@aquera/nile-elements 0.1.58 → 0.1.59-beta-1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/demo/index.html +150 -33
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1420 -654
- package/dist/internal/form.cjs.js +1 -1
- package/dist/internal/form.cjs.js.map +1 -1
- package/dist/internal/form.esm.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -17
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +8 -29
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +1 -1
- package/dist/nile-option/nile-option.esm.js +2 -2
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +2 -2
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.test.esm.js +2 -2
- package/dist/nile-select/virtual-scroll-helper.cjs.js +2 -0
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -0
- package/dist/nile-select/virtual-scroll-helper.esm.js +38 -0
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +2 -0
- package/dist/nile-virtual-select/index.cjs.js.map +1 -0
- package/dist/nile-virtual-select/index.esm.js +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +477 -0
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +227 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +93 -0
- package/dist/nile-virtual-select/renderer.cjs.js +2 -0
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -0
- package/dist/nile-virtual-select/renderer.esm.js +28 -0
- package/dist/nile-virtual-select/search-manager.cjs.js +2 -0
- package/dist/nile-virtual-select/search-manager.cjs.js.map +1 -0
- package/dist/nile-virtual-select/search-manager.esm.js +1 -0
- package/dist/nile-virtual-select/selection-manager.cjs.js +2 -0
- package/dist/nile-virtual-select/selection-manager.cjs.js.map +1 -0
- package/dist/nile-virtual-select/selection-manager.esm.js +1 -0
- package/dist/nile-virtual-select/types.cjs.js +2 -0
- package/dist/nile-virtual-select/types.cjs.js.map +1 -0
- package/dist/nile-virtual-select/types.esm.js +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/form.js +2 -2
- package/dist/src/internal/form.js.map +1 -1
- package/dist/src/nile-option/nile-option.css.js +1 -1
- package/dist/src/nile-option/nile-option.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +5 -1
- package/dist/src/nile-option/nile-option.js +21 -6
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +11 -2
- package/dist/src/nile-select/nile-select.js +37 -18
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-select/virtual-scroll-helper.d.ts +9 -0
- package/dist/src/nile-select/virtual-scroll-helper.js +51 -0
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -0
- package/dist/src/nile-virtual-select/index.d.ts +1 -0
- package/dist/src/nile-virtual-select/index.js +2 -0
- package/dist/src/nile-virtual-select/index.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +12 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +489 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +266 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.js +1226 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +7 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +631 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -0
- package/dist/src/nile-virtual-select/renderer.d.ts +16 -0
- package/dist/src/nile-virtual-select/renderer.js +72 -0
- package/dist/src/nile-virtual-select/renderer.js.map +1 -0
- package/dist/src/nile-virtual-select/search-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select/search-manager.js +40 -0
- package/dist/src/nile-virtual-select/search-manager.js.map +1 -0
- package/dist/src/nile-virtual-select/selection-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select/selection-manager.js +64 -0
- package/dist/src/nile-virtual-select/selection-manager.js.map +1 -0
- package/dist/src/nile-virtual-select/types.d.ts +50 -0
- package/dist/src/nile-virtual-select/types.js +8 -0
- package/dist/src/nile-virtual-select/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/virtualize-a4a40d96.esm.js +22 -0
- package/dist/virtualize-b6a2fbe0.cjs.js +18 -0
- package/dist/virtualize-b6a2fbe0.cjs.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +3 -1
- package/src/internal/form.ts +2 -2
- package/src/nile-option/nile-option.css.ts +1 -1
- package/src/nile-option/nile-option.ts +17 -3
- package/src/nile-select/nile-select.ts +35 -9
- package/src/nile-select/virtual-scroll-helper.ts +56 -0
- package/src/nile-virtual-select/index.ts +1 -0
- package/src/nile-virtual-select/nile-virtual-select.css.ts +491 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +774 -0
- package/src/nile-virtual-select/nile-virtual-select.ts +1314 -0
- package/src/nile-virtual-select/renderer.ts +100 -0
- package/src/nile-virtual-select/search-manager.ts +50 -0
- package/src/nile-virtual-select/selection-manager.ts +75 -0
- package/src/nile-virtual-select/types.ts +54 -0
- package/vscode-html-custom-data.json +229 -2
@@ -33,8 +33,11 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
33
33
|
import type { NileFormControl } from '../internal/nile-element';
|
34
34
|
import type NileOption from '../nile-option/nile-option';
|
35
35
|
import type NilePopup from '../nile-popup/nile-popup';
|
36
|
+
import type { RenderItemConfig } from '../nile-virtual-select/types.js';
|
36
37
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
37
38
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
39
|
+
import '../nile-virtual-select/nile-virtual-select';
|
40
|
+
import { VirtualScrollHelper } from './virtual-scroll-helper';
|
38
41
|
|
39
42
|
type NileRemoveEvent = CustomEvent<Record<PropertyKey, never>>;
|
40
43
|
|
@@ -53,6 +56,7 @@ type NileRemoveEvent = CustomEvent<Record<PropertyKey, never>>;
|
|
53
56
|
* @dependency nile-icon
|
54
57
|
* @dependency nile-popup
|
55
58
|
* @dependency nile-tag
|
59
|
+
* @dependency nile-virtual-select
|
56
60
|
*
|
57
61
|
* @slot - The listbox options. Must be `<nile-option>` elements. You can use `<nile-divider>` to group items visually.
|
58
62
|
* @slot label - The input's label. Alternatively, you can use the `label` attribute.
|
@@ -91,14 +95,15 @@ type NileRemoveEvent = CustomEvent<Record<PropertyKey, never>>;
|
|
91
95
|
*/
|
92
96
|
|
93
97
|
@customElement('nile-select')
|
94
|
-
export class NileSelect extends NileElement implements NileFormControl
|
98
|
+
export class NileSelect extends NileElement implements NileFormControl{
|
95
99
|
static styles: CSSResultGroup = styles;
|
96
100
|
|
97
101
|
// protected override BUBBLES=false;
|
98
102
|
|
99
|
-
private
|
100
|
-
|
101
|
-
|
103
|
+
private formControlController: FormControlController | null;
|
104
|
+
private virtualScrollHelper!: VirtualScrollHelper;
|
105
|
+
|
106
|
+
|
102
107
|
private readonly hasSlotController = new HasSlotController(
|
103
108
|
this,
|
104
109
|
'help-text',
|
@@ -232,6 +237,13 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
232
237
|
|
233
238
|
@property({ type: String }) noResultsMessage: string = 'No results found';
|
234
239
|
|
240
|
+
/** Enhanced configuration for rendering items with support for display text, value, and search text */
|
241
|
+
@property({ attribute: false }) renderItemConfig?: RenderItemConfig;
|
242
|
+
|
243
|
+
@property({ type: Array }) data: any = [];
|
244
|
+
|
245
|
+
@property({ type: Boolean }) enableVirtualScroll = false;
|
246
|
+
|
235
247
|
/** Gets the validity state object */
|
236
248
|
get validity() {
|
237
249
|
return this.valueInput?.validity;
|
@@ -242,8 +254,18 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
242
254
|
return this.valueInput?.validationMessage;
|
243
255
|
}
|
244
256
|
|
257
|
+
constructor() {
|
258
|
+
super();
|
259
|
+
}
|
260
|
+
|
245
261
|
connectedCallback() {
|
246
262
|
super.connectedCallback();
|
263
|
+
if(!this.enableVirtualScroll) {
|
264
|
+
this.formControlController = new FormControlController(this, {
|
265
|
+
assumeInteractionOn: ['nile-blur', 'nile-input'],
|
266
|
+
});
|
267
|
+
}
|
268
|
+
this.virtualScrollHelper = new VirtualScrollHelper(this);
|
247
269
|
this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
|
248
270
|
this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
|
249
271
|
this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
@@ -747,7 +769,7 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
747
769
|
|
748
770
|
// Update validity
|
749
771
|
this.updateComplete.then(() => {
|
750
|
-
this.formControlController
|
772
|
+
this.formControlController?.updateValidity();
|
751
773
|
});
|
752
774
|
|
753
775
|
this.calculateTotalWidthOfTags();
|
@@ -798,8 +820,8 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
798
820
|
}
|
799
821
|
|
800
822
|
private handleInvalid(event: Event) {
|
801
|
-
this.formControlController
|
802
|
-
this.formControlController
|
823
|
+
this.formControlController?.setValidity(false);
|
824
|
+
this.formControlController?.emitInvalidEvent(event);
|
803
825
|
}
|
804
826
|
|
805
827
|
@watch('disabled', { waitUntilFirstUpdate: true })
|
@@ -902,7 +924,7 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
902
924
|
|
903
925
|
/** Gets the associated form, if one exists. */
|
904
926
|
getForm(): HTMLFormElement | null {
|
905
|
-
return this.formControlController
|
927
|
+
return this.formControlController?.getForm() || null;
|
906
928
|
}
|
907
929
|
|
908
930
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
@@ -913,7 +935,7 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
913
935
|
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
914
936
|
setCustomValidity(message: string) {
|
915
937
|
this.valueInput.setCustomValidity(message);
|
916
|
-
this.formControlController
|
938
|
+
this.formControlController?.updateValidity();
|
917
939
|
}
|
918
940
|
|
919
941
|
/** Sets focus on the control. */
|
@@ -986,6 +1008,10 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
986
1008
|
}
|
987
1009
|
|
988
1010
|
render() {
|
1011
|
+
if(this.enableVirtualScroll) {
|
1012
|
+
return this.virtualScrollHelper.renderVirtualizedContent();
|
1013
|
+
}
|
1014
|
+
|
989
1015
|
const hasLabelSlot = this.hasSlotController.test('label');
|
990
1016
|
const hasHelpTextSlot = this.hasSlotController.test('help-text');
|
991
1017
|
const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import { html } from 'lit';
|
2
|
+
import type NileElement from '../internal/nile-element';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Helper class to manage virtual scroll functionality for nile-select component
|
6
|
+
*/
|
7
|
+
export class VirtualScrollHelper {
|
8
|
+
private component: NileElement;
|
9
|
+
|
10
|
+
constructor(component: NileElement) {
|
11
|
+
this.component = component;
|
12
|
+
}
|
13
|
+
|
14
|
+
renderVirtualizedContent(): any {
|
15
|
+
const component = this.component as any;
|
16
|
+
|
17
|
+
return html`
|
18
|
+
<div class="virtual-select">
|
19
|
+
<nile-virtual-select
|
20
|
+
.name=${component.name}
|
21
|
+
.value=${component.value}
|
22
|
+
.placeholder=${component.placeholder}
|
23
|
+
.size=${component.size}
|
24
|
+
.searchEnabled=${component.searchEnabled}
|
25
|
+
.internalSearchPlaceHolder=${component.internalSearchPlaceHolder}
|
26
|
+
.disableLocalSearch=${component.disableLocalSearch}
|
27
|
+
.optionsLoading=${component.optionsLoading}
|
28
|
+
.multiple=${component.multiple}
|
29
|
+
.helpText=${component.helpText}
|
30
|
+
.errorMessage=${component.errorMessage}
|
31
|
+
.warning=${component.warning}
|
32
|
+
.error=${component.error}
|
33
|
+
.success=${component.success}
|
34
|
+
.disabled=${component.disabled}
|
35
|
+
.clearable=${component.clearable}
|
36
|
+
.hoist=${component.hoist}
|
37
|
+
.filled=${component.filled}
|
38
|
+
.pill=${component.pill}
|
39
|
+
.label=${component.label}
|
40
|
+
.placement=${component.placement}
|
41
|
+
.form=${component.form}
|
42
|
+
.required=${component.required}
|
43
|
+
.showNoResults=${component.showNoResults}
|
44
|
+
.noResultsMessage=${component.noResultsMessage}
|
45
|
+
.renderItemConfig=${component.renderItemConfig}
|
46
|
+
.blockValueChange=${component.blockValueChange}
|
47
|
+
.noWidthSync=${component.noWidthSync}
|
48
|
+
.maxOptionsVisible=${component.maxOptionsVisible}
|
49
|
+
.data=${component.data}
|
50
|
+
>
|
51
|
+
<slot name="prefix" slot="prefix"></slot>
|
52
|
+
</nile-virtual-select>
|
53
|
+
</div>
|
54
|
+
`;
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileVirtualSelect } from './nile-virtual-select';
|
@@ -0,0 +1,491 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2025
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {css} from 'lit';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Select_2 CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
box-sizing: border-box;
|
16
|
+
}
|
17
|
+
|
18
|
+
.virtualized{
|
19
|
+
min-width: 110px;
|
20
|
+
width: 100%;
|
21
|
+
}
|
22
|
+
|
23
|
+
.virtualized ::slotted(nile-option),
|
24
|
+
.virtualized nile-option {
|
25
|
+
width: 100%;
|
26
|
+
display: block;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* Ensure proper sizing for non-virtualized options (small datasets) */
|
30
|
+
.virtualized:not(:has(lit-virtualizer)) {
|
31
|
+
display: flex;
|
32
|
+
flex-direction: column;
|
33
|
+
}
|
34
|
+
|
35
|
+
.virtualized:not(:has(lit-virtualizer)) nile-option {
|
36
|
+
flex-shrink: 0;
|
37
|
+
}
|
38
|
+
|
39
|
+
:host *,
|
40
|
+
:host *::before,
|
41
|
+
:host *::after {
|
42
|
+
box-sizing: inherit;
|
43
|
+
}
|
44
|
+
|
45
|
+
[hidden] {
|
46
|
+
display: none !important;
|
47
|
+
}
|
48
|
+
|
49
|
+
.form-control .form-control__label {
|
50
|
+
display: none;
|
51
|
+
}
|
52
|
+
|
53
|
+
.form-control .form-control__help-text {
|
54
|
+
display: none;
|
55
|
+
}
|
56
|
+
|
57
|
+
/* Label */
|
58
|
+
.form-control--has-label .form-control__label {
|
59
|
+
display: block;
|
60
|
+
margin-bottom: 6px;
|
61
|
+
color: var(--nile-colors-dark-900);
|
62
|
+
font-family: Colfax-regular;
|
63
|
+
font-size: 14px;
|
64
|
+
font-style: normal;
|
65
|
+
font-weight: 400;
|
66
|
+
line-height: 20px;
|
67
|
+
letter-spacing: 0.2px;
|
68
|
+
}
|
69
|
+
|
70
|
+
.form-control--has-label.form-control--medium .form-control__label {
|
71
|
+
font-size: 14px;
|
72
|
+
}
|
73
|
+
|
74
|
+
:host([required]) .form-control--has-label .form-control__label::after {
|
75
|
+
content: '*';
|
76
|
+
margin-inline-start: -2px;
|
77
|
+
color: var(--nile-colors-red-700);
|
78
|
+
}
|
79
|
+
|
80
|
+
/* Help text */
|
81
|
+
.form-control--has-help-text .form-control__help-text {
|
82
|
+
display: block;
|
83
|
+
color: var(--nile-colors-dark-500);
|
84
|
+
margin-top: 0.75rem;
|
85
|
+
}
|
86
|
+
|
87
|
+
.form-control--has-help-text.form-control--medium .form-control__help-text {
|
88
|
+
font-size: 0.875rem;
|
89
|
+
}
|
90
|
+
|
91
|
+
.form-control--has-help-text.form-control--radio-group
|
92
|
+
.form-control__help-text {
|
93
|
+
margin-top: 0.25rem;
|
94
|
+
}
|
95
|
+
|
96
|
+
:host {
|
97
|
+
display: block;
|
98
|
+
}
|
99
|
+
|
100
|
+
/** The popup */
|
101
|
+
.select {
|
102
|
+
flex: 1 1 auto;
|
103
|
+
display: inline-flex;
|
104
|
+
width: 100%;
|
105
|
+
position: relative;
|
106
|
+
vertical-align: middle;
|
107
|
+
}
|
108
|
+
|
109
|
+
.select::part(popup) {
|
110
|
+
z-index: 9999;
|
111
|
+
}
|
112
|
+
|
113
|
+
.select[data-current-placement^='top']::part(popup) {
|
114
|
+
transform-origin: bottom;
|
115
|
+
}
|
116
|
+
|
117
|
+
.select[data-current-placement^='bottom']::part(popup) {
|
118
|
+
transform-origin: top;
|
119
|
+
}
|
120
|
+
|
121
|
+
/* Combobox */
|
122
|
+
.select__combobox {
|
123
|
+
flex: 1;
|
124
|
+
display: flex;
|
125
|
+
width: 100%;
|
126
|
+
min-width: 0;
|
127
|
+
position: relative;
|
128
|
+
align-items: center;
|
129
|
+
justify-content: start;
|
130
|
+
font-family: var(--nile-font-family-sans-serif);
|
131
|
+
font-weight: 400;
|
132
|
+
letter-spacing: normal;
|
133
|
+
vertical-align: middle;
|
134
|
+
overflow: hidden;
|
135
|
+
cursor: pointer;
|
136
|
+
transition: 150ms color, 150ms border, 150ms box-shadow,
|
137
|
+
150ms background-color;
|
138
|
+
}
|
139
|
+
|
140
|
+
.select__display-input {
|
141
|
+
position: relative;
|
142
|
+
width: 100%;
|
143
|
+
font: inherit;
|
144
|
+
border: none;
|
145
|
+
background: none;
|
146
|
+
color: var(--nile-colors-dark-900);
|
147
|
+
cursor: inherit;
|
148
|
+
overflow: hidden;
|
149
|
+
padding: 0;
|
150
|
+
margin: 0;
|
151
|
+
-webkit-appearance: none;
|
152
|
+
font-family: var(--nile-font-family-serif);
|
153
|
+
}
|
154
|
+
|
155
|
+
.select__display-input::placeholder {
|
156
|
+
font-family: var(--nile-font-family-serif);
|
157
|
+
}
|
158
|
+
|
159
|
+
.select:not(.select--disabled):hover .select__display-input {
|
160
|
+
color: var(--nile-colors-dark-900);
|
161
|
+
}
|
162
|
+
|
163
|
+
.select__display-input:focus {
|
164
|
+
outline: none;
|
165
|
+
}
|
166
|
+
|
167
|
+
/* Visually hide the display input when multiple is enabled */
|
168
|
+
.select--multiple:not(.select--placeholder-visible) .select__display-input {
|
169
|
+
position: absolute;
|
170
|
+
z-index: -1;
|
171
|
+
top: 0;
|
172
|
+
left: 0;
|
173
|
+
width: 100%;
|
174
|
+
height: 100%;
|
175
|
+
opacity: 0;
|
176
|
+
}
|
177
|
+
|
178
|
+
.select__value-input {
|
179
|
+
position: absolute;
|
180
|
+
top: 0;
|
181
|
+
left: 0;
|
182
|
+
width: 100%;
|
183
|
+
height: 100%;
|
184
|
+
padding: 0;
|
185
|
+
margin: 0;
|
186
|
+
opacity: 0;
|
187
|
+
z-index: -1;
|
188
|
+
}
|
189
|
+
|
190
|
+
.select__tags {
|
191
|
+
display: flex;
|
192
|
+
flex: 1;
|
193
|
+
align-items: center;
|
194
|
+
flex-wrap: no-wrap;
|
195
|
+
margin-inline-start: 0.5rem;
|
196
|
+
width: 100%;
|
197
|
+
overflow: hidden;
|
198
|
+
}
|
199
|
+
|
200
|
+
.select__tags-count {
|
201
|
+
color: var(--nile-colors-primary-600);
|
202
|
+
font-family: Colfax-regular;
|
203
|
+
font-size: 14px;
|
204
|
+
font-style: normal;
|
205
|
+
font-weight: 400;
|
206
|
+
line-height: 14px;
|
207
|
+
letter-spacing: 0.2px;
|
208
|
+
margin: 6px;
|
209
|
+
}
|
210
|
+
|
211
|
+
.select__tags-count-clearable {
|
212
|
+
margin-right: 50px;
|
213
|
+
}
|
214
|
+
|
215
|
+
.select__tags::slotted(nile-tag) {
|
216
|
+
cursor: pointer !important;
|
217
|
+
}
|
218
|
+
|
219
|
+
.select--disabled .select__tags,
|
220
|
+
.select--disabled .select__tags::slotted(nile-tag) {
|
221
|
+
cursor: not-allowed !important;
|
222
|
+
}
|
223
|
+
|
224
|
+
/* Standard selects */
|
225
|
+
.select--standard .select__combobox {
|
226
|
+
background-color: var(--nile-colors-white-base);
|
227
|
+
border: solid 1px var(--nile-colors-neutral-500);
|
228
|
+
}
|
229
|
+
|
230
|
+
.select--standard .select__combobox:hover {
|
231
|
+
border: 1px solid var(--nile-colors-dark-900);
|
232
|
+
background: var(--nile-colors-white-base);
|
233
|
+
}
|
234
|
+
|
235
|
+
.select--standard.select--disabled .select__combobox {
|
236
|
+
background-color: var(--nile-colors-neutral-100);
|
237
|
+
border-color: var(--nile-colors-neutral-500);
|
238
|
+
color: var(--nile-colors-dark-500);
|
239
|
+
opacity: 0.5;
|
240
|
+
cursor: not-allowed;
|
241
|
+
outline: none;
|
242
|
+
}
|
243
|
+
|
244
|
+
.select--standard:not(.select--disabled).select--open .select__combobox,
|
245
|
+
.select--standard:not(.select--disabled).select--focused .select__combobox {
|
246
|
+
background-color: var(--nile-colors-neutral-100);
|
247
|
+
}
|
248
|
+
|
249
|
+
.select--warning .select__combobox {
|
250
|
+
border-color: var(--nile-colors-yellow-500);
|
251
|
+
}
|
252
|
+
|
253
|
+
.select--error .select__combobox {
|
254
|
+
border-color: var(--nile-colors-red-500);
|
255
|
+
}
|
256
|
+
|
257
|
+
.select--success {
|
258
|
+
border-color: var(--nile-colors-green-500);
|
259
|
+
}
|
260
|
+
|
261
|
+
/* Filled selects */
|
262
|
+
.select--filled .select__combobox {
|
263
|
+
border: none;
|
264
|
+
background-color: var(--nile-colors-neutral-100);
|
265
|
+
color: var(--nile-colors-dark-900);
|
266
|
+
}
|
267
|
+
|
268
|
+
.select--filled:hover:not(.select--disabled) .select__combobox {
|
269
|
+
background-color: var(--nile-colors-neutral-100);
|
270
|
+
}
|
271
|
+
|
272
|
+
.select--filled.select--disabled .select__combobox {
|
273
|
+
background-color: var(--nile-colors-neutral-100);
|
274
|
+
opacity: 0.5;
|
275
|
+
cursor: not-allowed;
|
276
|
+
}
|
277
|
+
|
278
|
+
.select--filled:not(.select--disabled).select--open .select__combobox,
|
279
|
+
.select--filled:not(.select--disabled).select--focused .select__combobox {
|
280
|
+
background-color: var(--nile-colors-neutral-100);
|
281
|
+
outline: 3px solid rgba(0, 89, 255, 0.4);
|
282
|
+
}
|
283
|
+
|
284
|
+
.select--medium .select__combobox {
|
285
|
+
border-radius: 4px;
|
286
|
+
font-size: 14px;
|
287
|
+
padding: 12px;
|
288
|
+
height: 40px;
|
289
|
+
box-sizing: border-box;
|
290
|
+
}
|
291
|
+
|
292
|
+
.select--medium .select__clear {
|
293
|
+
margin-inline-start: 0.75rem;
|
294
|
+
}
|
295
|
+
|
296
|
+
.select--medium .select__prefix::slotted(*) {
|
297
|
+
margin-inline-end: 0.75rem;
|
298
|
+
}
|
299
|
+
|
300
|
+
.select--medium .select__prefix.multiple::slotted(*) {
|
301
|
+
margin-inline-start: 0.75rem;
|
302
|
+
}
|
303
|
+
|
304
|
+
.select--medium.select--multiple:not(.select--placeholder-visible)
|
305
|
+
.select__combobox {
|
306
|
+
padding-inline-start: 0;
|
307
|
+
}
|
308
|
+
|
309
|
+
.select--medium .select__tags {
|
310
|
+
gap: 3px;
|
311
|
+
}
|
312
|
+
|
313
|
+
/* Pills */
|
314
|
+
.select--pill.select--medium .select__combobox {
|
315
|
+
border-radius: 2.5rem;
|
316
|
+
}
|
317
|
+
|
318
|
+
/* Prefix */
|
319
|
+
.select__prefix {
|
320
|
+
flex: 0;
|
321
|
+
display: inline-flex;
|
322
|
+
align-items: center;
|
323
|
+
color: var(--nile-colors-dark-500);
|
324
|
+
}
|
325
|
+
|
326
|
+
.select__suffix {
|
327
|
+
flex: 0;
|
328
|
+
display: inline-flex;
|
329
|
+
align-items: center;
|
330
|
+
color: var(--nile-colors-dark-500);
|
331
|
+
}
|
332
|
+
|
333
|
+
/* Clear button */
|
334
|
+
.select__clear {
|
335
|
+
display: inline-flex;
|
336
|
+
align-items: center;
|
337
|
+
justify-content: center;
|
338
|
+
font-size: inherit;
|
339
|
+
color: var(--nile-colors-primary-600);
|
340
|
+
border: none;
|
341
|
+
background: none;
|
342
|
+
padding: 0;
|
343
|
+
transition: 150ms color;
|
344
|
+
cursor: pointer;
|
345
|
+
}
|
346
|
+
|
347
|
+
.select__clear:hover {
|
348
|
+
color: var(--nile-colors-dark-500);
|
349
|
+
}
|
350
|
+
|
351
|
+
.select__clear:focus {
|
352
|
+
outline: none;
|
353
|
+
}
|
354
|
+
|
355
|
+
/* Expand icon */
|
356
|
+
.select__expand-icon {
|
357
|
+
flex: 0 0 auto;
|
358
|
+
display: flex;
|
359
|
+
align-items: center;
|
360
|
+
transition: 250ms rotate ease;
|
361
|
+
rotate: 0;
|
362
|
+
margin-inline-start: 0.25rem;
|
363
|
+
}
|
364
|
+
|
365
|
+
.select--open .select__expand-icon {
|
366
|
+
rotate: -180deg;
|
367
|
+
}
|
368
|
+
|
369
|
+
/* Listbox */
|
370
|
+
.select__listbox {
|
371
|
+
display: block;
|
372
|
+
position: relative;
|
373
|
+
font-size: 1rem;
|
374
|
+
font-weight: 400;
|
375
|
+
background: var(--nile-colors-white-base);
|
376
|
+
border: solid 1px var(--nile-colors-neutral-500);
|
377
|
+
border-radius: 0.25rem;
|
378
|
+
padding-block: 0;
|
379
|
+
padding-inline: 0;
|
380
|
+
overflow: auto;
|
381
|
+
overscroll-behavior: none;
|
382
|
+
/* Make sure it adheres to the popup's auto size */
|
383
|
+
max-width: var(--auto-size-available-width);
|
384
|
+
max-height: var(--auto-size-available-height);
|
385
|
+
}
|
386
|
+
|
387
|
+
.select__options {
|
388
|
+
font-size: 14px;
|
389
|
+
color: rgb(133, 129, 129);
|
390
|
+
width: 100%;
|
391
|
+
}
|
392
|
+
|
393
|
+
.select__options__search-enabled {
|
394
|
+
padding-top: 10px;
|
395
|
+
width: 100%;
|
396
|
+
}
|
397
|
+
|
398
|
+
.select__listbox::slotted(nile-divider) {
|
399
|
+
--spacing: 0.25rem;
|
400
|
+
}
|
401
|
+
|
402
|
+
.select__listbox::slotted(small) {
|
403
|
+
font-size: 0.875rem;
|
404
|
+
font-weight: 600;
|
405
|
+
color: var(--nile-colors-dark-500);
|
406
|
+
padding-block: 0.25rem;
|
407
|
+
padding-inline: 1rem;
|
408
|
+
}
|
409
|
+
|
410
|
+
.select__search {
|
411
|
+
position: sticky;
|
412
|
+
top: 0px;
|
413
|
+
z-index: 1;
|
414
|
+
width: calc(100% - 16px);
|
415
|
+
padding: 8px;
|
416
|
+
background-color: white;
|
417
|
+
margin-bottom: -8px;
|
418
|
+
}
|
419
|
+
|
420
|
+
.select__footer {
|
421
|
+
position: sticky;
|
422
|
+
bottom: 0px;
|
423
|
+
background: var(--nile-colors-neutral-100);
|
424
|
+
border: 1px solid var(--nile-colors-neutral-400);
|
425
|
+
display: flex;
|
426
|
+
height: 15px;
|
427
|
+
/* Auto layout */
|
428
|
+
display: flex;
|
429
|
+
flex-direction: row;
|
430
|
+
align-items: flex-start;
|
431
|
+
padding: 8px 12px 16px;
|
432
|
+
gap: 12px;
|
433
|
+
justify-content: space-between;
|
434
|
+
}
|
435
|
+
|
436
|
+
.tag__prefix[slot='prefix'] {
|
437
|
+
height: 14px;
|
438
|
+
display: inline-block;
|
439
|
+
overflow: hidden;
|
440
|
+
}
|
441
|
+
|
442
|
+
.tag__prefix[slot='prefix'] img {
|
443
|
+
max-height: 100%;
|
444
|
+
}
|
445
|
+
|
446
|
+
.select__loader {
|
447
|
+
width: 100%;
|
448
|
+
text-align: center;
|
449
|
+
display: block;
|
450
|
+
}
|
451
|
+
|
452
|
+
.select__loader--icon {
|
453
|
+
margin-top: 20px;
|
454
|
+
animation: spin 0.6s linear infinite;
|
455
|
+
}
|
456
|
+
|
457
|
+
.select__no-results {
|
458
|
+
padding: 10px;
|
459
|
+
}
|
460
|
+
|
461
|
+
@keyframes spin {
|
462
|
+
0% {
|
463
|
+
transform: rotate(0deg);
|
464
|
+
}
|
465
|
+
100% {
|
466
|
+
transform: rotate(360deg);
|
467
|
+
}
|
468
|
+
}
|
469
|
+
|
470
|
+
.select__invisible{
|
471
|
+
opacity: 0;
|
472
|
+
}
|
473
|
+
|
474
|
+
.select__prefix--from-options {
|
475
|
+
margin-inline-end: 12px;
|
476
|
+
}
|
477
|
+
|
478
|
+
.select__hide-default{
|
479
|
+
display: none;
|
480
|
+
}
|
481
|
+
|
482
|
+
.virtualized nile-option[selected] {
|
483
|
+
background-color: var(--nile-colors-neutral-100);
|
484
|
+
}
|
485
|
+
|
486
|
+
.virtualized nile-option[selected]::part(base) {
|
487
|
+
color: var(--nile-colors-primary-600);
|
488
|
+
}
|
489
|
+
`;
|
490
|
+
|
491
|
+
export default [styles];
|