@descope/web-components-ui 1.0.178 → 1.0.180

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 (61) hide show
  1. package/dist/cjs/index.cjs.js +162 -142
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.esm.js +173 -151
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1000.js +1 -1
  7. package/dist/umd/2481.js +1 -1
  8. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  9. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  10. package/dist/umd/descope-button-selection-group-descope-button-selection-group-internal-index-js.js +1 -0
  11. package/dist/umd/descope-button-selection-group-descope-button-selection-group-item-index-js.js +1 -0
  12. package/dist/umd/descope-button-selection-group-index-js.js +1 -0
  13. package/dist/umd/descope-combo-box-index-js.js +1 -1
  14. package/dist/umd/descope-email-field-index-js.js +1 -1
  15. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  16. package/dist/umd/descope-number-field-index-js.js +1 -1
  17. package/dist/umd/descope-passcode-index-js.js +1 -1
  18. package/dist/umd/descope-text-area-index-js.js +1 -1
  19. package/dist/umd/descope-text-field-index-js.js +1 -1
  20. package/dist/umd/index.js +1 -1
  21. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  22. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  23. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  24. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  25. package/package.json +6 -6
  26. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +1 -1
  27. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +1 -1
  28. package/src/components/{descope-single-select/SingleSelectClass.js → descope-button-selection-group/ButtonSelectionGroupClass.js} +9 -9
  29. package/src/components/{descope-single-select/descope-single-select-internal/SingleSelectInternalClass.js → descope-button-selection-group/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js} +2 -2
  30. package/src/components/descope-button-selection-group/descope-button-selection-group-internal/index.js +9 -0
  31. package/src/components/{descope-single-select/descope-select-item/SelectItemClass.js → descope-button-selection-group/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js} +2 -2
  32. package/src/components/descope-button-selection-group/descope-button-selection-group-item/index.js +6 -0
  33. package/src/components/descope-button-selection-group/index.js +6 -0
  34. package/src/components/descope-combo-box/ComboBoxClass.js +16 -7
  35. package/src/components/descope-email-field/EmailFieldClass.js +1 -1
  36. package/src/components/descope-new-password/NewPasswordClass.js +1 -1
  37. package/src/components/descope-number-field/NumberFieldClass.js +1 -1
  38. package/src/components/descope-passcode/PasscodeClass.js +1 -1
  39. package/src/components/descope-password/PasswordClass.js +1 -1
  40. package/src/components/descope-text-area/TextAreaClass.js +1 -1
  41. package/src/components/descope-text-field/TextFieldClass.js +1 -1
  42. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  43. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +6 -4
  44. package/src/components/phone-fields/descope-phone-field/helpers.js +2 -2
  45. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -1
  46. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +1 -1
  47. package/src/index.cjs.js +2 -2
  48. package/src/index.d.ts +1 -0
  49. package/src/index.js +2 -2
  50. package/src/mixins/createStyleMixin/index.js +9 -5
  51. package/src/mixins/proxyInputMixin.js +102 -97
  52. package/src/theme/components/{single-select/singleSelect.js → buttonSelectionGroup/buttonSelectionGroup.js} +4 -4
  53. package/src/theme/components/{single-select/selectItem.js → buttonSelectionGroup/buttonSelectionGroupItem.js} +4 -4
  54. package/src/theme/components/comboBox.js +7 -5
  55. package/src/theme/components/index.js +4 -4
  56. package/dist/umd/descope-single-select-descope-select-item-index-js.js +0 -1
  57. package/dist/umd/descope-single-select-descope-single-select-internal-index-js.js +0 -1
  58. package/dist/umd/descope-single-select-index-js.js +0 -1
  59. package/src/components/descope-single-select/descope-select-item/index.js +0 -6
  60. package/src/components/descope-single-select/descope-single-select-internal/index.js +0 -6
  61. package/src/components/descope-single-select/index.js +0 -6
@@ -0,0 +1,9 @@
1
+ import {
2
+ componentName,
3
+ ButtonSelectionGroupInternalClass,
4
+ } from './ButtonSelectionGroupInternalClass';
5
+ import '../../descope-button';
6
+
7
+ customElements.define(componentName, ButtonSelectionGroupInternalClass);
8
+
9
+ export { ButtonSelectionGroupInternalClass };
@@ -4,7 +4,7 @@ import { compose } from '../../../helpers';
4
4
  import { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';
5
5
  import { ButtonClass } from '../../descope-button/ButtonClass';
6
6
 
7
- export const componentName = getComponentName('select-item');
7
+ export const componentName = getComponentName('button-selection-group-item');
8
8
 
9
9
  class RawSelectItem extends createBaseClass({
10
10
  componentName,
@@ -72,7 +72,7 @@ class RawSelectItem extends createBaseClass({
72
72
  }
73
73
  }
74
74
 
75
- export const SelectItemClass = compose(
75
+ export const ButtonSelectionGroupItemClass = compose(
76
76
  createStyleMixin({
77
77
  mappings: {
78
78
  backgroundColor: {
@@ -0,0 +1,6 @@
1
+ import { componentName, ButtonSelectionGroupItemClass } from './ButtonSelectionGroupItemClass';
2
+ import '../../descope-button';
3
+
4
+ customElements.define(componentName, ButtonSelectionGroupItemClass);
5
+
6
+ export { ButtonSelectionGroupItemClass };
@@ -0,0 +1,6 @@
1
+ import { componentName, ButtonSelectionGroupClass } from './ButtonSelectionGroupClass';
2
+ import './descope-button-selection-group-internal';
3
+
4
+ customElements.define(componentName, ButtonSelectionGroupClass);
5
+
6
+ export { ButtonSelectionGroupClass };
@@ -64,6 +64,16 @@ const ComboBoxMixin = (superclass) =>
64
64
  this.#overrideOverlaySettings();
65
65
  observeChildren(this, this.#onChildrenChange.bind(this));
66
66
  }
67
+
68
+ set value(val) {
69
+ this.baseElement.selectedItem = this.baseElement.items.find(
70
+ (item) => item['data-id'] === val
71
+ );
72
+ }
73
+
74
+ get value() {
75
+ return this.baseElement.selectedItem?.['data-id'] || '';
76
+ }
67
77
  };
68
78
 
69
79
  const {
@@ -88,11 +98,6 @@ const {
88
98
  errorMessage: { selector: '::part(error-message)' },
89
99
  };
90
100
 
91
- // const { slotted, selected } = {
92
- // slotted: { selector: () => '::slotted(*)' },
93
- // selected: { selector: () => '::slotted([selected])' }
94
- // }
95
-
96
101
  export const ComboBoxClass = compose(
97
102
  createStyleMixin({
98
103
  mappings: {
@@ -136,6 +141,9 @@ export const ComboBoxClass = compose(
136
141
  // at this time.
137
142
  overlayBackground: { property: () => ComboBoxClass.cssVarList.overlay.backgroundColor },
138
143
  overlayBorder: { property: () => ComboBoxClass.cssVarList.overlay.border },
144
+ overlayFontSize: { property: () => ComboBoxClass.cssVarList.overlay.fontSize },
145
+ overlayFontFamily: { property: () => ComboBoxClass.cssVarList.overlay.fontFamily },
146
+ overlayCursor: { property: () => ComboBoxClass.cssVarList.overlay.cursor },
139
147
  },
140
148
  }),
141
149
  draggableMixin,
@@ -144,17 +152,18 @@ export const ComboBoxClass = compose(
144
152
  selector: '',
145
153
  mappings: {
146
154
  backgroundColor: { selector: 'vaadin-combo-box-scroller' },
147
- cursor: { selector: 'vaadin-combo-box-item' }, // TODO: this mapping doesn't work, needs fixing.
148
155
  minHeight: { selector: 'vaadin-combo-box-overlay' },
149
156
  margin: { selector: 'vaadin-combo-box-overlay' },
157
+ cursor: { selector: 'vaadin-combo-box-item' },
150
158
  fontFamily: { selector: 'vaadin-combo-box-item' },
159
+ fontSize: { selector: 'vaadin-combo-box-item' },
151
160
  },
152
161
  forward: {
153
162
  include: false,
154
163
  attributes: ['size'],
155
164
  },
156
165
  }),
157
- proxyInputMixin,
166
+ proxyInputMixin({ proxyProps: ['selectionStart'] }),
158
167
  componentNameValidationMixin,
159
168
  ComboBoxMixin
160
169
  )(
@@ -27,7 +27,7 @@ export const EmailFieldClass = compose(
27
27
  mappings: textFieldMappings,
28
28
  }),
29
29
  draggableMixin,
30
- proxyInputMixin,
30
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
31
31
  componentNameValidationMixin,
32
32
  customMixin
33
33
  )(
@@ -73,7 +73,7 @@ export const NewPasswordClass = compose(
73
73
  },
74
74
  }),
75
75
  draggableMixin,
76
- proxyInputMixin,
76
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
77
77
  customMixin
78
78
  )(
79
79
  createProxy({
@@ -20,7 +20,7 @@ export const NumberFieldClass = compose(
20
20
  mappings: textFieldMappings,
21
21
  }),
22
22
  draggableMixin,
23
- proxyInputMixin,
23
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
24
24
  componentNameValidationMixin
25
25
  )(
26
26
  createProxy({
@@ -108,7 +108,7 @@ export const PasscodeClass = compose(
108
108
  },
109
109
  }),
110
110
  draggableMixin,
111
- proxyInputMixin,
111
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
112
112
  componentNameValidationMixin,
113
113
  customMixin
114
114
  )(
@@ -81,7 +81,7 @@ export const PasswordClass = compose(
81
81
  },
82
82
  }),
83
83
  draggableMixin,
84
- proxyInputMixin,
84
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
85
85
  componentNameValidationMixin,
86
86
  passwordDraggableMixin
87
87
  )(
@@ -66,7 +66,7 @@ export const TextAreaClass = compose(
66
66
  },
67
67
  }),
68
68
  draggableMixin,
69
- proxyInputMixin,
69
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
70
70
  componentNameValidationMixin
71
71
  )(
72
72
  createProxy({
@@ -42,7 +42,7 @@ export const TextFieldClass = compose(
42
42
  mappings: textFieldMappings,
43
43
  }),
44
44
  draggableMixin,
45
- proxyInputMixin,
45
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
46
46
  componentNameValidationMixin,
47
47
  customMixin
48
48
  )(
@@ -155,7 +155,7 @@ export const PhoneFieldClass = compose(
155
155
  },
156
156
  }),
157
157
  draggableMixin,
158
- proxyInputMixin,
158
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
159
159
  customMixin
160
160
  )(
161
161
  createProxy({
@@ -33,9 +33,9 @@ class PhoneFieldInternal extends BaseInputClass {
33
33
  >
34
34
  ${CountryCodes.map((item) => comboBoxItem(item)).join('')}
35
35
  </descope-combo-box>
36
- <div class="separator"></div>
36
+ <div class="separator"></div>
37
37
  <descope-text-field type="tel"></descope-text-field>
38
- </div>
38
+ </div>
39
39
  `;
40
40
 
41
41
  this.countryCodeInput = this.querySelector('descope-combo-box');
@@ -107,12 +107,14 @@ class PhoneFieldInternal extends BaseInputClass {
107
107
 
108
108
  getCountryByDialCode(countryDialCode) {
109
109
  return this.countryCodeInput.items?.find(
110
- (c) => c.getAttribute('data-dial-code') === countryDialCode
110
+ (c) => c.getAttribute('data-country-code') === countryDialCode
111
111
  );
112
112
  }
113
113
 
114
114
  getCountryByCodeId(countryCode) {
115
- return this.countryCodeInput.items?.find((c) => c['data-id'] === countryCode)?.['data-name'];
115
+ return this.countryCodeInput.items?.find(
116
+ (c) => c.getAttribute('data-country-code') === countryCode
117
+ );
116
118
  }
117
119
 
118
120
  updateCountryCodeItems(restrictCountries) {
@@ -6,9 +6,9 @@ export const getCountryFlag = (code) =>
6
6
  export const comboBoxItem = ({ code, dialCode, name: country }) => `
7
7
  <div
8
8
  style="display:flex; flex-direction: column;"
9
- data-id="${code}"
9
+ data-id="${dialCode}"
10
10
  data-name="${code} ${dialCode} ${country}"
11
- data-dial-code="${dialCode}"
11
+ data-country-code="${code}"
12
12
  >
13
13
  <div>
14
14
  <span>
@@ -100,7 +100,7 @@ export const PhoneFieldInputBoxClass = compose(
100
100
  },
101
101
  }),
102
102
  draggableMixin,
103
- proxyInputMixin,
103
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
104
104
  customMixin
105
105
  )(
106
106
  createProxy({
@@ -116,7 +116,7 @@ class PhoneFieldInternal extends BaseInputClass {
116
116
 
117
117
  getCountryByDialCode(countryDialCode) {
118
118
  return this.countryCodeInput.items?.find(
119
- (c) => c.getAttribute('data-dial-code') === countryDialCode
119
+ (c) => c.getAttribute('data-country-code') === countryDialCode
120
120
  );
121
121
  }
122
122
 
package/src/index.cjs.js CHANGED
@@ -27,5 +27,5 @@ export { PhoneFieldInputBoxClass } from './components/phone-fields/descope-phone
27
27
  export { NewPasswordClass } from './components/descope-new-password/NewPasswordClass';
28
28
  export { RecaptchaClass } from './components/descope-recaptcha/RecaptchaClass';
29
29
  export { UploadFileClass } from './components/descope-upload-file/UploadFileClass';
30
- export { SingleSelectClass } from './components/descope-single-select/SingleSelectClass';
31
- export { SelectItemClass } from './components/descope-single-select/descope-select-item/SelectItemClass';
30
+ export { ButtonSelectionGroupClass } from './components/descope-button-selection-group/ButtonSelectionGroupClass';
31
+ export { ButtonSelectionGroupItemClass } from './components/descope-button-selection-group/descope-button-selection-group-item/ButtonSelectionGroupItemClass';
package/src/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export { PhoneFieldInputBoxClass } from './components/phone-fields/descope-phone
32
32
  export { NewPasswordClass } from './components/descope-new-password';
33
33
  export { RecaptchaClass } from './components/descope-recaptcha';
34
34
  export { UploadFileClass } from './components/descope-upload-file';
35
+ export { ButtonSelectionGroupClass } from './components/descope-button-selection-group/ButtonSelectionGroupClass';
35
36
 
36
37
  export type Theme = {
37
38
  globals: {
package/src/index.js CHANGED
@@ -22,8 +22,8 @@ export * from './components/phone-fields/descope-phone-input-box-field';
22
22
  export * from './components/descope-new-password';
23
23
  export * from './components/descope-recaptcha';
24
24
  export * from './components/descope-upload-file';
25
- export * from './components/descope-single-select';
26
- export * from './components/descope-single-select/descope-select-item';
25
+ export * from './components/descope-button-selection-group';
26
+ export * from './components/descope-button-selection-group/descope-button-selection-group-item';
27
27
 
28
28
  export {
29
29
  globalsThemeToStyle,
@@ -37,6 +37,8 @@ export const createStyleMixin =
37
37
 
38
38
  #styleAttributes;
39
39
 
40
+ #getRootElement;
41
+
40
42
  // we are using this mixin also for portalMixin
41
43
  // so we should be able to inject styles to other DOM elements
42
44
  // this is why we need to support these overrides
@@ -49,16 +51,12 @@ export const createStyleMixin =
49
51
  super();
50
52
  this.#componentNameSuffix = componentNameSuffix;
51
53
  this.#themeSection = themeSection;
52
- this.#rootElement = getRootElement?.(this) || this.shadowRoot;
53
54
  this.#baseSelector = baseSelector ?? this.baseSelector;
55
+ this.#getRootElement = getRootElement;
54
56
 
55
57
  this.#styleAttributes = Object.keys(mappings).map((key) =>
56
58
  kebabCaseJoin(STYLE_OVERRIDE_ATTR_PREFIX, componentNameSuffix, key)
57
59
  );
58
-
59
- this.#createMappingStyle();
60
- this.#createComponentTheme();
61
- this.#createOverridesStyle();
62
60
  }
63
61
 
64
62
  // eslint-disable-next-line class-methods-use-this
@@ -147,8 +145,14 @@ export const createStyleMixin =
147
145
  init() {
148
146
  super.init?.();
149
147
  if (this.shadowRoot.isConnected) {
148
+ this.#rootElement = this.#getRootElement?.(this) || this.shadowRoot;
149
+
150
150
  this.#addClassName(componentName);
151
151
 
152
+ this.#createMappingStyle();
153
+ this.#createComponentTheme();
154
+ this.#createOverridesStyle();
155
+
152
156
  // this is instead attributeChangedCallback because we cannot use static methods in this case
153
157
  observeAttributes(this, this.#updateOverridesStyle.bind(this), {});
154
158
  }
@@ -34,123 +34,128 @@ const getNestedInput = (ele) => {
34
34
  return undefined;
35
35
  };
36
36
 
37
- const proxyInputMixin = (superclass) =>
38
- class ProxyInputMixinClass extends inputValidationMixin(superclass) {
39
- static get observedAttributes() {
40
- return [...(superclass.observedAttributes || []), ...errorAttrs];
41
- }
42
-
43
- #inputElement;
37
+ const proxyInputMixin =
38
+ ({ proxyProps = [] }) =>
39
+ (superclass) =>
40
+ class ProxyInputMixinClass extends inputValidationMixin(superclass) {
41
+ static get observedAttributes() {
42
+ return [...(superclass.observedAttributes || []), ...errorAttrs];
43
+ }
44
44
 
45
- #dispatchChange = createDispatchEvent.bind(this, 'change');
45
+ #inputElement;
46
46
 
47
- constructor() {
48
- super();
47
+ #dispatchChange = createDispatchEvent.bind(this, 'change');
49
48
 
50
- this.#inputElement = super.inputElement;
51
- }
49
+ constructor() {
50
+ super();
52
51
 
53
- // the web-component does not loaded immediately, so we want to defer the warning
54
- // and show it only if the input element was not found after the component is loaded
55
- warnIfInputElementIsMissing() {
56
- clearTimeout(this.inputElementTimerId);
52
+ this.#inputElement = super.inputElement;
53
+ }
57
54
 
58
- this.inputElementTimerId = setTimeout(() => {
59
- // eslint-disable-next-line no-console
60
- !this.#inputElement && console.warn(this.localName, 'no input was found');
61
- }, 0);
62
- }
55
+ // the web-component does not loaded immediately, so we want to defer the warning
56
+ // and show it only if the input element was not found after the component is loaded
57
+ warnIfInputElementIsMissing() {
58
+ clearTimeout(this.inputElementTimerId);
63
59
 
64
- get inputElement() {
65
- if (this.#inputElement) return this.#inputElement;
60
+ this.inputElementTimerId = setTimeout(() => {
61
+ // eslint-disable-next-line no-console
62
+ !this.#inputElement && console.warn(this.localName, 'no input was found');
63
+ }, 0);
64
+ }
66
65
 
67
- this.warnIfInputElementIsMissing();
66
+ get inputElement() {
67
+ if (this.#inputElement) return this.#inputElement;
68
68
 
69
- const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="input"]');
70
- const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');
69
+ this.warnIfInputElementIsMissing();
71
70
 
72
- this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);
71
+ const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="input"]');
72
+ const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');
73
73
 
74
- return this.#inputElement;
75
- }
74
+ this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);
76
75
 
77
- set inputElement(ele) {
78
- this.#inputElement = ele;
79
- }
76
+ return this.#inputElement;
77
+ }
80
78
 
81
- getValidity() {
82
- return this.inputElement?.validity || {};
83
- }
79
+ set inputElement(ele) {
80
+ this.#inputElement = ele;
81
+ }
84
82
 
85
- handleInternalInputErrorMessage() {
86
- if (!this.inputElement.checkValidity()) {
87
- this.inputElement.setCustomValidity(this.validationMessage);
83
+ getValidity() {
84
+ return this.inputElement?.validity || {};
88
85
  }
89
- }
90
-
91
- #handleErrorMessage() {
92
- this.handleInternalInputErrorMessage();
93
- this.setAttribute('error-message', this.validationMessage);
94
- }
95
-
96
- init() {
97
- super.init?.();
98
-
99
- // on some cases the base element is not ready so the inputElement is empty
100
- // we are deferring this section to make sure the base element is ready
101
- setTimeout(() => {
102
- this.inputElement?.addEventListener('input', (e) => {
103
- if (!this.inputElement.checkValidity()) {
104
- this.inputElement.setCustomValidity('');
105
- // after updating the input validity we want to trigger set validity on the wrapping element
106
- // so we will get the updated validity
107
- this.setCustomValidity('');
108
-
109
- // Vaadin is getting the input event before us,
110
- // so in order to make sure they use the updated validity
111
- // we calling their fn after updating the input validity
112
- this.baseElement.__onInput(e);
113
86
 
114
- this.#handleErrorMessage();
115
- }
116
- });
87
+ handleInternalInputErrorMessage() {
88
+ if (!this.inputElement.checkValidity()) {
89
+ this.inputElement.setCustomValidity(this.validationMessage);
90
+ }
91
+ }
117
92
 
118
- this.baseElement.addEventListener('change', () => {
119
- this.#dispatchChange();
120
- });
93
+ #handleErrorMessage() {
94
+ this.handleInternalInputErrorMessage();
95
+ this.setAttribute('error-message', this.validationMessage);
96
+ }
121
97
 
122
- this.#inputElement.addEventListener('blur', () => {
123
- if (!this.checkValidity()) {
124
- this.setAttribute('invalid', 'true');
98
+ init() {
99
+ super.init?.();
100
+
101
+ // on some cases the base element is not ready so the inputElement is empty
102
+ // we are deferring this section to make sure the base element is ready
103
+ setTimeout(() => {
104
+ this.inputElement?.addEventListener('input', (e) => {
105
+ if (!this.inputElement.checkValidity()) {
106
+ this.inputElement.setCustomValidity('');
107
+ // after updating the input validity we want to trigger set validity on the wrapping element
108
+ // so we will get the updated validity
109
+ this.setCustomValidity('');
110
+
111
+ // Vaadin is getting the input event before us,
112
+ // so in order to make sure they use the updated validity
113
+ // we calling their fn after updating the input validity
114
+ this.baseElement.__onInput(e);
115
+
116
+ this.#handleErrorMessage();
117
+ }
118
+ });
119
+
120
+ this.baseElement.addEventListener('change', () => {
121
+ this.#dispatchChange();
122
+ });
123
+
124
+ this.#inputElement.addEventListener('blur', () => {
125
+ if (!this.checkValidity()) {
126
+ this.setAttribute('invalid', 'true');
127
+ this.#handleErrorMessage();
128
+ }
129
+ });
130
+
131
+ this.addEventListener('invalid', () => {
132
+ if (!this.checkValidity()) {
133
+ this.setAttribute('invalid', 'true');
134
+ }
125
135
  this.#handleErrorMessage();
126
- }
127
- });
136
+ });
128
137
 
129
- this.addEventListener('invalid', () => {
130
- if (!this.checkValidity()) {
131
- this.setAttribute('invalid', 'true');
132
- }
133
- this.#handleErrorMessage();
134
- });
138
+ this.handleInternalInputErrorMessage();
135
139
 
136
- this.handleInternalInputErrorMessage();
140
+ // sync properties
141
+ proxyProps.forEach((prop) => {
142
+ propertyObserver(this, this.inputElement, prop);
143
+ });
144
+
145
+ this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);
137
146
 
138
- // sync properties
139
- propertyObserver(this, this.inputElement, 'value');
140
- propertyObserver(this, this.inputElement, 'selectionStart');
141
- this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);
142
-
143
- forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });
144
- });
145
- }
146
- };
147
-
148
- const composedProxyInputMixin = compose(
149
- proxyInputMixin,
150
- // in order to use input-wrapper across all our input components, we need to inject its theme
151
- // to every proxy input mixin, to allow its css vars to be scoped properly and accessible
152
- // in the proxy input component
153
- createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })
154
- );
147
+ forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });
148
+ });
149
+ }
150
+ };
151
+
152
+ const composedProxyInputMixin = (proxyInputMixinConfig) =>
153
+ compose(
154
+ proxyInputMixin(proxyInputMixinConfig),
155
+ // in order to use input-wrapper across all our input components, we need to inject its theme
156
+ // to every proxy input mixin, to allow its css vars to be scoped properly and accessible
157
+ // in the proxy input component
158
+ createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })
159
+ );
155
160
 
156
161
  export { composedProxyInputMixin as proxyInputMixin };
@@ -1,12 +1,12 @@
1
- import { SingleSelectClass } from '../../../components/descope-single-select/SingleSelectClass';
1
+ import { ButtonSelectionGroupClass } from '../../../components/descope-button-selection-group/ButtonSelectionGroupClass';
2
2
  import { getThemeRefs } from '../../../helpers/themeHelpers';
3
3
  import globals from '../../globals';
4
4
  import { refs } from '../inputWrapper';
5
5
 
6
6
  const globalRefs = getThemeRefs(globals);
7
- const vars = SingleSelectClass.cssVarList;
7
+ const vars = ButtonSelectionGroupClass.cssVarList;
8
8
 
9
- const singleSelect = {
9
+ const buttonSelectionGroup = {
10
10
  [vars.fontFamily]: refs.fontFamily,
11
11
  [vars.labelTextColor]: refs.labelTextColor,
12
12
  [vars.labelRequiredIndicator]: refs.requiredIndicator,
@@ -15,5 +15,5 @@ const singleSelect = {
15
15
  [vars.hostWidth]: refs.width,
16
16
  };
17
17
 
18
- export default singleSelect;
18
+ export default buttonSelectionGroup;
19
19
  export { vars };
@@ -1,12 +1,12 @@
1
- import { SelectItemClass } from '../../../components/descope-single-select/descope-select-item/SelectItemClass';
1
+ import { ButtonSelectionGroupItemClass } from '../../../components/descope-button-selection-group/descope-button-selection-group-item/ButtonSelectionGroupItemClass';
2
2
  import { getThemeRefs } from '../../../helpers/themeHelpers';
3
3
  import globals from '../../globals';
4
4
 
5
5
  const globalRefs = getThemeRefs(globals);
6
6
 
7
- export const vars = SelectItemClass.cssVarList;
7
+ export const vars = ButtonSelectionGroupItemClass.cssVarList;
8
8
 
9
- const selectItem = {
9
+ const buttonSelectionGroupItem = {
10
10
  [vars.backgroundColor]: globalRefs.colors.surface.light,
11
11
  [vars.labelTextColor]: globalRefs.colors.surface.contrast,
12
12
  [vars.borderColor]: globalRefs.colors.surface.main,
@@ -24,4 +24,4 @@ const selectItem = {
24
24
  },
25
25
  };
26
26
 
27
- export default selectItem;
27
+ export default buttonSelectionGroupItem;
@@ -35,12 +35,14 @@ export const comboBox = {
35
35
  [vars.inputDropdownButtonCursor]: 'default',
36
36
  },
37
37
 
38
- [vars.overlay.minHeight]: '400px',
39
- [vars.overlay.margin]: '0 auto',
38
+ // Overlay theme exposed via the component:
39
+ [vars.overlayFontSize]: refs.fontSize,
40
+ [vars.overlayFontFamily]: refs.fontFamily,
41
+ [vars.overlayCursor]: 'pointer',
40
42
 
41
- // [vars.overlayCursor]: 'pointer',
42
- // [vars.overlayBackground]: globalRefs.colors.surface.light,
43
- // [vars.overlayBorder]: `2px solid red`,
43
+ // Overlay direct theme:
44
+ [vars.overlay.minHeight]: '400px',
45
+ [vars.overlay.margin]: '0',
44
46
  };
45
47
 
46
48
  export default comboBox;
@@ -21,8 +21,8 @@ import * as phoneInputBoxField from './phoneInputBoxField';
21
21
  import * as newPassword from './newPassword';
22
22
  import * as inputWrapper from './inputWrapper';
23
23
  import * as uploadFile from './uploadFile';
24
- import * as selectItem from './single-select/selectItem';
25
- import * as singleSelect from './single-select/singleSelect';
24
+ import * as buttonSelectionGroupItem from './buttonSelectionGroup/buttonSelectionGroupItem';
25
+ import * as buttonSelectionGroup from './buttonSelectionGroup/buttonSelectionGroup';
26
26
 
27
27
  const components = {
28
28
  button,
@@ -49,8 +49,8 @@ const components = {
49
49
  newPassword,
50
50
  inputWrapper,
51
51
  uploadFile,
52
- selectItem,
53
- singleSelect,
52
+ buttonSelectionGroupItem,
53
+ buttonSelectionGroup,
54
54
  };
55
55
 
56
56
  const theme = Object.keys(components).reduce(
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[8798],{6982:(t,e,s)=>{s.r(e),s.d(e,{SelectItemClass:()=>d});var o=s(1e3),n=s(3874),r=s(2061),i=s(4567),a=s(9690);const c=(0,i.iY)("select-item");class l extends((0,n.s)({componentName:c,baseSelector:":host > descope-button"})){get size(){return this.getAttribute("size")||"md"}get variant(){return this.getAttribute("variant")||"contained"}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n\t\t<style>\n descope-button {\n max-width: 100%;\n }\n\t\t\tdescope-button > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\toverflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n max-width: 100%\n\t\t\t}\n\t\t</style>\n <descope-button variant="${this.variant}" size="${this.size}" mode="primary">\n <slot></slot>\n </descope-button>\n\t`,(0,i.oP)(this,this.baseElement,{includeAttrs:["size","variant"]})}handleFocus(){this.shadowRoot.querySelector("descope-button")?.focus()}focus(){this.handleFocus()}init(){super.init(),this.addEventListener("focus",(t=>{t.isTrusted&&this.handleFocus()}))}}const d=(0,r.qC)((0,o.yk)({mappings:{backgroundColor:{selector:()=>a.n.componentName,property:a.n.cssVarList.backgroundColor},labelTextColor:{selector:()=>a.n.componentName,property:a.n.cssVarList.labelTextColor},borderColor:{selector:()=>a.n.componentName,property:a.n.cssVarList.borderColor},borderStyle:{selector:()=>a.n.componentName,property:a.n.cssVarList.borderStyle},borderRadius:{selector:()=>a.n.componentName,property:a.n.cssVarList.borderRadius}}}),o.e4,o.Ae)(l);s(2018),customElements.define(c,d)}}]);