@limetech/lime-elements 37.33.0 → 37.33.2

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 (27) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-breadcrumbs_4.cjs.entry.js +74 -41
  4. package/dist/cjs/limel-breadcrumbs_4.cjs.entry.js.map +1 -1
  5. package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
  6. package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/chip-set/chip-set.css +0 -3
  9. package/dist/collection/components/input-field/input-field.css +5 -19
  10. package/dist/collection/components/input-field/input-field.js +74 -41
  11. package/dist/collection/components/input-field/input-field.js.map +1 -1
  12. package/dist/collection/style/internal/shared_input-select-picker.scss +2 -24
  13. package/dist/esm/lime-elements.js +1 -1
  14. package/dist/esm/limel-breadcrumbs_4.entry.js +74 -41
  15. package/dist/esm/limel-breadcrumbs_4.entry.js.map +1 -1
  16. package/dist/esm/limel-chip_2.entry.js +1 -1
  17. package/dist/esm/limel-chip_2.entry.js.map +1 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/lime-elements/lime-elements.esm.js +1 -1
  20. package/dist/lime-elements/{p-54d85dd0.entry.js → p-8bda6cb8.entry.js} +2 -2
  21. package/dist/lime-elements/{p-54d85dd0.entry.js.map → p-8bda6cb8.entry.js.map} +1 -1
  22. package/dist/lime-elements/{p-82a91723.entry.js → p-e772c172.entry.js} +5 -5
  23. package/dist/lime-elements/p-e772c172.entry.js.map +1 -0
  24. package/dist/lime-elements/style/internal/shared_input-select-picker.scss +2 -24
  25. package/dist/types/components/input-field/input-field.d.ts +9 -3
  26. package/package.json +1 -1
  27. package/dist/lime-elements/p-82a91723.entry.js.map +0 -1
@@ -5,6 +5,7 @@ import { ARROW_DOWN, ARROW_DOWN_KEY_CODE, ARROW_UP, ARROW_UP_KEY_CODE, ENTER, EN
5
5
  import { getHref, getTarget } from '../../util/link-helper';
6
6
  import { createRandomString } from '../../util/random-string';
7
7
  import { globalConfig } from '../../global/config';
8
+ const DEBOUNCE_TIMEOUT = 300;
8
9
  /**
9
10
  * @exampleComponent limel-example-input-field-text
10
11
  * @exampleComponent limel-example-input-field-placeholder
@@ -26,12 +27,19 @@ import { globalConfig } from '../../global/config';
26
27
  export class InputField {
27
28
  constructor() {
28
29
  this.completionsList = [];
30
+ this.changeWaiting = false;
29
31
  this.initialize = () => {
30
32
  const element = this.limelInputField.shadowRoot.querySelector('.mdc-text-field');
31
33
  if (!element) {
32
34
  return;
33
35
  }
34
36
  this.mdcTextField = new MDCTextField(element);
37
+ if (this.value) {
38
+ this.mdcTextField.value = this.value;
39
+ }
40
+ if (this.invalid) {
41
+ this.mdcTextField.valid = false;
42
+ }
35
43
  this.mapCompletions();
36
44
  window.addEventListener('resize', this.layout, { passive: true });
37
45
  this.limelInputField.addEventListener('focus', this.setFocus);
@@ -53,7 +61,7 @@ export class InputField {
53
61
  'mdc-text-field--disabled': this.disabled || this.readonly,
54
62
  'lime-text-field--readonly': this.readonly,
55
63
  'mdc-text-field--required': this.required,
56
- 'lime-text-field--empty': !this.value,
64
+ 'lime-text-field--empty': this.isEmpty(),
57
65
  'lime-has-prefix': this.hasPrefix(),
58
66
  'lime-has-suffix': this.hasSuffix(),
59
67
  };
@@ -69,18 +77,31 @@ export class InputField {
69
77
  }
70
78
  return classList;
71
79
  };
80
+ this.isEmpty = () => {
81
+ var _a;
82
+ if (this.type === 'number' && ((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.validity.badInput)) {
83
+ return false;
84
+ }
85
+ return !this.getCurrentValue();
86
+ };
87
+ this.getCurrentValue = () => {
88
+ if (this.changeWaiting && this.inputElement) {
89
+ return this.inputElement.value;
90
+ }
91
+ return this.value;
92
+ };
72
93
  this.renderInput = (properties) => {
73
94
  if (this.type === 'textarea') {
74
95
  return;
75
96
  }
76
97
  const type = this.type === 'urlAsText' ? 'text' : this.type;
77
- return (h("input", Object.assign({}, properties, { type: type, pattern: this.pattern, onWheel: this.handleWheel, onKeyDown: this.onKeyDown, value: this.value, placeholder: this.placeholder })));
98
+ return (h("input", Object.assign({}, properties, { type: type, pattern: this.pattern, onWheel: this.handleWheel, onKeyDown: this.onKeyDown, placeholder: this.placeholder })));
78
99
  };
79
100
  this.renderTextarea = (properties) => {
80
101
  if (this.type !== 'textarea') {
81
102
  return;
82
103
  }
83
- return (h("span", { class: "mdc-text-field__resizer" }, h("textarea", Object.assign({}, properties, { placeholder: this.placeholder }), this.value)));
104
+ return (h("span", { class: "mdc-text-field__resizer" }, h("textarea", Object.assign({}, properties, { placeholder: this.placeholder }))));
84
105
  };
85
106
  this.layout = () => {
86
107
  var _a;
@@ -111,7 +132,8 @@ export class InputField {
111
132
  };
112
133
  this.onBlur = () => {
113
134
  this.isFocused = false;
114
- this.isModified = true;
135
+ this.validate();
136
+ this.changeEmitter.flush();
115
137
  };
116
138
  this.hasHelperText = () => {
117
139
  return this.helperText !== null && this.helperText !== undefined;
@@ -120,7 +142,7 @@ export class InputField {
120
142
  return this.maxlength || this.hasHelperText();
121
143
  };
122
144
  this.renderHelperLine = () => {
123
- const text = this.value || '';
145
+ const text = this.getCurrentValue() || '';
124
146
  const length = text.length;
125
147
  if (!this.hasHelperLine()) {
126
148
  return;
@@ -128,7 +150,7 @@ export class InputField {
128
150
  return (h("limel-helper-line", { helperTextId: this.helperTextId, helperText: this.helperText, length: length, maxLength: this.maxlength, invalid: this.isInvalid() }));
129
151
  };
130
152
  this.renderEmptyValueForReadonly = () => {
131
- if (this.readonly && !this.value) {
153
+ if (this.readonly && this.isEmpty()) {
132
154
  return (h("span", { class: "lime-empty-value-for-readonly lime-looks-like-input-value" }, "\u2013"));
133
155
  }
134
156
  };
@@ -170,23 +192,26 @@ export class InputField {
170
192
  // of whether the field has been modified.
171
193
  return true;
172
194
  }
173
- if (!this.isModified) {
174
- return false;
195
+ return this.wasInvalid;
196
+ };
197
+ this.validate = () => {
198
+ if (this.readonly || this.invalid) {
199
+ this.wasInvalid = false;
200
+ return;
201
+ }
202
+ if (this.inputElement) {
203
+ this.wasInvalid = !this.inputElement.checkValidity();
175
204
  }
176
- const element = this.getInputElement();
177
- return !(element && element.checkValidity());
178
205
  };
179
- this.getInputElement = () => {
180
- let elementName = 'input';
181
- if (this.type === 'textarea') {
182
- elementName = 'textarea';
206
+ this.setInputElement = (element) => {
207
+ if (element) {
208
+ this.inputElement = element;
183
209
  }
184
- return this.limelInputField.shadowRoot.querySelector(elementName);
185
210
  };
186
211
  this.renderLabel = () => {
187
212
  const labelClassList = {
188
213
  'mdc-floating-label': true,
189
- 'mdc-floating-label--float-above': !!this.value || this.isFocused || this.readonly,
214
+ 'mdc-floating-label--float-above': !this.isEmpty() || this.isFocused || this.readonly,
190
215
  };
191
216
  if (!this.label) {
192
217
  return;
@@ -205,15 +230,13 @@ export class InputField {
205
230
  if (this.type === 'textarea') {
206
231
  return;
207
232
  }
208
- const html = [];
209
233
  const trailingIcon = this.getTrailingIcon();
210
234
  if (!this.isInvalid() && this.hasLink()) {
211
- html.push(this.renderLinkIcon(this.getLink(), trailingIcon));
235
+ return this.renderLinkIcon(this.getLink(), trailingIcon);
212
236
  }
213
237
  else if (trailingIcon) {
214
- html.push(this.renderTrailingIcon(trailingIcon));
238
+ return this.renderTrailingIcon(trailingIcon);
215
239
  }
216
- return html;
217
240
  };
218
241
  this.hasLink = () => {
219
242
  return (this.showLink &&
@@ -240,18 +263,13 @@ export class InputField {
240
263
  // `preventDefault()` on the event. For links, we don't want that,
241
264
  // so instead of `mdc-text-field__icon--trailing`, we use our own class
242
265
  // `lime-trailing-icon-for-link`, which uses all the same styling. /Ads
243
- return (h("a", Object.assign({}, linkProps, { class: "material-icons mdc-text-field__icon lime-trailing-icon-for-link", tabindex: this.disabled || !this.value ? '-1' : '0', role: "button" }), h("limel-icon", { name: icon })));
266
+ return (h("a", Object.assign({}, linkProps, { class: "material-icons mdc-text-field__icon lime-trailing-icon-for-link", tabindex: this.disabled || this.isEmpty() ? '-1' : '0', role: "button" }), h("limel-icon", { name: icon })));
244
267
  };
245
268
  this.renderTrailingIcon = (icon) => {
246
- const props = {
247
- tabIndex: this.isInvalid() ? '-1' : '0',
248
- };
249
- if (!this.isInvalid()) {
250
- props.onKeyPress = this.handleIconKeyPress;
251
- props.onClick = this.handleIconClick;
252
- props.role = 'button';
269
+ if (this.isInvalid()) {
270
+ return (h("i", { key: "invalid", class: "material-icons mdc-text-field__icon invalid-icon" }, h("limel-icon", { name: icon })));
253
271
  }
254
- return (h("i", Object.assign({ class: "material-icons mdc-text-field__icon mdc-text-field__icon--trailing" }, props), h("limel-icon", { name: icon })));
272
+ return (h("i", { key: "action", class: "material-icons mdc-text-field__icon mdc-text-field__icon--trailing", tabIndex: 0, role: "button", onKeyPress: this.handleIconKeyPress, onClick: this.handleIconClick }, h("limel-icon", { name: icon })));
255
273
  };
256
274
  this.getTrailingIcon = () => {
257
275
  if (this.isInvalid()) {
@@ -278,6 +296,9 @@ export class InputField {
278
296
  let renderValue = this.value;
279
297
  if (this.formatNumber && this.value) {
280
298
  renderValue = new Intl.NumberFormat(this.locale).format(Number(this.value));
299
+ if (renderValue === 'NaN') {
300
+ return;
301
+ }
281
302
  }
282
303
  return (h("span", { class: "lime-formatted-input lime-looks-like-input-value" }, renderValue));
283
304
  };
@@ -329,6 +350,7 @@ export class InputField {
329
350
  the same debounced emitter function. /Ads
330
351
  */
331
352
  this.changeEmitter(event.detail.text);
353
+ this.changeEmitter.flush();
332
354
  };
333
355
  this.renderAutocompleteList = () => {
334
356
  if (this.type === 'textarea' || !this.completions.length) {
@@ -342,7 +364,7 @@ export class InputField {
342
364
  }, onDismiss: this.handleCloseMenu }, this.renderListResult())));
343
365
  };
344
366
  this.renderListResult = () => {
345
- const filteredCompletions = this.filterCompletions(this.value);
367
+ const filteredCompletions = this.filterCompletions(this.getCurrentValue());
346
368
  if (!filteredCompletions || filteredCompletions.length === 0) {
347
369
  return null;
348
370
  }
@@ -369,7 +391,7 @@ export class InputField {
369
391
  return this.completionsList.filter((completion) => completion.text.toLowerCase().indexOf(filter.toLowerCase()) >
370
392
  -1);
371
393
  };
372
- this.handleChange = (event) => {
394
+ this.handleInput = (event) => {
373
395
  event.stopPropagation();
374
396
  let value = event.target.value;
375
397
  if (this.type === 'number') {
@@ -381,20 +403,24 @@ export class InputField {
381
403
  value = Number(value);
382
404
  }
383
405
  }
406
+ this.changeWaiting = true;
384
407
  this.changeEmitter(value);
385
408
  };
386
- this.changeEmitter = (value) => {
409
+ this.changeEmitter = debounce((value) => {
387
410
  this.change.emit(value);
411
+ this.changeWaiting = false;
412
+ }, DEBOUNCE_TIMEOUT);
413
+ this.handleChange = (event) => {
414
+ event.stopPropagation();
415
+ this.changeEmitter.flush();
388
416
  };
389
417
  this.handleIconClick = () => {
390
- if (!this.isInvalid()) {
391
- this.action.emit();
392
- }
418
+ this.action.emit();
393
419
  };
394
420
  this.handleIconKeyPress = (event) => {
395
421
  const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;
396
422
  const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;
397
- if ((isSpace || isEnter) && !this.isInvalid()) {
423
+ if (isSpace || isEnter) {
398
424
  this.action.emit();
399
425
  }
400
426
  };
@@ -433,10 +459,8 @@ export class InputField {
433
459
  this.showLink = false;
434
460
  this.locale = globalConfig.defaultLocale;
435
461
  this.isFocused = false;
436
- this.isModified = false;
462
+ this.wasInvalid = false;
437
463
  this.showCompletions = false;
438
- const debounceTimeout = 300;
439
- this.changeEmitter = debounce(this.changeEmitter, debounceTimeout);
440
464
  this.portalId = createRandomString();
441
465
  this.helperTextId = createRandomString();
442
466
  this.labelId = createRandomString();
@@ -458,12 +482,15 @@ export class InputField {
458
482
  if (this.invalid) {
459
483
  this.mdcTextField.valid = false;
460
484
  }
485
+ this.mdcTextField.disabled = this.disabled || this.readonly;
461
486
  }
462
487
  render() {
463
488
  const properties = this.getAdditionalProps();
464
489
  properties['aria-labelledby'] = this.labelId;
465
490
  properties.class = 'mdc-text-field__input';
466
- properties.onInput = this.handleChange;
491
+ properties.ref = this.setInputElement;
492
+ properties.onInput = this.handleInput;
493
+ properties.onChange = this.handleChange;
467
494
  properties.onFocus = this.onFocus;
468
495
  properties.onBlur = this.onBlur;
469
496
  properties.required = this.required;
@@ -493,9 +520,15 @@ export class InputField {
493
520
  if (!this.mdcTextField) {
494
521
  return;
495
522
  }
523
+ if (this.changeWaiting) {
524
+ return;
525
+ }
496
526
  if (newValue !== this.mdcTextField.value) {
497
527
  this.mdcTextField.value = newValue || '';
498
528
  }
529
+ if (this.wasInvalid) {
530
+ this.validate();
531
+ }
499
532
  }
500
533
  completionsWatcher() {
501
534
  this.mapCompletions();
@@ -923,7 +956,7 @@ export class InputField {
923
956
  static get states() {
924
957
  return {
925
958
  "isFocused": {},
926
- "isModified": {},
959
+ "wasInvalid": {},
927
960
  "showCompletions": {}
928
961
  };
929
962
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input-field.js","sourceRoot":"","sources":["../../../src/components/input-field/input-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACH,UAAU,EACV,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,cAAc,EACd,MAAM,EACN,eAAe,EACf,KAAK,EACL,cAAc,EACd,GAAG,EACH,YAAY,GACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EA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BAA0B,EAAE,CAC9B;MACR,IAAI,CAAC,gBAAgB,EAAE;MACvB,IAAI,CAAC,sBAAsB,EAAE;KAChC,CAAC;EACN,CAAC;EAGS,YAAY,CAAC,QAAgB;IACnC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;MACpB,OAAO;KACV;IAED,IAAI,QAAQ,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE;MACtC,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,QAAQ,IAAI,EAAE,CAAC;KAC5C;EACL,CAAC;EAGS,kBAAkB;IACxB,IAAI,CAAC,cAAc,EAAE,CAAC;EAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8kBJ","sourcesContent":["import { MDCTextField } from '@material/textfield';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { debounce } from 'lodash-es';\nimport {\n ARROW_DOWN,\n ARROW_DOWN_KEY_CODE,\n ARROW_UP,\n ARROW_UP_KEY_CODE,\n ENTER,\n ENTER_KEY_CODE,\n ESCAPE,\n ESCAPE_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\nimport { InputType } from '../input-field/input-field.types';\nimport { ListItem } from '../list/list-item.types';\nimport { getHref, getTarget } from '../../util/link-helper';\nimport { JSXBase } from '@stencil/core/internal';\nimport { createRandomString } from '../../util/random-string';\nimport { LimelListCustomEvent } from '../../components';\nimport { globalConfig } from '../../global/config';\n\ninterface LinkProperties {\n href: string;\n target?: string;\n}\n\n/**\n * @exampleComponent limel-example-input-field-text\n * @exampleComponent limel-example-input-field-placeholder\n * @exampleComponent limel-example-input-field-text-multiple\n * @exampleComponent limel-example-input-field-number\n * @exampleComponent limel-example-input-field-autocomplete\n * @exampleComponent limel-example-input-field-icon-leading\n * @exampleComponent limel-example-input-field-icon-trailing\n * @exampleComponent limel-example-input-field-icon-both\n * @exampleComponent limel-example-input-field-showlink\n * @exampleComponent limel-example-input-field-error-icon\n * @exampleComponent limel-example-input-field-textarea\n * @exampleComponent limel-example-input-field-suffix\n * @exampleComponent limel-example-input-field-prefix\n * @exampleComponent limel-example-input-field-search\n * @exampleComponent limel-example-input-field-pattern\n * @exampleComponent limel-example-input-field-focus\n */\n@Component({\n tag: 'limel-input-field',\n shadow: true,\n styleUrl: 'input-field.scss',\n})\nexport class InputField {\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * The placeholder text shown inside the input field, when the field is focused and empty.\n */\n @Prop({ reflect: true })\n public placeholder: string;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * A short piece of text to display before the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public prefix: string;\n\n /**\n * A short piece of text to display after the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public suffix: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * The value of the field.\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Trailing icon to show to the far right in the field.\n */\n @Prop({ reflect: true })\n public trailingIcon: string;\n\n /**\n * Leading icon to show to the far left in the field.\n */\n @Prop({ reflect: true })\n public leadingIcon: string;\n\n /**\n * Regular expression that the current value of the input field must match.\n * No forward slashes should be specified around the pattern.\n * Only used if type is `text`, `tel`, `email`, `url`, `urlAsText`,\n * `password`, or `search`.\n */\n @Prop({ reflect: true })\n public pattern: string;\n\n /**\n * Type of input.\n *\n * Note** regarding type `url`: `limel-input` uses the native validation\n * built into the browser for many types of input fields. The native\n * validation for `url` is very strict, and does not allow relative urls,\n * nor any other formats that are not a \"fully qualified\" url. To allow\n * such urls, use the type `urlAsText` instead. `urlAsText` works exactly\n * like `text` in all regards, except that it enables use of the `showLink`\n * property.\n */\n @Prop({ reflect: true })\n public type: InputType = 'text';\n\n /**\n * Set to `true` to format the current value of the input field only\n * if the field is of type number.\n * The number format is determined by the current language of the browser.\n */\n @Prop({ reflect: true })\n public formatNumber = true;\n\n /**\n * Incremental values that are valid if the field type is `number`.\n */\n @Prop({ reflect: true })\n public step: number | 'any' = 'any';\n\n /**\n * Maximum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public max: number;\n\n /**\n * Minimum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public min: number;\n\n /**\n * Maximum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public maxlength: number;\n\n /**\n * Minimum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public minlength: number;\n\n /**\n * list of suggestions `value` can autocomplete to.\n */\n @Prop()\n public completions: string[] = [];\n\n /**\n * For inputs of type `email`, `tel`, `url`, and `urlAsText`, set this to\n * `true` to show a trailing icon with a `mailto:`,`tel:`, or normal link,\n * respectively. The default icon can be overridden using the `trailingIcon`\n * property.\n */\n @Prop({ reflect: true })\n public showLink = false;\n\n /**\n * The locale to use for formatting numbers.\n */\n @Prop({ reflect: true })\n public locale: string = globalConfig.defaultLocale;\n\n /**\n * Emitted when the input value is changed.\n */\n @Event()\n private change: EventEmitter<string>;\n\n /**\n * Emitted when `trailingIcon` or `leadingIcon` is set\n * and the icon is interacted with.\n */\n @Event()\n private action: EventEmitter<void>;\n\n @Element()\n private limelInputField: HTMLLimelInputFieldElement;\n\n @State()\n private isFocused: boolean = false;\n\n @State()\n private isModified: boolean = false;\n\n @State()\n public showCompletions: boolean = false;\n\n private mdcTextField: MDCTextField;\n private completionsList: ListItem[] = [];\n private portalId: string;\n private helperTextId: string;\n private labelId: string;\n\n constructor() {\n const debounceTimeout = 300;\n this.changeEmitter = debounce(this.changeEmitter, debounceTimeout);\n\n this.portalId = createRandomString();\n this.helperTextId = createRandomString();\n this.labelId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n public disconnectedCallback() {\n if (this.mdcTextField) {\n this.mdcTextField.destroy();\n }\n\n window.removeEventListener('resize', this.layout);\n this.limelInputField.removeEventListener('focus', this.setFocus);\n }\n\n public componentDidUpdate() {\n if (this.invalid) {\n this.mdcTextField.valid = false;\n }\n }\n\n public render() {\n const properties = this.getAdditionalProps();\n properties['aria-labelledby'] = this.labelId;\n properties.class = 'mdc-text-field__input';\n properties.onInput = this.handleChange;\n properties.onFocus = this.onFocus;\n properties.onBlur = this.onBlur;\n properties.required = this.required;\n properties.readonly = this.readonly;\n properties.disabled = this.disabled || this.readonly;\n\n let ariaControls = '';\n\n if (this.hasHelperText()) {\n ariaControls += this.helperTextId;\n properties['aria-describedby'] = this.helperTextId;\n }\n\n if (this.renderAutocompleteList()) {\n if (ariaControls) {\n ariaControls += ' ';\n }\n\n ariaControls += this.portalId;\n }\n\n if (ariaControls) {\n properties['aria-controls'] = ariaControls;\n }\n\n return [\n <label class={this.getContainerClassList()}>\n <span class=\"mdc-notched-outline\" tabindex=\"-1\">\n <span class=\"mdc-notched-outline__leading\"></span>\n {this.renderLabel()}\n <span class=\"mdc-notched-outline__trailing\"></span>\n </span>\n {this.renderLeadingIcon()}\n {this.renderEmptyValueForReadonly()}\n {this.renderPrefix()}\n {this.renderFormattedNumber()}\n {this.renderInput(properties)}\n {this.renderSuffix()}\n {this.renderTextarea(properties)}\n {this.renderTrailingLinkOrButton()}\n </label>,\n this.renderHelperLine(),\n this.renderAutocompleteList(),\n ];\n }\n\n @Watch('value')\n protected valueWatcher(newValue: string) {\n if (!this.mdcTextField) {\n return;\n }\n\n if (newValue !== this.mdcTextField.value) {\n this.mdcTextField.value = newValue || '';\n }\n }\n\n @Watch('completions')\n protected completionsWatcher() {\n this.mapCompletions();\n }\n\n private initialize = () => {\n const element =\n this.limelInputField.shadowRoot.querySelector('.mdc-text-field');\n if (!element) {\n return;\n }\n\n this.mdcTextField = new MDCTextField(element);\n\n this.mapCompletions();\n\n window.addEventListener('resize', this.layout, { passive: true });\n this.limelInputField.addEventListener('focus', this.setFocus);\n };\n\n private mapCompletions = () => {\n this.completionsList = [...this.completions].map((item) => {\n return { text: item };\n });\n };\n\n private setFocus = () => {\n this.mdcTextField.focus();\n };\n\n private getContainerClassList = () => {\n const classList = {\n 'mdc-text-field': true,\n 'mdc-text-field--no-label': !this.label,\n 'mdc-text-field--outlined': true,\n 'mdc-text-field--invalid': this.isInvalid(),\n 'mdc-text-field--disabled': this.disabled || this.readonly,\n 'lime-text-field--readonly': this.readonly,\n 'mdc-text-field--required': this.required,\n 'lime-text-field--empty': !this.value,\n 'lime-has-prefix': this.hasPrefix(),\n 'lime-has-suffix': this.hasSuffix(),\n };\n\n if (this.type === 'textarea') {\n classList['mdc-text-field--textarea'] = true;\n classList['has-helper-line'] =\n !!this.helperText || !!this.maxlength;\n } else {\n classList['mdc-text-field--with-leading-icon'] = !!this.leadingIcon;\n classList['mdc-text-field--with-trailing-icon'] =\n !!this.getTrailingIcon();\n }\n\n return classList;\n };\n\n private renderInput = (\n properties: JSXBase.InputHTMLAttributes<HTMLInputElement>,\n ) => {\n if (this.type === 'textarea') {\n return;\n }\n\n const type = this.type === 'urlAsText' ? 'text' : this.type;\n\n return (\n <input\n {...properties}\n type={type}\n pattern={this.pattern}\n onWheel={this.handleWheel}\n onKeyDown={this.onKeyDown}\n value={this.value}\n placeholder={this.placeholder}\n />\n );\n };\n\n private renderTextarea = (\n properties: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>,\n ) => {\n if (this.type !== 'textarea') {\n return;\n }\n\n return (\n <span class=\"mdc-text-field__resizer\">\n <textarea {...properties} placeholder={this.placeholder}>\n {this.value}\n </textarea>\n </span>\n );\n };\n\n private layout = () => {\n this.mdcTextField?.layout();\n };\n\n private getAdditionalProps = () => {\n const props: any = {};\n\n if (this.type === 'number') {\n props.step = this.step;\n }\n\n if (this.type === 'number' && Number.isInteger(this.min)) {\n props.min = this.min;\n }\n\n if (this.type === 'number' && Number.isInteger(this.max)) {\n props.max = this.max;\n }\n\n if (this.minlength) {\n props.minlength = this.minlength;\n }\n\n if (this.maxlength) {\n props.maxlength = this.maxlength;\n }\n\n return props;\n };\n\n private onFocus = () => {\n this.isFocused = true;\n this.showCompletions = true;\n };\n\n private onBlur = () => {\n this.isFocused = false;\n this.isModified = true;\n };\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private hasHelperLine = () => {\n return this.maxlength || this.hasHelperText();\n };\n\n private renderHelperLine = () => {\n const text: string = this.value || '';\n const length = text.length;\n\n if (!this.hasHelperLine()) {\n return;\n }\n\n return (\n <limel-helper-line\n helperTextId={this.helperTextId}\n helperText={this.helperText}\n length={length}\n maxLength={this.maxlength}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private renderEmptyValueForReadonly = () => {\n if (this.readonly && !this.value) {\n return (\n <span class=\"lime-empty-value-for-readonly lime-looks-like-input-value\">\n –\n </span>\n );\n }\n };\n\n private renderSuffix = () => {\n if (!this.hasSuffix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--suffix': true,\n };\n\n return <span class={classList}>{this.suffix}</span>;\n };\n\n private hasSuffix = () => {\n return this.suffix !== null && this.suffix !== undefined;\n };\n\n private renderPrefix = () => {\n if (!this.hasPrefix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--prefix': true,\n };\n\n return <span class={classList}>{this.prefix}</span>;\n };\n\n private hasPrefix = () => {\n return this.prefix !== null && this.prefix !== undefined;\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n // `this.invalid` is set by the consumer. If the consumer explicitly\n // told us to consider the field invalid, we consider it invalid\n // regardless of what our internal validation thinks, and regardless\n // of whether the field has been modified.\n return true;\n }\n\n if (!this.isModified) {\n return false;\n }\n\n const element = this.getInputElement();\n\n return !(element && element.checkValidity());\n };\n\n private getInputElement = (): HTMLInputElement | HTMLTextAreaElement => {\n let elementName = 'input';\n if (this.type === 'textarea') {\n elementName = 'textarea';\n }\n\n return this.limelInputField.shadowRoot.querySelector(elementName);\n };\n\n private renderLabel = () => {\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !!this.value || this.isFocused || this.readonly,\n };\n\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"mdc-notched-outline__notch\">\n <span class={labelClassList} id={this.labelId}>\n {this.label}\n </span>\n </span>\n );\n };\n\n private renderLeadingIcon = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n if (this.leadingIcon) {\n return (\n <i class=\"material-icons mdc-text-field__icon mdc-text-field__icon--leading\">\n <limel-icon name={this.leadingIcon} />\n </i>\n );\n }\n };\n\n private renderTrailingLinkOrButton = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n const html = [];\n\n const trailingIcon = this.getTrailingIcon();\n\n if (!this.isInvalid() && this.hasLink()) {\n html.push(this.renderLinkIcon(this.getLink(), trailingIcon));\n } else if (trailingIcon) {\n html.push(this.renderTrailingIcon(trailingIcon));\n }\n\n return html;\n };\n\n private hasLink = () => {\n return (\n this.showLink &&\n ['email', 'tel', 'url', 'urlAsText'].includes(this.type)\n );\n };\n\n private getLink = () => {\n const props: LinkProperties = { href: '' };\n switch (this.type) {\n case 'email':\n props.href = `mailto:${this.value}`;\n break;\n case 'tel':\n props.href = `tel:${this.value}`;\n break;\n default:\n props.href = getHref(this.value);\n props.target = getTarget(this.value);\n }\n\n return props;\n };\n\n private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {\n // If the trailing icon uses the class `mdc-text-field__icon--trailing`,\n // MDC attaches a click handler to it, which apparently runs\n // `preventDefault()` on the event. For links, we don't want that,\n // so instead of `mdc-text-field__icon--trailing`, we use our own class\n // `lime-trailing-icon-for-link`, which uses all the same styling. /Ads\n return (\n <a\n {...linkProps}\n class=\"material-icons mdc-text-field__icon lime-trailing-icon-for-link\"\n tabindex={this.disabled || !this.value ? '-1' : '0'}\n role=\"button\"\n >\n <limel-icon name={icon} />\n </a>\n );\n };\n\n private renderTrailingIcon = (icon: string) => {\n const props: any = {\n tabIndex: this.isInvalid() ? '-1' : '0',\n };\n if (!this.isInvalid()) {\n props.onKeyPress = this.handleIconKeyPress;\n props.onClick = this.handleIconClick;\n props.role = 'button';\n }\n\n return (\n <i\n class=\"material-icons mdc-text-field__icon mdc-text-field__icon--trailing\"\n {...props}\n >\n <limel-icon name={icon} />\n </i>\n );\n };\n\n private getTrailingIcon = () => {\n if (this.isInvalid()) {\n return 'high_importance';\n }\n\n if (this.trailingIcon) {\n return this.trailingIcon;\n }\n\n if (this.showLink && this.type === 'email') {\n return 'filled_message';\n }\n\n if (this.showLink && this.type === 'tel') {\n return 'phone';\n }\n\n if (\n this.showLink &&\n (this.type === 'url' || this.type === 'urlAsText')\n ) {\n return 'external_link';\n }\n };\n\n private renderFormattedNumber = () => {\n if (this.type !== 'number') {\n return;\n }\n\n let renderValue = this.value;\n if (this.formatNumber && this.value) {\n renderValue = new Intl.NumberFormat(this.locale).format(\n Number(this.value),\n );\n }\n\n return (\n <span class=\"lime-formatted-input lime-looks-like-input-value\">\n {renderValue}\n </span>\n );\n };\n\n /**\n * Key handler for the input field\n * Will change focus to the first/last item in the dropdown list to enable selection with the keyboard\n *\n * @param event - event\n */\n\n private onKeyDown = (event: KeyboardEvent): void => {\n this.showCompletions = true;\n const isForwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n !event.shiftKey;\n const isUp =\n event.key === ARROW_UP || event.keyCode === ARROW_UP_KEY_CODE;\n const isDown =\n event.key === ARROW_DOWN || event.keyCode === ARROW_DOWN_KEY_CODE;\n\n if (event.keyCode === TAB_KEY_CODE && event.shiftKey) {\n this.showCompletions = false;\n }\n\n if (!isForwardTab && !isUp && !isDown) {\n return;\n }\n\n const list = document.querySelector(` #${this.portalId} limel-list`);\n\n if (!list) {\n return;\n }\n\n event.preventDefault();\n if (isForwardTab || isDown) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:first-child',\n );\n listElement.focus();\n\n return;\n }\n\n if (isUp) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:last-child',\n );\n listElement.focus();\n }\n };\n\n private handleCompletionChange = (\n event: LimelListCustomEvent<ListItem>,\n ) => {\n event.stopPropagation();\n if (!event.detail) {\n return;\n }\n\n this.showCompletions = false;\n\n /*\n This change event doesn't need to be debounced in itself, but we want\n to make absolutely sure that an earlier change event that *has* been\n debounced doesn't emit after this one. Therefore, we run this through\n the same debounced emitter function. /Ads\n */\n this.changeEmitter(event.detail.text);\n };\n\n private renderAutocompleteList = () => {\n if (this.type === 'textarea' || !this.completions.length) {\n return;\n }\n\n const dropdownZIndex = getComputedStyle(\n this.limelInputField,\n ).getPropertyValue('--dropdown-z-index');\n\n return (\n <limel-portal\n visible={this.showCompletions}\n containerId={this.portalId}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': dropdownZIndex }}\n >\n <limel-menu-surface\n open={this.showCompletions}\n allowClicksElement={this.limelInputField}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n }}\n onDismiss={this.handleCloseMenu}\n >\n {this.renderListResult()}\n </limel-menu-surface>\n </limel-portal>\n );\n };\n\n private renderListResult = () => {\n const filteredCompletions: ListItem[] = this.filterCompletions(\n this.value,\n );\n if (!filteredCompletions || filteredCompletions.length === 0) {\n return null;\n }\n\n return (\n <limel-list\n onChange={this.handleCompletionChange}\n onKeyDown={this.handleKeyDownInDropdown}\n type=\"selectable\"\n items={filteredCompletions}\n />\n );\n };\n\n private handleKeyDownInDropdown = (event: KeyboardEvent) => {\n const keyFound = [TAB, ESCAPE, ENTER].includes(event.key);\n const keyCodeFound = [\n TAB_KEY_CODE,\n ESCAPE_KEY_CODE,\n ENTER_KEY_CODE,\n ].includes(event.keyCode);\n if (keyFound || keyCodeFound) {\n this.setFocus();\n }\n };\n\n private handleCloseMenu = () => {\n this.showCompletions = false;\n };\n\n private filterCompletions = (filter: string) => {\n if (!filter) {\n return this.completionsList;\n }\n\n return this.completionsList.filter(\n (completion) =>\n completion.text.toLowerCase().indexOf(filter.toLowerCase()) >\n -1,\n );\n };\n\n private handleChange = (event) => {\n event.stopPropagation();\n let value = event.target.value;\n\n if (this.type === 'number') {\n if (!value && event.data) {\n event.stopPropagation();\n\n return;\n }\n\n if (value) {\n value = Number(value);\n }\n }\n\n this.changeEmitter(value);\n };\n\n private changeEmitter = (value: string) => {\n this.change.emit(value);\n };\n\n private handleIconClick = () => {\n if (!this.isInvalid()) {\n this.action.emit();\n }\n };\n\n private handleIconKeyPress = (event: KeyboardEvent) => {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if ((isSpace || isEnter) && !this.isInvalid()) {\n this.action.emit();\n }\n };\n\n private handleWheel = () => {\n // This empty event handler is here to circumvent a bug.\n // In some browsers (Chrome for example), hovering the input with\n // the input focused, and scrolling, will both change the value\n // AND scroll the page. We would prefer to never change the value\n // on scroll, instead always scrolling the page, but since we\n // haven't found a way to do that, this is the next best thing, as\n // it prevents the page from being scrolled, but only in the\n // circumstances when the value is changed by the scrolling.\n // Please test THOROUGHLY if you remove this event handler 😄\n };\n}\n"]}
1
+ {"version":3,"file":"input-field.js","sourceRoot":"","sources":["../../../src/components/input-field/input-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACH,UAAU,EACV,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,cAAc,EACd,MAAM,EACN,eAAe,EACf,KAAK,EACL,cAAc,EACd,GAAG,EACH,YAAY,GACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE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C,QAAQ,EAAE,CAAC;KACnB;EACL,CAAC;EAGS,kBAAkB;IACxB,IAAI,CAAC,cAAc,EAAE,CAAC;EAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsnBJ","sourcesContent":["import { MDCTextField } from '@material/textfield';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { debounce } from 'lodash-es';\nimport {\n ARROW_DOWN,\n ARROW_DOWN_KEY_CODE,\n ARROW_UP,\n ARROW_UP_KEY_CODE,\n ENTER,\n ENTER_KEY_CODE,\n ESCAPE,\n ESCAPE_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\nimport { InputType } from '../input-field/input-field.types';\nimport { ListItem } from '../list/list-item.types';\nimport { getHref, getTarget } from '../../util/link-helper';\nimport { JSXBase } from '@stencil/core/internal';\nimport { createRandomString } from '../../util/random-string';\nimport { LimelListCustomEvent } from '../../components';\nimport { globalConfig } from '../../global/config';\n\ninterface LinkProperties {\n href: string;\n target?: string;\n}\n\nconst DEBOUNCE_TIMEOUT = 300;\n\n/**\n * @exampleComponent limel-example-input-field-text\n * @exampleComponent limel-example-input-field-placeholder\n * @exampleComponent limel-example-input-field-text-multiple\n * @exampleComponent limel-example-input-field-number\n * @exampleComponent limel-example-input-field-autocomplete\n * @exampleComponent limel-example-input-field-icon-leading\n * @exampleComponent limel-example-input-field-icon-trailing\n * @exampleComponent limel-example-input-field-icon-both\n * @exampleComponent limel-example-input-field-showlink\n * @exampleComponent limel-example-input-field-error-icon\n * @exampleComponent limel-example-input-field-textarea\n * @exampleComponent limel-example-input-field-suffix\n * @exampleComponent limel-example-input-field-prefix\n * @exampleComponent limel-example-input-field-search\n * @exampleComponent limel-example-input-field-pattern\n * @exampleComponent limel-example-input-field-focus\n */\n@Component({\n tag: 'limel-input-field',\n shadow: true,\n styleUrl: 'input-field.scss',\n})\nexport class InputField {\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * The placeholder text shown inside the input field, when the field is focused and empty.\n */\n @Prop({ reflect: true })\n public placeholder: string;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * A short piece of text to display before the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public prefix: string;\n\n /**\n * A short piece of text to display after the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public suffix: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * The value of the field.\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Trailing icon to show to the far right in the field.\n */\n @Prop({ reflect: true })\n public trailingIcon: string;\n\n /**\n * Leading icon to show to the far left in the field.\n */\n @Prop({ reflect: true })\n public leadingIcon: string;\n\n /**\n * Regular expression that the current value of the input field must match.\n * No forward slashes should be specified around the pattern.\n * Only used if type is `text`, `tel`, `email`, `url`, `urlAsText`,\n * `password`, or `search`.\n */\n @Prop({ reflect: true })\n public pattern: string;\n\n /**\n * Type of input.\n *\n * Note** regarding type `url`: `limel-input` uses the native validation\n * built into the browser for many types of input fields. The native\n * validation for `url` is very strict, and does not allow relative urls,\n * nor any other formats that are not a \"fully qualified\" url. To allow\n * such urls, use the type `urlAsText` instead. `urlAsText` works exactly\n * like `text` in all regards, except that it enables use of the `showLink`\n * property.\n */\n @Prop({ reflect: true })\n public type: InputType = 'text';\n\n /**\n * Set to `true` to format the current value of the input field only\n * if the field is of type number.\n * The number format is determined by the current language of the browser.\n */\n @Prop({ reflect: true })\n public formatNumber = true;\n\n /**\n * Incremental values that are valid if the field type is `number`.\n */\n @Prop({ reflect: true })\n public step: number | 'any' = 'any';\n\n /**\n * Maximum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public max: number;\n\n /**\n * Minimum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public min: number;\n\n /**\n * Maximum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public maxlength: number;\n\n /**\n * Minimum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public minlength: number;\n\n /**\n * list of suggestions `value` can autocomplete to.\n */\n @Prop()\n public completions: string[] = [];\n\n /**\n * For inputs of type `email`, `tel`, `url`, and `urlAsText`, set this to\n * `true` to show a trailing icon with a `mailto:`,`tel:`, or normal link,\n * respectively. The default icon can be overridden using the `trailingIcon`\n * property.\n */\n @Prop({ reflect: true })\n public showLink = false;\n\n /**\n * The locale to use for formatting numbers.\n */\n @Prop({ reflect: true })\n public locale: string = globalConfig.defaultLocale;\n\n /**\n * Emitted when the input value is changed.\n */\n @Event()\n private change: EventEmitter<string>;\n\n /**\n * Emitted when `trailingIcon` or `leadingIcon` is set\n * and the icon is interacted with.\n */\n @Event()\n private action: EventEmitter<void>;\n\n @Element()\n private limelInputField: HTMLLimelInputFieldElement;\n\n @State()\n private isFocused: boolean = false;\n\n @State()\n private wasInvalid: boolean = false;\n\n @State()\n public showCompletions: boolean = false;\n\n private inputElement?: HTMLInputElement | HTMLTextAreaElement;\n private mdcTextField: MDCTextField;\n private completionsList: ListItem[] = [];\n private portalId: string;\n private helperTextId: string;\n private labelId: string;\n\n private changeWaiting = false;\n\n constructor() {\n this.portalId = createRandomString();\n this.helperTextId = createRandomString();\n this.labelId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n public disconnectedCallback() {\n if (this.mdcTextField) {\n this.mdcTextField.destroy();\n }\n\n window.removeEventListener('resize', this.layout);\n this.limelInputField.removeEventListener('focus', this.setFocus);\n }\n\n public componentDidUpdate() {\n if (this.invalid) {\n this.mdcTextField.valid = false;\n }\n\n this.mdcTextField.disabled = this.disabled || this.readonly;\n }\n\n public render() {\n const properties = this.getAdditionalProps();\n properties['aria-labelledby'] = this.labelId;\n properties.class = 'mdc-text-field__input';\n properties.ref = this.setInputElement;\n properties.onInput = this.handleInput;\n properties.onChange = this.handleChange;\n properties.onFocus = this.onFocus;\n properties.onBlur = this.onBlur;\n properties.required = this.required;\n properties.readonly = this.readonly;\n properties.disabled = this.disabled || this.readonly;\n\n let ariaControls = '';\n\n if (this.hasHelperText()) {\n ariaControls += this.helperTextId;\n properties['aria-describedby'] = this.helperTextId;\n }\n\n if (this.renderAutocompleteList()) {\n if (ariaControls) {\n ariaControls += ' ';\n }\n\n ariaControls += this.portalId;\n }\n\n if (ariaControls) {\n properties['aria-controls'] = ariaControls;\n }\n\n return [\n <label class={this.getContainerClassList()}>\n <span class=\"mdc-notched-outline\" tabindex=\"-1\">\n <span class=\"mdc-notched-outline__leading\"></span>\n {this.renderLabel()}\n <span class=\"mdc-notched-outline__trailing\"></span>\n </span>\n {this.renderLeadingIcon()}\n {this.renderEmptyValueForReadonly()}\n {this.renderPrefix()}\n {this.renderFormattedNumber()}\n {this.renderInput(properties)}\n {this.renderSuffix()}\n {this.renderTextarea(properties)}\n {this.renderTrailingLinkOrButton()}\n </label>,\n this.renderHelperLine(),\n this.renderAutocompleteList(),\n ];\n }\n\n @Watch('value')\n protected valueWatcher(newValue: string) {\n if (!this.mdcTextField) {\n return;\n }\n\n if (this.changeWaiting) {\n return;\n }\n\n if (newValue !== this.mdcTextField.value) {\n this.mdcTextField.value = newValue || '';\n }\n\n if (this.wasInvalid) {\n this.validate();\n }\n }\n\n @Watch('completions')\n protected completionsWatcher() {\n this.mapCompletions();\n }\n\n private initialize = () => {\n const element =\n this.limelInputField.shadowRoot.querySelector('.mdc-text-field');\n if (!element) {\n return;\n }\n\n this.mdcTextField = new MDCTextField(element);\n if (this.value) {\n this.mdcTextField.value = this.value;\n }\n\n if (this.invalid) {\n this.mdcTextField.valid = false;\n }\n\n this.mapCompletions();\n\n window.addEventListener('resize', this.layout, { passive: true });\n this.limelInputField.addEventListener('focus', this.setFocus);\n };\n\n private mapCompletions = () => {\n this.completionsList = [...this.completions].map((item) => {\n return { text: item };\n });\n };\n\n private setFocus = () => {\n this.mdcTextField.focus();\n };\n\n private getContainerClassList = () => {\n const classList = {\n 'mdc-text-field': true,\n 'mdc-text-field--no-label': !this.label,\n 'mdc-text-field--outlined': true,\n 'mdc-text-field--invalid': this.isInvalid(),\n 'mdc-text-field--disabled': this.disabled || this.readonly,\n 'lime-text-field--readonly': this.readonly,\n 'mdc-text-field--required': this.required,\n 'lime-text-field--empty': this.isEmpty(),\n 'lime-has-prefix': this.hasPrefix(),\n 'lime-has-suffix': this.hasSuffix(),\n };\n\n if (this.type === 'textarea') {\n classList['mdc-text-field--textarea'] = true;\n classList['has-helper-line'] =\n !!this.helperText || !!this.maxlength;\n } else {\n classList['mdc-text-field--with-leading-icon'] = !!this.leadingIcon;\n classList['mdc-text-field--with-trailing-icon'] =\n !!this.getTrailingIcon();\n }\n\n return classList;\n };\n\n private isEmpty = () => {\n if (this.type === 'number' && this.inputElement?.validity.badInput) {\n return false;\n }\n\n return !this.getCurrentValue();\n };\n\n private getCurrentValue = () => {\n if (this.changeWaiting && this.inputElement) {\n return this.inputElement.value;\n }\n\n return this.value;\n };\n\n private renderInput = (\n properties: JSXBase.InputHTMLAttributes<HTMLInputElement>,\n ) => {\n if (this.type === 'textarea') {\n return;\n }\n\n const type = this.type === 'urlAsText' ? 'text' : this.type;\n\n return (\n <input\n {...properties}\n type={type}\n pattern={this.pattern}\n onWheel={this.handleWheel}\n onKeyDown={this.onKeyDown}\n placeholder={this.placeholder}\n />\n );\n };\n\n private renderTextarea = (\n properties: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>,\n ) => {\n if (this.type !== 'textarea') {\n return;\n }\n\n return (\n <span class=\"mdc-text-field__resizer\">\n <textarea\n {...properties}\n placeholder={this.placeholder}\n ></textarea>\n </span>\n );\n };\n\n private layout = () => {\n this.mdcTextField?.layout();\n };\n\n private getAdditionalProps = () => {\n const props: any = {};\n\n if (this.type === 'number') {\n props.step = this.step;\n }\n\n if (this.type === 'number' && Number.isInteger(this.min)) {\n props.min = this.min;\n }\n\n if (this.type === 'number' && Number.isInteger(this.max)) {\n props.max = this.max;\n }\n\n if (this.minlength) {\n props.minlength = this.minlength;\n }\n\n if (this.maxlength) {\n props.maxlength = this.maxlength;\n }\n\n return props;\n };\n\n private onFocus = () => {\n this.isFocused = true;\n this.showCompletions = true;\n };\n\n private onBlur = () => {\n this.isFocused = false;\n this.validate();\n this.changeEmitter.flush();\n };\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private hasHelperLine = () => {\n return this.maxlength || this.hasHelperText();\n };\n\n private renderHelperLine = () => {\n const text: string = this.getCurrentValue() || '';\n const length = text.length;\n\n if (!this.hasHelperLine()) {\n return;\n }\n\n return (\n <limel-helper-line\n helperTextId={this.helperTextId}\n helperText={this.helperText}\n length={length}\n maxLength={this.maxlength}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private renderEmptyValueForReadonly = () => {\n if (this.readonly && this.isEmpty()) {\n return (\n <span class=\"lime-empty-value-for-readonly lime-looks-like-input-value\">\n –\n </span>\n );\n }\n };\n\n private renderSuffix = () => {\n if (!this.hasSuffix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--suffix': true,\n };\n\n return <span class={classList}>{this.suffix}</span>;\n };\n\n private hasSuffix = () => {\n return this.suffix !== null && this.suffix !== undefined;\n };\n\n private renderPrefix = () => {\n if (!this.hasPrefix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--prefix': true,\n };\n\n return <span class={classList}>{this.prefix}</span>;\n };\n\n private hasPrefix = () => {\n return this.prefix !== null && this.prefix !== undefined;\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n // `this.invalid` is set by the consumer. If the consumer explicitly\n // told us to consider the field invalid, we consider it invalid\n // regardless of what our internal validation thinks, and regardless\n // of whether the field has been modified.\n return true;\n }\n\n return this.wasInvalid;\n };\n\n private validate = () => {\n if (this.readonly || this.invalid) {\n this.wasInvalid = false;\n\n return;\n }\n\n if (this.inputElement) {\n this.wasInvalid = !this.inputElement.checkValidity();\n }\n };\n\n private setInputElement = (\n element?: HTMLInputElement | HTMLTextAreaElement,\n ) => {\n if (element) {\n this.inputElement = element;\n }\n };\n\n private renderLabel = () => {\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !this.isEmpty() || this.isFocused || this.readonly,\n };\n\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"mdc-notched-outline__notch\">\n <span class={labelClassList} id={this.labelId}>\n {this.label}\n </span>\n </span>\n );\n };\n\n private renderLeadingIcon = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n if (this.leadingIcon) {\n return (\n <i class=\"material-icons mdc-text-field__icon mdc-text-field__icon--leading\">\n <limel-icon name={this.leadingIcon} />\n </i>\n );\n }\n };\n\n private renderTrailingLinkOrButton = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n const trailingIcon = this.getTrailingIcon();\n\n if (!this.isInvalid() && this.hasLink()) {\n return this.renderLinkIcon(this.getLink(), trailingIcon);\n } else if (trailingIcon) {\n return this.renderTrailingIcon(trailingIcon);\n }\n };\n\n private hasLink = () => {\n return (\n this.showLink &&\n ['email', 'tel', 'url', 'urlAsText'].includes(this.type)\n );\n };\n\n private getLink = () => {\n const props: LinkProperties = { href: '' };\n switch (this.type) {\n case 'email':\n props.href = `mailto:${this.value}`;\n break;\n case 'tel':\n props.href = `tel:${this.value}`;\n break;\n default:\n props.href = getHref(this.value);\n props.target = getTarget(this.value);\n }\n\n return props;\n };\n\n private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {\n // If the trailing icon uses the class `mdc-text-field__icon--trailing`,\n // MDC attaches a click handler to it, which apparently runs\n // `preventDefault()` on the event. For links, we don't want that,\n // so instead of `mdc-text-field__icon--trailing`, we use our own class\n // `lime-trailing-icon-for-link`, which uses all the same styling. /Ads\n return (\n <a\n {...linkProps}\n class=\"material-icons mdc-text-field__icon lime-trailing-icon-for-link\"\n tabindex={this.disabled || this.isEmpty() ? '-1' : '0'}\n role=\"button\"\n >\n <limel-icon name={icon} />\n </a>\n );\n };\n\n private renderTrailingIcon = (icon: string) => {\n if (this.isInvalid()) {\n return (\n <i\n key=\"invalid\"\n class=\"material-icons mdc-text-field__icon invalid-icon\"\n >\n <limel-icon name={icon} />\n </i>\n );\n }\n\n return (\n <i\n key=\"action\"\n class=\"material-icons mdc-text-field__icon mdc-text-field__icon--trailing\"\n tabIndex={0}\n role=\"button\"\n onKeyPress={this.handleIconKeyPress}\n onClick={this.handleIconClick}\n >\n <limel-icon name={icon} />\n </i>\n );\n };\n\n private getTrailingIcon = () => {\n if (this.isInvalid()) {\n return 'high_importance';\n }\n\n if (this.trailingIcon) {\n return this.trailingIcon;\n }\n\n if (this.showLink && this.type === 'email') {\n return 'filled_message';\n }\n\n if (this.showLink && this.type === 'tel') {\n return 'phone';\n }\n\n if (\n this.showLink &&\n (this.type === 'url' || this.type === 'urlAsText')\n ) {\n return 'external_link';\n }\n };\n\n private renderFormattedNumber = () => {\n if (this.type !== 'number') {\n return;\n }\n\n let renderValue = this.value;\n if (this.formatNumber && this.value) {\n renderValue = new Intl.NumberFormat(this.locale).format(\n Number(this.value),\n );\n if (renderValue === 'NaN') {\n return;\n }\n }\n\n return (\n <span class=\"lime-formatted-input lime-looks-like-input-value\">\n {renderValue}\n </span>\n );\n };\n\n /**\n * Key handler for the input field\n * Will change focus to the first/last item in the dropdown list to enable selection with the keyboard\n *\n * @param event - event\n */\n\n private onKeyDown = (event: KeyboardEvent): void => {\n this.showCompletions = true;\n const isForwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n !event.shiftKey;\n const isUp =\n event.key === ARROW_UP || event.keyCode === ARROW_UP_KEY_CODE;\n const isDown =\n event.key === ARROW_DOWN || event.keyCode === ARROW_DOWN_KEY_CODE;\n\n if (event.keyCode === TAB_KEY_CODE && event.shiftKey) {\n this.showCompletions = false;\n }\n\n if (!isForwardTab && !isUp && !isDown) {\n return;\n }\n\n const list = document.querySelector(` #${this.portalId} limel-list`);\n\n if (!list) {\n return;\n }\n\n event.preventDefault();\n if (isForwardTab || isDown) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:first-child',\n );\n listElement.focus();\n\n return;\n }\n\n if (isUp) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:last-child',\n );\n listElement.focus();\n }\n };\n\n private handleCompletionChange = (\n event: LimelListCustomEvent<ListItem>,\n ) => {\n event.stopPropagation();\n if (!event.detail) {\n return;\n }\n\n this.showCompletions = false;\n\n /*\n This change event doesn't need to be debounced in itself, but we want\n to make absolutely sure that an earlier change event that *has* been\n debounced doesn't emit after this one. Therefore, we run this through\n the same debounced emitter function. /Ads\n */\n this.changeEmitter(event.detail.text);\n this.changeEmitter.flush();\n };\n\n private renderAutocompleteList = () => {\n if (this.type === 'textarea' || !this.completions.length) {\n return;\n }\n\n const dropdownZIndex = getComputedStyle(\n this.limelInputField,\n ).getPropertyValue('--dropdown-z-index');\n\n return (\n <limel-portal\n visible={this.showCompletions}\n containerId={this.portalId}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': dropdownZIndex }}\n >\n <limel-menu-surface\n open={this.showCompletions}\n allowClicksElement={this.limelInputField}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n }}\n onDismiss={this.handleCloseMenu}\n >\n {this.renderListResult()}\n </limel-menu-surface>\n </limel-portal>\n );\n };\n\n private renderListResult = () => {\n const filteredCompletions: ListItem[] = this.filterCompletions(\n this.getCurrentValue(),\n );\n if (!filteredCompletions || filteredCompletions.length === 0) {\n return null;\n }\n\n return (\n <limel-list\n onChange={this.handleCompletionChange}\n onKeyDown={this.handleKeyDownInDropdown}\n type=\"selectable\"\n items={filteredCompletions}\n />\n );\n };\n\n private handleKeyDownInDropdown = (event: KeyboardEvent) => {\n const keyFound = [TAB, ESCAPE, ENTER].includes(event.key);\n const keyCodeFound = [\n TAB_KEY_CODE,\n ESCAPE_KEY_CODE,\n ENTER_KEY_CODE,\n ].includes(event.keyCode);\n if (keyFound || keyCodeFound) {\n this.setFocus();\n }\n };\n\n private handleCloseMenu = () => {\n this.showCompletions = false;\n };\n\n private filterCompletions = (filter: string) => {\n if (!filter) {\n return this.completionsList;\n }\n\n return this.completionsList.filter(\n (completion) =>\n completion.text.toLowerCase().indexOf(filter.toLowerCase()) >\n -1,\n );\n };\n\n private handleInput = (event) => {\n event.stopPropagation();\n let value = event.target.value;\n\n if (this.type === 'number') {\n if (!value && event.data) {\n event.stopPropagation();\n\n return;\n }\n\n if (value) {\n value = Number(value);\n }\n }\n\n this.changeWaiting = true;\n this.changeEmitter(value);\n };\n\n private changeEmitter = debounce((value: string) => {\n this.change.emit(value);\n this.changeWaiting = false;\n }, DEBOUNCE_TIMEOUT);\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n this.changeEmitter.flush();\n };\n\n private handleIconClick = () => {\n this.action.emit();\n };\n\n private handleIconKeyPress = (event: KeyboardEvent) => {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if (isSpace || isEnter) {\n this.action.emit();\n }\n };\n\n private handleWheel = () => {\n // This empty event handler is here to circumvent a bug.\n // In some browsers (Chrome for example), hovering the input with\n // the input focused, and scrolling, will both change the value\n // AND scroll the page. We would prefer to never change the value\n // on scroll, instead always scrolling the page, but since we\n // haven't found a way to do that, this is the next best thing, as\n // it prevents the page from being scrolled, but only in the\n // circumstances when the value is changed by the scrolling.\n // Please test THOROUGHLY if you remove this event handler 😄\n };\n}\n"]}
@@ -237,7 +237,7 @@ $cropped-label-hack--font-size: 0.875rem; //14px
237
237
  box-shadow: 0 0 0 functions.pxToRem(2) var(--mdc-theme-primary) !important; // has to be `!important` since we're using `box-shadow` insted of `outline` which is also used in `hover` mode
238
238
  }
239
239
  }
240
- &:hover {
240
+ &:not(.mdc-text-field--disabled):hover {
241
241
  .mdc-text-field__icon--trailing {
242
242
  box-shadow: var(--button-shadow-normal);
243
243
  background-color: rgba(var(--contrast-100), 0.4);
@@ -253,27 +253,8 @@ $cropped-label-hack--font-size: 0.875rem; //14px
253
253
  }
254
254
  }
255
255
 
256
- &.mdc-text-field--disabled,
257
256
  &.mdc-text-field--invalid {
258
- // `mdc-text-field--invalid` displays a (!) icon, which we don't want it to appear interactive
259
- &:hover {
260
- .mdc-text-field__icon--trailing {
261
- box-shadow: none;
262
- background-color: transparent;
263
-
264
- &:hover {
265
- background-color: transparent;
266
- box-shadow: none;
267
- }
268
-
269
- &:active {
270
- box-shadow: none;
271
- }
272
- }
273
- }
274
- }
275
- &.mdc-text-field--invalid {
276
- i.mdc-text-field__icon.mdc-text-field__icon--trailing {
257
+ i.mdc-text-field__icon.invalid-icon {
277
258
  limel-icon {
278
259
  color: var(--lime-error-text-color);
279
260
  }
@@ -310,9 +291,6 @@ $cropped-label-hack--font-size: 0.875rem; //14px
310
291
  color: var(--lime-error-text-color);
311
292
  }
312
293
  }
313
- .mdc-text-field__icon--trailing {
314
- color: var(--lime-error-text-color);
315
- }
316
294
  }
317
295
 
318
296
  &.mdc-text-field--with-trailing-icon {