@descope/web-components-ui 1.0.188 → 1.0.190

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.
@@ -4941,6 +4941,7 @@ const ComboBoxClass = compose(
4941
4941
  overlayFontSize: { property: () => ComboBoxClass.cssVarList.overlay.fontSize },
4942
4942
  overlayFontFamily: { property: () => ComboBoxClass.cssVarList.overlay.fontFamily },
4943
4943
  overlayCursor: { property: () => ComboBoxClass.cssVarList.overlay.cursor },
4944
+ overlayItemBoxShadow: { property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow },
4944
4945
  },
4945
4946
  }),
4946
4947
  draggableMixin,
@@ -4954,6 +4955,7 @@ const ComboBoxClass = compose(
4954
4955
  cursor: { selector: 'vaadin-combo-box-item' },
4955
4956
  fontFamily: { selector: 'vaadin-combo-box-item' },
4956
4957
  fontSize: { selector: 'vaadin-combo-box-item' },
4958
+ itemBoxShadow: { selector: 'vaadin-combo-box-item', property: 'box-shadow' },
4957
4959
  },
4958
4960
  forward: {
4959
4961
  include: false,
@@ -5042,6 +5044,7 @@ const comboBox = {
5042
5044
  [vars$8.overlayFontSize]: refs.fontSize,
5043
5045
  [vars$8.overlayFontFamily]: refs.fontFamily,
5044
5046
  [vars$8.overlayCursor]: 'pointer',
5047
+ [vars$8.overlayItemBoxShadow]: 'none',
5045
5048
 
5046
5049
  // Overlay direct theme:
5047
5050
  [vars$8.overlay.minHeight]: '400px',
@@ -7478,6 +7481,64 @@ const componentName$1 = getComponentName('button-selection-group');
7478
7481
 
7479
7482
  const customMixin = (superclass) =>
7480
7483
  class ButtonSelectionGroupMixinClass extends superclass {
7484
+ // eslint-disable-next-line class-methods-use-this
7485
+ #renderItem = ({ value, label }) =>
7486
+ `<descope-button-selection-group-item value="${value}">${label}</descope-button-selection-group-item>`;
7487
+
7488
+ #data;
7489
+
7490
+ get renderItem() {
7491
+ return this.#renderItem;
7492
+ }
7493
+
7494
+ set renderItem(renderFn) {
7495
+ this.#renderItem = renderFn;
7496
+ this.renderItems();
7497
+ }
7498
+
7499
+ get data() {
7500
+ if (this.#data) return this.#data;
7501
+
7502
+ try {
7503
+ const data = JSON.parse(this.getAttribute('data'));
7504
+ if (this.isValidDataType(data)) {
7505
+ return data;
7506
+ }
7507
+ } catch (e) {
7508
+ // eslint-disable-next-line no-console
7509
+ console.error('could not parse data string from attribute "data" - ', e.message);
7510
+ }
7511
+
7512
+ return [];
7513
+ }
7514
+
7515
+ set data(data) {
7516
+ if (this.isValidDataType(data)) {
7517
+ this.#data = data;
7518
+ this.renderItems();
7519
+ }
7520
+ }
7521
+
7522
+ // eslint-disable-next-line class-methods-use-this
7523
+ isValidDataType(data) {
7524
+ const isValid = Array.isArray(data);
7525
+ if (!isValid) {
7526
+ // eslint-disable-next-line no-console
7527
+ console.error('data must be an array, received:', data);
7528
+ }
7529
+
7530
+ return isValid;
7531
+ }
7532
+
7533
+ getItemsTemplate() {
7534
+ return this.data?.reduce?.((acc, item) => acc + (this.renderItem?.(item || {}) || ''), '');
7535
+ }
7536
+
7537
+ renderItems() {
7538
+ const template = this.getItemsTemplate();
7539
+ if (template) this.innerHTML = this.getItemsTemplate();
7540
+ }
7541
+
7481
7542
  init() {
7482
7543
  super.init?.();
7483
7544
  const template = document.createElement('template');
@@ -7497,6 +7558,10 @@ const customMixin = (superclass) =>
7497
7558
  this.inputElement = this.shadowRoot.querySelector(componentName$2);
7498
7559
 
7499
7560
  forwardAttrs(this, this.inputElement, { includeAttrs: ['size', 'default-value'] });
7561
+
7562
+ this.renderItems();
7563
+
7564
+ observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });
7500
7565
  }
7501
7566
  };
7502
7567