@descope/web-components-ui 1.0.135 → 1.0.148
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +77 -56
- package/src/baseClasses/createBaseClass.js +18 -16
- package/src/baseClasses/createBaseInputClass.js +14 -8
- package/src/baseClasses/createCssVarImageClass.js +27 -23
- package/src/components/boolean-fields/booleanFieldMixin.js +18 -29
- package/src/components/boolean-fields/commonStyles.js +1 -1
- package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +46 -51
- package/src/components/boolean-fields/descope-boolean-field-internal/index.js +1 -1
- package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +80 -85
- package/src/components/boolean-fields/descope-checkbox/index.js +2 -2
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +88 -95
- package/src/components/boolean-fields/descope-switch-toggle/index.js +2 -2
- package/src/components/descope-button/ButtonClass.js +57 -47
- package/src/components/descope-button/clickableMixin.js +10 -0
- package/src/components/descope-combo-box/ComboBoxClass.js +156 -160
- package/src/components/descope-container/ContainerClass.js +32 -42
- package/src/components/descope-date-picker/index.js +9 -14
- package/src/components/descope-divider/DividerClass.js +52 -62
- package/src/components/descope-email-field/EmailFieldClass.js +25 -20
- package/src/components/descope-image/ImageClass.js +21 -24
- package/src/components/descope-link/LinkClass.js +31 -35
- package/src/components/descope-loader-linear/LoaderLinearClass.js +31 -36
- package/src/components/descope-loader-radial/LoaderRadialClass.js +23 -30
- package/src/components/descope-logo/LogoClass.js +5 -1
- package/src/components/descope-new-password/NewPasswordClass.js +63 -81
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +157 -162
- package/src/components/descope-new-password/descope-new-password-internal/componentName.js +1 -1
- package/src/components/descope-new-password/descope-new-password-internal/index.js +3 -3
- package/src/components/descope-new-password/index.js +3 -3
- package/src/components/descope-number-field/NumberFieldClass.js +25 -20
- package/src/components/descope-passcode/PasscodeClass.js +95 -95
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +151 -157
- package/src/components/descope-passcode/descope-passcode-internal/helpers.js +7 -8
- package/src/components/descope-passcode/descope-passcode-internal/index.js +2 -2
- package/src/components/descope-passcode/index.js +2 -2
- package/src/components/descope-password/PasswordClass.js +75 -83
- package/src/components/descope-password/passwordDraggableMixin.js +28 -27
- package/src/components/descope-phone-field/CountryCodes.js +1210 -1210
- package/src/components/descope-phone-field/PhoneFieldClass.js +139 -141
- package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +157 -173
- package/src/components/descope-phone-field/helpers.js +3 -3
- package/src/components/descope-text/TextClass.js +25 -29
- package/src/components/descope-text-area/TextAreaClass.js +68 -67
- package/src/components/descope-text-field/TextFieldClass.js +42 -37
- package/src/components/descope-text-field/textFieldMappings.js +40 -55
- package/src/components/descope-totp-image/TotpImageClass.js +5 -1
- package/src/components/descope-upload-file/UploadFileClass.js +202 -0
- package/src/components/descope-upload-file/helpers.js +11 -0
- package/src/components/descope-upload-file/index.js +6 -0
- package/src/constants.js +3 -3
- package/src/helpers/componentHelpers.js +68 -74
- package/src/helpers/index.js +17 -16
- package/src/helpers/mixinsHelpers.js +21 -10
- package/src/helpers/themeHelpers/colorsHelpers.js +18 -18
- package/src/helpers/themeHelpers/componentsThemeManager.js +7 -6
- package/src/helpers/themeHelpers/index.js +114 -124
- package/src/helpers/themeHelpers/resetHelpers.js +16 -16
- package/src/index.cjs.js +3 -3
- package/src/index.d.ts +22 -21
- package/src/index.js +5 -4
- package/src/index.umd.js +14 -13
- package/src/mixins/changeMixin.js +18 -17
- package/src/mixins/componentNameValidationMixin.js +19 -19
- package/src/mixins/createProxy.js +33 -33
- package/src/mixins/createStyleMixin/helpers.js +54 -64
- package/src/mixins/createStyleMixin/index.js +155 -141
- package/src/mixins/draggableMixin.js +61 -61
- package/src/mixins/hoverableMixin.js +11 -13
- package/src/mixins/index.js +6 -6
- package/src/mixins/inputEventsDispatchingMixin.js +61 -60
- package/src/mixins/inputValidationMixin.js +153 -148
- package/src/mixins/lifecycleEventsMixin.js +17 -15
- package/src/mixins/normalizeBooleanAttributesMixin.js +31 -23
- package/src/mixins/portalMixin.js +58 -52
- package/src/mixins/proxyInputMixin.js +138 -132
- package/src/theme/components/button.js +86 -81
- package/src/theme/components/checkbox.js +26 -28
- package/src/theme/components/comboBox.js +32 -31
- package/src/theme/components/container.js +99 -89
- package/src/theme/components/divider.js +30 -31
- package/src/theme/components/emailField.js +20 -19
- package/src/theme/components/image.js +3 -3
- package/src/theme/components/index.js +33 -25
- package/src/theme/components/inputWrapper.js +28 -25
- package/src/theme/components/link.js +29 -36
- package/src/theme/components/loader/index.js +3 -3
- package/src/theme/components/loader/loaderLinear.js +34 -34
- package/src/theme/components/loader/loaderRadial.js +40 -34
- package/src/theme/components/logo.js +4 -4
- package/src/theme/components/newPassword.js +14 -13
- package/src/theme/components/numberField.js +20 -19
- package/src/theme/components/passcode.js +20 -22
- package/src/theme/components/password.js +22 -21
- package/src/theme/components/phoneField.js +23 -23
- package/src/theme/components/switchToggle.js +47 -46
- package/src/theme/components/text.js +72 -72
- package/src/theme/components/textArea.js +27 -25
- package/src/theme/components/textField.js +23 -22
- package/src/theme/components/totpImage.js +4 -4
- package/src/theme/components/uploadFile.js +60 -0
- package/src/theme/globals.js +123 -124
- package/src/theme/index.js +1 -1
- package/dist/cjs/index.cjs.js +0 -5924
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/index.d.ts +0 -51
- package/dist/index.esm.js +0 -6606
- package/dist/index.esm.js.map +0 -1
- package/dist/umd/1018.js +0 -577
- package/dist/umd/1018.js.LICENSE.txt +0 -23
- package/dist/umd/2481.js +0 -1
- package/dist/umd/3208.js +0 -2
- package/dist/umd/3208.js.LICENSE.txt +0 -5
- package/dist/umd/3585.js +0 -1
- package/dist/umd/3878.js +0 -1
- package/dist/umd/4201.js +0 -1
- package/dist/umd/422.js +0 -2
- package/dist/umd/422.js.LICENSE.txt +0 -5
- package/dist/umd/4447.js +0 -1
- package/dist/umd/4513.js +0 -1
- package/dist/umd/4803.js +0 -1
- package/dist/umd/541.js +0 -744
- package/dist/umd/541.js.LICENSE.txt +0 -21
- package/dist/umd/5767.js +0 -2
- package/dist/umd/5767.js.LICENSE.txt +0 -15
- package/dist/umd/5806.js +0 -109
- package/dist/umd/5806.js.LICENSE.txt +0 -5
- package/dist/umd/7056.js +0 -48
- package/dist/umd/7056.js.LICENSE.txt +0 -5
- package/dist/umd/7101.js +0 -148
- package/dist/umd/7101.js.LICENSE.txt +0 -11
- package/dist/umd/729.js +0 -1
- package/dist/umd/7824.js +0 -229
- package/dist/umd/7824.js.LICENSE.txt +0 -27
- package/dist/umd/7840.js +0 -356
- package/dist/umd/7840.js.LICENSE.txt +0 -61
- package/dist/umd/8725.js +0 -37
- package/dist/umd/8725.js.LICENSE.txt +0 -11
- package/dist/umd/9211.js +0 -312
- package/dist/umd/9211.js.LICENSE.txt +0 -5
- package/dist/umd/9241.js +0 -1
- package/dist/umd/9314.js +0 -283
- package/dist/umd/9314.js.LICENSE.txt +0 -27
- package/dist/umd/9437.js +0 -19
- package/dist/umd/9437.js.LICENSE.txt +0 -5
- package/dist/umd/9515.js +0 -202
- package/dist/umd/9515.js.LICENSE.txt +0 -11
- package/dist/umd/9789.js +0 -1
- package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +0 -1
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +0 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +0 -1
- package/dist/umd/descope-button-index-js.js +0 -1
- package/dist/umd/descope-combo-box-index-js.js +0 -1
- package/dist/umd/descope-container-index-js.js +0 -1
- package/dist/umd/descope-date-picker-index-js.js +0 -1
- package/dist/umd/descope-divider-index-js.js +0 -1
- package/dist/umd/descope-email-field-index-js.js +0 -1
- package/dist/umd/descope-image-index-js.js +0 -1
- package/dist/umd/descope-link-index-js.js +0 -1
- package/dist/umd/descope-loader-linear-index-js.js +0 -1
- package/dist/umd/descope-loader-radial-index-js.js +0 -1
- package/dist/umd/descope-logo-index-js.js +0 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +0 -1
- package/dist/umd/descope-new-password-index-js.js +0 -1
- package/dist/umd/descope-number-field-index-js.js +0 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +0 -1
- package/dist/umd/descope-passcode-index-js.js +0 -1
- package/dist/umd/descope-password-index-js.js +0 -1
- package/dist/umd/descope-phone-field-descope-phone-field-internal-index-js.js +0 -1
- package/dist/umd/descope-phone-field-index-js.js +0 -1
- package/dist/umd/descope-text-area-index-js.js +0 -1
- package/dist/umd/descope-text-field-index-js.js +0 -1
- package/dist/umd/descope-text-index-js.js +0 -1
- package/dist/umd/descope-totp-image-index-js.js +0 -1
- package/dist/umd/index.js +0 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
createStyleMixin,
|
3
|
+
draggableMixin,
|
4
|
+
createProxy,
|
5
|
+
proxyInputMixin,
|
6
|
+
componentNameValidationMixin,
|
7
7
|
} from '../../mixins';
|
8
8
|
import { compose } from '../../helpers';
|
9
9
|
import { getComponentName } from '../../helpers/componentHelpers';
|
@@ -13,90 +13,82 @@ import { resetInputCursor, useHostExternalPadding } from '../../helpers/themeHel
|
|
13
13
|
export const componentName = getComponentName('password');
|
14
14
|
|
15
15
|
const {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
host,
|
17
|
+
inputField,
|
18
|
+
inputElement,
|
19
|
+
inputElementPlaceholder,
|
20
|
+
revealButtonContainer,
|
21
|
+
revealButtonIcon,
|
22
|
+
label,
|
23
|
+
requiredIndicator,
|
24
|
+
errorMessage,
|
25
|
+
helperText,
|
26
26
|
} = {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
27
|
+
host: { selector: () => ':host' },
|
28
|
+
inputField: { selector: '::part(input-field)' },
|
29
|
+
inputElement: { selector: '> input' },
|
30
|
+
inputElementPlaceholder: { selector: '> input:placeholder-shown' },
|
31
|
+
revealButtonContainer: { selector: () => '::part(reveal-button)' },
|
32
|
+
revealButtonIcon: { selector: () => '::part(reveal-button)::before' },
|
33
|
+
label: { selector: '::part(label)' },
|
34
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
35
|
+
helperText: { selector: '::part(helper-text)' },
|
36
|
+
errorMessage: { selector: '::part(error-message)' },
|
37
|
+
};
|
38
38
|
|
39
39
|
export const PasswordClass = compose(
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
helperText
|
53
|
-
],
|
54
|
-
inputHeight: { ...inputField, property: 'height' },
|
55
|
-
inputHorizontalPadding: [
|
56
|
-
{ ...inputElement, property: 'padding-left' },
|
57
|
-
{ ...inputElement, property: 'padding-right' }
|
58
|
-
],
|
59
|
-
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
40
|
+
createStyleMixin({
|
41
|
+
mappings: {
|
42
|
+
hostWidth: { ...host, property: 'width' },
|
43
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
44
|
+
fontSize: [{}, host],
|
45
|
+
fontFamily: [label, inputField, errorMessage, helperText],
|
46
|
+
inputHeight: { ...inputField, property: 'height' },
|
47
|
+
inputHorizontalPadding: [
|
48
|
+
{ ...inputElement, property: 'padding-left' },
|
49
|
+
{ ...inputElement, property: 'padding-right' },
|
50
|
+
],
|
51
|
+
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
60
52
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
53
|
+
inputBorderStyle: { ...inputField, property: 'border-style' },
|
54
|
+
inputBorderWidth: { ...inputField, property: 'border-width' },
|
55
|
+
inputBorderColor: { ...inputField, property: 'border-color' },
|
56
|
+
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
65
57
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
58
|
+
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
59
|
+
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
60
|
+
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
61
|
+
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
70
62
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
63
|
+
labelTextColor: [
|
64
|
+
{ ...label, property: 'color' },
|
65
|
+
{ ...requiredIndicator, property: 'color' },
|
66
|
+
],
|
67
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
68
|
+
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
76
69
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
70
|
+
inputValueTextColor: [
|
71
|
+
{ ...inputElement, property: 'color' },
|
72
|
+
{ ...revealButtonIcon, property: 'color' },
|
73
|
+
],
|
74
|
+
inputPlaceholderTextColor: { ...inputElementPlaceholder, property: 'color' },
|
82
75
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
passwordDraggableMixin
|
76
|
+
revealButtonOffset: [
|
77
|
+
{ ...revealButtonContainer, property: 'margin-right' },
|
78
|
+
{ ...revealButtonContainer, property: 'margin-left' },
|
79
|
+
],
|
80
|
+
revealButtonSize: { ...revealButtonContainer, property: 'font-size' },
|
81
|
+
},
|
82
|
+
}),
|
83
|
+
draggableMixin,
|
84
|
+
proxyInputMixin,
|
85
|
+
componentNameValidationMixin,
|
86
|
+
passwordDraggableMixin
|
95
87
|
)(
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
88
|
+
createProxy({
|
89
|
+
slots: ['suffix'],
|
90
|
+
wrappedEleName: 'vaadin-password-field',
|
91
|
+
style: () => `
|
100
92
|
:host {
|
101
93
|
display: inline-block;
|
102
94
|
max-width: 100%;
|
@@ -145,7 +137,7 @@ export const PasswordClass = compose(
|
|
145
137
|
box-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});
|
146
138
|
}
|
147
139
|
`,
|
148
|
-
|
149
|
-
|
150
|
-
|
140
|
+
excludeAttrsSync: ['tabindex'],
|
141
|
+
componentName,
|
142
|
+
})
|
151
143
|
);
|
@@ -1,34 +1,35 @@
|
|
1
|
-
const passwordDraggableMixin = (superclass) =>
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
const passwordDraggableMixin = (superclass) =>
|
2
|
+
class PasswordDraggableMixinClass extends superclass {
|
3
|
+
get isReadOnly() {
|
4
|
+
return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';
|
5
|
+
}
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
+
this.addEventListener('mousedown', (e) => {
|
12
|
+
if (this.isDraggable && this.isReadOnly) {
|
13
|
+
const inputEle = this.baseElement.querySelector('input');
|
14
|
+
const prevType = inputEle.getAttribute('type');
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
inputEle.setAttribute('type', 'text');
|
17
|
+
setTimeout(() => inputEle.focus());
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
const onComplete = (_) => {
|
20
|
+
inputEle.setAttribute('type', prevType);
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
e.target.removeEventListener('mouseup', onComplete);
|
23
|
+
e.target.removeEventListener('dragend', onComplete);
|
24
|
+
};
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
e.target.addEventListener('mouseup', onComplete, { once: true });
|
27
|
+
e.target.addEventListener('dragend', onComplete, { once: true });
|
28
|
+
}
|
29
|
+
});
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
}
|
31
|
+
super.init?.();
|
32
|
+
}
|
33
|
+
};
|
33
34
|
|
34
|
-
export default passwordDraggableMixin
|
35
|
+
export default passwordDraggableMixin;
|