@dile/ui 3.22.0 → 3.23.0

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 (29) hide show
  1. package/components/button/src/DileButton.js +3 -0
  2. package/components/color-picker/src/DileColorPicker.js +6 -2
  3. package/components/drop-file/src/DileDropFile.js +3 -3
  4. package/components/form-group/form-group.js +5 -0
  5. package/components/form-group/index.js +1 -0
  6. package/components/form-group/src/DileFormGroup.js +188 -0
  7. package/components/input/src/DileInput.js +121 -30
  8. package/components/input/src/DileInputContact.js +38 -40
  9. package/components/input/src/DileInputIcon.js +7 -43
  10. package/components/input/src/DileInputInteger.js +8 -22
  11. package/components/input/src/DileInputMask.js +9 -15
  12. package/components/input/src/DileInputMoney.js +6 -23
  13. package/components/input/src/DileInputNumber.js +6 -12
  14. package/components/input/src/DileInputNumberMask.js +5 -12
  15. package/components/input/src/DileInputPercentage.js +8 -20
  16. package/components/input/src/DileInputSearch.js +5 -1
  17. package/components/menu-overlay/src/DileMenuOverlay.js +17 -0
  18. package/components/number-picker/src/DileNumberPicker.js +3 -2
  19. package/components/number-picker/src/DileNumberPickerElement.js +5 -0
  20. package/components/otp-input/src/DileOtpInput.js +5 -2
  21. package/components/password/src/DilePassword.js +19 -42
  22. package/components/select/src/DileSelectAjax.js +5 -3
  23. package/components/time-picker/src/DileTimePicker.js +5 -2
  24. package/components/wheel-picker/index.js +1 -0
  25. package/components/wheel-picker/src/DileWheelPicker.js +364 -0
  26. package/components/wheel-picker/wheel-picker.js +5 -0
  27. package/mixins/form/index.js +1 -1
  28. package/mixins/form/src/DileFieldMessage.js +4 -1
  29. package/package.json +2 -2
@@ -1,5 +1,4 @@
1
1
  import { LitElement, html, css } from 'lit';
2
- import { ifDefined } from 'lit/directives/if-defined.js';
3
2
  import { DileInput } from '../../input/index.js';
4
3
  import '@dile/iconlib/dile-iconlib.js';
5
4
  import '@dile/ui/components/tooltip/tooltip.js';
@@ -13,6 +12,8 @@ export class DileInputIcon extends DileInput {
13
12
  icon: { type: String },
14
13
  /** Callback function that receives the component instance when icon button is clicked */
15
14
  onIconClick: { type: Function },
15
+ /** Accessible name of the icon button. Defaults to the tooltip text */
16
+ iconLabel: { type: String },
16
17
  /** Tooltip text to show on icon hover */
17
18
  tooltip: { type: String },
18
19
  /** Tooltip position: "top", "bottom", "left", "right" */
@@ -69,52 +70,15 @@ export class DileInputIcon extends DileInput {
69
70
  super();
70
71
  this.icon = '';
71
72
  this.onIconClick = null;
73
+ this.iconLabel = '';
72
74
  this.tooltip = '';
73
75
  this.tooltipPosition = 'top';
74
76
  this.tooltipFadeIn = false;
75
77
  this.tooltipArrow = false;
76
78
  }
77
79
 
78
- render() {
79
- return html`
80
- <main>
81
- ${this.labelTemplate}
82
- <section class="for-input">
83
- ${this.inputTemplate}
84
- ${this.icon ? this.renderIconButton() : ''}
85
- ${this.labelRight ? html`<span class="labelright">${this.labelRight}</span>` : ''}
86
- </section>
87
- ${this.messageTemplate}
88
- </main>
89
- `;
90
- }
91
-
92
- get labelTemplate() {
93
- return this.label
94
- ? html`<label for="textField">${this.label}</label>`
95
- : '';
96
- }
97
-
98
- get inputTemplate() {
99
- return html`
100
- <input
101
- type="${this.availableType(this.type)}"
102
- id="textField"
103
- name="${this.name}"
104
- aria-label="${ifDefined(this.inputAriaLabel)}"
105
- placeholder="${this.placeholder}"
106
- ?disabled="${this.disabled}"
107
- ?readonly="${this.readonly}"
108
- autocomplete="${this.disableAutocomplete ? 'off' : 'on'}"
109
- .value="${this.computeValue(this.value)}"
110
- class="${this.errored ? 'errored' : ''}"
111
- @keypress="${this._lookForEnter}"
112
- @input="${this._input}"
113
- @blur="${this.doBlur}"
114
- @focus="${this.doFocus}"
115
- ?selectonfocus="${this.selectOnFocus}"
116
- >
117
- `;
80
+ get fieldEndTemplate() {
81
+ return this.icon ? this.renderIconButton() : '';
118
82
  }
119
83
 
120
84
  get iconTemplate() {
@@ -126,8 +90,8 @@ export class DileInputIcon extends DileInput {
126
90
  class="input-icon-btn"
127
91
  type="button"
128
92
  @click="${this._handleIconClick}"
129
- ?disabled="${this.disabled}"
130
- aria-label="Icon action button"
93
+ ?disabled="${this.isDisabled}"
94
+ aria-label="${this.iconLabel || this.tooltip || 'Icon action button'}"
131
95
  >
132
96
  ${this.iconTemplate}
133
97
  </button>`;
@@ -14,33 +14,19 @@ export class DileInputInteger extends DileInput {
14
14
  `
15
15
  ];
16
16
 
17
- constructor() {
18
- super();
19
- this.changed = false;
20
- }
21
-
17
+ /** Normalizes the typed text on blur. The element-changed event is dispatched by DileInput when the value changes */
22
18
  doBlur(e) {
23
- let num = e.target.value;
24
- if(num.length > 0) {
25
- num = this.formatInteger(num);
26
- }
27
- if(num != e.target.value || this.changed) {
19
+ const typed = e.target.value;
20
+ const num = typed.length > 0 ? this.formatInteger(typed) : typed;
21
+ if (num !== typed) {
28
22
  this.el.value = num;
29
- this.value = num;
30
- this.emmitChange();
31
- this.changed = false;
32
23
  }
24
+ this.value = num;
33
25
  }
34
26
 
27
+ /** Returns the integer as a string, or '0' when the text is not a number */
35
28
  formatInteger(num) {
36
- num = parseInt(num);
37
- return isNaN(num) ? '0' : num;
38
- }
39
-
40
- updated(changedProperties) {
41
- super.updated(changedProperties);
42
- if(changedProperties.has('value') && this.value) {
43
- this.changed = true;
44
- }
29
+ num = parseInt(num, 10);
30
+ return isNaN(num) ? '0' : String(num);
45
31
  }
46
32
  }
@@ -20,17 +20,19 @@ export class DileInputMask extends DileInput {
20
20
  this.content = '';
21
21
  this.language = 'en';
22
22
  this.lazySeparators = false;
23
- this._keyDownHandler = this.handleKeyDown.bind(this);
24
- this._blurHandler = this.handleBlur.bind(this);
25
23
  }
26
24
 
27
25
  firstUpdated() {
28
26
  super.firstUpdated();
29
27
  this.createMaskController(this.mask);
30
- if (this.el) {
31
- this.el.addEventListener('keydown', this._keyDownHandler);
32
- this.el.addEventListener('blur', this._blurHandler);
33
- }
28
+ }
29
+
30
+ doKeydown(e) {
31
+ this.handleKeyDown(e);
32
+ }
33
+
34
+ doBlur(e) {
35
+ this.handleBlur(e);
34
36
  }
35
37
 
36
38
  createMaskController(mask) {
@@ -53,20 +55,12 @@ export class DileInputMask extends DileInput {
53
55
  this.updateMaskedValue();
54
56
  }
55
57
  if (changedProperties.has('value')) {
56
- const transformedValue = this.maskController.transformValue(this.value.slice(0, this.maxChars));
58
+ const transformedValue = this.maskController.transformValue(String(this.value ?? '').slice(0, this.maxChars));
57
59
  this.content = transformedValue;
58
60
  this.updateMaskedValue();
59
61
  }
60
62
  }
61
63
 
62
- disconnectedCallback() {
63
- if (this.el) {
64
- this.el.removeEventListener('keydown', this._keyDownHandler);
65
- this.el.removeEventListener('blur', this._blurHandler);
66
- }
67
- super.disconnectedCallback();
68
- }
69
-
70
64
  updateMaskedValue() {
71
65
  this.maskedValue = this.maskController.maskIt(this.content);
72
66
  }
@@ -25,16 +25,10 @@ export class DileInputMoney extends DileInput {
25
25
  this.decimalSeparator = '.';
26
26
  }
27
27
 
28
+ /** Normalizes the typed text on blur. The element-changed event is dispatched by DileInput when the value changes */
28
29
  doBlur(e) {
29
- let num = e.target.value;
30
- if(num.length > 0) {
31
- num = this.formatMoney(num);
32
- }
33
- if(num != e.target.value || this.changed) {
34
- this.value = num;
35
- this.emmitChange();
36
- this.changed = false;
37
- }
30
+ const typed = e.target.value;
31
+ this.value = typed.length > 0 ? this.formatMoney(typed) : typed;
38
32
  }
39
33
 
40
34
  set(value) {
@@ -43,11 +37,11 @@ export class DileInputMoney extends DileInput {
43
37
  }
44
38
 
45
39
  doFormat() {
46
- this.value = this.formatMoney(this.value.toString());
40
+ this.value = this.formatMoney(this.value);
47
41
  }
48
42
 
49
43
  formatMoney(num) {
50
- num = num.replace(this.decimalSeparator, '.');
44
+ num = String(num ?? '').replace(this.decimalSeparator, '.');
51
45
  num = parseFloat(num);
52
46
  if(isNaN(num)) {
53
47
  return '0.00';
@@ -56,18 +50,7 @@ export class DileInputMoney extends DileInput {
56
50
  }
57
51
  }
58
52
 
59
- updated(changedProperties) {
60
- super.updated(changedProperties);
61
- if(changedProperties.has('value') && this.value) {
62
- this.changed = true;
63
- }
64
- }
65
-
66
53
  computeValue(value) {
67
- if(value) {
68
- value = value.toString();
69
- return value.replace('.', this.decimalSeparator);
70
- }
71
- return '';
54
+ return String(value ?? '').replace('.', this.decimalSeparator);
72
55
  }
73
56
  }
@@ -36,7 +36,6 @@ export class DileInputNumber extends DileInput {
36
36
  this.step = 'any';
37
37
  this.decimals = null;
38
38
  this.normalizeOn = 'input';
39
- this.changed = false;
40
39
  this.viewValueOnFocus = null;
41
40
  this.isInputFocused = false;
42
41
  }
@@ -46,6 +45,10 @@ export class DileInputNumber extends DileInput {
46
45
  this.syncNativeInputConstraints();
47
46
  }
48
47
 
48
+ get inputModeValue() {
49
+ return 'decimal';
50
+ }
51
+
49
52
  get safeDecimalSeparator() {
50
53
  return this.decimalSeparator === ',' ? ',' : '.';
51
54
  }
@@ -243,13 +246,8 @@ export class DileInputNumber extends DileInput {
243
246
  doBlur(e) {
244
247
  this.isInputFocused = false;
245
248
  this.viewValueOnFocus = null;
246
- const num = this.normalizeAndConstrain(e.target.value);
247
-
248
- if (num !== e.target.value || this.changed) {
249
- this.value = num;
250
- this.emmitChange();
251
- this.changed = false;
252
- }
249
+ // element-changed is dispatched by DileInput when the value changes
250
+ this.value = this.normalizeAndConstrain(e.target.value);
253
251
 
254
252
  if (this.normalizeOnBlur) {
255
253
  this.el.value = this.computeValue(this.value);
@@ -269,10 +267,6 @@ export class DileInputNumber extends DileInput {
269
267
  return;
270
268
  }
271
269
 
272
- if (changedProperties.has('value') && this.value) {
273
- this.changed = true;
274
- }
275
-
276
270
  if (changedProperties.has('min') || changedProperties.has('max') || changedProperties.has('step') || changedProperties.has('decimals')) {
277
271
  if (this.value) {
278
272
  const normalized = this.normalizeAndConstrain(this.value);
@@ -16,15 +16,15 @@ export class DileInputNumberMask extends DileInput {
16
16
  this.mask = '';
17
17
  this.maskedValue = '';
18
18
  this.content = '';
19
- this._keyDownHandler = this.handleKeyDown.bind(this);
20
19
  }
21
20
 
22
21
  firstUpdated() {
23
22
  super.firstUpdated();
24
23
  this.createMaskController(this.mask);
25
- if (this.el) {
26
- this.el.addEventListener('keydown', this._keyDownHandler);
27
- }
24
+ }
25
+
26
+ doKeydown(e) {
27
+ this.handleKeyDown(e);
28
28
  }
29
29
 
30
30
  createMaskController(mask) {
@@ -39,18 +39,11 @@ export class DileInputNumberMask extends DileInput {
39
39
  this.updateMaskedValue();
40
40
  }
41
41
  if (changedProperties.has('value')) {
42
- this.content = this.value.slice(0, this.maxChars);
42
+ this.content = String(this.value ?? '').slice(0, this.maxChars);
43
43
  this.updateMaskedValue();
44
44
  }
45
45
  }
46
46
 
47
- disconnectedCallback() {
48
- if (this.el) {
49
- this.el.removeEventListener('keydown', this._keyDownHandler);
50
- }
51
- super.disconnectedCallback();
52
- }
53
-
54
47
  updateMaskedValue() {
55
48
  this.maskedValue = this.maskController.maskIt(this.content);
56
49
  }
@@ -23,36 +23,24 @@ export class DileInputPercentage extends DileInput {
23
23
  this.decimalSeparator = '.';
24
24
  }
25
25
 
26
+ /** Normalizes the typed text on blur. The element-changed event is dispatched by DileInput when the value changes */
26
27
  doBlur(e) {
27
- let num = e.target.value;
28
- if(num.length > 0) {
29
- num = this.formatFloat(num);
30
- }
31
- if(num != e.target.value || this.changed) {
32
- this.value = num;
33
- this.emmitChange();
34
- this.changed = false;
35
- }
28
+ const typed = e.target.value;
29
+ this.value = typed.length > 0 ? this.formatFloat(typed) : typed;
36
30
  }
37
31
 
38
32
  doFormat() {
39
33
  this.value = this.formatFloat(this.value);
40
34
  }
41
35
 
36
+ /** Returns the number as a string with "." as decimal separator, or '0' when the text is not a number */
42
37
  formatFloat(num) {
43
- num = num.replace(this.decimalSeparator, '.');
44
- num = parseFloat(num);
45
- return isNaN(num) ? '0' : num;
46
- }
47
-
48
- updated(changedProperties) {
49
- super.updated(changedProperties);
50
- if(changedProperties.has('value') && this.value) {
51
- this.changed = true;
52
- }
38
+ const text = String(num ?? '').replace(this.decimalSeparator, '.');
39
+ const parsed = parseFloat(text);
40
+ return isNaN(parsed) ? '0' : String(parsed);
53
41
  }
54
42
 
55
43
  computeValue(value) {
56
- return value.toString().replace('.', this.decimalSeparator);
44
+ return String(value ?? '').replace('.', this.decimalSeparator);
57
45
  }
58
46
  }
@@ -1,4 +1,5 @@
1
1
  import { LitElement, html, css } from 'lit';
2
+ import { ifDefined } from 'lit/directives/if-defined.js';
2
3
  import '../../icon/icon.js';
3
4
  import { searchIcon, clearIcon } from '@dile/icons/index.js';
4
5
 
@@ -102,6 +103,8 @@ export class DileInputSearch extends LitElement {
102
103
  _hasErrorContent: { state: true },
103
104
  /** Accessible name of the input field, read by screen readers. Defaults to name, or to searchButtonLabel. */
104
105
  accessibleLabel: { type: String },
106
+ /** Accessible description of the input, applied as aria-description (e.g. a validation message rendered outside this component) */
107
+ accessibleDescription: { type: String },
105
108
  /** Accessible name of the button when the field is empty */
106
109
  searchButtonLabel: { type: String },
107
110
  /** Accessible name of the button that clears the field */
@@ -145,7 +148,8 @@ export class DileInputSearch extends LitElement {
145
148
  ?disabled="${this.disabled}"
146
149
  ?readonly="${this.readOnly}"
147
150
  aria-label="${this.accessibleLabel || this.name || this.searchButtonLabel}"
148
- ?aria-invalid="${this.errored}"
151
+ aria-invalid="${ifDefined(this.errored ? 'true' : undefined)}"
152
+ aria-description="${ifDefined(this.accessibleDescription || undefined)}"
149
153
  aria-describedby="${this.showErrorMessage ? 'error-msg' : null}"
150
154
  >
151
155
  <button
@@ -80,6 +80,7 @@ export class DileMenuOverlay extends DileOverlay(DileCloseDocumentClick(LitEleme
80
80
  class="${this._overlayClass}"
81
81
  ?inert="${!this._overlayClass && !this._opening}"
82
82
  @click="${this.clickHandler}"
83
+ @keydown="${this._onOverlayKeydown}"
83
84
  >
84
85
  <slot name="content"></slot>
85
86
  </div>
@@ -105,6 +106,22 @@ export class DileMenuOverlay extends DileOverlay(DileCloseDocumentClick(LitEleme
105
106
  if (e.key !== 'Escape' || this._overlayClass !== 'opened') {
106
107
  return;
107
108
  }
109
+ // A key pressed inside the menu is handled when it bubbles up to the overlay,
110
+ // so the content can consume it first by calling preventDefault().
111
+ if (e.composedPath().includes(this.overlay)) {
112
+ return;
113
+ }
114
+ this._closeOnEsc(e);
115
+ }
116
+
117
+ _onOverlayKeydown(e) {
118
+ if (e.key !== 'Escape' || this._overlayClass !== 'opened' || e.defaultPrevented) {
119
+ return;
120
+ }
121
+ this._closeOnEsc(e);
122
+ }
123
+
124
+ _closeOnEsc(e) {
108
125
  // Only the menu closes: a modal or drawer that contains it stays opened until the next Escape.
109
126
  e.stopPropagation();
110
127
  this.close();
@@ -1,5 +1,5 @@
1
1
  import { LitElement, html, css } from 'lit';
2
- import { DileEmmitChange } from '../../../mixins/form/index.js';
2
+ import { DileEmmitChange, FIELD_MESSAGE_ID } from '../../../mixins/form/index.js';
3
3
  import '../number-picker-element.js';
4
4
  import { labelStyles } from '../../input/src/label-styles.js';
5
5
  import { messageStyles } from '../../input/src/message-styles.js';
@@ -81,6 +81,7 @@ export class DileNumberPicker extends DileEmmitChange(LitElement) {
81
81
  @dile-number-picker-value-changed=${this.valueChanged}
82
82
  ?focusOnStart=${this.focusOnStart}
83
83
  ?errored=${this.errored}
84
+ .accessibleDescription=${this.message || undefined}
84
85
  min=${this._numericMin(this.min)}
85
86
  max=${this._numericMax(this.max)}
86
87
  ?disabled=${this.disabled}
@@ -98,7 +99,7 @@ export class DileNumberPicker extends DileEmmitChange(LitElement) {
98
99
  get messageTemplate() {
99
100
  return html`
100
101
  ${this.message
101
- ? html`<div class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
102
+ ? html`<div id="${FIELD_MESSAGE_ID}" class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
102
103
  : ''
103
104
  }
104
105
  `
@@ -1,4 +1,5 @@
1
1
  import { html, css, LitElement } from "lit";
2
+ import { ifDefined } from "lit/directives/if-defined.js";
2
3
  import { arrowDropUpLargeIcon, arrowDropDownLargeIcon } from '@dile/icons';
3
4
  import '../../icon/icon.js'
4
5
 
@@ -81,6 +82,8 @@ export class DileNumberPickerElement extends LitElement {
81
82
  }
82
83
  },
83
84
  disabled: { type: Boolean },
85
+ /** Accessible description of the input, applied as aria-description (e.g. the validation message of the parent field) */
86
+ accessibleDescription: { type: String },
84
87
  };
85
88
  }
86
89
 
@@ -118,6 +121,8 @@ export class DileNumberPickerElement extends LitElement {
118
121
  id="elinput"
119
122
  @input=${this._onInput}
120
123
  ?disabled=${this.disabled}
124
+ aria-invalid=${ifDefined(this.errored ? 'true' : undefined)}
125
+ aria-description=${ifDefined(this.accessibleDescription || undefined)}
121
126
  >
122
127
  <div class="controls">
123
128
  <dile-icon .icon=${arrowDropUpLargeIcon} @click=${this.increment}></dile-icon>
@@ -1,5 +1,6 @@
1
1
  import { LitElement, html, css } from 'lit';
2
- import { DileEmmitChange } from '../../../mixins/form/index.js';
2
+ import { ifDefined } from 'lit/directives/if-defined.js';
3
+ import { DileEmmitChange, FIELD_MESSAGE_ID } from '../../../mixins/form/index.js';
3
4
  import { labelStyles, messageStyles } from '../../input/index.js';
4
5
  import { sanitizeOtpValue } from '../../../lib/otp/sanitizeOtpValue.js';
5
6
 
@@ -169,6 +170,8 @@ export class DileOtpInput extends DileEmmitChange(LitElement) {
169
170
  ?readonly="${this.readonly}"
170
171
  .value="${char}"
171
172
  class="${this.errored ? 'errored' : ''}"
173
+ aria-invalid="${ifDefined(this.errored ? 'true' : undefined)}"
174
+ aria-describedby="${ifDefined(this.message ? FIELD_MESSAGE_ID : undefined)}"
172
175
  @input="${(e) => this._onInput(e, index)}"
173
176
  @keydown="${(e) => this._onKeydown(e, index)}"
174
177
  @keypress="${this._lookForEnter}"
@@ -185,7 +188,7 @@ export class DileOtpInput extends DileEmmitChange(LitElement) {
185
188
  get messageTemplate() {
186
189
  return html`
187
190
  ${this.message
188
- ? html`<div class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
191
+ ? html`<div id="${FIELD_MESSAGE_ID}" class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
189
192
  : ''
190
193
  }
191
194
  `;
@@ -59,49 +59,26 @@ export class DilePassword extends DileInput {
59
59
  this.passwordVisible = false;
60
60
  }
61
61
 
62
- render() {
63
- const inputType = this.passwordVisible ? 'text' : 'password';
64
-
65
- return html`
66
- <div>
67
- ${this.label
68
- ? html`<label for="textField">${this.label}</label>`
69
- : ''
70
- }
71
- <section class="for-input">
72
- <input
73
- type="${inputType}"
74
- id="textField"
75
- name="${this.name}"
76
- placeholder="${this.placeholder}"
77
- ?disabled="${this.disabled}"
78
- @keypress="${this._lookForEnter}"
79
- @input="${this._input}"
80
- .value="${this.value}"
81
- class="${ this.errored ? 'errored' : '' }"
82
- >
83
- ${this.showPasswordToggle
84
- ? html`<button
85
- class="password-toggle-btn"
86
- type="button"
87
- @click="${this._togglePasswordVisibility}"
88
- ?disabled="${this.disabled}"
89
- aria-label="${this.passwordVisible ? 'Hide password' : 'Show password'}"
90
- >
91
- ${this.passwordVisible
92
- ? html`<dile-lucide-icon-eye></dile-lucide-icon-eye>`
93
- : html`<dile-lucide-icon-eye-off></dile-lucide-icon-eye-off>`
94
- }
95
- </button>`
96
- : ''
97
- }
98
- </section>
99
- ${this.message
100
- ? html`<div class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
101
- : ''
62
+ get inputType() {
63
+ return this.passwordVisible ? 'text' : 'password';
64
+ }
65
+
66
+ get fieldEndTemplate() {
67
+ if (!this.showPasswordToggle) {
68
+ return '';
69
+ }
70
+ return html`<button
71
+ class="password-toggle-btn"
72
+ type="button"
73
+ @click="${this._togglePasswordVisibility}"
74
+ ?disabled="${this.isDisabled}"
75
+ aria-label="${this.passwordVisible ? 'Hide password' : 'Show password'}"
76
+ >
77
+ ${this.passwordVisible
78
+ ? html`<dile-lucide-icon-eye></dile-lucide-icon-eye>`
79
+ : html`<dile-lucide-icon-eye-off></dile-lucide-icon-eye-off>`
102
80
  }
103
- </div>
104
- `;
81
+ </button>`;
105
82
  }
106
83
 
107
84
  _togglePasswordVisibility() {
@@ -1,7 +1,7 @@
1
1
  import { LitElement, html, css } from 'lit';
2
2
  import '../../input/input-search.js';
3
3
  import '../../spinner/spinner-horizontal.js';
4
- import { DileEmmitChange } from '../../../mixins/form/index.js';
4
+ import { DileEmmitChange, FIELD_MESSAGE_ID } from '../../../mixins/form/index.js';
5
5
  import '../select.js';
6
6
  import { labelStyles } from '../../input/src/label-styles.js';
7
7
  import { messageStyles } from '../../input/src/message-styles.js';
@@ -201,6 +201,7 @@ export class DileSelectAjax extends DileEmmitChange(LitElement) {
201
201
  id="result"
202
202
  ?errored=${this.errored}
203
203
  ?disabled=${this.disabled}
204
+ .accessibleDescription=${this.message || undefined}
204
205
  value="${this.selectedText}"
205
206
  readOnly
206
207
  @dile-input-search-cleared=${this.onClearSelected}
@@ -217,6 +218,7 @@ export class DileSelectAjax extends DileEmmitChange(LitElement) {
217
218
  label="${this.label}"
218
219
  ?errored=${this.errored}
219
220
  ?disabled=${this.disabled}
221
+ .accessibleDescription=${this.message || undefined}
220
222
  @focus=${this.onFocus}
221
223
  @dile-input-search=${this.onTextInput}
222
224
  delay="${this.delay}"
@@ -272,7 +274,7 @@ export class DileSelectAjax extends DileEmmitChange(LitElement) {
272
274
  name="generated-select-field"
273
275
  ?errored=${this.errored}
274
276
  >
275
- <select slot="select">
277
+ <select slot="select" aria-description=${this.message || ''}>
276
278
  <option value="">${this.selectDefaultPlaceholder}</option>
277
279
  ${this.data.map(item => html`
278
280
  <option value="${item[this.idProperty]}">${item[this.displayProperty]}</option>
@@ -285,7 +287,7 @@ export class DileSelectAjax extends DileEmmitChange(LitElement) {
285
287
  get messageTemplate() {
286
288
  return html`
287
289
  ${this.message
288
- ? html`<div class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
290
+ ? html`<div id="${FIELD_MESSAGE_ID}" class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
289
291
  : ''
290
292
  }
291
293
  `
@@ -1,5 +1,5 @@
1
1
  import { LitElement, html, css } from 'lit';
2
- import { DileEmmitChange } from '../../../mixins/form/index.js';
2
+ import { DileEmmitChange, FIELD_MESSAGE_ID } from '../../../mixins/form/index.js';
3
3
  import '../../number-picker/number-picker-element.js';
4
4
  import { labelStyles } from '../../input/src/label-styles.js';
5
5
  import { messageStyles } from '../../input/src/message-styles.js';
@@ -62,6 +62,7 @@ export class DileTimePicker extends DileEmmitChange(LitElement) {
62
62
  .value=${this._hours}
63
63
  ?disabled=${this.disabled}
64
64
  ?errored=${this.errored}
65
+ .accessibleDescription=${this.message || undefined}
65
66
  ?focusOnStart=${this.focusOnStart}
66
67
  @dile-number-picker-value-changed=${this._changeHours}
67
68
  ></dile-number-picker-element>
@@ -74,6 +75,7 @@ export class DileTimePicker extends DileEmmitChange(LitElement) {
74
75
  .value=${this._minutes}
75
76
  ?disabled=${this.disabled}
76
77
  ?errored=${this.errored}
78
+ .accessibleDescription=${this.message || undefined}
77
79
  @dile-number-picker-value-changed=${this._changeMinutes}
78
80
  ></dile-number-picker-element>
79
81
  <dile-number-picker-element
@@ -85,6 +87,7 @@ export class DileTimePicker extends DileEmmitChange(LitElement) {
85
87
  .value=${this._seconds}
86
88
  ?disabled=${this.disabled}
87
89
  ?errored=${this.errored}
90
+ .accessibleDescription=${this.message || undefined}
88
91
  @dile-number-picker-value-changed=${this._changeSeconds}
89
92
  ></dile-number-picker-element>
90
93
  </section>
@@ -96,7 +99,7 @@ export class DileTimePicker extends DileEmmitChange(LitElement) {
96
99
  get messageTemplate() {
97
100
  return html`
98
101
  ${this.message
99
- ? html`<div class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
102
+ ? html`<div id="${FIELD_MESSAGE_ID}" class="message ${this.errored ? 'errored-msg' : ''}"><span>${this.message}</span></div>`
100
103
  : ''
101
104
  }
102
105
  `
@@ -0,0 +1 @@
1
+ export { DileWheelPicker } from './src/DileWheelPicker.js';