@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,142 @@
|
|
1
|
+
import {
|
2
|
+
createStyleMixin,
|
3
|
+
draggableMixin,
|
4
|
+
createProxy,
|
5
|
+
proxyInputMixin,
|
6
|
+
componentNameValidationMixin,
|
7
|
+
} from '../../mixins';
|
8
|
+
import textFieldMappings from './textFieldMappings';
|
9
|
+
import { compose } from '../../helpers';
|
10
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
11
|
+
import {
|
12
|
+
inputFloatingLabelStyle,
|
13
|
+
resetInputLabelPosition,
|
14
|
+
resetInputOverrides,
|
15
|
+
useHostExternalPadding,
|
16
|
+
} from '../../helpers/themeHelpers/resetHelpers';
|
17
|
+
|
18
|
+
export const componentName = getComponentName('text-field');
|
19
|
+
|
20
|
+
const observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];
|
21
|
+
|
22
|
+
const customMixin = (superclass) =>
|
23
|
+
class TextFieldClass extends superclass {
|
24
|
+
static get observedAttributes() {
|
25
|
+
return observedAttrs.concat(superclass.observedAttributes || []);
|
26
|
+
}
|
27
|
+
|
28
|
+
icon;
|
29
|
+
|
30
|
+
init() {
|
31
|
+
super.init?.();
|
32
|
+
}
|
33
|
+
|
34
|
+
renderCopyToClipboard(shouldRender) {
|
35
|
+
if (!shouldRender) {
|
36
|
+
this.icon?.remove();
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
|
40
|
+
const iconInitConfig = {
|
41
|
+
icon: 'vaadin:copy-o',
|
42
|
+
title: 'Copy',
|
43
|
+
style: 'cursor: pointer',
|
44
|
+
};
|
45
|
+
|
46
|
+
const iconCopiedConfig = {
|
47
|
+
icon: 'vaadin:check-circle-o',
|
48
|
+
title: 'Copied',
|
49
|
+
style: 'cursor: initial',
|
50
|
+
};
|
51
|
+
|
52
|
+
this.icon = Object.assign(document.createElement('vaadin-icon'), {
|
53
|
+
slot: 'suffix',
|
54
|
+
...iconInitConfig,
|
55
|
+
});
|
56
|
+
|
57
|
+
this.baseElement.appendChild(this.icon);
|
58
|
+
this.icon.addEventListener('click', () => {
|
59
|
+
navigator.clipboard.writeText(this.value);
|
60
|
+
Object.assign(this.icon, iconCopiedConfig);
|
61
|
+
|
62
|
+
// we want the icon to go back to the initial state after 5 seconds
|
63
|
+
setTimeout(() => {
|
64
|
+
Object.assign(this.icon, iconInitConfig);
|
65
|
+
}, 5000);
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
onLabelClick() {
|
70
|
+
this.focus();
|
71
|
+
}
|
72
|
+
|
73
|
+
attributeChangedCallback(attrName, oldVal, newVal) {
|
74
|
+
super.attributeChangeCallback?.(attrName, oldVal, newVal);
|
75
|
+
|
76
|
+
// Vaadin doesn't allow to change the input type attribute.
|
77
|
+
// We need the ability to do that, so we're overriding their
|
78
|
+
// behavior with their private API.
|
79
|
+
// When receiving a `type` attribute, we use their private API
|
80
|
+
// to set it on the input.
|
81
|
+
if (attrName === 'type') {
|
82
|
+
this.baseElement._setType(newVal);
|
83
|
+
}
|
84
|
+
|
85
|
+
if (oldVal !== newVal) {
|
86
|
+
if (attrName === 'label-type') {
|
87
|
+
if (newVal === 'floating') {
|
88
|
+
this.addEventListener('click', this.onLabelClick);
|
89
|
+
} else {
|
90
|
+
this.removeEventListener('click', this.onLabelClick);
|
91
|
+
}
|
92
|
+
} else if (attrName === 'copy-to-clipboard') {
|
93
|
+
this.renderCopyToClipboard(newVal === 'true');
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
};
|
98
|
+
|
99
|
+
export const TextFieldClass = compose(
|
100
|
+
createStyleMixin({
|
101
|
+
mappings: textFieldMappings,
|
102
|
+
}),
|
103
|
+
draggableMixin,
|
104
|
+
proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),
|
105
|
+
componentNameValidationMixin,
|
106
|
+
customMixin
|
107
|
+
)(
|
108
|
+
createProxy({
|
109
|
+
slots: ['prefix', 'suffix'],
|
110
|
+
wrappedEleName: 'vaadin-text-field',
|
111
|
+
style: () => `
|
112
|
+
:host {
|
113
|
+
display: inline-block;
|
114
|
+
max-width: 100%;
|
115
|
+
padding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${
|
116
|
+
TextFieldClass.cssVarList.inputOutlineOffset
|
117
|
+
}));
|
118
|
+
box-sizing: border-box;
|
119
|
+
}
|
120
|
+
:host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {
|
121
|
+
opacity: 1;
|
122
|
+
}
|
123
|
+
|
124
|
+
vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {
|
125
|
+
opacity: 0;
|
126
|
+
}
|
127
|
+
vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {
|
128
|
+
opacity: 0;
|
129
|
+
}
|
130
|
+
${resetInputLabelPosition('vaadin-text-field')}
|
131
|
+
${useHostExternalPadding(TextFieldClass.cssVarList)}
|
132
|
+
${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}
|
133
|
+
${inputFloatingLabelStyle()}
|
134
|
+
|
135
|
+
vaadin-text-field vaadin-icon {
|
136
|
+
align-self: center;
|
137
|
+
}
|
138
|
+
`,
|
139
|
+
excludeAttrsSync: ['tabindex'],
|
140
|
+
componentName,
|
141
|
+
})
|
142
|
+
);
|
@@ -0,0 +1,151 @@
|
|
1
|
+
const {
|
2
|
+
host,
|
3
|
+
label,
|
4
|
+
placeholder,
|
5
|
+
requiredIndicator,
|
6
|
+
inputField,
|
7
|
+
input,
|
8
|
+
inputMask,
|
9
|
+
helperText,
|
10
|
+
errorMessage,
|
11
|
+
disabledPlaceholder,
|
12
|
+
inputDisabled,
|
13
|
+
inputIcon,
|
14
|
+
externalInput,
|
15
|
+
externalInputDisabled,
|
16
|
+
externalPlaceholder,
|
17
|
+
externalDisabledPlaceholder,
|
18
|
+
} = {
|
19
|
+
host: { selector: () => ':host' },
|
20
|
+
label: { selector: '::part(label)' },
|
21
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
22
|
+
placeholder: [
|
23
|
+
{ selector: '> input:placeholder-shown' },
|
24
|
+
{ selector: () => ':host::slotted(input:placeholder-shown)' },
|
25
|
+
],
|
26
|
+
disabledPlaceholder: { selector: '> input:disabled::placeholder' },
|
27
|
+
inputField: { selector: '::part(input-field)' },
|
28
|
+
input: { selector: 'input' },
|
29
|
+
inputMask: { selector: '::part(input-field)::before' },
|
30
|
+
inputDisabled: { selector: 'input:disabled' },
|
31
|
+
helperText: { selector: '::part(helper-text)' },
|
32
|
+
errorMessage: { selector: '::part(error-message)' },
|
33
|
+
inputIcon: { selector: 'vaadin-icon' },
|
34
|
+
externalInput: { selector: () => '::slotted(input)' },
|
35
|
+
externalInputDisabled: { selector: () => '::slotted(input:disabled)' },
|
36
|
+
externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },
|
37
|
+
externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },
|
38
|
+
};
|
39
|
+
|
40
|
+
export default {
|
41
|
+
// we apply font-size also on the host so we can set its width with em
|
42
|
+
fontSize: [{}, host],
|
43
|
+
fontFamily: [label, inputField, helperText, errorMessage],
|
44
|
+
|
45
|
+
labelFontSize: { ...label, property: 'font-size' },
|
46
|
+
labelFontWeight: { ...label, property: 'font-weight' },
|
47
|
+
|
48
|
+
labelTextColor: [
|
49
|
+
{ ...label, property: 'color' },
|
50
|
+
{ ...requiredIndicator, property: 'color' },
|
51
|
+
{ ...label, property: '-webkit-text-fill-color' },
|
52
|
+
{ ...requiredIndicator, property: '-webkit-text-fill-color' },
|
53
|
+
],
|
54
|
+
|
55
|
+
hostWidth: { ...host, property: 'width' },
|
56
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
57
|
+
hostDirection: { ...host, property: 'direction' },
|
58
|
+
inputDirection: { ...input, property: 'direction' },
|
59
|
+
|
60
|
+
inputBackgroundColor: [
|
61
|
+
{ ...inputField, property: 'background-color' },
|
62
|
+
{ ...inputMask, property: 'background-color' },
|
63
|
+
],
|
64
|
+
|
65
|
+
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
66
|
+
errorMessageIcon: { ...errorMessage, property: 'background-image' },
|
67
|
+
errorMessageIconSize: { ...errorMessage, property: 'background-size' },
|
68
|
+
errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },
|
69
|
+
errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },
|
70
|
+
errorMessageIconPosition: { ...errorMessage, property: 'background-position' },
|
71
|
+
|
72
|
+
helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },
|
73
|
+
|
74
|
+
inputValueTextColor: [
|
75
|
+
{ ...inputField, property: 'color' },
|
76
|
+
{ ...inputDisabled, property: '-webkit-text-fill-color' },
|
77
|
+
{ ...externalInputDisabled, property: '-webkit-text-fill-color' },
|
78
|
+
],
|
79
|
+
inputCaretTextColor: [
|
80
|
+
{ ...input, property: 'caret-color' },
|
81
|
+
{ ...externalInput, property: 'caret-color' },
|
82
|
+
],
|
83
|
+
|
84
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
85
|
+
|
86
|
+
inputBorderColor: { ...inputField, property: 'border-color' },
|
87
|
+
inputBorderWidth: { ...inputField, property: 'border-width' },
|
88
|
+
inputBorderStyle: { ...inputField, property: 'border-style' },
|
89
|
+
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
90
|
+
|
91
|
+
inputHeight: { ...inputField, property: 'height' },
|
92
|
+
inputHorizontalPadding: [
|
93
|
+
{ ...input, property: 'padding-left' },
|
94
|
+
{ ...input, property: 'padding-right' },
|
95
|
+
{ ...externalInput, property: 'padding-left' },
|
96
|
+
{ ...externalInput, property: 'padding-right' },
|
97
|
+
],
|
98
|
+
|
99
|
+
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
100
|
+
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
101
|
+
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
102
|
+
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
103
|
+
|
104
|
+
textAlign: {},
|
105
|
+
|
106
|
+
inputTextAlign: [
|
107
|
+
{ ...input, property: 'text-align' },
|
108
|
+
{ ...externalInput, property: 'text-align' },
|
109
|
+
],
|
110
|
+
|
111
|
+
inputPlaceholderColor: [
|
112
|
+
{ selector: () => ':host input:placeholder-shown', property: 'color' },
|
113
|
+
{ ...externalPlaceholder, property: 'color' },
|
114
|
+
{ ...placeholder, property: 'color' },
|
115
|
+
{ ...disabledPlaceholder, property: '-webkit-text-fill-color' },
|
116
|
+
{ ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },
|
117
|
+
],
|
118
|
+
|
119
|
+
labelPosition: { ...label, property: 'position' },
|
120
|
+
labelTopPosition: { ...label, property: 'top' },
|
121
|
+
labelHorizontalPosition: [
|
122
|
+
{ ...label, property: 'left' },
|
123
|
+
{ ...label, property: 'right' },
|
124
|
+
],
|
125
|
+
inputTransformY: { ...label, property: 'transform' },
|
126
|
+
inputTransition: { ...label, property: 'transition' },
|
127
|
+
marginInlineStart: { ...label, property: 'margin-inline-start' },
|
128
|
+
placeholderOpacity: [
|
129
|
+
{ selector: '> input:placeholder-shown', property: 'opacity' },
|
130
|
+
{ ...externalPlaceholder, property: 'opacity' },
|
131
|
+
],
|
132
|
+
inputVerticalAlignment: [
|
133
|
+
{ ...inputField, property: 'align-items' },
|
134
|
+
{ ...externalInput, property: 'align-items' },
|
135
|
+
],
|
136
|
+
valueInputHeight: [
|
137
|
+
{ ...input, property: 'height' },
|
138
|
+
{ ...externalInput, property: 'height' },
|
139
|
+
],
|
140
|
+
valueInputMarginBottom: [
|
141
|
+
{ ...input, property: 'margin-bottom' },
|
142
|
+
{ ...externalInput, property: 'margin-bottom' },
|
143
|
+
],
|
144
|
+
|
145
|
+
inputIconOffset: [
|
146
|
+
{ ...inputIcon, property: 'margin-right' },
|
147
|
+
{ ...inputIcon, property: 'margin-left' },
|
148
|
+
],
|
149
|
+
inputIconSize: { ...inputIcon, property: 'font-size' },
|
150
|
+
inputIconColor: { ...inputIcon, property: 'color' },
|
151
|
+
};
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
2
|
+
import { compose } from '../../helpers';
|
3
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
4
|
+
import { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../mixins';
|
5
|
+
import { IconClass } from '../descope-icon/IconClass';
|
6
|
+
import { LogoClass } from '../descope-logo/LogoClass';
|
7
|
+
import arrowsImg from './arrows.svg';
|
8
|
+
|
9
|
+
export const componentName = getComponentName('third-party-app-logo');
|
10
|
+
class RawThirdPartyAppLogoClass extends createBaseClass({
|
11
|
+
componentName,
|
12
|
+
baseSelector: '.wrapper',
|
13
|
+
}) {
|
14
|
+
constructor() {
|
15
|
+
super();
|
16
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
17
|
+
<style>
|
18
|
+
:host {
|
19
|
+
display: inline-flex;
|
20
|
+
}
|
21
|
+
:host([draggable="true"]) > div {
|
22
|
+
pointer-events: none
|
23
|
+
}
|
24
|
+
|
25
|
+
.wrapper {
|
26
|
+
display: flex;
|
27
|
+
justify-content: center;
|
28
|
+
align-items: center;
|
29
|
+
min-width: max-content;
|
30
|
+
}
|
31
|
+
|
32
|
+
.third-party-app-logo {
|
33
|
+
flex-shrink: 0;
|
34
|
+
display: inline-block;
|
35
|
+
max-width: 100%;
|
36
|
+
max-height: 100%;
|
37
|
+
object-fit: contain;
|
38
|
+
}
|
39
|
+
|
40
|
+
.company-logo-wrapper, .third-party-app-logo-wrapper {
|
41
|
+
flex-shrink: 0;
|
42
|
+
display: inline-flex;
|
43
|
+
}
|
44
|
+
|
45
|
+
.company-logo-wrapper {
|
46
|
+
justify-content: flex-end;
|
47
|
+
}
|
48
|
+
|
49
|
+
.third-party-app-logo-wrapper {
|
50
|
+
justify-content: flex-start;
|
51
|
+
}
|
52
|
+
|
53
|
+
.arrows {
|
54
|
+
flex-shrink: 0;
|
55
|
+
display: flex;
|
56
|
+
}
|
57
|
+
|
58
|
+
</style>
|
59
|
+
<div class="wrapper">
|
60
|
+
<div class="third-party-app-logo-wrapper">
|
61
|
+
<div class="third-party-app-logo"></div>
|
62
|
+
</div>
|
63
|
+
<div class="arrows">
|
64
|
+
<descope-icon src="${arrowsImg}"></descope-icon>
|
65
|
+
</div>
|
66
|
+
<div class="company-logo-wrapper">
|
67
|
+
<descope-logo></descope-logo>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
`;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
const companyLogoWrapper = '>.company-logo-wrapper';
|
75
|
+
const thirdPartyAppLogoWrapper = '>.third-party-app-logo-wrapper';
|
76
|
+
|
77
|
+
export const ThirdPartyAppLogoClass = compose(
|
78
|
+
createStyleMixin({
|
79
|
+
mappings: {
|
80
|
+
logoMaxHeight: [
|
81
|
+
{ selector: companyLogoWrapper, property: 'height' },
|
82
|
+
{ selector: thirdPartyAppLogoWrapper, property: 'height' },
|
83
|
+
],
|
84
|
+
logoMaxWidth: [
|
85
|
+
{ selector: companyLogoWrapper, property: 'max-width' },
|
86
|
+
{ selector: thirdPartyAppLogoWrapper, property: 'max-width' },
|
87
|
+
],
|
88
|
+
thirdPartyAppLogo: {
|
89
|
+
selector: () => '.third-party-app-logo',
|
90
|
+
property: 'content',
|
91
|
+
fallback: {},
|
92
|
+
},
|
93
|
+
companyLogoFallback: {
|
94
|
+
selector: LogoClass.componentName,
|
95
|
+
property: LogoClass.cssVarList.fallbackUrl,
|
96
|
+
},
|
97
|
+
gap: {},
|
98
|
+
arrowsColor: { selector: IconClass.componentName, property: IconClass.cssVarList.fill },
|
99
|
+
},
|
100
|
+
}),
|
101
|
+
draggableMixin,
|
102
|
+
componentNameValidationMixin
|
103
|
+
)(RawThirdPartyAppLogoClass);
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<svg width="29" height="28" viewBox="0 0 29 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M9.14492 15.645L7.49992 14L2.83325 18.6667L7.49992 23.3333L9.14492 21.6883L7.30159 19.8333H24.9999V17.5H7.30159L9.14492 15.645Z" fill="#636C74"/>
|
3
|
+
<path d="M19.855 12.3553L21.5 14.0003L26.1667 9.33366L21.5 4.66699L19.855 6.31199L21.6983 8.16699H4V10.5003H21.6983L19.855 12.3553Z" fill="#636C74"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
2
|
+
import { createCssVarImageClass } from '../../baseClasses/createCssVarImageClass';
|
3
|
+
|
4
|
+
export const componentName = getComponentName('totp-image');
|
5
|
+
|
6
|
+
export const TotpImageClass = createCssVarImageClass({
|
7
|
+
componentName,
|
8
|
+
varName: 'url',
|
9
|
+
fallbackVarName: 'fallbackUrl',
|
10
|
+
});
|
@@ -0,0 +1,236 @@
|
|
1
|
+
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
2
|
+
import { compose } from '../../helpers';
|
3
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
4
|
+
import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';
|
5
|
+
import { ButtonClass } from '../descope-button/ButtonClass';
|
6
|
+
import { getFileBase64, getFilename } from './helpers';
|
7
|
+
|
8
|
+
export const componentName = getComponentName('upload-file');
|
9
|
+
|
10
|
+
const observedAttributes = [
|
11
|
+
'title',
|
12
|
+
'description',
|
13
|
+
'button-label',
|
14
|
+
'accept',
|
15
|
+
'readonly',
|
16
|
+
'button-mode',
|
17
|
+
'button-variant',
|
18
|
+
'required',
|
19
|
+
'size',
|
20
|
+
'icon',
|
21
|
+
];
|
22
|
+
|
23
|
+
const BaseInputClass = createBaseInputClass({ componentName, baseSelector: ':host > div' });
|
24
|
+
|
25
|
+
class RawUploadFile extends BaseInputClass {
|
26
|
+
static get observedAttributes() {
|
27
|
+
return observedAttributes.concat(BaseInputClass.observedAttributes || []);
|
28
|
+
}
|
29
|
+
|
30
|
+
constructor() {
|
31
|
+
super();
|
32
|
+
|
33
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
34
|
+
<style>
|
35
|
+
:host {
|
36
|
+
display: flex;
|
37
|
+
}
|
38
|
+
:host > div {
|
39
|
+
display: flex;
|
40
|
+
align-items: center;
|
41
|
+
justify-content: center;
|
42
|
+
text-align: center;
|
43
|
+
flex-direction: column;
|
44
|
+
width: 100%;
|
45
|
+
}
|
46
|
+
.button-wrapper {
|
47
|
+
position: relative;
|
48
|
+
width: fit-content;
|
49
|
+
}
|
50
|
+
input {
|
51
|
+
position: absolute;
|
52
|
+
width: 100%;
|
53
|
+
height: 100%;
|
54
|
+
opacity: 0;
|
55
|
+
}
|
56
|
+
</style>
|
57
|
+
<div>
|
58
|
+
<slot name="icon"></slot>
|
59
|
+
<div class="title">
|
60
|
+
<span class="title-text"></span>
|
61
|
+
</div>
|
62
|
+
<div class="description"></div>
|
63
|
+
<div class="button-wrapper">
|
64
|
+
<input type="file" tabindex="-1" />
|
65
|
+
<descope-button></descope-button>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
`;
|
69
|
+
|
70
|
+
this.wrapperEle = this.shadowRoot.querySelector('.wrapper');
|
71
|
+
this.inputElement = this.shadowRoot.querySelector('input');
|
72
|
+
|
73
|
+
this.button.onclick = () => this.inputElement.click();
|
74
|
+
|
75
|
+
this.inputElement.onchange = async (e) => {
|
76
|
+
const receivedFileList = e.target.files;
|
77
|
+
|
78
|
+
if (!receivedFileList.length) {
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
|
82
|
+
this.value = await getFileBase64(receivedFileList[0]);
|
83
|
+
|
84
|
+
this.updateDescription(getFilename(receivedFileList[0]));
|
85
|
+
};
|
86
|
+
|
87
|
+
this.oninvalid = () => {
|
88
|
+
this.setAttribute('invalid', 'true');
|
89
|
+
};
|
90
|
+
}
|
91
|
+
|
92
|
+
// this is a temp solution,
|
93
|
+
// we should show the input error message like we have in all other inputs
|
94
|
+
/*
|
95
|
+
reportValidity() {
|
96
|
+
this.defaultReportValidity();
|
97
|
+
}
|
98
|
+
*/
|
99
|
+
|
100
|
+
getValidity() {
|
101
|
+
if (this.isRequired && !this.input.value) {
|
102
|
+
return { valueMissing: true };
|
103
|
+
}
|
104
|
+
this.removeAttribute('invalid');
|
105
|
+
return {};
|
106
|
+
}
|
107
|
+
|
108
|
+
initInputs() {
|
109
|
+
const button = this.rootElement.querySelector('descope-button');
|
110
|
+
button.onclick = () => this.inputElement.click();
|
111
|
+
}
|
112
|
+
|
113
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
114
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
115
|
+
|
116
|
+
if (oldValue !== newValue) {
|
117
|
+
if (attrName === 'title') {
|
118
|
+
this.updateTitle(newValue);
|
119
|
+
} else if (attrName === 'description') {
|
120
|
+
this.updateDescription(newValue);
|
121
|
+
} else if (attrName === 'button-label') {
|
122
|
+
this.updateButtonLabel(newValue);
|
123
|
+
} else if (attrName === 'button-mode') {
|
124
|
+
this.updateButtonMode(newValue);
|
125
|
+
} else if (attrName === 'button-variant') {
|
126
|
+
this.updateButtonVariant(newValue);
|
127
|
+
} else if (attrName === 'size') {
|
128
|
+
this.updateButtonSize(newValue);
|
129
|
+
} else if (attrName === 'accept') {
|
130
|
+
this.updateInputAccept(newValue);
|
131
|
+
} else if (attrName === 'readonly') {
|
132
|
+
this.updateReadOnly(newValue);
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
get button() {
|
138
|
+
return this.shadowRoot.querySelector('descope-button');
|
139
|
+
}
|
140
|
+
|
141
|
+
get input() {
|
142
|
+
return this.shadowRoot.querySelector('input');
|
143
|
+
}
|
144
|
+
|
145
|
+
get title() {
|
146
|
+
return this.shadowRoot.querySelector('.title-text');
|
147
|
+
}
|
148
|
+
|
149
|
+
get description() {
|
150
|
+
return this.shadowRoot.querySelector('.description');
|
151
|
+
}
|
152
|
+
|
153
|
+
get icon() {
|
154
|
+
return this.shadowRoot.querySelector('.icon');
|
155
|
+
}
|
156
|
+
|
157
|
+
updateTitle(val) {
|
158
|
+
this.title.innerHTML = val;
|
159
|
+
}
|
160
|
+
|
161
|
+
updateDescription(val) {
|
162
|
+
this.description.innerHTML = val;
|
163
|
+
}
|
164
|
+
|
165
|
+
updateButtonLabel(val) {
|
166
|
+
this.button.innerHTML = val;
|
167
|
+
}
|
168
|
+
|
169
|
+
updateButtonSize(val) {
|
170
|
+
this.button.setAttribute('size', val);
|
171
|
+
}
|
172
|
+
|
173
|
+
updateButtonMode(val) {
|
174
|
+
this.button.setAttribute('mode', val);
|
175
|
+
}
|
176
|
+
|
177
|
+
updateButtonVariant(val) {
|
178
|
+
this.button.setAttribute('variant', val);
|
179
|
+
}
|
180
|
+
|
181
|
+
updateInputAccept(val) {
|
182
|
+
this.input.setAttribute('accept', val);
|
183
|
+
}
|
184
|
+
|
185
|
+
updateReadOnly(val) {
|
186
|
+
if (val === 'true') {
|
187
|
+
this.input.setAttribute('disabled', 'true');
|
188
|
+
} else {
|
189
|
+
this.input.removeAttribute('disabled');
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
const buttonVars = ButtonClass.cssVarList;
|
195
|
+
const { host, wrapper, icon, title, description, requiredIndicator } = {
|
196
|
+
host: { selector: () => ':host' },
|
197
|
+
wrapper: { selector: () => ':host > div' },
|
198
|
+
icon: { selector: () => '::slotted(*)' },
|
199
|
+
title: { selector: () => '.title' },
|
200
|
+
description: { selector: () => '.description' },
|
201
|
+
requiredIndicator: { selector: () => '.title::after' },
|
202
|
+
};
|
203
|
+
|
204
|
+
export const UploadFileClass = compose(
|
205
|
+
createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),
|
206
|
+
createStyleMixin({
|
207
|
+
mappings: {
|
208
|
+
fontSize: {},
|
209
|
+
fontFamily: {},
|
210
|
+
borderColor: {},
|
211
|
+
borderWidth: {},
|
212
|
+
borderStyle: {},
|
213
|
+
borderRadius: {},
|
214
|
+
hostHeight: { ...host, property: 'height' },
|
215
|
+
hostWidth: { ...host, property: 'width' },
|
216
|
+
hostPadding: { property: 'padding' },
|
217
|
+
hostDirection: [
|
218
|
+
{ ...host, property: 'direction' },
|
219
|
+
{ selector: () => ButtonClass.componentName, property: buttonVars.hostDirection },
|
220
|
+
],
|
221
|
+
gap: { ...wrapper },
|
222
|
+
lineHeight: { ...wrapper, property: 'line-height' },
|
223
|
+
titleFontSize: { ...title, property: 'font-size' },
|
224
|
+
titleFontWeight: { ...title, property: 'font-weight' },
|
225
|
+
descriptionFontSize: { ...description, property: 'font-size' },
|
226
|
+
labelTextColor: [
|
227
|
+
{ ...title, property: 'color' },
|
228
|
+
{ ...description, property: 'color' },
|
229
|
+
],
|
230
|
+
iconSize: { ...icon, property: 'width' },
|
231
|
+
requiredIndicator: { ...requiredIndicator, property: 'content' },
|
232
|
+
},
|
233
|
+
}),
|
234
|
+
draggableMixin,
|
235
|
+
componentNameValidationMixin
|
236
|
+
)(RawUploadFile);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export const getFileBase64 = (fileObj) => {
|
2
|
+
return new Promise((resolve) => {
|
3
|
+
const reader = new FileReader();
|
4
|
+
reader.onload = (e) => resolve(e.target.result);
|
5
|
+
reader.readAsDataURL(fileObj);
|
6
|
+
});
|
7
|
+
};
|
8
|
+
|
9
|
+
export const getFilename = (fileObj) => {
|
10
|
+
return fileObj.name.replace(/^.*\\/, '');
|
11
|
+
};
|