@descope/web-components-ui 2.3.2 → 3.0.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.
- package/dist/cjs/index.cjs.js +16884 -16946
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5291 -5373
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/5414.js +1 -1
- package/dist/umd/5414.js.LICENSE.txt +1 -1
- package/dist/umd/5414.js.map +1 -1
- package/dist/umd/9365.js +1 -1
- package/dist/umd/9365.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/dist/umd/descope-alert-index-js.js.map +1 -1
- package/dist/umd/descope-code-snippet-index-js.js +1 -1
- package/dist/umd/descope-code-snippet-index-js.js.map +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/dist/umd/descope-container-index-js.js.map +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js.map +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js.map +1 -1
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js.map +1 -1
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.map +1 -1
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.map +1 -1
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.map +1 -1
- package/dist/umd/descope-grid-index-js.js +1 -1
- package/dist/umd/descope-grid-index-js.js.map +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
- package/dist/umd/descope-loader-linear-index-js.js +1 -1
- package/dist/umd/descope-loader-linear-index-js.js.map +1 -1
- package/dist/umd/descope-loader-radial-index-js.js +1 -1
- package/dist/umd/descope-loader-radial-index-js.js.map +1 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-notification-index-js.js.map +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js.map +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js.map +1 -1
- package/dist/umd/descope-policy-validation-index-js.js +1 -1
- package/dist/umd/descope-policy-validation-index-js.js.map +1 -1
- package/dist/umd/descope-radio-group-index-js.js.map +1 -1
- package/dist/umd/descope-recaptcha-index-js.js +1 -1
- package/dist/umd/descope-recaptcha-index-js.js.map +1 -1
- package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
- package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
- package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
- package/dist/umd/descope-upload-file-index-js.js +1 -1
- package/dist/umd/descope-upload-file-index-js.js.map +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +1 -1
- package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js.map +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
- package/package.json +32 -32
- package/src/baseClasses/createBaseClass.js +1 -1
- package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +0 -2
- package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +1 -3
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +0 -1
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +2 -2
- package/src/components/descope-alert/AlertClass.js +2 -2
- package/src/components/descope-code-snippet/CodeSnippetClass.js +1 -1
- package/src/components/descope-code-snippet/helpers.js +1 -3
- package/src/components/descope-container/ContainerClass.js +1 -1
- package/src/components/descope-date-field/DateCounterClass.js +1 -1
- package/src/components/descope-date-field/DateFieldClass.js +4 -5
- package/src/components/descope-date-field/descope-calendar/CalendarClass.js +2 -2
- package/src/components/descope-date-field/descope-calendar/helpers.js +1 -3
- package/src/components/descope-divider/DividerClass.js +2 -2
- package/src/components/descope-grid/GridClass.js +15 -19
- package/src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js +0 -1
- package/src/components/descope-grid/descope-grid-custom-column/index.js +0 -1
- package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +0 -2
- package/src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js +0 -3
- package/src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js +0 -1
- package/src/components/descope-grid/helpers.js +1 -3
- package/src/components/descope-hybrid-field/HybridFieldClass.js +1 -1
- package/src/components/descope-loader-linear/LoaderLinearClass.js +1 -1
- package/src/components/descope-loader-radial/LoaderRadialClass.js +1 -1
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +3 -9
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +3 -6
- package/src/components/descope-notification/NotificationClass.js +0 -2
- package/src/components/descope-passcode/PasscodeClass.js +1 -1
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +1 -3
- package/src/components/descope-passcode/descope-passcode-internal/helpers.js +1 -3
- package/src/components/descope-policy-validation/PolicyValidationClass.js +1 -2
- package/src/components/descope-radio-group/RadioGroupClass.js +3 -8
- package/src/components/descope-recaptcha/RecaptchaClass.js +1 -1
- package/src/components/descope-scopes-list/ScopesListClass.js +0 -3
- package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +5 -8
- package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +3 -4
- package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +1 -1
- package/src/components/descope-upload-file/UploadFileClass.js +2 -2
- package/src/components/descope-upload-file/helpers.js +3 -6
- package/src/components/descope-user-attribute/UserAttributeClass.js +4 -4
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +5 -5
- package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/MappingsFieldInternal.js +0 -1
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +1 -1
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -1
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +1 -1
- package/src/components/phone-fields/helpers.js +2 -3
- package/src/helpers/componentHelpers.js +0 -1
- package/src/helpers/themeHelpers/colorsHelpers.js +2 -3
- package/src/helpers/themeHelpers/index.js +4 -6
- package/src/helpers/themeHelpers/resetHelpers.js +1 -3
- package/src/index.umd.js +0 -1
- package/src/mixins/createDynamicDataMixin.js +0 -1
- package/src/mixins/createStyleMixin/helpers.js +1 -1
- package/src/mixins/createStyleMixin/index.js +1 -2
- package/src/mixins/externalInputHelpers.js +0 -2
- package/src/mixins/externalInputMixin.js +1 -1
- package/src/mixins/inputValidationMixin.js +0 -4
- package/src/mixins/normalizeBooleanAttributesMixin.js +1 -3
- package/src/mixins/portalMixin.js +0 -1
- package/src/mixins/proxyInputMixin.js +0 -1
- package/src/theme/components/alert.js +1 -1
- package/src/theme/components/index.js +22 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-radio-group-index-js.js","mappings":"yPASO,MAAMA,GAAgB,QAAiB,gBAoCjCC,GAAmB,SAC9B,QAAiB,CACfC,SAAU,CACRC,OAAQ,CAAC,CAAC,EAAG,CAAEC,SAAU,UACzBC,SAAU,CAAC,CAAED,SAAU,SAAW,CA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SAAU,OACxCyI,wBAAyB,CACvB,IAAK9F,EAAO3C,SAAU,QACtB,IAAK2C,EAAO3C,SAAU,UAExB0I,gBAAiB,IAAK/F,EAAO3C,SAAU,aACvC2I,gBAAiB,IAAKhG,EAAO3C,SAAU,cACvC4I,kBAAmB,IAAKjG,EAAO3C,SAAU,uBACzC6I,mBAAoB,CAClB,CAAEhJ,SAAU,4BAA6BG,SAAU,WACnD,IAAKsG,EAAqBtG,SAAU,YAEtC8I,uBAAwB,CACtB,IAAKlD,EAAY5F,SAAU,eAC3B,IAAKoG,EAAepG,SAAU,gBAEhC+I,iBAAkB,CAChB,IAAKlD,EAAO7F,SAAU,UACtB,IAAKoG,EAAepG,SAAU,WAEhCgJ,uBAAwB,CACtB,IAAKnD,EAAO7F,SAAU,iBACtB,IAAKoG,EAAepG,SAAU,kBAGhCiJ,gBAAiB,CACf,IAAK9C,EAAWnG,SAAU,gBAC1B,IAAKmG,EAAWnG,SAAU,gBAE5BkJ,cAAe,IAAK/C,EAAWnG,SAAU,aACzCmJ,eAAgB,IAAKhD,EAAWnG,SAAU,SAC1CoJ,kBAAmB,CACjB,IAAKvD,EAAO7F,SAAU,yBACtB,IAAK6F,EAAO7F,SAAU,iBACtB,IAAKoG,EAAepG,SAAU,yBAC9B,IAAKoG,EAAepG,SAAU,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-radio-group/RadioButtonClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/RadioGroupClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js"],"sourcesContent":["import { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n proxyInputMixin,\n} from '../../mixins';\n\nexport const componentName = getComponentName('radio-button');\n\nconst customMixin = (superclass) =>\n class CustomMixin extends superclass {\n constructor() {\n super();\n\n this.baseElement.checkValidity = () => {};\n }\n\n init() {\n // we are forwarding vaadin checked-changed event\n this.baseElement.addEventListener('checked-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent(\n 'checked-changed',\n { detail: e.detail },\n { bubbles: true, composed: true }\n )\n );\n });\n\n super.init?.();\n\n observeChildren(this, this.renderLabel.bind(this));\n }\n\n renderLabel() {\n this.baseElement.setAttribute('label', this.textContent);\n }\n\n get value() {\n return this.getAttribute('value');\n }\n };\n\nexport const RadioButtonClass = compose(\n createStyleMixin({\n mappings: {\n cursor: [{}, { selector: 'label' }],\n fontSize: [{ selector: 'label' }, {}],\n labelTextColor: { selector: 'label', property: 'color' },\n fontFamily: { selector: 'label' },\n radioSize: [\n { selector: '::part(radio)', property: 'height' },\n { selector: '::part(radio)', property: 'width' },\n ],\n radioBackgroundColor: { selector: '::part(radio)', property: 'background-color' },\n radioMargin: { selector: '::part(radio)', property: 'margin' },\n radioCheckedSize: { selector: '::part(radio)::after', property: 'border-width' },\n radioCheckedColor: { selector: '::part(radio)::after', property: 'border-color' },\n radioBorderColor: { selector: '::part(radio)', property: 'border-color', fallback: 'none' },\n radioBorderWidth: { selector: '::part(radio)', property: 'border-width', fallback: 0 },\n radioBorderStyle: { selector: '::part(radio)', property: 'border-style', fallback: 'solid' },\n },\n }),\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: [''],\n wrappedEleName: 'vaadin-radio-button',\n excludeAttrsSync: ['tabindex', 'data', 'style'],\n includeForwardProps: ['checked', 'name', 'disabled'],\n componentName,\n })\n);\n","import { compose } from '../../helpers';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '../../helpers/componentHelpers';\nimport { resetInputLabelPosition } from '../../helpers/themeHelpers/resetHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n proxyInputMixin,\n} from '../../mixins';\nimport textFieldMappings from '../descope-text-field/textFieldMappings';\nimport { componentName as childNodeName, RadioButtonClass } from './RadioButtonClass';\n\nexport const componentName = getComponentName('radio-group');\n\nconst RadioGroupMixin = (superclass) =>\n class RadioGroupMixinClass extends superclass {\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ value, label }) =>\n `<descope-radio-button value=\"${value}\">${label}</descope-radio-button>`;\n\n #data;\n\n constructor() {\n super();\n\n // we are overriding vaadin children getter so it will run on our custom elements\n Object.defineProperty(this.baseElement, 'children', {\n get: () => this.querySelectorAll(childNodeName),\n });\n\n // we are overriding vaadin __filterRadioButtons so it will run on our custom elements\n this.baseElement.__filterRadioButtons = (nodes) => {\n return nodes.filter((node) => node.localName === childNodeName);\n };\n\n // vaadin radio group missing some input properties\n this.baseElement.setCustomValidity = () => {};\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n get size() {\n return this.getAttribute('size');\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 defaultValue() {\n return this.getAttribute('default-value');\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 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 init() {\n super.init?.();\n\n this.inputElement = this.baseElement;\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n Object.defineProperty(this.baseElement, 'validity', {\n get: () => {\n return { valueMissing: !this.baseElement.checkValidity() };\n },\n });\n\n forwardAttrs(this, this.baseElement, {\n includeAttrs: ['layout'],\n mapAttrs: { layout: 'theme' },\n });\n\n setTimeout(() => {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n });\n\n // we want new items to get the size\n observeChildren(this, ({ addedNodes }) => {\n addedNodes.forEach((node) => {\n node.setAttribute('size', this.size);\n });\n });\n\n observeAttributes(\n this,\n () => {\n this.items.forEach((item) => {\n item.setAttribute('size', this.size);\n });\n },\n {\n includeAttrs: ['size'],\n }\n );\n }\n };\n\nexport const RadioGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...textFieldMappings,\n buttonsSpacing: { selector: '::part(group-field)', property: 'justify-content' },\n buttonsRowGap: { selector: '::part(group-field)', property: 'row-gap' },\n buttonsColumnGap: { selector: '::part(group-field)', property: 'column-gap' },\n itemsLabelColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.labelTextColor,\n },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n RadioGroupMixin\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-radio-group',\n style: () => `\n :host {\n display: inline-block;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n vaadin-radio-group {\n padding: 0;\n width: 100%;\n }\n\n ${resetInputLabelPosition('vaadin-radio-group')}\n `,\n\n excludeAttrsSync: ['tabindex', 'size', 'data', 'direction', 'style'],\n componentName,\n includeForwardProps: ['value'],\n })\n);\n","import { componentName as groupComponentName, RadioGroupClass } from './RadioGroupClass';\nimport { componentName as buttonComponentName, RadioButtonClass } from './RadioButtonClass';\nimport '@vaadin/radio-group';\n\ncustomElements.define(groupComponentName, RadioGroupClass);\ncustomElements.define(buttonComponentName, RadioButtonClass);\n\nexport { RadioGroupClass, groupComponentName as componentName };\n","const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\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\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\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\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\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: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n"],"names":["componentName","RadioButtonClass","mappings","cursor","selector","fontSize","labelTextColor","property","fontFamily","radioSize","radioBackgroundColor","radioMargin","radioCheckedSize","radioCheckedColor","radioBorderColor","fallback","radioBorderWidth","radioBorderStyle","proxyProps","superclass","constructor","super","this","baseElement","checkValidity","init","addEventListener","e","dispatchEvent","CustomEvent","detail","bubbles","composed","renderLabel","bind","setAttribute","textContent","value","getAttribute","slots","wrappedEleName","excludeAttrsSync","includeForwardProps","RadioGroupClass","textFieldMappings","buttonsSpacing","buttonsRowGap","buttonsColumnGap","itemsLabelColor","cssVarList","label","Object","defineProperty","get","querySelectorAll","__filterRadioButtons","nodes","filter","node","localName","setCustomValidity","items","shadowRoot","querySelector","assignedElements","size","data","dataAttr","JSON","parse","isValidDataType","console","error","message","renderItems","defaultValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","inputElement","includeAttrs","valueMissing","mapAttrs","layout","setTimeout","addedNodes","forEach","style","customElements","define","host","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","labelFontSize","labelFontWeight","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-radio-group-index-js.js","mappings":"yPASO,MAAMA,GAAgB,QAAiB,gBAoCjCC,GAAmB,SAC9B,QAAiB,CACfC,SAAU,CACRC,OAAQ,CAAC,CAAC,EAAG,CAAEC,SAAU,UACzBC,SAAU,CAAC,CAAED,SAAU,SAAW,CAAC,GACnCE,eAAgB,CAAEF,SAAU,QAASG,SAAU,SAC/CC,WAAY,CAAEJ,SAAU,SACxBK,UAAW,CACT,CAAEL,SAAU,gBAAiBG,SAAU,UACvC,CAAEH,SAAU,gBAAiBG,SAAU,UAEzCG,qBAAsB,CAAEN,SAAU,gBAAiBG,SAAU,oBAC7DI,YAAa,CAAEP,SAAU,gBAAiBG,SAAU,UACpDK,iBAAkB,CAAER,SAAU,uBAAwBG,SAAU,gBAChEM,kBAAmB,CAAET,SAAU,uBAAwBG,SAAU,gBACjEO,iBAAkB,CAAEV,SAAU,gBAAiBG,SAAU,eAAgBQ,SAAU,QACnFC,iBAAkB,CAAEZ,SAAU,gBAAiBG,SAAU,eAAgBQ,SAAU,GACnFE,iBAAkB,CAAEb,SAAU,gBAAiBG,SAAU,eAAgBQ,SAAU,aAGvF,QAAgB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BAAiB,CACf,IAAK9C,EAAWnG,SAAU,gBAC1B,IAAKmG,EAAWnG,SAAU,gBAE5BkJ,cAAe,IAAK/C,EAAWnG,SAAU,aACzCmJ,eAAgB,IAAKhD,EAAWnG,SAAU,SAC1CoJ,kBAAmB,CACjB,IAAKvD,EAAO7F,SAAU,yBACtB,IAAK6F,EAAO7F,SAAU,iBACtB,IAAKoG,EAAepG,SAAU,yBAC9B,IAAKoG,EAAepG,SAAU,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-radio-group/RadioButtonClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/RadioGroupClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js"],"sourcesContent":["import { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n proxyInputMixin,\n} from '../../mixins';\n\nexport const componentName = getComponentName('radio-button');\n\nconst customMixin = (superclass) =>\n class CustomMixin extends superclass {\n constructor() {\n super();\n\n this.baseElement.checkValidity = () => {};\n }\n\n init() {\n // we are forwarding vaadin checked-changed event\n this.baseElement.addEventListener('checked-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent(\n 'checked-changed',\n { detail: e.detail },\n { bubbles: true, composed: true }\n )\n );\n });\n\n super.init?.();\n\n observeChildren(this, this.renderLabel.bind(this));\n }\n\n renderLabel() {\n this.baseElement.setAttribute('label', this.textContent);\n }\n\n get value() {\n return this.getAttribute('value');\n }\n };\n\nexport const RadioButtonClass = compose(\n createStyleMixin({\n mappings: {\n cursor: [{}, { selector: 'label' }],\n fontSize: [{ selector: 'label' }, {}],\n labelTextColor: { selector: 'label', property: 'color' },\n fontFamily: { selector: 'label' },\n radioSize: [\n { selector: '::part(radio)', property: 'height' },\n { selector: '::part(radio)', property: 'width' },\n ],\n radioBackgroundColor: { selector: '::part(radio)', property: 'background-color' },\n radioMargin: { selector: '::part(radio)', property: 'margin' },\n radioCheckedSize: { selector: '::part(radio)::after', property: 'border-width' },\n radioCheckedColor: { selector: '::part(radio)::after', property: 'border-color' },\n radioBorderColor: { selector: '::part(radio)', property: 'border-color', fallback: 'none' },\n radioBorderWidth: { selector: '::part(radio)', property: 'border-width', fallback: 0 },\n radioBorderStyle: { selector: '::part(radio)', property: 'border-style', fallback: 'solid' },\n },\n }),\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: [''],\n wrappedEleName: 'vaadin-radio-button',\n excludeAttrsSync: ['tabindex', 'data', 'style'],\n includeForwardProps: ['checked', 'name', 'disabled'],\n componentName,\n })\n);\n","import { compose } from '../../helpers';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '../../helpers/componentHelpers';\nimport { resetInputLabelPosition } from '../../helpers/themeHelpers/resetHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n proxyInputMixin,\n} from '../../mixins';\nimport textFieldMappings from '../descope-text-field/textFieldMappings';\nimport { componentName as childNodeName, RadioButtonClass } from './RadioButtonClass';\n\nexport const componentName = getComponentName('radio-group');\n\nconst RadioGroupMixin = (superclass) =>\n class RadioGroupMixinClass extends superclass {\n #renderItem = ({ value, label }) =>\n `<descope-radio-button value=\"${value}\">${label}</descope-radio-button>`;\n\n #data;\n\n constructor() {\n super();\n\n // we are overriding vaadin children getter so it will run on our custom elements\n Object.defineProperty(this.baseElement, 'children', {\n get: () => this.querySelectorAll(childNodeName),\n });\n\n // we are overriding vaadin __filterRadioButtons so it will run on our custom elements\n this.baseElement.__filterRadioButtons = (nodes) =>\n nodes.filter((node) => node.localName === childNodeName);\n\n // vaadin radio group missing some input properties\n this.baseElement.setCustomValidity = () => {};\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n get size() {\n return this.getAttribute('size');\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 defaultValue() {\n return this.getAttribute('default-value');\n }\n\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data 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 init() {\n super.init?.();\n\n this.inputElement = this.baseElement;\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n Object.defineProperty(this.baseElement, 'validity', {\n get: () => ({ valueMissing: !this.baseElement.checkValidity() }),\n });\n\n forwardAttrs(this, this.baseElement, {\n includeAttrs: ['layout'],\n mapAttrs: { layout: 'theme' },\n });\n\n setTimeout(() => {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n });\n\n // we want new items to get the size\n observeChildren(this, ({ addedNodes }) => {\n addedNodes.forEach((node) => {\n node.setAttribute('size', this.size);\n });\n });\n\n observeAttributes(\n this,\n () => {\n this.items.forEach((item) => {\n item.setAttribute('size', this.size);\n });\n },\n {\n includeAttrs: ['size'],\n }\n );\n }\n };\n\nexport const RadioGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...textFieldMappings,\n buttonsSpacing: { selector: '::part(group-field)', property: 'justify-content' },\n buttonsRowGap: { selector: '::part(group-field)', property: 'row-gap' },\n buttonsColumnGap: { selector: '::part(group-field)', property: 'column-gap' },\n itemsLabelColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.labelTextColor,\n },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n RadioGroupMixin\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-radio-group',\n style: () => `\n :host {\n display: inline-block;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n vaadin-radio-group {\n padding: 0;\n width: 100%;\n }\n\n ${resetInputLabelPosition('vaadin-radio-group')}\n `,\n\n excludeAttrsSync: ['tabindex', 'size', 'data', 'direction', 'style'],\n componentName,\n includeForwardProps: ['value'],\n })\n);\n","import { componentName as groupComponentName, RadioGroupClass } from './RadioGroupClass';\nimport { componentName as buttonComponentName, RadioButtonClass } from './RadioButtonClass';\nimport '@vaadin/radio-group';\n\ncustomElements.define(groupComponentName, RadioGroupClass);\ncustomElements.define(buttonComponentName, RadioButtonClass);\n\nexport { RadioGroupClass, groupComponentName as componentName };\n","const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\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\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\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\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\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: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n"],"names":["componentName","RadioButtonClass","mappings","cursor","selector","fontSize","labelTextColor","property","fontFamily","radioSize","radioBackgroundColor","radioMargin","radioCheckedSize","radioCheckedColor","radioBorderColor","fallback","radioBorderWidth","radioBorderStyle","proxyProps","superclass","constructor","super","this","baseElement","checkValidity","init","addEventListener","e","dispatchEvent","CustomEvent","detail","bubbles","composed","renderLabel","bind","setAttribute","textContent","value","getAttribute","slots","wrappedEleName","excludeAttrsSync","includeForwardProps","RadioGroupClass","textFieldMappings","buttonsSpacing","buttonsRowGap","buttonsColumnGap","itemsLabelColor","cssVarList","label","Object","defineProperty","get","querySelectorAll","__filterRadioButtons","nodes","filter","node","localName","setCustomValidity","items","shadowRoot","querySelector","assignedElements","size","data","dataAttr","JSON","parse","isValidDataType","console","error","message","renderItems","defaultValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","inputElement","includeAttrs","valueMissing","mapAttrs","layout","setTimeout","addedNodes","forEach","style","customElements","define","host","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","labelFontSize","labelFontWeight","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3847],{85386(e,t,a){a.r(t),a.d(t,{RecaptchaClass:()=>d,componentName:()=>r});var n=a(
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3847],{85386(e,t,a){a.r(t),a.d(t,{RecaptchaClass:()=>d,componentName:()=>r});var n=a(25964),s=a(79365),c=a(81365),i=a(9696),h=a(97810);const r=(0,h.xE)("recaptcha"),o=["enabled","site-key","action","enterprise"],p=(0,c.q)({componentName:r,baseSelector:":host > div"}),d=(0,i.Zz)(s.VO)(class extends p{static get observedAttributes(){return o.concat(p.observedAttributes||[])}attributeChangedCallback(e,t,a){super.attributeChangedCallback?.(e,t,a),t!==a&&"enabled"===e&&this.#e("true"===a)}renderRecaptcha(e){this.children.length?this.updatePreview():this.toggleRecaptchaEles(e)}toggleRecaptchaEles(e){e?(this.recaptchaEle.style.display="",this.mockRecaptchaEle.style.display="none"):(this.recaptchaEle.style.display="none",this.mockRecaptchaEle.style.display="")}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="badge">\n <span id="recaptcha"></span>\n <img src="https://imgs.descope.com/connectors/templates/recaptcha/recaptcha-big.png" alt="recaptcha"/>\n </div>\n <slot></slot>\n\t',(0,n.fz)('\n :host {\n display: inline-flex;\n }\n :host > div:not(.hidden) {\n display: flex;\n }\n :host #recaptcha .grecaptcha-badge {\n box-shadow: none !important;\n }\n :host #recaptcha .grecaptcha-logo {\n height: 100%;\n }\n :host #recaptcha {\n\t\t\t\twidth: 100%;\n height: 100%;\n\t\t\t}\n :host img {\n width: 256px;\n }\n :host([full-width="true"]) {\n width: 100%;\n }\n .hidden {\n display: none;\n }\n ',this),this.recaptchaEle=this.baseElement.querySelector("#recaptcha"),this.mockRecaptchaEle=this.baseElement.querySelector("img"),this.badge=this.shadowRoot.querySelector(".badge")}init(){super.init?.(),(0,h.Ge)(this,this.updatePreview.bind(this))}updatePreview(){this.children.length?(this.recaptchaEle.style.display="none",this.mockRecaptchaEle.style.display="none",this.badge.classList.add("hidden")):(this.toggleRecaptchaEles(this.enabled),this.badge.classList.remove("hidden"))}get enterprise(){return"true"===this.getAttribute("enterprise")}get siteKey(){return this.getAttribute("site-key")}get action(){return this.getAttribute("action")||"load"}get enabled(){return"true"===this.getAttribute("enabled")}get scriptURL(){const e=new URL("https://www.google.com/recaptcha/");return e.pathname+=(this.enterprise?"enterprise":"api")+".js",e.searchParams.append("onload","onRecaptchaLoadCallback"),e.searchParams.append("render","explicit"),e.toString()}#e(e){this.renderRecaptcha(e),e&&(this.#t(),document.getElementById("recaptcha-script")?window.onRecaptchaLoadCallback():this.#a())}#a(){const e=document.createElement("script");e.src=this.scriptURL,e.async=!0,e.id="recaptcha-script",e.defer=!0,document.body.appendChild(e)}get grecaptchaInstance(){return this.enterprise?window.grecaptcha?.enterprise:window.grecaptcha}#n(e,t,a){this.isConnected&&e.ready(()=>{const n=t.querySelector('textarea[name^="g-recaptcha-response"]')?.cloneNode();if(n&&(n.style.display="none",document.body.appendChild(n)),!this.siteKey)return;const s=e?.execute(a,{action:this.action});s.then((s,c)=>{c?console.warn("could not execute recaptcha",c):(this.updateComponentsContext({risktoken:s,riskaction:this.action}),this.isConnected&&setTimeout(()=>{this.#n(e,t,a)},11e4)),n.remove()})})}#t(){window.onRecaptchaLoadCallback=()=>{const e=this.recaptchaEle;if(e.hasChildNodes())return;const{grecaptchaInstance:t}=this;t&&setTimeout(()=>{const a=t.render(e,{sitekey:this.siteKey,badge:"inline",size:"invisible"});this.#n(t,e,a)},0)}}});customElements.define(r,d)}}]);
|
|
2
2
|
//# sourceMappingURL=descope-recaptcha-index-js.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-recaptcha-index-js.js","mappings":"yPAMO,MAAMA,GAAgB,QAAiB,aAExCC,EAAqB,CAAC,UAAW,WAAY,SAAU,cAEvDC,GAAY,EAAAC,EAAA,GAAgB,CAChCH,gBACAI,aAAc,gBA8NHC,GAAiB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T,MAAMd,EAAoBH,EAAmBmB,OAAOjB,EAAa,CAC/DkB,QAASnE,KAAK0B,QACdT,MAAO,SACPmD,KAAM,cAERpE,MAAK,EAAa+C,EAAoBE,EAAaC,IAClD,GAEP,ICrOFmB,eAAeC,OAAOlF,EAAeK,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-recaptcha/RecaptchaClass.js","webpack://@descope/web-components-ui/./src/components/descope-recaptcha/index.js"],"sourcesContent":["import { draggableMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('recaptcha');\n\nconst observedAttributes = ['enabled', 'site-key', 'action', 'enterprise'];\n\nconst BaseClass = createBaseClass({\n componentName,\n baseSelector: ':host > div',\n});\nclass RawRecaptcha extends BaseClass {\n static get observedAttributes() {\n return observedAttributes.concat(BaseClass.observedAttributes || []);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n if (attrName === 'enabled') {\n this.#toggleRecaptcha(newValue === 'true');\n }\n }\n }\n\n renderRecaptcha(enabled) {\n if (this.children.length) {\n this.updatePreview();\n return;\n }\n\n this.toggleRecaptchaEles(enabled);\n }\n\n toggleRecaptchaEles(enabled) {\n if (enabled) {\n this.recaptchaEle.style.display = '';\n this.mockRecaptchaEle.style.display = 'none';\n } else {\n this.recaptchaEle.style.display = 'none';\n this.mockRecaptchaEle.style.display = '';\n }\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"badge\">\n <span id=\"recaptcha\"></span>\n <img src=\"https://imgs.descope.com/connectors/templates/recaptcha/recaptcha-big.png\" alt=\"recaptcha\"/>\n </div>\n <slot></slot>\n\t`;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n :host > div:not(.hidden) {\n display: flex;\n }\n :host #recaptcha .grecaptcha-badge {\n box-shadow: none !important;\n }\n :host #recaptcha .grecaptcha-logo {\n height: 100%;\n }\n :host #recaptcha {\n\t\t\t\twidth: 100%;\n height: 100%;\n\t\t\t}\n :host img {\n width: 256px;\n }\n :host([full-width=\"true\"]) {\n width: 100%;\n }\n .hidden {\n display: none;\n }\n `,\n this\n );\n\n this.recaptchaEle = this.baseElement.querySelector('#recaptcha');\n this.mockRecaptchaEle = this.baseElement.querySelector('img');\n this.badge = this.shadowRoot.querySelector('.badge');\n }\n\n init() {\n super.init?.();\n\n observeChildren(this, this.updatePreview.bind(this));\n }\n\n updatePreview() {\n if (this.children.length) {\n this.recaptchaEle.style.display = 'none';\n this.mockRecaptchaEle.style.display = 'none';\n this.badge.classList.add('hidden');\n } else {\n this.toggleRecaptchaEles(this.enabled);\n this.badge.classList.remove('hidden');\n }\n }\n\n get enterprise() {\n return this.getAttribute('enterprise') === 'true';\n }\n\n get siteKey() {\n return this.getAttribute('site-key');\n }\n\n get action() {\n return this.getAttribute('action') || 'load';\n }\n\n get enabled() {\n return this.getAttribute('enabled') === 'true';\n }\n\n get scriptURL() {\n const url = new URL('https://www.google.com/recaptcha/');\n url.pathname += `${this.enterprise ? 'enterprise' : 'api'}.js`;\n url.searchParams.append('onload', 'onRecaptchaLoadCallback');\n url.searchParams.append('render', 'explicit');\n return url.toString();\n }\n\n #toggleRecaptcha(enabled) {\n this.renderRecaptcha(enabled);\n if (enabled) {\n this.#createOnLoadScript();\n if (!document.getElementById('recaptcha-script')) {\n this.#loadRecaptchaScript();\n } else {\n window.onRecaptchaLoadCallback();\n }\n }\n }\n\n #loadRecaptchaScript() {\n const script = document.createElement('script');\n script.src = this.scriptURL;\n script.async = true;\n script.id = 'recaptcha-script';\n script.defer = true;\n document.body.appendChild(script);\n }\n\n get grecaptchaInstance() {\n return this.enterprise ? window.grecaptcha?.enterprise : window.grecaptcha;\n }\n\n #getNewToken(grecaptchaInstance, currentNode, recaptchaWidgetId) {\n if (!this.isConnected) {\n return;\n }\n\n grecaptchaInstance.ready(() => {\n // clone the node and append it to the body so that it can be used by the grepcaptcha script\n const cloneNode = currentNode\n .querySelector('textarea[name^=\"g-recaptcha-response\"]')\n ?.cloneNode();\n if (cloneNode) {\n cloneNode.style.display = 'none';\n document.body.appendChild(cloneNode);\n }\n\n // cleaning up the recaptcha element we added to the body\n const removeCloneNode = () => {\n cloneNode.remove();\n };\n\n if (!this.siteKey) {\n return;\n }\n // we should pass recaptchaWidgetId, but this does not allow us to run execute multiple times\n // also calling grecaptchaInstance.reset() does not work\n const exec = grecaptchaInstance?.execute(recaptchaWidgetId, { action: this.action });\n exec.then((token, e) => {\n if (e) {\n // eslint-disable-next-line no-console\n console.warn('could not execute recaptcha', e);\n } else {\n this.updateComponentsContext({\n risktoken: token,\n riskaction: this.action,\n });\n // if the component is still connected, we should try to get a new token before the token expires (2 minutes)\n if (this.isConnected) {\n setTimeout(() => {\n this.#getNewToken(grecaptchaInstance, currentNode, recaptchaWidgetId);\n }, 110000);\n }\n }\n removeCloneNode();\n });\n });\n }\n\n #createOnLoadScript() {\n window.onRecaptchaLoadCallback = () => {\n const currentNode = this.recaptchaEle;\n\n // if there are child nodes, it means that the recaptcha was already rendered\n if (currentNode.hasChildNodes()) {\n return;\n }\n\n const { grecaptchaInstance } = this;\n\n if (!grecaptchaInstance) {\n return;\n }\n\n setTimeout(() => {\n const recaptchaWidgetId = grecaptchaInstance.render(currentNode, {\n sitekey: this.siteKey,\n badge: 'inline',\n size: 'invisible',\n });\n this.#getNewToken(grecaptchaInstance, currentNode, recaptchaWidgetId);\n }, 0);\n };\n }\n}\n\nexport const RecaptchaClass = compose(draggableMixin)(RawRecaptcha);\n","import { componentName, RecaptchaClass } from './RecaptchaClass';\n\ncustomElements.define(componentName, RecaptchaClass);\n\nexport { RecaptchaClass, componentName };\n"],"names":["componentName","observedAttributes","BaseClass","createBaseClass","baseSelector","RecaptchaClass","concat","attributeChangedCallback","attrName","oldValue","newValue","super","this","renderRecaptcha","enabled","children","length","updatePreview","toggleRecaptchaEles","recaptchaEle","style","display","mockRecaptchaEle","constructor","attachShadow","mode","innerHTML","baseElement","querySelector","badge","shadowRoot","init","bind","classList","add","remove","enterprise","getAttribute","siteKey","action","scriptURL","url","URL","pathname","searchParams","append","toString","document","getElementById","window","onRecaptchaLoadCallback","script","createElement","src","async","id","defer","body","appendChild","grecaptchaInstance","grecaptcha","currentNode","recaptchaWidgetId","isConnected","ready","cloneNode","exec","execute","then","token","e","console","warn","updateComponentsContext","risktoken","riskaction","setTimeout","hasChildNodes","render","sitekey","size","customElements","define"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-recaptcha-index-js.js","mappings":"yPAMO,MAAMA,GAAgB,QAAiB,aAExCC,EAAqB,CAAC,UAAW,WAAY,SAAU,cAEvDC,GAAY,EAAAC,EAAA,GAAgB,CAChCH,gBACAI,aAAc,gBA8NHC,GAAiB,QAAQ,KAAR,CA5N9B,cAA2BH,EACzB,6BAAWD,GACT,OAAOA,EAAmBK,OAAOJ,EAAUD,oBAAsB,GACnE,CAEA,wBAAAM,CAAyBC,EAAUC,EAAUC,GAC3CC,MAAMJ,2BAA2BC,EAAUC,EAAUC,GACjDD,IAAaC,GACE,YAAbF,GACFI,MAAK,EAA8B,SAAbF,EAG5B,CAEA,eAAAG,CAAgBC,GACVF,KAAKG,SAASC,OAChBJ,KAAKK,gBAIPL,KAAKM,oBAAoBJ,EAC3B,CAEA,mBAAAI,CAAoBJ,GACdA,GACFF,KAAKO,aAAaC,MAAMC,QAAU,GAClCT,KAAKU,iBAAiBF,MAAMC,QAAU,SAEtCT,KAAKO,aAAaC,MAAMC,QAAU,OAClCT,KAAKU,iBAAiBF,MAAMC,QAAU,GAE1C,CAEA,WAAAE,GACEZ,QAEAC,KAAKY,aAAa,CAAEC,KAAM,SAAUC,UAAY,kNAQhD,QACE,qiBA2BAd,MAGFA,KAAKO,aAAeP,KAAKe,YAAYC,cAAc,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AM,KAEvB,MAAMC,EAAYJ,EACfjC,cAAc,2CACbqC,YAWJ,GAVIA,IACFA,EAAU7C,MAAMC,QAAU,OAC1B0B,SAASU,KAAKC,YAAYO,KAQvBrD,KAAK0B,QACR,OAIF,MAAM4B,EAAOP,GAAoBQ,QAAQL,EAAmB,CAAEvB,OAAQ3B,KAAK2B,SAC3E2B,EAAKE,KAAK,CAACC,EAAOC,KACZA,EAEFC,QAAQC,KAAK,8BAA+BF,IAE5C1D,KAAK6D,wBAAwB,CAC3BC,UAAWL,EACXM,WAAY/D,KAAK2B,SAGf3B,KAAKmD,aACPa,WAAW,KACThE,MAAK,EAAa+C,EAAoBE,EAAaC,IAClD,OAtBPG,EAAU9B,YA4BhB,CAEA,KACEc,OAAOC,wBAA0B,KAC/B,MAAMW,EAAcjD,KAAKO,aAGzB,GAAI0C,EAAYgB,gBACd,OAGF,MAAM,mBAAElB,GAAuB/C,KAE1B+C,GAILiB,WAAW,KACT,MAAMd,EAAoBH,EAAmBmB,OAAOjB,EAAa,CAC/DkB,QAASnE,KAAK0B,QACdT,MAAO,SACPmD,KAAM,cAERpE,MAAK,EAAa+C,EAAoBE,EAAaC,IAClD,GAEP,ICrOFmB,eAAeC,OAAOlF,EAAeK,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-recaptcha/RecaptchaClass.js","webpack://@descope/web-components-ui/./src/components/descope-recaptcha/index.js"],"sourcesContent":["import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { draggableMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('recaptcha');\n\nconst observedAttributes = ['enabled', 'site-key', 'action', 'enterprise'];\n\nconst BaseClass = createBaseClass({\n componentName,\n baseSelector: ':host > div',\n});\nclass RawRecaptcha extends BaseClass {\n static get observedAttributes() {\n return observedAttributes.concat(BaseClass.observedAttributes || []);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n if (attrName === 'enabled') {\n this.#toggleRecaptcha(newValue === 'true');\n }\n }\n }\n\n renderRecaptcha(enabled) {\n if (this.children.length) {\n this.updatePreview();\n return;\n }\n\n this.toggleRecaptchaEles(enabled);\n }\n\n toggleRecaptchaEles(enabled) {\n if (enabled) {\n this.recaptchaEle.style.display = '';\n this.mockRecaptchaEle.style.display = 'none';\n } else {\n this.recaptchaEle.style.display = 'none';\n this.mockRecaptchaEle.style.display = '';\n }\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"badge\">\n <span id=\"recaptcha\"></span>\n <img src=\"https://imgs.descope.com/connectors/templates/recaptcha/recaptcha-big.png\" alt=\"recaptcha\"/>\n </div>\n <slot></slot>\n\t`;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n :host > div:not(.hidden) {\n display: flex;\n }\n :host #recaptcha .grecaptcha-badge {\n box-shadow: none !important;\n }\n :host #recaptcha .grecaptcha-logo {\n height: 100%;\n }\n :host #recaptcha {\n\t\t\t\twidth: 100%;\n height: 100%;\n\t\t\t}\n :host img {\n width: 256px;\n }\n :host([full-width=\"true\"]) {\n width: 100%;\n }\n .hidden {\n display: none;\n }\n `,\n this\n );\n\n this.recaptchaEle = this.baseElement.querySelector('#recaptcha');\n this.mockRecaptchaEle = this.baseElement.querySelector('img');\n this.badge = this.shadowRoot.querySelector('.badge');\n }\n\n init() {\n super.init?.();\n\n observeChildren(this, this.updatePreview.bind(this));\n }\n\n updatePreview() {\n if (this.children.length) {\n this.recaptchaEle.style.display = 'none';\n this.mockRecaptchaEle.style.display = 'none';\n this.badge.classList.add('hidden');\n } else {\n this.toggleRecaptchaEles(this.enabled);\n this.badge.classList.remove('hidden');\n }\n }\n\n get enterprise() {\n return this.getAttribute('enterprise') === 'true';\n }\n\n get siteKey() {\n return this.getAttribute('site-key');\n }\n\n get action() {\n return this.getAttribute('action') || 'load';\n }\n\n get enabled() {\n return this.getAttribute('enabled') === 'true';\n }\n\n get scriptURL() {\n const url = new URL('https://www.google.com/recaptcha/');\n url.pathname += `${this.enterprise ? 'enterprise' : 'api'}.js`;\n url.searchParams.append('onload', 'onRecaptchaLoadCallback');\n url.searchParams.append('render', 'explicit');\n return url.toString();\n }\n\n #toggleRecaptcha(enabled) {\n this.renderRecaptcha(enabled);\n if (enabled) {\n this.#createOnLoadScript();\n if (!document.getElementById('recaptcha-script')) {\n this.#loadRecaptchaScript();\n } else {\n window.onRecaptchaLoadCallback();\n }\n }\n }\n\n #loadRecaptchaScript() {\n const script = document.createElement('script');\n script.src = this.scriptURL;\n script.async = true;\n script.id = 'recaptcha-script';\n script.defer = true;\n document.body.appendChild(script);\n }\n\n get grecaptchaInstance() {\n return this.enterprise ? window.grecaptcha?.enterprise : window.grecaptcha;\n }\n\n #getNewToken(grecaptchaInstance, currentNode, recaptchaWidgetId) {\n if (!this.isConnected) {\n return;\n }\n\n grecaptchaInstance.ready(() => {\n // clone the node and append it to the body so that it can be used by the grepcaptcha script\n const cloneNode = currentNode\n .querySelector('textarea[name^=\"g-recaptcha-response\"]')\n ?.cloneNode();\n if (cloneNode) {\n cloneNode.style.display = 'none';\n document.body.appendChild(cloneNode);\n }\n\n // cleaning up the recaptcha element we added to the body\n const removeCloneNode = () => {\n cloneNode.remove();\n };\n\n if (!this.siteKey) {\n return;\n }\n // we should pass recaptchaWidgetId, but this does not allow us to run execute multiple times\n // also calling grecaptchaInstance.reset() does not work\n const exec = grecaptchaInstance?.execute(recaptchaWidgetId, { action: this.action });\n exec.then((token, e) => {\n if (e) {\n // eslint-disable-next-line no-console\n console.warn('could not execute recaptcha', e);\n } else {\n this.updateComponentsContext({\n risktoken: token,\n riskaction: this.action,\n });\n // if the component is still connected, we should try to get a new token before the token expires (2 minutes)\n if (this.isConnected) {\n setTimeout(() => {\n this.#getNewToken(grecaptchaInstance, currentNode, recaptchaWidgetId);\n }, 110000);\n }\n }\n removeCloneNode();\n });\n });\n }\n\n #createOnLoadScript() {\n window.onRecaptchaLoadCallback = () => {\n const currentNode = this.recaptchaEle;\n\n // if there are child nodes, it means that the recaptcha was already rendered\n if (currentNode.hasChildNodes()) {\n return;\n }\n\n const { grecaptchaInstance } = this;\n\n if (!grecaptchaInstance) {\n return;\n }\n\n setTimeout(() => {\n const recaptchaWidgetId = grecaptchaInstance.render(currentNode, {\n sitekey: this.siteKey,\n badge: 'inline',\n size: 'invisible',\n });\n this.#getNewToken(grecaptchaInstance, currentNode, recaptchaWidgetId);\n }, 0);\n };\n }\n}\n\nexport const RecaptchaClass = compose(draggableMixin)(RawRecaptcha);\n","import { componentName, RecaptchaClass } from './RecaptchaClass';\n\ncustomElements.define(componentName, RecaptchaClass);\n\nexport { RecaptchaClass, componentName };\n"],"names":["componentName","observedAttributes","BaseClass","createBaseClass","baseSelector","RecaptchaClass","concat","attributeChangedCallback","attrName","oldValue","newValue","super","this","renderRecaptcha","enabled","children","length","updatePreview","toggleRecaptchaEles","recaptchaEle","style","display","mockRecaptchaEle","constructor","attachShadow","mode","innerHTML","baseElement","querySelector","badge","shadowRoot","init","bind","classList","add","remove","enterprise","getAttribute","siteKey","action","scriptURL","url","URL","pathname","searchParams","append","toString","document","getElementById","window","onRecaptchaLoadCallback","script","createElement","src","async","id","defer","body","appendChild","grecaptchaInstance","grecaptcha","currentNode","recaptchaWidgetId","isConnected","ready","cloneNode","exec","execute","then","token","e","console","warn","updateComponentsContext","risktoken","riskaction","setTimeout","hasChildNodes","render","sitekey","size","customElements","define"],"sourceRoot":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-scopes-list-index-js.js","mappings":";6NAWO,MAAMA,GAAgB,QAAiB,aA4BjCC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,gBAAiB,CACf,CAAEC,SAAU,eACZ,CAAEA,SAAU,mBAEdC,kBAAmB,CACjB,CAAED,SAAU,gBACZ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AAS4C,EAAGC,KACvD,MAAMC,EAAiC,aAAhBD,EAAIvI,QAAyBoG,EAAA,EAAgB/D,EAAA,EAEpE,MAAO,UACFmG,EAAe9K,oDAET6K,EAAIrD,sBACFmD,sBACExC,uBACCH,GAAY6C,EAAI/H,gCAChBkF,oCAET8C,EAAe9K,oBA2GiBkJ,kBAAmB,CAAC,OAAQ,aACnE,KACA,KAxC6B,CAyC7B5B,G,2BCjIF3F,eAAeC,OAAO5B,EAAeyI,E,+CCK9B,MAAMsC,UAAwB,IACnC,WAAA3J,CAAY6C,EAAM+G,GAChB3J,MAAM4C,EAAM,QAAS,QAAS,CAC5BgH,YAAa,CAAC5C,EAAMpE,KACdA,EAAKgE,QACPI,EAAKJ,MAAQhE,EAAKgE,OAEhBhE,EAAKiH,MACP7C,EAAKjG,aAAa,OAAQ6B,EAAKiH,MAIjC7C,EAAKF,GAAK7G,KAAK6J,UAES,mBAAbH,GACTA,EAAS3C,IAGb+C,aAAa,GAEjB,E","sources":["webpack://@descope/web-components-ui/../components/descope-list-item/src/component/ListItemClass.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/ListClass.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/index.js","webpack://@descope/web-components-ui/./src/mixins/createDynamicDataMixin.js","webpack://@descope/web-components-ui/./src/components/descope-scopes-list/ScopesListClass.js","webpack://@descope/web-components-ui/./src/components/descope-scopes-list/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n activeableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this,\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-left' },\n { property: 'padding-right' },\n ],\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin,\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n","import { componentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(componentName, ListItemClass);\n\nexport { ListItemClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { ListItemClass } from '@descope-ui/descope-list-item/class';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list');\n\nclass RawList extends createBaseClass({\n componentName,\n baseSelector: '.wrapper',\n}) {\n static get observedAttributes() {\n return ['variant', 'readonly'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n <slot name=\"empty-state\">\n No item...\n </slot>\n </div>\n\t`;\n\n injectStyle(\n `\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name=\"empty-state\"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name=\"empty-state\"] {\n display: none;\n }\n :host([empty]) slot[name=\"empty-state\"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n `,\n this,\n );\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n #handleEmptyState() {\n if (this.items.length === 0) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n }\n\n get variant() {\n return this.getAttribute('variant') || 'list';\n }\n\n #handleItemsVariant() {\n this.items.forEach((item) => {\n let listItem = item;\n if (listItem.localName !== ListItemClass.componentName) {\n listItem = item.querySelector(ListItemClass.componentName);\n }\n\n const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';\n listItem?.setAttribute('variant', listItemVariant);\n });\n }\n\n init() {\n super.init?.();\n\n // we want new items to get the size\n observeChildren(this, () => {\n this.#handleEmptyState();\n this.#handleItemsVariant();\n this.#handleReadOnly();\n });\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n #handleReadOnly() {\n this.items.forEach((item) => {\n if (this.isReadOnly) item.setAttribute('inert', '');\n else item.removeAttribute('inert');\n });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (newValue === oldValue) return;\n\n if (name === 'variant') {\n this.#handleItemsVariant();\n } else if (name === 'readonly') {\n this.#handleReadOnly();\n }\n }\n}\n\nexport const ListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n maxHeight: { selector: () => ':host' },\n minHeight: {},\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-left' },\n { property: 'padding-right' },\n ],\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontFamily: {},\n gap: {},\n\n backgroundColor: {},\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n boxShadow: {},\n gridTemplateColumns: {},\n maxItemsWidth: {\n selector: () => '::slotted(:not([slot]))',\n property: 'max-width',\n },\n minItemsWidth: {\n selector: () => '::slotted(:not([slot]))',\n property: 'min-width',\n },\n maxRowItems: {\n property: 'max-row-items',\n },\n itemsHorizontalAlign: {\n selector: () => '::slotted(*)',\n property: 'justify-self',\n },\n emptyStateTextColor: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'color',\n },\n emptyStateTextFontFamily: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'font-family',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawList);\n","import '@descope-ui/descope-list-item';\n\nimport { componentName, ListClass } from './ListClass';\n\ncustomElements.define(componentName, ListClass);\n\nexport { ListClass, componentName };\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('switch-toggle');\n\nconst {\n host,\n component,\n checkboxElement: track,\n checkboxSurface: knob,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: {\n selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::part(content)::after',\n },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const SwitchToggleClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [component, checkboxLabel, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: [\n { ...checkboxLabel, property: 'color' },\n { ...checkboxLabel, property: '-webkit-text-fill-color' },\n ],\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n\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\n trackBorderWidth: { ...track, property: 'border-width' },\n trackBorderStyle: { ...track, property: 'border-style' },\n trackBorderColor: { ...track, property: 'border-color' },\n trackBackgroundColor: { ...track, property: 'background-color' },\n trackBorderRadius: { ...track, property: 'border-radius' },\n trackWidth: [{ ...track, property: 'width' }],\n trackHeight: [\n { ...knob, property: 'font-size' },\n { ...track, property: 'height' },\n ],\n\n knobSize: [\n { ...knob, property: 'width' },\n { ...knob, property: 'height' },\n ],\n knobTextColor: { ...knob, property: 'color' },\n knobRadius: { ...knob, property: 'border-radius' },\n knobTransitionDuration: { ...knob, property: 'transition' },\n knobColor: { ...knob, property: 'background-color' },\n knobTopOffset: { ...knob, property: 'top' },\n knobLeftOffset: { ...knob, property: 'left' },\n\n inputOutlineWidth: { ...track, property: 'outline-width' },\n inputOutlineOffset: { ...track, property: 'outline-offset' },\n inputOutlineColor: { ...track, property: 'outline-color' },\n inputOutlineStyle: { ...track, property: 'outline-style' },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles(SwitchToggleClass.cssVarList)}\n\t\t\t${useHostExternalPadding(SwitchToggleClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot=\"label\"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['label', 'tabindex', 'style'],\n componentName,\n })\n);\n","import { componentName, SwitchToggleClass } from './SwitchToggleClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '@descope-ui/descope-enriched-text';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, SwitchToggleClass);\n\nexport { SwitchToggleClass, componentName };\n","import { observeAttributes } from '../helpers/componentHelpers';\n\nconst defaultValidateSchema = () => true;\nconst defaultItemRenderer = (item) => `<pre>${JSON.stringify(item, null, 4)}</pre>`;\n\nconst createTemplate = (templateString) => {\n const template = document.createElement('template');\n template.innerHTML = templateString;\n\n return template;\n};\n\nconst getTemplateContent = (templateOrString) => {\n if (typeof templateOrString === 'string') {\n return createTemplate(templateOrString).content;\n }\n\n if (templateOrString instanceof HTMLTemplateElement) {\n return templateOrString.content;\n }\n\n // eslint-disable-next-line no-console\n console.error('Invalid template', templateOrString);\n return null;\n};\n\nexport const createDynamicDataMixin =\n ({\n itemRenderer = defaultItemRenderer,\n validateSchema = defaultValidateSchema,\n slotName,\n rerenderAttrsList = [],\n }) =>\n (superclass) =>\n class DynamicDataMixinClass extends superclass {\n #data = [];\n\n // eslint-disable-next-line class-methods-use-this\n #validateSchema(data) {\n if (!validateSchema) return true;\n\n const validation = validateSchema(data);\n if (validation === true) return true;\n\n // eslint-disable-next-line no-console\n console.error('Data schema validation failed', validation || '');\n\n return false;\n }\n\n #removeOldItems() {\n const selector = slotName ? `*[slot=\"${slotName}\"]` : ':not([slot])';\n this.baseElement.querySelectorAll(selector).forEach((item) => item.remove());\n }\n\n #renderItems() {\n this.#removeOldItems();\n this.data.forEach((item, index) => {\n const content = getTemplateContent(itemRenderer(item, index, this));\n this.baseElement.appendChild(content?.cloneNode(true));\n });\n }\n\n set data(value) {\n if (this.#validateSchema(value)) {\n this.#data = value;\n this.#renderItems();\n }\n }\n\n get data() {\n return this.#data;\n }\n\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) => {\n if (attrs.includes('data')) this.#handleDataAttr();\n else this.#renderItems();\n },\n { includeAttrs: [...rerenderAttrsList, 'data'] }\n );\n }\n\n #handleDataAttr() {\n const dataAttr = this.getAttribute('data');\n\n if (!dataAttr) return;\n\n try {\n this.data = JSON.parse(dataAttr);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Invalid JSON data', dataAttr);\n }\n }\n };\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../mixins';\nimport { createDynamicDataMixin } from '../../mixins/createDynamicDataMixin';\nimport { CheckboxClass } from '../boolean-fields/descope-checkbox/CheckboxClass';\nimport { SwitchToggleClass } from '../boolean-fields/descope-switch-toggle/SwitchToggleClass';\n\nexport const componentName = getComponentName('scopes-list');\nconst variants = ['checkbox', 'switch'];\n\nconst itemRenderer = ({ id, desc, required = false }, _, ref) => {\n const ComponentClass = ref.variant === 'checkbox' ? CheckboxClass : SwitchToggleClass;\n\n return `\n <${ComponentClass.componentName}\n bordered=\"true\"\n size=${ref.size}\n label=\"${desc}\"\n data-id=\"${id}\"\n readonly=\"${required || ref.isReadOnly}\"\n required=\"${required}\"\n checked=\"true\"\n ></${ComponentClass.componentName}>\n`;\n};\n\nclass RawScopesList extends createBaseClass({ componentName, baseSelector: 'div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div></div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n\n div {\n display: flex;\n flex-direction: column;\n }\n `,\n this\n );\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n get size() {\n return this.getAttribute('size') || 'sm';\n }\n\n #getChildNodes() {\n return Array.from(this.shadowRoot.querySelector('div').children);\n }\n\n // eslint-disable-next-line class-methods-use-this\n reportValidity() {\n this.checkValidity();\n }\n\n // eslint-disable-next-line class-methods-use-this\n checkValidity() {\n return this.data.every((item) => !item.required || this.value.includes(item.id));\n }\n\n get value() {\n return this.#getChildNodes()\n .filter((node) => node.checked)\n .map((node) => node.getAttribute('data-id'));\n }\n\n set value(val = []) {\n this.#getChildNodes().forEach((node) => {\n // eslint-disable-next-line no-param-reassign\n node.checked = val.includes(node.getAttribute('data-id'));\n });\n }\n\n get variant() {\n const variant = this.getAttribute('variant');\n\n return variants.includes(variant) ? variant : variants[0];\n }\n}\n\nexport const ScopesListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: [\n { selector: () => ':host', property: 'direction' },\n {\n selector: () => CheckboxClass.componentName,\n property: CheckboxClass.cssVarList.hostDirection,\n },\n {\n selector: () => SwitchToggleClass.componentName,\n property: SwitchToggleClass.cssVarList.hostDirection,\n },\n ],\n gap: { selector: () => 'div', property: 'gap' },\n requiredInputBorderColor: [\n {\n selector: `${CheckboxClass.componentName}[required=\"true\"]`,\n property: CheckboxClass.cssVarList.inputBorderColor,\n },\n {\n selector: `${SwitchToggleClass.componentName}[required=\"true\"]`,\n property: SwitchToggleClass.cssVarList.inputBorderColor,\n },\n ],\n requiredInputValueTextColor: [\n {\n selector: `${CheckboxClass.componentName}[required=\"true\"]`,\n property: CheckboxClass.cssVarList.inputValueTextColor,\n },\n {\n selector: `${SwitchToggleClass.componentName}[required=\"true\"]`,\n property: SwitchToggleClass.cssVarList.knobColor,\n },\n ],\n },\n }),\n createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size', 'variant'] }),\n draggableMixin,\n componentNameValidationMixin\n)(RawScopesList);\n","import { componentName, ScopesListClass } from './ScopesListClass';\nimport '@descope-ui/descope-list';\nimport '../boolean-fields/descope-checkbox';\nimport '../boolean-fields/descope-switch-toggle';\n\ncustomElements.define(componentName, ScopesListClass);\n\nexport { ScopesListClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<input>` element.\n */\nexport class InputController extends SlotController {\n constructor(host, callback) {\n super(host, 'input', 'input', {\n initializer: (node, host) => {\n if (host.value) {\n node.value = host.value;\n }\n if (host.type) {\n node.setAttribute('type', host.type);\n }\n\n // Ensure every instance has unique ID\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n"],"names":["componentName","ListItemClass","mappings","verticalPadding","property","horizontalPadding","backgroundColor","borderColor","borderStyle","borderWidth","borderRadius","outline","cursor","gap","maxWidth","selector","alignItems","flexDirection","transition","superclass","constructor","super","this","attachShadow","mode","innerHTML","baseSelector","customElements","define","RawList","observedAttributes","items","shadowRoot","querySelector","assignedElements","length","setAttribute","removeAttribute","variant","getAttribute","forEach","item","listItem","localName","listItemVariant","init","isReadOnly","attributeChangedCallback","name","oldValue","newValue","ListClass","hostWidth","maxHeight","minHeight","hostDirection","fontFamily","boxShadow","gridTemplateColumns","maxItemsWidth","minItemsWidth","maxRowItems","itemsHorizontalAlign","emptyStateTextColor","emptyStateTextFontFamily","host","component","checkboxElement","track","checkboxSurface","knob","checkboxLabel","requiredIndicator","helperText","errorMessage","SwitchToggleClass","fontSize","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","trackBorderWidth","trackBorderStyle","trackBorderColor","trackBackgroundColor","trackBorderRadius","trackWidth","trackHeight","knobSize","knobTextColor","knobRadius","knobTransitionDuration","knobColor","knobTopOffset","knobLeftOffset","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","proxyProps","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","defaultValidateSchema","defaultItemRenderer","JSON","stringify","variants","RawScopesList","createBaseClass","size","Array","from","children","reportValidity","checkValidity","data","every","required","value","includes","id","filter","node","checked","map","val","ScopesListClass","CheckboxClass","requiredInputBorderColor","inputBorderColor","requiredInputValueTextColor","inputValueTextColor","itemRenderer","validateSchema","slotName","rerenderAttrsList","validation","console","error","baseElement","querySelectorAll","remove","index","content","templateOrString","templateString","template","document","createElement","createTemplate","HTMLTemplateElement","appendChild","cloneNode","attrs","includeAttrs","dataAttr","parse","e","warn","createDynamicDataMixin","desc","_","ref","ComponentClass","InputController","callback","initializer","type","defaultId","useUniqueId"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-scopes-list-index-js.js","mappings":";6NAWO,MAAMA,GAAgB,QAAiB,aA4BjCC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,gBAAiB,CACf,CAAEC,SAAU,eACZ,CAAEA,SAAU,mBAEdC,kBAAmB,CACjB,CAAED,SAAU,gBACZ,CAAEA,SAAU,kBAEdE,gBAAiB,CAAC,EAClBC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,aAAc,CAAC,EACfC,QAAS,CAAC,EACVC,OAAQ,CAAC,EACTC,IAAK,CAAC,EACNC,SAAU,CAAEC,SAAU,IAAM,SAC5BC,WAAY,CAAC,EACbC,cAAe,CAAC,EAChBC,WAAY,CAAC,KAGjB,KACA,KApDmBC,GACnB,cAAiCA,EAC/B,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+BAIhD,QACE,uMAWAH,KAEJ,GA+BF,IA5B2B,EA6B3B,QAAgB,CAAEtB,gBAAe0B,aAAc,S,0FClEjDC,eAAeC,OAAO,IAAe,I,kGCY9B,MAAM5B,GAAgB,QAAiB,QAE9C,MAAM6B,WAAgB,QAAgB,CACpC7B,gBACA0B,aAAc,cAEd,6BAAWI,GACT,MAAO,CAAC,UAAW,WACrB,CAEA,WAAAV,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,gIAShD,QACE,8kBA6BAH,KAEJ,CAEA,SAAIS,GACF,OAAOT,KAAKU,WAAWC,cAAc,QAAQC,kBAC/C,CAEA,KAC4B,IAAtBZ,KAAKS,MAAMI,OACbb,KAAKc,aAAa,QAAS,QAE3Bd,KAAKe,gBAAgB,QAEzB,CAEA,WAAIC,GACF,OAAOhB,KAAKiB,aAAa,YAAc,MACzC,CAEA,KACEjB,KAAKS,MAAMS,QAASC,IAClB,IAAIC,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,KAEZ,CAAE+I,aAAc,IAAInB,EAAmB,SAE3C,CAEA,KACE,MAAMoB,EAAWhJ,KAAKiB,aAAa,QAEnC,GAAK+H,EAEL,IACEhJ,KAAKwG,KAAOX,KAAKoD,MAAMD,EACzB,CAAE,MAAOE,GAEPpB,QAAQqB,KAAK,oBAAqBH,EACpC,CACF,GC+BJI,CAAuB,CAAE3B,aApHN,EAAGZ,KAAIwC,OAAM3C,YAAW,GAAS4C,EAAGC,KACvD,MAAMC,EAAiC,aAAhBD,EAAIvI,QAAyBoG,EAAA,EAAgB/D,EAAA,EAEpE,MAAO,UACFmG,EAAe9K,oDAET6K,EAAIrD,sBACFmD,sBACExC,uBACCH,GAAY6C,EAAI/H,gCAChBkF,oCAET8C,EAAe9K,oBAwGiBkJ,kBAAmB,CAAC,OAAQ,aACnE,KACA,KAxC6B,CAyC7B5B,G,2BC9HF3F,eAAeC,OAAO5B,EAAeyI,E,+CCK9B,MAAMsC,UAAwB,IACnC,WAAA3J,CAAY6C,EAAM+G,GAChB3J,MAAM4C,EAAM,QAAS,QAAS,CAC5BgH,YAAa,CAAC5C,EAAMpE,KACdA,EAAKgE,QACPI,EAAKJ,MAAQhE,EAAKgE,OAEhBhE,EAAKiH,MACP7C,EAAKjG,aAAa,OAAQ6B,EAAKiH,MAIjC7C,EAAKF,GAAK7G,KAAK6J,UAES,mBAAbH,GACTA,EAAS3C,IAGb+C,aAAa,GAEjB,E","sources":["webpack://@descope/web-components-ui/../components/descope-list-item/src/component/ListItemClass.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/ListClass.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/index.js","webpack://@descope/web-components-ui/./src/mixins/createDynamicDataMixin.js","webpack://@descope/web-components-ui/./src/components/descope-scopes-list/ScopesListClass.js","webpack://@descope/web-components-ui/./src/components/descope-scopes-list/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n activeableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this,\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-left' },\n { property: 'padding-right' },\n ],\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin,\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n","import { componentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(componentName, ListItemClass);\n\nexport { ListItemClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { ListItemClass } from '@descope-ui/descope-list-item/class';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list');\n\nclass RawList extends createBaseClass({\n componentName,\n baseSelector: '.wrapper',\n}) {\n static get observedAttributes() {\n return ['variant', 'readonly'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n <slot name=\"empty-state\">\n No item...\n </slot>\n </div>\n\t`;\n\n injectStyle(\n `\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name=\"empty-state\"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name=\"empty-state\"] {\n display: none;\n }\n :host([empty]) slot[name=\"empty-state\"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n `,\n this,\n );\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n #handleEmptyState() {\n if (this.items.length === 0) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n }\n\n get variant() {\n return this.getAttribute('variant') || 'list';\n }\n\n #handleItemsVariant() {\n this.items.forEach((item) => {\n let listItem = item;\n if (listItem.localName !== ListItemClass.componentName) {\n listItem = item.querySelector(ListItemClass.componentName);\n }\n\n const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';\n listItem?.setAttribute('variant', listItemVariant);\n });\n }\n\n init() {\n super.init?.();\n\n // we want new items to get the size\n observeChildren(this, () => {\n this.#handleEmptyState();\n this.#handleItemsVariant();\n this.#handleReadOnly();\n });\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n #handleReadOnly() {\n this.items.forEach((item) => {\n if (this.isReadOnly) item.setAttribute('inert', '');\n else item.removeAttribute('inert');\n });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (newValue === oldValue) return;\n\n if (name === 'variant') {\n this.#handleItemsVariant();\n } else if (name === 'readonly') {\n this.#handleReadOnly();\n }\n }\n}\n\nexport const ListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n maxHeight: { selector: () => ':host' },\n minHeight: {},\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-left' },\n { property: 'padding-right' },\n ],\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontFamily: {},\n gap: {},\n\n backgroundColor: {},\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n boxShadow: {},\n gridTemplateColumns: {},\n maxItemsWidth: {\n selector: () => '::slotted(:not([slot]))',\n property: 'max-width',\n },\n minItemsWidth: {\n selector: () => '::slotted(:not([slot]))',\n property: 'min-width',\n },\n maxRowItems: {\n property: 'max-row-items',\n },\n itemsHorizontalAlign: {\n selector: () => '::slotted(*)',\n property: 'justify-self',\n },\n emptyStateTextColor: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'color',\n },\n emptyStateTextFontFamily: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'font-family',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawList);\n","import '@descope-ui/descope-list-item';\n\nimport { componentName, ListClass } from './ListClass';\n\ncustomElements.define(componentName, ListClass);\n\nexport { ListClass, componentName };\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('switch-toggle');\n\nconst {\n host,\n component,\n checkboxElement: track,\n checkboxSurface: knob,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: {\n selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::part(content)::after',\n },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const SwitchToggleClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [component, checkboxLabel, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: [\n { ...checkboxLabel, property: 'color' },\n { ...checkboxLabel, property: '-webkit-text-fill-color' },\n ],\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n\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\n trackBorderWidth: { ...track, property: 'border-width' },\n trackBorderStyle: { ...track, property: 'border-style' },\n trackBorderColor: { ...track, property: 'border-color' },\n trackBackgroundColor: { ...track, property: 'background-color' },\n trackBorderRadius: { ...track, property: 'border-radius' },\n trackWidth: [{ ...track, property: 'width' }],\n trackHeight: [\n { ...knob, property: 'font-size' },\n { ...track, property: 'height' },\n ],\n\n knobSize: [\n { ...knob, property: 'width' },\n { ...knob, property: 'height' },\n ],\n knobTextColor: { ...knob, property: 'color' },\n knobRadius: { ...knob, property: 'border-radius' },\n knobTransitionDuration: { ...knob, property: 'transition' },\n knobColor: { ...knob, property: 'background-color' },\n knobTopOffset: { ...knob, property: 'top' },\n knobLeftOffset: { ...knob, property: 'left' },\n\n inputOutlineWidth: { ...track, property: 'outline-width' },\n inputOutlineOffset: { ...track, property: 'outline-offset' },\n inputOutlineColor: { ...track, property: 'outline-color' },\n inputOutlineStyle: { ...track, property: 'outline-style' },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles(SwitchToggleClass.cssVarList)}\n\t\t\t${useHostExternalPadding(SwitchToggleClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot=\"label\"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['label', 'tabindex', 'style'],\n componentName,\n })\n);\n","import { componentName, SwitchToggleClass } from './SwitchToggleClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '@descope-ui/descope-enriched-text';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, SwitchToggleClass);\n\nexport { SwitchToggleClass, componentName };\n","import { observeAttributes } from '../helpers/componentHelpers';\n\nconst defaultValidateSchema = () => true;\nconst defaultItemRenderer = (item) => `<pre>${JSON.stringify(item, null, 4)}</pre>`;\n\nconst createTemplate = (templateString) => {\n const template = document.createElement('template');\n template.innerHTML = templateString;\n\n return template;\n};\n\nconst getTemplateContent = (templateOrString) => {\n if (typeof templateOrString === 'string') {\n return createTemplate(templateOrString).content;\n }\n\n if (templateOrString instanceof HTMLTemplateElement) {\n return templateOrString.content;\n }\n\n // eslint-disable-next-line no-console\n console.error('Invalid template', templateOrString);\n return null;\n};\n\nexport const createDynamicDataMixin =\n ({\n itemRenderer = defaultItemRenderer,\n validateSchema = defaultValidateSchema,\n slotName,\n rerenderAttrsList = [],\n }) =>\n (superclass) =>\n class DynamicDataMixinClass extends superclass {\n #data = [];\n\n #validateSchema(data) {\n if (!validateSchema) return true;\n\n const validation = validateSchema(data);\n if (validation === true) return true;\n\n // eslint-disable-next-line no-console\n console.error('Data schema validation failed', validation || '');\n\n return false;\n }\n\n #removeOldItems() {\n const selector = slotName ? `*[slot=\"${slotName}\"]` : ':not([slot])';\n this.baseElement.querySelectorAll(selector).forEach((item) => item.remove());\n }\n\n #renderItems() {\n this.#removeOldItems();\n this.data.forEach((item, index) => {\n const content = getTemplateContent(itemRenderer(item, index, this));\n this.baseElement.appendChild(content?.cloneNode(true));\n });\n }\n\n set data(value) {\n if (this.#validateSchema(value)) {\n this.#data = value;\n this.#renderItems();\n }\n }\n\n get data() {\n return this.#data;\n }\n\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) => {\n if (attrs.includes('data')) this.#handleDataAttr();\n else this.#renderItems();\n },\n { includeAttrs: [...rerenderAttrsList, 'data'] }\n );\n }\n\n #handleDataAttr() {\n const dataAttr = this.getAttribute('data');\n\n if (!dataAttr) return;\n\n try {\n this.data = JSON.parse(dataAttr);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Invalid JSON data', dataAttr);\n }\n }\n };\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../mixins';\nimport { createDynamicDataMixin } from '../../mixins/createDynamicDataMixin';\nimport { CheckboxClass } from '../boolean-fields/descope-checkbox/CheckboxClass';\nimport { SwitchToggleClass } from '../boolean-fields/descope-switch-toggle/SwitchToggleClass';\n\nexport const componentName = getComponentName('scopes-list');\nconst variants = ['checkbox', 'switch'];\n\nconst itemRenderer = ({ id, desc, required = false }, _, ref) => {\n const ComponentClass = ref.variant === 'checkbox' ? CheckboxClass : SwitchToggleClass;\n\n return `\n <${ComponentClass.componentName}\n bordered=\"true\"\n size=${ref.size}\n label=\"${desc}\"\n data-id=\"${id}\"\n readonly=\"${required || ref.isReadOnly}\"\n required=\"${required}\"\n checked=\"true\"\n ></${ComponentClass.componentName}>\n`;\n};\n\nclass RawScopesList extends createBaseClass({ componentName, baseSelector: 'div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div></div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n\n div {\n display: flex;\n flex-direction: column;\n }\n `,\n this\n );\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n get size() {\n return this.getAttribute('size') || 'sm';\n }\n\n #getChildNodes() {\n return Array.from(this.shadowRoot.querySelector('div').children);\n }\n\n reportValidity() {\n this.checkValidity();\n }\n\n checkValidity() {\n return this.data.every((item) => !item.required || this.value.includes(item.id));\n }\n\n get value() {\n return this.#getChildNodes()\n .filter((node) => node.checked)\n .map((node) => node.getAttribute('data-id'));\n }\n\n set value(val = []) {\n this.#getChildNodes().forEach((node) => {\n node.checked = val.includes(node.getAttribute('data-id'));\n });\n }\n\n get variant() {\n const variant = this.getAttribute('variant');\n\n return variants.includes(variant) ? variant : variants[0];\n }\n}\n\nexport const ScopesListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: [\n { selector: () => ':host', property: 'direction' },\n {\n selector: () => CheckboxClass.componentName,\n property: CheckboxClass.cssVarList.hostDirection,\n },\n {\n selector: () => SwitchToggleClass.componentName,\n property: SwitchToggleClass.cssVarList.hostDirection,\n },\n ],\n gap: { selector: () => 'div', property: 'gap' },\n requiredInputBorderColor: [\n {\n selector: `${CheckboxClass.componentName}[required=\"true\"]`,\n property: CheckboxClass.cssVarList.inputBorderColor,\n },\n {\n selector: `${SwitchToggleClass.componentName}[required=\"true\"]`,\n property: SwitchToggleClass.cssVarList.inputBorderColor,\n },\n ],\n requiredInputValueTextColor: [\n {\n selector: `${CheckboxClass.componentName}[required=\"true\"]`,\n property: CheckboxClass.cssVarList.inputValueTextColor,\n },\n {\n selector: `${SwitchToggleClass.componentName}[required=\"true\"]`,\n property: SwitchToggleClass.cssVarList.knobColor,\n },\n ],\n },\n }),\n createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size', 'variant'] }),\n draggableMixin,\n componentNameValidationMixin\n)(RawScopesList);\n","import { componentName, ScopesListClass } from './ScopesListClass';\nimport '@descope-ui/descope-list';\nimport '../boolean-fields/descope-checkbox';\nimport '../boolean-fields/descope-switch-toggle';\n\ncustomElements.define(componentName, ScopesListClass);\n\nexport { ScopesListClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<input>` element.\n */\nexport class InputController extends SlotController {\n constructor(host, callback) {\n super(host, 'input', 'input', {\n initializer: (node, host) => {\n if (host.value) {\n node.value = host.value;\n }\n if (host.type) {\n node.setAttribute('type', host.type);\n }\n\n // Ensure every instance has unique ID\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n"],"names":["componentName","ListItemClass","mappings","verticalPadding","property","horizontalPadding","backgroundColor","borderColor","borderStyle","borderWidth","borderRadius","outline","cursor","gap","maxWidth","selector","alignItems","flexDirection","transition","superclass","constructor","super","this","attachShadow","mode","innerHTML","baseSelector","customElements","define","RawList","observedAttributes","items","shadowRoot","querySelector","assignedElements","length","setAttribute","removeAttribute","variant","getAttribute","forEach","item","listItem","localName","listItemVariant","init","isReadOnly","attributeChangedCallback","name","oldValue","newValue","ListClass","hostWidth","maxHeight","minHeight","hostDirection","fontFamily","boxShadow","gridTemplateColumns","maxItemsWidth","minItemsWidth","maxRowItems","itemsHorizontalAlign","emptyStateTextColor","emptyStateTextFontFamily","host","component","checkboxElement","track","checkboxSurface","knob","checkboxLabel","requiredIndicator","helperText","errorMessage","SwitchToggleClass","fontSize","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","trackBorderWidth","trackBorderStyle","trackBorderColor","trackBackgroundColor","trackBorderRadius","trackWidth","trackHeight","knobSize","knobTextColor","knobRadius","knobTransitionDuration","knobColor","knobTopOffset","knobLeftOffset","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","proxyProps","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","defaultValidateSchema","defaultItemRenderer","JSON","stringify","variants","RawScopesList","createBaseClass","size","Array","from","children","reportValidity","checkValidity","data","every","required","value","includes","id","filter","node","checked","map","val","ScopesListClass","CheckboxClass","requiredInputBorderColor","inputBorderColor","requiredInputValueTextColor","inputValueTextColor","itemRenderer","validateSchema","slotName","rerenderAttrsList","validation","console","error","baseElement","querySelectorAll","remove","index","content","templateOrString","templateString","template","document","createElement","createTemplate","HTMLTemplateElement","appendChild","cloneNode","attrs","includeAttrs","dataAttr","parse","e","warn","createDynamicDataMixin","desc","_","ref","ComponentClass","InputController","callback","initializer","type","defaultId","useUniqueId"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3594],{74460(e,t,r){r.r(t),r.d(t,{SecurityQuestionsSetupClass:()=>y,componentName:()=>c});var o=r(81365),i=r(9696),n=r(97810),s=r(79365),l=r(86365),a=r(79275),p=r(25964);const c=(0,n.xE)("security-questions-setup"),d=["full-width","readonly","size","label-type","question-label","question-placeholder","question-data-errormessage-value-missing","answer-label","answer-placeholder","answer-data-errormessage-value-missing","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"],u=["count","questions"];class h extends((0,o.q)({componentName:c,baseSelector:"div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <div></div>\n\t\t",(0,p.fz)("\n :host {\n display: inline-flex;\n }\n\n div {\n display: flex;\n flex-direction: column;\n }\n ",this)}get count(){return Number(this.getAttribute("count"))||0}#e(){const e=Array.from({length:this.count}).map((e,t)=>`\n <div class="question-wrapper">\n <descope-combo-box\n data-id="${t}"\n item-label-path="data-name"\n item-value-path="data-id"\n bordered="true"\n required="true"\n clear-button-visible="true"\n ></descope-combo-box>\n\n <descope-text-field\n data-id="${t}"\n required="true"\n bordered="true"\n minlength="2"\n ></descope-text-field>\n </div>\n `);this.baseElement.innerHTML=e.join("<spacer></spacer><descope-divider></descope-divider><spacer></spacer>"),this.comboBoxes.forEach(e=>{e.addEventListener("change",e=>{this.updateRemainingCombosData(e.target),this.getAttachedTextField(e.target).value=""}),e.data=this.data}),this.#t(d)}getAttachedTextField(e){const t=`descope-text-field[data-id="${e.getAttribute("data-id")}"]`;return this.baseElement.querySelector(t)}filterData(e){return this.data.filter(t=>t.value===e||!this.selectedQuestionIds.includes(t.value))}reportValidity(){return this.inputs.reverse().forEach(e=>e.reportValidity()),this.checkValidity()}checkValidity(){return[...this.comboBoxes,...this.textFields].every(e=>e.checkValidity())}updateRemainingCombosData(e){this.comboBoxes.filter(t=>t!==e).forEach(e=>{e.data=this.filterData(e.value)})}get questions(){try{return JSON.parse(this.getAttribute("questions"))||[]}catch(e){return console.error(c,"Error parsing questions attribute",e),[]}}get data(){return this.questions.map(({id:e,text:t})=>({value:e,label:t}))}get comboBoxes(){return Array.from(this.baseElement.querySelectorAll("descope-combo-box"))}get textFields(){return Array.from(this.baseElement.querySelectorAll("descope-text-field"))}get inputs(){return Array.from(this.baseElement.querySelectorAll("descope-combo-box, descope-text-field"))}get selectedQuestionIds(){return this.comboBoxes.map(e=>e.value)}get value(){return this.comboBoxes.map(e=>({id:e.value,answer:this.getAttachedTextField(e).value}))}set value(e=[]){e.forEach((e,t)=>{const r=this.comboBoxes[t],o=this.getAttachedTextField(r);r.value=e.id,o.value=e.answer})}#r(e,t,r){null===r?e.removeAttribute(t):e.setAttribute(t,r)}#t(e){const t={question:this.comboBoxes,answer:this.textFields};e.forEach(e=>{const[r,...o]=e.split("-"),i=t[r]||this.inputs,n=t[r]?o.join("-"):e;i.forEach(t=>{this.#r(t,n,this.getAttribute(e))})})}init(){super.init?.(),(0,n.mx)(this,()=>{this.#e()},{includeAttrs:u}),(0,n.mx)(this,this.#t.bind(this),{includeAttrs:d})}}const y=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"},{property:"width"}],hostDirection:[{selector:()=>":host",property:"direction"},{selector:()=>l.C.componentName,property:l.C.cssVarList.hostDirection},{selector:()=>a.w.componentName,property:a.w.cssVarList.hostDirection}],gap:{selector:()=>"div",property:"gap"}}}),s.VO,s.tQ)(h);r(21374),r(27092),customElements.define(c,y)},79275(e,t,r){r.d(t,{T:()=>a,w:()=>c});var o=r(79365),i=r(6424),n=r(9696),s=r(97810),l=r(73551);const a=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],c=(0,n.Zz)((0,o.RF)({mappings:i.A}),o.VO,(0,o.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),o.tQ,e=>class extends e{static get observedAttributes(){return p.concat(e.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(e){if(!e)return void this.icon?.remove();const t={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},r={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...t}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,r),setTimeout(()=>{Object.assign(this.icon,t)},5e3)})}onLabelClick(){this.focus()}attributeChangedCallback(e,t,r){super.attributeChangeCallback?.(e,t,r),"type"===e&&this.baseElement._setType(r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===r))}})((0,o.tz)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${c.cssVarList.inputOutlineWidth}) + var(${c.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,l.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(c.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",c.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:a}))},21374(e,t,r){r.r(t),r.d(t,{TextFieldClass:()=>o.w,componentName:()=>o.T}),r(11284),r(37182),r(95260);var o=r(79275);customElements.define(o.T,o.w)},6424(e,t,r){r.d(t,{A:()=>f});const{host:o,label:i,placeholder:n,requiredIndicator:s,inputField:l,input:a,inputMask:p,helperText:c,errorMessage:d,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:b,externalInputDisabled:g,externalPlaceholder:m,externalDisabledPlaceholder:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},f={fontSize:[{},o],fontFamily:[i,l,c,d],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...s,property:"color"},{...i,property:"-webkit-text-fill-color"},{...s,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...a,property:"direction"},inputBackgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...d,property:"color"},errorMessageIcon:{...d,property:"background-image"},errorMessageIconSize:{...d,property:"background-size"},errorMessageIconPadding:{...d,property:"padding-inline-start"},errorMessageIconRepeat:{...d,property:"background-repeat"},errorMessageIconPosition:{...d,property:"background-position"},errorMessageFontSize:{...d,property:"font-size"},helperTextColor:{...c,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...h,property:"-webkit-text-fill-color"},{...g,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...a,property:"caret-color"},{...b,property:"caret-color"}],labelRequiredIndicator:{...s,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...a,property:"padding-left"},{...a,property:"padding-right"},{...b,property:"padding-left"},{...b,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},textAlign:{},inputTextAlign:[{...a,property:"text-align"},{...b,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...m,property:"color"},{...n,property:"color"},{...u,property:"-webkit-text-fill-color"},{...x,property:"-webkit-text-fill-color"}],labelPosition:{...i,property:"position"},labelTopPosition:{...i,property:"top"},labelHorizontalPosition:[{...i,property:"left"},{...i,property:"right"}],inputTransformY:{...i,property:"transform"},inputTransition:{...i,property:"transition"},marginInlineStart:{...i,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...m,property:"opacity"}],inputVerticalAlignment:[{...l,property:"align-items"},{...b,property:"align-items"}],valueInputHeight:[{...a,property:"height"},{...b,property:"height"}],valueInputMarginBottom:[{...a,property:"margin-bottom"},{...b,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"},inputTextSecurity:[{...a,property:"-webkit-text-security"},{...a,property:"text-security"},{...b,property:"-webkit-text-security"},{...b,property:"text-security"}]}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3594],{74460(e,t,r){r.r(t),r.d(t,{SecurityQuestionsSetupClass:()=>y,componentName:()=>c});var o=r(86365),i=r(25964),n=r(81365),s=r(9696),l=r(97810),a=r(79365),p=r(79275);const c=(0,l.xE)("security-questions-setup"),d=["full-width","readonly","size","label-type","question-label","question-placeholder","question-data-errormessage-value-missing","answer-label","answer-placeholder","answer-data-errormessage-value-missing","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"],u=["count","questions"];class h extends((0,n.q)({componentName:c,baseSelector:"div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <div></div>\n\t\t",(0,i.fz)("\n :host {\n display: inline-flex;\n }\n\n div {\n display: flex;\n flex-direction: column;\n }\n ",this)}get count(){return Number(this.getAttribute("count"))||0}#e(){const e=Array.from({length:this.count}).map((e,t)=>`\n <div class="question-wrapper">\n <descope-combo-box\n data-id="${t}"\n item-label-path="data-name"\n item-value-path="data-id"\n bordered="true"\n required="true"\n clear-button-visible="true"\n ></descope-combo-box>\n\n <descope-text-field\n data-id="${t}"\n required="true"\n bordered="true"\n minlength="2"\n ></descope-text-field>\n </div>\n `);this.baseElement.innerHTML=e.join("<spacer></spacer><descope-divider></descope-divider><spacer></spacer>"),this.comboBoxes.forEach(e=>{e.addEventListener("change",e=>{this.updateRemainingCombosData(e.target),this.getAttachedTextField(e.target).value=""}),e.data=this.data}),this.#t(d)}getAttachedTextField(e){const t=`descope-text-field[data-id="${e.getAttribute("data-id")}"]`;return this.baseElement.querySelector(t)}filterData(e){return this.data.filter(t=>t.value===e||!this.selectedQuestionIds.includes(t.value))}reportValidity(){return this.inputs.reverse().forEach(e=>e.reportValidity()),this.checkValidity()}checkValidity(){return[...this.comboBoxes,...this.textFields].every(e=>e.checkValidity())}updateRemainingCombosData(e){this.comboBoxes.filter(t=>t!==e).forEach(e=>{e.data=this.filterData(e.value)})}get questions(){try{return JSON.parse(this.getAttribute("questions"))||[]}catch(e){return console.error(c,"Error parsing questions attribute",e),[]}}get data(){return this.questions.map(({id:e,text:t})=>({value:e,label:t}))}get comboBoxes(){return Array.from(this.baseElement.querySelectorAll("descope-combo-box"))}get textFields(){return Array.from(this.baseElement.querySelectorAll("descope-text-field"))}get inputs(){return Array.from(this.baseElement.querySelectorAll("descope-combo-box, descope-text-field"))}get selectedQuestionIds(){return this.comboBoxes.map(e=>e.value)}get value(){return this.comboBoxes.map(e=>({id:e.value,answer:this.getAttachedTextField(e).value}))}set value(e=[]){e.forEach((e,t)=>{const r=this.comboBoxes[t],o=this.getAttachedTextField(r);r.value=e.id,o.value=e.answer})}#r(e,t,r){null===r?e.removeAttribute(t):e.setAttribute(t,r)}#t(e){const t={question:this.comboBoxes,answer:this.textFields};e.forEach(e=>{const[r,...o]=e.split("-"),i=t[r]||this.inputs,n=t[r]?o.join("-"):e;i.forEach(t=>{this.#r(t,n,this.getAttribute(e))})})}init(){super.init?.(),(0,l.mx)(this,()=>{this.#e()},{includeAttrs:u}),(0,l.mx)(this,this.#t.bind(this),{includeAttrs:d})}}const y=(0,s.Zz)((0,a.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"},{property:"width"}],hostDirection:[{selector:()=>":host",property:"direction"},{selector:()=>o.C.componentName,property:o.C.cssVarList.hostDirection},{selector:()=>p.w.componentName,property:p.w.cssVarList.hostDirection}],gap:{selector:()=>"div",property:"gap"}}}),a.VO,a.tQ)(h);r(21374),r(27092),customElements.define(c,y)},79275(e,t,r){r.d(t,{T:()=>a,w:()=>c});var o=r(79365),i=r(6424),n=r(9696),s=r(97810),l=r(73551);const a=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],c=(0,n.Zz)((0,o.RF)({mappings:i.A}),o.VO,(0,o.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),o.tQ,e=>class extends e{static get observedAttributes(){return p.concat(e.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(e){if(!e)return void this.icon?.remove();const t={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},r={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...t}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,r),setTimeout(()=>{Object.assign(this.icon,t)},5e3)})}onLabelClick(){this.focus()}attributeChangedCallback(e,t,r){super.attributeChangeCallback?.(e,t,r),"type"===e&&this.baseElement._setType(r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===r))}})((0,o.tz)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${c.cssVarList.inputOutlineWidth}) + var(${c.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,l.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(c.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",c.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:a}))},21374(e,t,r){r.r(t),r.d(t,{TextFieldClass:()=>o.w,componentName:()=>o.T}),r(11284),r(37182),r(95260);var o=r(79275);customElements.define(o.T,o.w)},6424(e,t,r){r.d(t,{A:()=>f});const{host:o,label:i,placeholder:n,requiredIndicator:s,inputField:l,input:a,inputMask:p,helperText:c,errorMessage:d,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:b,externalInputDisabled:g,externalPlaceholder:m,externalDisabledPlaceholder:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},f={fontSize:[{},o],fontFamily:[i,l,c,d],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...s,property:"color"},{...i,property:"-webkit-text-fill-color"},{...s,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...a,property:"direction"},inputBackgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...d,property:"color"},errorMessageIcon:{...d,property:"background-image"},errorMessageIconSize:{...d,property:"background-size"},errorMessageIconPadding:{...d,property:"padding-inline-start"},errorMessageIconRepeat:{...d,property:"background-repeat"},errorMessageIconPosition:{...d,property:"background-position"},errorMessageFontSize:{...d,property:"font-size"},helperTextColor:{...c,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...h,property:"-webkit-text-fill-color"},{...g,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...a,property:"caret-color"},{...b,property:"caret-color"}],labelRequiredIndicator:{...s,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...a,property:"padding-left"},{...a,property:"padding-right"},{...b,property:"padding-left"},{...b,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},textAlign:{},inputTextAlign:[{...a,property:"text-align"},{...b,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...m,property:"color"},{...n,property:"color"},{...u,property:"-webkit-text-fill-color"},{...x,property:"-webkit-text-fill-color"}],labelPosition:{...i,property:"position"},labelTopPosition:{...i,property:"top"},labelHorizontalPosition:[{...i,property:"left"},{...i,property:"right"}],inputTransformY:{...i,property:"transform"},inputTransition:{...i,property:"transition"},marginInlineStart:{...i,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...m,property:"opacity"}],inputVerticalAlignment:[{...l,property:"align-items"},{...b,property:"align-items"}],valueInputHeight:[{...a,property:"height"},{...b,property:"height"}],valueInputMarginBottom:[{...a,property:"margin-bottom"},{...b,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"},inputTextSecurity:[{...a,property:"-webkit-text-security"},{...a,property:"text-security"},{...b,property:"-webkit-text-security"},{...b,property:"text-security"}]}}}]);
|
|
2
2
|
//# sourceMappingURL=descope-security-questions-setup-index-js.js.map
|