@descope/web-components-ui 1.114.0 → 1.116.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.
@@ -1 +1 @@
1
- {"version":3,"file":"descope-multi-select-combo-box-index-js.js","mappings":"oQAyBO,MAAMA,GAAgB,QAAiB,2BAgZxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAAW,MACXC,EAAK,kBACLC,EAAiB,WACjBC,EAAU,aACVC,EAAY,KACZC,EAAI,UACJC,EAAS,wBACTC,EAAuB,yBACvBC,GACE,CACFb,KAAM,CAAEc,SAAU,IAAM,SACxBb,WAAY,CAAEa,SAAU,uBACxBZ,aAAc,CAAEY,SAAU,SAC1BX,YAAa,CAAEW,SAAU,6BACzBV,OAAQ,CAAEU,SAAU,yBACpBT,YAAa,CAAES,SAAU,wBACzBR,MAAO,CAAEQ,SAAU,iBACnBP,kBAAmB,CAAEO,SAAU,+CAC/BN,WAAY,CAAEM,SAAU,uBACxBL,aAAc,CAAEK,SAAU,yBAC1BJ,KAAM,CAAEI,SAAU,sCAClBH,UAAW,CAAEG,SAAU,mDACvBF,wBAAyB,CACvBE,SAAU,+DAEZD,yBAA0B,CACxBC,SAAU,+DAIDC,GAA2B,SACtC,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKjB,EAAMkB,SAAU,SAChCC,cAAe,IAAKnB,EAAMkB,SAAU,aAEpCE,SAAU,CAAC,CAAC,EAAGpB,GACfqB,aAAc,IAAKV,EAAWO,SAAU,aACxCI,WAAY,CAAChB,EAAOH,EAAaF,EAAYO,EAAYC,EAAcE,GACvEY,cAAe,IAAKjB,EAAOY,SAAU,aACrCM,gBAAiB,IAAKlB,EAAOY,SAAU,eACvCO,eAAgB,CACd,IAAKnB,EAAOY,SAAU,SACtB,IAAKX,EAAmBW,SAAU,UAEpCQ,sBAAuB,IAAKjB,EAAcS,SAAU,SACpDS,iBAAkB,IAAKlB,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AuB5I,GAAS,SACvCA,sIASO6I,EAAmB7I,GAAS,SACnCA,6GAOO8I,EAAoB9I,GAAS,SACpCA,mBACAA,wBACAA,mEAKO+I,EAAwB,CAAC/I,EAAMY,EAAM,UAAY,SACxDZ,iBAAoBY,2BACvBZ,iBAAoBY,gDAgBVoI,EAA8B,IAAM,uGAOpCC,EAA2BjJ,GAAS,SAC3CA,8DAKOkJ,EAAyClJ,GAAS,SACzDA,oEAKOmJ,EAAsB,CAACnJ,EAAMjB,IAAe,SACnD6J,EAAoB5I,WACpB8I,EAAiB9I,WACjB+I,EAAsB/I,WACtB6I,EAAgB7I,WAlCY,EAACA,EAAMjB,IAAe,SAClDiB,kCACAA,8CACAA,wCACAA,yCACAA,0EACiCjB,EAAWxB,wDAClBwB,EAAW/B,oBAAoB+B,EAAW9B,wCA4BpEmM,CAAmBpJ,EAAMjB,WACzBmK,EAAsClJ,WAnFV,CAACA,GAAS,SACtCA,yCAmFAqJ,CAAmBrJ,WA9EQ,CAACA,GAAS,SACrCA,mHA8EAsJ,CAAkBtJ,WA3FwB,CAACA,GAAS,SACpDA,gEA2FAuJ,CAAiCvJ,OAM1BwJ,EAA2BxJ,GAAS,4ZAiB3CA,yJAQOyJ,EAA0B,IAC9B,gM","sources":["webpack://@descope/web-components-ui/./src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js","webpack://@descope/web-components-ui/./src/components/descope-multi-select-combo-box/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js"],"sourcesContent":["import { compose, compareArraysUnordered } from '../../helpers';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '../../helpers/componentHelpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n portalMixin,\n proxyInputMixin,\n changeMixin,\n} from '../../mixins';\n\nexport const componentName = getComponentName('multi-select-combo-box');\n\nconst multiSelectComboBoxMixin = (superclass) =>\n class MultiSelectComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ displayName, value, label }) => {\n const ele = document.createElement('span');\n ele.setAttribute('data-name', label);\n ele.setAttribute('data-id', value);\n ele.textContent = displayName || label;\n\n return ele.outerHTML;\n };\n\n #data;\n\n #value = [];\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"default-values\" -', e.message);\n }\n }\n return [];\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"data\" -', e.message);\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get allowCustomValues() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data and default-values must be an array, received:', data);\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.((acc, item) => acc + (this.renderItem?.(item || {}) || ''), '');\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) this.innerHTML = template;\n }\n\n updateSelectedItems() {\n // This is a list of all the selected items, including ones that may have been removed from the DOM\n const currentSelected =\n this.baseElement.selectedItems?.map((item) => item.getAttribute('data-id')) || [];\n\n // if there are selected items, we want to trigger a potential update to the value if some child elements were removed\n if (currentSelected.length > 0) {\n // setting the value checks that the selected items are still in the DOM and will not set the value if they are not\n this.value = currentSelected;\n }\n\n // otherwise, if default value is specified, set default value as selected item\n if (this.value.length === 0) {\n this.setDefaultValues();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n customValueTransformFn(val) {\n return val;\n }\n\n // We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the\n // field that it searches the value, and the finaly display value of the input.\n // We provide a custom transform function to override that behavior.\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value'\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n // To prevent duplicate items for the multi select options, we dedup them based on the \"data-id\" attribute\n // eslint-disable-next-line class-methods-use-this\n #dedupItems(items) {\n return Array.from(\n new Map(items.map((item) => [item.getAttribute('data-id'), item])).values()\n );\n }\n\n // vaadin api is to set props on their combo box node,\n // in order to avoid it, we are passing the children of this component\n // to the items & renderer props, so it will be used as the combo box items\n #onChildrenChange() {\n const items = Array.from(this.children);\n const dedupItems = this.#dedupItems(items);\n\n // we want the data-name attribute to be accessible as an object attribute\n if (items.length) {\n this.removeAttribute('has-no-options');\n\n dedupItems.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = dedupItems;\n\n setTimeout(() => {\n // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden\n this.updateSelectedItems();\n }, 0);\n } else {\n this.baseElement.items = [];\n this.setAttribute('has-no-options', '');\n }\n\n // use vaadin combobox custom renderer to render options as HTML\n // and not via default renderer, which renders only the data-name's value\n // in its own HTML template\n this.baseElement.renderer = (root, combo, model) => {\n // eslint-disable-next-line no-param-reassign\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot\n .querySelector('vaadin-multi-select-combo-box-internal')\n .shadowRoot.querySelector('vaadin-multi-select-combo-box-overlay');\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #handleCustomValues() {\n if (this.allowCustomValues) {\n this.baseElement.addEventListener('custom-value-set', (e) => {\n const newItemHtml = this.#renderItem({\n label: e.detail,\n displayName: e.detail,\n value: e.detail,\n });\n this.innerHTML += newItemHtml;\n // The internal filter needs to be removed, otherwise there's a bug where a new custom item\n // added can't be removed from the dropdown because of how the vaadin component is implemented\n this.baseElement._lastFilter = '';\n // The value needs to be set with a timeout because it needs to execute after\n // the custom value is added to items by the children change observer\n setTimeout(() => {\n this.value = [...this.value, e.detail];\n }, 0);\n });\n }\n }\n\n setGetValidity() {\n // eslint-disable-next-line func-names\n this.getValidity = function () {\n if (this.pattern) {\n const patternRegex = new RegExp(this.pattern);\n if (this.value.some((val) => !patternRegex.test(val)))\n return {\n patternMismatch: true,\n };\n }\n\n if (this.isRequired && !this.value.length) {\n return {\n valueMissing: true,\n };\n }\n // If the field is not required, no minimum selection can be set\n if (\n this.isRequired &&\n this.minItemsSelection &&\n this.value.length < this.minItemsSelection\n ) {\n return {\n rangeUnderflow: true,\n };\n }\n if (this.maxItemsSelection && this.value.length > this.maxItemsSelection) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n };\n\n // This is required to override the default validity check of the vaadin component\n // which is triggered when the component is checked for validity after blur\n // Without this, our minItemsSelection and maxItemsSelection constraints will not be checked\n const that = this;\n // eslint-disable-next-line func-names\n this.baseElement.checkValidity = () => {\n return that.validity.valid;\n };\n }\n\n init() {\n super.init?.();\n\n this.setGetValidity();\n\n this.setComboBoxDescriptor();\n\n this.#overrideOverlaySettings();\n\n this.#handleCustomValues();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n // Note: we need to forward the `placeholder` because the vaadin component observes it and\n // tries to override it, causing us to lose the user set placeholder.\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n\n this.setDefaultValues();\n\n this.baseElement.addEventListener('selected-items-changed', () => {\n this.#updateInternalValue();\n this.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n });\n }\n\n setDefaultValues() {\n const initialDefaultValues = this.defaultValues;\n if (initialDefaultValues.length > 0) {\n this.value = this.defaultValues;\n }\n }\n\n #updateInternalValue() {\n // This is done here because we don't want to return a different copy of the same array\n // every time get value is called if a new value wasn't set\n this.#value =\n this.baseElement.selectedItems?.map((elem) => elem.getAttribute('data-id')) || [];\n }\n\n // Updating the value will update the selectedItems, which will trigger an event 'selected-items-changed'\n // which we listen to in the init function to update the internal value\n set value(vals) {\n if (vals && vals.length > 0) {\n // Filters the children of the component to find the ones that match the values,\n // since it's possible that some values that are trying to set are not in the children\n const selectedChildren = this.baseElement.items?.filter((item) =>\n vals.includes(item['data-id'])\n );\n\n // If the component allows custom values, we need to add the values that are not present in the children\n if (this.allowCustomValues) {\n const existingValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n const missingValues = vals.filter((val) => !existingValues.includes(val));\n\n if (missingValues.length) {\n const newItemsHtml = missingValues.reduce((acc, val) => {\n const newItemHtml = this.#renderItem({\n label: val,\n displayName: val,\n value: val,\n });\n return acc + newItemHtml;\n }, '');\n this.innerHTML += newItemsHtml;\n\n // The value needs to be set with a timeout because it needs to execute after\n // the custom values are added to the items by the children change observer\n setTimeout(() => {\n this.value = vals;\n }, 0);\n return;\n }\n }\n\n const newSelectedValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n if (!compareArraysUnordered(this.#value, newSelectedValues)) {\n this.baseElement.selectedItems = selectedChildren;\n }\n } else {\n this.baseElement.selectedItems = [];\n }\n }\n\n get value() {\n return this.#value;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null && newValue === 'true');\n }\n }\n\n onReadOnlyChange(val) {\n if (val) {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.setAttribute('inert', val);\n } else {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.removeAttribute('inert');\n }\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n chip,\n chipLabel,\n overflowChipFirstBorder,\n overflowChipSecondBorder,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n chip: { selector: 'vaadin-multi-select-combo-box-chip' },\n chipLabel: { selector: 'vaadin-multi-select-combo-box-chip::part(label)' },\n overflowChipFirstBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::before\",\n },\n overflowChipSecondBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::after\",\n },\n};\n\nexport const MultiSelectComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n chipFontSize: { ...chipLabel, property: 'font-size' },\n fontFamily: [label, placeholder, inputField, helperText, errorMessage, chipLabel],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'min-height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n { ...inputField, property: 'padding-inline-start' },\n ],\n inputVerticalPadding: [\n { ...inputField, property: 'padding-top' },\n { ...inputField, property: 'padding-bottom' },\n ],\n chipTextColor: { ...chipLabel, property: 'color' },\n chipBackgroundColor: [\n { ...chip, property: 'background-color' },\n { ...overflowChipFirstBorder, property: 'border-color' },\n { ...overflowChipSecondBorder, property: 'border-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelLeftPosition: { ...label, property: 'left' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n\n // we need to use the variables from the portal mixin\n // so we need to use an arrow function on the selector\n // for that to work, because ComboBox is not available\n // at this time.\n overlayBackground: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.border },\n overlayFontSize: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontSize },\n overlayFontFamily: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontFamily },\n overlayCursor: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.cursor },\n overlayItemBoxShadow: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: 'vaadin-multi-select-combo-box-internal',\n mappings: {\n backgroundColor: { selector: 'vaadin-multi-select-combo-box-scroller' },\n minHeight: { selector: 'vaadin-multi-select-combo-box-overlay' },\n margin: { selector: 'vaadin-multi-select-combo-box-overlay' },\n cursor: { selector: 'vaadin-multi-select-combo-box-item' },\n fontFamily: { selector: 'vaadin-multi-select-combo-box-item' },\n textColor: { selector: 'vaadin-multi-select-combo-box-item', property: 'color' },\n fontSize: { selector: 'vaadin-multi-select-combo-box-item' },\n itemBoxShadow: { selector: 'vaadin-multi-select-combo-box-item', property: 'box-shadow' },\n itemPaddingInlineStart: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-end',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({ proxyProps: ['selectionStart'], inputEvent: 'selected-items-changed' }),\n changeMixin,\n componentNameValidationMixin,\n multiSelectComboBoxMixin\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-multi-select-combo-box',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${useHostExternalPadding(MultiSelectComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-multi-select-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-multi-select-combo-box')}\n\t\t${resetInputCursor('vaadin-multi-select-combo-box')}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot=\"input\"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${resetInputLabelPosition('vaadin-multi-select-combo-box')}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${inputFloatingLabelStyle()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,\n // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property\n // with the same name. Including it will cause Vaadin to calculate NaN size,\n // and reset items to an empty array, and opening the list box with no items\n // to display.\n // Note: we exclude `placeholder` because the vaadin component observes it and\n // tries to override it, causing us to lose the user set placeholder.\n excludeAttrsSync: ['tabindex', 'size', 'data', 'placeholder'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItems'],\n })\n);\n","import '@vaadin/multi-select-combo-box';\nimport { componentName, MultiSelectComboBoxClass } from './MultiSelectComboBoxClass';\n\ncustomElements.define(componentName, MultiSelectComboBoxClass);\n\nexport { MultiSelectComboBoxClass, componentName };\n","export const useHostExternalPadding = (cssVarList) => `\n :host {\n padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))\n }\n`;\n\nexport const resetInputFieldUnderlayingBorder = (name) => `\n ${name}::part(input-field)::after {\n border: none;\n }\n`;\n\nexport const resetInitialHeight = (name) => `\n ${name}::before {\n\t\theight: unset;\n\t}\n`;\n\nexport const resetInputElement = (name) => `\n ${name} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputContainer = (name) => `\n ${name} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputField = (name) => `\n ${name}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`;\n\nexport const resetInputCursor = (name) => `\n ${name} > label,\n ${name}::part(label),\n ${name}::part(required-indicator) {\n cursor: pointer;\n }\n`;\n\nexport const resetInputPlaceholder = (name, ele = 'input') => `\n ${name}[disabled] > ${ele}:placeholder-shown,\n\t${name}[readonly] > ${ele}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`;\n\nexport const resetInputAutoFill = (name, cssVarList) => `\n ${name} input:-webkit-autofill,\n ${name} input:-webkit-autofill::first-line,\n ${name} input:-webkit-autofill:hover,\n ${name} input:-webkit-autofill:active,\n ${name} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});\n box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;\n }\n`;\n\nexport const resetInputFieldDefaultWidth = () => `\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputReadonlyStyle = (name) => `\n ${name}::part(input-field)::after {\n opacity: 0;\n }\n`;\n\nexport const resetInputFieldInvalidBackgroundColor = (name) => `\n ${name}::part(input-field)::after {\n background: none;\n }\n`;\n\nexport const resetInputOverrides = (name, cssVarList) => `\n ${resetInputContainer(name)}\n ${resetInputCursor(name)}\n ${resetInputPlaceholder(name)}\n ${resetInputField(name)}\n ${resetInputAutoFill(name, cssVarList)}\n ${resetInputFieldInvalidBackgroundColor(name)}\n ${resetInitialHeight(name)}\n ${resetInputElement(name)}\n ${resetInputFieldUnderlayingBorder(name)}\n`;\n\n// This function is used to support RTL correctly for input components.\n// It also fixes the error message to be displayed LTR since we currently\n// don't support RTL for error messages.\nexport const resetInputLabelPosition = (name) => `\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${name} [slot=\"label\"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`;\n\nexport const inputFloatingLabelStyle = () => {\n return `\n :host([label-type=\"floating\"]) {\n position: relative;\n }\n :host([label-type=\"floating\"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","chip","chipLabel","overflowChipFirstBorder","overflowChipSecondBorder","selector","MultiSelectComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","chipFontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","inputVerticalPadding","chipTextColor","chipBackgroundColor","labelPosition","labelTopPosition","labelLeftPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","name","minHeight","margin","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","ele","document","createElement","setAttribute","textContent","outerHTML","defaultValues","defaultValuesAttr","this","getAttribute","JSON","parse","isValidDataType","e","console","error","message","renderItem","renderFn","renderItems","data","dataAttr","allowCustomValues","minItemsSelection","parseInt","maxItemsSelection","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","updateSelectedItems","currentSelected","baseElement","selectedItems","map","length","setDefaultValues","customValueTransformFn","val","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","transformedValue","call","items","from","Map","values","children","dedupItems","removeAttribute","forEach","node","defineProperty","configurable","writable","setTimeout","renderer","root","combo","model","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","addEventListener","newItemHtml","detail","_lastFilter","setGetValidity","getValidity","pattern","patternRegex","RegExp","some","test","patternMismatch","isRequired","valueMissing","rangeUnderflow","rangeOverflow","that","checkValidity","validity","valid","init","super","bind","includeAttrs","dispatchEvent","CustomEvent","bubbles","elem","vals","selectedChildren","filter","includes","existingValues","child","missingValues","newItemsHtml","newSelectedValues","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define","useHostExternalPadding","resetInputContainer","resetInputField","resetInputCursor","resetInputPlaceholder","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-multi-select-combo-box-index-js.js","mappings":"oQAyBO,MAAMA,GAAgB,QAAiB,2BAoZxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAAW,MACXC,EAAK,kBACLC,EAAiB,WACjBC,EAAU,aACVC,EAAY,KACZC,EAAI,UACJC,EAAS,wBACTC,EAAuB,yBACvBC,GACE,CACFb,KAAM,CAAEc,SAAU,IAAM,SACxBb,WAAY,CAAEa,SAAU,uBACxBZ,aAAc,CAAEY,SAAU,SAC1BX,YAAa,CAAEW,SAAU,6BACzBV,OAAQ,CAAEU,SAAU,yBACpBT,YAAa,CAAES,SAAU,wBACzBR,MAAO,CAAEQ,SAAU,iBACnBP,kBAAmB,CAAEO,SAAU,+CAC/BN,WAAY,CAAEM,SAAU,uBACxBL,aAAc,CAAEK,SAAU,yBAC1BJ,KAAM,CAAEI,SAAU,sCAClBH,UAAW,CAAEG,SAAU,mDACvBF,wBAAyB,CACvBE,SAAU,+DAEZD,yBAA0B,CACxBC,SAAU,+DAIDC,GAA2B,SACtC,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKjB,EAAMkB,SAAU,SAChCC,cAAe,IAAKnB,EAAMkB,SAAU,aAEpCE,SAAU,CAAC,CAAC,EAAGpB,GACfqB,aAAc,IAAKV,EAAWO,SAAU,aACxCI,WAAY,CAAChB,EAAOH,EAAaF,EAAYO,EAAYC,EAAcE,GACvEY,cAAe,IAAKjB,EAAOY,SAAU,aACrCM,gBAAiB,IAAKlB,EAAOY,SAAU,eACvCO,eAAgB,CACd,IAAKnB,EAAOY,SAAU,SACtB,IAAK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C,OAAO5N,EAAegB,E,8HCH9B,MAAM6M,EAA0B5J,GAAe,4CAE1BA,EAAWjB,4BAA4BiB,EAAWf,gCAwBjE4K,EAAuB5I,GAAS,SACvCA,sIASO6I,EAAmB7I,GAAS,SACnCA,6GAOO8I,EAAoB9I,GAAS,SACpCA,mBACAA,wBACAA,mEAKO+I,EAAwB,CAAC/I,EAAMY,EAAM,UAAY,SACxDZ,iBAAoBY,2BACvBZ,iBAAoBY,gDAgBVoI,EAA8B,IAAM,uGAOpCC,EAA2BjJ,GAAS,SAC3CA,8DAKOkJ,EAAyClJ,GAAS,SACzDA,oEAKOmJ,EAAsB,CAACnJ,EAAMjB,IAAe,SACnD6J,EAAoB5I,WACpB8I,EAAiB9I,WACjB+I,EAAsB/I,WACtB6I,EAAgB7I,WAlCY,EAACA,EAAMjB,IAAe,SAClDiB,kCACAA,8CACAA,wCACAA,yCACAA,0EACiCjB,EAAWxB,wDAClBwB,EAAW/B,oBAAoB+B,EAAW9B,wCA4BpEmM,CAAmBpJ,EAAMjB,WACzBmK,EAAsClJ,WAnFV,CAACA,GAAS,SACtCA,yCAmFAqJ,CAAmBrJ,WA9EQ,CAACA,GAAS,SACrCA,mHA8EAsJ,CAAkBtJ,WA3FwB,CAACA,GAAS,SACpDA,gEA2FAuJ,CAAiCvJ,OAM1BwJ,EAA2BxJ,GAAS,4ZAiB3CA,yJAQOyJ,EAA0B,IAC9B,gM","sources":["webpack://@descope/web-components-ui/./src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js","webpack://@descope/web-components-ui/./src/components/descope-multi-select-combo-box/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js"],"sourcesContent":["import { compose, compareArraysUnordered } from '../../helpers';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '../../helpers/componentHelpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n portalMixin,\n proxyInputMixin,\n changeMixin,\n} from '../../mixins';\n\nexport const componentName = getComponentName('multi-select-combo-box');\n\nconst multiSelectComboBoxMixin = (superclass) =>\n class MultiSelectComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ displayName, value, label }) => {\n const ele = document.createElement('span');\n ele.setAttribute('data-name', label);\n ele.setAttribute('data-id', value);\n ele.textContent = displayName || label;\n\n return ele.outerHTML;\n };\n\n #data;\n\n #value = [];\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"default-values\" -', e.message);\n }\n }\n return [];\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"data\" -', e.message);\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get allowCustomValues() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data and default-values must be an array, received:', data);\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.((acc, item) => acc + (this.renderItem?.(item || {}) || ''), '');\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) this.innerHTML = template;\n }\n\n updateSelectedItems() {\n // This is a list of all the selected items, including ones that may have been removed from the DOM\n const currentSelected =\n this.baseElement.selectedItems?.map((item) => item.getAttribute('data-id')) || [];\n\n // if there are selected items, we want to trigger a potential update to the value if some child elements were removed\n if (currentSelected.length > 0) {\n // setting the value checks that the selected items are still in the DOM and will not set the value if they are not\n this.value = currentSelected;\n }\n\n // otherwise, if default value is specified, set default value as selected item\n if (this.value.length === 0) {\n this.setDefaultValues();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n customValueTransformFn(val) {\n return val;\n }\n\n // We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the\n // field that it searches the value, and the finaly display value of the input.\n // We provide a custom transform function to override that behavior.\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value'\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n // To prevent duplicate items for the multi select options, we dedup them based on the \"data-id\" attribute\n // eslint-disable-next-line class-methods-use-this\n #dedupItems(items) {\n return Array.from(\n new Map(items.map((item) => [item.getAttribute('data-id'), item])).values()\n );\n }\n\n // vaadin api is to set props on their combo box node,\n // in order to avoid it, we are passing the children of this component\n // to the items & renderer props, so it will be used as the combo box items\n #onChildrenChange() {\n const items = Array.from(this.children);\n const dedupItems = this.#dedupItems(items);\n\n // we want the data-name attribute to be accessible as an object attribute\n if (items.length) {\n this.removeAttribute('has-no-options');\n\n dedupItems.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = dedupItems;\n\n setTimeout(() => {\n // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden\n this.updateSelectedItems();\n }, 0);\n } else {\n this.baseElement.items = [];\n this.setAttribute('has-no-options', '');\n }\n\n // use vaadin combobox custom renderer to render options as HTML\n // and not via default renderer, which renders only the data-name's value\n // in its own HTML template\n this.baseElement.renderer = (root, combo, model) => {\n // eslint-disable-next-line no-param-reassign\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot\n .querySelector('vaadin-multi-select-combo-box-internal')\n .shadowRoot.querySelector('vaadin-multi-select-combo-box-overlay');\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #handleCustomValues() {\n if (this.allowCustomValues) {\n this.baseElement.addEventListener('custom-value-set', (e) => {\n const newItemHtml = this.#renderItem({\n label: e.detail,\n displayName: e.detail,\n value: e.detail,\n });\n this.innerHTML += newItemHtml;\n // The internal filter needs to be removed, otherwise there's a bug where a new custom item\n // added can't be removed from the dropdown because of how the vaadin component is implemented\n this.baseElement._lastFilter = '';\n // The value needs to be set with a timeout because it needs to execute after\n // the custom value is added to items by the children change observer\n setTimeout(() => {\n this.value = [...this.value, e.detail];\n }, 0);\n });\n }\n }\n\n setGetValidity() {\n // eslint-disable-next-line func-names\n this.getValidity = function () {\n if (this.pattern) {\n const patternRegex = new RegExp(this.pattern);\n if (this.value.some((val) => !patternRegex.test(val)))\n return {\n patternMismatch: true,\n };\n }\n\n if (this.isRequired && !this.value.length) {\n return {\n valueMissing: true,\n };\n }\n // If the field is not required, no minimum selection can be set\n if (\n this.isRequired &&\n this.minItemsSelection &&\n this.value.length < this.minItemsSelection\n ) {\n return {\n rangeUnderflow: true,\n };\n }\n if (this.maxItemsSelection && this.value.length > this.maxItemsSelection) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n };\n\n // This is required to override the default validity check of the vaadin component\n // which is triggered when the component is checked for validity after blur\n // Without this, our minItemsSelection and maxItemsSelection constraints will not be checked\n const that = this;\n // eslint-disable-next-line func-names\n this.baseElement.checkValidity = () => {\n return that.validity.valid;\n };\n }\n\n init() {\n super.init?.();\n\n this.setGetValidity();\n\n this.#handleCustomValues();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n // Note: we need to forward the `placeholder` because the vaadin component observes it and\n // tries to override it, causing us to lose the user set placeholder.\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n\n // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to\n // set the component's descriptor and override the overlay settings.\n // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n this.setDefaultValues();\n\n this.baseElement.addEventListener('selected-items-changed', () => {\n this.#updateInternalValue();\n this.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n });\n }\n\n setDefaultValues() {\n const initialDefaultValues = this.defaultValues;\n if (initialDefaultValues.length > 0) {\n this.value = this.defaultValues;\n }\n }\n\n #updateInternalValue() {\n // This is done here because we don't want to return a different copy of the same array\n // every time get value is called if a new value wasn't set\n this.#value =\n this.baseElement.selectedItems?.map((elem) => elem.getAttribute('data-id')) || [];\n }\n\n // Updating the value will update the selectedItems, which will trigger an event 'selected-items-changed'\n // which we listen to in the init function to update the internal value\n set value(vals) {\n if (vals && vals.length > 0) {\n // Filters the children of the component to find the ones that match the values,\n // since it's possible that some values that are trying to set are not in the children\n const selectedChildren = this.baseElement.items?.filter((item) =>\n vals.includes(item['data-id'])\n );\n\n // If the component allows custom values, we need to add the values that are not present in the children\n if (this.allowCustomValues) {\n const existingValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n const missingValues = vals.filter((val) => !existingValues.includes(val));\n\n if (missingValues.length) {\n const newItemsHtml = missingValues.reduce((acc, val) => {\n const newItemHtml = this.#renderItem({\n label: val,\n displayName: val,\n value: val,\n });\n return acc + newItemHtml;\n }, '');\n this.innerHTML += newItemsHtml;\n\n // The value needs to be set with a timeout because it needs to execute after\n // the custom values are added to the items by the children change observer\n setTimeout(() => {\n this.value = vals;\n }, 0);\n return;\n }\n }\n\n const newSelectedValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n if (!compareArraysUnordered(this.#value, newSelectedValues)) {\n this.baseElement.selectedItems = selectedChildren;\n }\n } else {\n this.baseElement.selectedItems = [];\n }\n }\n\n get value() {\n return this.#value;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null && newValue === 'true');\n }\n }\n\n onReadOnlyChange(val) {\n if (val) {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.setAttribute('inert', val);\n } else {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.removeAttribute('inert');\n }\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n chip,\n chipLabel,\n overflowChipFirstBorder,\n overflowChipSecondBorder,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n chip: { selector: 'vaadin-multi-select-combo-box-chip' },\n chipLabel: { selector: 'vaadin-multi-select-combo-box-chip::part(label)' },\n overflowChipFirstBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::before\",\n },\n overflowChipSecondBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::after\",\n },\n};\n\nexport const MultiSelectComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n chipFontSize: { ...chipLabel, property: 'font-size' },\n fontFamily: [label, placeholder, inputField, helperText, errorMessage, chipLabel],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'min-height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n { ...inputField, property: 'padding-inline-start' },\n ],\n inputVerticalPadding: [\n { ...inputField, property: 'padding-top' },\n { ...inputField, property: 'padding-bottom' },\n ],\n chipTextColor: { ...chipLabel, property: 'color' },\n chipBackgroundColor: [\n { ...chip, property: 'background-color' },\n { ...overflowChipFirstBorder, property: 'border-color' },\n { ...overflowChipSecondBorder, property: 'border-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelLeftPosition: { ...label, property: 'left' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n\n // we need to use the variables from the portal mixin\n // so we need to use an arrow function on the selector\n // for that to work, because ComboBox is not available\n // at this time.\n overlayBackground: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.border },\n overlayFontSize: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontSize },\n overlayFontFamily: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontFamily },\n overlayCursor: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.cursor },\n overlayItemBoxShadow: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: 'vaadin-multi-select-combo-box-internal',\n mappings: {\n backgroundColor: { selector: 'vaadin-multi-select-combo-box-scroller' },\n minHeight: { selector: 'vaadin-multi-select-combo-box-overlay' },\n margin: { selector: 'vaadin-multi-select-combo-box-overlay' },\n cursor: { selector: 'vaadin-multi-select-combo-box-item' },\n fontFamily: { selector: 'vaadin-multi-select-combo-box-item' },\n textColor: { selector: 'vaadin-multi-select-combo-box-item', property: 'color' },\n fontSize: { selector: 'vaadin-multi-select-combo-box-item' },\n itemBoxShadow: { selector: 'vaadin-multi-select-combo-box-item', property: 'box-shadow' },\n itemPaddingInlineStart: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-end',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({ proxyProps: ['selectionStart'], inputEvent: 'selected-items-changed' }),\n changeMixin,\n componentNameValidationMixin,\n multiSelectComboBoxMixin\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-multi-select-combo-box',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${useHostExternalPadding(MultiSelectComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-multi-select-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-multi-select-combo-box')}\n\t\t${resetInputCursor('vaadin-multi-select-combo-box')}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot=\"input\"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${resetInputLabelPosition('vaadin-multi-select-combo-box')}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${inputFloatingLabelStyle()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,\n // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property\n // with the same name. Including it will cause Vaadin to calculate NaN size,\n // and reset items to an empty array, and opening the list box with no items\n // to display.\n // Note: we exclude `placeholder` because the vaadin component observes it and\n // tries to override it, causing us to lose the user set placeholder.\n excludeAttrsSync: ['tabindex', 'size', 'data', 'placeholder'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItems'],\n })\n);\n","import '@vaadin/multi-select-combo-box';\nimport { componentName, MultiSelectComboBoxClass } from './MultiSelectComboBoxClass';\n\ncustomElements.define(componentName, MultiSelectComboBoxClass);\n\nexport { MultiSelectComboBoxClass, componentName };\n","export const useHostExternalPadding = (cssVarList) => `\n :host {\n padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))\n }\n`;\n\nexport const resetInputFieldUnderlayingBorder = (name) => `\n ${name}::part(input-field)::after {\n border: none;\n }\n`;\n\nexport const resetInitialHeight = (name) => `\n ${name}::before {\n\t\theight: unset;\n\t}\n`;\n\nexport const resetInputElement = (name) => `\n ${name} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputContainer = (name) => `\n ${name} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputField = (name) => `\n ${name}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`;\n\nexport const resetInputCursor = (name) => `\n ${name} > label,\n ${name}::part(label),\n ${name}::part(required-indicator) {\n cursor: pointer;\n }\n`;\n\nexport const resetInputPlaceholder = (name, ele = 'input') => `\n ${name}[disabled] > ${ele}:placeholder-shown,\n\t${name}[readonly] > ${ele}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`;\n\nexport const resetInputAutoFill = (name, cssVarList) => `\n ${name} input:-webkit-autofill,\n ${name} input:-webkit-autofill::first-line,\n ${name} input:-webkit-autofill:hover,\n ${name} input:-webkit-autofill:active,\n ${name} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});\n box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;\n }\n`;\n\nexport const resetInputFieldDefaultWidth = () => `\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputReadonlyStyle = (name) => `\n ${name}::part(input-field)::after {\n opacity: 0;\n }\n`;\n\nexport const resetInputFieldInvalidBackgroundColor = (name) => `\n ${name}::part(input-field)::after {\n background: none;\n }\n`;\n\nexport const resetInputOverrides = (name, cssVarList) => `\n ${resetInputContainer(name)}\n ${resetInputCursor(name)}\n ${resetInputPlaceholder(name)}\n ${resetInputField(name)}\n ${resetInputAutoFill(name, cssVarList)}\n ${resetInputFieldInvalidBackgroundColor(name)}\n ${resetInitialHeight(name)}\n ${resetInputElement(name)}\n ${resetInputFieldUnderlayingBorder(name)}\n`;\n\n// This function is used to support RTL correctly for input components.\n// It also fixes the error message to be displayed LTR since we currently\n// don't support RTL for error messages.\nexport const resetInputLabelPosition = (name) => `\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${name} [slot=\"label\"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`;\n\nexport const inputFloatingLabelStyle = () => {\n return `\n :host([label-type=\"floating\"]) {\n position: relative;\n }\n :host([label-type=\"floating\"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","chip","chipLabel","overflowChipFirstBorder","overflowChipSecondBorder","selector","MultiSelectComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","chipFontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","inputVerticalPadding","chipTextColor","chipBackgroundColor","labelPosition","labelTopPosition","labelLeftPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","name","minHeight","margin","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","ele","document","createElement","setAttribute","textContent","outerHTML","defaultValues","defaultValuesAttr","this","getAttribute","JSON","parse","isValidDataType","e","console","error","message","renderItem","renderFn","renderItems","data","dataAttr","allowCustomValues","minItemsSelection","parseInt","maxItemsSelection","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","updateSelectedItems","currentSelected","baseElement","selectedItems","map","length","setDefaultValues","customValueTransformFn","val","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","transformedValue","call","items","from","Map","values","children","dedupItems","removeAttribute","forEach","node","defineProperty","configurable","writable","setTimeout","renderer","root","combo","model","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","addEventListener","newItemHtml","detail","_lastFilter","setGetValidity","getValidity","pattern","patternRegex","RegExp","some","test","patternMismatch","isRequired","valueMissing","rangeUnderflow","rangeOverflow","that","checkValidity","validity","valid","init","super","bind","includeAttrs","dispatchEvent","CustomEvent","bubbles","elem","vals","selectedChildren","filter","includes","existingValues","child","missingValues","newItemsHtml","newSelectedValues","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define","useHostExternalPadding","resetInputContainer","resetInputField","resetInputCursor","resetInputPlaceholder","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.114.0",
3
+ "version": "1.116.0",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -81,9 +81,9 @@
81
81
  "@descope-ui/descope-icon": "0.0.17",
82
82
  "@descope-ui/descope-text": "0.0.19",
83
83
  "@descope-ui/descope-avatar": "0.0.19",
84
- "@descope-ui/descope-combo-box": "0.1.9",
85
- "@descope-ui/descope-autocomplete-field": "0.0.22",
86
- "@descope-ui/descope-address-field": "0.0.21",
84
+ "@descope-ui/descope-combo-box": "0.1.10",
85
+ "@descope-ui/descope-autocomplete-field": "0.0.23",
86
+ "@descope-ui/descope-address-field": "0.0.22",
87
87
  "@descope-ui/descope-timer": "0.0.17",
88
88
  "@descope-ui/descope-timer-button": "0.0.20",
89
89
  "@descope-ui/descope-list": "0.0.1",
@@ -9,11 +9,12 @@ import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
9
9
  import { compose } from '../../helpers';
10
10
  import {
11
11
  newDate,
12
- isValidTimestamp,
13
- formatTimestamp,
12
+ isValidEpoch,
13
+ formatEpoch,
14
14
  isNumber,
15
15
  getCurrentTime,
16
16
  overrideConstructedStylesheet,
17
+ dateToEpoch,
17
18
  } from './helpers';
18
19
  import { formats } from './formats';
19
20
  import { calendarIcon } from './icons';
@@ -37,12 +38,19 @@ export const componentName = getComponentName('date-field');
37
38
  const BASE_SELECTOR = 'vaadin-popover';
38
39
  const BaseInputClass = createBaseInputClass({ componentName, baseSelector: BASE_SELECTOR });
39
40
 
40
- const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];
41
+ const dateFieldAttrs = [
42
+ 'format',
43
+ 'opened',
44
+ 'initial-value',
45
+ 'readonly',
46
+ 'disable-calendar',
47
+ 'utc-time',
48
+ ];
41
49
  const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
42
50
  const observedAttrs = [...dateFieldAttrs, ...calendarAttrs];
43
51
 
44
52
  class RawDateFieldClass extends BaseInputClass {
45
- timestamp = '';
53
+ epoch = '';
46
54
 
47
55
  format = DEFAULT_FORMAT;
48
56
 
@@ -54,10 +62,10 @@ class RawDateFieldClass extends BaseInputClass {
54
62
 
55
63
  updateValue() {
56
64
  if (this.isCountersOutOfRange) {
57
- this.updateTimestamp('');
65
+ this.updateEpoch('');
58
66
  } else {
59
67
  const date = formats[this.format].getDate(this.inputElement.value);
60
- this.updateTimestamp(date.getTime());
68
+ this.updateEpoch(dateToEpoch(date, this.isUtcTime));
61
69
  }
62
70
  }
63
71
 
@@ -68,11 +76,11 @@ class RawDateFieldClass extends BaseInputClass {
68
76
  this.#dispatchInput();
69
77
  };
70
78
 
71
- updateTimestamp(epochOrDate) {
79
+ updateEpoch(epochOrDate) {
72
80
  if (!epochOrDate) {
73
- this.timestamp = '';
81
+ this.epoch = '';
74
82
  } else {
75
- this.timestamp = newDate(epochOrDate).getTime();
83
+ this.epoch = newDate(epochOrDate).getTime();
76
84
  }
77
85
  }
78
86
 
@@ -145,11 +153,11 @@ class RawDateFieldClass extends BaseInputClass {
145
153
  return this.getAttribute('opened') === 'true';
146
154
  }
147
155
 
148
- // returns the input's value as a timestamp
156
+ // returns the input's value as a epoch
149
157
  get displayValueEpoch() {
150
158
  const date = formats[this.format].getDate(this.inputElement.value);
151
159
 
152
- if (!isValidTimestamp(date?.getTime())) {
160
+ if (!isValidEpoch(date?.getTime())) {
153
161
  return null;
154
162
  }
155
163
 
@@ -197,15 +205,15 @@ class RawDateFieldClass extends BaseInputClass {
197
205
  if (this.isInvalidDate()) {
198
206
  return '';
199
207
  }
200
- return this.timestamp;
208
+ return this.epoch;
201
209
  }
202
210
 
203
211
  set value(val) {
204
212
  if (val) {
205
- this.updateTimestamp(val);
213
+ this.updateEpoch(val);
206
214
  this.updateDateCounters(newDate(val));
207
215
  } else {
208
- this.updateTimestamp('');
216
+ this.updateEpoch('');
209
217
  }
210
218
  }
211
219
 
@@ -221,6 +229,10 @@ class RawDateFieldClass extends BaseInputClass {
221
229
  return this.getAttribute('disable-calendar') === 'true';
222
230
  }
223
231
 
232
+ get isUtcTime() {
233
+ return this.getAttribute('utc-time') === 'true';
234
+ }
235
+
224
236
  get isSelectAll() {
225
237
  const inputEle = this.inputElement.baseElement.inputElement;
226
238
  return inputEle.value.length === inputEle.selectionStart + inputEle.selectionEnd;
@@ -235,7 +247,7 @@ class RawDateFieldClass extends BaseInputClass {
235
247
  }
236
248
 
237
249
  updateInputDisplay() {
238
- this.inputElement.value = formatTimestamp(newDate(this.countersValue).getTime(), this.format);
250
+ this.inputElement.value = formatEpoch(newDate(this.countersValue).getTime(), this.format);
239
251
  }
240
252
 
241
253
  init() {
@@ -426,7 +438,7 @@ class RawDateFieldClass extends BaseInputClass {
426
438
 
427
439
  const calendarDate = newDate(this.calendar.value);
428
440
 
429
- this.value = calendarDate.getTime();
441
+ this.value = dateToEpoch(calendarDate, this.isUtcTime);
430
442
 
431
443
  this.getCounterById('year').replaceValue(calendarDate.getFullYear());
432
444
  this.getCounterById('month').replaceValue(calendarDate.getMonth() + 1);
@@ -440,17 +452,17 @@ class RawDateFieldClass extends BaseInputClass {
440
452
 
441
453
  updateCalendarView() {
442
454
  const validInputVal =
443
- isValidTimestamp(newDate(this.inputElement.value || '').getTime()) &&
455
+ isValidEpoch(newDate(this.inputElement.value || '').getTime()) &&
444
456
  formats[this.format].validate(this.inputElement.value);
445
457
 
446
458
  if (this.displayValueEpoch || validInputVal) {
447
459
  this.calendar.setAttribute(
448
460
  'initial-value',
449
- formatTimestamp(this.displayValueEpoch || this.timestamp, NATIVE_FORMAT)
461
+ formatEpoch(this.displayValueEpoch || this.epoch, NATIVE_FORMAT)
450
462
  );
451
463
  } else {
452
464
  this.calendar.clearValue();
453
- this.calendar.setAttribute('preview', formatTimestamp(getCurrentTime(), NATIVE_FORMAT));
465
+ this.calendar.setAttribute('preview', formatEpoch(getCurrentTime(), NATIVE_FORMAT));
454
466
  }
455
467
 
456
468
  forwardAttrs(this, this.calendar, {
@@ -768,12 +780,22 @@ class RawDateFieldClass extends BaseInputClass {
768
780
  year: '',
769
781
  };
770
782
 
771
- try {
772
- const date = newDate(this.timestamp);
783
+ if (!this.epoch) {
784
+ return ret;
785
+ }
773
786
 
774
- ret.month = date.getMonth() + 1;
775
- ret.day = date.getDate();
776
- ret.year = date.getFullYear();
787
+ try {
788
+ const date = newDate(this.epoch);
789
+
790
+ if (this.isUtcTime) {
791
+ ret.month = date.getUTCMonth() + 1;
792
+ ret.day = date.getUTCDate();
793
+ ret.year = date.getUTCFullYear();
794
+ } else {
795
+ ret.month = date.getMonth() + 1;
796
+ ret.day = date.getDate();
797
+ ret.year = date.getFullYear();
798
+ }
777
799
  } catch (e) {}
778
800
 
779
801
  return ret;
@@ -817,7 +839,7 @@ class RawDateFieldClass extends BaseInputClass {
817
839
  const validDate = parseDateString(pastedData, this.format);
818
840
 
819
841
  if (validDate) {
820
- this.value = validDate.getTime();
842
+ this.value = dateToEpoch(validDate, this.isUtcTime);
821
843
  this.onDateCounterChange();
822
844
 
823
845
  // select all
@@ -5,10 +5,10 @@ import { inputFloatingLabelStyle } from '../../../helpers/themeHelpers/resetHelp
5
5
  import { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../../mixins';
6
6
  import {
7
7
  getCurrentDay,
8
- getTimestampParts,
9
- isValidTimestamp,
8
+ getPartsFromEpoch,
9
+ isValidEpoch,
10
10
  newDate,
11
- formatTimestamp,
11
+ formatEpoch,
12
12
  getCurrentTime,
13
13
  getFullYear,
14
14
  getMonth,
@@ -61,11 +61,11 @@ class RawCalendar extends BaseInputClass {
61
61
  return [].concat(BaseInputClass.observedAttributes || [], observedAttrs, calendarUiAttrs);
62
62
  }
63
63
 
64
- // preview state timestamp
64
+ // preview state epoch
65
65
  preview;
66
66
 
67
- // value timestamp
68
- timestamp;
67
+ // value epoch
68
+ epoch;
69
69
 
70
70
  constructor() {
71
71
  super();
@@ -151,23 +151,23 @@ class RawCalendar extends BaseInputClass {
151
151
  set value(val) {
152
152
  if (!val) return;
153
153
 
154
- const timestamp = newDate(val).getTime();
154
+ const epoch = newDate(val).getTime();
155
155
 
156
- if (!isValidTimestamp(timestamp) || timestamp === this.timestmap) {
156
+ if (!isValidEpoch(epoch) || epoch === this.epoch) {
157
157
  return;
158
158
  }
159
159
 
160
- this.timestamp = timestamp;
160
+ this.epoch = epoch;
161
161
 
162
162
  this.renderCalendar();
163
163
  }
164
164
 
165
165
  get value() {
166
- return this.timestamp ? formatTimestamp(this.timestamp, NATIVE_FORMAT) : '';
166
+ return this.epoch ? formatEpoch(this.epoch, NATIVE_FORMAT) : '';
167
167
  }
168
168
 
169
169
  get isSelectedView() {
170
- return isViewVisible(this.preview, this.timestamp);
170
+ return isViewVisible(this.preview, this.epoch);
171
171
  }
172
172
 
173
173
  get isTodayView() {
@@ -284,14 +284,14 @@ class RawCalendar extends BaseInputClass {
284
284
  clearSelectedDay() {
285
285
  this.getSelectedDayEle()?.removeAttribute('data-selected');
286
286
  this.submitButton.setAttribute('disabled', 'true');
287
- this.timestamp = '';
287
+ this.epoch = '';
288
288
  }
289
289
 
290
290
  updateInputs() {
291
291
  if (this.yearInput && this.monthInput) {
292
- const timestamp = this.preview || getCurrentTime();
293
- const year = getFullYear(timestamp);
294
- const month = getMonth(timestamp);
292
+ const epoch = this.preview || getCurrentTime();
293
+ const year = getFullYear(epoch);
294
+ const month = getMonth(epoch);
295
295
  this.monthInput.value = month;
296
296
  // For the yearInput we update the base element directly to properly trigger the change event
297
297
  // since this can be a custom value
@@ -303,9 +303,9 @@ class RawCalendar extends BaseInputClass {
303
303
 
304
304
  renderCalendar() {
305
305
  const date = newDate(this.preview || getCurrentTime());
306
- const timestamp = date.getTime();
306
+ const epoch = date.getTime();
307
307
 
308
- const [year, month] = getTimestampParts(timestamp);
308
+ const [year, month] = getPartsFromEpoch(epoch);
309
309
 
310
310
  if (this.calendar) {
311
311
  this.calendar.innerHTML = createMonthView(year, month, truncateWeekdays(this.weekdayNames));
@@ -324,7 +324,7 @@ class RawCalendar extends BaseInputClass {
324
324
  if (this.isDisabled) return;
325
325
  const date = newDate(this.preview);
326
326
  date.setDate(Number(e.target.getAttribute('data-date-day')));
327
- this.value = formatTimestamp(date.getTime(), NATIVE_FORMAT);
327
+ this.value = formatEpoch(date.getTime(), NATIVE_FORMAT);
328
328
  this.dispatchEvent(new CustomEvent('day-changed', { detail: date }));
329
329
  }
330
330
 
@@ -355,7 +355,7 @@ class RawCalendar extends BaseInputClass {
355
355
  }
356
356
 
357
357
  getSelectedDayEle() {
358
- const day = newDate(this.timestamp).getDate();
358
+ const day = newDate(this.epoch).getDate();
359
359
  return this.calendar?.querySelector(`[data-date-day="${day}"]`);
360
360
  }
361
361
 
@@ -380,8 +380,8 @@ class RawCalendar extends BaseInputClass {
380
380
  if (this.isTodayView) {
381
381
  const ele = this.getCurrentDayEle();
382
382
  const title = this.getAttribute('calendar-label-today') || CALENDAR_LABEL_TODAY;
383
- ele.setAttribute('data-current-day', 'true');
384
- ele.setAttribute('title', title);
383
+ ele?.setAttribute('data-current-day', 'true');
384
+ ele?.setAttribute('title', title);
385
385
  }
386
386
  }
387
387
 
@@ -404,7 +404,7 @@ class RawCalendar extends BaseInputClass {
404
404
  }
405
405
 
406
406
  clearValue() {
407
- this.timestamp = '';
407
+ this.epoch = '';
408
408
  this.value = '';
409
409
  this.removeAttribute('preview');
410
410
  this.submitButton.setAttribute('disabled', 'true');
@@ -417,11 +417,11 @@ class RawCalendar extends BaseInputClass {
417
417
  }
418
418
 
419
419
  const date = newDate(newValue);
420
- const timestamp = date.getTime();
420
+ const epoch = date.getTime();
421
421
 
422
- if (isValidTimestamp(timestamp)) {
423
- this.timestamp = timestamp;
424
- this.preview = timestamp;
422
+ if (isValidEpoch(epoch)) {
423
+ this.epoch = epoch;
424
+ this.preview = epoch;
425
425
  } else {
426
426
  this.clearValue();
427
427
  }
@@ -1,5 +1,5 @@
1
1
  import { months, weekdays } from '../consts';
2
- import { getTimestampParts, newDate } from '../helpers';
2
+ import { getPartsFromEpoch, newDate } from '../helpers';
3
3
 
4
4
  const isValidAttrArr = (arr, count) =>
5
5
  Array.isArray(arr) && arr.length === count && arr.filter(Boolean).length === count;
@@ -91,9 +91,9 @@ export const getMonthsOptions = (customMonths = months) =>
91
91
  .map((item, index) => comboBoxItemTpl({ label: item, dataId: index + 1, dataName: item }))
92
92
  .join('');
93
93
 
94
- export const isViewVisible = (selectionTimestamp, previewTimestamp) => {
95
- const [previewYear, previewMonth] = getTimestampParts(previewTimestamp);
96
- const [selectedYear, selectedMonth] = getTimestampParts(selectionTimestamp);
94
+ export const isViewVisible = (selectionEpoch, previewEpoch) => {
95
+ const [previewYear, previewMonth] = getPartsFromEpoch(previewEpoch);
96
+ const [selectedYear, selectedMonth] = getPartsFromEpoch(selectionEpoch);
97
97
  return selectedYear === previewYear && selectedMonth === previewMonth;
98
98
  };
99
99
 
@@ -154,8 +154,8 @@ export const ensureShortWeekdayNamesArr = (attrVal) => {
154
154
 
155
155
  export const truncateWeekdays = (arr) => arr.map((d) => d.substring(0, 3));
156
156
 
157
- export const prevMonth = (timestamp) => {
158
- const date = newDate(timestamp);
157
+ export const prevMonth = (epoch) => {
158
+ const date = newDate(epoch);
159
159
  const month = date.getMonth();
160
160
 
161
161
  if (month === 0) {
@@ -169,8 +169,8 @@ export const prevMonth = (timestamp) => {
169
169
  return date;
170
170
  };
171
171
 
172
- export const nextMonth = (timestamp) => {
173
- const date = newDate(timestamp);
172
+ export const nextMonth = (epoch) => {
173
+ const date = newDate(epoch);
174
174
  const month = date.getMonth();
175
175
 
176
176
  if (month === 11) {