@descope/web-components-ui 1.0.38 → 1.0.40
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +816 -224
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/101.js +148 -0
- package/dist/umd/208.js +2 -0
- package/dist/umd/208.js.LICENSE.txt +5 -0
- package/dist/umd/211.js +312 -0
- package/dist/umd/211.js.LICENSE.txt +5 -0
- package/dist/umd/233.js +573 -0
- package/dist/umd/{511.js.LICENSE.txt → 233.js.LICENSE.txt} +0 -6
- package/dist/umd/422.js +2 -0
- package/dist/umd/422.js.LICENSE.txt +5 -0
- package/dist/umd/437.js +19 -0
- package/dist/umd/437.js.LICENSE.txt +5 -0
- package/dist/umd/513.js +1 -0
- package/dist/umd/515.js +202 -0
- package/dist/umd/515.js.LICENSE.txt +11 -0
- package/dist/umd/54.js +4 -4
- package/dist/umd/56.js +48 -0
- package/dist/umd/56.js.LICENSE.txt +5 -0
- package/dist/umd/599.js +1 -1
- package/dist/umd/63.js +1 -0
- package/dist/umd/725.js +37 -0
- package/dist/umd/725.js.LICENSE.txt +11 -0
- package/dist/umd/729.js +1 -1
- package/dist/umd/767.js +2 -0
- package/dist/umd/{9.js.LICENSE.txt → 767.js.LICENSE.txt} +0 -6
- package/dist/umd/786.js +2 -0
- package/dist/umd/786.js.LICENSE.txt +17 -0
- package/dist/umd/789.js +1 -0
- package/dist/umd/806.js +109 -0
- package/dist/umd/806.js.LICENSE.txt +5 -0
- package/dist/umd/938.js +1 -0
- package/dist/umd/97.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-checkbox-index-js.js +1 -0
- package/dist/umd/descope-combo-index-js.js +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -0
- package/dist/umd/descope-number-field-index-js.js +1 -0
- package/dist/umd/descope-password-field-index-js.js +1 -0
- package/dist/umd/descope-switch-toggle-index-js.js +1 -0
- package/dist/umd/descope-text-area-index-js.js +1 -0
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +9 -2
- package/src/components/descope-button/Button.js +90 -30
- package/src/components/descope-checkbox/Checkbox.js +33 -0
- package/src/components/descope-checkbox/index.js +6 -0
- package/src/components/descope-email-field/EmailField.js +72 -0
- package/src/components/descope-email-field/index.js +6 -0
- package/src/components/descope-number-field/NumberField.js +72 -0
- package/src/components/descope-number-field/index.js +6 -0
- package/src/components/descope-password-field/PasswordField.js +79 -0
- package/src/components/descope-password-field/index.js +6 -0
- package/src/components/descope-switch-toggle/SwitchToggle.js +81 -0
- package/src/components/descope-switch-toggle/index.js +6 -0
- package/src/components/descope-text-area/TextArea.js +66 -0
- package/src/components/descope-text-area/index.js +6 -0
- package/src/components/descope-text-field/TextField.js +98 -28
- package/src/componentsHelpers/createProxy/index.js +27 -17
- package/src/componentsHelpers/createStyleMixin/index.js +1 -1
- package/src/componentsHelpers/index.js +12 -9
- package/src/componentsHelpers/inputMixin.js +38 -37
- package/src/index.js +11 -3
- package/src/theme/components/button.js +45 -34
- package/src/theme/components/checkbox.js +9 -0
- package/src/theme/components/container.js +32 -27
- package/src/theme/components/emailField.js +8 -0
- package/src/theme/components/index.js +19 -7
- package/src/theme/components/input.js +106 -0
- package/src/theme/components/numberField.js +8 -0
- package/src/theme/components/passwordField.js +11 -0
- package/src/theme/components/switchToggle.js +10 -0
- package/src/theme/components/textArea.js +44 -0
- package/src/theme/components/textField.js +69 -45
- package/src/theme/globals.js +8 -7
- package/dist/umd/221.js +0 -37
- package/dist/umd/511.js +0 -573
- package/dist/umd/9.js +0 -312
- /package/dist/umd/{221.js.LICENSE.txt → 101.js.LICENSE.txt} +0 -0
package/dist/index.esm.js
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
import '@vaadin/button';
|
2
2
|
import '@vaadin/text-field';
|
3
|
+
import '@vaadin/number-field';
|
4
|
+
import '@vaadin/email-field';
|
5
|
+
import '@vaadin/password-field';
|
6
|
+
import '@vaadin/text-area';
|
3
7
|
import '@vaadin/date-picker';
|
4
8
|
import merge from 'lodash.merge';
|
5
9
|
import set from 'lodash.set';
|
@@ -125,7 +129,7 @@ const createStyleMixin = ({ mappings = {} }) => (superclass) => {
|
|
125
129
|
#createComponentStyle() {
|
126
130
|
const themeStyle = document.createElement('style');
|
127
131
|
themeStyle.id = 'style-mixin-component';
|
128
|
-
themeStyle.innerHTML = createStyle(superclass.componentName, baseSelector, mappings);
|
132
|
+
themeStyle.innerHTML = createStyle(superclass.componentName, this.baseSelector, mappings);
|
129
133
|
this.shadowRoot.prepend(themeStyle);
|
130
134
|
}
|
131
135
|
|
@@ -205,13 +209,18 @@ const syncAttrs = (ele1, ele2, excludeAttrs) => {
|
|
205
209
|
observeAttributes(ele2, createSyncAttrsCb(ele2, ele1), excludeAttrs);
|
206
210
|
};
|
207
211
|
|
208
|
-
const createProxy = ({
|
209
|
-
|
212
|
+
const createProxy = ({
|
213
|
+
componentName,
|
214
|
+
wrappedEleName,
|
215
|
+
slots = [],
|
216
|
+
style,
|
217
|
+
excludeAttrsSync = []
|
218
|
+
}) => {
|
210
219
|
const template = `
|
211
|
-
|
220
|
+
<style id="create-proxy"></style>
|
212
221
|
<${wrappedEleName}>
|
213
222
|
<slot></slot>
|
214
|
-
${slots.map((slot) => `<slot name="${slot}" slot="${slot}"></slot>`).join(
|
223
|
+
${slots.map((slot) => `<slot name="${slot}" slot="${slot}"></slot>`).join('')}
|
215
224
|
</${wrappedEleName}>
|
216
225
|
`;
|
217
226
|
|
@@ -221,17 +230,19 @@ const createProxy = ({ componentName, wrappedEleName, slots = [], style, exclude
|
|
221
230
|
}
|
222
231
|
|
223
232
|
constructor() {
|
224
|
-
super().attachShadow({ mode:
|
233
|
+
super().attachShadow({ mode: 'open' }).innerHTML = template;
|
225
234
|
this.hostElement = this.shadowRoot.host;
|
226
235
|
this.componentName = this.hostElement.tagName.toLowerCase();
|
227
236
|
this.baseSelector = wrappedEleName;
|
237
|
+
this.shadowRoot.getElementById('create-proxy').innerHTML =
|
238
|
+
typeof style === 'function' ? style() : style;
|
228
239
|
}
|
229
240
|
|
230
241
|
connectedCallback() {
|
231
242
|
if (this.shadowRoot.isConnected) {
|
232
243
|
this.proxyElement = this.shadowRoot.querySelector(wrappedEleName);
|
233
244
|
this.setAttribute('tabindex', '0');
|
234
|
-
|
245
|
+
|
235
246
|
// we want to focus on the proxy element when focusing our WC
|
236
247
|
this.onfocus = (e) => {
|
237
248
|
this.proxyElement.focus();
|
@@ -251,8 +262,11 @@ const createProxy = ({ componentName, wrappedEleName, slots = [], style, exclude
|
|
251
262
|
|
252
263
|
this.mouseoverCbRef = () => {
|
253
264
|
this.proxyElement.setAttribute('hover', '');
|
254
|
-
this.proxyElement.addEventListener(
|
255
|
-
|
265
|
+
this.proxyElement.addEventListener(
|
266
|
+
'mouseleave',
|
267
|
+
() => this.proxyElement.removeAttribute('hover'),
|
268
|
+
{ once: true }
|
269
|
+
);
|
256
270
|
};
|
257
271
|
|
258
272
|
this.proxyElement.addEventListener('mouseover', this.mouseoverCbRef);
|
@@ -279,51 +293,52 @@ const createProxy = ({ componentName, wrappedEleName, slots = [], style, exclude
|
|
279
293
|
};
|
280
294
|
|
281
295
|
const inputMixin = (superclass) =>
|
282
|
-
|
296
|
+
class InputMixinClass extends superclass {
|
283
297
|
static get formAssociated() {
|
284
298
|
return true;
|
285
299
|
}
|
286
|
-
|
287
|
-
#internals
|
288
|
-
|
289
|
-
constructor() {
|
290
|
-
super();
|
291
300
|
|
292
|
-
|
301
|
+
#internals;
|
293
302
|
|
294
|
-
|
295
|
-
|
296
|
-
this.setAttribute('tabindex', 0);
|
297
|
-
}
|
298
|
-
}
|
299
|
-
|
300
|
-
formAssociatedCallback() {
|
301
|
-
this.setValidity?.();
|
302
|
-
}
|
303
|
-
|
304
|
-
connectedCallback() {
|
305
|
-
super.connectedCallback?.();
|
303
|
+
constructor() {
|
304
|
+
super();
|
306
305
|
|
307
|
-
|
308
|
-
|
309
|
-
const input = this.proxyElement.querySelector('input');
|
310
|
-
if (!input) throw Error('no input was found')
|
306
|
+
this.#internals = this.attachInternals();
|
307
|
+
}
|
311
308
|
|
312
|
-
|
313
|
-
|
314
|
-
|
309
|
+
formAssociatedCallback() {
|
310
|
+
this.setValidity?.();
|
311
|
+
}
|
315
312
|
|
316
|
-
|
317
|
-
|
318
|
-
};
|
313
|
+
connectedCallback() {
|
314
|
+
super.connectedCallback?.();
|
319
315
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
316
|
+
// this is needed in order to make sure the form input validation is working
|
317
|
+
if (!this.hasAttribute('tabindex')) {
|
318
|
+
this.setAttribute('tabindex', 0);
|
319
|
+
}
|
324
320
|
|
325
|
-
|
326
|
-
|
321
|
+
// vaadin does not expose all those validation attributes so we need to take it from the input
|
322
|
+
// https://github.com/vaadin/web-components/issues/1177
|
323
|
+
const input =
|
324
|
+
this.proxyElement.querySelector('input') ||
|
325
|
+
this.proxyElement.querySelector('textarea');
|
326
|
+
if (!input) throw Error('no input was found');
|
327
|
+
|
328
|
+
this.checkValidity = () => input.checkValidity();
|
329
|
+
this.reportValidity = () => input.reportValidity();
|
330
|
+
this.validity = input.validity;
|
331
|
+
|
332
|
+
this.setValidity = () => {
|
333
|
+
this.#internals.setValidity(input.validity, input.validationMessage);
|
334
|
+
};
|
335
|
+
|
336
|
+
input.oninput = () => {
|
337
|
+
this.value = input.value;
|
338
|
+
this.setValidity();
|
339
|
+
};
|
340
|
+
}
|
341
|
+
};
|
327
342
|
|
328
343
|
const componentNameValidationMixin = (superclass) =>
|
329
344
|
class DraggableMixinClass extends superclass {
|
@@ -349,79 +364,195 @@ const componentNameValidationMixin = (superclass) =>
|
|
349
364
|
|
350
365
|
const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);
|
351
366
|
|
352
|
-
const compose =
|
367
|
+
const compose =
|
368
|
+
(...fns) =>
|
369
|
+
(val) =>
|
370
|
+
fns.reduceRight((res, fn) => fn(res), val);
|
371
|
+
|
372
|
+
const componentName$a = getComponentName('button');
|
353
373
|
|
354
374
|
const editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;
|
375
|
+
const resetStyles = `
|
376
|
+
vaadin-button { margin: 0; }
|
377
|
+
vaadin-button::part(prefix) {
|
378
|
+
margin-left: 0;
|
379
|
+
margin-right: 0;
|
380
|
+
}
|
381
|
+
`;
|
382
|
+
const iconStyles = `
|
383
|
+
vaadin-button::part(prefix),
|
384
|
+
vaadin-button::part(label) {
|
385
|
+
display: flex;
|
386
|
+
justify-content: center;
|
387
|
+
align-items: center;
|
388
|
+
gap: 5px;
|
389
|
+
}
|
390
|
+
`;
|
355
391
|
|
356
|
-
const
|
392
|
+
const selectors$2 = {
|
393
|
+
label: '::part(label)'
|
394
|
+
};
|
357
395
|
|
358
396
|
const Button = compose(
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
397
|
+
createStyleMixin({
|
398
|
+
// todo: do we want to change the mapping structure to this? ['aa', 'aaa', {'color': [{ selector: '::part(label)' }]}],
|
399
|
+
mappings: {
|
400
|
+
backgroundColor: {},
|
401
|
+
borderRadius: {},
|
402
|
+
color: { selector: selectors$2.label },
|
403
|
+
borderColor: {},
|
404
|
+
borderStyle: {},
|
405
|
+
borderWidth: {},
|
406
|
+
fontSize: {},
|
407
|
+
height: {},
|
408
|
+
width: [matchHostStyle()],
|
409
|
+
cursor: {},
|
410
|
+
padding: [matchHostStyle(), { selector: selectors$2.label }],
|
411
|
+
textDecoration: { selector: selectors$2.label }
|
412
|
+
}
|
413
|
+
}),
|
414
|
+
draggableMixin,
|
415
|
+
componentNameValidationMixin
|
377
416
|
)(
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
417
|
+
createProxy({
|
418
|
+
slots: ['prefix', 'label', 'suffix'],
|
419
|
+
wrappedEleName: 'vaadin-button',
|
420
|
+
style: () =>
|
421
|
+
`${resetStyles} ${editorOverrides} ${iconStyles} ${loadingIndicatorStyles}`,
|
422
|
+
excludeAttrsSync: ['tabindex'],
|
423
|
+
componentName: componentName$a
|
424
|
+
})
|
385
425
|
);
|
386
426
|
|
387
|
-
|
427
|
+
const loadingIndicatorStyles = `
|
428
|
+
@keyframes spin {
|
429
|
+
0% { -webkit-transform: rotate(0deg); }
|
430
|
+
100% { -webkit-transform: rotate(360deg); }
|
431
|
+
}
|
432
|
+
:host([loading]) ::before {
|
433
|
+
--marginRatio: 1.35;
|
434
|
+
color: var(${Button.cssVarList.color});
|
435
|
+
animation: spin 2s linear infinite;
|
436
|
+
position: absolute;
|
437
|
+
top: calc(50% - calc((var(${Button.cssVarList.height}) / var(--marginRatio)) / 2));
|
438
|
+
left: calc(50% - calc((var(${Button.cssVarList.height}) / var(--marginRatio)) / 2));
|
439
|
+
content: '';
|
440
|
+
z-index: 1;
|
441
|
+
box-sizing: border-box;
|
442
|
+
border-radius: 50%;
|
443
|
+
border-bottom-color: transparent;
|
444
|
+
border-left-color: transparent;
|
445
|
+
border-width: calc(var(${Button.cssVarList.height}) / 12);
|
446
|
+
border-style: solid;
|
447
|
+
width: calc(var(${Button.cssVarList.height}) / var(--marginRatio));
|
448
|
+
height: calc(var(${Button.cssVarList.height}) / var(--marginRatio));
|
449
|
+
}
|
450
|
+
:host([loading])::part(prefix),
|
451
|
+
:host([loading])::part(label) {
|
452
|
+
visibility: hidden;
|
453
|
+
}
|
454
|
+
`;
|
388
455
|
|
389
|
-
|
456
|
+
customElements.define(componentName$a, Button);
|
457
|
+
|
458
|
+
const componentName$9 = getComponentName('text-field');
|
459
|
+
|
460
|
+
const selectors$1 = {
|
461
|
+
label: '::part(label)',
|
462
|
+
input: '::part(input-field)',
|
463
|
+
readOnlyInput: '[readonly]::part(input-field)::after',
|
464
|
+
placeholder: '> input:placeholder-shown'
|
465
|
+
};
|
466
|
+
|
467
|
+
let overrides$5 = ``;
|
468
|
+
|
469
|
+
const textFieldMappings = {
|
470
|
+
color: { selector: selectors$1.input },
|
471
|
+
backgroundColor: { selector: selectors$1.input },
|
472
|
+
width: [matchHostStyle()],
|
473
|
+
color: { selector: selectors$1.input },
|
474
|
+
borderColor: [
|
475
|
+
{ selector: selectors$1.input },
|
476
|
+
{ selector: selectors$1.readOnlyInput }
|
477
|
+
],
|
478
|
+
borderWidth: [
|
479
|
+
{ selector: selectors$1.input },
|
480
|
+
{ selector: selectors$1.readOnlyInput }
|
481
|
+
],
|
482
|
+
borderStyle: [
|
483
|
+
{ selector: selectors$1.input },
|
484
|
+
{ selector: selectors$1.readOnlyInput }
|
485
|
+
],
|
486
|
+
borderRadius: { selector: selectors$1.input },
|
487
|
+
boxShadow: { selector: selectors$1.input },
|
488
|
+
fontSize: {},
|
489
|
+
height: { selector: selectors$1.input },
|
490
|
+
padding: { selector: selectors$1.input },
|
491
|
+
outline: { selector: selectors$1.input },
|
492
|
+
outlineOffset: { selector: selectors$1.input },
|
493
|
+
|
494
|
+
placeholderColor: { selector: selectors$1.placeholder, property: 'color' }
|
495
|
+
};
|
390
496
|
|
391
497
|
const TextField = compose(
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
'borderStyle': { selector: '::part(input-field)' },
|
399
|
-
'borderRadius': { selector: '::part(input-field)' },
|
400
|
-
'boxShadow': { selector: '::part(input-field)' },
|
401
|
-
'height': { selector: '::part(input-field)' },
|
402
|
-
'padding': { selector: '::part(input-field)' },
|
403
|
-
'backgroundColor': { selector: '::part(input-field)' },
|
404
|
-
'labelColor': { selector: '::part(label)', property: 'color' },
|
405
|
-
},
|
406
|
-
}),
|
407
|
-
draggableMixin,
|
408
|
-
inputMixin,
|
409
|
-
componentNameValidationMixin
|
498
|
+
createStyleMixin({
|
499
|
+
mappings: textFieldMappings
|
500
|
+
}),
|
501
|
+
draggableMixin,
|
502
|
+
inputMixin,
|
503
|
+
componentNameValidationMixin
|
410
504
|
)(
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
505
|
+
createProxy({
|
506
|
+
slots: ['prefix', 'suffix'],
|
507
|
+
wrappedEleName: 'vaadin-text-field',
|
508
|
+
style: () => overrides$5,
|
509
|
+
excludeAttrsSync: ['tabindex'],
|
510
|
+
componentName: componentName$9
|
511
|
+
})
|
418
512
|
);
|
419
513
|
|
420
|
-
|
514
|
+
overrides$5 = `
|
515
|
+
vaadin-text-field {
|
516
|
+
margin: 0;
|
517
|
+
padding: 0;
|
518
|
+
}
|
519
|
+
vaadin-text-field::part(input-field) {
|
520
|
+
overflow: hidden;
|
521
|
+
}
|
522
|
+
vaadin-text-field[readonly] > input:placeholder-shown {
|
523
|
+
opacity: 1;
|
524
|
+
}
|
525
|
+
vaadin-text-field input:-webkit-autofill,
|
526
|
+
vaadin-text-field input:-webkit-autofill::first-line,
|
527
|
+
vaadin-text-field input:-webkit-autofill:hover,
|
528
|
+
vaadin-text-field input:-webkit-autofill:active,
|
529
|
+
vaadin-text-field input:-webkit-autofill:focus {
|
530
|
+
-webkit-text-fill-color: var(${TextField.cssVarList.color});
|
531
|
+
box-shadow: 0 0 0 var(${TextField.cssVarList.height}) var(${TextField.cssVarList.backgroundColor}) inset;
|
532
|
+
}
|
533
|
+
vaadin-text-field > label,
|
534
|
+
vaadin-text-field::part(input-field) {
|
535
|
+
cursor: pointer;
|
536
|
+
color: var(${TextField.cssVarList.color});
|
537
|
+
}
|
538
|
+
vaadin-text-field::part(input-field):focus {
|
539
|
+
cursor: text;
|
540
|
+
}
|
541
|
+
vaadin-text-field[required]::part(required-indicator)::after {
|
542
|
+
font-size: "12px";
|
543
|
+
content: "*";
|
544
|
+
color: var(${TextField.cssVarList.color});
|
545
|
+
}
|
546
|
+
vaadin-text-field[readonly]::part(input-field)::after {
|
547
|
+
border: 0 solid;
|
548
|
+
}
|
549
|
+
`;
|
550
|
+
|
551
|
+
customElements.define(componentName$9, TextField);
|
421
552
|
|
422
553
|
const template = document.createElement('template');
|
423
554
|
|
424
|
-
const componentName$
|
555
|
+
const componentName$8 = getComponentName("combo");
|
425
556
|
|
426
557
|
template.innerHTML = `
|
427
558
|
<descope-button></descope-button>
|
@@ -438,29 +569,280 @@ class Combo extends HTMLElement {
|
|
438
569
|
}
|
439
570
|
}
|
440
571
|
|
441
|
-
customElements.define(componentName$
|
572
|
+
customElements.define(componentName$8, Combo);
|
573
|
+
|
574
|
+
const componentName$7 = getComponentName('number-field');
|
575
|
+
|
576
|
+
let overrides$4 = ``;
|
577
|
+
|
578
|
+
const NumberField = compose(
|
579
|
+
createStyleMixin({
|
580
|
+
mappings: {
|
581
|
+
...textFieldMappings
|
582
|
+
}
|
583
|
+
}),
|
584
|
+
draggableMixin,
|
585
|
+
inputMixin,
|
586
|
+
componentNameValidationMixin
|
587
|
+
)(
|
588
|
+
createProxy({
|
589
|
+
slots: ['prefix', 'suffix'],
|
590
|
+
wrappedEleName: 'vaadin-number-field',
|
591
|
+
style: () => overrides$4,
|
592
|
+
excludeAttrsSync: ['tabindex'],
|
593
|
+
componentName: componentName$7
|
594
|
+
})
|
595
|
+
);
|
596
|
+
|
597
|
+
overrides$4 = `
|
598
|
+
vaadin-number-field {
|
599
|
+
margin: 0;
|
600
|
+
padding: 0;
|
601
|
+
}
|
602
|
+
vaadin-number-field::part(input-field) {
|
603
|
+
overflow: hidden;
|
604
|
+
}
|
605
|
+
vaadin-number-field[readonly] > input:placeholder-shown {
|
606
|
+
opacity: 1;
|
607
|
+
}
|
608
|
+
vaadin-number-field input:-webkit-autofill,
|
609
|
+
vaadin-number-field input:-webkit-autofill::first-line,
|
610
|
+
vaadin-number-field input:-webkit-autofill:hover,
|
611
|
+
vaadin-number-field input:-webkit-autofill:active,
|
612
|
+
vaadin-number-field input:-webkit-autofill:focus {
|
613
|
+
-webkit-text-fill-color: var(${NumberField.cssVarList.color});
|
614
|
+
box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
|
615
|
+
}
|
616
|
+
vaadin-number-field > label,
|
617
|
+
vaadin-number-field::part(input-field) {
|
618
|
+
cursor: pointer;
|
619
|
+
color: var(${NumberField.cssVarList.color});
|
620
|
+
}
|
621
|
+
vaadin-number-field::part(input-field):focus {
|
622
|
+
cursor: text;
|
623
|
+
}
|
624
|
+
vaadin-number-field[required]::part(required-indicator)::after {
|
625
|
+
font-size: "12px";
|
626
|
+
content: "*";
|
627
|
+
color: var(${NumberField.cssVarList.color});
|
628
|
+
}
|
629
|
+
vaadin-number-field[readonly]::part(input-field)::after {
|
630
|
+
border: 0 solid;
|
631
|
+
}
|
632
|
+
`;
|
633
|
+
|
634
|
+
customElements.define(componentName$7, NumberField);
|
635
|
+
|
636
|
+
const componentName$6 = getComponentName('email-field');
|
637
|
+
|
638
|
+
let overrides$3 = ``;
|
639
|
+
|
640
|
+
const EmailField = compose(
|
641
|
+
createStyleMixin({
|
642
|
+
mappings: {
|
643
|
+
...textFieldMappings
|
644
|
+
}
|
645
|
+
}),
|
646
|
+
draggableMixin,
|
647
|
+
inputMixin,
|
648
|
+
componentNameValidationMixin
|
649
|
+
)(
|
650
|
+
createProxy({
|
651
|
+
slots: ['suffix'],
|
652
|
+
wrappedEleName: 'vaadin-email-field',
|
653
|
+
style: () => overrides$3,
|
654
|
+
excludeAttrsSync: ['tabindex'],
|
655
|
+
componentName: componentName$6
|
656
|
+
})
|
657
|
+
);
|
658
|
+
|
659
|
+
overrides$3 = `
|
660
|
+
vaadin-email-field {
|
661
|
+
margin: 0;
|
662
|
+
padding: 0;
|
663
|
+
}
|
664
|
+
vaadin-email-field::part(input-field) {
|
665
|
+
overflow: hidden;
|
666
|
+
}
|
667
|
+
vaadin-email-field[readonly] > input:placeholder-shown {
|
668
|
+
opacity: 1;
|
669
|
+
}
|
670
|
+
vaadin-email-field input:-webkit-autofill,
|
671
|
+
vaadin-email-field input:-webkit-autofill::first-line,
|
672
|
+
vaadin-email-field input:-webkit-autofill:hover,
|
673
|
+
vaadin-email-field input:-webkit-autofill:active,
|
674
|
+
vaadin-email-field input:-webkit-autofill:focus {
|
675
|
+
-webkit-text-fill-color: var(${EmailField.cssVarList.color});
|
676
|
+
box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
|
677
|
+
}
|
678
|
+
vaadin-email-field > label,
|
679
|
+
vaadin-email-field::part(input-field) {
|
680
|
+
cursor: pointer;
|
681
|
+
color: var(${EmailField.cssVarList.color});
|
682
|
+
}
|
683
|
+
vaadin-email-field::part(input-field):focus {
|
684
|
+
cursor: text;
|
685
|
+
}
|
686
|
+
vaadin-email-field[required]::part(required-indicator)::after {
|
687
|
+
font-size: "12px";
|
688
|
+
content: "*";
|
689
|
+
color: var(${EmailField.cssVarList.color});
|
690
|
+
}
|
691
|
+
vaadin-email-field[readonly]::part(input-field)::after {
|
692
|
+
border: 0 solid;
|
693
|
+
}
|
694
|
+
`;
|
695
|
+
|
696
|
+
customElements.define(componentName$6, EmailField);
|
697
|
+
|
698
|
+
const componentName$5 = getComponentName('password-field');
|
699
|
+
|
700
|
+
let overrides$2 = ``;
|
701
|
+
|
702
|
+
const PasswordField = compose(
|
703
|
+
createStyleMixin({
|
704
|
+
mappings: {
|
705
|
+
...textFieldMappings,
|
706
|
+
// todo: override cursor from lumo
|
707
|
+
revealCursor: [
|
708
|
+
{
|
709
|
+
selector: '::part(reveal-button)::before',
|
710
|
+
property: 'cursor'
|
711
|
+
}
|
712
|
+
]
|
713
|
+
}
|
714
|
+
}),
|
715
|
+
draggableMixin,
|
716
|
+
inputMixin,
|
717
|
+
componentNameValidationMixin
|
718
|
+
)(
|
719
|
+
createProxy({
|
720
|
+
slots: ['suffix'],
|
721
|
+
wrappedEleName: 'vaadin-password-field',
|
722
|
+
style: () => overrides$2,
|
723
|
+
excludeAttrsSync: ['tabindex'],
|
724
|
+
componentName: componentName$5
|
725
|
+
})
|
726
|
+
);
|
727
|
+
|
728
|
+
overrides$2 = `
|
729
|
+
vaadin-password-field {
|
730
|
+
margin: 0;
|
731
|
+
padding: 0;
|
732
|
+
}
|
733
|
+
vaadin-password-field::part(input-field) {
|
734
|
+
overflow: hidden;
|
735
|
+
}
|
736
|
+
vaadin-password-field[readonly] > input:placeholder-shown {
|
737
|
+
opacity: 1;
|
738
|
+
}
|
739
|
+
vaadin-password-field input:-webkit-autofill,
|
740
|
+
vaadin-password-field input:-webkit-autofill::first-line,
|
741
|
+
vaadin-password-field input:-webkit-autofill:hover,
|
742
|
+
vaadin-password-field input:-webkit-autofill:active,
|
743
|
+
vaadin-password-field input:-webkit-autofill:focus {
|
744
|
+
-webkit-text-fill-color: var(${PasswordField.cssVarList.color});
|
745
|
+
box-shadow: 0 0 0 var(${PasswordField.cssVarList.height}) var(${PasswordField.cssVarList.backgroundColor}) inset;
|
746
|
+
}
|
747
|
+
vaadin-password-field > label,
|
748
|
+
vaadin-password-field::part(input-field) {
|
749
|
+
cursor: pointer;
|
750
|
+
color: var(${PasswordField.cssVarList.color});
|
751
|
+
}
|
752
|
+
vaadin-password-field::part(input-field):focus {
|
753
|
+
cursor: text;
|
754
|
+
}
|
755
|
+
vaadin-password-field[required]::part(required-indicator)::after {
|
756
|
+
font-size: "12px";
|
757
|
+
content: "*";
|
758
|
+
color: var(${PasswordField.cssVarList.color});
|
759
|
+
}
|
760
|
+
vaadin-password-field[readonly]::part(input-field)::after {
|
761
|
+
border: 0 solid;
|
762
|
+
}
|
763
|
+
`;
|
764
|
+
|
765
|
+
customElements.define(componentName$5, PasswordField);
|
766
|
+
|
767
|
+
const componentName$4 = getComponentName('text-area');
|
768
|
+
|
769
|
+
const selectors = {
|
770
|
+
label: '::part(label)',
|
771
|
+
input: ':not([disabled])::part(input-field)',
|
772
|
+
required: '::part(required-indicator)::after'
|
773
|
+
};
|
774
|
+
|
775
|
+
let overrides$1 = ``;
|
776
|
+
|
777
|
+
const TextArea = compose(
|
778
|
+
createStyleMixin({
|
779
|
+
mappings: {
|
780
|
+
resize: { selector: '> textarea' },
|
781
|
+
color: { selector: selectors.label },
|
782
|
+
cursor: {},
|
783
|
+
width: {},
|
784
|
+
backgroundColor: { selector: selectors.input },
|
785
|
+
borderWidth: { selector: selectors.input },
|
786
|
+
borderStyle: { selector: selectors.input },
|
787
|
+
borderColor: { selector: selectors.input },
|
788
|
+
borderRadius: { selector: selectors.input },
|
789
|
+
outline: { selector: selectors.input },
|
790
|
+
outlineOffset: { selector: selectors.input }
|
791
|
+
}
|
792
|
+
}),
|
793
|
+
draggableMixin,
|
794
|
+
inputMixin,
|
795
|
+
componentNameValidationMixin
|
796
|
+
)(
|
797
|
+
createProxy({
|
798
|
+
slots: [],
|
799
|
+
wrappedEleName: 'vaadin-text-area',
|
800
|
+
style: () => overrides$1,
|
801
|
+
excludeAttrsSync: ['tabindex'],
|
802
|
+
componentName: componentName$4
|
803
|
+
})
|
804
|
+
);
|
805
|
+
|
806
|
+
overrides$1 = `
|
807
|
+
vaadin-text-area {
|
808
|
+
margin: 0;
|
809
|
+
}
|
810
|
+
vaadin-text-area > label,
|
811
|
+
vaadin-text-area::part(input-field) {
|
812
|
+
cursor: pointer;
|
813
|
+
}
|
814
|
+
vaadin-text-area[focused] input:focus {
|
815
|
+
cursor: text;
|
816
|
+
}
|
817
|
+
vaadin-text-area::part(required-indicator)::after {
|
818
|
+
font-size: "12px";
|
819
|
+
content: "*";
|
820
|
+
}
|
821
|
+
`;
|
822
|
+
|
823
|
+
customElements.define(componentName$4, TextArea);
|
442
824
|
|
443
|
-
const componentName$
|
825
|
+
const componentName$3 = getComponentName("date-picker");
|
444
826
|
|
445
827
|
const DatePicker = compose(
|
446
828
|
draggableMixin,
|
447
829
|
componentNameValidationMixin
|
448
830
|
)(
|
449
831
|
createProxy({
|
450
|
-
componentName: componentName$
|
832
|
+
componentName: componentName$3,
|
451
833
|
slots: ["prefix", "suffix"],
|
452
834
|
wrappedEleName: "vaadin-date-picker",
|
453
835
|
style: ``,
|
454
836
|
})
|
455
837
|
);
|
456
838
|
|
457
|
-
customElements.define(componentName$
|
839
|
+
customElements.define(componentName$3, DatePicker);
|
458
840
|
|
459
|
-
const componentName = getComponentName("container");
|
841
|
+
const componentName$2 = getComponentName("container");
|
460
842
|
|
461
843
|
class RawContainer extends HTMLElement {
|
462
844
|
static get componentName() {
|
463
|
-
return componentName
|
845
|
+
return componentName$2
|
464
846
|
}
|
465
847
|
constructor() {
|
466
848
|
super();
|
@@ -510,7 +892,7 @@ const Container = compose(
|
|
510
892
|
componentNameValidationMixin,
|
511
893
|
)(RawContainer);
|
512
894
|
|
513
|
-
customElements.define(componentName, Container);
|
895
|
+
customElements.define(componentName$2, Container);
|
514
896
|
|
515
897
|
const getVarName = (path) => getCssVarName(DESCOPE_PREFIX, ...path);
|
516
898
|
|
@@ -631,8 +1013,9 @@ const genColors = (colors) => {
|
|
631
1013
|
|
632
1014
|
const colors = genColors({
|
633
1015
|
surface: {
|
634
|
-
main:
|
635
|
-
light:
|
1016
|
+
main: "lightgray",
|
1017
|
+
light: "#fff",
|
1018
|
+
dark: "#000",
|
636
1019
|
},
|
637
1020
|
primary: "#0082B5",
|
638
1021
|
secondary: "#7D14EB",
|
@@ -659,11 +1042,11 @@ const typography = {
|
|
659
1042
|
};
|
660
1043
|
|
661
1044
|
const spacing = {
|
662
|
-
xs:
|
663
|
-
sm:
|
664
|
-
md:
|
665
|
-
lg:
|
666
|
-
xl:
|
1045
|
+
xs: "2px",
|
1046
|
+
sm: "4px",
|
1047
|
+
md: "8px",
|
1048
|
+
lg: "16px",
|
1049
|
+
xl: "32px",
|
667
1050
|
};
|
668
1051
|
|
669
1052
|
const border = {
|
@@ -696,132 +1079,330 @@ var globals = {
|
|
696
1079
|
shadow,
|
697
1080
|
};
|
698
1081
|
|
699
|
-
const globalRefs$
|
700
|
-
const vars$
|
1082
|
+
const globalRefs$3 = getThemeRefs(globals);
|
1083
|
+
const vars$6 = Button.cssVarList;
|
701
1084
|
|
702
1085
|
const mode = {
|
703
|
-
primary:
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
},
|
709
|
-
secondary: globalRefs$2.colors.secondary,
|
710
|
-
success: globalRefs$2.colors.success,
|
711
|
-
error: globalRefs$2.colors.error,
|
712
|
-
surface: globalRefs$2.colors.surface,
|
1086
|
+
primary: globalRefs$3.colors.primary,
|
1087
|
+
secondary: globalRefs$3.colors.secondary,
|
1088
|
+
success: globalRefs$3.colors.success,
|
1089
|
+
error: globalRefs$3.colors.error,
|
1090
|
+
surface: globalRefs$3.colors.surface,
|
713
1091
|
};
|
714
1092
|
|
715
|
-
const [helperTheme$1, helperRefs$1] = createHelperVars({ mode }, componentName$
|
1093
|
+
const [helperTheme$1, helperRefs$1] = createHelperVars({ mode }, componentName$a);
|
716
1094
|
|
717
1095
|
const button = {
|
718
1096
|
...helperTheme$1,
|
719
|
-
[vars$2.borderRadius]: globalRefs$2.radius.lg,
|
720
|
-
[vars$2.cursor]: 'pointer',
|
721
1097
|
|
722
1098
|
size: {
|
723
1099
|
xs: {
|
724
|
-
[vars$
|
725
|
-
[vars$
|
726
|
-
[vars$
|
1100
|
+
[vars$6.height]: "10px",
|
1101
|
+
[vars$6.fontSize]: "10px",
|
1102
|
+
[vars$6.padding]: `0 ${globalRefs$3.spacing.xs}`,
|
727
1103
|
},
|
728
1104
|
sm: {
|
729
|
-
[vars$
|
730
|
-
[vars$
|
731
|
-
[vars$
|
1105
|
+
[vars$6.height]: "20px",
|
1106
|
+
[vars$6.fontSize]: "10px",
|
1107
|
+
[vars$6.padding]: `0 ${globalRefs$3.spacing.sm}`,
|
732
1108
|
},
|
733
1109
|
md: {
|
734
|
-
[vars$
|
735
|
-
[vars$
|
736
|
-
[vars$
|
1110
|
+
[vars$6.height]: "30px",
|
1111
|
+
[vars$6.fontSize]: "14px",
|
1112
|
+
[vars$6.padding]: `0 ${globalRefs$3.spacing.md}`,
|
737
1113
|
},
|
738
1114
|
lg: {
|
739
|
-
[vars$
|
740
|
-
[vars$
|
741
|
-
[vars$
|
1115
|
+
[vars$6.height]: "40px",
|
1116
|
+
[vars$6.fontSize]: "20px",
|
1117
|
+
[vars$6.padding]: `0 ${globalRefs$3.spacing.lg}`,
|
742
1118
|
},
|
743
1119
|
xl: {
|
744
|
-
[vars$
|
745
|
-
[vars$
|
746
|
-
[vars$
|
1120
|
+
[vars$6.height]: "50px",
|
1121
|
+
[vars$6.fontSize]: "25px",
|
1122
|
+
[vars$6.padding]: `0 ${globalRefs$3.spacing.xl}`,
|
747
1123
|
},
|
748
1124
|
},
|
749
1125
|
|
750
|
-
|
751
|
-
|
1126
|
+
[vars$6.borderRadius]: globalRefs$3.radius.lg,
|
1127
|
+
[vars$6.cursor]: "pointer",
|
1128
|
+
[vars$6.borderWidth]: "2px",
|
1129
|
+
[vars$6.borderStyle]: "solid",
|
1130
|
+
[vars$6.borderColor]: "transparent",
|
1131
|
+
|
1132
|
+
_fullwidth: {
|
1133
|
+
[vars$6.width]: "100%",
|
1134
|
+
},
|
1135
|
+
_loading: {
|
1136
|
+
[vars$6.cursor]: "wait",
|
752
1137
|
},
|
753
1138
|
|
754
1139
|
variant: {
|
755
1140
|
contained: {
|
756
|
-
[vars$
|
757
|
-
[vars$
|
1141
|
+
[vars$6.color]: helperRefs$1.contrast,
|
1142
|
+
[vars$6.backgroundColor]: helperRefs$1.main,
|
758
1143
|
_hover: {
|
759
|
-
[vars$
|
1144
|
+
[vars$6.backgroundColor]: helperRefs$1.dark,
|
1145
|
+
},
|
1146
|
+
_loading: {
|
1147
|
+
[vars$6.backgroundColor]: helperRefs$1.main,
|
760
1148
|
},
|
761
1149
|
},
|
762
1150
|
outline: {
|
763
|
-
[vars$
|
764
|
-
[vars$
|
765
|
-
[vars$2.borderWidth]: '2px',
|
766
|
-
[vars$2.borderStyle]: 'solid',
|
1151
|
+
[vars$6.color]: helperRefs$1.main,
|
1152
|
+
[vars$6.borderColor]: helperRefs$1.main,
|
767
1153
|
_hover: {
|
768
|
-
[vars$
|
769
|
-
[vars$
|
1154
|
+
[vars$6.color]: helperRefs$1.dark,
|
1155
|
+
[vars$6.borderColor]: helperRefs$1.dark,
|
770
1156
|
_error: {
|
771
|
-
[vars$
|
772
|
-
}
|
773
|
-
}
|
1157
|
+
[vars$6.color]: helperRefs$1.error,
|
1158
|
+
},
|
1159
|
+
},
|
774
1160
|
},
|
775
1161
|
link: {
|
776
|
-
[vars$
|
1162
|
+
[vars$6.color]: helperRefs$1.main,
|
1163
|
+
[vars$6.padding]: 0,
|
1164
|
+
[vars$6.margin]: 0,
|
1165
|
+
[vars$6.lineHeight]: helperRefs$1.height,
|
1166
|
+
[vars$6.borderRadius]: 0,
|
1167
|
+
_hover: {
|
1168
|
+
[vars$6.color]: helperRefs$1.main,
|
1169
|
+
[vars$6.textDecoration]: "underline",
|
1170
|
+
},
|
777
1171
|
},
|
1172
|
+
},
|
1173
|
+
};
|
1174
|
+
|
1175
|
+
const globalRefs$2 = getThemeRefs(globals);
|
1176
|
+
|
1177
|
+
const vars$5 = TextField.cssVarList;
|
1178
|
+
|
1179
|
+
const textField = (vars) => ({
|
1180
|
+
size: {
|
1181
|
+
xs: {
|
1182
|
+
[vars.height]: '14px',
|
1183
|
+
[vars.fontSize]: '8px',
|
1184
|
+
[vars.padding]: `0 ${globalRefs$2.spacing.xs}`
|
1185
|
+
},
|
1186
|
+
sm: {
|
1187
|
+
[vars.height]: '20px',
|
1188
|
+
[vars.fontSize]: '10px',
|
1189
|
+
[vars.padding]: `0 ${globalRefs$2.spacing.sm}`
|
1190
|
+
},
|
1191
|
+
md: {
|
1192
|
+
[vars.height]: '30px',
|
1193
|
+
[vars.fontSize]: '14px',
|
1194
|
+
[vars.padding]: `0 ${globalRefs$2.spacing.md}`
|
1195
|
+
},
|
1196
|
+
lg: {
|
1197
|
+
[vars.height]: '40px',
|
1198
|
+
[vars.fontSize]: '16px',
|
1199
|
+
[vars.padding]: `0 ${globalRefs$2.spacing.lg}`
|
1200
|
+
},
|
1201
|
+
xl: {
|
1202
|
+
[vars.height]: '50px',
|
1203
|
+
[vars.fontSize]: '25px',
|
1204
|
+
[vars.padding]: `0 ${globalRefs$2.spacing.xl}`
|
1205
|
+
}
|
1206
|
+
},
|
1207
|
+
|
1208
|
+
[vars.color]: globalRefs$2.colors.surface.contrast,
|
1209
|
+
[vars.placeholderColor]: globalRefs$2.colors.surface.contrast,
|
1210
|
+
|
1211
|
+
[vars.backgroundColor]: globalRefs$2.colors.surface.light,
|
1212
|
+
|
1213
|
+
[vars.borderWidth]: '1px',
|
1214
|
+
[vars.borderStyle]: 'solid',
|
1215
|
+
[vars.borderColor]: 'transparent',
|
1216
|
+
[vars.borderWidthReadOnly]: '0',
|
1217
|
+
[vars.borderRadius]: globalRefs$2.radius.sm,
|
1218
|
+
|
1219
|
+
_borderoffset: {
|
1220
|
+
[vars.outlineOffset]: '2px'
|
1221
|
+
},
|
1222
|
+
|
1223
|
+
_invalid: {
|
1224
|
+
[vars.borderColor]: globalRefs$2.colors.error.main,
|
1225
|
+
[vars.color]: globalRefs$2.colors.error.main
|
1226
|
+
},
|
1227
|
+
|
1228
|
+
_disabled: {
|
1229
|
+
[vars.color]: globalRefs$2.colors.surface.dark,
|
1230
|
+
[vars.placeholderColor]: globalRefs$2.colors.surface.light,
|
1231
|
+
[vars.backgroundColor]: globalRefs$2.colors.surface.main
|
1232
|
+
},
|
1233
|
+
|
1234
|
+
_fullwidth: {
|
1235
|
+
[vars.width]: '100%'
|
1236
|
+
},
|
1237
|
+
|
1238
|
+
_focused: {
|
1239
|
+
[vars.outline]: `2px solid ${globalRefs$2.colors.surface.main}`
|
1240
|
+
},
|
1241
|
+
|
1242
|
+
_bordered: {
|
1243
|
+
[vars.borderColor]: globalRefs$2.colors.surface.main
|
778
1244
|
}
|
1245
|
+
});
|
1246
|
+
|
1247
|
+
var textField$1 = textField(vars$5);
|
1248
|
+
|
1249
|
+
const vars$4 = PasswordField.cssVarList;
|
1250
|
+
|
1251
|
+
const passwordField = {
|
1252
|
+
...textField(vars$4),
|
1253
|
+
[vars$4.revealCursor]: 'pointer'
|
1254
|
+
};
|
1255
|
+
|
1256
|
+
const numberField = {
|
1257
|
+
...textField(NumberField.cssVarList)
|
1258
|
+
};
|
1259
|
+
|
1260
|
+
const emailField = {
|
1261
|
+
...textField(EmailField.cssVarList)
|
779
1262
|
};
|
780
1263
|
|
781
1264
|
const globalRefs$1 = getThemeRefs(globals);
|
1265
|
+
const vars$3 = TextArea.cssVarList;
|
782
1266
|
|
783
|
-
const
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
1267
|
+
const textArea = {
|
1268
|
+
[vars$3.color]: globalRefs$1.colors.primary.main,
|
1269
|
+
[vars$3.backgroundColor]: globalRefs$1.colors.surface.light,
|
1270
|
+
[vars$3.resize]: 'vertical',
|
1271
|
+
|
1272
|
+
[vars$3.borderRadius]: globalRefs$1.radius.sm,
|
1273
|
+
[vars$3.borderWidth]: '1px',
|
1274
|
+
[vars$3.borderStyle]: 'solid',
|
1275
|
+
[vars$3.borderColor]: 'transparent',
|
1276
|
+
|
1277
|
+
_borderoffset: {
|
1278
|
+
[vars$3.outlineOffset]: '2px'
|
1279
|
+
},
|
1280
|
+
|
1281
|
+
_bordered: {
|
1282
|
+
[vars$3.inputBorderColor]: globalRefs$1.colors.surface.main
|
1283
|
+
},
|
1284
|
+
|
1285
|
+
_focused: {
|
1286
|
+
[vars$3.focusInputCursor]: 'text',
|
1287
|
+
[vars$3.outline]: `2px solid ${globalRefs$1.colors.surface.main}`
|
1288
|
+
},
|
1289
|
+
|
1290
|
+
_fullwidth: {
|
1291
|
+
[vars$3.width]: '100%'
|
1292
|
+
},
|
1293
|
+
|
1294
|
+
_disabled: {
|
1295
|
+
[vars$3.cursor]: 'not-allowed'
|
1296
|
+
},
|
1297
|
+
|
1298
|
+
_invalid: {
|
1299
|
+
[vars$3.outline]: `2px solid ${globalRefs$1.colors.error.main}`
|
1300
|
+
}
|
1301
|
+
};
|
1302
|
+
|
1303
|
+
const componentName$1 = getComponentName('checkbox');
|
1304
|
+
|
1305
|
+
const Checkbox = compose(
|
1306
|
+
createStyleMixin({
|
1307
|
+
mappings: {
|
1308
|
+
width: {},
|
1309
|
+
cursor: [{}, { selector: '> label' }]
|
1310
|
+
}
|
1311
|
+
}),
|
1312
|
+
draggableMixin,
|
1313
|
+
inputMixin,
|
1314
|
+
componentNameValidationMixin
|
1315
|
+
)(
|
1316
|
+
createProxy({
|
1317
|
+
slots: [],
|
1318
|
+
wrappedEleName: 'vaadin-checkbox',
|
1319
|
+
style: ``,
|
1320
|
+
excludeAttrsSync: ['tabindex'],
|
1321
|
+
componentName: componentName$1
|
1322
|
+
})
|
1323
|
+
);
|
1324
|
+
|
1325
|
+
const vars$2 = Checkbox.cssVarList;
|
1326
|
+
|
1327
|
+
const checkbox = {
|
1328
|
+
[vars$2.cursor]: 'pointer'
|
1329
|
+
};
|
821
1330
|
|
822
|
-
|
823
|
-
|
824
|
-
|
1331
|
+
const componentName = getComponentName('switch-toggle');
|
1332
|
+
|
1333
|
+
let overrides = ``;
|
1334
|
+
|
1335
|
+
const SwitchToggle = compose(
|
1336
|
+
createStyleMixin({
|
1337
|
+
mappings: {
|
1338
|
+
width: {},
|
1339
|
+
cursor: [{}, { selector: '> label' }]
|
1340
|
+
}
|
1341
|
+
}),
|
1342
|
+
draggableMixin,
|
1343
|
+
inputMixin,
|
1344
|
+
componentNameValidationMixin
|
1345
|
+
)(
|
1346
|
+
createProxy({
|
1347
|
+
slots: [],
|
1348
|
+
wrappedEleName: 'vaadin-checkbox',
|
1349
|
+
style: () => overrides,
|
1350
|
+
excludeAttrsSync: ['tabindex'],
|
1351
|
+
componentName
|
1352
|
+
})
|
1353
|
+
);
|
1354
|
+
|
1355
|
+
overrides = `
|
1356
|
+
:host {
|
1357
|
+
--margin: 7px;
|
1358
|
+
--width: var(${SwitchToggle.cssVarList.width});
|
1359
|
+
--height: calc(var(--width) / 2);
|
1360
|
+
--radius: var(--height);
|
1361
|
+
--knobSize: calc(var(--height) - 5px);
|
1362
|
+
--bgColor: #fff;
|
1363
|
+
--knobBgColor: #000;
|
1364
|
+
}
|
1365
|
+
vaadin-checkbox>label {
|
1366
|
+
cursor: pointer;
|
1367
|
+
border: 1px solid;
|
1368
|
+
text-indent: -99999px;
|
1369
|
+
display: block;
|
1370
|
+
position: relative;
|
1371
|
+
width: var(--width);
|
1372
|
+
height: var(--height);
|
1373
|
+
background: var(--bgColor);
|
1374
|
+
border-radius: var(--radius);
|
1375
|
+
}
|
1376
|
+
vaadin-checkbox>label::after {
|
1377
|
+
content: '';
|
1378
|
+
position: absolute;
|
1379
|
+
transition: 0.3s;
|
1380
|
+
top: var(--margin);
|
1381
|
+
left: var(--margin);
|
1382
|
+
width: var(--knobSize);
|
1383
|
+
height: var(--knobSize);
|
1384
|
+
background: var(--knobBgColor);
|
1385
|
+
border-radius: var(--knobSize);
|
1386
|
+
}
|
1387
|
+
vaadin-checkbox::part(checkbox) {
|
1388
|
+
height: 0;
|
1389
|
+
width: 0;
|
1390
|
+
visibility: hidden;
|
1391
|
+
}
|
1392
|
+
vaadin-checkbox[checked]>label::after {
|
1393
|
+
transform: translateX(-100%);
|
1394
|
+
left: calc(100% - var(--margin));
|
1395
|
+
}
|
1396
|
+
vaadin-checkbox[active]>label::after {
|
1397
|
+
width: calc(var(--knobSize) + 15px);
|
1398
|
+
}
|
1399
|
+
`;
|
1400
|
+
|
1401
|
+
const vars$1 = SwitchToggle.cssVarList;
|
1402
|
+
|
1403
|
+
const swtichToggle = {
|
1404
|
+
[vars$1.width]: '70px',
|
1405
|
+
[vars$1.cursor]: [{}, { selector: '> label' }]
|
825
1406
|
};
|
826
1407
|
|
827
1408
|
const globalRefs = getThemeRefs(globals);
|
@@ -831,30 +1412,33 @@ const vars = Container.cssVarList;
|
|
831
1412
|
const verticalAlignment = {
|
832
1413
|
start: { verticalAlignment: 'start' },
|
833
1414
|
center: { verticalAlignment: 'center' },
|
834
|
-
end: { verticalAlignment: 'end' }
|
1415
|
+
end: { verticalAlignment: 'end' }
|
835
1416
|
};
|
836
1417
|
|
837
1418
|
const horizontalAlignment = {
|
838
1419
|
start: { horizontalAlignment: 'start' },
|
839
1420
|
center: { horizontalAlignment: 'center' },
|
840
|
-
end: { horizontalAlignment: 'end' }
|
1421
|
+
end: { horizontalAlignment: 'end' }
|
841
1422
|
};
|
842
1423
|
|
843
|
-
const [helperTheme,
|
844
|
-
|
1424
|
+
const [helperTheme, helperRefs, helperVars] = createHelperVars(
|
1425
|
+
{ verticalAlignment, horizontalAlignment },
|
1426
|
+
'container'
|
1427
|
+
);
|
845
1428
|
|
846
1429
|
const container = {
|
847
1430
|
...helperTheme,
|
848
1431
|
[vars.display]: 'flex',
|
1432
|
+
[vars.backgroundColor]: globalRefs.colors.surface.main,
|
849
1433
|
verticalPadding: {
|
850
1434
|
sm: { [vars.verticalPadding]: '5px' },
|
851
1435
|
md: { [vars.verticalPadding]: '10px' },
|
852
|
-
lg: { [vars.verticalPadding]: '20px' }
|
1436
|
+
lg: { [vars.verticalPadding]: '20px' }
|
853
1437
|
},
|
854
1438
|
horizontalPadding: {
|
855
1439
|
sm: { [vars.horizontalPadding]: '5px' },
|
856
1440
|
md: { [vars.horizontalPadding]: '10px' },
|
857
|
-
lg: { [vars.horizontalPadding]: '20px' }
|
1441
|
+
lg: { [vars.horizontalPadding]: '20px' }
|
858
1442
|
},
|
859
1443
|
direction: {
|
860
1444
|
row: {
|
@@ -862,7 +1446,7 @@ const container = {
|
|
862
1446
|
[vars.alignItems]: helperRefs.verticalAlignment,
|
863
1447
|
[vars.justifyContent]: helperRefs.horizontalAlignment,
|
864
1448
|
horizontalAlignment: {
|
865
|
-
spaceBetween: { [helperVars.horizontalAlignment]: 'space-between' }
|
1449
|
+
spaceBetween: { [helperVars.horizontalAlignment]: 'space-between' }
|
866
1450
|
}
|
867
1451
|
},
|
868
1452
|
|
@@ -871,9 +1455,11 @@ const container = {
|
|
871
1455
|
[vars.alignItems]: helperRefs.horizontalAlignment,
|
872
1456
|
[vars.justifyContent]: helperRefs.verticalAlignment,
|
873
1457
|
verticalAlignment: {
|
874
|
-
spaceBetween: {
|
1458
|
+
spaceBetween: {
|
1459
|
+
[helperVars.verticalAlignment]: 'space-between'
|
1460
|
+
}
|
875
1461
|
}
|
876
|
-
}
|
1462
|
+
}
|
877
1463
|
},
|
878
1464
|
|
879
1465
|
spaceBetween: {
|
@@ -889,34 +1475,40 @@ const container = {
|
|
889
1475
|
},
|
890
1476
|
|
891
1477
|
shadow: {
|
892
|
-
sm: {
|
893
|
-
[vars.boxShadow]: `${globalRefs.shadow.size.sm} ${globalRefs.shadow.color}`
|
894
|
-
},
|
895
|
-
md: {
|
896
|
-
[vars.boxShadow]: `${globalRefs.shadow.size.md} ${globalRefs.shadow.color}`
|
897
|
-
},
|
898
|
-
lg: {
|
899
|
-
[vars.boxShadow]: `${globalRefs.shadow.size.lg} ${globalRefs.shadow.color}`
|
1478
|
+
sm: {
|
1479
|
+
[vars.boxShadow]: `${globalRefs.shadow.size.sm} ${globalRefs.shadow.color}`
|
1480
|
+
},
|
1481
|
+
md: {
|
1482
|
+
[vars.boxShadow]: `${globalRefs.shadow.size.md} ${globalRefs.shadow.color}`
|
900
1483
|
},
|
1484
|
+
lg: {
|
1485
|
+
[vars.boxShadow]: `${globalRefs.shadow.size.lg} ${globalRefs.shadow.color}`
|
1486
|
+
}
|
901
1487
|
},
|
902
1488
|
|
903
1489
|
borderRadius: {
|
904
|
-
sm: {
|
1490
|
+
sm: {
|
905
1491
|
[vars.borderRadius]: globalRefs.radius.sm
|
906
1492
|
},
|
907
|
-
md: {
|
1493
|
+
md: {
|
908
1494
|
[vars.borderRadius]: globalRefs.radius.md
|
909
1495
|
},
|
910
|
-
lg: {
|
1496
|
+
lg: {
|
911
1497
|
[vars.borderRadius]: globalRefs.radius.lg
|
912
|
-
}
|
1498
|
+
}
|
913
1499
|
}
|
914
1500
|
};
|
915
1501
|
|
916
1502
|
var components = {
|
917
|
-
|
918
|
-
|
919
|
-
|
1503
|
+
button,
|
1504
|
+
textField: textField$1,
|
1505
|
+
passwordField,
|
1506
|
+
numberField,
|
1507
|
+
emailField,
|
1508
|
+
textArea,
|
1509
|
+
checkbox,
|
1510
|
+
switchToggle: swtichToggle,
|
1511
|
+
container
|
920
1512
|
};
|
921
1513
|
|
922
1514
|
var index = { globals, components };
|