@descope/web-components-ui 1.0.97 → 1.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +245 -162
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/0.js +1 -0
- package/dist/umd/447.js +1 -1
- package/dist/umd/878.js +1 -1
- package/dist/umd/890.js +1 -0
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-combo-box-index-js.js +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/dist/umd/descope-date-picker-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-image-index-js.js +1 -1
- package/dist/umd/descope-link-index-js.js +1 -1
- package/dist/umd/descope-loader-linear-index-js.js +1 -1
- package/dist/umd/descope-loader-radial-index-js.js +1 -1
- package/dist/umd/descope-logo-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-password-field-index-js.js +1 -1
- package/dist/umd/descope-phone-field-index-js.js +1 -1
- package/dist/umd/descope-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/descope-text-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/src/baseClasses/createBaseInputClass.js +1 -2
- package/src/components/descope-email-field/EmailField.js +4 -2
- package/src/components/descope-link/Link.js +1 -2
- package/src/components/descope-loader-linear/LoaderLinear.js +1 -1
- package/src/components/descope-passcode/Passcode.js +12 -4
- package/src/components/descope-password-field/PasswordField.js +21 -5
- package/src/components/descope-password-field/passwordDraggableMixin.js +33 -0
- package/src/components/descope-text-area/TextArea.js +38 -20
- package/src/components/descope-text-field/TextField.js +4 -2
- package/src/components/descope-text-field/textFieldMappings.js +7 -3
- package/src/mixins/createStyleMixin/index.js +4 -7
- package/src/mixins/draggableMixin.js +6 -4
- package/src/mixins/index.js +0 -1
- package/src/mixins/inputValidationMixin.js +5 -1
- package/src/mixins/proxyInputMixin.js +1 -1
- package/src/theme/components/checkbox.js +1 -1
- package/src/theme/components/container.js +10 -1
- package/src/theme/components/passcode.js +3 -3
- package/src/theme/components/passwordField.js +11 -1
- package/src/theme/components/textArea.js +9 -9
- package/src/theme/components/textField.js +6 -7
- package/src/theme/globals.js +5 -3
- package/dist/umd/387.js +0 -1
- package/dist/umd/988.js +0 -1
- package/src/mixins/readOnlyMixin.js +0 -18
@@ -10,11 +10,20 @@ import { getComponentName } from '../../helpers/componentHelpers';
|
|
10
10
|
|
11
11
|
export const componentName = getComponentName('text-area');
|
12
12
|
|
13
|
-
const
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
const {
|
14
|
+
host,
|
15
|
+
placeholder,
|
16
|
+
input,
|
17
|
+
textArea,
|
18
|
+
label,
|
19
|
+
requiredIndicator
|
20
|
+
} = {
|
21
|
+
host: { selector: () => ':host' },
|
22
|
+
textArea: { selector: '> textarea' },
|
23
|
+
label: { selector: '::part(label)' },
|
24
|
+
input: { selector: '::part(input-field)' },
|
25
|
+
placeholder: { selector: 'textarea:placeholder-shown' },
|
26
|
+
requiredIndicator: { selector: '::part(required-indicator)::after' },
|
18
27
|
};
|
19
28
|
|
20
29
|
let overrides = ``;
|
@@ -22,19 +31,24 @@ let overrides = ``;
|
|
22
31
|
const TextArea = compose(
|
23
32
|
createStyleMixin({
|
24
33
|
mappings: {
|
25
|
-
resize:
|
26
|
-
color:
|
34
|
+
resize: textArea,
|
35
|
+
color: textArea,
|
27
36
|
cursor: {},
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
labelColor: [
|
38
|
+
{ ...label, property: 'color' },
|
39
|
+
{ ...requiredIndicator, property: 'color' }
|
40
|
+
],
|
41
|
+
placeholderColor: { ...placeholder, property: 'color' },
|
42
|
+
width: host,
|
43
|
+
backgroundColor: input,
|
44
|
+
borderWidth: input,
|
45
|
+
borderStyle: input,
|
46
|
+
borderColor: input,
|
47
|
+
borderRadius: input,
|
48
|
+
outlineWidth: input,
|
49
|
+
outlineStyle: input,
|
50
|
+
outlineColor: input,
|
51
|
+
outlineOffset: [input, { property: 'padding' }],
|
38
52
|
}
|
39
53
|
}),
|
40
54
|
draggableMixin,
|
@@ -58,6 +72,7 @@ overrides = `
|
|
58
72
|
vaadin-text-area {
|
59
73
|
margin: 0;
|
60
74
|
width: 100%;
|
75
|
+
box-sizing: border-box;
|
61
76
|
}
|
62
77
|
vaadin-text-area > label,
|
63
78
|
vaadin-text-area::part(input-field) {
|
@@ -66,9 +81,12 @@ overrides = `
|
|
66
81
|
vaadin-text-area[focused]::part(input-field) {
|
67
82
|
cursor: text;
|
68
83
|
}
|
69
|
-
vaadin-text-area::part(required-indicator)::after {
|
70
|
-
font-size: "12px";
|
84
|
+
vaadin-text-area[required]::part(required-indicator)::after {
|
71
85
|
content: "*";
|
72
|
-
}
|
86
|
+
}
|
87
|
+
vaadin-text-area[disabled] > textarea:placeholder-shown,
|
88
|
+
vaadin-text-area[readonly] > textarea:placeholder-shown {
|
89
|
+
opacity: 1;
|
90
|
+
}
|
73
91
|
`;
|
74
92
|
export default TextArea;
|
@@ -63,6 +63,7 @@ overrides = `
|
|
63
63
|
padding: 0;
|
64
64
|
width: 100%;
|
65
65
|
height: 100%;
|
66
|
+
box-sizing: border-box;
|
66
67
|
}
|
67
68
|
|
68
69
|
vaadin-text-field::part(input-field) {
|
@@ -98,10 +99,11 @@ overrides = `
|
|
98
99
|
content: "*";
|
99
100
|
color: var(${TextField.cssVarList.color});
|
100
101
|
}
|
101
|
-
vaadin-text-field
|
102
|
-
|
102
|
+
vaadin-text-field::part(input-field)::after {
|
103
|
+
opacity: 0 !important;
|
103
104
|
}
|
104
105
|
|
106
|
+
|
105
107
|
vaadin-text-field::before {
|
106
108
|
height: unset;
|
107
109
|
}
|
@@ -28,15 +28,19 @@ export default {
|
|
28
28
|
|
29
29
|
// we apply font-size also on the host so we can set its width with em
|
30
30
|
fontSize: [{}, { selector: selectors.host }],
|
31
|
-
|
31
|
+
|
32
32
|
height: { selector: selectors.inputWrapper },
|
33
33
|
padding: { selector: selectors.inputWrapper },
|
34
34
|
margin: { selector: selectors.inputWrapper },
|
35
35
|
caretColor: { selector: selectors.input },
|
36
36
|
outlineColor: { selector: selectors.inputWrapper },
|
37
37
|
outlineStyle: { selector: selectors.inputWrapper },
|
38
|
-
outlineWidth:
|
38
|
+
outlineWidth: [
|
39
|
+
{ selector: selectors.inputWrapper },
|
40
|
+
// we need to make sure there is enough space for the outline
|
41
|
+
{ property: 'padding' }
|
42
|
+
],
|
39
43
|
outlineOffset: { selector: selectors.inputWrapper },
|
40
|
-
textAlign: {selector: selectors.input},
|
44
|
+
textAlign: { selector: selectors.input },
|
41
45
|
placeholderColor: { selector: selectors.placeholder, property: 'color' }
|
42
46
|
};
|
@@ -46,6 +46,10 @@ export const createStyleMixin =
|
|
46
46
|
this.#styleAttributes = Object.keys(mappings).map((key) =>
|
47
47
|
kebabCaseJoin(STYLE_OVERRIDE_ATTR_PREFIX, componentNameSuffix, key)
|
48
48
|
);
|
49
|
+
|
50
|
+
this.#createMappingStyle();
|
51
|
+
this.#createComponentTheme();
|
52
|
+
this.#createOverridesStyle();
|
49
53
|
}
|
50
54
|
|
51
55
|
get componentTheme() {
|
@@ -116,15 +120,8 @@ export const createStyleMixin =
|
|
116
120
|
init() {
|
117
121
|
super.init?.();
|
118
122
|
if (this.shadowRoot.isConnected) {
|
119
|
-
|
120
123
|
this.#addClassName(superclass.componentName)
|
121
124
|
|
122
|
-
// TODO: we should do everything we can on the constructor
|
123
|
-
// when dragging & dropping these styles are created over & over
|
124
|
-
this.#createMappingStyle();
|
125
|
-
this.#createComponentTheme();
|
126
|
-
this.#createOverridesStyle();
|
127
|
-
|
128
125
|
// this is instead attributeChangedCallback because we cannot use static methods in this case
|
129
126
|
observeAttributes(this, this.#updateOverridesStyle.bind(this), {})
|
130
127
|
}
|
@@ -22,22 +22,24 @@ export const draggableMixin = (superclass) =>
|
|
22
22
|
}
|
23
23
|
}
|
24
24
|
|
25
|
-
get
|
25
|
+
get isDraggable() {
|
26
26
|
return this.hasAttribute('draggable') && this.getAttribute('draggable') !== 'false'
|
27
27
|
}
|
28
28
|
|
29
29
|
init() {
|
30
|
-
|
31
30
|
// because we are delegating the focus from the outer component,
|
32
31
|
// the D&D is not working well in the page editor
|
33
32
|
// in order to solve it we are making the inner component focusable on mouse down
|
34
33
|
// and removing it on complete
|
35
34
|
this.addEventListener('mousedown', (e) => {
|
36
|
-
if (this
|
35
|
+
if (this.isDraggable) {
|
36
|
+
const prevTabIndex = this.baseElement.getAttribute('tabindex')
|
37
37
|
this.baseElement.setAttribute('tabindex', '-1');
|
38
38
|
|
39
39
|
const onComplete = () => {
|
40
|
-
|
40
|
+
prevTabIndex ?
|
41
|
+
this.baseElement.setAttribute('tabindex', prevTabIndex) :
|
42
|
+
this.baseElement.removeAttribute('tabindex');
|
41
43
|
|
42
44
|
e.target.removeEventListener('mouseup', onComplete)
|
43
45
|
e.target.removeEventListener('dragend', onComplete)
|
package/src/mixins/index.js
CHANGED
@@ -8,6 +8,5 @@ export { inputValidationMixin } from './inputValidationMixin'
|
|
8
8
|
export { portalMixin } from './portalMixin'
|
9
9
|
export { changeMixin } from './changeMixin'
|
10
10
|
export { normalizeBooleanAttributesMixin } from './normalizeBooleanAttributesMixin'
|
11
|
-
export { readOnlyMixin } from './readOnlyMixin'
|
12
11
|
export { lifecycleEventsMixin } from './lifecycleEventsMixin'
|
13
12
|
export { inputEventsDispatchingMixin } from './inputEventsDispatchingMixin'
|
@@ -67,7 +67,7 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
|
|
67
67
|
}
|
68
68
|
|
69
69
|
#setValidity() {
|
70
|
-
const validity = this.getValidity()
|
70
|
+
const validity = this.isReadOnly ? {} : this.getValidity()
|
71
71
|
this.#internals.setValidity(validity, this.getErrorMessage(validity), this.validationTarget)
|
72
72
|
}
|
73
73
|
|
@@ -108,6 +108,10 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
|
|
108
108
|
return this.hasAttribute('required') && this.getAttribute('required') !== 'false'
|
109
109
|
}
|
110
110
|
|
111
|
+
get isReadOnly() {
|
112
|
+
return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false'
|
113
|
+
}
|
114
|
+
|
111
115
|
get pattern() {
|
112
116
|
return this.getAttribute('pattern')
|
113
117
|
}
|
@@ -109,7 +109,7 @@ export const proxyInputMixin = (superclass) =>
|
|
109
109
|
this.#dispatchChange()
|
110
110
|
})
|
111
111
|
|
112
|
-
this.addEventListener('blur', () => {
|
112
|
+
this.#inputElement.addEventListener('blur', () => {
|
113
113
|
if (!this.checkValidity()) {
|
114
114
|
this.setAttribute('invalid', 'true')
|
115
115
|
this.#handleErrorMessage()
|
@@ -88,7 +88,7 @@ const container = {
|
|
88
88
|
[vars.boxShadow]: `${globalRefs.shadow.wide.xl} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.xl} ${helperRefs.shadowColor}`
|
89
89
|
},
|
90
90
|
'2xl': {
|
91
|
-
[helperVars.shadowColor]: '#00000050',
|
91
|
+
[helperVars.shadowColor]: '#00000050', // mimic daisyUI shadow settings
|
92
92
|
[vars.boxShadow]: `${globalRefs.shadow.wide['2xl']} ${helperRefs.shadowColor}`
|
93
93
|
},
|
94
94
|
},
|
@@ -103,6 +103,15 @@ const container = {
|
|
103
103
|
lg: {
|
104
104
|
[vars.borderRadius]: globalRefs.radius.lg
|
105
105
|
},
|
106
|
+
xl: {
|
107
|
+
[vars.borderRadius]: globalRefs.radius.xl
|
108
|
+
},
|
109
|
+
'2xl': {
|
110
|
+
[vars.borderRadius]: globalRefs.radius['2xl']
|
111
|
+
},
|
112
|
+
'3xl': {
|
113
|
+
[vars.borderRadius]: globalRefs.radius['3xl']
|
114
|
+
},
|
106
115
|
}
|
107
116
|
};
|
108
117
|
|
@@ -8,12 +8,12 @@ const globalRefs = getThemeRefs(globals);
|
|
8
8
|
const passcode = {
|
9
9
|
[vars.backgroundColor]: globalRefs.colors.surface.light,
|
10
10
|
[vars.outlineWidth]: '2px',
|
11
|
-
[vars.outlineColor]:
|
11
|
+
[vars.outlineColor]: 'transparent',
|
12
12
|
[vars.padding]: '0',
|
13
13
|
[vars.textAlign]: 'center',
|
14
14
|
[vars.borderColor]: 'transparent',
|
15
15
|
[vars.digitsGap]: '4px',
|
16
|
-
[vars.
|
16
|
+
[vars.focusedDigitFieldBorderColor]: globalRefs.colors.primary.main,
|
17
17
|
|
18
18
|
_hideCursor: {
|
19
19
|
[vars.caretColor]: 'transparent',
|
@@ -34,7 +34,7 @@ const passcode = {
|
|
34
34
|
_invalid: {
|
35
35
|
[vars.borderColor]: globalRefs.colors.error.main,
|
36
36
|
[vars.color]: globalRefs.colors.error.main,
|
37
|
-
[vars.
|
37
|
+
[vars.focusedDigitFieldBorderColor]: globalRefs.colors.error.light,
|
38
38
|
},
|
39
39
|
}
|
40
40
|
|
@@ -11,6 +11,11 @@ const passwordField = {
|
|
11
11
|
[vars.wrapperBorderWidth]: '1px',
|
12
12
|
[vars.wrapperBorderColor]: 'transparent',
|
13
13
|
[vars.wrapperBorderRadius]: globalRefs.radius.sm,
|
14
|
+
[vars.backgroundColor]: globalRefs.colors.surface.light,
|
15
|
+
|
16
|
+
[vars.outlineWidth]: '2px',
|
17
|
+
[vars.outlineStyle]: 'solid',
|
18
|
+
[vars.outlineColor]: 'transparent',
|
14
19
|
|
15
20
|
[vars.labelTextColor]: globalRefs.colors.surface.contrast,
|
16
21
|
[vars.inputTextColor]: globalRefs.colors.surface.contrast,
|
@@ -52,11 +57,16 @@ const passwordField = {
|
|
52
57
|
[vars.width]: '100%'
|
53
58
|
},
|
54
59
|
|
60
|
+
_focused: {
|
61
|
+
[vars.outlineColor]: globalRefs.colors.surface.main
|
62
|
+
},
|
63
|
+
|
55
64
|
_invalid: {
|
56
65
|
[vars.labelTextColor]: globalRefs.colors.error.main,
|
57
66
|
[vars.inputTextColor]: globalRefs.colors.error.main,
|
58
67
|
[vars.placeholderTextColor]: globalRefs.colors.error.light,
|
59
|
-
[vars.wrapperBorderColor]: globalRefs.colors.error.main
|
68
|
+
[vars.wrapperBorderColor]: globalRefs.colors.error.main,
|
69
|
+
[vars.outlineColor]: globalRefs.colors.error.main,
|
60
70
|
},
|
61
71
|
};
|
62
72
|
|
@@ -6,36 +6,36 @@ const globalRefs = getThemeRefs(globals);
|
|
6
6
|
const vars = TextArea.cssVarList;
|
7
7
|
|
8
8
|
const textArea = {
|
9
|
-
[vars.
|
9
|
+
[vars.labelColor]: globalRefs.colors.surface.contrast,
|
10
|
+
[vars.placeholderColor]: globalRefs.colors.surface.main,
|
11
|
+
[vars.color]: globalRefs.colors.surface.contrast,
|
12
|
+
|
10
13
|
[vars.backgroundColor]: globalRefs.colors.surface.light,
|
11
14
|
[vars.resize]: 'vertical',
|
12
15
|
|
13
16
|
[vars.borderRadius]: globalRefs.radius.sm,
|
14
17
|
[vars.borderWidth]: '1px',
|
15
18
|
[vars.borderStyle]: 'solid',
|
16
|
-
[vars.borderColor]:
|
19
|
+
[vars.borderColor]: globalRefs.colors.surface.main,
|
17
20
|
[vars.outlineWidth]: '2px',
|
18
21
|
[vars.outlineStyle]: 'solid',
|
19
22
|
[vars.outlineColor]: 'transparent',
|
23
|
+
[vars.outlineOffset]: '0px',
|
20
24
|
|
21
|
-
|
22
|
-
|
23
|
-
[vars.borderColor]: globalRefs.colors.surface.main
|
25
|
+
_fullWidth: {
|
26
|
+
[vars.width]: '100%'
|
24
27
|
},
|
25
28
|
|
26
29
|
_focused: {
|
27
30
|
[vars.outlineColor]: globalRefs.colors.surface.main
|
28
31
|
},
|
29
32
|
|
30
|
-
_fullWidth: {
|
31
|
-
[vars.width]: '100%'
|
32
|
-
},
|
33
|
-
|
34
33
|
_disabled: {
|
35
34
|
[vars.cursor]: 'not-allowed'
|
36
35
|
},
|
37
36
|
|
38
37
|
_invalid: {
|
38
|
+
[vars.labelColor]: globalRefs.colors.error.main,
|
39
39
|
[vars.outlineColor]: globalRefs.colors.error.main
|
40
40
|
}
|
41
41
|
};
|
@@ -7,31 +7,32 @@ const globalRefs = getThemeRefs(globals);
|
|
7
7
|
const vars = TextField.cssVarList;
|
8
8
|
|
9
9
|
export const textField = (vars) => ({
|
10
|
+
[vars.padding]: '0 1em',
|
11
|
+
|
12
|
+
[vars.outlineWidth]: '2px',
|
13
|
+
[vars.outlineStyle]: 'solid',
|
14
|
+
[vars.outlineColor]: 'transparent',
|
15
|
+
|
10
16
|
size: {
|
11
17
|
xs: {
|
12
18
|
[vars.height]: '14px',
|
13
19
|
[vars.fontSize]: '8px',
|
14
|
-
[vars.padding]: `0 ${globalRefs.spacing.xs}`
|
15
20
|
},
|
16
21
|
sm: {
|
17
22
|
[vars.height]: '20px',
|
18
23
|
[vars.fontSize]: '10px',
|
19
|
-
[vars.padding]: `0 ${globalRefs.spacing.sm}`
|
20
24
|
},
|
21
25
|
md: {
|
22
26
|
[vars.height]: '30px',
|
23
27
|
[vars.fontSize]: '14px',
|
24
|
-
[vars.padding]: `0 ${globalRefs.spacing.md}`
|
25
28
|
},
|
26
29
|
lg: {
|
27
30
|
[vars.height]: '40px',
|
28
31
|
[vars.fontSize]: '20px',
|
29
|
-
[vars.padding]: `0 ${globalRefs.spacing.lg}`
|
30
32
|
},
|
31
33
|
xl: {
|
32
34
|
[vars.height]: '50px',
|
33
35
|
[vars.fontSize]: '25px',
|
34
|
-
[vars.padding]: `0 ${globalRefs.spacing.xl}`
|
35
36
|
}
|
36
37
|
},
|
37
38
|
|
@@ -56,8 +57,6 @@ export const textField = (vars) => ({
|
|
56
57
|
},
|
57
58
|
|
58
59
|
_focused: {
|
59
|
-
[vars.outlineWidth]: '2px',
|
60
|
-
[vars.outlineStyle]: 'solid',
|
61
60
|
[vars.outlineColor]: globalRefs.colors.surface.main
|
62
61
|
},
|
63
62
|
|
package/src/theme/globals.js
CHANGED
@@ -85,12 +85,12 @@ const typography = {
|
|
85
85
|
},
|
86
86
|
body1: {
|
87
87
|
font: fontsRef.font1.family,
|
88
|
-
weight: '
|
88
|
+
weight: '400',
|
89
89
|
size: '16px'
|
90
90
|
},
|
91
91
|
body2: {
|
92
92
|
font: fontsRef.font1.family,
|
93
|
-
weight: '
|
93
|
+
weight: '400',
|
94
94
|
size: '14px'
|
95
95
|
}
|
96
96
|
};
|
@@ -116,7 +116,9 @@ const radius = {
|
|
116
116
|
sm: '10px',
|
117
117
|
md: '15px',
|
118
118
|
lg: '20px',
|
119
|
-
xl: '25px'
|
119
|
+
xl: '25px',
|
120
|
+
'2xl': '30px',
|
121
|
+
'3xl': '35px'
|
120
122
|
};
|
121
123
|
|
122
124
|
const shadow = {
|
package/dist/umd/387.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[387],{3387:(t,e,r)=>{r.d(e,{Z:()=>h,f:()=>n});var o=r(4988),p=r(2061);const n=(0,r(4567).iY)("password-field"),{host:a,inputWrapper:l,inputElement:i,inputElementPlaceholder:d,revealButton:s,revealButtonIcon:c,label:u,requiredIndicator:f}={host:()=>":host",inputWrapper:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButton:{selector:"vaadin-password-field-button"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"> label"},requiredIndicator:{selector:"::part(required-indicator)::after"}},h=(0,p.qC)((0,o.yk)({mappings:{wrapperBorderStyle:{...l,property:"border-style"},wrapperBorderWidth:{...l,property:"border-width"},wrapperBorderColor:{...l,property:"border-color"},wrapperBorderRadius:{...l,property:"border-radius"},labelTextColor:[{...u,property:"color"},{...f,property:"color"}],inputTextColor:[{...i,property:"color"},{...c,property:"color"}],placeholderTextColor:{...d,property:"color"},fontSize:[{},a],height:l,padding:l,pointerCursor:[{...s,property:"cursor"},{...u,property:"cursor"},{...f,property:"cursor"}]}}),o.e4,o.dj,o.Ae)((0,o.DM)({slots:["suffix"],wrappedEleName:"vaadin-password-field",style:"\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbackground: transparent;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\t\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t",excludeAttrsSync:["tabindex"],componentName:n}))}}]);
|
package/dist/umd/988.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[988],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}};var a=s(8084);const o=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.A,r,a.Q)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,tg:()=>l});var i=s(2061),n=s(5279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{for(const n of t)"attributes"!==n.type||s.includes(n.attributeName)||i.length&&!i.includes(n.attributeName)||e([n.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#s(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#s()}}},4988:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>T,wX:()=>E,QT:()=>C.Q,Iw:()=>S,dj:()=>f,P4:()=>L});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>t+`${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),c=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#u(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#u.bind(this)),this.#u()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#p(t,s){const i=this.#i?.sheet?.cssRules[0].style;if(!i)return;const n=(0,r.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(n,s):i?.removeProperty(n)}#g(t=[]){for(const e of t)this.#c.includes(e)&&this.#p(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#E(){const s=document.createElement("style");s.id="style-mixin-mappings",s.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,o(h))}))})),i.toString()})((0,n.E3)(e.componentName,this.#a),this.#h,t),this.#l.prepend(s)}#b(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#b(e.componentName),this.#E(),this.#d(),this.#m(),(0,r.FX)(this,this.#g.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}get#f(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.#f){this.baseElement.setAttribute("tabindex","-1");const e=()=>{this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",e),t.target.removeEventListener("dragend",e)};t.target.addEventListener("mouseup",e,{once:!0}),t.target.addEventListener("dragend",e,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,d.s)({componentName:t,baseSelector:e})){#A=m.C.bind(this,"blur");#S=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#A()})),this.baseElement.addEventListener("focus",(t=>{this.#S()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],E=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#M;constructor(){super(),this.#M=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.tooShort:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case t.tooLong:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case t.customError:return this.validationMessage;default:return""}}#C(){const t=this.getValidity();this.#M.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#M.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#M.validity.valid}reportValidity(){return this.#M.reportValidity()}get validity(){return this.#M.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#M.setValidity({customError:!0},t,this.validationTarget):(this.#M.setValidity({}),this.#C())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#M.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#C()}init(){super.init?.(),this.addEventListener("change",this.#C),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#C),setTimeout((()=>this.#C()))}},b=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(E(t)){static get observedAttributes(){return[...t.observedAttributes||[],...b]}#L;#T=m.C.bind(this,"change");constructor(){super(),this.#L=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#L&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#L??=y(t)||y(e),this.#L}set inputElement(t){this.#L=t}getValidity(){return this.inputElement?.validity||{}}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#x(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#x())})),this.baseElement.addEventListener("change",(()=>{this.#T()})),this.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#x())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#x()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#N;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#N=(s=t(this)).host||s}#w(){this.#N.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#N.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#N,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#w()}}},M=t=>class extends t{#T=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#T(),this.prevValue=this.value)}))}};var C=s(8084);const L=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){["focus","blur"].forEach((t=>{this.addEventListener(t,(t=>{this.isReadOnly&&(t.stopImmediatePropagation(),t.preventDefault())}),!0)})),super.init?.()}},T=t=>class extends t{init(){this.#k(),super.init?.()}#k(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>n});var i=s(4567);const n=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}}}}]);
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export const readOnlyMixin = (superclass) => class ReadOnlyMixinClass extends superclass {
|
2
|
-
get isReadOnly() {
|
3
|
-
return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false'
|
4
|
-
}
|
5
|
-
|
6
|
-
init() {
|
7
|
-
['focus', 'blur'].forEach(event => {
|
8
|
-
this.addEventListener(event, (e) => {
|
9
|
-
if (this.isReadOnly) {
|
10
|
-
e.stopImmediatePropagation()
|
11
|
-
e.preventDefault()
|
12
|
-
}
|
13
|
-
}, true)
|
14
|
-
})
|
15
|
-
|
16
|
-
super.init?.()
|
17
|
-
}
|
18
|
-
}
|