@descope/web-components-ui 1.0.62 → 1.0.63
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +95 -21
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +669 -696
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/447.js +1 -1
- package/dist/umd/666.js +37 -0
- package/dist/umd/725.js +1 -37
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-checkbox-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-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-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-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-switch-toggle-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/BaseInputClass.js +1 -1
- package/src/components/descope-button/Button.js +14 -10
- package/src/components/descope-checkbox/Checkbox.js +8 -5
- package/src/components/descope-container/Container.js +12 -7
- package/src/components/descope-date-picker/index.js +3 -3
- package/src/components/descope-divider/Divider.js +35 -30
- package/src/components/descope-email-field/EmailField.js +3 -3
- package/src/components/descope-link/Link.js +19 -27
- package/src/components/descope-loader-linear/LoaderLinear.js +12 -7
- package/src/components/descope-loader-radial/LoaderRadial.js +5 -5
- package/src/components/descope-logo/Logo.js +4 -4
- package/src/components/descope-number-field/NumberField.js +3 -3
- package/src/components/descope-passcode/Passcode.js +50 -69
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +1 -1
- package/src/components/descope-password-field/PasswordField.js +3 -3
- package/src/components/descope-switch-toggle/SwitchToggle.js +8 -5
- package/src/components/descope-text/Text.js +18 -9
- package/src/components/descope-text-area/TextArea.js +7 -6
- package/src/components/descope-text-field/TextField.js +3 -3
- package/src/components/descope-text-field/textFieldMappings.js +3 -5
- package/src/constants.js +1 -0
- package/src/dev/index.js +2 -2
- package/src/{componentsHelpers/createProxy/helpers.js → helpers/componentHelpers.js} +13 -5
- package/src/{helpers.js → helpers/index.js} +5 -2
- package/src/helpers/themeHelpers/componentsThemeManager.js +40 -0
- package/src/{themeHelpers → helpers/themeHelpers}/index.js +56 -21
- package/src/index.cjs.js +1 -1
- package/src/index.js +5 -5
- package/src/index.umd.js +4 -0
- package/src/{componentsHelpers/createProxy/index.js → mixins/createProxy.js} +4 -4
- package/src/{componentsHelpers → mixins}/createStyleMixin/helpers.js +14 -15
- package/src/mixins/createStyleMixin/index.js +109 -0
- package/src/{componentsHelpers → mixins}/index.js +2 -6
- package/src/theme/components/button.js +2 -2
- package/src/theme/components/checkbox.js +2 -1
- package/src/theme/components/container.js +2 -2
- package/src/theme/components/divider.js +17 -9
- package/src/theme/components/link.js +1 -1
- package/src/theme/components/loader/loaderLinear.js +1 -1
- package/src/theme/components/loader/loaderRadial.js +1 -1
- package/src/theme/components/text.js +1 -1
- package/src/theme/components/textArea.js +2 -1
- package/src/theme/components/textField.js +1 -1
- package/src/theme/globals.js +3 -3
- package/dist/umd/442.js +0 -1
- package/dist/umd/942.js +0 -1
- package/dist/umd/descope-combo-index-js.js +0 -1
- package/src/components/descope-combo/index.js +0 -27
- package/src/componentsHelpers/compose.js +0 -3
- package/src/componentsHelpers/createStyleMixin/index.js +0 -114
- package/src/componentsHelpers/enforceNestingElementsStylesMixin.js +0 -103
- /package/dist/umd/{725.js.LICENSE.txt → 666.js.LICENSE.txt} +0 -0
- /package/src/{themeHelpers/processColors.js → helpers/themeHelpers/colorsHelpers.js} +0 -0
- /package/src/{componentsHelpers → mixins}/componentNameValidationMixin.js +0 -0
- /package/src/{componentsHelpers → mixins}/draggableMixin.js +0 -0
- /package/src/{componentsHelpers → mixins}/hoverableMixin.js +0 -0
- /package/src/{componentsHelpers → mixins}/inputMixin.js +0 -0
- /package/src/{componentsHelpers → mixins}/proxyInputMixin.js +0 -0
package/dist/index.esm.js
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
import '@vaadin/button';
|
2
2
|
import '@vaadin/checkbox';
|
3
|
-
import '@vaadin/text-field';
|
4
3
|
import '@vaadin/date-picker';
|
5
4
|
import '@vaadin/email-field';
|
6
5
|
import '@vaadin/number-field';
|
6
|
+
import '@vaadin/text-field';
|
7
7
|
import '@vaadin/password-field';
|
8
8
|
import '@vaadin/text-area';
|
9
9
|
import merge from 'lodash.merge';
|
10
10
|
import set from 'lodash.set';
|
11
11
|
import Color from 'color';
|
12
12
|
|
13
|
-
const DESCOPE_PREFIX = 'descope';
|
14
|
-
|
15
13
|
const kebabCase = (str) =>
|
16
14
|
str
|
17
15
|
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
@@ -20,8 +18,132 @@ const kebabCase = (str) =>
|
|
20
18
|
|
21
19
|
const kebabCaseJoin = (...args) => kebabCase(args.join('-'));
|
22
20
|
|
21
|
+
const compose = (...fns) =>
|
22
|
+
(val) =>
|
23
|
+
fns.reduceRight((res, fn) => fn(res), val);
|
24
|
+
|
25
|
+
const DESCOPE_PREFIX = 'descope';
|
26
|
+
const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3;
|
27
|
+
|
28
|
+
const observeAttributes = (
|
29
|
+
ele,
|
30
|
+
callback,
|
31
|
+
{ excludeAttrs = [], includeAttrs = [] }
|
32
|
+
) => {
|
33
|
+
// sync all attrs on init
|
34
|
+
callback(
|
35
|
+
...Array.from(ele.attributes)
|
36
|
+
.filter(
|
37
|
+
(attr) =>
|
38
|
+
!excludeAttrs.includes(attr.name) &&
|
39
|
+
(!includeAttrs.length || includeAttrs.includes(attr.name))
|
40
|
+
)
|
41
|
+
.map((attr) => attr.name)
|
42
|
+
);
|
43
|
+
|
44
|
+
const observer = new MutationObserver((mutationsList) => {
|
45
|
+
for (const mutation of mutationsList) {
|
46
|
+
if (
|
47
|
+
mutation.type === 'attributes' &&
|
48
|
+
!excludeAttrs.includes(mutation.attributeName) &&
|
49
|
+
(!includeAttrs.length || includeAttrs.includes(mutation.attributeName))
|
50
|
+
) {
|
51
|
+
callback([mutation.attributeName]);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
});
|
55
|
+
|
56
|
+
observer.observe(ele, { attributes: true });
|
57
|
+
};
|
58
|
+
|
59
|
+
const createSyncAttrsCb =
|
60
|
+
(srcEle, targetEle, mapAttrs = {}) =>
|
61
|
+
(...attrNames) => {
|
62
|
+
attrNames.forEach((attrName) => {
|
63
|
+
const targetAttrName = mapAttrs[attrName] || attrName;
|
64
|
+
const srcAttrVal = srcEle.getAttribute(attrName);
|
65
|
+
if (srcAttrVal !== null) {
|
66
|
+
if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
|
67
|
+
targetEle.setAttribute(targetAttrName, srcAttrVal);
|
68
|
+
}
|
69
|
+
} else {
|
70
|
+
targetEle.removeAttribute(targetAttrName);
|
71
|
+
}
|
72
|
+
});
|
73
|
+
};
|
74
|
+
|
75
|
+
const syncAttrs = (ele1, ele2, options) => {
|
76
|
+
observeAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);
|
77
|
+
observeAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);
|
78
|
+
};
|
79
|
+
|
80
|
+
const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);
|
81
|
+
|
23
82
|
const getCssVarName = (...args) =>
|
24
|
-
|
83
|
+
`--${kebabCaseJoin(...args.filter((arg) => !!arg))}`;
|
84
|
+
|
85
|
+
const forwardAttrs = (source, dest, options = {}) => {
|
86
|
+
observeAttributes(
|
87
|
+
source,
|
88
|
+
createSyncAttrsCb(source, dest, options.mapAttrs),
|
89
|
+
options
|
90
|
+
);
|
91
|
+
};
|
92
|
+
|
93
|
+
const forwardProps = (src, target, props = []) => {
|
94
|
+
if(!props.length) return;
|
95
|
+
|
96
|
+
const config = props.reduce((acc, prop) => Object.assign(acc, {[prop] : {
|
97
|
+
get () {
|
98
|
+
return target[prop]
|
99
|
+
},
|
100
|
+
set (v) {
|
101
|
+
target[prop] = v;
|
102
|
+
}
|
103
|
+
}}), {});
|
104
|
+
|
105
|
+
Object.defineProperties(src, config);
|
106
|
+
};
|
107
|
+
|
108
|
+
class ComponentsThemeManager {
|
109
|
+
static mountOnPropName = 'DescopeThemeManager';
|
110
|
+
|
111
|
+
#themes = {};
|
112
|
+
|
113
|
+
#currentThemeName = 'light';
|
114
|
+
|
115
|
+
#callbacks = new Set();
|
116
|
+
|
117
|
+
#notify() {
|
118
|
+
this.#callbacks.forEach(cb => cb?.());
|
119
|
+
};
|
120
|
+
|
121
|
+
get currentThemeName() {
|
122
|
+
return this.#currentThemeName;
|
123
|
+
}
|
124
|
+
|
125
|
+
set currentThemeName(themeName) {
|
126
|
+
this.#currentThemeName = themeName;
|
127
|
+
this.#notify();
|
128
|
+
}
|
129
|
+
|
130
|
+
get currentTheme() {
|
131
|
+
return this.#themes[this.currentThemeName];
|
132
|
+
}
|
133
|
+
|
134
|
+
onCurrentThemeChange(cb) {
|
135
|
+
this.#callbacks.add(cb);
|
136
|
+
|
137
|
+
return () => { this.#callbacks.delete(cb); };
|
138
|
+
};
|
139
|
+
|
140
|
+
set themes(themes) {
|
141
|
+
this.#themes = themes;
|
142
|
+
this.#notify();
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
const componentsThemeManager = new ComponentsThemeManager();
|
25
147
|
|
26
148
|
const createCssVarFallback = (first, ...rest) =>
|
27
149
|
`var(${first}${rest.length ? ` , ${createCssVarFallback(...rest)}` : ''})`;
|
@@ -32,11 +154,10 @@ const createCssSelector = (
|
|
32
154
|
) =>
|
33
155
|
typeof relativeSelectorOrSelectorFn === 'function'
|
34
156
|
? relativeSelectorOrSelectorFn(baseSelector)
|
35
|
-
: `${baseSelector}${
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
}`;
|
157
|
+
: `${baseSelector}${/^[A-Za-z]/.test(relativeSelectorOrSelectorFn)
|
158
|
+
? ` ${relativeSelectorOrSelectorFn}`
|
159
|
+
: relativeSelectorOrSelectorFn
|
160
|
+
}`;
|
40
161
|
|
41
162
|
class StyleBuilder {
|
42
163
|
constructor() {
|
@@ -57,9 +178,9 @@ class StyleBuilder {
|
|
57
178
|
toString() {
|
58
179
|
return Array.from(this.styleMap.entries()).reduce(
|
59
180
|
(style, [selector, propValArr]) =>
|
60
|
-
|
61
|
-
|
62
|
-
|
181
|
+
(style += `${selector} { \n${propValArr
|
182
|
+
.map(({ property, value }) => `${property}: ${value}`)
|
183
|
+
.join(';\n')} \n}\n\n`),
|
63
184
|
''
|
64
185
|
);
|
65
186
|
}
|
@@ -105,124 +226,115 @@ const createCssVarsList = (componentName, mappings) =>
|
|
105
226
|
{}
|
106
227
|
);
|
107
228
|
|
108
|
-
//
|
109
|
-
//
|
110
|
-
const
|
111
|
-
|
112
|
-
|
113
|
-
];
|
229
|
+
// on some cases we need a selector to be more specific than another
|
230
|
+
// for this we have this fn that generate a class selector multiple times
|
231
|
+
const createClassSelectorSpecifier = (className, numOfRepeats) => Array(numOfRepeats)
|
232
|
+
.fill(`.${className}`)
|
233
|
+
.join('');
|
114
234
|
|
115
235
|
const createStyleMixin =
|
116
|
-
({ mappings = {}
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
static get cssVarList() {
|
128
|
-
return createCssVarsList(superclass.componentName, {
|
129
|
-
...mappings,
|
130
|
-
...nestedMappings
|
131
|
-
});
|
132
|
-
}
|
133
|
-
|
134
|
-
#styleEle = null;
|
236
|
+
({ mappings = {} }) =>
|
237
|
+
(superclass) => {
|
238
|
+
const styleAttributes = Object.keys(mappings).map((key) =>
|
239
|
+
kebabCaseJoin('st', key)
|
240
|
+
);
|
241
|
+
return class CustomStyleMixinClass extends superclass {
|
242
|
+
static get observedAttributes() {
|
243
|
+
const superAttrs = superclass.observedAttributes || [];
|
244
|
+
return [...superAttrs, ...styleAttributes];
|
245
|
+
}
|
135
246
|
|
136
|
-
|
137
|
-
|
247
|
+
static get cssVarList() {
|
248
|
+
return createCssVarsList(superclass.componentName, {
|
249
|
+
...mappings,
|
250
|
+
});
|
251
|
+
}
|
138
252
|
|
139
|
-
|
140
|
-
|
141
|
-
|
253
|
+
#overrideStyleEle = null;
|
254
|
+
#themeStyleEle = null;
|
255
|
+
#disconnectThemeManager
|
142
256
|
|
143
|
-
|
144
|
-
|
145
|
-
this.#styleEle.id = 'style-mixin-overrides';
|
257
|
+
constructor() {
|
258
|
+
super();
|
146
259
|
|
147
|
-
|
148
|
-
this.shadowRoot.prepend(this.#styleEle);
|
149
|
-
}
|
260
|
+
this.classList.add(superclass.componentName);
|
150
261
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
attrName.replace(/^st-/, '')
|
156
|
-
);
|
262
|
+
this.#createComponentStyle();
|
263
|
+
this.#createComponentTheme();
|
264
|
+
this.#createAttrOverrideStyle();
|
265
|
+
}
|
157
266
|
|
158
|
-
|
159
|
-
|
160
|
-
|
267
|
+
get componentTheme() {
|
268
|
+
return componentsThemeManager.currentTheme?.[superclass.componentName] || ''
|
269
|
+
}
|
161
270
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
themeStyle.innerHTML = createStyle(
|
166
|
-
superclass.componentName,
|
167
|
-
this.baseSelector,
|
168
|
-
mappings
|
169
|
-
);
|
170
|
-
this.shadowRoot.prepend(themeStyle);
|
171
|
-
}
|
271
|
+
onComponentThemeChange() {
|
272
|
+
this.#themeStyleEle.innerHTML = this.componentTheme.theme;
|
273
|
+
}
|
172
274
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
275
|
+
#createComponentTheme() {
|
276
|
+
this.#themeStyleEle = document.createElement('style');
|
277
|
+
this.#themeStyleEle.id = 'style-mixin-component-theme';
|
278
|
+
this.shadowRoot.prepend(this.#themeStyleEle);
|
279
|
+
this.#disconnectThemeManager = componentsThemeManager.onCurrentThemeChange(this.onComponentThemeChange.bind(this));
|
280
|
+
this.onComponentThemeChange();
|
281
|
+
}
|
177
282
|
|
178
|
-
|
179
|
-
|
283
|
+
#createAttrOverrideStyle() {
|
284
|
+
this.#overrideStyleEle = document.createElement('style');
|
285
|
+
this.#overrideStyleEle.id = 'style-mixin-overrides';
|
180
286
|
|
181
|
-
|
182
|
-
|
287
|
+
const classSpecifier = createClassSelectorSpecifier(superclass.componentName, CSS_SELECTOR_SPECIFIER_MULTIPLY);
|
288
|
+
this.#overrideStyleEle.innerText = `:host(${classSpecifier}) {}`;
|
289
|
+
this.shadowRoot.append(this.#overrideStyleEle);
|
290
|
+
}
|
183
291
|
|
184
|
-
|
292
|
+
#updateAttrOverrideStyle(attrName, value) {
|
293
|
+
const style = this.#overrideStyleEle.sheet?.cssRules[0].style;
|
294
|
+
const varName = getCssVarName(
|
295
|
+
superclass.componentName,
|
296
|
+
attrName.replace(/^st-/, '')
|
297
|
+
);
|
185
298
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
superclass.componentName,
|
190
|
-
`${superclass.componentName}${Array(numOfClassNameSpecifier)
|
191
|
-
.fill(`.${className}`)
|
192
|
-
.join('')}`,
|
193
|
-
nestedMappings
|
194
|
-
);
|
299
|
+
if (value) style?.setProperty(varName, value);
|
300
|
+
else style?.removeProperty(varName);
|
301
|
+
}
|
195
302
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
303
|
+
#createComponentStyle() {
|
304
|
+
const themeStyle = document.createElement('style');
|
305
|
+
themeStyle.id = 'style-mixin-component';
|
306
|
+
themeStyle.innerHTML = createStyle(
|
307
|
+
superclass.componentName,
|
308
|
+
this.baseSelector,
|
309
|
+
mappings
|
310
|
+
);
|
311
|
+
this.shadowRoot.prepend(themeStyle);
|
201
312
|
}
|
202
|
-
}
|
203
313
|
|
204
|
-
|
205
|
-
|
314
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
315
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
206
316
|
|
207
|
-
|
208
|
-
|
317
|
+
if (styleAttributes.includes(attrName)) {
|
318
|
+
this.#updateAttrOverrideStyle(attrName, newValue);
|
319
|
+
}
|
209
320
|
}
|
210
|
-
}
|
211
321
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
322
|
+
connectedCallback() {
|
323
|
+
super.connectedCallback?.();
|
324
|
+
if (this.shadowRoot.isConnected) {
|
325
|
+
Array.from(this.attributes).forEach((attr) => {
|
326
|
+
if (styleAttributes.includes(attr.nodeName)) {
|
327
|
+
this.#updateAttrOverrideStyle(attr.nodeName, attr.value);
|
328
|
+
}
|
329
|
+
});
|
330
|
+
}
|
331
|
+
}
|
216
332
|
|
217
|
-
|
218
|
-
|
219
|
-
this.#updateAttrOverrideStyle(attr.nodeName, attr.value);
|
220
|
-
}
|
221
|
-
});
|
333
|
+
disconnectedCallback() {
|
334
|
+
this.#disconnectThemeManager?.();
|
222
335
|
}
|
223
|
-
}
|
336
|
+
};
|
224
337
|
};
|
225
|
-
};
|
226
338
|
|
227
339
|
const draggableMixin = (superclass) =>
|
228
340
|
class DraggableMixinClass extends superclass {
|
@@ -256,10 +368,6 @@ const draggableMixin = (superclass) =>
|
|
256
368
|
}
|
257
369
|
};
|
258
370
|
|
259
|
-
var compose = (...fns) =>
|
260
|
-
(val) =>
|
261
|
-
fns.reduceRight((res, fn) => fn(res), val);
|
262
|
-
|
263
371
|
class DescopeBaseClass extends HTMLElement {}
|
264
372
|
|
265
373
|
const hoverableMixin =
|
@@ -286,81 +394,6 @@ const hoverableMixin =
|
|
286
394
|
}
|
287
395
|
};
|
288
396
|
|
289
|
-
const observeAttributes = (
|
290
|
-
ele,
|
291
|
-
callback,
|
292
|
-
{ excludeAttrs = [], includeAttrs = [] }
|
293
|
-
) => {
|
294
|
-
// sync all attrs on init
|
295
|
-
callback(
|
296
|
-
...Array.from(ele.attributes)
|
297
|
-
.filter(
|
298
|
-
(attr) =>
|
299
|
-
!excludeAttrs.includes(attr.name) &&
|
300
|
-
(!includeAttrs.length || includeAttrs.includes(attr.name))
|
301
|
-
)
|
302
|
-
.map((attr) => attr.name)
|
303
|
-
);
|
304
|
-
|
305
|
-
const observer = new MutationObserver((mutationsList) => {
|
306
|
-
for (const mutation of mutationsList) {
|
307
|
-
if (
|
308
|
-
mutation.type === 'attributes' &&
|
309
|
-
!excludeAttrs.includes(mutation.attributeName) &&
|
310
|
-
(!includeAttrs.length || includeAttrs.includes(mutation.attributeName))
|
311
|
-
) {
|
312
|
-
callback([mutation.attributeName]);
|
313
|
-
}
|
314
|
-
}
|
315
|
-
});
|
316
|
-
|
317
|
-
observer.observe(ele, { attributes: true });
|
318
|
-
};
|
319
|
-
|
320
|
-
const createSyncAttrsCb =
|
321
|
-
(srcEle, targetEle, mapAttrs = {}) =>
|
322
|
-
(...attrNames) => {
|
323
|
-
attrNames.forEach((attrName) => {
|
324
|
-
const targetAttrName = mapAttrs[attrName] || attrName;
|
325
|
-
const srcAttrVal = srcEle.getAttribute(attrName);
|
326
|
-
if (srcAttrVal !== null) {
|
327
|
-
if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
|
328
|
-
targetEle.setAttribute(targetAttrName, srcAttrVal);
|
329
|
-
}
|
330
|
-
} else {
|
331
|
-
targetEle.removeAttribute(targetAttrName);
|
332
|
-
}
|
333
|
-
});
|
334
|
-
};
|
335
|
-
|
336
|
-
const syncAttrs = (ele1, ele2, options) => {
|
337
|
-
observeAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);
|
338
|
-
observeAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);
|
339
|
-
};
|
340
|
-
|
341
|
-
const forwardAttrs = (source, dest, options = {}) => {
|
342
|
-
observeAttributes(
|
343
|
-
source,
|
344
|
-
createSyncAttrsCb(source, dest, options.mapAttrs),
|
345
|
-
options
|
346
|
-
);
|
347
|
-
};
|
348
|
-
|
349
|
-
const forwardProps = (src, target, props = []) => {
|
350
|
-
if(!props.length) return;
|
351
|
-
|
352
|
-
const config = props.reduce((acc, prop) => Object.assign(acc, {[prop] : {
|
353
|
-
get () {
|
354
|
-
return target[prop]
|
355
|
-
},
|
356
|
-
set (v) {
|
357
|
-
target[prop] = v;
|
358
|
-
}
|
359
|
-
}}), {});
|
360
|
-
|
361
|
-
Object.defineProperties(src, config);
|
362
|
-
};
|
363
|
-
|
364
397
|
const createProxy = ({
|
365
398
|
componentName,
|
366
399
|
wrappedEleName,
|
@@ -792,9 +825,7 @@ const componentNameValidationMixin = (superclass) =>
|
|
792
825
|
}
|
793
826
|
};
|
794
827
|
|
795
|
-
const
|
796
|
-
|
797
|
-
const componentName$i = getComponentName('button');
|
828
|
+
const componentName$h = getComponentName('button');
|
798
829
|
|
799
830
|
const editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;
|
800
831
|
const resetStyles = `
|
@@ -817,8 +848,9 @@ const iconStyles = `
|
|
817
848
|
}
|
818
849
|
`;
|
819
850
|
|
820
|
-
const
|
821
|
-
label: '::part(label)'
|
851
|
+
const { label: label$1, host: host$3 } = {
|
852
|
+
label: { selector: '::part(label)' },
|
853
|
+
host: { selector: () => ':host' }
|
822
854
|
};
|
823
855
|
|
824
856
|
const Button = compose(
|
@@ -826,16 +858,16 @@ const Button = compose(
|
|
826
858
|
mappings: {
|
827
859
|
backgroundColor: {},
|
828
860
|
borderRadius: {},
|
829
|
-
color:
|
861
|
+
color: label$1,
|
830
862
|
borderColor: {},
|
831
863
|
borderStyle: {},
|
832
864
|
borderWidth: {},
|
833
865
|
fontSize: {},
|
834
866
|
height: {},
|
835
|
-
width:
|
867
|
+
width: host$3,
|
836
868
|
cursor: {},
|
837
|
-
padding:
|
838
|
-
textDecoration:
|
869
|
+
padding: label$1,
|
870
|
+
textDecoration: label$1
|
839
871
|
}
|
840
872
|
}),
|
841
873
|
draggableMixin,
|
@@ -847,7 +879,7 @@ const Button = compose(
|
|
847
879
|
style: () =>
|
848
880
|
`${resetStyles} ${editorOverrides} ${iconStyles} ${loadingIndicatorStyles}`,
|
849
881
|
excludeAttrsSync: ['tabindex'],
|
850
|
-
componentName: componentName$
|
882
|
+
componentName: componentName$h
|
851
883
|
})
|
852
884
|
);
|
853
885
|
|
@@ -878,16 +910,20 @@ const loadingIndicatorStyles = `
|
|
878
910
|
:host([loading="true"])::part(label) {
|
879
911
|
visibility: hidden;
|
880
912
|
}
|
913
|
+
|
914
|
+
vaadin-button {
|
915
|
+
width: 100%;
|
916
|
+
}
|
881
917
|
`;
|
882
918
|
|
883
|
-
customElements.define(componentName$
|
919
|
+
customElements.define(componentName$h, Button);
|
884
920
|
|
885
|
-
const componentName$
|
921
|
+
const componentName$g = getComponentName('checkbox');
|
886
922
|
|
887
923
|
const Checkbox = compose(
|
888
924
|
createStyleMixin({
|
889
925
|
mappings: {
|
890
|
-
width:
|
926
|
+
width: { selector: () => ':host' },
|
891
927
|
cursor: [{}, { selector: '> label' }]
|
892
928
|
}
|
893
929
|
}),
|
@@ -902,19 +938,23 @@ const Checkbox = compose(
|
|
902
938
|
:host {
|
903
939
|
display: inline-block;
|
904
940
|
}
|
941
|
+
|
942
|
+
vaadin-checkbox {
|
943
|
+
width: 100%;
|
944
|
+
}
|
905
945
|
`,
|
906
946
|
excludeAttrsSync: ['tabindex'],
|
907
|
-
componentName: componentName$
|
947
|
+
componentName: componentName$g
|
908
948
|
})
|
909
949
|
);
|
910
950
|
|
911
|
-
customElements.define(componentName$
|
951
|
+
customElements.define(componentName$g, Checkbox);
|
912
952
|
|
913
|
-
const componentName$
|
953
|
+
const componentName$f = getComponentName('loader-linear');
|
914
954
|
|
915
955
|
class RawLoaderLinear extends DescopeBaseClass {
|
916
956
|
static get componentName() {
|
917
|
-
return componentName$
|
957
|
+
return componentName$f;
|
918
958
|
}
|
919
959
|
constructor() {
|
920
960
|
super();
|
@@ -927,6 +967,7 @@ class RawLoaderLinear extends DescopeBaseClass {
|
|
927
967
|
}
|
928
968
|
:host {
|
929
969
|
position: relative;
|
970
|
+
display: inline-block
|
930
971
|
}
|
931
972
|
div::after {
|
932
973
|
content: '';
|
@@ -934,6 +975,10 @@ class RawLoaderLinear extends DescopeBaseClass {
|
|
934
975
|
position: absolute;
|
935
976
|
left: 0;
|
936
977
|
}
|
978
|
+
|
979
|
+
:host > div {
|
980
|
+
width: 100%;
|
981
|
+
}
|
937
982
|
</style>
|
938
983
|
<div></div>
|
939
984
|
`;
|
@@ -947,16 +992,17 @@ class RawLoaderLinear extends DescopeBaseClass {
|
|
947
992
|
|
948
993
|
const selectors$4 = {
|
949
994
|
root: {},
|
950
|
-
after: { selector: '::after' }
|
995
|
+
after: { selector: '::after' },
|
996
|
+
host: { selector: () => ':host' }
|
951
997
|
};
|
952
998
|
|
953
|
-
const { root: root$1, after: after$1 } = selectors$4;
|
999
|
+
const { root: root$1, after: after$1, host: host$2 } = selectors$4;
|
954
1000
|
|
955
1001
|
const LoaderLinear = compose(
|
956
1002
|
createStyleMixin({
|
957
1003
|
mappings: {
|
958
1004
|
display: root$1,
|
959
|
-
width:
|
1005
|
+
width: host$2,
|
960
1006
|
height: [root$1, after$1],
|
961
1007
|
borderRadius: [root$1, after$1],
|
962
1008
|
surfaceColor: [{ property: 'background-color' }],
|
@@ -971,13 +1017,13 @@ const LoaderLinear = compose(
|
|
971
1017
|
componentNameValidationMixin
|
972
1018
|
)(RawLoaderLinear);
|
973
1019
|
|
974
|
-
customElements.define(componentName$
|
1020
|
+
customElements.define(componentName$f, LoaderLinear);
|
975
1021
|
|
976
|
-
const componentName$
|
1022
|
+
const componentName$e = getComponentName('loader-radial');
|
977
1023
|
|
978
1024
|
class RawLoaderRadial extends DescopeBaseClass {
|
979
1025
|
static get componentName() {
|
980
|
-
return componentName$
|
1026
|
+
return componentName$e;
|
981
1027
|
}
|
982
1028
|
constructor() {
|
983
1029
|
super();
|
@@ -990,6 +1036,7 @@ class RawLoaderRadial extends DescopeBaseClass {
|
|
990
1036
|
}
|
991
1037
|
:host {
|
992
1038
|
position: relative;
|
1039
|
+
display: inline-flex;
|
993
1040
|
}
|
994
1041
|
:host > div {
|
995
1042
|
animation-name: spin;
|
@@ -1009,7 +1056,7 @@ const LoaderRadial = compose(
|
|
1009
1056
|
createStyleMixin({
|
1010
1057
|
mappings: {
|
1011
1058
|
display: {},
|
1012
|
-
width:
|
1059
|
+
width: {},
|
1013
1060
|
height: {},
|
1014
1061
|
spinnerWidth: { property: 'border-width' },
|
1015
1062
|
spinnerStyle: { property: 'border-style' },
|
@@ -1028,133 +1075,13 @@ const LoaderRadial = compose(
|
|
1028
1075
|
componentNameValidationMixin
|
1029
1076
|
)(RawLoaderRadial);
|
1030
1077
|
|
1031
|
-
customElements.define(componentName$
|
1078
|
+
customElements.define(componentName$e, LoaderRadial);
|
1032
1079
|
|
1033
|
-
const
|
1034
|
-
label: '::part(label)',
|
1035
|
-
input: '::part(input-field)',
|
1036
|
-
readOnlyInput: '[readonly]::part(input-field)::after',
|
1037
|
-
placeholder: '> input:placeholder-shown'
|
1038
|
-
};
|
1039
|
-
|
1040
|
-
var textFieldMappings = {
|
1041
|
-
color: { selector: selectors$3.input },
|
1042
|
-
backgroundColor: { selector: selectors$3.input },
|
1043
|
-
color: { selector: selectors$3.input },
|
1044
|
-
width: matchHostStyle({}),
|
1045
|
-
borderColor: [
|
1046
|
-
{ selector: selectors$3.input },
|
1047
|
-
{ selector: selectors$3.readOnlyInput }
|
1048
|
-
],
|
1049
|
-
borderWidth: [
|
1050
|
-
{ selector: selectors$3.input },
|
1051
|
-
{ selector: selectors$3.readOnlyInput }
|
1052
|
-
],
|
1053
|
-
borderStyle: [
|
1054
|
-
{ selector: selectors$3.input },
|
1055
|
-
{ selector: selectors$3.readOnlyInput }
|
1056
|
-
],
|
1057
|
-
borderRadius: { selector: selectors$3.input },
|
1058
|
-
boxShadow: { selector: selectors$3.input },
|
1059
|
-
fontSize: {},
|
1060
|
-
height: { selector: selectors$3.input },
|
1061
|
-
padding: { selector: selectors$3.input },
|
1062
|
-
outline: { selector: selectors$3.input },
|
1063
|
-
outlineOffset: { selector: selectors$3.input },
|
1064
|
-
|
1065
|
-
placeholderColor: { selector: selectors$3.placeholder, property: 'color' }
|
1066
|
-
};
|
1067
|
-
|
1068
|
-
const componentName$e = getComponentName('text-field');
|
1069
|
-
|
1070
|
-
let overrides$6 = ``;
|
1071
|
-
|
1072
|
-
const TextField = compose(
|
1073
|
-
createStyleMixin({
|
1074
|
-
mappings: textFieldMappings
|
1075
|
-
}),
|
1076
|
-
draggableMixin,
|
1077
|
-
proxyInputMixin,
|
1078
|
-
componentNameValidationMixin
|
1079
|
-
)(
|
1080
|
-
createProxy({
|
1081
|
-
slots: ['prefix', 'suffix'],
|
1082
|
-
wrappedEleName: 'vaadin-text-field',
|
1083
|
-
style: () => overrides$6,
|
1084
|
-
excludeAttrsSync: ['tabindex'],
|
1085
|
-
componentName: componentName$e
|
1086
|
-
})
|
1087
|
-
);
|
1088
|
-
|
1089
|
-
overrides$6 = `
|
1090
|
-
:host {
|
1091
|
-
display: inline-block;
|
1092
|
-
}
|
1093
|
-
|
1094
|
-
vaadin-text-field {
|
1095
|
-
margin: 0;
|
1096
|
-
padding: 0;
|
1097
|
-
}
|
1098
|
-
vaadin-text-field::part(input-field) {
|
1099
|
-
overflow: hidden;
|
1100
|
-
}
|
1101
|
-
vaadin-text-field[readonly] > input:placeholder-shown {
|
1102
|
-
opacity: 1;
|
1103
|
-
}
|
1104
|
-
vaadin-text-field input:-webkit-autofill,
|
1105
|
-
vaadin-text-field input:-webkit-autofill::first-line,
|
1106
|
-
vaadin-text-field input:-webkit-autofill:hover,
|
1107
|
-
vaadin-text-field input:-webkit-autofill:active,
|
1108
|
-
vaadin-text-field input:-webkit-autofill:focus {
|
1109
|
-
-webkit-text-fill-color: var(${TextField.cssVarList.color});
|
1110
|
-
box-shadow: 0 0 0 var(${TextField.cssVarList.height}) var(${TextField.cssVarList.backgroundColor}) inset;
|
1111
|
-
}
|
1112
|
-
vaadin-text-field > label,
|
1113
|
-
vaadin-text-field::part(input-field) {
|
1114
|
-
cursor: pointer;
|
1115
|
-
color: var(${TextField.cssVarList.color});
|
1116
|
-
}
|
1117
|
-
vaadin-text-field::part(input-field):focus {
|
1118
|
-
cursor: text;
|
1119
|
-
}
|
1120
|
-
vaadin-text-field[required]::part(required-indicator)::after {
|
1121
|
-
font-size: "12px";
|
1122
|
-
content: "*";
|
1123
|
-
color: var(${TextField.cssVarList.color});
|
1124
|
-
}
|
1125
|
-
vaadin-text-field[readonly]::part(input-field)::after {
|
1126
|
-
border: 0 solid;
|
1127
|
-
}
|
1128
|
-
`;
|
1129
|
-
|
1130
|
-
customElements.define(componentName$e, TextField);
|
1131
|
-
|
1132
|
-
const template = document.createElement('template');
|
1133
|
-
|
1134
|
-
const componentName$d = getComponentName('combo');
|
1135
|
-
|
1136
|
-
template.innerHTML = `
|
1137
|
-
<descope-button></descope-button>
|
1138
|
-
<descope-text-field></descope-text-field>
|
1139
|
-
`;
|
1140
|
-
|
1141
|
-
class Combo extends DescopeBaseClass {
|
1142
|
-
constructor() {
|
1143
|
-
super();
|
1144
|
-
|
1145
|
-
this.attachShadow({ mode: 'open' }).appendChild(
|
1146
|
-
template.content.cloneNode(true)
|
1147
|
-
);
|
1148
|
-
}
|
1149
|
-
}
|
1150
|
-
|
1151
|
-
customElements.define(componentName$d, Combo);
|
1152
|
-
|
1153
|
-
const componentName$c = getComponentName('container');
|
1080
|
+
const componentName$d = getComponentName('container');
|
1154
1081
|
|
1155
1082
|
class RawContainer extends DescopeBaseClass {
|
1156
1083
|
static get componentName() {
|
1157
|
-
return componentName$
|
1084
|
+
return componentName$d;
|
1158
1085
|
}
|
1159
1086
|
constructor() {
|
1160
1087
|
super();
|
@@ -1163,6 +1090,13 @@ class RawContainer extends DescopeBaseClass {
|
|
1163
1090
|
<style>
|
1164
1091
|
:host > slot {
|
1165
1092
|
box-sizing: border-box;
|
1093
|
+
width: 100%;
|
1094
|
+
height: 100%;
|
1095
|
+
display: flex;
|
1096
|
+
overflow: auto;
|
1097
|
+
}
|
1098
|
+
:host {
|
1099
|
+
display: inline-block;
|
1166
1100
|
}
|
1167
1101
|
</style>
|
1168
1102
|
<slot></slot>
|
@@ -1178,8 +1112,8 @@ class RawContainer extends DescopeBaseClass {
|
|
1178
1112
|
const Container = compose(
|
1179
1113
|
createStyleMixin({
|
1180
1114
|
mappings: {
|
1181
|
-
height:
|
1182
|
-
width:
|
1115
|
+
height: { selector: () => ':host' },
|
1116
|
+
width: { selector: () => ':host' },
|
1183
1117
|
|
1184
1118
|
verticalPadding: [
|
1185
1119
|
{ property: 'padding-top' },
|
@@ -1189,273 +1123,223 @@ const Container = compose(
|
|
1189
1123
|
{ property: 'padding-left' },
|
1190
1124
|
{ property: 'padding-right' }
|
1191
1125
|
],
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
borderColor: {},
|
1203
|
-
borderStyle: {},
|
1204
|
-
borderWidth: {},
|
1205
|
-
|
1206
|
-
boxShadow: {}
|
1207
|
-
}
|
1208
|
-
}),
|
1209
|
-
draggableMixin,
|
1210
|
-
componentNameValidationMixin
|
1211
|
-
)(RawContainer);
|
1212
|
-
|
1213
|
-
customElements.define(componentName$c, Container);
|
1214
|
-
|
1215
|
-
const componentName$b = getComponentName('date-picker');
|
1216
|
-
|
1217
|
-
const DatePicker = compose(
|
1218
|
-
draggableMixin,
|
1219
|
-
componentNameValidationMixin
|
1220
|
-
)(
|
1221
|
-
createProxy({
|
1222
|
-
componentName: componentName$b,
|
1223
|
-
slots: ['prefix', 'suffix'],
|
1224
|
-
wrappedEleName: 'vaadin-date-picker',
|
1225
|
-
style: ``
|
1226
|
-
})
|
1227
|
-
);
|
1228
|
-
|
1229
|
-
customElements.define(componentName$b, DatePicker);
|
1230
|
-
|
1231
|
-
const getChildObserver = (callback) => {
|
1232
|
-
return new MutationObserver((mutationsList) => {
|
1233
|
-
for (const mutation of mutationsList) {
|
1234
|
-
if (mutation.type === 'childList') {
|
1235
|
-
callback(mutation);
|
1236
|
-
}
|
1237
|
-
}
|
1238
|
-
});
|
1239
|
-
};
|
1240
|
-
|
1241
|
-
const insertNestingLevel = (srcEle, nestingEle) => {
|
1242
|
-
nestingEle.append(...srcEle.childNodes);
|
1243
|
-
srcEle.appendChild(nestingEle);
|
1244
|
-
};
|
1245
|
-
|
1246
|
-
// adds a nesting element to the component, and move all existing children
|
1247
|
-
// to be under the nesting element
|
1248
|
-
const enforceNestingElementsStylesMixin =
|
1249
|
-
({ nestingElementTagName, nestingElementDestSlotName, forwardAttrOptions }) =>
|
1250
|
-
(superclass) => {
|
1251
|
-
const getChildNodeEle = () =>
|
1252
|
-
document.createElement(nestingElementTagName, {
|
1253
|
-
slot: nestingElementDestSlotName
|
1254
|
-
});
|
1255
|
-
|
1256
|
-
let childObserver;
|
1257
|
-
|
1258
|
-
const getObserver = () => childObserver;
|
1259
|
-
|
1260
|
-
let isMutating = false;
|
1261
|
-
|
1262
|
-
const filterNestingElement = (node) => node.localName !== nestingElementTagName;
|
1263
|
-
return class EnforceNestingElementsStylesMixinClass extends superclass {
|
1264
|
-
constructor() {
|
1265
|
-
super();
|
1266
|
-
|
1267
|
-
const childObserverCallback = (mutation, observer) => {
|
1268
|
-
|
1269
|
-
// we are going to change the DOM, so we need to skip the upcoming mutations
|
1270
|
-
if (isMutating) return;
|
1271
|
-
|
1272
|
-
isMutating = true;
|
1273
|
-
|
1274
|
-
const { addedNodes, removedNodes } = mutation;
|
1275
|
-
|
1276
|
-
const nestingElement = this.shadowRoot.host.querySelector(nestingElementTagName);
|
1277
|
-
const hasNewChildren = Array.from(addedNodes)
|
1278
|
-
.filter(filterNestingElement)
|
1279
|
-
.length > 0;
|
1280
|
-
const hasRemovedChildren = Array.from(removedNodes)
|
1281
|
-
.filter(filterNestingElement)
|
1282
|
-
.length > 0;
|
1283
|
-
|
1284
|
-
if (!nestingElement && hasNewChildren) {
|
1285
|
-
// if before there were no children and now there are children - insert
|
1286
|
-
this.handleNestingLevelInsertion();
|
1287
|
-
|
1288
|
-
} else if (nestingElement && hasNewChildren) {
|
1289
|
-
// if children existed, and they changed -
|
1290
|
-
// we need to update (move) the new children into
|
1291
|
-
// descope-text and remove previous children
|
1292
|
-
nestingElement.replaceChildren(...addedNodes);
|
1293
|
-
}
|
1294
|
-
else if (nestingElement && !hasNewChildren && hasRemovedChildren) {
|
1295
|
-
// // if children existed and now there are none -
|
1296
|
-
// // we need to remove descope-text completely
|
1297
|
-
nestingElement.remove();
|
1298
|
-
}
|
1299
|
-
|
1300
|
-
setTimeout(() => {
|
1301
|
-
isMutating = false;
|
1302
|
-
});
|
1303
|
-
};
|
1304
|
-
|
1305
|
-
childObserver = getChildObserver(childObserverCallback);
|
1306
|
-
}
|
1307
|
-
|
1308
|
-
handleNestingLevelInsertion() {
|
1309
|
-
insertNestingLevel(this.shadowRoot.host, getChildNodeEle());
|
1310
|
-
|
1311
|
-
forwardAttrs(
|
1312
|
-
this.shadowRoot.host,
|
1313
|
-
this.shadowRoot.host.querySelector(nestingElementTagName),
|
1314
|
-
forwardAttrOptions
|
1315
|
-
);
|
1316
|
-
}
|
1317
|
-
|
1318
|
-
connectedCallback() {
|
1319
|
-
super.connectedCallback?.();
|
1320
|
-
|
1321
|
-
if (this.shadowRoot.host.childNodes.length > 0) {
|
1322
|
-
// on the first render - we want to move all component's children to be under descope-text
|
1323
|
-
this.handleNestingLevelInsertion();
|
1324
|
-
}
|
1325
|
-
|
1326
|
-
getObserver().observe(this.shadowRoot.host, {
|
1327
|
-
childList: true
|
1328
|
-
});
|
1329
|
-
}
|
1330
|
-
};
|
1331
|
-
};
|
1332
|
-
|
1333
|
-
const componentName$a = getComponentName('text');
|
1334
|
-
|
1335
|
-
class RawText extends DescopeBaseClass {
|
1336
|
-
static get componentName() {
|
1337
|
-
return componentName$a;
|
1338
|
-
}
|
1339
|
-
constructor() {
|
1340
|
-
super();
|
1341
|
-
const template = document.createElement('template');
|
1342
|
-
template.innerHTML = `<slot></slot>`;
|
1343
|
-
|
1344
|
-
this.attachShadow({ mode: 'open' });
|
1345
|
-
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
1346
|
-
|
1347
|
-
this.baseSelector = ':host > slot';
|
1348
|
-
}
|
1349
|
-
}
|
1350
|
-
|
1351
|
-
const Text = compose(
|
1352
|
-
createStyleMixin({
|
1353
|
-
mappings: {
|
1354
|
-
fontFamily: {},
|
1355
|
-
lineHeight: {},
|
1356
|
-
fontStyle: {},
|
1357
|
-
fontSize: {},
|
1358
|
-
fontWeight: {},
|
1359
|
-
width: {},
|
1360
|
-
color: {},
|
1361
|
-
letterSpacing: {},
|
1362
|
-
textShadow: {},
|
1363
|
-
borderWidth: {},
|
1364
|
-
borderStyle: {},
|
1126
|
+
|
1127
|
+
flexDirection: {},
|
1128
|
+
justifyContent: {},
|
1129
|
+
alignItems: {},
|
1130
|
+
gap: {},
|
1131
|
+
|
1132
|
+
backgroundColor: {},
|
1133
|
+
borderRadius: {},
|
1134
|
+
|
1365
1135
|
borderColor: {},
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1136
|
+
borderStyle: {},
|
1137
|
+
borderWidth: {},
|
1138
|
+
|
1139
|
+
boxShadow: {}
|
1369
1140
|
}
|
1370
1141
|
}),
|
1371
1142
|
draggableMixin,
|
1372
1143
|
componentNameValidationMixin
|
1373
|
-
)(
|
1144
|
+
)(RawContainer);
|
1374
1145
|
|
1375
|
-
|
1146
|
+
customElements.define(componentName$d, Container);
|
1147
|
+
|
1148
|
+
const componentName$c = getComponentName('date-picker');
|
1149
|
+
|
1150
|
+
const DatePicker = compose(
|
1151
|
+
draggableMixin,
|
1152
|
+
componentNameValidationMixin
|
1153
|
+
)(
|
1154
|
+
createProxy({
|
1155
|
+
componentName: componentName$c,
|
1156
|
+
slots: ['prefix', 'suffix'],
|
1157
|
+
wrappedEleName: 'vaadin-date-picker',
|
1158
|
+
style: ``
|
1159
|
+
})
|
1160
|
+
);
|
1161
|
+
|
1162
|
+
customElements.define(componentName$c, DatePicker);
|
1163
|
+
|
1164
|
+
const componentName$b = getComponentName('divider');
|
1376
1165
|
class RawDivider extends DescopeBaseClass {
|
1377
1166
|
static get componentName() {
|
1378
|
-
return componentName$
|
1167
|
+
return componentName$b;
|
1379
1168
|
}
|
1380
1169
|
constructor() {
|
1381
1170
|
super();
|
1171
|
+
|
1382
1172
|
const template = document.createElement('template');
|
1383
1173
|
template.innerHTML = `
|
1384
1174
|
<style>
|
1385
1175
|
:host > div {
|
1386
1176
|
display: flex;
|
1387
1177
|
height: 100%;
|
1178
|
+
width: 100%;
|
1388
1179
|
}
|
1389
1180
|
:host > div::before,
|
1390
1181
|
:host > div::after {
|
1391
1182
|
content: '';
|
1392
1183
|
flex-grow: 1;
|
1393
|
-
width: 100%;
|
1394
1184
|
}
|
1395
|
-
|
1185
|
+
|
1186
|
+
descope-text {
|
1396
1187
|
flex-grow: 0;
|
1397
1188
|
flex-shrink: 0;
|
1398
1189
|
}
|
1190
|
+
|
1191
|
+
:host(:empty) descope-text {
|
1192
|
+
display: none;
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
:host([vertical="true"]) div {
|
1196
|
+
width: fit-content;
|
1197
|
+
}
|
1198
|
+
|
1399
1199
|
</style>
|
1400
1200
|
<div>
|
1401
|
-
<
|
1402
|
-
|
1201
|
+
<descope-text>
|
1202
|
+
<slot></slot>
|
1203
|
+
</descope-text>
|
1403
1204
|
</div>
|
1404
1205
|
`;
|
1405
1206
|
this.attachShadow({ mode: 'open' });
|
1406
1207
|
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
1407
1208
|
|
1408
1209
|
this.baseSelector = ':host > div';
|
1210
|
+
|
1211
|
+
this.textComponent = this.shadowRoot.querySelector('descope-text');
|
1212
|
+
|
1213
|
+
forwardAttrs(this, this.textComponent, {
|
1214
|
+
includeAttrs: ['mode', 'variant', 'italic']
|
1215
|
+
});
|
1409
1216
|
}
|
1410
1217
|
}
|
1411
1218
|
|
1412
|
-
const selectors$
|
1219
|
+
const selectors$3 = {
|
1413
1220
|
root: { selector: '' },
|
1414
1221
|
before: { selector: '::before' },
|
1415
1222
|
after: { selector: '::after' },
|
1416
|
-
|
1223
|
+
text: { selector: 'descope-text' },
|
1224
|
+
host: { selector: () => ':host' },
|
1417
1225
|
};
|
1418
1226
|
|
1419
|
-
const { root, before, after,
|
1227
|
+
const { root, before, after, text: text$2, host: host$1 } = selectors$3;
|
1420
1228
|
|
1421
1229
|
const Divider = compose(
|
1422
|
-
enforceNestingElementsStylesMixin({
|
1423
|
-
nestingElementTagName: 'descope-text',
|
1424
|
-
nestingElementDestSlotName: 'text',
|
1425
|
-
forwardAttrOptions: {
|
1426
|
-
includeAttrs: ['mode', 'variant'],
|
1427
|
-
excludeAttrs: []
|
1428
|
-
}
|
1429
|
-
}),
|
1430
1230
|
createStyleMixin({
|
1431
1231
|
mappings: {
|
1232
|
+
maxTextWidth: { ...text$2, property: 'max-width' },
|
1432
1233
|
minHeight: root,
|
1433
1234
|
alignItems: root,
|
1434
1235
|
alignSelf: root,
|
1435
1236
|
flexDirection: root,
|
1436
|
-
|
1437
|
-
width:
|
1438
|
-
|
1237
|
+
textPadding: {...text$2, property: 'padding'},
|
1238
|
+
width: host$1,
|
1239
|
+
padding: host$1,
|
1439
1240
|
backgroundColor: [before, after],
|
1440
1241
|
opacity: [before, after],
|
1441
|
-
textWidth: { ...
|
1242
|
+
textWidth: { ...text$2, property: 'width' },
|
1243
|
+
dividerHeight: [{ ...before, property: 'height' }, { ...after, property: 'height' }],
|
1244
|
+
dividerWidth: [{ ...before, property: 'width' }, { ...after, property: 'width' }]
|
1442
1245
|
},
|
1443
|
-
nestedMappings: {
|
1444
|
-
fontStyle: {
|
1445
|
-
selector: Text.componentName,
|
1446
|
-
property: Text.cssVarList.fontStyle
|
1447
|
-
}
|
1448
|
-
}
|
1449
1246
|
}),
|
1450
1247
|
draggableMixin,
|
1451
1248
|
componentNameValidationMixin
|
1452
1249
|
)(RawDivider);
|
1453
1250
|
|
1251
|
+
const componentName$a = getComponentName('text');
|
1252
|
+
|
1253
|
+
class RawText extends DescopeBaseClass {
|
1254
|
+
static get componentName() {
|
1255
|
+
return componentName$a;
|
1256
|
+
}
|
1257
|
+
constructor() {
|
1258
|
+
super();
|
1259
|
+
const template = document.createElement('template');
|
1260
|
+
template.innerHTML = `
|
1261
|
+
<style>
|
1262
|
+
:host {
|
1263
|
+
display: inline-block;
|
1264
|
+
}
|
1265
|
+
:host > slot {
|
1266
|
+
width: 100%;
|
1267
|
+
display: inline-block;
|
1268
|
+
}
|
1269
|
+
</style>
|
1270
|
+
<slot></slot>
|
1271
|
+
`;
|
1272
|
+
|
1273
|
+
this.attachShadow({ mode: 'open' });
|
1274
|
+
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
1275
|
+
|
1276
|
+
this.baseSelector = ':host > slot';
|
1277
|
+
}
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
const Text = compose(
|
1281
|
+
createStyleMixin({
|
1282
|
+
mappings: {
|
1283
|
+
fontFamily: {},
|
1284
|
+
lineHeight: {},
|
1285
|
+
fontStyle: {},
|
1286
|
+
fontSize: {},
|
1287
|
+
fontWeight: {},
|
1288
|
+
width: { selector: () => ':host' },
|
1289
|
+
color: {},
|
1290
|
+
letterSpacing: {},
|
1291
|
+
textShadow: {},
|
1292
|
+
borderWidth: {},
|
1293
|
+
borderStyle: {},
|
1294
|
+
borderColor: {},
|
1295
|
+
textTransform: {},
|
1296
|
+
textAlign: {},
|
1297
|
+
},
|
1298
|
+
}),
|
1299
|
+
draggableMixin,
|
1300
|
+
componentNameValidationMixin
|
1301
|
+
)(RawText);
|
1302
|
+
|
1454
1303
|
customElements.define(componentName$a, Text);
|
1455
1304
|
|
1456
|
-
customElements.define(componentName$
|
1305
|
+
customElements.define(componentName$b, Divider);
|
1306
|
+
|
1307
|
+
const selectors$2 = {
|
1308
|
+
label: '::part(label)',
|
1309
|
+
input: '::part(input-field)',
|
1310
|
+
readOnlyInput: '[readonly]::part(input-field)::after',
|
1311
|
+
placeholder: '> input:placeholder-shown',
|
1312
|
+
host: () => ':host'
|
1313
|
+
};
|
1314
|
+
|
1315
|
+
var textFieldMappings = {
|
1316
|
+
backgroundColor: { selector: selectors$2.input },
|
1317
|
+
color: { selector: selectors$2.input },
|
1318
|
+
width: { selector: selectors$2.host },
|
1319
|
+
borderColor: [
|
1320
|
+
{ selector: selectors$2.input },
|
1321
|
+
{ selector: selectors$2.readOnlyInput }
|
1322
|
+
],
|
1323
|
+
borderWidth: [
|
1324
|
+
{ selector: selectors$2.input },
|
1325
|
+
{ selector: selectors$2.readOnlyInput }
|
1326
|
+
],
|
1327
|
+
borderStyle: [
|
1328
|
+
{ selector: selectors$2.input },
|
1329
|
+
{ selector: selectors$2.readOnlyInput }
|
1330
|
+
],
|
1331
|
+
borderRadius: { selector: selectors$2.input },
|
1332
|
+
boxShadow: { selector: selectors$2.input },
|
1333
|
+
fontSize: {},
|
1334
|
+
height: { selector: selectors$2.input },
|
1335
|
+
padding: { selector: selectors$2.input },
|
1336
|
+
outline: { selector: selectors$2.input },
|
1337
|
+
outlineOffset: { selector: selectors$2.input },
|
1338
|
+
|
1339
|
+
placeholderColor: { selector: selectors$2.placeholder, property: 'color' }
|
1340
|
+
};
|
1457
1341
|
|
1458
|
-
const componentName$
|
1342
|
+
const componentName$9 = getComponentName('email-field');
|
1459
1343
|
|
1460
1344
|
let overrides$5 = ``;
|
1461
1345
|
|
@@ -1474,7 +1358,7 @@ const EmailField = compose(
|
|
1474
1358
|
wrappedEleName: 'vaadin-email-field',
|
1475
1359
|
style: () => overrides$5,
|
1476
1360
|
excludeAttrsSync: ['tabindex'],
|
1477
|
-
componentName: componentName$
|
1361
|
+
componentName: componentName$9
|
1478
1362
|
})
|
1479
1363
|
);
|
1480
1364
|
|
@@ -1518,12 +1402,12 @@ overrides$5 = `
|
|
1518
1402
|
}
|
1519
1403
|
`;
|
1520
1404
|
|
1521
|
-
customElements.define(componentName$
|
1405
|
+
customElements.define(componentName$9, EmailField);
|
1522
1406
|
|
1523
|
-
const componentName$
|
1407
|
+
const componentName$8 = getComponentName('link');
|
1524
1408
|
class RawLink extends DescopeBaseClass {
|
1525
1409
|
static get componentName() {
|
1526
|
-
return componentName$
|
1410
|
+
return componentName$8;
|
1527
1411
|
}
|
1528
1412
|
constructor() {
|
1529
1413
|
super();
|
@@ -1540,7 +1424,9 @@ class RawLink extends DescopeBaseClass {
|
|
1540
1424
|
</style>
|
1541
1425
|
<div>
|
1542
1426
|
<a>
|
1543
|
-
<
|
1427
|
+
<descope-text>
|
1428
|
+
<slot></slot>
|
1429
|
+
</descope-text>
|
1544
1430
|
</a>
|
1545
1431
|
</div>
|
1546
1432
|
`;
|
@@ -1548,63 +1434,56 @@ class RawLink extends DescopeBaseClass {
|
|
1548
1434
|
this.attachShadow({ mode: 'open' });
|
1549
1435
|
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
1550
1436
|
|
1551
|
-
forwardAttrs(this
|
1437
|
+
forwardAttrs(this, this.shadowRoot.querySelector('a'), {
|
1552
1438
|
includeAttrs: ['href', 'target', 'tooltip'],
|
1553
1439
|
mapAttrs: {
|
1554
1440
|
tooltip: 'title'
|
1555
1441
|
}
|
1556
1442
|
});
|
1557
1443
|
|
1444
|
+
forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {
|
1445
|
+
includeAttrs: ['mode', 'variant'],
|
1446
|
+
});
|
1447
|
+
|
1558
1448
|
this.baseSelector = ':host > div';
|
1559
1449
|
}
|
1560
1450
|
}
|
1561
1451
|
|
1562
1452
|
const selectors$1 = {
|
1563
|
-
|
1453
|
+
host: { selector: () => 'host' },
|
1454
|
+
anchor: { selector: '> a' },
|
1455
|
+
text: { selector: Text.componentName }
|
1564
1456
|
};
|
1565
1457
|
|
1566
|
-
const { anchor } = selectors$1;
|
1458
|
+
const { anchor, text: text$1, host } = selectors$1;
|
1567
1459
|
|
1568
1460
|
const Link = compose(
|
1569
|
-
enforceNestingElementsStylesMixin({
|
1570
|
-
nestingElementTagName: 'descope-text',
|
1571
|
-
nestingElementDestSlotName: 'text',
|
1572
|
-
forwardAttrOptions: {
|
1573
|
-
includeAttrs: ['variant', 'italic', 'uppercase', 'lowercase']
|
1574
|
-
}
|
1575
|
-
}),
|
1576
1461
|
createStyleMixin({
|
1577
1462
|
mappings: {
|
1578
|
-
width:
|
1463
|
+
width: host,
|
1579
1464
|
textAlign: {},
|
1580
|
-
color: anchor,
|
1465
|
+
color: [anchor, { ...text$1, property: Text.cssVarList.color }],
|
1581
1466
|
cursor: anchor,
|
1582
1467
|
borderBottomWidth: anchor,
|
1583
1468
|
borderBottomStyle: anchor,
|
1584
1469
|
borderBottomColor: anchor
|
1585
1470
|
},
|
1586
|
-
nestedMappings: {
|
1587
|
-
color: {
|
1588
|
-
selector: Text.componentName,
|
1589
|
-
property: Text.cssVarList.color
|
1590
|
-
}
|
1591
|
-
}
|
1592
1471
|
}),
|
1593
1472
|
hoverableMixin(anchor.selector),
|
1594
1473
|
draggableMixin,
|
1595
1474
|
componentNameValidationMixin
|
1596
1475
|
)(RawLink);
|
1597
1476
|
|
1598
|
-
customElements.define(componentName$
|
1477
|
+
customElements.define(componentName$8, Link);
|
1599
1478
|
|
1600
|
-
const componentName$
|
1479
|
+
const componentName$7 = getComponentName('logo');
|
1601
1480
|
|
1602
1481
|
let style;
|
1603
1482
|
const getStyle = () => style;
|
1604
1483
|
|
1605
1484
|
class RawLogo extends DescopeBaseClass {
|
1606
1485
|
static get componentName() {
|
1607
|
-
return componentName$
|
1486
|
+
return componentName$7;
|
1608
1487
|
}
|
1609
1488
|
constructor() {
|
1610
1489
|
super();
|
@@ -1637,7 +1516,7 @@ const Logo = compose(
|
|
1637
1516
|
|
1638
1517
|
style = `
|
1639
1518
|
:host {
|
1640
|
-
display: inline-
|
1519
|
+
display: inline-flex;
|
1641
1520
|
}
|
1642
1521
|
:host > div {
|
1643
1522
|
display: inline-block;
|
@@ -1645,9 +1524,9 @@ style = `
|
|
1645
1524
|
}
|
1646
1525
|
`;
|
1647
1526
|
|
1648
|
-
customElements.define(componentName$
|
1527
|
+
customElements.define(componentName$7, Logo);
|
1649
1528
|
|
1650
|
-
const componentName$
|
1529
|
+
const componentName$6 = getComponentName('number-field');
|
1651
1530
|
|
1652
1531
|
let overrides$4 = ``;
|
1653
1532
|
|
@@ -1666,7 +1545,7 @@ const NumberField = compose(
|
|
1666
1545
|
wrappedEleName: 'vaadin-number-field',
|
1667
1546
|
style: () => overrides$4,
|
1668
1547
|
excludeAttrsSync: ['tabindex'],
|
1669
|
-
componentName: componentName$
|
1548
|
+
componentName: componentName$6
|
1670
1549
|
})
|
1671
1550
|
);
|
1672
1551
|
|
@@ -1710,7 +1589,7 @@ overrides$4 = `
|
|
1710
1589
|
}
|
1711
1590
|
`;
|
1712
1591
|
|
1713
|
-
customElements.define(componentName$
|
1592
|
+
customElements.define(componentName$6, NumberField);
|
1714
1593
|
|
1715
1594
|
var BaseInputClass = inputMixin(HTMLElement); //todo: maybe we should use base class?
|
1716
1595
|
|
@@ -1728,7 +1607,7 @@ const getSanitizedCharacters = (str) => {
|
|
1728
1607
|
return [...pin]; // creating array of chars
|
1729
1608
|
};
|
1730
1609
|
|
1731
|
-
const componentName$
|
1610
|
+
const componentName$5 = getComponentName('passcode-internal');
|
1732
1611
|
|
1733
1612
|
class PasscodeInternal extends BaseInputClass {
|
1734
1613
|
static get observedAttributes() {
|
@@ -1741,7 +1620,7 @@ class PasscodeInternal extends BaseInputClass {
|
|
1741
1620
|
}
|
1742
1621
|
|
1743
1622
|
static get componentName() {
|
1744
|
-
return componentName$
|
1623
|
+
return componentName$5;
|
1745
1624
|
}
|
1746
1625
|
|
1747
1626
|
constructor() {
|
@@ -1916,6 +1795,68 @@ class PasscodeInternal extends BaseInputClass {
|
|
1916
1795
|
}
|
1917
1796
|
}
|
1918
1797
|
|
1798
|
+
const componentName$4 = getComponentName('text-field');
|
1799
|
+
|
1800
|
+
let overrides$3 = ``;
|
1801
|
+
|
1802
|
+
const TextField = compose(
|
1803
|
+
createStyleMixin({
|
1804
|
+
mappings: textFieldMappings
|
1805
|
+
}),
|
1806
|
+
draggableMixin,
|
1807
|
+
proxyInputMixin,
|
1808
|
+
componentNameValidationMixin
|
1809
|
+
)(
|
1810
|
+
createProxy({
|
1811
|
+
slots: ['prefix', 'suffix'],
|
1812
|
+
wrappedEleName: 'vaadin-text-field',
|
1813
|
+
style: () => overrides$3,
|
1814
|
+
excludeAttrsSync: ['tabindex'],
|
1815
|
+
componentName: componentName$4
|
1816
|
+
})
|
1817
|
+
);
|
1818
|
+
|
1819
|
+
overrides$3 = `
|
1820
|
+
:host {
|
1821
|
+
display: inline-block;
|
1822
|
+
}
|
1823
|
+
|
1824
|
+
vaadin-text-field {
|
1825
|
+
margin: 0;
|
1826
|
+
padding: 0;
|
1827
|
+
}
|
1828
|
+
vaadin-text-field::part(input-field) {
|
1829
|
+
overflow: hidden;
|
1830
|
+
}
|
1831
|
+
vaadin-text-field[readonly] > input:placeholder-shown {
|
1832
|
+
opacity: 1;
|
1833
|
+
}
|
1834
|
+
vaadin-text-field input:-webkit-autofill,
|
1835
|
+
vaadin-text-field input:-webkit-autofill::first-line,
|
1836
|
+
vaadin-text-field input:-webkit-autofill:hover,
|
1837
|
+
vaadin-text-field input:-webkit-autofill:active,
|
1838
|
+
vaadin-text-field input:-webkit-autofill:focus {
|
1839
|
+
-webkit-text-fill-color: var(${TextField.cssVarList.color});
|
1840
|
+
box-shadow: 0 0 0 var(${TextField.cssVarList.height}) var(${TextField.cssVarList.backgroundColor}) inset;
|
1841
|
+
}
|
1842
|
+
vaadin-text-field > label,
|
1843
|
+
vaadin-text-field::part(input-field) {
|
1844
|
+
cursor: pointer;
|
1845
|
+
color: var(${TextField.cssVarList.color});
|
1846
|
+
}
|
1847
|
+
vaadin-text-field::part(input-field):focus {
|
1848
|
+
cursor: text;
|
1849
|
+
}
|
1850
|
+
vaadin-text-field[required]::part(required-indicator)::after {
|
1851
|
+
font-size: "12px";
|
1852
|
+
content: "*";
|
1853
|
+
color: var(${TextField.cssVarList.color});
|
1854
|
+
}
|
1855
|
+
vaadin-text-field[readonly]::part(input-field)::after {
|
1856
|
+
border: 0 solid;
|
1857
|
+
}
|
1858
|
+
`;
|
1859
|
+
|
1919
1860
|
const componentName$3 = getComponentName('passcode');
|
1920
1861
|
|
1921
1862
|
const customMixin = (superclass) =>
|
@@ -1933,28 +1874,21 @@ const customMixin = (superclass) =>
|
|
1933
1874
|
const template = document.createElement('template');
|
1934
1875
|
|
1935
1876
|
template.innerHTML = `
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
const slotEle = Object.assign(document.createElement('slot'), {
|
1946
|
-
name: 'input',
|
1947
|
-
slot: 'input',
|
1948
|
-
part: 'input'
|
1949
|
-
});
|
1950
|
-
this.proxyElement.appendChild(slotEle);
|
1877
|
+
<${componentName$5}
|
1878
|
+
bordered="true"
|
1879
|
+
name="code"
|
1880
|
+
tabindex="-1"
|
1881
|
+
slot="input"
|
1882
|
+
></${componentName$5}>
|
1883
|
+
`;
|
1884
|
+
|
1885
|
+
this.proxyElement.appendChild(template.content.cloneNode(true));
|
1951
1886
|
|
1952
1887
|
// we want to control when the element is out of focus
|
1953
1888
|
// so the validations will be triggered blur event is dispatched from descope-passcode internal (and not every time focusing a digit)
|
1954
1889
|
this.proxyElement._setFocused = () => { };
|
1955
1890
|
|
1956
|
-
this.shadowRoot.
|
1957
|
-
this.inputElement = this.querySelector(componentName$4);
|
1891
|
+
this.inputElement = this.shadowRoot.querySelector(componentName$5);
|
1958
1892
|
|
1959
1893
|
forwardAttrs(this.shadowRoot.host, this.inputElement, { includeAttrs: ['required', 'pattern'] });
|
1960
1894
|
|
@@ -1968,17 +1902,21 @@ const customMixin = (superclass) =>
|
|
1968
1902
|
const { borderStyle, borderWidth, ...restTextFieldMappings } =
|
1969
1903
|
textFieldMappings;
|
1970
1904
|
|
1905
|
+
const { digitField, label, requiredIndicator } = {
|
1906
|
+
digitField: { selector: () => TextField.componentName },
|
1907
|
+
label: { selector: '> label' },
|
1908
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' }
|
1909
|
+
};
|
1910
|
+
|
1911
|
+
const textVars = TextField.cssVarList;
|
1912
|
+
|
1971
1913
|
const Passcode = compose(
|
1972
1914
|
createStyleMixin({
|
1973
1915
|
mappings: {
|
1974
|
-
...restTextFieldMappings
|
1916
|
+
...restTextFieldMappings,
|
1917
|
+
borderColor: { ...digitField, property: textVars.borderColor },
|
1918
|
+
color: [restTextFieldMappings.color, label, requiredIndicator],
|
1975
1919
|
},
|
1976
|
-
nestedMappings: {
|
1977
|
-
borderColor: {
|
1978
|
-
selector: TextField.componentName,
|
1979
|
-
property: TextField.cssVarList.borderColor
|
1980
|
-
}
|
1981
|
-
}
|
1982
1920
|
}),
|
1983
1921
|
draggableMixin,
|
1984
1922
|
proxyInputMixin,
|
@@ -1991,63 +1929,50 @@ const Passcode = compose(
|
|
1991
1929
|
style: () => `
|
1992
1930
|
:host {
|
1993
1931
|
--vaadin-field-default-width: auto;
|
1932
|
+
display: inline-block;
|
1994
1933
|
}
|
1995
|
-
|
1996
|
-
::slotted([slot='input']) {
|
1934
|
+
descope-passcode-internal {
|
1997
1935
|
-webkit-mask-image: none;
|
1998
1936
|
display: flex;
|
1999
1937
|
gap: 2px;
|
2000
1938
|
align-items: center;
|
2001
1939
|
padding: 0;
|
2002
1940
|
}
|
2003
|
-
|
2004
1941
|
vaadin-text-field::part(input-field) {
|
2005
1942
|
background-color: transparent;
|
2006
1943
|
padding: 0;
|
1944
|
+
overflow: hidden;
|
2007
1945
|
}
|
2008
|
-
|
2009
|
-
|
1946
|
+
vaadin-text-field {
|
1947
|
+
margin: 0;
|
1948
|
+
padding: 0;
|
1949
|
+
}
|
1950
|
+
vaadin-text-field[readonly] > input:placeholder-shown {
|
1951
|
+
opacity: 1;
|
1952
|
+
}
|
1953
|
+
vaadin-text-field > label,
|
1954
|
+
vaadin-text-field::part(input-field) {
|
1955
|
+
cursor: pointer;
|
1956
|
+
}
|
1957
|
+
vaadin-text-field::part(input-field):focus {
|
1958
|
+
cursor: text;
|
1959
|
+
}
|
1960
|
+
vaadin-text-field[required]::part(required-indicator)::after {
|
1961
|
+
font-size: "12px";
|
1962
|
+
content: "*";
|
1963
|
+
}
|
1964
|
+
vaadin-text-field[readonly]::part(input-field)::after {
|
1965
|
+
border: 0 solid;
|
1966
|
+
}
|
2010
1967
|
`,
|
2011
1968
|
excludeAttrsSync: ['tabindex'],
|
2012
1969
|
componentName: componentName$3
|
2013
1970
|
})
|
2014
1971
|
);
|
2015
1972
|
|
2016
|
-
|
2017
|
-
:host {
|
2018
|
-
display: inline-block;
|
2019
|
-
}
|
2020
|
-
|
2021
|
-
vaadin-text-field {
|
2022
|
-
margin: 0;
|
2023
|
-
padding: 0;
|
2024
|
-
}
|
2025
|
-
vaadin-text-field::part(input-field) {
|
2026
|
-
overflow: hidden;
|
2027
|
-
}
|
2028
|
-
vaadin-text-field[readonly] > input:placeholder-shown {
|
2029
|
-
opacity: 1;
|
2030
|
-
}
|
2031
|
-
|
2032
|
-
vaadin-text-field > label,
|
2033
|
-
vaadin-text-field::part(input-field) {
|
2034
|
-
cursor: pointer;
|
2035
|
-
color: var(${Passcode.cssVarList.color});
|
2036
|
-
}
|
2037
|
-
vaadin-text-field::part(input-field):focus {
|
2038
|
-
cursor: text;
|
2039
|
-
}
|
2040
|
-
vaadin-text-field[required]::part(required-indicator)::after {
|
2041
|
-
font-size: "12px";
|
2042
|
-
content: "*";
|
2043
|
-
color: var(${Passcode.cssVarList.color});
|
2044
|
-
}
|
2045
|
-
vaadin-text-field[readonly]::part(input-field)::after {
|
2046
|
-
border: 0 solid;
|
2047
|
-
}
|
2048
|
-
`;
|
1973
|
+
customElements.define(componentName$4, TextField);
|
2049
1974
|
|
2050
|
-
customElements.define(componentName$
|
1975
|
+
customElements.define(componentName$5, PasscodeInternal);
|
2051
1976
|
|
2052
1977
|
customElements.define(componentName$3, Passcode);
|
2053
1978
|
|
@@ -2129,7 +2054,7 @@ let overrides$1 = ``;
|
|
2129
2054
|
const SwitchToggle = compose(
|
2130
2055
|
createStyleMixin({
|
2131
2056
|
mappings: {
|
2132
|
-
width:
|
2057
|
+
width: {selector: () => ':host'},
|
2133
2058
|
cursor: [{}, { selector: '> label' }]
|
2134
2059
|
}
|
2135
2060
|
}),
|
@@ -2160,6 +2085,9 @@ overrides$1 = `
|
|
2160
2085
|
--bgColor: #fff;
|
2161
2086
|
--knobBgColor: #000;
|
2162
2087
|
}
|
2088
|
+
vaadin-checkbox : {
|
2089
|
+
width: 100%;
|
2090
|
+
}
|
2163
2091
|
vaadin-checkbox>label {
|
2164
2092
|
cursor: pointer;
|
2165
2093
|
border: 1px solid;
|
@@ -2186,6 +2114,7 @@ overrides$1 = `
|
|
2186
2114
|
height: 0;
|
2187
2115
|
width: 0;
|
2188
2116
|
visibility: hidden;
|
2117
|
+
margin: 0;
|
2189
2118
|
}
|
2190
2119
|
vaadin-checkbox[checked]>label::after {
|
2191
2120
|
transform: translateX(-100%);
|
@@ -2203,7 +2132,8 @@ const componentName = getComponentName('text-area');
|
|
2203
2132
|
const selectors = {
|
2204
2133
|
label: '::part(label)',
|
2205
2134
|
input: '::part(input-field)',
|
2206
|
-
required: '::part(required-indicator)::after'
|
2135
|
+
required: '::part(required-indicator)::after',
|
2136
|
+
host: () => ':host'
|
2207
2137
|
};
|
2208
2138
|
|
2209
2139
|
let overrides = ``;
|
@@ -2214,7 +2144,7 @@ const TextArea = compose(
|
|
2214
2144
|
resize: { selector: '> textarea' },
|
2215
2145
|
color: { selector: selectors.label },
|
2216
2146
|
cursor: {},
|
2217
|
-
width:
|
2147
|
+
width: { selector: selectors.host },
|
2218
2148
|
backgroundColor: { selector: selectors.input },
|
2219
2149
|
borderWidth: { selector: selectors.input },
|
2220
2150
|
borderStyle: { selector: selectors.input },
|
@@ -2244,6 +2174,7 @@ overrides = `
|
|
2244
2174
|
|
2245
2175
|
vaadin-text-area {
|
2246
2176
|
margin: 0;
|
2177
|
+
width: 100%;
|
2247
2178
|
}
|
2248
2179
|
vaadin-text-area > label,
|
2249
2180
|
vaadin-text-area::part(input-field) {
|
@@ -2288,9 +2219,9 @@ const getThemeRefs = (theme, prefix) =>
|
|
2288
2219
|
const globalsThemeToStyle = (theme, themeName = '') => `
|
2289
2220
|
*[data-theme="${themeName}"] {
|
2290
2221
|
${Object.entries(themeToCSSVarsObj(theme)).reduce(
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2222
|
+
(acc, entry) => (acc += `${entry.join(':')};\n`),
|
2223
|
+
''
|
2224
|
+
)}
|
2294
2225
|
}
|
2295
2226
|
`;
|
2296
2227
|
|
@@ -2298,10 +2229,20 @@ const componentsThemeToStyleObj = (componentsTheme) =>
|
|
2298
2229
|
transformTheme(componentsTheme, [], (path, val) => {
|
2299
2230
|
const [component, ...restPath] = path;
|
2300
2231
|
const property = restPath.pop();
|
2232
|
+
const componentName = getComponentName(component);
|
2233
|
+
|
2234
|
+
// we need a support for portal components theme (e.g. overlay)
|
2235
|
+
// this allows us to generate those themes under different sections
|
2236
|
+
// if the theme has root level attribute that starts with #
|
2237
|
+
// we are generating a new theme
|
2238
|
+
let themeName = 'theme';
|
2239
|
+
|
2240
|
+
if (restPath[0] && restPath[0].startsWith('#')) {
|
2241
|
+
themeName = restPath.shift();
|
2242
|
+
}
|
2301
2243
|
|
2302
2244
|
// do not start with underscore -> key:value, must have 2 no underscore attrs in a row
|
2303
2245
|
// starts with underscore -> attribute selector
|
2304
|
-
|
2305
2246
|
const attrsSelector = restPath.reduce((acc, section, idx) => {
|
2306
2247
|
if (section.startsWith('_'))
|
2307
2248
|
return (acc += `[${kebabCase(section.replace(/^_/, ''))}="true"]`);
|
@@ -2321,30 +2262,53 @@ const componentsThemeToStyleObj = (componentsTheme) =>
|
|
2321
2262
|
.join('')}"]`);
|
2322
2263
|
}, '');
|
2323
2264
|
|
2324
|
-
let selector =
|
2265
|
+
let selector = `:host${attrsSelector ? `(${attrsSelector})` : ''}`;
|
2325
2266
|
|
2326
2267
|
return {
|
2327
|
-
[
|
2328
|
-
[
|
2268
|
+
[componentName]: {
|
2269
|
+
[themeName]: {
|
2270
|
+
[selector]: {
|
2271
|
+
[property]: val
|
2272
|
+
}
|
2273
|
+
}
|
2329
2274
|
}
|
2330
2275
|
};
|
2331
2276
|
});
|
2332
2277
|
|
2333
|
-
|
2334
|
-
|
2278
|
+
|
2279
|
+
const createComponentsTheme = (componentsTheme) => {
|
2280
|
+
const styleObj = componentsThemeToStyleObj(componentsTheme);
|
2281
|
+
|
2282
|
+
return Object.keys(styleObj).reduce(
|
2283
|
+
(acc, componentName) => {
|
2284
|
+
const componentThemes = styleObj[componentName];
|
2285
|
+
|
2286
|
+
return Object.assign(acc, {
|
2287
|
+
[componentName]: Object.keys(componentThemes)
|
2288
|
+
.reduce((acc, theme) =>
|
2289
|
+
Object.assign(acc, { [theme]: componentsThemeToStyle(componentThemes[theme]) }),
|
2290
|
+
{})
|
2291
|
+
})
|
2292
|
+
},
|
2293
|
+
{}
|
2294
|
+
);
|
2295
|
+
};
|
2296
|
+
|
2297
|
+
const componentsThemeToStyle = (componentsTheme) =>
|
2298
|
+
Object.entries(componentsTheme).reduce(
|
2335
2299
|
(acc, [selector, vars]) =>
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2300
|
+
(acc += `${selector} { \n${Object.entries(
|
2301
|
+
vars
|
2302
|
+
)
|
2303
|
+
.map(([key, val]) => `${key}: ${val}`)
|
2304
|
+
.join(';\n')} \n}\n\n`),
|
2341
2305
|
''
|
2342
2306
|
);
|
2343
2307
|
|
2344
|
-
const themeToStyle = ({ globals, components }, themeName) =>
|
2345
|
-
|
2346
|
-
|
2347
|
-
|
2308
|
+
const themeToStyle = ({ globals, components }, themeName) => ({
|
2309
|
+
globals: globalsThemeToStyle(globals, themeName),
|
2310
|
+
components: createComponentsTheme(components)
|
2311
|
+
});
|
2348
2312
|
|
2349
2313
|
const useVar = (varName) => `var(${varName})`;
|
2350
2314
|
|
@@ -2399,7 +2363,7 @@ const colors = genColors({
|
|
2399
2363
|
surface: {
|
2400
2364
|
main: 'lightgray',
|
2401
2365
|
light: '#fff',
|
2402
|
-
dark: '#000'
|
2366
|
+
dark: '#000',
|
2403
2367
|
},
|
2404
2368
|
primary: '#0082B5',
|
2405
2369
|
secondary: '#7D14EB',
|
@@ -2509,11 +2473,11 @@ const mode = {
|
|
2509
2473
|
surface: globalRefs$7.colors.surface
|
2510
2474
|
};
|
2511
2475
|
|
2512
|
-
const [helperTheme$
|
2476
|
+
const [helperTheme$2, helperRefs$2] = createHelperVars({ mode }, componentName$h);
|
2513
2477
|
|
2514
2478
|
const button = {
|
2515
|
-
...helperTheme$
|
2516
|
-
|
2479
|
+
...helperTheme$2,
|
2480
|
+
[vars$c.width]: 'fit-content',
|
2517
2481
|
size: {
|
2518
2482
|
xs: {
|
2519
2483
|
[vars$c.height]: '10px',
|
@@ -2557,34 +2521,34 @@ const button = {
|
|
2557
2521
|
|
2558
2522
|
variant: {
|
2559
2523
|
contained: {
|
2560
|
-
[vars$c.color]: helperRefs$
|
2561
|
-
[vars$c.backgroundColor]: helperRefs$
|
2524
|
+
[vars$c.color]: helperRefs$2.contrast,
|
2525
|
+
[vars$c.backgroundColor]: helperRefs$2.main,
|
2562
2526
|
_hover: {
|
2563
|
-
[vars$c.backgroundColor]: helperRefs$
|
2527
|
+
[vars$c.backgroundColor]: helperRefs$2.dark
|
2564
2528
|
},
|
2565
2529
|
_loading: {
|
2566
|
-
[vars$c.backgroundColor]: helperRefs$
|
2530
|
+
[vars$c.backgroundColor]: helperRefs$2.main
|
2567
2531
|
}
|
2568
2532
|
},
|
2569
2533
|
outline: {
|
2570
|
-
[vars$c.color]: helperRefs$
|
2571
|
-
[vars$c.borderColor]: helperRefs$
|
2534
|
+
[vars$c.color]: helperRefs$2.main,
|
2535
|
+
[vars$c.borderColor]: helperRefs$2.main,
|
2572
2536
|
_hover: {
|
2573
|
-
[vars$c.color]: helperRefs$
|
2574
|
-
[vars$c.borderColor]: helperRefs$
|
2537
|
+
[vars$c.color]: helperRefs$2.dark,
|
2538
|
+
[vars$c.borderColor]: helperRefs$2.dark,
|
2575
2539
|
_error: {
|
2576
|
-
[vars$c.color]: helperRefs$
|
2540
|
+
[vars$c.color]: helperRefs$2.error
|
2577
2541
|
}
|
2578
2542
|
}
|
2579
2543
|
},
|
2580
2544
|
link: {
|
2581
|
-
[vars$c.color]: helperRefs$
|
2545
|
+
[vars$c.color]: helperRefs$2.main,
|
2582
2546
|
[vars$c.padding]: 0,
|
2583
2547
|
[vars$c.margin]: 0,
|
2584
|
-
[vars$c.lineHeight]: helperRefs$
|
2548
|
+
[vars$c.lineHeight]: helperRefs$2.height,
|
2585
2549
|
[vars$c.borderRadius]: 0,
|
2586
2550
|
_hover: {
|
2587
|
-
[vars$c.color]: helperRefs$
|
2551
|
+
[vars$c.color]: helperRefs$2.main,
|
2588
2552
|
[vars$c.textDecoration]: 'underline'
|
2589
2553
|
}
|
2590
2554
|
}
|
@@ -2680,6 +2644,7 @@ const globalRefs$5 = getThemeRefs(globals);
|
|
2680
2644
|
const vars$9 = TextArea.cssVarList;
|
2681
2645
|
|
2682
2646
|
const textArea = {
|
2647
|
+
[vars$9.width]: '100%',
|
2683
2648
|
[vars$9.color]: globalRefs$5.colors.primary.main,
|
2684
2649
|
[vars$9.backgroundColor]: globalRefs$5.colors.surface.light,
|
2685
2650
|
[vars$9.resize]: 'vertical',
|
@@ -2713,7 +2678,8 @@ const textArea = {
|
|
2713
2678
|
const vars$8 = Checkbox.cssVarList;
|
2714
2679
|
|
2715
2680
|
const checkbox = {
|
2716
|
-
[vars$8.cursor]: 'pointer'
|
2681
|
+
[vars$8.cursor]: 'pointer',
|
2682
|
+
[vars$8.width]: 'fit-content'
|
2717
2683
|
};
|
2718
2684
|
|
2719
2685
|
const vars$7 = SwitchToggle.cssVarList;
|
@@ -2739,7 +2705,7 @@ const horizontalAlignment = {
|
|
2739
2705
|
end: { horizontalAlignment: 'end' },
|
2740
2706
|
};
|
2741
2707
|
|
2742
|
-
const [helperTheme, helperRefs, helperVars] =
|
2708
|
+
const [helperTheme$1, helperRefs$1, helperVars] =
|
2743
2709
|
createHelperVars({
|
2744
2710
|
verticalAlignment,
|
2745
2711
|
horizontalAlignment,
|
@@ -2747,8 +2713,8 @@ const [helperTheme, helperRefs, helperVars] =
|
|
2747
2713
|
}, 'container');
|
2748
2714
|
|
2749
2715
|
const container = {
|
2750
|
-
...helperTheme,
|
2751
|
-
[vars$6.
|
2716
|
+
...helperTheme$1,
|
2717
|
+
[vars$6.width]: '100%',
|
2752
2718
|
verticalPadding: {
|
2753
2719
|
sm: { [vars$6.verticalPadding]: '5px' },
|
2754
2720
|
md: { [vars$6.verticalPadding]: '10px' },
|
@@ -2762,8 +2728,8 @@ const container = {
|
|
2762
2728
|
direction: {
|
2763
2729
|
row: {
|
2764
2730
|
[vars$6.flexDirection]: 'row',
|
2765
|
-
[vars$6.alignItems]: helperRefs.verticalAlignment,
|
2766
|
-
[vars$6.justifyContent]: helperRefs.horizontalAlignment,
|
2731
|
+
[vars$6.alignItems]: helperRefs$1.verticalAlignment,
|
2732
|
+
[vars$6.justifyContent]: helperRefs$1.horizontalAlignment,
|
2767
2733
|
horizontalAlignment: {
|
2768
2734
|
spaceBetween: { [helperVars.horizontalAlignment]: 'space-between' },
|
2769
2735
|
}
|
@@ -2771,8 +2737,8 @@ const container = {
|
|
2771
2737
|
|
2772
2738
|
column: {
|
2773
2739
|
[vars$6.flexDirection]: 'column',
|
2774
|
-
[vars$6.alignItems]: helperRefs.horizontalAlignment,
|
2775
|
-
[vars$6.justifyContent]: helperRefs.verticalAlignment,
|
2740
|
+
[vars$6.alignItems]: helperRefs$1.horizontalAlignment,
|
2741
|
+
[vars$6.justifyContent]: helperRefs$1.verticalAlignment,
|
2776
2742
|
verticalAlignment: {
|
2777
2743
|
spaceBetween: { [helperVars.verticalAlignment]: 'space-between' }
|
2778
2744
|
}
|
@@ -2793,20 +2759,20 @@ const container = {
|
|
2793
2759
|
|
2794
2760
|
shadow: {
|
2795
2761
|
sm: {
|
2796
|
-
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.sm} ${helperRefs.shadowColor}, ${globalRefs$4.shadow.narrow.sm} ${helperRefs.shadowColor}`
|
2762
|
+
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.sm} ${helperRefs$1.shadowColor}, ${globalRefs$4.shadow.narrow.sm} ${helperRefs$1.shadowColor}`
|
2797
2763
|
},
|
2798
2764
|
md: {
|
2799
|
-
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.md} ${helperRefs.shadowColor}, ${globalRefs$4.shadow.narrow.md} ${helperRefs.shadowColor}`
|
2765
|
+
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.md} ${helperRefs$1.shadowColor}, ${globalRefs$4.shadow.narrow.md} ${helperRefs$1.shadowColor}`
|
2800
2766
|
},
|
2801
2767
|
lg: {
|
2802
|
-
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.lg} ${helperRefs.shadowColor}, ${globalRefs$4.shadow.narrow.lg} ${helperRefs.shadowColor}`
|
2768
|
+
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.lg} ${helperRefs$1.shadowColor}, ${globalRefs$4.shadow.narrow.lg} ${helperRefs$1.shadowColor}`
|
2803
2769
|
},
|
2804
2770
|
xl: {
|
2805
|
-
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.xl} ${helperRefs.shadowColor}, ${globalRefs$4.shadow.narrow.xl} ${helperRefs.shadowColor}`
|
2771
|
+
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide.xl} ${helperRefs$1.shadowColor}, ${globalRefs$4.shadow.narrow.xl} ${helperRefs$1.shadowColor}`
|
2806
2772
|
},
|
2807
2773
|
'2xl': {
|
2808
2774
|
[helperVars.shadowColor]: '#00000050',
|
2809
|
-
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide['2xl']} ${helperRefs.shadowColor}`
|
2775
|
+
[vars$6.boxShadow]: `${globalRefs$4.shadow.wide['2xl']} ${helperRefs$1.shadowColor}`
|
2810
2776
|
},
|
2811
2777
|
},
|
2812
2778
|
|
@@ -2963,25 +2929,32 @@ const link = {
|
|
2963
2929
|
|
2964
2930
|
const vars$2 = Divider.cssVarList;
|
2965
2931
|
|
2932
|
+
const thickness = '2px';
|
2933
|
+
const textPaddingSize = '10px';
|
2934
|
+
const [helperTheme, helperRefs] = createHelperVars({ thickness, textPaddingSize }, componentName$b);
|
2935
|
+
|
2936
|
+
|
2966
2937
|
const divider = {
|
2938
|
+
...helperTheme,
|
2967
2939
|
[vars$2.alignItems]: 'center',
|
2968
|
-
[vars$2.
|
2940
|
+
[vars$2.dividerHeight]: helperRefs.thickness,
|
2969
2941
|
[vars$2.backgroundColor]: 'currentColor',
|
2970
2942
|
[vars$2.opacity]: '0.2',
|
2971
|
-
[vars$2.
|
2943
|
+
[vars$2.textPadding]: `0 ${helperRefs.textPaddingSize}`,
|
2972
2944
|
[vars$2.width]: '100%',
|
2973
2945
|
[vars$2.flexDirection]: 'row',
|
2974
2946
|
[vars$2.alignSelf]: 'strech',
|
2975
2947
|
[vars$2.textWidth]: 'fit-content',
|
2948
|
+
[vars$2.maxTextWidth]: 'calc(100% - 100px)',
|
2976
2949
|
_vertical: {
|
2977
|
-
[vars$2.
|
2978
|
-
[vars$2.
|
2950
|
+
[vars$2.padding]: `0 calc(${thickness} * 3)`,
|
2951
|
+
[vars$2.width]: 'fit-content',
|
2952
|
+
[vars$2.textPadding]: `${helperRefs.textPaddingSize} 0`,
|
2979
2953
|
[vars$2.flexDirection]: 'column',
|
2980
2954
|
[vars$2.minHeight]: '200px',
|
2981
|
-
[vars$2.textWidth]: '
|
2982
|
-
|
2983
|
-
|
2984
|
-
[vars$2.fontStyle]: 'italic'
|
2955
|
+
[vars$2.textWidth]: 'fit-content',
|
2956
|
+
[vars$2.dividerWidth]: helperRefs.thickness,
|
2957
|
+
[vars$2.maxTextWidth]: '100%',
|
2985
2958
|
}
|
2986
2959
|
};
|
2987
2960
|
|
@@ -3111,5 +3084,5 @@ var components = {
|
|
3111
3084
|
|
3112
3085
|
var index = { globals, components };
|
3113
3086
|
|
3114
|
-
export {
|
3087
|
+
export { componentsThemeManager, createComponentsTheme, index as defaultTheme, genColor, globalsThemeToStyle, themeToStyle };
|
3115
3088
|
//# sourceMappingURL=index.esm.js.map
|