@descope/web-components-ui 3.3.5 → 3.5.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 +344 -15
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +344 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/3685.js +1 -1
- package/dist/umd/3685.js.map +1 -1
- package/dist/umd/7092.js +1 -1
- package/dist/umd/7092.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.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-email-field-index-js.js +4 -4
- package/dist/umd/descope-email-field-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-multi-select-combo-box-index-js.js +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-number-field-index-js.js +1 -1
- package/dist/umd/descope-number-field-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-password-index-js.js +1 -1
- package/dist/umd/descope-password-index-js.js.map +1 -1
- package/dist/umd/descope-radio-group-index-js.js +1 -1
- package/dist/umd/descope-radio-group-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-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-area-index-js.js.map +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js.map +1 -1
- package/dist/umd/descope-timer-button.js +2 -2
- package/dist/umd/descope-timer-button.js.map +1 -1
- package/dist/umd/descope-timer.js +1 -1
- package/dist/umd/descope-timer.js.map +1 -1
- package/dist/umd/index.js +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-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-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/components/descope-date-field/DateFieldClass.js +20 -0
- package/src/components/descope-hybrid-field/HybridFieldClass.js +50 -0
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +4 -0
- package/src/components/descope-new-password/NewPasswordClass.js +10 -0
- package/src/components/descope-passcode/PasscodeClass.js +6 -0
- package/src/components/descope-password/PasswordClass.js +10 -0
- package/src/components/descope-text-area/TextAreaClass.js +6 -0
- package/src/components/descope-text-field/textFieldMappings.js +11 -0
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +9 -0
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +4 -0
- package/src/theme/components/dateField.js +6 -0
- package/src/theme/components/emailField.js +4 -0
- package/src/theme/components/hybridField.js +5 -0
- package/src/theme/components/inputWrapper.js +4 -0
- package/src/theme/components/multiSelectComboBox.js +4 -0
- package/src/theme/components/newPassword.js +4 -0
- package/src/theme/components/numberField.js +4 -0
- package/src/theme/components/passcode.js +3 -0
- package/src/theme/components/password.js +4 -0
- package/src/theme/components/phoneField.js +6 -0
- package/src/theme/components/phoneInputBoxField.js +4 -0
- package/src/theme/components/textArea.js +6 -0
- package/src/theme/components/textField.js +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-password-index-js.js","mappings":"wNAkBO,MAAMA,GAAgB,QAAiB,aA4GxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,wBACZC,EAAuB,sBACvBC,EAAqB,iBACrBC,EAAgB,MAChBC,EAAK,kBACLC,EAAiB,aACjBC,EAAY,WACZC,GACE,CACFT,KAAM,CAAEU,SAAU,IAAM,SACxBT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,WAC1BP,wBAAyB,CAAEO,SAAU,IAAM,iCAC3CN,sBAAuB,CAAEM,SAAU,yBACnCL,iBAAkB,CAAEK,SAAU,iCAC9BJ,MAAO,CAAEI,SAAU,iBACnBH,kBAAmB,CAAEG,SAAU,+CAC/BD,WAAY,CAAEC,SAAU,uBACxBF,aAAc,CAAEE,SAAU,0BAGfC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKb,EAAMc,SAAU,SAChCC,aAAc,IAAKf,EAAMc,SAAU,aACnCE,cAAe,IAAKhB,EAAMc,SAAU,aACpCG,SAAU,CAAC,CAAC,EAAGjB,GACfkB,WAAY,CAACZ,EAAOL,EAAYO,EAAcC,GAC9CU,YAAa,IAAKlB,EAAYa,SAAU,UACxCM,uBAAwB,CACtB,IAAKlB,EAAcY,SAAU,gBAC7B,IAAKZ,EAAcY,SAAU,kBAE/BO,qBAAsB,IAAKpB,EAAYa,SAAU,oBAEjDQ,iBAAkB,IAAKrB,EAAYa,SAAU,gBAC7CS,iBAAkB,IAAKtB,EAAYa,SAAU,gBAC7CU,iBAAkB,IAAKvB,EAAYa,SAAU,gBAC7CW,kBAAmB,IAAKxB,EAAYa,SAA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,EAASd,aAAa,OAAQ,QAC9BlB,WAAW,KACTgC,EAASG,UAGX,MAAMC,EAAcC,IAClBL,EAASd,aAAa,OAAQgB,GAC9BN,EAAIU,gBAAgB,SACpB3D,KAAKkC,oBAAoB,UAAWuB,GACpCzD,KAAKkC,oBAAoB,UAAWuB,IAGtCzD,KAAKkD,iBAAiB,UAAWO,EAAY,CAAEG,MAAM,IACrD5D,KAAKkD,iBAAiB,UAAWO,EAAY,CAAEG,MAAM,GACvD,GAEJ,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n externalInputMixin,\n} from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport passwordDraggableMixin from './passwordDraggableMixin';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('password');\n\nconst customMixin = (superclass) =>\n class PasswordFieldMixinClass extends superclass {\n static get observedAttributes() {\n return ['manual-visibility-toggle'];\n }\n\n get manualToggleVisibility() {\n return this.getAttribute('manual-visibility-toggle') === 'true';\n }\n\n init() {\n super.init?.();\n this.handleCaretOnVisibilityChange();\n this.origSetPasswordVisible = this.baseElement._setPasswordVisible;\n this.origSetFocused = this.baseElement._setFocused;\n this.baseElement._setFocused = this.setFocus.bind(this);\n\n this.initExternalInput();\n }\n\n initExternalInput() {\n const externalInput = this.createExternalInput();\n if (externalInput) {\n this.handlePasswordVisibility(externalInput);\n }\n }\n\n get caretPosition() {\n return this.value?.length || 0;\n }\n\n handleCaretOnVisibilityChange() {\n const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(\n this.baseElement\n );\n this.baseElement._togglePasswordVisibility = () => {\n setTimeout(() => {\n origTogglePasswordVisibility();\n this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);\n return false;\n });\n };\n }\n\n // We use `manual-visibility-toggle` to to toggle the password's visibility\n // even if the input field is focused-out. However, on focusout - Vaadin resets\n // password visibility. Since we don't want to override Vaadin's native setFocus\n // function (which is part of their FocusMixin).\n // So, here we override the part of logic that runs within Vaadin's setFocus that reports\n // the password visibility state. This logic is part of our `manual-visibility-toggle` only.\n setFocus(focused) {\n if (this.manualToggleVisibility) {\n this.baseElement._setPasswordVisible = () => {};\n }\n this.origSetFocused.call(this.baseElement, focused);\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);\n }\n\n resetPasswordVisibilityToggle() {\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible;\n this.baseElement._setFocused = this.origSetFocus;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n }\n\n // override vaadin's password visibility toggle.\n // we need this override in order to to resolve the external input `focus` race condition,\n // which is caused due to the focus sync between the two inputs.\n handlePasswordVisibility(externalInput) {\n // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener\n const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;\n this.baseElement\n .querySelector('vaadin-password-field-button')\n .removeEventListener('mousedown', origBoundRevealButtonMouseDown);\n\n // disable vaadin's `_passwordVisibleChanged` observer\n this.baseElement._passwordVisibleChanged = () => {};\n\n // override vaadin's `_togglePasswordVisibility`\n this.baseElement._togglePasswordVisibility = () => {\n const currVisibility = externalInput.getAttribute('type');\n if (currVisibility === 'password') {\n this.showPasswordVisibility(externalInput);\n } else {\n this.hidePasswordVisibility(externalInput);\n }\n };\n }\n\n showPasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'text');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'true');\n }\n\n hidePasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'password');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'false');\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n inputElementPlaceholder,\n revealButtonContainer,\n revealButtonIcon,\n label,\n requiredIndicator,\n errorMessage,\n helperText,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: '> input' },\n inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },\n revealButtonContainer: { selector: '::part(reveal-button)' },\n revealButtonIcon: { selector: '::part(reveal-button)::before' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const PasswordClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n fontFamily: [label, inputField, errorMessage, helperText],\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\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 inputPlaceholderTextColor: [\n { ...inputElementPlaceholder, property: 'color' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },\n ],\n inputValueTextColor: [\n { ...inputElement, property: 'color' },\n { selector: () => ':host ::slotted(input)', property: 'color' },\n ],\n\n revealButtonOffset: [\n { ...revealButtonContainer, property: 'margin-right' },\n { ...revealButtonContainer, property: 'margin-left' },\n ],\n revealButtonSize: { ...revealButtonContainer, property: 'font-size' },\n revealButtonColor: { ...revealButtonIcon, property: 'color' },\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 { ...inputElement, property: 'opacity' },\n ],\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n },\n }),\n draggableMixin,\n externalInputMixin({\n inputType: 'password',\n inputName: 'password',\n includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],\n noBlurDispatch: true,\n }),\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n passwordDraggableMixin,\n customMixin\n)(\n createProxy({\n slots: ['', 'suffix'],\n wrappedEleName: 'vaadin-password-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\t\t${resetInputCursor('vaadin-password-field')}\n ${resetInputLabelPosition('vaadin-password-field')}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});\n\t\t\t}\n\n ${inputFloatingLabelStyle()}\n\n ::part(reveal-button) {\n align-self: center;\n }\n\n vaadin-password-field[external-input=\"true\"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\n","const passwordDraggableMixin = (superclass) =>\n class PasswordDraggableMixinClass extends superclass {\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n init() {\n // there is an issue in Chrome that input field with type password cannot be D&D\n // so in case the input is draggable & readonly, we are changing the input type to \"text\" before dragging\n // and return the original type when done\n super.init?.();\n\n const ele = this.querySelector('input');\n\n ele?.addEventListener('mousedown', (e) => {\n if (this.isDraggable && this.isReadOnly) {\n ele.setAttribute('inert', 'true');\n\n const inputEle = e.target;\n const prevType = inputEle.getAttribute('type');\n inputEle.setAttribute('type', 'text');\n setTimeout(() => {\n inputEle.focus();\n });\n\n const onComplete = (_) => {\n inputEle.setAttribute('type', prevType);\n ele.removeAttribute('inert');\n this.removeEventListener('mouseup', onComplete);\n this.removeEventListener('dragend', onComplete);\n };\n\n this.addEventListener('dragend', onComplete, { once: true });\n this.addEventListener('mouseup', onComplete, { once: true });\n }\n });\n }\n };\n\nexport default passwordDraggableMixin;\n"],"names":["componentName","host","inputField","inputElement","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","label","requiredIndicator","errorMessage","helperText","selector","PasswordClass","mappings","hostWidth","property","hostMinWidth","hostDirection","fontSize","fontFamily","inputHeight","inputHorizontalPadding","inputBackgroundColor","inputBorderStyle","inputBorderWidth","inputBorderColor","inputBorderRadius","inputOutlineColor","inputOutlineStyle","inputOutlineOffset","inputOutlineWidth","labelFontSize","labelFontWeight","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputPlaceholderTextColor","inputValueTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","inputType","inputName","includeAttrs","noBlurDispatch","proxyProps","useProxyTargets","superclass","observedAttributes","manualToggleVisibility","this","getAttribute","init","super","handleCaretOnVisibilityChange","origSetPasswordVisible","baseElement","_setPasswordVisible","origSetFocused","_setFocused","setFocus","bind","initExternalInput","externalInput","createExternalInput","handlePasswordVisibility","caretPosition","value","length","origTogglePasswordVisibility","_togglePasswordVisibility","setTimeout","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","attributeChangedCallback","attrName","oldValue","newValue","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","querySelector","removeEventListener","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","input","setAttribute","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","customElements","define","isReadOnly","hasAttribute","ele","addEventListener","e","isDraggable","inputEle","target","prevType","focus","onComplete","_","removeAttribute","once"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-password-index-js.js","mappings":"wNAkBO,MAAMA,GAAgB,QAAiB,aA4GxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,wBACZC,EAAuB,sBACvBC,EAAqB,iBACrBC,EAAgB,MAChBC,EAAK,kBACLC,EAAiB,aACjBC,EAAY,WACZC,GACE,CACFT,KAAM,CAAEU,SAAU,IAAM,SACxBT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,WAC1BP,wBAAyB,CAAEO,SAAU,IAAM,iCAC3CN,sBAAuB,CAAEM,SAAU,yBACnCL,iBAAkB,CAAEK,SAAU,iCAC9BJ,MAAO,CAAEI,SAAU,iBACnBH,kBAAmB,CAAEG,SAAU,+CAC/BD,WAAY,CAAEC,SAAU,uBACxBF,aAAc,CAAEE,SAAU,0BAGfC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKb,EAAMc,SAAU,SAChCC,aAAc,IAAKf,EAAMc,SAAU,aACnCE,cAAe,IAAKhB,EAAMc,SAAU,aACpCG,SAAU,CAAC,CAAC,EAAGjB,GACfkB,WAAY,CAACZ,EAAOL,EAAYO,EAAcC,GAC9CU,YA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,UACZC,eAAgB,wBAChBC,MAAO,IAAM,sLAQZ,QAAuBnG,EAAcoG,uBACrC,QAAiB,oCACd,QAAwB,0iCAsCApG,EAAcoG,WAAWrF,0CAGjD,+MAUJsF,iBAAkB,CAAC,WAAY,SAC/BjH,kB,kGCrTJkH,eAAeC,OAAO,IAAe,I,gCCHrC,MAuCA,EAvCgCjD,GAC9B,cAA0CA,EACxC,cAAIkD,GACF,OAAO/C,KAAKgD,aAAa,aAAiD,UAAlChD,KAAKC,aAAa,WAC5D,CAEA,IAAAC,GAIEC,MAAMD,SAEN,MAAM+C,EAAMjD,KAAKiC,cAAc,SAE/BgB,GAAKC,iBAAiB,YAAcC,IAClC,GAAInD,KAAKoD,aAAepD,KAAK+C,WAAY,CACvCE,EAAIV,aAAa,QAAS,QAE1B,MAAMc,EAAWF,EAAEG,OACbC,EAAWF,EAASpD,aAAa,QACvCoD,EAASd,aAAa,OAAQ,QAC9BlB,WAAW,KACTgC,EAASG,UAGX,MAAMC,EAAcC,IAClBL,EAASd,aAAa,OAAQgB,GAC9BN,EAAIU,gBAAgB,SACpB3D,KAAKkC,oBAAoB,UAAWuB,GACpCzD,KAAKkC,oBAAoB,UAAWuB,IAGtCzD,KAAKkD,iBAAiB,UAAWO,EAAY,CAAEG,MAAM,IACrD5D,KAAKkD,iBAAiB,UAAWO,EAAY,CAAEG,MAAM,GACvD,GAEJ,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n externalInputMixin,\n} from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport passwordDraggableMixin from './passwordDraggableMixin';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('password');\n\nconst customMixin = (superclass) =>\n class PasswordFieldMixinClass extends superclass {\n static get observedAttributes() {\n return ['manual-visibility-toggle'];\n }\n\n get manualToggleVisibility() {\n return this.getAttribute('manual-visibility-toggle') === 'true';\n }\n\n init() {\n super.init?.();\n this.handleCaretOnVisibilityChange();\n this.origSetPasswordVisible = this.baseElement._setPasswordVisible;\n this.origSetFocused = this.baseElement._setFocused;\n this.baseElement._setFocused = this.setFocus.bind(this);\n\n this.initExternalInput();\n }\n\n initExternalInput() {\n const externalInput = this.createExternalInput();\n if (externalInput) {\n this.handlePasswordVisibility(externalInput);\n }\n }\n\n get caretPosition() {\n return this.value?.length || 0;\n }\n\n handleCaretOnVisibilityChange() {\n const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(\n this.baseElement\n );\n this.baseElement._togglePasswordVisibility = () => {\n setTimeout(() => {\n origTogglePasswordVisibility();\n this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);\n return false;\n });\n };\n }\n\n // We use `manual-visibility-toggle` to to toggle the password's visibility\n // even if the input field is focused-out. However, on focusout - Vaadin resets\n // password visibility. Since we don't want to override Vaadin's native setFocus\n // function (which is part of their FocusMixin).\n // So, here we override the part of logic that runs within Vaadin's setFocus that reports\n // the password visibility state. This logic is part of our `manual-visibility-toggle` only.\n setFocus(focused) {\n if (this.manualToggleVisibility) {\n this.baseElement._setPasswordVisible = () => {};\n }\n this.origSetFocused.call(this.baseElement, focused);\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);\n }\n\n resetPasswordVisibilityToggle() {\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible;\n this.baseElement._setFocused = this.origSetFocus;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n }\n\n // override vaadin's password visibility toggle.\n // we need this override in order to to resolve the external input `focus` race condition,\n // which is caused due to the focus sync between the two inputs.\n handlePasswordVisibility(externalInput) {\n // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener\n const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;\n this.baseElement\n .querySelector('vaadin-password-field-button')\n .removeEventListener('mousedown', origBoundRevealButtonMouseDown);\n\n // disable vaadin's `_passwordVisibleChanged` observer\n this.baseElement._passwordVisibleChanged = () => {};\n\n // override vaadin's `_togglePasswordVisibility`\n this.baseElement._togglePasswordVisibility = () => {\n const currVisibility = externalInput.getAttribute('type');\n if (currVisibility === 'password') {\n this.showPasswordVisibility(externalInput);\n } else {\n this.hidePasswordVisibility(externalInput);\n }\n };\n }\n\n showPasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'text');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'true');\n }\n\n hidePasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'password');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'false');\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n inputElementPlaceholder,\n revealButtonContainer,\n revealButtonIcon,\n label,\n requiredIndicator,\n errorMessage,\n helperText,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: '> input' },\n inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },\n revealButtonContainer: { selector: '::part(reveal-button)' },\n revealButtonIcon: { selector: '::part(reveal-button)::before' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const PasswordClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n fontFamily: [label, inputField, errorMessage, helperText],\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: [\n { ...inputElement, property: 'font-weight' },\n { selector: () => ':host ::slotted(input)', property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { ...inputElementPlaceholder, property: 'font-weight' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\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 inputPlaceholderTextColor: [\n { ...inputElementPlaceholder, property: 'color' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },\n ],\n inputValueTextColor: [\n { ...inputElement, property: 'color' },\n { selector: () => ':host ::slotted(input)', property: 'color' },\n ],\n\n revealButtonOffset: [\n { ...revealButtonContainer, property: 'margin-right' },\n { ...revealButtonContainer, property: 'margin-left' },\n ],\n revealButtonSize: { ...revealButtonContainer, property: 'font-size' },\n revealButtonColor: { ...revealButtonIcon, property: 'color' },\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 { ...inputElement, property: 'opacity' },\n ],\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n },\n }),\n draggableMixin,\n externalInputMixin({\n inputType: 'password',\n inputName: 'password',\n includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],\n noBlurDispatch: true,\n }),\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n passwordDraggableMixin,\n customMixin\n)(\n createProxy({\n slots: ['', 'suffix'],\n wrappedEleName: 'vaadin-password-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\t\t${resetInputCursor('vaadin-password-field')}\n ${resetInputLabelPosition('vaadin-password-field')}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});\n\t\t\t}\n\n ${inputFloatingLabelStyle()}\n\n ::part(reveal-button) {\n align-self: center;\n }\n\n vaadin-password-field[external-input=\"true\"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\n","const passwordDraggableMixin = (superclass) =>\n class PasswordDraggableMixinClass extends superclass {\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n init() {\n // there is an issue in Chrome that input field with type password cannot be D&D\n // so in case the input is draggable & readonly, we are changing the input type to \"text\" before dragging\n // and return the original type when done\n super.init?.();\n\n const ele = this.querySelector('input');\n\n ele?.addEventListener('mousedown', (e) => {\n if (this.isDraggable && this.isReadOnly) {\n ele.setAttribute('inert', 'true');\n\n const inputEle = e.target;\n const prevType = inputEle.getAttribute('type');\n inputEle.setAttribute('type', 'text');\n setTimeout(() => {\n inputEle.focus();\n });\n\n const onComplete = (_) => {\n inputEle.setAttribute('type', prevType);\n ele.removeAttribute('inert');\n this.removeEventListener('mouseup', onComplete);\n this.removeEventListener('dragend', onComplete);\n };\n\n this.addEventListener('dragend', onComplete, { once: true });\n this.addEventListener('mouseup', onComplete, { once: true });\n }\n });\n }\n };\n\nexport default passwordDraggableMixin;\n"],"names":["componentName","host","inputField","inputElement","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","label","requiredIndicator","errorMessage","helperText","selector","PasswordClass","mappings","hostWidth","property","hostMinWidth","hostDirection","fontSize","fontFamily","inputHeight","inputHorizontalPadding","inputBackgroundColor","inputBorderStyle","inputBorderWidth","inputBorderColor","inputBorderRadius","inputOutlineColor","inputOutlineStyle","inputOutlineOffset","inputOutlineWidth","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputPlaceholderTextColor","inputValueTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","inputType","inputName","includeAttrs","noBlurDispatch","proxyProps","useProxyTargets","superclass","observedAttributes","manualToggleVisibility","this","getAttribute","init","super","handleCaretOnVisibilityChange","origSetPasswordVisible","baseElement","_setPasswordVisible","origSetFocused","_setFocused","setFocus","bind","initExternalInput","externalInput","createExternalInput","handlePasswordVisibility","caretPosition","value","length","origTogglePasswordVisibility","_togglePasswordVisibility","setTimeout","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","attributeChangedCallback","attrName","oldValue","newValue","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","querySelector","removeEventListener","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","input","setAttribute","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","customElements","define","isReadOnly","hasAttribute","ele","addEventListener","e","isDraggable","inputEle","target","prevType","focus","onComplete","_","removeAttribute","once"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9399],{40649(e,t,r){r.r(t),r.d(t,{RadioGroupClass:()=>c,componentName:()=>d});var o=r(9696),i=r(97810),
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9399],{40649(e,t,r){r.r(t),r.d(t,{RadioGroupClass:()=>c,componentName:()=>d});var o=r(9696),i=r(97810),p=r(73551),l=r(79365),a=r(6424);const n=(0,i.xE)("radio-button"),s=(0,o.Zz)((0,l.RF)({mappings:{cursor:[{},{selector:"label"}],fontSize:[{selector:"label"},{}],labelTextColor:{selector:"label",property:"color"},fontFamily:{selector:"label"},radioSize:[{selector:"::part(radio)",property:"height"},{selector:"::part(radio)",property:"width"}],radioBackgroundColor:{selector:"::part(radio)",property:"background-color"},radioMargin:{selector:"::part(radio)",property:"margin"},radioCheckedSize:{selector:"::part(radio)::after",property:"border-width"},radioCheckedColor:{selector:"::part(radio)::after",property:"border-color"},radioBorderColor:{selector:"::part(radio)",property:"border-color",fallback:"none"},radioBorderWidth:{selector:"::part(radio)",property:"border-width",fallback:0},radioBorderStyle:{selector:"::part(radio)",property:"border-style",fallback:"solid"}}}),(0,l.OZ)({proxyProps:["setSelectionRange"]}),l.tQ,e=>class extends e{constructor(){super(),this.baseElement.checkValidity=()=>{}}init(){this.baseElement.addEventListener("checked-changed",e=>{this.dispatchEvent(new CustomEvent("checked-changed",{detail:e.detail},{bubbles:!0,composed:!0}))}),super.init?.(),(0,i.Ge)(this,this.renderLabel.bind(this))}renderLabel(){this.baseElement.setAttribute("label",this.textContent)}get value(){return this.getAttribute("value")}})((0,l.tz)({slots:[""],wrappedEleName:"vaadin-radio-button",excludeAttrsSync:["tabindex","data","style"],includeForwardProps:["checked","name","disabled"],componentName:n})),d=(0,i.xE)("radio-group"),c=(0,o.Zz)((0,l.RF)({mappings:{...a.A,buttonsSpacing:{selector:"::part(group-field)",property:"justify-content"},buttonsRowGap:{selector:"::part(group-field)",property:"row-gap"},buttonsColumnGap:{selector:"::part(group-field)",property:"column-gap"},itemsLabelColor:{selector:()=>`::slotted(${s.componentName})`,property:s.cssVarList.labelTextColor}}}),l.VO,(0,l.OZ)({proxyProps:["setSelectionRange"]}),l.tQ,e=>class extends e{#e=({value:e,label:t})=>`<descope-radio-button value="${e}">${t}</descope-radio-button>`;#t;constructor(){super(),Object.defineProperty(this.baseElement,"children",{get:()=>this.querySelectorAll(n)}),this.baseElement.__filterRadioButtons=e=>e.filter(e=>e.localName===n),this.baseElement.setCustomValidity=()=>{}}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}get size(){return this.getAttribute("size")}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" - ',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get defaultValue(){return this.getAttribute("default-value")}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.#e?.(t||{})||""),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}init(){super.init?.(),this.inputElement=this.baseElement,this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),Object.defineProperty(this.baseElement,"validity",{get:()=>({valueMissing:!this.baseElement.checkValidity()})}),(0,i.EA)(this,this.baseElement,{includeAttrs:["layout"],mapAttrs:{layout:"theme"}}),setTimeout(()=>{this.defaultValue&&(this.value=this.defaultValue)}),(0,i.Ge)(this,({addedNodes:e})=>{e.forEach(e=>{e.setAttribute("size",this.size)})}),(0,i.mx)(this,()=>{this.items.forEach(e=>{e.setAttribute("size",this.size)})},{includeAttrs:["size"]})}})((0,l.tz)({slots:["","prefix"],wrappedEleName:"vaadin-radio-group",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 ${(0,p.$J)("vaadin-radio-group")}\n `,excludeAttrsSync:["tabindex","size","data","direction","style"],componentName:d,includeForwardProps:["value"]}));r(54623),customElements.define(d,c),customElements.define(n,s)},6424(e,t,r){r.d(t,{A:()=>x});const{host:o,label:i,placeholder:p,requiredIndicator:l,inputField:a,input:n,inputMask:s,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:b,externalInputDisabled:g,externalPlaceholder:m,externalDisabledPlaceholder:f}={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)"}},x={fontSize:[{},o],fontFamily:[i,a,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},inputValueFontWeight:[{...n,property:"font-weight"},{...b,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...m,property:"font-weight"}],helperTextFontWeight:{...d,property:"font-weight"},errorMessageFontWeight:{...c,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...l,property:"color"},{...i,property:"-webkit-text-fill-color"},{...l,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...n,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...s,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...h,property:"-webkit-text-fill-color"},{...g,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...n,property:"caret-color"},{...b,property:"caret-color"}],labelRequiredIndicator:{...l,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...n,property:"padding-left"},{...n,property:"padding-right"},{...b,property:"padding-left"},{...b,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...n,property:"text-align"},{...b,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...m,property:"color"},{...p,property:"color"},{...u,property:"-webkit-text-fill-color"},{...f,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:[{...a,property:"align-items"},{...b,property:"align-items"}],valueInputHeight:[{...n,property:"height"},{...b,property:"height"}],valueInputMarginBottom:[{...n,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:[{...n,property:"-webkit-text-security"},{...n,property:"text-security"},{...b,property:"-webkit-text-security"},{...b,property:"text-security"}]}}}]);
|
|
2
2
|
//# sourceMappingURL=descope-radio-group-index-js.js.map
|
|
@@ -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,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,CAAEG,WAAY,CAAC,uBAC/B,KAvDmBC,GACnB,cAA0BA,EACxB,WAAAC,GACEC,QAEAC,KAAKC,YAAYC,cAAgB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,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
|
+
{"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,CAA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,SAAU,eAGhC0I,sBAAuB,CACrB,CAAE7I,SAAU,IAAM,gCAAiCG,SAAU,SAC7D,IAAKsG,EAAqBtG,SAAU,SACpC,IAAK0F,EAAa1F,SAAU,SAC5B,IAAKiG,EAAqBjG,SAAU,2BACpC,IAAKuG,EAA6BvG,SAAU,4BAG9C2I,cAAe,IAAKhG,EAAO3C,SAAU,YACrC4I,iBAAkB,IAAKjG,EAAO3C,SAAU,OACxC6I,wBAAyB,CACvB,IAAKlG,EAAO3C,SAAU,QACtB,IAAK2C,EAAO3C,SAAU,UAExB8I,gBAAiB,IAAKnG,EAAO3C,SAAU,aACvC+I,gBAAiB,IAAKpG,EAAO3C,SAAU,cACvCgJ,kBAAmB,IAAKrG,EAAO3C,SAAU,uBACzCiJ,mBAAoB,CAClB,CAAEpJ,SAAU,4BAA6BG,SAAU,WACnD,IAAKsG,EAAqBtG,SAAU,YAEtCkJ,uBAAwB,CACtB,IAAKtD,EAAY5F,SAAU,eAC3B,IAAKoG,EAAepG,SAAU,gBAEhCmJ,iBAAkB,CAChB,IAAKtD,EAAO7F,SAAU,UACtB,IAAKoG,EAAepG,SAAU,WAEhCoJ,uBAAwB,CACtB,IAAKvD,EAAO7F,SAAU,iBACtB,IAAKoG,EAAepG,SAAU,kBAGhCqJ,gBAAiB,CACf,IAAKlD,EAAWnG,SAAU,gBAC1B,IAAKmG,EAAWnG,SAAU,gBAE5BsJ,cAAe,IAAKnD,EAAWnG,SAAU,aACzCuJ,eAAgB,IAAKpD,EAAWnG,SAAU,SAC1CwJ,kBAAmB,CACjB,IAAK3D,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 inputValueFontWeight: [\n { ...input, property: 'font-weight' },\n { ...externalInput, property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { selector: () => ':host input:placeholder-shown', property: 'font-weight' },\n { ...externalPlaceholder, property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, 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","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","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([[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"}]}}}]);
|
|
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"},inputValueFontWeight:[{...a,property:"font-weight"},{...b,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...m,property:"font-weight"}],helperTextFontWeight:{...c,property:"font-weight"},errorMessageFontWeight:{...d,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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-security-questions-setup-index-js.js","mappings":"4RAQO,MAAMA,GAAgB,QAAiB,4BAExCC,EAAc,CAClB,aACA,WACA,OACA,aACA,iBACA,uBACA,2CACA,eACA,qBACA,yCACA,wBACA,6BACA,iCAGIC,EAAkB,CAAC,QAAS,aAClC,MAAMC,WAAkC,EAAAC,EAAA,GAAgB,CAAEJ,gBAAeK,aAAc,SACrF,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2BAIhD,QACE,iJAUAH,KAEJ,CAEA,SAAII,GACF,OAAOC,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,IAAKjD,EAAOlD,SAAU,UACtB,IAAKyD,EAAezD,SAAU,WAEhCoG,uBAAwB,CACtB,IAAKlD,EAAOlD,SAAU,iBACtB,IAAKyD,EAAezD,SAAU,kBAGhCqG,gBAAiB,CACf,IAAK7C,EAAWxD,SAAU,gBAC1B,IAAKwD,EAAWxD,SAAU,gBAE5BsG,cAAe,IAAK9C,EAAWxD,SAAU,aACzCuG,eAAgB,IAAK/C,EAAWxD,SAAU,SAC1CwG,kBAAmB,CACjB,IAAKtD,EAAOlD,SAAU,yBACtB,IAAKkD,EAAOlD,SAAU,iBACtB,IAAKyD,EAAezD,SAAU,yBAC9B,IAAKyD,EAAezD,SAAU,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js","webpack://@descope/web-components-ui/./src/components/descope-security-questions-setup/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js"],"sourcesContent":["import { ComboBoxClass } from '@descope-ui/descope-combo-box/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeAttributes } from '../../helpers/componentHelpers';\nimport { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../mixins';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\n\nexport const componentName = getComponentName('security-questions-setup');\n\nconst attrsToSync = [\n 'full-width',\n 'readonly',\n 'size',\n 'label-type',\n 'question-label',\n 'question-placeholder',\n 'question-data-errormessage-value-missing',\n 'answer-label',\n 'answer-placeholder',\n 'answer-data-errormessage-value-missing',\n 'st-error-message-icon',\n 'st-error-message-icon-size',\n 'st-error-message-icon-padding',\n];\n\nconst attrsToReRender = ['count', 'questions'];\nclass RawSecurityQuestionsSetup 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 count() {\n return Number(this.getAttribute('count')) || 0;\n }\n\n #renderQuestions() {\n const res = Array.from({ length: this.count }).map(\n (_, index) =>\n // <!--html-->\n `\n <div class=\"question-wrapper\">\n <descope-combo-box\n data-id=\"${index}\"\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=\"${index}\"\n required=\"true\"\n bordered=\"true\"\n minlength=\"2\"\n ></descope-text-field>\n </div>\n `\n // <!--!html-->\n );\n\n this.baseElement.innerHTML = res.join(\n '<spacer></spacer><descope-divider></descope-divider><spacer></spacer>'\n );\n\n this.comboBoxes.forEach((el) => {\n el.addEventListener('change', (e) => {\n this.updateRemainingCombosData(e.target);\n const AttachedTextField = this.getAttachedTextField(e.target);\n\n AttachedTextField.value = '';\n });\n\n el.data = this.data;\n });\n\n this.#syncAttrs(attrsToSync);\n }\n\n getAttachedTextField(combo) {\n const selector = `descope-text-field[data-id=\"${combo.getAttribute('data-id')}\"]`;\n\n return this.baseElement.querySelector(selector);\n }\n\n filterData(comboValue) {\n const res = this.data.filter(\n (item) => item.value === comboValue || !this.selectedQuestionIds.includes(item.value)\n );\n\n return res;\n }\n\n reportValidity() {\n this.inputs.reverse().forEach((el) => el.reportValidity());\n\n return this.checkValidity();\n }\n\n checkValidity() {\n return [...this.comboBoxes, ...this.textFields].every((el) => el.checkValidity());\n }\n\n updateRemainingCombosData(sourceCombo) {\n this.comboBoxes\n .filter((combo) => combo !== sourceCombo)\n .forEach((combo) => {\n combo.data = this.filterData(combo.value);\n });\n }\n\n get questions() {\n try {\n return JSON.parse(this.getAttribute('questions')) || [];\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(componentName, 'Error parsing questions attribute', e);\n return [];\n }\n }\n\n // this returns the structure expected by the combo box\n get data() {\n return this.questions.map(({ id, text }) => ({ value: id, label: text }));\n }\n\n get comboBoxes() {\n return Array.from(this.baseElement.querySelectorAll('descope-combo-box'));\n }\n\n get textFields() {\n return Array.from(this.baseElement.querySelectorAll('descope-text-field'));\n }\n\n get inputs() {\n return Array.from(this.baseElement.querySelectorAll('descope-combo-box, descope-text-field'));\n }\n\n get selectedQuestionIds() {\n return this.comboBoxes.map((el) => el.value);\n }\n\n get value() {\n return this.comboBoxes.map((combo) => {\n const id = combo.value;\n const answer = this.getAttachedTextField(combo).value;\n\n return { id, answer };\n });\n }\n\n set value(val = []) {\n val.forEach((item, index) => {\n const combo = this.comboBoxes[index];\n const textField = this.getAttachedTextField(combo);\n\n combo.value = item.id;\n textField.value = item.answer;\n });\n }\n\n #updateAttribute(ele, attrName, value) {\n if (value === null) ele.removeAttribute(attrName);\n else ele.setAttribute(attrName, value);\n }\n\n #syncAttrs(attrs) {\n const componentMap = {\n question: this.comboBoxes,\n answer: this.textFields,\n };\n\n attrs.forEach((attr) => {\n const [maybeComponentType, ...rest] = attr.split('-');\n const elements = componentMap[maybeComponentType] || this.inputs;\n const attrName = componentMap[maybeComponentType] ? rest.join('-') : attr;\n\n elements.forEach((el) => {\n this.#updateAttribute(el, attrName, this.getAttribute(attr));\n });\n });\n }\n\n init() {\n super.init?.();\n // render new components\n observeAttributes(\n this,\n () => {\n this.#renderQuestions();\n },\n { includeAttrs: attrsToReRender }\n );\n\n // update existing components\n observeAttributes(this, this.#syncAttrs.bind(this), {\n includeAttrs: attrsToSync,\n });\n }\n}\n\nexport const SecurityQuestionsSetupClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: [{ selector: () => ':host', property: 'width' }, { property: 'width' }],\n hostDirection: [\n { selector: () => ':host', property: 'direction' },\n {\n selector: () => ComboBoxClass.componentName,\n property: ComboBoxClass.cssVarList.hostDirection,\n },\n {\n selector: () => TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.hostDirection,\n },\n ],\n gap: { selector: () => 'div', property: 'gap' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawSecurityQuestionsSetup);\n","import { componentName, SecurityQuestionsSetupClass } from './SecurityQuestionsSetupClass';\nimport '../descope-text-field';\nimport '@descope-ui/descope-combo-box';\n\ncustomElements.define(componentName, SecurityQuestionsSetupClass);\n\nexport { SecurityQuestionsSetupClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n 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(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\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 ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, 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","attrsToSync","attrsToReRender","RawSecurityQuestionsSetup","createBaseClass","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","count","Number","getAttribute","res","Array","from","length","map","_","index","baseElement","join","comboBoxes","forEach","el","addEventListener","e","updateRemainingCombosData","target","getAttachedTextField","value","data","combo","selector","querySelector","filterData","comboValue","filter","item","selectedQuestionIds","includes","reportValidity","inputs","reverse","checkValidity","textFields","every","sourceCombo","questions","JSON","parse","console","error","id","text","label","querySelectorAll","answer","val","textField","ele","attrName","removeAttribute","setAttribute","attrs","componentMap","question","attr","maybeComponentType","rest","split","elements","init","includeAttrs","bind","SecurityQuestionsSetupClass","mappings","hostWidth","property","hostDirection","ComboBoxClass","C","cssVarList","TextFieldClass","gap","customElements","define","observedAttrs","proxyProps","useProxyTargets","superclass","observedAttributes","concat","icon","renderCopyToClipboard","shouldRender","remove","iconInitConfig","title","style","iconCopiedConfig","Object","assign","document","createElement","slot","appendChild","navigator","clipboard","writeText","setTimeout","onLabelClick","focus","attributeChangedCallback","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","inputOutlineWidth","inputOutlineOffset","excludeAttrsSync","host","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","fontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","hostMinWidth","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-security-questions-setup-index-js.js","mappings":"4RAQO,MAAMA,GAAgB,QAAiB,4BAExCC,EAAc,CAClB,aACA,WACA,OACA,aACA,iBACA,uBACA,2CACA,eACA,qBACA,yCACA,wBACA,6BACA,iCAGIC,EAAkB,CAAC,QAAS,aAClC,MAAMC,WAAkC,EAAAC,EAAA,GAAgB,CAAEJ,gBAAeK,aAAc,SACrF,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2BAIhD,QACE,iJAUAH,KAEJ,CAEA,SAAII,GACF,OAAOC,OAAOL,KAAKM,aAAa,WAAa,CAC/C,CAEA,KACE,MAAMC,EAAMC,MAAMC,KAAK,CAAEC,OAAQV,KAAKI,QAASO,IAC7C,CA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,SAAU,WACnD,IAAK2D,EAAqB3D,SAAU,YAEtCsG,uBAAwB,CACtB,IAAKrD,EAAYjD,SAAU,eAC3B,IAAKyD,EAAezD,SAAU,gBAEhCuG,iBAAkB,CAChB,IAAKrD,EAAOlD,SAAU,UACtB,IAAKyD,EAAezD,SAAU,WAEhCwG,uBAAwB,CACtB,IAAKtD,EAAOlD,SAAU,iBACtB,IAAKyD,EAAezD,SAAU,kBAGhCyG,gBAAiB,CACf,IAAKjD,EAAWxD,SAAU,gBAC1B,IAAKwD,EAAWxD,SAAU,gBAE5B0G,cAAe,IAAKlD,EAAWxD,SAAU,aACzC2G,eAAgB,IAAKnD,EAAWxD,SAAU,SAC1C4G,kBAAmB,CACjB,IAAK1D,EAAOlD,SAAU,yBACtB,IAAKkD,EAAOlD,SAAU,iBACtB,IAAKyD,EAAezD,SAAU,yBAC9B,IAAKyD,EAAezD,SAAU,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js","webpack://@descope/web-components-ui/./src/components/descope-security-questions-setup/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js"],"sourcesContent":["import { ComboBoxClass } from '@descope-ui/descope-combo-box/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeAttributes } from '../../helpers/componentHelpers';\nimport { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../mixins';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\n\nexport const componentName = getComponentName('security-questions-setup');\n\nconst attrsToSync = [\n 'full-width',\n 'readonly',\n 'size',\n 'label-type',\n 'question-label',\n 'question-placeholder',\n 'question-data-errormessage-value-missing',\n 'answer-label',\n 'answer-placeholder',\n 'answer-data-errormessage-value-missing',\n 'st-error-message-icon',\n 'st-error-message-icon-size',\n 'st-error-message-icon-padding',\n];\n\nconst attrsToReRender = ['count', 'questions'];\nclass RawSecurityQuestionsSetup 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 count() {\n return Number(this.getAttribute('count')) || 0;\n }\n\n #renderQuestions() {\n const res = Array.from({ length: this.count }).map(\n (_, index) =>\n // <!--html-->\n `\n <div class=\"question-wrapper\">\n <descope-combo-box\n data-id=\"${index}\"\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=\"${index}\"\n required=\"true\"\n bordered=\"true\"\n minlength=\"2\"\n ></descope-text-field>\n </div>\n `\n // <!--!html-->\n );\n\n this.baseElement.innerHTML = res.join(\n '<spacer></spacer><descope-divider></descope-divider><spacer></spacer>'\n );\n\n this.comboBoxes.forEach((el) => {\n el.addEventListener('change', (e) => {\n this.updateRemainingCombosData(e.target);\n const AttachedTextField = this.getAttachedTextField(e.target);\n\n AttachedTextField.value = '';\n });\n\n el.data = this.data;\n });\n\n this.#syncAttrs(attrsToSync);\n }\n\n getAttachedTextField(combo) {\n const selector = `descope-text-field[data-id=\"${combo.getAttribute('data-id')}\"]`;\n\n return this.baseElement.querySelector(selector);\n }\n\n filterData(comboValue) {\n const res = this.data.filter(\n (item) => item.value === comboValue || !this.selectedQuestionIds.includes(item.value)\n );\n\n return res;\n }\n\n reportValidity() {\n this.inputs.reverse().forEach((el) => el.reportValidity());\n\n return this.checkValidity();\n }\n\n checkValidity() {\n return [...this.comboBoxes, ...this.textFields].every((el) => el.checkValidity());\n }\n\n updateRemainingCombosData(sourceCombo) {\n this.comboBoxes\n .filter((combo) => combo !== sourceCombo)\n .forEach((combo) => {\n combo.data = this.filterData(combo.value);\n });\n }\n\n get questions() {\n try {\n return JSON.parse(this.getAttribute('questions')) || [];\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(componentName, 'Error parsing questions attribute', e);\n return [];\n }\n }\n\n // this returns the structure expected by the combo box\n get data() {\n return this.questions.map(({ id, text }) => ({ value: id, label: text }));\n }\n\n get comboBoxes() {\n return Array.from(this.baseElement.querySelectorAll('descope-combo-box'));\n }\n\n get textFields() {\n return Array.from(this.baseElement.querySelectorAll('descope-text-field'));\n }\n\n get inputs() {\n return Array.from(this.baseElement.querySelectorAll('descope-combo-box, descope-text-field'));\n }\n\n get selectedQuestionIds() {\n return this.comboBoxes.map((el) => el.value);\n }\n\n get value() {\n return this.comboBoxes.map((combo) => {\n const id = combo.value;\n const answer = this.getAttachedTextField(combo).value;\n\n return { id, answer };\n });\n }\n\n set value(val = []) {\n val.forEach((item, index) => {\n const combo = this.comboBoxes[index];\n const textField = this.getAttachedTextField(combo);\n\n combo.value = item.id;\n textField.value = item.answer;\n });\n }\n\n #updateAttribute(ele, attrName, value) {\n if (value === null) ele.removeAttribute(attrName);\n else ele.setAttribute(attrName, value);\n }\n\n #syncAttrs(attrs) {\n const componentMap = {\n question: this.comboBoxes,\n answer: this.textFields,\n };\n\n attrs.forEach((attr) => {\n const [maybeComponentType, ...rest] = attr.split('-');\n const elements = componentMap[maybeComponentType] || this.inputs;\n const attrName = componentMap[maybeComponentType] ? rest.join('-') : attr;\n\n elements.forEach((el) => {\n this.#updateAttribute(el, attrName, this.getAttribute(attr));\n });\n });\n }\n\n init() {\n super.init?.();\n // render new components\n observeAttributes(\n this,\n () => {\n this.#renderQuestions();\n },\n { includeAttrs: attrsToReRender }\n );\n\n // update existing components\n observeAttributes(this, this.#syncAttrs.bind(this), {\n includeAttrs: attrsToSync,\n });\n }\n}\n\nexport const SecurityQuestionsSetupClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: [{ selector: () => ':host', property: 'width' }, { property: 'width' }],\n hostDirection: [\n { selector: () => ':host', property: 'direction' },\n {\n selector: () => ComboBoxClass.componentName,\n property: ComboBoxClass.cssVarList.hostDirection,\n },\n {\n selector: () => TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.hostDirection,\n },\n ],\n gap: { selector: () => 'div', property: 'gap' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawSecurityQuestionsSetup);\n","import { componentName, SecurityQuestionsSetupClass } from './SecurityQuestionsSetupClass';\nimport '../descope-text-field';\nimport '@descope-ui/descope-combo-box';\n\ncustomElements.define(componentName, SecurityQuestionsSetupClass);\n\nexport { SecurityQuestionsSetupClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n 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(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\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 ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, 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 inputValueFontWeight: [\n { ...input, property: 'font-weight' },\n { ...externalInput, property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { selector: () => ':host input:placeholder-shown', property: 'font-weight' },\n { ...externalPlaceholder, property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, 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","attrsToSync","attrsToReRender","RawSecurityQuestionsSetup","createBaseClass","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","count","Number","getAttribute","res","Array","from","length","map","_","index","baseElement","join","comboBoxes","forEach","el","addEventListener","e","updateRemainingCombosData","target","getAttachedTextField","value","data","combo","selector","querySelector","filterData","comboValue","filter","item","selectedQuestionIds","includes","reportValidity","inputs","reverse","checkValidity","textFields","every","sourceCombo","questions","JSON","parse","console","error","id","text","label","querySelectorAll","answer","val","textField","ele","attrName","removeAttribute","setAttribute","attrs","componentMap","question","attr","maybeComponentType","rest","split","elements","init","includeAttrs","bind","SecurityQuestionsSetupClass","mappings","hostWidth","property","hostDirection","ComboBoxClass","C","cssVarList","TextFieldClass","gap","customElements","define","observedAttrs","proxyProps","useProxyTargets","superclass","observedAttributes","concat","icon","renderCopyToClipboard","shouldRender","remove","iconInitConfig","title","style","iconCopiedConfig","Object","assign","document","createElement","slot","appendChild","navigator","clipboard","writeText","setTimeout","onLabelClick","focus","attributeChangedCallback","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","inputOutlineWidth","inputOutlineOffset","excludeAttrsSync","host","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","fontSize","fontFamily","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","hostMinWidth","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see descope-security-questions-verify-index-js.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4838,5166,9446],{66434(e,t,r){r.d(t,{T:()=>a,s:()=>d});var o=r(88961),i=r(63200),s=r(25964),n=r(72270);const a=(0,s.xE)("text");class l extends((0,n.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,()=>{const e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""})}}const{host:p}={host:{selector:()=>":host"}},d=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(l)},63595(e,t,r){r.r(t),r.d(t,{TextClass:()=>o.s,componentName:()=>o.T});var o=r(66434);customElements.define(o.T,o.s)},38479(e,t,r){r.r(t),r.d(t,{SecurityQuestionsVerifyClass:()=>b,componentName:()=>d});var o=r(66434),i=r(25964),s=r(81365),n=r(9696),a=r(97810),l=r(79365),p=r(79275);const d=(0,a.xE)("security-questions-verify"),c=["full-width","readonly","size","answer-placeholder","answer-data-errormessage-value-missing","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"],u=["question-mode"],h={"answer-placeholder":"placeholder","answer-data-errormessage-value-missing":"data-errormessage-value-missing","question-mode":"mode"},y=[...c,...u],g=["questions"];class m extends((0,s.q)({componentName:d,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)}#e(){const e=this.questions.map(({id:e,text:t})=>`\n <div class="question-wrapper">\n <descope-text\n data-id="${e}"\n >${t}</descope-text>\n\n <descope-text-field\n data-id="${e}"\n required="true"\n bordered="true"\n ></descope-text-field>\n </div>\n `);this.baseElement.innerHTML=e.join("<spacer></spacer><descope-divider></descope-divider><spacer></spacer>"),this.#t(y),this.texts.forEach(e=>{const t=this.textFields.find(t=>t.getAttribute("data-id")===e.getAttribute("data-id"));t&&(e.onclick=t.focus.bind(t))})}reportValidity(){return this.textFields.reverse().forEach(e=>e.reportValidity()),this.checkValidity()}checkValidity(){return this.textFields.every(e=>e.checkValidity())}get questions(){try{return JSON.parse(this.getAttribute("questions"))||[]}catch(e){return console.error(d,"Error parsing questions attribute",e),[]}}get texts(){return Array.from(this.baseElement.querySelectorAll("descope-text"))}get textFields(){return Array.from(this.baseElement.querySelectorAll("descope-text-field"))}get elements(){return Array.from(this.baseElement.querySelectorAll("descope-text, descope-text-field"))}get value(){return this.textFields.map(e=>({id:e.getAttribute("data-id"),answer:e.value}))}set value(e=[]){e.forEach(({id:e,answer:t})=>{const r=this.textFields.find(t=>t.getAttribute("data-id")===e);r&&(r.value=t)})}#r(e,t,r){null===r?e.removeAttribute(t):e.setAttribute(t,r)}#o(e){switch(!0){case c.includes(e):return this.textFields;case u.includes(e):return this.texts;default:return[]}}#t(e){e.forEach(e=>{this.#o(e).forEach(t=>{this.#r(t,h[e]||e,this.getAttribute(e))})})}init(){super.init?.(),(0,a.mx)(this,()=>{this.#e()},{includeAttrs:g}),(0,a.mx)(this,this.#t.bind(this),{includeAttrs:y})}}const b=(0,n.Zz)((0,l.RF)({componentNameOverride:(0,a.xE)("input-wrapper")}),(0,l.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"},{property:"width"}],hostDirection:[{selector:()=>":host",property:"direction"},{selector:()=>o.s.componentName,property:o.s.cssVarList.hostDirection},{selector:()=>p.w.componentName,property:p.w.cssVarList.hostDirection}],gap:{selector:()=>"div",property:"gap"},questionTextAlign:{selector:()=>o.s.componentName,property:o.s.cssVarList.textAlign},questionFontSize:{selector:()=>o.s.componentName,property:o.s.cssVarList.fontSize},questionFontFamily:{selector:()=>o.s.componentName,property:o.s.cssVarList.fontFamily},questionCursor:{selector:()=>o.s.componentName,property:"cursor"},errorMessageIcon:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageSize},errorMessageIconPadding:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessagePadding},errorMessageIconRepeat:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageRepeat},errorMessageIconPosition:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessagePosition},errorMessageFontSize:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageFontSize}}}),l.VO,l.tQ)(m);r(63595),r(21374),customElements.define(d,b)},79275(e,t,r){r.d(t,{T:()=>l,w:()=>d});var o=r(79365),i=r(6424),s=r(9696),n=r(97810),a=r(73551);const l=(0,n.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,s.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(${d.cssVarList.inputOutlineWidth}) + var(${d.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,a.$J)("vaadin-text-field")}\n\t\t\t${(0,a.cy)(d.cssVarList)}\n\t\t\t${(0,a.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,a.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:l}))},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:s,requiredIndicator:n,inputField:a,input:l,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:g,externalInputDisabled:m,externalPlaceholder:b,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,a,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...n,property:"color"},{...i,property:"-webkit-text-fill-color"},{...n,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...l,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...h,property:"-webkit-text-fill-color"},{...m,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...l,property:"caret-color"},{...g,property:"caret-color"}],labelRequiredIndicator:{...n,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"},{...g,property:"padding-left"},{...g,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...l,property:"text-align"},{...g,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...b,property:"color"},{...s,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"},{...b,property:"opacity"}],inputVerticalAlignment:[{...a,property:"align-items"},{...g,property:"align-items"}],valueInputHeight:[{...l,property:"height"},{...g,property:"height"}],valueInputMarginBottom:[{...l,property:"margin-bottom"},{...g,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"},inputTextSecurity:[{...l,property:"-webkit-text-security"},{...l,property:"text-security"},{...g,property:"-webkit-text-security"},{...g,property:"text-security"}]}},18330(e,t,r){r.d(t,{f:()=>i});var o=r(44099);class i extends o.r{constructor(e,t){super(e,"input","input",{initializer:(e,r)=>{r.value&&(e.value=r.value),r.type&&e.setAttribute("type",r.type),e.id=this.defaultId,"function"==typeof t&&t(e)},useUniqueId:!0})}}},37436(e,t,r){r.d(t,{a:()=>i});var o=r(44218);const i=e=>class extends((0,o.R)(e)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(e){this.__dataValue=e}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.value&&e.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),e.value=""),this.value&&(e.value=this.value))}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this.validate()}_onInput(e){super._onInput(e),this.invalid&&this.validate()}_valueChanged(e,t){super._valueChanged(e,t),void 0!==t&&this.invalid&&this.validate()}}},27136(e,t,r){r.d(t,{A:()=>h}),r(86689);var o=r(13256),i=r(82901),s=r(72562),n=r(81488),a=r(86314),l=r(87550),p=r(18330),d=r(37436),c=r(37720);const u=e=>class extends((0,d.a)(e)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new p.f(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e})),this.addController(new c.q(this.inputElement,this._labelController))}};(0,l.SF)("vaadin-text-field",a.k,{moduleId:"vaadin-text-field-styles"});class h extends(u((0,l.cp)((0,s.q)(o.Pu)))){static get is(){return"vaadin-text-field"}static get template(){return o.qy`
|
|
2
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4838,5166,9446],{66434(e,t,r){r.d(t,{T:()=>a,s:()=>d});var o=r(88961),i=r(63200),s=r(25964),n=r(72270);const a=(0,s.xE)("text");class l extends((0,n.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,()=>{const e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""})}}const{host:p}={host:{selector:()=>":host"}},d=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(l)},63595(e,t,r){r.r(t),r.d(t,{TextClass:()=>o.s,componentName:()=>o.T});var o=r(66434);customElements.define(o.T,o.s)},38479(e,t,r){r.r(t),r.d(t,{SecurityQuestionsVerifyClass:()=>b,componentName:()=>d});var o=r(66434),i=r(25964),s=r(81365),n=r(9696),a=r(97810),l=r(79365),p=r(79275);const d=(0,a.xE)("security-questions-verify"),c=["full-width","readonly","size","answer-placeholder","answer-data-errormessage-value-missing","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"],u=["question-mode"],h={"answer-placeholder":"placeholder","answer-data-errormessage-value-missing":"data-errormessage-value-missing","question-mode":"mode"},y=[...c,...u],g=["questions"];class m extends((0,s.q)({componentName:d,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)}#e(){const e=this.questions.map(({id:e,text:t})=>`\n <div class="question-wrapper">\n <descope-text\n data-id="${e}"\n >${t}</descope-text>\n\n <descope-text-field\n data-id="${e}"\n required="true"\n bordered="true"\n ></descope-text-field>\n </div>\n `);this.baseElement.innerHTML=e.join("<spacer></spacer><descope-divider></descope-divider><spacer></spacer>"),this.#t(y),this.texts.forEach(e=>{const t=this.textFields.find(t=>t.getAttribute("data-id")===e.getAttribute("data-id"));t&&(e.onclick=t.focus.bind(t))})}reportValidity(){return this.textFields.reverse().forEach(e=>e.reportValidity()),this.checkValidity()}checkValidity(){return this.textFields.every(e=>e.checkValidity())}get questions(){try{return JSON.parse(this.getAttribute("questions"))||[]}catch(e){return console.error(d,"Error parsing questions attribute",e),[]}}get texts(){return Array.from(this.baseElement.querySelectorAll("descope-text"))}get textFields(){return Array.from(this.baseElement.querySelectorAll("descope-text-field"))}get elements(){return Array.from(this.baseElement.querySelectorAll("descope-text, descope-text-field"))}get value(){return this.textFields.map(e=>({id:e.getAttribute("data-id"),answer:e.value}))}set value(e=[]){e.forEach(({id:e,answer:t})=>{const r=this.textFields.find(t=>t.getAttribute("data-id")===e);r&&(r.value=t)})}#r(e,t,r){null===r?e.removeAttribute(t):e.setAttribute(t,r)}#o(e){switch(!0){case c.includes(e):return this.textFields;case u.includes(e):return this.texts;default:return[]}}#t(e){e.forEach(e=>{this.#o(e).forEach(t=>{this.#r(t,h[e]||e,this.getAttribute(e))})})}init(){super.init?.(),(0,a.mx)(this,()=>{this.#e()},{includeAttrs:g}),(0,a.mx)(this,this.#t.bind(this),{includeAttrs:y})}}const b=(0,n.Zz)((0,l.RF)({componentNameOverride:(0,a.xE)("input-wrapper")}),(0,l.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"},{property:"width"}],hostDirection:[{selector:()=>":host",property:"direction"},{selector:()=>o.s.componentName,property:o.s.cssVarList.hostDirection},{selector:()=>p.w.componentName,property:p.w.cssVarList.hostDirection}],gap:{selector:()=>"div",property:"gap"},questionTextAlign:{selector:()=>o.s.componentName,property:o.s.cssVarList.textAlign},questionFontSize:{selector:()=>o.s.componentName,property:o.s.cssVarList.fontSize},questionFontFamily:{selector:()=>o.s.componentName,property:o.s.cssVarList.fontFamily},questionCursor:{selector:()=>o.s.componentName,property:"cursor"},errorMessageIcon:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageSize},errorMessageIconPadding:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessagePadding},errorMessageIconRepeat:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageRepeat},errorMessageIconPosition:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessagePosition},errorMessageFontSize:{selector:()=>o.s.componentName,property:o.s.cssVarList.errorMessageFontSize}}}),l.VO,l.tQ)(m);r(63595),r(21374),customElements.define(d,b)},79275(e,t,r){r.d(t,{T:()=>l,w:()=>d});var o=r(79365),i=r(6424),s=r(9696),n=r(97810),a=r(73551);const l=(0,n.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,s.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(${d.cssVarList.inputOutlineWidth}) + var(${d.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,a.$J)("vaadin-text-field")}\n\t\t\t${(0,a.cy)(d.cssVarList)}\n\t\t\t${(0,a.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,a.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:l}))},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:()=>x});const{host:o,label:i,placeholder:s,requiredIndicator:n,inputField:a,input:l,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:g,externalInputDisabled:m,externalPlaceholder:b,externalDisabledPlaceholder:f}={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)"}},x={fontSize:[{},o],fontFamily:[i,a,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},inputValueFontWeight:[{...l,property:"font-weight"},{...g,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...b,property:"font-weight"}],helperTextFontWeight:{...d,property:"font-weight"},errorMessageFontWeight:{...c,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...n,property:"color"},{...i,property:"-webkit-text-fill-color"},{...n,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...l,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...h,property:"-webkit-text-fill-color"},{...m,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...l,property:"caret-color"},{...g,property:"caret-color"}],labelRequiredIndicator:{...n,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"},{...g,property:"padding-left"},{...g,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...l,property:"text-align"},{...g,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...b,property:"color"},{...s,property:"color"},{...u,property:"-webkit-text-fill-color"},{...f,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"},{...b,property:"opacity"}],inputVerticalAlignment:[{...a,property:"align-items"},{...g,property:"align-items"}],valueInputHeight:[{...l,property:"height"},{...g,property:"height"}],valueInputMarginBottom:[{...l,property:"margin-bottom"},{...g,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"},inputTextSecurity:[{...l,property:"-webkit-text-security"},{...l,property:"text-security"},{...g,property:"-webkit-text-security"},{...g,property:"text-security"}]}},18330(e,t,r){r.d(t,{f:()=>i});var o=r(44099);class i extends o.r{constructor(e,t){super(e,"input","input",{initializer:(e,r)=>{r.value&&(e.value=r.value),r.type&&e.setAttribute("type",r.type),e.id=this.defaultId,"function"==typeof t&&t(e)},useUniqueId:!0})}}},37436(e,t,r){r.d(t,{a:()=>i});var o=r(44218);const i=e=>class extends((0,o.R)(e)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(e){this.__dataValue=e}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.value&&e.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),e.value=""),this.value&&(e.value=this.value))}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this.validate()}_onInput(e){super._onInput(e),this.invalid&&this.validate()}_valueChanged(e,t){super._valueChanged(e,t),void 0!==t&&this.invalid&&this.validate()}}},27136(e,t,r){r.d(t,{A:()=>h}),r(86689);var o=r(13256),i=r(82901),s=r(72562),n=r(81488),a=r(86314),l=r(87550),p=r(18330),d=r(37436),c=r(37720);const u=e=>class extends((0,d.a)(e)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new p.f(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e})),this.addController(new c.q(this.inputElement,this._labelController))}};(0,l.SF)("vaadin-text-field",a.k,{moduleId:"vaadin-text-field-styles"});class h extends(u((0,l.cp)((0,s.q)(o.Pu)))){static get is(){return"vaadin-text-field"}static get template(){return o.qy`
|
|
3
3
|
<style>
|
|
4
4
|
[part='input-field'] {
|
|
5
5
|
flex-grow: 0;
|