@descope/web-components-ui 0.0.1
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/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/cjs/index.cjs.js +18314 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.esm.js +20157 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/umd/1172.js +240 -0
- package/dist/umd/1172.js.LICENSE.txt +23 -0
- package/dist/umd/1396.js +37 -0
- package/dist/umd/1396.js.LICENSE.txt +11 -0
- package/dist/umd/1402.js +1 -0
- package/dist/umd/1484.js +148 -0
- package/dist/umd/1484.js.LICENSE.txt +17 -0
- package/dist/umd/189.js +338 -0
- package/dist/umd/189.js.LICENSE.txt +11 -0
- package/dist/umd/201.js +73 -0
- package/dist/umd/201.js.LICENSE.txt +23 -0
- package/dist/umd/2159.js +608 -0
- package/dist/umd/2159.js.LICENSE.txt +23 -0
- package/dist/umd/2540.js +1 -0
- package/dist/umd/2570.js +338 -0
- package/dist/umd/2570.js.LICENSE.txt +11 -0
- package/dist/umd/2666.js +148 -0
- package/dist/umd/2666.js.LICENSE.txt +11 -0
- package/dist/umd/2755.js +1 -0
- package/dist/umd/3110.js +275 -0
- package/dist/umd/3110.js.LICENSE.txt +23 -0
- package/dist/umd/3191.js +506 -0
- package/dist/umd/3191.js.LICENSE.txt +17 -0
- package/dist/umd/3437.js +2 -0
- package/dist/umd/3437.js.LICENSE.txt +15 -0
- package/dist/umd/3638.js +2 -0
- package/dist/umd/3638.js.LICENSE.txt +5 -0
- package/dist/umd/404.js +148 -0
- package/dist/umd/404.js.LICENSE.txt +17 -0
- package/dist/umd/4114.js +124 -0
- package/dist/umd/4114.js.LICENSE.txt +33 -0
- package/dist/umd/4127.js +449 -0
- package/dist/umd/4127.js.LICENSE.txt +17 -0
- package/dist/umd/4187.js +2 -0
- package/dist/umd/4187.js.LICENSE.txt +5 -0
- package/dist/umd/4218.js +129 -0
- package/dist/umd/4218.js.LICENSE.txt +23 -0
- package/dist/umd/4455.js +422 -0
- package/dist/umd/4455.js.LICENSE.txt +11 -0
- package/dist/umd/4480.js +1 -0
- package/dist/umd/4554.js +303 -0
- package/dist/umd/4554.js.LICENSE.txt +11 -0
- package/dist/umd/4574.js +400 -0
- package/dist/umd/4574.js.LICENSE.txt +23 -0
- package/dist/umd/4619.js +1 -0
- package/dist/umd/4902.js +170 -0
- package/dist/umd/4902.js.LICENSE.txt +23 -0
- package/dist/umd/507.js +279 -0
- package/dist/umd/507.js.LICENSE.txt +11 -0
- package/dist/umd/5096.js +109 -0
- package/dist/umd/5096.js.LICENSE.txt +5 -0
- package/dist/umd/5318.js +1 -0
- package/dist/umd/5414.js +2 -0
- package/dist/umd/5414.js.LICENSE.txt +1 -0
- package/dist/umd/5563.js +319 -0
- package/dist/umd/5563.js.LICENSE.txt +55 -0
- package/dist/umd/7097.js +338 -0
- package/dist/umd/7097.js.LICENSE.txt +11 -0
- package/dist/umd/7150.js +2 -0
- package/dist/umd/7150.js.LICENSE.txt +485 -0
- package/dist/umd/731.js +832 -0
- package/dist/umd/731.js.LICENSE.txt +17 -0
- package/dist/umd/742.js +2 -0
- package/dist/umd/742.js.LICENSE.txt +21 -0
- package/dist/umd/7979.js +419 -0
- package/dist/umd/7979.js.LICENSE.txt +11 -0
- package/dist/umd/8823.js +1 -0
- package/dist/umd/9030.js +381 -0
- package/dist/umd/9030.js.LICENSE.txt +17 -0
- package/dist/umd/9243.js +202 -0
- package/dist/umd/9243.js.LICENSE.txt +51 -0
- package/dist/umd/9478.js +338 -0
- package/dist/umd/9478.js.LICENSE.txt +11 -0
- package/dist/umd/DescopeDev.js +1 -0
- package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -0
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +2 -0
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +2 -0
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -0
- package/dist/umd/descope-alert-index-js.js +1 -0
- package/dist/umd/descope-apps-list-index-js.js +1 -0
- package/dist/umd/descope-avatar.js +1 -0
- package/dist/umd/descope-badge-index-js.js +1 -0
- package/dist/umd/descope-button-index-js.js +338 -0
- package/dist/umd/descope-button-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-code-snippet-index-js.js +1 -0
- package/dist/umd/descope-combo-box-index-js.js +113 -0
- package/dist/umd/descope-combo-box-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-container-index-js.js +1 -0
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -0
- package/dist/umd/descope-date-field-index-js.js +1 -0
- package/dist/umd/descope-divider-index-js.js +1 -0
- package/dist/umd/descope-email-field-index-js.js +54 -0
- package/dist/umd/descope-email-field-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-enriched-text-index-js.js +1 -0
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +90 -0
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js.LICENSE.txt +17 -0
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +105 -0
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +29 -0
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +2 -0
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.LICENSE.txt +17 -0
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +90 -0
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.LICENSE.txt +17 -0
- package/dist/umd/descope-grid-index-js.js +1 -0
- package/dist/umd/descope-hybrid-field-index-js.js +19 -0
- package/dist/umd/descope-hybrid-field-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/descope-icon-index-js.js +1 -0
- package/dist/umd/descope-image-index-js.js +1 -0
- package/dist/umd/descope-link-index-js.js +1 -0
- package/dist/umd/descope-list-index-js.js +1 -0
- package/dist/umd/descope-loader-linear-index-js.js +1 -0
- package/dist/umd/descope-loader-radial-index-js.js +1 -0
- package/dist/umd/descope-logo-index-js.js +1 -0
- package/dist/umd/descope-modal-index-js.js +1 -0
- package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -0
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -0
- package/dist/umd/descope-new-password-index-js.js +1 -0
- package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -0
- package/dist/umd/descope-notification-index-js.js +1 -0
- package/dist/umd/descope-notp-image-index-js.js +1 -0
- package/dist/umd/descope-number-field-index-js.js +1 -0
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -0
- package/dist/umd/descope-passcode-index-js.js +1 -0
- package/dist/umd/descope-password-index-js.js +1 -0
- package/dist/umd/descope-policy-validation-index-js.js +1 -0
- package/dist/umd/descope-radio-group-index-js.js +1 -0
- package/dist/umd/descope-recaptcha-index-js.js +1 -0
- package/dist/umd/descope-scopes-list-index-js.js +2 -0
- package/dist/umd/descope-scopes-list-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/descope-security-questions-setup-index-js.js +1 -0
- package/dist/umd/descope-security-questions-verify-index-js.js +37 -0
- package/dist/umd/descope-security-questions-verify-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-text-area-index-js.js +1 -0
- package/dist/umd/descope-text-field-index-js.js +37 -0
- package/dist/umd/descope-text-field-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-text.js +1 -0
- package/dist/umd/descope-third-party-app-logo-index-js.js +1 -0
- package/dist/umd/descope-totp-image-index-js.js +1 -0
- package/dist/umd/descope-upload-file-index-js.js +1 -0
- package/dist/umd/descope-user-attribute-index-js.js +1 -0
- package/dist/umd/descope-user-auth-method-index-js.js +1 -0
- package/dist/umd/index.js +1 -0
- package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -0
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -0
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +37 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +148 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt +17 -0
- package/node_modules/common/.eslintrc.json +18 -0
- package/node_modules/common/README.md +7 -0
- package/node_modules/common/package.json +34 -0
- package/node_modules/common/project.json +7 -0
- package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +66 -0
- package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +14 -0
- package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +55 -0
- package/node_modules/common/src/baseClasses/index.js +3 -0
- package/node_modules/common/src/componentsHelpers/index.js +95 -0
- package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +10 -0
- package/node_modules/common/src/componentsMixins/index.js +1 -0
- package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +14 -0
- package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +22 -0
- package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +23 -0
- package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +12 -0
- package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +100 -0
- package/node_modules/common/src/componentsMixins/mixins/createProxy.js +58 -0
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +106 -0
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +167 -0
- package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +62 -0
- package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +93 -0
- package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +170 -0
- package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +13 -0
- package/node_modules/common/src/componentsMixins/mixins/index.js +14 -0
- package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +76 -0
- package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +210 -0
- package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +23 -0
- package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +57 -0
- package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +112 -0
- package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +242 -0
- package/node_modules/common/src/constants.js +4 -0
- package/node_modules/common/src/icons/errorMessageIconBase64.js +1 -0
- package/node_modules/common/src/sbControls.js +302 -0
- package/node_modules/common/src/themeHelpers/colorsHelpers.js +94 -0
- package/node_modules/common/src/themeHelpers/componentsThemeManager.js +45 -0
- package/node_modules/common/src/themeHelpers/index.js +176 -0
- package/node_modules/common/src/utils/index.js +68 -0
- package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +54 -0
- package/node_modules/descope-avatar/package.json +34 -0
- package/node_modules/descope-avatar/project.json +7 -0
- package/node_modules/descope-avatar/src/component/AvatarClass.js +109 -0
- package/node_modules/descope-avatar/src/component/index.js +8 -0
- package/node_modules/descope-avatar/src/theme.js +44 -0
- package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
- package/node_modules/descope-avatar/stories/descope-avatar.stories.js +32 -0
- package/node_modules/descope-text/e2e/descope-text.spec.ts +35 -0
- package/node_modules/descope-text/package.json +31 -0
- package/node_modules/descope-text/project.json +7 -0
- package/node_modules/descope-text/src/component/TextClass.js +63 -0
- package/node_modules/descope-text/src/component/index.js +5 -0
- package/node_modules/descope-text/src/theme.js +91 -0
- package/node_modules/descope-text/stories/descope-text.stories.js +55 -0
- package/package.json +151 -0
- package/src/baseClasses/createBaseClass.js +66 -0
- package/src/baseClasses/createBaseInputClass.js +16 -0
- package/src/baseClasses/createCssVarImageClass.js +53 -0
- package/src/components/boolean-fields/booleanFieldMixin.js +36 -0
- package/src/components/boolean-fields/commonStyles.js +50 -0
- package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +77 -0
- package/src/components/boolean-fields/descope-boolean-field-internal/index.js +3 -0
- package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +133 -0
- package/src/components/boolean-fields/descope-checkbox/index.js +8 -0
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +154 -0
- package/src/components/boolean-fields/descope-switch-toggle/index.js +8 -0
- package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +171 -0
- package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +101 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js +67 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js +7 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +108 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/index.js +8 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js +67 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group/index.js +7 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +77 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-internal/index.js +8 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +115 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/index.js +6 -0
- package/src/components/descope-alert/AlertClass.js +105 -0
- package/src/components/descope-alert/index.js +6 -0
- package/src/components/descope-apps-list/AppsListClass.js +97 -0
- package/src/components/descope-apps-list/index.js +8 -0
- package/src/components/descope-badge/BadgeClass.js +57 -0
- package/src/components/descope-badge/index.js +5 -0
- package/src/components/descope-button/ButtonClass.js +163 -0
- package/src/components/descope-button/clickableMixin.js +10 -0
- package/src/components/descope-button/index.js +6 -0
- package/src/components/descope-code-snippet/CodeSnippetClass.js +238 -0
- package/src/components/descope-code-snippet/helpers.js +9 -0
- package/src/components/descope-code-snippet/index.js +5 -0
- package/src/components/descope-combo-box/ComboBoxClass.js +543 -0
- package/src/components/descope-combo-box/index.js +6 -0
- package/src/components/descope-container/ContainerClass.js +65 -0
- package/src/components/descope-container/index.js +5 -0
- package/src/components/descope-date-field/DateCounterClass.js +83 -0
- package/src/components/descope-date-field/DateFieldClass.js +702 -0
- package/src/components/descope-date-field/consts.js +55 -0
- package/src/components/descope-date-field/descope-calendar/CalendarClass.js +668 -0
- package/src/components/descope-date-field/descope-calendar/helpers.js +186 -0
- package/src/components/descope-date-field/descope-calendar/index.js +9 -0
- package/src/components/descope-date-field/formats.js +49 -0
- package/src/components/descope-date-field/helpers.js +72 -0
- package/src/components/descope-date-field/icons.js +14 -0
- package/src/components/descope-date-field/index.js +10 -0
- package/src/components/descope-divider/DividerClass.js +105 -0
- package/src/components/descope-divider/index.js +6 -0
- package/src/components/descope-email-field/EmailFieldClass.js +90 -0
- package/src/components/descope-email-field/index.js +6 -0
- package/src/components/descope-enriched-text/EnrichedTextClass.js +204 -0
- package/src/components/descope-enriched-text/consts.js +14 -0
- package/src/components/descope-enriched-text/helpers.js +5 -0
- package/src/components/descope-enriched-text/index.js +5 -0
- package/src/components/descope-grid/GridClass.js +368 -0
- package/src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js +31 -0
- package/src/components/descope-grid/descope-grid-custom-column/index.js +7 -0
- package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +37 -0
- package/src/components/descope-grid/descope-grid-item-details-column/index.js +8 -0
- package/src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js +58 -0
- package/src/components/descope-grid/descope-grid-selection-column/index.js +7 -0
- package/src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js +26 -0
- package/src/components/descope-grid/descope-grid-text-column/index.js +6 -0
- package/src/components/descope-grid/helpers.js +74 -0
- package/src/components/descope-grid/index.js +12 -0
- package/src/components/descope-hybrid-field/HybridFieldClass.js +363 -0
- package/src/components/descope-hybrid-field/helpers.js +5 -0
- package/src/components/descope-hybrid-field/index.js +9 -0
- package/src/components/descope-icon/IconClass.js +82 -0
- package/src/components/descope-icon/helpers.js +51 -0
- package/src/components/descope-icon/index.js +5 -0
- package/src/components/descope-image/ImageClass.js +48 -0
- package/src/components/descope-image/index.js +5 -0
- package/src/components/descope-link/LinkClass.js +71 -0
- package/src/components/descope-link/index.js +6 -0
- package/src/components/descope-list/ListClass.js +154 -0
- package/src/components/descope-list/ListItemClass.js +56 -0
- package/src/components/descope-list/index.js +7 -0
- package/src/components/descope-loader-linear/LoaderLinearClass.js +69 -0
- package/src/components/descope-loader-linear/index.js +5 -0
- package/src/components/descope-loader-radial/LoaderRadialClass.js +50 -0
- package/src/components/descope-loader-radial/index.js +5 -0
- package/src/components/descope-logo/LogoClass.js +10 -0
- package/src/components/descope-logo/index.js +5 -0
- package/src/components/descope-modal/ModalClass.js +112 -0
- package/src/components/descope-modal/index.js +6 -0
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +676 -0
- package/src/components/descope-multi-select-combo-box/index.js +6 -0
- package/src/components/descope-new-password/NewPasswordClass.js +218 -0
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +246 -0
- package/src/components/descope-new-password/descope-new-password-internal/componentName.js +3 -0
- package/src/components/descope-new-password/descope-new-password-internal/index.js +4 -0
- package/src/components/descope-new-password/index.js +9 -0
- package/src/components/descope-notification/NotificationClass.js +107 -0
- package/src/components/descope-notification/descope-notification-card/NotificationCardClass.js +115 -0
- package/src/components/descope-notification/descope-notification-card/index.js +6 -0
- package/src/components/descope-notification/descope-notification-container.js +13 -0
- package/src/components/descope-notification/index.js +8 -0
- package/src/components/descope-notp-image/NotpImageClass.js +10 -0
- package/src/components/descope-notp-image/index.js +5 -0
- package/src/components/descope-number-field/NumberFieldClass.js +54 -0
- package/src/components/descope-number-field/index.js +6 -0
- package/src/components/descope-passcode/PasscodeClass.js +209 -0
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +231 -0
- package/src/components/descope-passcode/descope-passcode-internal/helpers.js +41 -0
- package/src/components/descope-passcode/descope-passcode-internal/index.js +3 -0
- package/src/components/descope-passcode/index.js +8 -0
- package/src/components/descope-password/PasswordClass.js +302 -0
- package/src/components/descope-password/index.js +6 -0
- package/src/components/descope-password/passwordDraggableMixin.js +40 -0
- package/src/components/descope-policy-validation/PolicyValidationClass.js +220 -0
- package/src/components/descope-policy-validation/helpers.js +2 -0
- package/src/components/descope-policy-validation/index.js +5 -0
- package/src/components/descope-radio-group/RadioButtonClass.js +77 -0
- package/src/components/descope-radio-group/RadioGroupClass.js +192 -0
- package/src/components/descope-radio-group/index.js +8 -0
- package/src/components/descope-recaptcha/RecaptchaClass.js +230 -0
- package/src/components/descope-recaptcha/index.js +5 -0
- package/src/components/descope-scopes-list/ScopesListClass.js +131 -0
- package/src/components/descope-scopes-list/index.js +7 -0
- package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +240 -0
- package/src/components/descope-security-questions-setup/index.js +7 -0
- package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +232 -0
- package/src/components/descope-security-questions-verify/index.js +7 -0
- package/src/components/descope-text-area/TextAreaClass.js +102 -0
- package/src/components/descope-text-area/index.js +6 -0
- package/src/components/descope-text-field/TextFieldClass.js +142 -0
- package/src/components/descope-text-field/index.js +9 -0
- package/src/components/descope-text-field/textFieldMappings.js +151 -0
- package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +103 -0
- package/src/components/descope-third-party-app-logo/arrows.svg +4 -0
- package/src/components/descope-third-party-app-logo/index.js +7 -0
- package/src/components/descope-totp-image/TotpImageClass.js +10 -0
- package/src/components/descope-totp-image/index.js +5 -0
- package/src/components/descope-upload-file/UploadFileClass.js +236 -0
- package/src/components/descope-upload-file/helpers.js +11 -0
- package/src/components/descope-upload-file/index.js +6 -0
- package/src/components/descope-user-attribute/UserAttributeClass.js +245 -0
- package/src/components/descope-user-attribute/delete.svg +3 -0
- package/src/components/descope-user-attribute/edit.svg +3 -0
- package/src/components/descope-user-attribute/index.js +9 -0
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +204 -0
- package/src/components/descope-user-auth-method/green-v.svg +3 -0
- package/src/components/descope-user-auth-method/index.js +9 -0
- package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +188 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/MappingItem.js +167 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/index.js +3 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/MappingsFieldInternal.js +257 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/index.js +3 -0
- package/src/components/mapping-fields/descope-mappings-field/index.js +14 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/SamlGroupMappingsClass.js +116 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/SamlGroupMappingsInternal.js +136 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/index.js +3 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/index.js +10 -0
- package/src/components/phone-fields/CountryCodes.js +1215 -0
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +313 -0
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +272 -0
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +6 -0
- package/src/components/phone-fields/descope-phone-field/helpers.js +52 -0
- package/src/components/phone-fields/descope-phone-field/index.js +9 -0
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +236 -0
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +172 -0
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js +5 -0
- package/src/components/phone-fields/descope-phone-input-box-field/index.js +9 -0
- package/src/components/phone-fields/helpers.js +5 -0
- package/src/constants.js +4 -0
- package/src/darkTheme.js +52 -0
- package/src/dev/index.js +3 -0
- package/src/helpers/componentHelpers.js +95 -0
- package/src/helpers/index.js +68 -0
- package/src/helpers/mixinsHelpers.js +10 -0
- package/src/helpers/themeHelpers/colorsHelpers.js +94 -0
- package/src/helpers/themeHelpers/index.js +175 -0
- package/src/helpers/themeHelpers/resetHelpers.js +144 -0
- package/src/index.cjs.js +60 -0
- package/src/index.d.ts +72 -0
- package/src/index.js +62 -0
- package/src/index.umd.js +28 -0
- package/src/mixins/activableMixin.js +14 -0
- package/src/mixins/changeMixin.js +22 -0
- package/src/mixins/componentNameValidationMixin.js +23 -0
- package/src/mixins/componentsContextMixin.js +12 -0
- package/src/mixins/createDynamicDataMixin.js +100 -0
- package/src/mixins/createProxy.js +58 -0
- package/src/mixins/createStyleMixin/helpers.js +106 -0
- package/src/mixins/createStyleMixin/index.js +167 -0
- package/src/mixins/draggableMixin.js +62 -0
- package/src/mixins/externalInputHelpers.js +93 -0
- package/src/mixins/externalInputMixin.js +170 -0
- package/src/mixins/hoverableMixin.js +13 -0
- package/src/mixins/index.js +13 -0
- package/src/mixins/inputEventsDispatchingMixin.js +76 -0
- package/src/mixins/inputValidationMixin.js +210 -0
- package/src/mixins/lifecycleEventsMixin.js +23 -0
- package/src/mixins/normalizeBooleanAttributesMixin.js +59 -0
- package/src/mixins/portalMixin.js +111 -0
- package/src/mixins/proxyInputMixin.js +242 -0
- package/src/theme/components/alert.js +88 -0
- package/src/theme/components/appsList.js +36 -0
- package/src/theme/components/badge.js +71 -0
- package/src/theme/components/button.js +133 -0
- package/src/theme/components/buttonSelectionGroup/baseButtonSelectionGroup.js +23 -0
- package/src/theme/components/buttonSelectionGroup/buttonMultiSelectionGroup.js +11 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +11 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +34 -0
- package/src/theme/components/calendar.js +91 -0
- package/src/theme/components/checkbox.js +39 -0
- package/src/theme/components/codeSnippet.js +145 -0
- package/src/theme/components/comboBox.js +93 -0
- package/src/theme/components/container.js +127 -0
- package/src/theme/components/dateField.js +32 -0
- package/src/theme/components/divider.js +49 -0
- package/src/theme/components/emailField.js +50 -0
- package/src/theme/components/enrichedText.js +40 -0
- package/src/theme/components/grid.js +52 -0
- package/src/theme/components/hybridField.js +22 -0
- package/src/theme/components/icon.js +7 -0
- package/src/theme/components/image.js +8 -0
- package/src/theme/components/index.js +124 -0
- package/src/theme/components/inputWrapper.js +130 -0
- package/src/theme/components/link.js +36 -0
- package/src/theme/components/list/list.js +56 -0
- package/src/theme/components/list/listItem.js +41 -0
- package/src/theme/components/loader/index.js +4 -0
- package/src/theme/components/loader/loaderLinear.js +45 -0
- package/src/theme/components/loader/loaderRadial.js +57 -0
- package/src/theme/components/logo.js +10 -0
- package/src/theme/components/mappingsField.js +30 -0
- package/src/theme/components/modal.js +19 -0
- package/src/theme/components/multiSelectComboBox.js +86 -0
- package/src/theme/components/newPassword.js +40 -0
- package/src/theme/components/notificationCard.js +54 -0
- package/src/theme/components/notpImage.js +10 -0
- package/src/theme/components/numberField.js +50 -0
- package/src/theme/components/passcode.js +47 -0
- package/src/theme/components/password.js +55 -0
- package/src/theme/components/phoneField.js +44 -0
- package/src/theme/components/phoneInputBoxField.js +50 -0
- package/src/theme/components/policyValidation.js +29 -0
- package/src/theme/components/radioGroup/radioButton.js +44 -0
- package/src/theme/components/radioGroup/radioGroup.js +42 -0
- package/src/theme/components/samlGroupMappings.js +20 -0
- package/src/theme/components/scopesList.js +15 -0
- package/src/theme/components/securityQuestionsSetup.js +12 -0
- package/src/theme/components/securityQuestionsVerify.js +16 -0
- package/src/theme/components/switchToggle.js +77 -0
- package/src/theme/components/textArea.js +48 -0
- package/src/theme/components/textField.js +63 -0
- package/src/theme/components/thirdPartyAppLogo.js +36 -0
- package/src/theme/components/totpImage.js +10 -0
- package/src/theme/components/uploadFile.js +66 -0
- package/src/theme/components/userAttribute.js +20 -0
- package/src/theme/components/userAuthMethod.js +20 -0
- package/src/theme/globals.js +181 -0
- package/src/theme/index.js +5 -0
@@ -0,0 +1,302 @@
|
|
1
|
+
import {
|
2
|
+
createStyleMixin,
|
3
|
+
draggableMixin,
|
4
|
+
createProxy,
|
5
|
+
proxyInputMixin,
|
6
|
+
componentNameValidationMixin,
|
7
|
+
externalInputMixin,
|
8
|
+
} from '../../mixins';
|
9
|
+
import { compose } from '../../helpers';
|
10
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
11
|
+
import passwordDraggableMixin from './passwordDraggableMixin';
|
12
|
+
import {
|
13
|
+
resetInputLabelPosition,
|
14
|
+
resetInputCursor,
|
15
|
+
useHostExternalPadding,
|
16
|
+
inputFloatingLabelStyle,
|
17
|
+
} from '../../helpers/themeHelpers/resetHelpers';
|
18
|
+
|
19
|
+
export const componentName = getComponentName('password');
|
20
|
+
|
21
|
+
const customMixin = (superclass) =>
|
22
|
+
class PasswordFieldMixinClass extends superclass {
|
23
|
+
static get observedAttributes() {
|
24
|
+
return ['manual-visibility-toggle'];
|
25
|
+
}
|
26
|
+
|
27
|
+
get manualToggleVisibility() {
|
28
|
+
return this.getAttribute('manual-visibility-toggle') === 'true';
|
29
|
+
}
|
30
|
+
|
31
|
+
init() {
|
32
|
+
super.init?.();
|
33
|
+
this.handleCaretOnVisibilityChange();
|
34
|
+
this.origSetPasswordVisible = this.baseElement._setPasswordVisible;
|
35
|
+
this.origSetFocused = this.baseElement._setFocused;
|
36
|
+
this.baseElement._setFocused = this.setFocus.bind(this);
|
37
|
+
|
38
|
+
this.initExternalInput();
|
39
|
+
}
|
40
|
+
|
41
|
+
initExternalInput() {
|
42
|
+
const externalInput = this.createExternalInput();
|
43
|
+
if (externalInput) {
|
44
|
+
this.handlePasswordVisibility(externalInput);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
get caretPosition() {
|
49
|
+
return this.value?.length || 0;
|
50
|
+
}
|
51
|
+
|
52
|
+
handleCaretOnVisibilityChange() {
|
53
|
+
const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(
|
54
|
+
this.baseElement
|
55
|
+
);
|
56
|
+
this.baseElement._togglePasswordVisibility = () => {
|
57
|
+
setTimeout(() => {
|
58
|
+
origTogglePasswordVisibility();
|
59
|
+
this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);
|
60
|
+
return false;
|
61
|
+
});
|
62
|
+
};
|
63
|
+
}
|
64
|
+
|
65
|
+
// We use `manual-visibility-toggle` to to toggle the password's visibility
|
66
|
+
// even if the input field is focused-out. However, on focusout - Vaadin resets
|
67
|
+
// password visibility. Since we don't want to override Vaadin's native setFocus
|
68
|
+
// function (which is part of their FocusMixin).
|
69
|
+
// So, here we override the part of logic that runs within Vaadin's setFocus that reports
|
70
|
+
// the password visibility state. This logic is part of our `manual-visibility-toggle` only.
|
71
|
+
setFocus(focused) {
|
72
|
+
if (this.manualToggleVisibility) {
|
73
|
+
this.baseElement._setPasswordVisible = () => {};
|
74
|
+
}
|
75
|
+
this.origSetFocused.call(this.baseElement, focused);
|
76
|
+
this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);
|
77
|
+
}
|
78
|
+
|
79
|
+
resetPasswordVisibilityToggle() {
|
80
|
+
this.baseElement._setPasswordVisible = this.origSetPasswordVisible;
|
81
|
+
this.baseElement._setFocused = this.origSetFocus;
|
82
|
+
}
|
83
|
+
|
84
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
85
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
86
|
+
}
|
87
|
+
|
88
|
+
// override vaadin's password visibility toggle.
|
89
|
+
// we need this override in order to to resolve the external input `focus` race condition,
|
90
|
+
// which is caused due to the focus sync between the two inputs.
|
91
|
+
handlePasswordVisibility(externalInput) {
|
92
|
+
// disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener
|
93
|
+
const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;
|
94
|
+
this.baseElement
|
95
|
+
.querySelector('vaadin-password-field-button')
|
96
|
+
.removeEventListener('mousedown', origBoundRevealButtonMouseDown);
|
97
|
+
|
98
|
+
// disable vaadin's `_passwordVisibleChanged` observer
|
99
|
+
this.baseElement._passwordVisibleChanged = () => {};
|
100
|
+
|
101
|
+
// override vaadin's `_togglePasswordVisibility`
|
102
|
+
this.baseElement._togglePasswordVisibility = () => {
|
103
|
+
const currVisibility = externalInput.getAttribute('type');
|
104
|
+
if (currVisibility === 'password') {
|
105
|
+
this.showPasswordVisibility(externalInput);
|
106
|
+
} else {
|
107
|
+
this.hidePasswordVisibility(externalInput);
|
108
|
+
}
|
109
|
+
};
|
110
|
+
}
|
111
|
+
|
112
|
+
showPasswordVisibility(input) {
|
113
|
+
// handle input element's type
|
114
|
+
input.setAttribute('type', 'text');
|
115
|
+
// handle vaadin's `password-visible` attribute
|
116
|
+
this.setAttribute('password-visible', 'true');
|
117
|
+
}
|
118
|
+
|
119
|
+
hidePasswordVisibility(input) {
|
120
|
+
// handle input element's type
|
121
|
+
input.setAttribute('type', 'password');
|
122
|
+
// handle vaadin's `password-visible` attribute
|
123
|
+
this.setAttribute('password-visible', 'false');
|
124
|
+
}
|
125
|
+
};
|
126
|
+
|
127
|
+
const {
|
128
|
+
host,
|
129
|
+
inputField,
|
130
|
+
inputElement,
|
131
|
+
inputElementPlaceholder,
|
132
|
+
revealButtonContainer,
|
133
|
+
revealButtonIcon,
|
134
|
+
label,
|
135
|
+
requiredIndicator,
|
136
|
+
errorMessage,
|
137
|
+
helperText,
|
138
|
+
} = {
|
139
|
+
host: { selector: () => ':host' },
|
140
|
+
inputField: { selector: '::part(input-field)' },
|
141
|
+
inputElement: { selector: '> input' },
|
142
|
+
inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },
|
143
|
+
revealButtonContainer: { selector: '::part(reveal-button)' },
|
144
|
+
revealButtonIcon: { selector: '::part(reveal-button)::before' },
|
145
|
+
label: { selector: '::part(label)' },
|
146
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
147
|
+
helperText: { selector: '::part(helper-text)' },
|
148
|
+
errorMessage: { selector: '::part(error-message)' },
|
149
|
+
};
|
150
|
+
|
151
|
+
export const PasswordClass = compose(
|
152
|
+
createStyleMixin({
|
153
|
+
mappings: {
|
154
|
+
hostWidth: { ...host, property: 'width' },
|
155
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
156
|
+
hostDirection: { ...host, property: 'direction' },
|
157
|
+
fontSize: [{}, host],
|
158
|
+
fontFamily: [label, inputField, errorMessage, helperText],
|
159
|
+
inputHeight: { ...inputField, property: 'height' },
|
160
|
+
inputHorizontalPadding: [
|
161
|
+
{ ...inputElement, property: 'padding-left' },
|
162
|
+
{ ...inputElement, property: 'padding-right' },
|
163
|
+
],
|
164
|
+
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
165
|
+
|
166
|
+
inputBorderStyle: { ...inputField, property: 'border-style' },
|
167
|
+
inputBorderWidth: { ...inputField, property: 'border-width' },
|
168
|
+
inputBorderColor: { ...inputField, property: 'border-color' },
|
169
|
+
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
170
|
+
|
171
|
+
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
172
|
+
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
173
|
+
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
174
|
+
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
175
|
+
|
176
|
+
labelFontSize: { ...label, property: 'font-size' },
|
177
|
+
labelFontWeight: { ...label, property: 'font-weight' },
|
178
|
+
labelTextColor: [
|
179
|
+
{ ...label, property: 'color' },
|
180
|
+
{ ...requiredIndicator, property: 'color' },
|
181
|
+
],
|
182
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
183
|
+
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
184
|
+
errorMessageIcon: { ...errorMessage, property: 'background-image' },
|
185
|
+
errorMessageIconSize: { ...errorMessage, property: 'background-size' },
|
186
|
+
errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },
|
187
|
+
errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },
|
188
|
+
errorMessageIconPosition: { ...errorMessage, property: 'background-position' },
|
189
|
+
|
190
|
+
inputPlaceholderTextColor: [
|
191
|
+
{ ...inputElementPlaceholder, property: 'color' },
|
192
|
+
{ selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },
|
193
|
+
],
|
194
|
+
inputValueTextColor: [
|
195
|
+
{ ...inputElement, property: 'color' },
|
196
|
+
{ selector: () => ':host ::slotted(input)', property: 'color' },
|
197
|
+
],
|
198
|
+
|
199
|
+
revealButtonOffset: [
|
200
|
+
{ ...revealButtonContainer, property: 'margin-right' },
|
201
|
+
{ ...revealButtonContainer, property: 'margin-left' },
|
202
|
+
],
|
203
|
+
revealButtonSize: { ...revealButtonContainer, property: 'font-size' },
|
204
|
+
revealButtonColor: { ...revealButtonIcon, property: 'color' },
|
205
|
+
|
206
|
+
labelPosition: { ...label, property: 'position' },
|
207
|
+
labelTopPosition: { ...label, property: 'top' },
|
208
|
+
labelHorizontalPosition: [
|
209
|
+
{ ...label, property: 'left' },
|
210
|
+
{ ...label, property: 'right' },
|
211
|
+
],
|
212
|
+
inputTransformY: { ...label, property: 'transform' },
|
213
|
+
inputTransition: { ...label, property: 'transition' },
|
214
|
+
marginInlineStart: { ...label, property: 'margin-inline-start' },
|
215
|
+
placeholderOpacity: [
|
216
|
+
{ selector: '> input:placeholder-shown', property: 'opacity' },
|
217
|
+
{ ...inputElement, property: 'opacity' },
|
218
|
+
],
|
219
|
+
inputVerticalAlignment: { ...inputField, property: 'align-items' },
|
220
|
+
valueInputHeight: { ...inputElement, property: 'height' },
|
221
|
+
},
|
222
|
+
}),
|
223
|
+
draggableMixin,
|
224
|
+
externalInputMixin({
|
225
|
+
inputType: 'password',
|
226
|
+
inputName: 'password',
|
227
|
+
includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],
|
228
|
+
noBlurDispatch: true,
|
229
|
+
}),
|
230
|
+
proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),
|
231
|
+
componentNameValidationMixin,
|
232
|
+
passwordDraggableMixin,
|
233
|
+
customMixin
|
234
|
+
)(
|
235
|
+
createProxy({
|
236
|
+
slots: ['', 'suffix'],
|
237
|
+
wrappedEleName: 'vaadin-password-field',
|
238
|
+
style: () => `
|
239
|
+
:host {
|
240
|
+
display: inline-block;
|
241
|
+
max-width: 100%;
|
242
|
+
min-width: 10em;
|
243
|
+
box-sizing: border-box;
|
244
|
+
position: relative;
|
245
|
+
}
|
246
|
+
${useHostExternalPadding(PasswordClass.cssVarList)}
|
247
|
+
${resetInputCursor('vaadin-password-field')}
|
248
|
+
${resetInputLabelPosition('vaadin-password-field')}
|
249
|
+
|
250
|
+
vaadin-password-field {
|
251
|
+
width: 100%;
|
252
|
+
box-sizing: border-box;
|
253
|
+
padding: 0;
|
254
|
+
}
|
255
|
+
vaadin-password-field > input {
|
256
|
+
-webkit-mask-image: none;
|
257
|
+
box-sizing: border-box;
|
258
|
+
opacity: 1;
|
259
|
+
}
|
260
|
+
vaadin-password-field::part(input-field) {
|
261
|
+
box-sizing: border-box;
|
262
|
+
padding: 0;
|
263
|
+
}
|
264
|
+
vaadin-password-field[focus-ring]::part(input-field) {
|
265
|
+
box-shadow: none;
|
266
|
+
}
|
267
|
+
:host ::slotted(input) {
|
268
|
+
min-height: 0;
|
269
|
+
}
|
270
|
+
:host([readonly]) ::slotted(input:placeholder-shown) {
|
271
|
+
opacity: 0;
|
272
|
+
}
|
273
|
+
vaadin-password-field::before {
|
274
|
+
height: initial;
|
275
|
+
}
|
276
|
+
vaadin-password-field::part(input-field)::after {
|
277
|
+
opacity: 0;
|
278
|
+
}
|
279
|
+
vaadin-password-field-button {
|
280
|
+
cursor: pointer;
|
281
|
+
}
|
282
|
+
:host([readonly]) vaadin-password-field-button {
|
283
|
+
pointer-events: none;
|
284
|
+
}
|
285
|
+
vaadin-password-field-button[focus-ring] {
|
286
|
+
box-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});
|
287
|
+
}
|
288
|
+
|
289
|
+
${inputFloatingLabelStyle()}
|
290
|
+
|
291
|
+
::part(reveal-button) {
|
292
|
+
align-self: center;
|
293
|
+
}
|
294
|
+
|
295
|
+
vaadin-password-field[external-input="true"] > input:not(:placeholder-shown) {
|
296
|
+
opacity: 0;
|
297
|
+
}
|
298
|
+
`,
|
299
|
+
excludeAttrsSync: ['tabindex'],
|
300
|
+
componentName,
|
301
|
+
})
|
302
|
+
);
|
@@ -0,0 +1,40 @@
|
|
1
|
+
const passwordDraggableMixin = (superclass) =>
|
2
|
+
class PasswordDraggableMixinClass extends superclass {
|
3
|
+
get isReadOnly() {
|
4
|
+
return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';
|
5
|
+
}
|
6
|
+
|
7
|
+
init() {
|
8
|
+
// there is an issue in Chrome that input field with type password cannot be D&D
|
9
|
+
// so in case the input is draggable & readonly, we are changing the input type to "text" before dragging
|
10
|
+
// and return the original type when done
|
11
|
+
super.init?.();
|
12
|
+
|
13
|
+
const ele = this.querySelector('input');
|
14
|
+
|
15
|
+
ele?.addEventListener('mousedown', (e) => {
|
16
|
+
if (this.isDraggable && this.isReadOnly) {
|
17
|
+
ele.setAttribute('inert', 'true');
|
18
|
+
|
19
|
+
const inputEle = e.target;
|
20
|
+
const prevType = inputEle.getAttribute('type');
|
21
|
+
inputEle.setAttribute('type', 'text');
|
22
|
+
setTimeout(() => {
|
23
|
+
inputEle.focus();
|
24
|
+
});
|
25
|
+
|
26
|
+
const onComplete = (_) => {
|
27
|
+
inputEle.setAttribute('type', prevType);
|
28
|
+
ele.removeAttribute('inert');
|
29
|
+
this.removeEventListener('mouseup', onComplete);
|
30
|
+
this.removeEventListener('dragend', onComplete);
|
31
|
+
};
|
32
|
+
|
33
|
+
this.addEventListener('dragend', onComplete, { once: true });
|
34
|
+
this.addEventListener('mouseup', onComplete, { once: true });
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
export default passwordDraggableMixin;
|
@@ -0,0 +1,220 @@
|
|
1
|
+
// eslint-disable-next-line max-classes-per-file
|
2
|
+
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
3
|
+
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
4
|
+
import { compose } from '../../helpers';
|
5
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
6
|
+
import { interpolateString } from './helpers';
|
7
|
+
|
8
|
+
export const componentName = getComponentName('policy-validation');
|
9
|
+
|
10
|
+
const overrideAttrs = ['data-password-policy-value-minlength'];
|
11
|
+
const dataAttrs = ['data', 'active-policies', 'overrides', ...overrideAttrs];
|
12
|
+
const policyAttrs = ['label', 'value', ...dataAttrs];
|
13
|
+
|
14
|
+
class RawPolicyValidation extends createBaseClass({ componentName, baseSelector: ':host > div' }) {
|
15
|
+
#availablePolicies;
|
16
|
+
|
17
|
+
#activePolicies = [];
|
18
|
+
|
19
|
+
#overrides;
|
20
|
+
|
21
|
+
static get observedAttributes() {
|
22
|
+
return policyAttrs;
|
23
|
+
}
|
24
|
+
|
25
|
+
constructor() {
|
26
|
+
super();
|
27
|
+
|
28
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
29
|
+
<div>
|
30
|
+
<div class="label"></div>
|
31
|
+
<ul></ul>
|
32
|
+
</div>
|
33
|
+
<style>
|
34
|
+
:host > div {
|
35
|
+
width: 100%;
|
36
|
+
display: flex;
|
37
|
+
flex-direction: column;
|
38
|
+
box-sizing: border-box;
|
39
|
+
}
|
40
|
+
.label {
|
41
|
+
max-width: 100%;
|
42
|
+
text-wrap: wrap;
|
43
|
+
overflow-wrap: break-word;
|
44
|
+
}
|
45
|
+
.hide-label .label {
|
46
|
+
display: none;
|
47
|
+
}
|
48
|
+
ul {
|
49
|
+
display: flex;
|
50
|
+
flex-direction: column;
|
51
|
+
padding: 0;
|
52
|
+
margin: 0;
|
53
|
+
}
|
54
|
+
ul, li {
|
55
|
+
margin: 0;
|
56
|
+
padding: 0;
|
57
|
+
list-style: none;
|
58
|
+
}
|
59
|
+
li::before {
|
60
|
+
display: inline-block;
|
61
|
+
width: 1em;
|
62
|
+
text-align: center;
|
63
|
+
}
|
64
|
+
</style>
|
65
|
+
`;
|
66
|
+
|
67
|
+
this.panel = this.shadowRoot.querySelector(':host > div');
|
68
|
+
this.label = this.shadowRoot.querySelector('.label');
|
69
|
+
this.list = this.shadowRoot.querySelector('ul');
|
70
|
+
}
|
71
|
+
|
72
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
73
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
74
|
+
if (oldValue !== newValue) {
|
75
|
+
if (attrName === 'label') {
|
76
|
+
this.updateLabel(newValue);
|
77
|
+
}
|
78
|
+
|
79
|
+
// we're don't know the order in which the attributes are forwarded, so we're trying to render every time
|
80
|
+
// once `data` and `active-policies` are populated, the render will be executed.
|
81
|
+
// once the `overrides` object is updated, we want to re-render the panel.
|
82
|
+
if (dataAttrs.includes(attrName)) {
|
83
|
+
if (attrName === 'data') {
|
84
|
+
try {
|
85
|
+
this.availablePolicies = JSON.parse(newValue);
|
86
|
+
} catch {
|
87
|
+
// eslint-disable-next-line no-console
|
88
|
+
console.error('Failed to set available policies');
|
89
|
+
}
|
90
|
+
}
|
91
|
+
if (attrName === 'active-policies') {
|
92
|
+
this.#activePolicies = (newValue || '').split(',');
|
93
|
+
}
|
94
|
+
|
95
|
+
if (attrName === 'data-password-policy-value-minlength') {
|
96
|
+
const ln = Number(newValue);
|
97
|
+
if (!Number.isNaN(ln) && ln > 0) {
|
98
|
+
this.#overrides = { ...this.#overrides, minlength: { value: `${ln}` } };
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
this.renderItems(this.#availablePolicies, this.#activePolicies, this.#overrides);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
get availablePolicies() {
|
108
|
+
return this.#availablePolicies || [];
|
109
|
+
}
|
110
|
+
|
111
|
+
set availablePolicies(val) {
|
112
|
+
this.#availablePolicies = val;
|
113
|
+
}
|
114
|
+
|
115
|
+
get value() {
|
116
|
+
return this.getAttribute('value') || '';
|
117
|
+
}
|
118
|
+
|
119
|
+
validate() {
|
120
|
+
let policies = this.#availablePolicies;
|
121
|
+
|
122
|
+
if (this.#overrides) {
|
123
|
+
policies = this.#availablePolicies.map((policy) =>
|
124
|
+
this.#overrides[policy.id] ? { ...policy, data: this.#overrides[policy.id] } : policy
|
125
|
+
);
|
126
|
+
}
|
127
|
+
|
128
|
+
return this.#activePolicies.reduce((results, id) => {
|
129
|
+
const policy = policies.find((p) => p.id === id);
|
130
|
+
|
131
|
+
if (!policy) {
|
132
|
+
return results;
|
133
|
+
}
|
134
|
+
|
135
|
+
const { pattern, message, data } = policy;
|
136
|
+
|
137
|
+
if (!pattern || !message) {
|
138
|
+
return results;
|
139
|
+
}
|
140
|
+
|
141
|
+
const exp = new RegExp(interpolateString(pattern, data));
|
142
|
+
|
143
|
+
const validationResult = {
|
144
|
+
valid: exp.test(this.value),
|
145
|
+
message: interpolateString(message, data),
|
146
|
+
id,
|
147
|
+
};
|
148
|
+
|
149
|
+
results.push(validationResult);
|
150
|
+
|
151
|
+
return results;
|
152
|
+
}, []);
|
153
|
+
}
|
154
|
+
|
155
|
+
get isValid() {
|
156
|
+
return !this.validate().some(({ valid }) => valid === false);
|
157
|
+
}
|
158
|
+
|
159
|
+
getValidationItemTemplate({ valid, message }) {
|
160
|
+
const status = !this.value ? 'none' : valid;
|
161
|
+
return `
|
162
|
+
<li class="item" data-valid="${status}">
|
163
|
+
<span class="message">${message}</span>
|
164
|
+
</li>
|
165
|
+
`;
|
166
|
+
}
|
167
|
+
|
168
|
+
renderItems(availablePolicies, activePolicies) {
|
169
|
+
if (!availablePolicies || !activePolicies.length) {
|
170
|
+
return;
|
171
|
+
}
|
172
|
+
|
173
|
+
this.list.innerHTML = this.validate().map(this.getValidationItemTemplate.bind(this)).join('');
|
174
|
+
}
|
175
|
+
|
176
|
+
updateLabel(val) {
|
177
|
+
if (!val) {
|
178
|
+
this.classList.add('hide-label');
|
179
|
+
this.label.innerHTML = '';
|
180
|
+
} else {
|
181
|
+
this.label.innerHTML = val;
|
182
|
+
this.classList.remove('hide-label');
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
const { host, item, symbolDefault, symbolSuccess, symbolError } = {
|
188
|
+
host: { selector: () => ':host > div' },
|
189
|
+
item: { selector: () => '.item' },
|
190
|
+
symbolDefault: { selector: () => '.item[data-valid="none"]::before' },
|
191
|
+
symbolSuccess: { selector: () => '.item[data-valid="true"]::before' },
|
192
|
+
symbolError: { selector: () => '.item[data-valid="false"]::before' },
|
193
|
+
};
|
194
|
+
|
195
|
+
export const PolicyValidationClass = compose(
|
196
|
+
createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),
|
197
|
+
createStyleMixin({
|
198
|
+
mappings: {
|
199
|
+
hostDirection: { selector: () => ':host', property: 'direction' },
|
200
|
+
fontSize: {},
|
201
|
+
fontFamily: {},
|
202
|
+
padding: {},
|
203
|
+
borderWidth: { ...host, property: 'border-width' },
|
204
|
+
borderStyle: { ...host, property: 'border-style' },
|
205
|
+
borderColor: { ...host, property: 'border-color' },
|
206
|
+
borderRadius: { ...host, property: 'border-radius' },
|
207
|
+
backgroundColor: { ...host, property: 'background-color' },
|
208
|
+
textColor: { property: 'color' },
|
209
|
+
labelMargin: { ...host, property: 'gap' },
|
210
|
+
itemsSpacing: { ...item, property: 'line-height' },
|
211
|
+
itemSymbolSuccessColor: { ...symbolSuccess, property: 'color' },
|
212
|
+
itemSymbolErrorColor: { ...symbolError, property: 'color' },
|
213
|
+
itemSymbolDefault: { ...symbolDefault, property: 'content' },
|
214
|
+
itemSymbolSuccess: { ...symbolSuccess, property: 'content' },
|
215
|
+
itemSymbolError: { ...symbolError, property: 'content' },
|
216
|
+
},
|
217
|
+
}),
|
218
|
+
draggableMixin,
|
219
|
+
componentNameValidationMixin
|
220
|
+
)(RawPolicyValidation);
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { compose } from '../../helpers';
|
2
|
+
import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
|
3
|
+
import {
|
4
|
+
componentNameValidationMixin,
|
5
|
+
createProxy,
|
6
|
+
createStyleMixin,
|
7
|
+
proxyInputMixin,
|
8
|
+
} from '../../mixins';
|
9
|
+
|
10
|
+
export const componentName = getComponentName('radio-button');
|
11
|
+
|
12
|
+
const customMixin = (superclass) =>
|
13
|
+
class CustomMixin extends superclass {
|
14
|
+
constructor() {
|
15
|
+
super();
|
16
|
+
|
17
|
+
this.baseElement.checkValidity = () => {};
|
18
|
+
}
|
19
|
+
|
20
|
+
init() {
|
21
|
+
// we are forwarding vaadin checked-changed event
|
22
|
+
this.baseElement.addEventListener('checked-changed', (e) => {
|
23
|
+
this.dispatchEvent(
|
24
|
+
new CustomEvent(
|
25
|
+
'checked-changed',
|
26
|
+
{ detail: e.detail },
|
27
|
+
{ bubbles: true, composed: true }
|
28
|
+
)
|
29
|
+
);
|
30
|
+
});
|
31
|
+
|
32
|
+
super.init?.();
|
33
|
+
|
34
|
+
observeChildren(this, this.renderLabel.bind(this));
|
35
|
+
}
|
36
|
+
|
37
|
+
renderLabel() {
|
38
|
+
this.baseElement.setAttribute('label', this.textContent);
|
39
|
+
}
|
40
|
+
|
41
|
+
get value() {
|
42
|
+
return this.getAttribute('value');
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
46
|
+
export const RadioButtonClass = compose(
|
47
|
+
createStyleMixin({
|
48
|
+
mappings: {
|
49
|
+
cursor: [{}, { selector: 'label' }],
|
50
|
+
fontSize: [{ selector: 'label' }, {}],
|
51
|
+
labelTextColor: { selector: 'label', property: 'color' },
|
52
|
+
fontFamily: { selector: 'label' },
|
53
|
+
radioSize: [
|
54
|
+
{ selector: '::part(radio)', property: 'height' },
|
55
|
+
{ selector: '::part(radio)', property: 'width' },
|
56
|
+
],
|
57
|
+
radioBackgroundColor: { selector: '::part(radio)', property: 'background-color' },
|
58
|
+
radioMargin: { selector: '::part(radio)', property: 'margin' },
|
59
|
+
radioCheckedSize: { selector: '::part(radio)::after', property: 'border-width' },
|
60
|
+
radioCheckedColor: { selector: '::part(radio)::after', property: 'border-color' },
|
61
|
+
radioBorderColor: { selector: '::part(radio)', property: 'border-color', fallback: 'none' },
|
62
|
+
radioBorderWidth: { selector: '::part(radio)', property: 'border-width', fallback: 0 },
|
63
|
+
radioBorderStyle: { selector: '::part(radio)', property: 'border-style', fallback: 'solid' },
|
64
|
+
},
|
65
|
+
}),
|
66
|
+
proxyInputMixin({ proxyProps: ['setSelectionRange'] }),
|
67
|
+
componentNameValidationMixin,
|
68
|
+
customMixin
|
69
|
+
)(
|
70
|
+
createProxy({
|
71
|
+
slots: [''],
|
72
|
+
wrappedEleName: 'vaadin-radio-button',
|
73
|
+
excludeAttrsSync: ['tabindex', 'data'],
|
74
|
+
includeForwardProps: ['checked', 'name', 'disabled'],
|
75
|
+
componentName,
|
76
|
+
})
|
77
|
+
);
|