@aquera/nile-elements 0.1.22 → 0.1.23

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.
Files changed (43) hide show
  1. package/README.md +6 -0
  2. package/dist/flow-8340c041.esm.js +16 -0
  3. package/dist/flow-d0fa8803.cjs.js +14 -0
  4. package/dist/flow-d0fa8803.cjs.js.map +1 -0
  5. package/dist/index.cjs.js +1 -1
  6. package/dist/index.esm.js +1 -1
  7. package/dist/nile-auto-complete/index.cjs.js +1 -1
  8. package/dist/nile-auto-complete/index.esm.js +1 -1
  9. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +25 -1
  10. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  11. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  12. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  13. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +11 -2
  14. package/dist/nile-auto-complete/nile-auto-complete.esm.js +50 -10
  15. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  16. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
  17. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +5 -5
  18. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  19. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  20. package/dist/nile-chip/nile-chip.esm.js +3 -2
  21. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  22. package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
  23. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  24. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  25. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  26. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +7 -2
  27. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +9 -0
  28. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  29. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +5 -0
  30. package/dist/src/nile-auto-complete/nile-auto-complete.js +32 -11
  31. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  32. package/dist/src/nile-chip/nile-chip.d.ts +2 -0
  33. package/dist/src/nile-chip/nile-chip.js +7 -1
  34. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  35. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +5 -0
  36. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +3 -2
  39. package/src/nile-auto-complete/nile-auto-complete.css.ts +9 -0
  40. package/src/nile-auto-complete/nile-auto-complete.ts +33 -13
  41. package/src/nile-chip/nile-chip.ts +6 -1
  42. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +5 -0
  43. package/vscode-html-custom-data.json +12 -2
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.1.22",
6
+ "version": "0.1.23",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -117,7 +117,8 @@
117
117
  "@codemirror/lang-javascript": "6.2.1",
118
118
  "@codemirror/lang-sql": "6.7.0",
119
119
  "@codemirror/lang-json": "^6.0.1",
120
- "@codemirror/lang-html":"6.4.9",
120
+ "@codemirror/lang-html": "6.4.9",
121
+ "@lit-labs/virtualizer": "^2.0.15",
121
122
  "codemirror": "6.0.1",
122
123
  "chalk": "5.3.0",
123
124
  "figlet": "1.7.0",
@@ -12,12 +12,21 @@ import { css } from 'lit';
12
12
  */
13
13
  export const styles = css`
14
14
  :host {
15
+ --virtual-scroll-container-width:100px;
15
16
  }
16
17
 
17
18
  .nile-dropdown--input {
18
19
  width: 100%;
19
20
  }
20
21
 
22
+ .nile-dropdown--input lit-virtualizer{
23
+ min-width: var(--virtual-scroll-container-width)!important;
24
+ }
25
+
26
+ .nile-dropdown--input nile-menu-item{
27
+ width:100%;
28
+ }
29
+
21
30
  .nile-auto-complete--input {
22
31
  width: 100%;
23
32
  }
@@ -10,6 +10,7 @@ import { styles } from './nile-auto-complete.css';
10
10
  import NileElement from '../internal/nile-element';
11
11
  import type { CSSResultGroup, PropertyValues } from 'lit';
12
12
  import { NileDropdown } from '../nile-dropdown';
13
+ import '@lit-labs/virtualizer';
13
14
 
14
15
  // Define the custom element 'nile-auto-complete'
15
16
  @customElement('nile-auto-complete')
@@ -23,6 +24,8 @@ export class NileAutoComplete extends NileElement {
23
24
 
24
25
  @property({ type: Boolean }) isDropdownOpen: boolean = false;
25
26
 
27
+ @property({ type: Boolean }) enableVirtualScroll: boolean = false;
28
+
26
29
  @property({ type: Boolean }) openOnFocus: boolean = false;
27
30
 
28
31
  @property({ type: String }) value: string = '';
@@ -53,6 +56,7 @@ export class NileAutoComplete extends NileElement {
53
56
  }
54
57
 
55
58
  public render(): TemplateResult {
59
+ const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();
56
60
  return html`
57
61
  <nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick>
58
62
  <nile-input class="nile-auto-complete--input"
@@ -67,23 +71,39 @@ export class NileAutoComplete extends NileElement {
67
71
  ${this.loading?html`<nile-icon slot="suffix" color="var(--nile-colors-primary-600)" name="button-loading-blue-animated"></nile-icon>`:nothing}
68
72
  </nile-input>
69
73
  ${this.menuItems.length > 0 && !this.loading
70
- ? html`
71
- <nile-menu @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper">
72
- ${this.menuItems.map(
73
- (item: any) => {
74
- const renderItem=this.renderItemFunction(item)
75
- return html`
76
- <nile-menu-item value=${renderItem}>${renderItem}</nile-menu-item>
77
- `
78
- }
79
- )}
80
- </nile-menu>
81
- `
82
- : ''}
74
+ ? content
75
+ : nothing}
83
76
  </nile-dropdown>
84
77
  `;
85
78
  }
86
79
 
80
+ getVirtualizedContent():TemplateResult{
81
+ return html`
82
+ <nile-menu @nile-select=${this.handleSelect} id="content-menu" exportparts="menu__items-wrapper:options__wrapper">
83
+ <lit-virtualizer
84
+ .items=${this.menuItems}
85
+ .renderItem=${(item:any):TemplateResult=>this.getItemRenderFunction(item)}
86
+ ></lit-virtualizer>
87
+ </nile-menu>
88
+ `
89
+ }
90
+
91
+ getContent():TemplateResult{
92
+ return html`
93
+ <nile-menu id="content-menu" @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper">
94
+ ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}
95
+ </nile-menu>`
96
+ }
97
+
98
+ getItemRenderFunction(item:any):TemplateResult{
99
+ const value=this.renderItemFunction(item)
100
+ return html`
101
+ <nile-menu-item value=${value}>
102
+ ${value}
103
+ </nile-menu-item>
104
+ `;
105
+ }
106
+
87
107
  private handleSelect(event: CustomEvent) {
88
108
  this.value = event.detail.value;
89
109
  this.emit('nile-complete', { value: event.detail.value });
@@ -72,7 +72,11 @@ export class NileChip extends NileElement {
72
72
  /** Disables the input. */
73
73
  @property({ type: Boolean, reflect: true }) disabled = false;
74
74
 
75
- // Auto-complete options
75
+ // AUTO-COMPLETE-OPTIONS
76
+
77
+ /** Virtual scroll in dropdown options. */
78
+ @property({ type: Boolean }) enableVirtualScroll = false;
79
+
76
80
  @property({ type: Array }) autoCompleteOptions: any[] = [];
77
81
 
78
82
  @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];
@@ -186,6 +190,7 @@ export class NileChip extends NileElement {
186
190
  )}
187
191
  <div class="nile-chip__auto-complete">
188
192
  <nile-auto-complete
193
+ .enableVirtualScroll=${this.enableVirtualScroll}
189
194
  .allMenuItems=${this.filteredAutoCompleteOptions}
190
195
  .filterFunction=${this.filterFunction}
191
196
  .renderItemFunction=${this.renderItemFunction}
@@ -58,6 +58,11 @@ export default css`
58
58
  line-height: 18px;
59
59
  }
60
60
 
61
+ .nile-slide--disabled .nile-slide-toggle__label,
62
+ .nile-slide--disabled .nile-slide-toggle__sublabel{
63
+ color: var(--nile-colors-dark-500);
64
+ }
65
+
61
66
  .nile-slide-toggle__switch input {
62
67
  opacity: 0;
63
68
  width: 0;
@@ -62,13 +62,18 @@
62
62
  },
63
63
  {
64
64
  "name": "nile-auto-complete",
65
- "description": "Attributes:\n\n * `isDropdownOpen` {`boolean`} - \n\n * `openOnFocus` {`boolean`} - \n\n * `value` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `noBorder` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `allMenuItems` - \n\nProperties:\n\n * `styles` - \n\n * `dropdownElement` - \n\n * `isDropdownOpen` {`boolean`} - \n\n * `openOnFocus` {`boolean`} - \n\n * `value` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `noBorder` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `filterFunction` - \n\n * `renderItemFunction` - \n\n * `allMenuItems` - \n\n * `menuItems` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
65
+ "description": "Attributes:\n\n * `isDropdownOpen` {`boolean`} - \n\n * `enableVirtualScroll` {`boolean`} - \n\n * `openOnFocus` {`boolean`} - \n\n * `value` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `noBorder` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `allMenuItems` - \n\nProperties:\n\n * `styles` - \n\n * `dropdownElement` - \n\n * `isDropdownOpen` {`boolean`} - \n\n * `enableVirtualScroll` {`boolean`} - \n\n * `openOnFocus` {`boolean`} - \n\n * `value` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `noBorder` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `filterFunction` - \n\n * `renderItemFunction` - \n\n * `allMenuItems` - \n\n * `menuItems` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
66
66
  "attributes": [
67
67
  {
68
68
  "name": "isDropdownOpen",
69
69
  "description": "`isDropdownOpen` {`boolean`} - \n\nProperty: isDropdownOpen\n\nDefault: false",
70
70
  "valueSet": "v"
71
71
  },
72
+ {
73
+ "name": "enableVirtualScroll",
74
+ "description": "`enableVirtualScroll` {`boolean`} - \n\nProperty: enableVirtualScroll\n\nDefault: false",
75
+ "valueSet": "v"
76
+ },
72
77
  {
73
78
  "name": "openOnFocus",
74
79
  "description": "`openOnFocus` {`boolean`} - \n\nProperty: openOnFocus\n\nDefault: false",
@@ -696,7 +701,7 @@
696
701
  },
697
702
  {
698
703
  "name": "nile-chip",
699
- "description": "Attributes:\n\n * `warning` {`boolean`} - Sets the input to a warning state, changing its visual appearance.\n\n * `error` {`boolean`} - Sets the input to an error state, changing its visual appearance.\n\n * `success` {`boolean`} - Sets the input to a success state, changing its visual appearance.\n\n * `noDuplicates` {`boolean`} - Disables the duplicate entries.\n\n * `label` {`string`} - The input's label. If you need to display HTML, use the `label` slot instead.\n\n * `acceptUserInput` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `clearable` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `placeholder` {`string`} - Placeholder text to show as a hint when the input is empty.\n\n * `readonly` {`boolean`} - Makes the input readonly.\n\n * `disabled` {`boolean`} - Disables the input.\n\n * `autoCompleteOptions` {`any[]`} - \n\n * `filteredAutoCompleteOptions` {`any[]`} - \n\n * `value` {`any[]`} - \n\n * `noWrap` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `errorIndexes` {`number[]`} - \n\n * `help-text` {`string`} - \n\n * `error-message` {`string`} - \n\nProperties:\n\n * `hasSlotController` - \n\n * `tags` {`string[]`} - \n\n * `inputValue` {`string`} - \n\n * `isDropdownOpen` {`boolean`} - \n\n * `autoComplete` - \n\n * `warning` {`boolean`} - Sets the input to a warning state, changing its visual appearance.\n\n * `error` {`boolean`} - Sets the input to an error state, changing its visual appearance.\n\n * `success` {`boolean`} - Sets the input to a success state, changing its visual appearance.\n\n * `noDuplicates` {`boolean`} - Disables the duplicate entries.\n\n * `label` {`string`} - The input's label. If you need to display HTML, use the `label` slot instead.\n\n * `acceptUserInput` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `clearable` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `placeholder` {`string`} - Placeholder text to show as a hint when the input is empty.\n\n * `readonly` {`boolean`} - Makes the input readonly.\n\n * `disabled` {`boolean`} - Disables the input.\n\n * `autoCompleteOptions` {`any[]`} - \n\n * `filteredAutoCompleteOptions` {`any[]`} - \n\n * `value` {`any[]`} - \n\n * `noWrap` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `errorIndexes` {`number[]`} - \n\n * `helpText` {`string`} - \n\n * `errorMessage` {`string`} - \n\n * `filterFunction` - \n\n * `renderItemFunction` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
704
+ "description": "Attributes:\n\n * `warning` {`boolean`} - Sets the input to a warning state, changing its visual appearance.\n\n * `error` {`boolean`} - Sets the input to an error state, changing its visual appearance.\n\n * `success` {`boolean`} - Sets the input to a success state, changing its visual appearance.\n\n * `noDuplicates` {`boolean`} - Disables the duplicate entries.\n\n * `label` {`string`} - The input's label. If you need to display HTML, use the `label` slot instead.\n\n * `acceptUserInput` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `clearable` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `placeholder` {`string`} - Placeholder text to show as a hint when the input is empty.\n\n * `readonly` {`boolean`} - Makes the input readonly.\n\n * `disabled` {`boolean`} - Disables the input.\n\n * `enableVirtualScroll` {`boolean`} - Virtual scroll in dropdown options.\n\n * `autoCompleteOptions` {`any[]`} - \n\n * `filteredAutoCompleteOptions` {`any[]`} - \n\n * `value` {`any[]`} - \n\n * `noWrap` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `errorIndexes` {`number[]`} - \n\n * `help-text` {`string`} - \n\n * `error-message` {`string`} - \n\nProperties:\n\n * `hasSlotController` - \n\n * `tags` {`string[]`} - \n\n * `inputValue` {`string`} - \n\n * `isDropdownOpen` {`boolean`} - \n\n * `autoComplete` - \n\n * `warning` {`boolean`} - Sets the input to a warning state, changing its visual appearance.\n\n * `error` {`boolean`} - Sets the input to an error state, changing its visual appearance.\n\n * `success` {`boolean`} - Sets the input to a success state, changing its visual appearance.\n\n * `noDuplicates` {`boolean`} - Disables the duplicate entries.\n\n * `label` {`string`} - The input's label. If you need to display HTML, use the `label` slot instead.\n\n * `acceptUserInput` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `clearable` {`boolean`} - Adds a clear button when the input is not empty.\n\n * `placeholder` {`string`} - Placeholder text to show as a hint when the input is empty.\n\n * `readonly` {`boolean`} - Makes the input readonly.\n\n * `disabled` {`boolean`} - Disables the input.\n\n * `enableVirtualScroll` {`boolean`} - Virtual scroll in dropdown options.\n\n * `autoCompleteOptions` {`any[]`} - \n\n * `filteredAutoCompleteOptions` {`any[]`} - \n\n * `value` {`any[]`} - \n\n * `noWrap` {`boolean`} - \n\n * `loading` {`boolean`} - \n\n * `errorIndexes` {`number[]`} - \n\n * `helpText` {`string`} - \n\n * `errorMessage` {`string`} - \n\n * `filterFunction` - \n\n * `renderItemFunction` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
700
705
  "attributes": [
701
706
  {
702
707
  "name": "warning",
@@ -746,6 +751,11 @@
746
751
  "description": "`disabled` {`boolean`} - Disables the input.\n\nProperty: disabled\n\nDefault: false",
747
752
  "valueSet": "v"
748
753
  },
754
+ {
755
+ "name": "enableVirtualScroll",
756
+ "description": "`enableVirtualScroll` {`boolean`} - Virtual scroll in dropdown options.\n\nProperty: enableVirtualScroll\n\nDefault: false",
757
+ "valueSet": "v"
758
+ },
749
759
  {
750
760
  "name": "autoCompleteOptions",
751
761
  "description": "`autoCompleteOptions` {`any[]`} - \n\nProperty: autoCompleteOptions\n\nDefault: "