Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select placeholder #1842

Merged
merged 55 commits into from
Mar 5, 2024
Merged
Changes from 21 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
30c8250
Iniital implementation
atmgrifter00 Feb 20, 2024
1af86a8
Minor change
atmgrifter00 Feb 20, 2024
9441431
Mark placeholderVisible API as internal
atmgrifter00 Feb 20, 2024
ca12dc4
Newline
atmgrifter00 Feb 20, 2024
ab7f2f6
Remove unneeded storybook change.
atmgrifter00 Feb 20, 2024
1be9868
Fix escape behavior with placeholder
atmgrifter00 Feb 20, 2024
1c62453
Revert some changes
atmgrifter00 Feb 20, 2024
52a4a7a
Add a comment
atmgrifter00 Feb 20, 2024
4598108
Prettier
atmgrifter00 Feb 20, 2024
af6fd1b
Select placeholder re-work with tests.
atmgrifter00 Feb 23, 2024
b858136
Change files
atmgrifter00 Feb 23, 2024
3ba52a6
Allow changing placeholder option.
atmgrifter00 Feb 26, 2024
69ffb06
Merge branch 'main' into select-placeholder
atmgrifter00 Feb 26, 2024
cfde826
Docs and minor updates.
atmgrifter00 Feb 26, 2024
fd12e2f
Merge branch 'select-placeholder' of https://github.com/ni/nimble int…
atmgrifter00 Feb 26, 2024
1d33027
Slight re-factor.
atmgrifter00 Feb 27, 2024
0681812
Add PageObject method and test.
atmgrifter00 Feb 27, 2024
d2d92ef
Slight code-reorg.
atmgrifter00 Feb 27, 2024
ee6ffd4
Fix matrix test.
atmgrifter00 Feb 27, 2024
c4e47b8
Revert a change.
atmgrifter00 Feb 27, 2024
501f6fe
Merge branch 'main' into select-placeholder
atmgrifter00 Feb 27, 2024
938ad6f
Update packages/nimble-components/src/select/tests/select.stories.ts
atmgrifter00 Feb 28, 2024
d8ee8cd
Update packages/nimble-components/src/select/tests/select.stories.ts
atmgrifter00 Feb 28, 2024
5ca54b1
Handle PR feedback.
atmgrifter00 Feb 28, 2024
b09b8a5
Merge branch 'select-placeholder' of https://github.com/ni/nimble int…
atmgrifter00 Feb 28, 2024
4640d41
Prettier
atmgrifter00 Feb 28, 2024
c6dfd60
Merge branch 'main' into select-placeholder
atmgrifter00 Feb 28, 2024
aedd65e
Add comments
atmgrifter00 Feb 28, 2024
cce5ae7
Merge branch 'main' into select-placeholder
atmgrifter00 Feb 28, 2024
1584fc5
Merge branch 'main' into select-placeholder
atmgrifter00 Feb 28, 2024
7e5ec79
Fix test
atmgrifter00 Feb 28, 2024
0a89d27
Merge branch 'select-placeholder' of https://github.com/ni/nimble int…
atmgrifter00 Feb 28, 2024
a50f8c6
Add pageObject public method.
atmgrifter00 Feb 28, 2024
3ae5ba0
Make pageObject API non-async
atmgrifter00 Feb 28, 2024
b15b452
Make new API click-based.
atmgrifter00 Feb 28, 2024
e5063d5
Slight pageObject update.
atmgrifter00 Feb 29, 2024
0d434b7
Merge branch 'main' into select-placeholder
atmgrifter00 Feb 29, 2024
0543d0b
Another pageObject change.
atmgrifter00 Feb 29, 2024
cfd26ff
Remove fdescribe
atmgrifter00 Feb 29, 2024
088dafd
Allow pageObject.clickOption to work without being open.
atmgrifter00 Feb 29, 2024
5d93db9
Update packages/nimble-components/src/select/testing/select.pageobjec…
atmgrifter00 Mar 4, 2024
3a41432
Update packages/nimble-components/src/select/index.ts
atmgrifter00 Mar 4, 2024
a9a33f5
Handle PR feedback.
atmgrifter00 Mar 4, 2024
b995b50
Merge branch 'select-placeholder' of https://github.com/ni/nimble int…
atmgrifter00 Mar 4, 2024
92fd495
Merge branch 'main' into select-placeholder
atmgrifter00 Mar 4, 2024
bd7ba33
Update packages/nimble-components/src/select/styles.ts
atmgrifter00 Mar 5, 2024
40d036f
Update packages/nimble-components/src/select/template.ts
atmgrifter00 Mar 5, 2024
b0b5b25
Merge branch 'select-placeholder' of https://github.com/ni/nimble int…
atmgrifter00 Mar 5, 2024
5054609
Revert an update.
atmgrifter00 Mar 5, 2024
13b9f94
Handle PR feedback.
atmgrifter00 Mar 5, 2024
582ee06
Fix build issue.
atmgrifter00 Mar 5, 2024
d8ae92a
Merge branch 'main' into select-placeholder
atmgrifter00 Mar 5, 2024
432a16a
Merge branch 'main' into select-placeholder
atmgrifter00 Mar 5, 2024
a540f66
Add test.
atmgrifter00 Mar 5, 2024
cb104d9
Merge branch 'select-placeholder' of https://github.com/ni/nimble int…
atmgrifter00 Mar 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Adding placeholder behavior for Select",
"packageName": "@ni/nimble-components",
"email": "26874831+atmgrifter00@users.noreply.github.com",
"dependentChangeType": "patch"
}
13 changes: 12 additions & 1 deletion packages/nimble-components/src/list-option/index.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import {
DesignSystem,
ListboxOption as FoundationListboxOption
} from '@microsoft/fast-foundation';
import { observable } from '@microsoft/fast-element';
import { observable, attr } from '@microsoft/fast-element';
import { styles } from './styles';
import { template } from './template';

@@ -19,6 +19,17 @@ export class ListOption extends FoundationListboxOption {
/** @internal */
public contentSlot!: HTMLSlotElement;

/**
* The hidden state of the element.
*
* @public
* @defaultValue - false
* @remarks
* HTML Attribute: hidden
*/
@attr({ mode: 'boolean' })
public override hidden = false;

/** @internal */
@observable
public hasOverflow = false;
26 changes: 15 additions & 11 deletions packages/nimble-components/src/list-option/styles.ts
Original file line number Diff line number Diff line change
@@ -22,17 +22,6 @@ export const styles = css`
height: ${controlHeight};
}

[part='start'] {
display: none;
}

.content {
padding: 8px 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

:host([aria-selected='true']) {
box-shadow: none;
outline: none;
@@ -69,6 +58,21 @@ export const styles = css`
cursor: default;
}

:host(.hidden-option) {
display: none;
}

[part='start'] {
display: none;
}

.content {
padding: 8px 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.content[disabled] {
box-shadow: none;
outline: none;
Loading
Loading