@aquera/nile-elements 0.1.21 → 0.1.22

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 (39) hide show
  1. package/README.md +3 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/nile-auto-complete/index.cjs.js +1 -1
  5. package/dist/nile-auto-complete/index.esm.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  8. package/dist/nile-auto-complete/nile-auto-complete.esm.js +6 -6
  9. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  10. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
  11. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +5 -5
  12. package/dist/nile-chip/index.cjs.js +1 -1
  13. package/dist/nile-chip/index.esm.js +1 -1
  14. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  15. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  16. package/dist/nile-chip/nile-chip.esm.js +6 -5
  17. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  18. package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
  19. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  20. package/dist/nile-radio-group/nile-radio-group.css.cjs.js +1 -1
  21. package/dist/nile-radio-group/nile-radio-group.css.cjs.js.map +1 -1
  22. package/dist/nile-radio-group/nile-radio-group.css.esm.js +1 -1
  23. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +5 -5
  24. package/dist/src/nile-auto-complete/nile-auto-complete.js +42 -44
  25. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  26. package/dist/src/nile-chip/nile-chip.d.ts +5 -5
  27. package/dist/src/nile-chip/nile-chip.js +76 -77
  28. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  29. package/dist/src/nile-radio-group/nile-radio-group.css.js +1 -1
  30. package/dist/src/nile-radio-group/nile-radio-group.css.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/dist/watch.cjs.js +1 -1
  33. package/dist/watch.cjs.js.map +1 -1
  34. package/dist/watch.esm.js +1 -1
  35. package/package.json +1 -1
  36. package/src/nile-auto-complete/nile-auto-complete.ts +44 -47
  37. package/src/nile-chip/nile-chip.ts +94 -94
  38. package/src/nile-radio-group/nile-radio-group.css.ts +1 -1
  39. package/vscode-html-custom-data.json +2 -2
package/dist/watch.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- System.register([],function(_export,_context){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function t(t,i){var n=_objectSpread({waitUntilFirstUpdate:!1},i);return function(i,s){var o=i.update,c=Array.isArray(t)?t:[t];i.update=function(t){var _this=this;c.forEach(function(i){var o=i;if(t.has(o)){var _i=t.get(o),_c=_this[o];_i!==_c&&(n.waitUntilFirstUpdate&&!_this.hasUpdated||_this[s](_i,_c));}}),o.call(this,t);};};}_export("w",t);return{setters:[],execute:function execute(){}};});
1
+ System.register([],function(_export,_context){"use strict";return{setters:[],execute:function execute(){}};});
2
2
  //# sourceMappingURL=watch.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch.cjs.js","sources":["../../src/watch.ts"],"sourcesContent":["import type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\ntype UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface WatchOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n waitUntilFirstUpdate?: boolean;\n}\n\n/**\n * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an\n * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the\n * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n *\n * Usage:\n *\n * @watch('propName')\n * handlePropChange(oldValue, newValue) {\n * ...\n * }\n */\nexport function watch(propertyName: string | string[], options?: WatchOptions) {\n const resolvedOptions: Required<WatchOptions> = {\n waitUntilFirstUpdate: false,\n ...options\n };\n return <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => {\n // @ts-expect-error - update is a protected property\n const { update } = proto;\n const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];\n\n // @ts-expect-error - update is a protected property\n proto.update = function (this: ElemClass, changedProps: Map<keyof ElemClass, ElemClass[keyof ElemClass]>) {\n watchedProperties.forEach(property => {\n const key = property as keyof ElemClass;\n if (changedProps.has(key)) {\n const oldValue = changedProps.get(key);\n const newValue = this[key];\n\n if (oldValue !== newValue) {\n if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {\n (this[decoratedFnName] as unknown as UpdateHandler)(oldValue, newValue);\n }\n }\n }\n });\n\n update.call(this, changedProps);\n };\n };\n}\n"],"names":["watch","propertyName","options","resolvedOptions","_objectSpread","waitUntilFirstUpdate","proto","decoratedFnName","update","watchedProperties","Array","isArray","changedProps","forEach","property","key","has","oldValue","get","newValue","this","hasUpdated","call"],"mappings":"u8CA6BgB,QAAAA,CAAAA,CAAMC,CAAAA,CAAAA,CAAiCC,CACrD,CAAA,CAAA,GAAMC,CAAAA,CAA0C,CAAAC,aAAA,EAC9CC,oBAAsB,CAAA,CAAA,CAAA,EACnBH,CAEL,CAAA,CAAA,MAAO,UAA+BI,CAAAA,CAAkBC,GAEhDC,GAAEA,CAAAA,CAAWF,CAAAA,CAAAA,CAAbE,MAAAA,CACAC,CAAoBC,CAAAA,KAAAA,CAAMC,OAAQV,CAAAA,CAAAA,CAAAA,CAAgBA,CAAe,CAAA,CAACA,CAGxEK,CAAAA,CAAAA,CAAAA,CAAME,MAAS,CAAA,SAA2BI,CACxCH,CAAAA,KAAAA,KAAAA,MAAAA,CAAAA,CAAkBI,QAAQC,SAAAA,CACxB,CAAA,CAAA,GAAMC,CAAAA,CAAMD,CAAAA,CAAAA,CACZ,GAAIF,CAAAA,CAAaI,GAAID,CAAAA,CAAAA,CAAAA,CAAM,CACzB,GAAME,CAAAA,EAAWL,CAAAA,CAAAA,CAAaM,GAAIH,CAAAA,CAAAA,CAAAA,CAC5BI,EAAWC,CAAAA,KAAAA,CAAKL,GAElBE,EAAaE,GAAAA,EAAAA,GACVhB,CAAgBE,CAAAA,oBAAAA,EAAAA,CAAwBe,KAAKC,CAAAA,UAAAA,EAC/CD,KAAKb,CAAAA,CAAAA,CAAAA,CAA8CU,EAAUE,CAAAA,EAAAA,CAAAA,CAGnE,EAGHX,CAAAA,CAAAA,CAAAA,CAAAA,CAAOc,IAAKF,CAAAA,IAAAA,CAAMR,CACpB,CAAA,EAAC,EAEL"}
1
+ {"version":3,"file":"watch.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/watch.esm.js CHANGED
@@ -1 +1 @@
1
- function t(t,i){const n={waitUntilFirstUpdate:!1,...i};return(i,s)=>{const{update:o}=i,c=Array.isArray(t)?t:[t];i.update=function(t){c.forEach((i=>{const o=i;if(t.has(o)){const i=t.get(o),c=this[o];i!==c&&(n.waitUntilFirstUpdate&&!this.hasUpdated||this[s](i,c))}})),o.call(this,t)}}}export{t as w};
1
+
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.21",
6
+ "version": "0.1.22",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -8,8 +8,7 @@ import {
8
8
  import { customElement, query, state, property } from 'lit/decorators.js';
9
9
  import { styles } from './nile-auto-complete.css';
10
10
  import NileElement from '../internal/nile-element';
11
- import { watch } from '../watch';
12
- import type { CSSResultGroup } from 'lit';
11
+ import type { CSSResultGroup, PropertyValues } from 'lit';
13
12
  import { NileDropdown } from '../nile-dropdown';
14
13
 
15
14
  // Define the custom element 'nile-auto-complete'
@@ -36,6 +35,8 @@ export class NileAutoComplete extends NileElement {
36
35
 
37
36
  @property({ attribute:false}) filterFunction: any = (item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());
38
37
 
38
+ @property({ attribute:false}) renderItemFunction: any = (item:any)=>item;
39
+
39
40
  @property({ type: Array }) allMenuItems: any = [];
40
41
 
41
42
  @state() menuItems: any = [];
@@ -45,20 +46,44 @@ export class NileAutoComplete extends NileElement {
45
46
  this.menuItems = [...this.allMenuItems];
46
47
  }
47
48
 
48
- // Watch for changes in 'allMenuItems' property
49
- @watch('allMenuItems')
50
- handleAllMenuItemsChange() {
51
- this.menuItems = [...this.allMenuItems];
52
- }
53
-
54
-
55
- @watch('isDropdownOpen', { waitUntilFirstUpdate: true })
56
- async handleValueChange() {
57
- await this.updateComplete;
58
- // Filter menu items based on the search value
59
- this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);
49
+ protected updated(changedProperties: PropertyValues): void {
50
+ super.updated(changedProperties);
51
+ if (changedProperties.has('allMenuItems')) this.menuItems = [...this.allMenuItems];
52
+ if (changedProperties.has('isDropdownOpen')) this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);
60
53
  }
61
54
 
55
+ public render(): TemplateResult {
56
+ return html`
57
+ <nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick>
58
+ <nile-input class="nile-auto-complete--input"
59
+ ?no-border=${this.noBorder}
60
+ .value=${this.value}
61
+ @nile-input=${this.handleSearch}
62
+ @focus=${this.handleFocus}
63
+ @click=${this.handleClick}
64
+ slot="trigger"
65
+ placeholder=${this.placeholder}
66
+ >
67
+ ${this.loading?html`<nile-icon slot="suffix" color="var(--nile-colors-primary-600)" name="button-loading-blue-animated"></nile-icon>`:nothing}
68
+ </nile-input>
69
+ ${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
+ : ''}
83
+ </nile-dropdown>
84
+ `;
85
+ }
86
+
62
87
  private handleSelect(event: CustomEvent) {
63
88
  this.value = event.detail.value;
64
89
  this.emit('nile-complete', { value: event.detail.value });
@@ -77,12 +102,6 @@ export class NileAutoComplete extends NileElement {
77
102
  if (this.isDropdownOpen) this.dropdownElement?.show();
78
103
  }
79
104
 
80
- applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {
81
- const res:T[]=[]
82
- list.forEach( el=> filterFn(el,this.value) && res.push(el) )
83
- return res
84
- }
85
-
86
105
  public handleFocus() {
87
106
  if (!this.openOnFocus) {
88
107
  return;
@@ -100,34 +119,12 @@ export class NileAutoComplete extends NileElement {
100
119
  this.dropdownElement?.show();
101
120
  }
102
121
 
103
- public render(): TemplateResult {
104
- return html`
105
- <nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick>
106
- <nile-input class="nile-auto-complete--input"
107
- ?no-border=${this.noBorder}
108
- .value=${this.value}
109
- @nile-input=${this.handleSearch}
110
- @focus=${this.handleFocus}
111
- @click=${this.handleClick}
112
- slot="trigger"
113
- placeholder=${this.placeholder}
114
- >
115
- ${this.loading?html`<nile-icon slot="suffix" color="var(--nile-colors-primary-600)" name="button-loading-blue-animated"></nile-icon>`:nothing}
116
- </nile-input>
117
- ${this.menuItems.length > 0 && !this.loading
118
- ? html`
119
- <nile-menu @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper">
120
- ${this.menuItems.map(
121
- (item: any) => html`
122
- <nile-menu-item value=${item}>${item}</nile-menu-item>
123
- `
124
- )}
125
- </nile-menu>
126
- `
127
- : ''}
128
- </nile-dropdown>
129
- `;
122
+ applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {
123
+ const res:T[]=[]
124
+ list.forEach( el=> filterFn(el,this.value) && res.push(el) )
125
+ return res
130
126
  }
127
+
131
128
  }
132
129
 
133
130
  export default NileAutoComplete;
@@ -10,12 +10,12 @@ import {
10
10
  html,
11
11
  CSSResultArray,
12
12
  TemplateResult,
13
+ PropertyValues,
13
14
  } from 'lit';
14
15
  import { customElement, query, state, property } from 'lit/decorators.js';
15
16
  import { styles } from './nile-chip.css';
16
17
  import { classMap } from 'lit/directives/class-map.js';
17
18
  import { HasSlotController } from '../internal/slot';
18
- import { watch } from '../internal/watch';
19
19
  import NileElement, { NileFormControl } from '../internal/nile-element';
20
20
 
21
21
  interface CustomEventDetail {
@@ -91,37 +91,30 @@ export class NileChip extends NileElement {
91
91
 
92
92
  @property({ attribute:false}) filterFunction: any = (item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());
93
93
 
94
- @watch('autoCompleteOptions')
95
- onAutoCompleteOptionsChanged() {
96
- this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];
97
-
98
- if (this.noDuplicates) {
99
- this.filteredAutoCompleteOptions =
100
- this.filteredAutoCompleteOptions.filter(
101
- option => !this.value.includes(option)
102
- );
94
+ @property({ attribute:false}) renderItemFunction: any = (item:any)=>item;
95
+
96
+ protected updated(changedProperties: PropertyValues): void {
97
+ super.updated(changedProperties);
98
+ if (changedProperties.has('autoCompleteOptions')) {
99
+ this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];
100
+ if (this.noDuplicates) {
101
+ this.filteredAutoCompleteOptions =
102
+ this.filteredAutoCompleteOptions.filter(
103
+ option => !this.value.includes(option)
104
+ );
105
+ }
103
106
  }
104
- }
105
-
106
- @watch('value')
107
- onValueChanged() {
108
- this.tags = [...this.value];
109
- this.onTagsChanged();
110
- }
111
-
112
- @watch('tags')
113
- onTagsChanged() {
114
- if (this.noDuplicates) {
115
- this.filteredAutoCompleteOptions =
116
- this.filteredAutoCompleteOptions.filter(
117
- option => !this.tags.includes(option)
118
- );
107
+ if (changedProperties.has('value')){
108
+ this.tags = [...this.value];
109
+ this.onTagsChanged();
110
+ }
111
+ if (changedProperties.has('tags')){
112
+ this.onTagsChanged();
119
113
  }
120
114
  }
121
115
 
122
116
  connectedCallback() {
123
117
  super.connectedCallback();
124
-
125
118
  if (this.noDuplicates) {
126
119
  this.filteredAutoCompleteOptions =
127
120
  this.filteredAutoCompleteOptions.filter(
@@ -136,74 +129,6 @@ export class NileChip extends NileElement {
136
129
  this.emit('nile-destroy');
137
130
  }
138
131
 
139
- private handleSelect(event: CustomEvent<CustomEventDetail>) {
140
- // Add the selected value to the tags array only if it doesn't already exist
141
- if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {
142
- this.tags = [...this.tags, event.detail.value];
143
- this.emit('nile-chip-change', { value: this.tags });
144
- this.resetInput();
145
- }
146
- }
147
-
148
- private handleRemove(value: string) {
149
- // Remove the tag from the tags array
150
- this.tags = this.tags.filter(tag => tag !== value);
151
-
152
- if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {
153
- this.filteredAutoCompleteOptions = [
154
- ...this.filteredAutoCompleteOptions,
155
- value,
156
- ];
157
- }
158
- this.emit('nile-chip-change', { value: this.tags });
159
- }
160
-
161
- private handleInputChange(event: CustomEvent<CustomEventDetail>) {
162
- // Update the input value
163
- this.inputValue = event.detail.value;
164
- }
165
-
166
- private handleInputKeydown(event: KeyboardEvent) {
167
- if (!this.acceptUserInput) {
168
- return;
169
- }
170
-
171
- if(event.key === 'Tab'){
172
- event.preventDefault()
173
- }
174
-
175
- if (
176
- (event.key === 'Enter' || event.key === 'Tab' )
177
- && this.inputValue
178
- && (!this.noDuplicates || !this.tags.includes(this.inputValue))
179
- ) {
180
- event.preventDefault()
181
- this.tags = [...this.tags, this.inputValue];
182
- this.resetInput();
183
- this.emit('nile-chip-change', { value: this.tags });
184
- }
185
-
186
- if(
187
- (event.key === 'Enter'|| event.key === 'Tab' )
188
- && this.inputValue
189
- && (this.noDuplicates || this.tags.includes(this.inputValue))
190
- ){
191
- this.emit('nile-duplicates-blocked');
192
- }
193
- }
194
-
195
- private handleFocus() {
196
- this.isDropdownOpen = true;
197
- }
198
-
199
- private resetInput() {
200
- // Reset the input-related properties
201
- this.inputValue = '';
202
- this.isDropdownOpen = false;
203
- this.autoComplete.value = '';
204
- this.autoComplete.handleFocus();
205
- }
206
-
207
132
  render() {
208
133
  // Check if slots are present
209
134
  const hasLabelSlot = this.hasSlotController.test('label');
@@ -263,6 +188,7 @@ export class NileChip extends NileElement {
263
188
  <nile-auto-complete
264
189
  .allMenuItems=${this.filteredAutoCompleteOptions}
265
190
  .filterFunction=${this.filterFunction}
191
+ .renderItemFunction=${this.renderItemFunction}
266
192
  .loading="${this.loading}"
267
193
  .value=${this.inputValue}
268
194
  ?isDropdownOpen=${this.isDropdownOpen}
@@ -306,6 +232,80 @@ export class NileChip extends NileElement {
306
232
  </div>
307
233
  `;
308
234
  }
235
+
236
+ private handleSelect(event: CustomEvent<CustomEventDetail>) {
237
+ // Add the selected value to the tags array only if it doesn't already exist
238
+ if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {
239
+ this.tags = [...this.tags, event.detail.value];
240
+ this.emit('nile-chip-change', { value: this.tags });
241
+ this.resetInput();
242
+ }
243
+ }
244
+
245
+ private handleRemove(value: string) {
246
+ // Remove the tag from the tags array
247
+ this.tags = this.tags.filter(tag => tag !== value);
248
+
249
+ if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {
250
+ this.filteredAutoCompleteOptions = [
251
+ ...this.filteredAutoCompleteOptions,
252
+ value,
253
+ ];
254
+ }
255
+ this.emit('nile-chip-change', { value: this.tags });
256
+ }
257
+
258
+ private handleInputChange(event: CustomEvent<CustomEventDetail>) {
259
+ // Update the input value
260
+ this.inputValue = event.detail.value;
261
+ }
262
+
263
+ private handleInputKeydown(event: KeyboardEvent) {
264
+ if (!this.acceptUserInput) {
265
+ return;
266
+ }
267
+
268
+ if(event.key === 'Tab'){
269
+ event.preventDefault()
270
+ }
271
+
272
+ if (
273
+ (event.key === 'Enter' || event.key === 'Tab' )
274
+ && this.inputValue
275
+ && (!this.noDuplicates || !this.tags.includes(this.inputValue))
276
+ ) {
277
+ event.preventDefault()
278
+ this.tags = [...this.tags, this.inputValue];
279
+ this.resetInput();
280
+ this.emit('nile-chip-change', { value: this.tags });
281
+ }
282
+
283
+ if(
284
+ (event.key === 'Enter'|| event.key === 'Tab' )
285
+ && this.inputValue
286
+ && (this.noDuplicates || this.tags.includes(this.inputValue))
287
+ ){
288
+ this.emit('nile-duplicates-blocked');
289
+ }
290
+ }
291
+
292
+ private handleFocus() {
293
+ this.isDropdownOpen = true;
294
+ }
295
+
296
+ onTagsChanged() {
297
+ if (this.noDuplicates)
298
+ this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));
299
+ }
300
+
301
+
302
+ private resetInput() {
303
+ // Reset the input-related properties
304
+ this.inputValue = '';
305
+ this.isDropdownOpen = false;
306
+ this.autoComplete.value = '';
307
+ this.autoComplete.handleFocus();
308
+ }
309
309
  }
310
310
 
311
311
  export default NileChip;
@@ -8,7 +8,7 @@ export default css`
8
8
 
9
9
  .form-control--inline-radio ::slotted(nile-radio) {
10
10
  display: inline-block;
11
- margin-right: 24px !important;
11
+ margin-right: 24px;
12
12
  }
13
13
 
14
14
  .form-control {
@@ -62,7 +62,7 @@
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 * `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 * `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`} - ",
66
66
  "attributes": [
67
67
  {
68
68
  "name": "isDropdownOpen",
@@ -696,7 +696,7 @@
696
696
  },
697
697
  {
698
698
  "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 * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
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`} - ",
700
700
  "attributes": [
701
701
  {
702
702
  "name": "warning",