mdui 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.js +7 -2
- package/components/avatar/style.js +31 -1
- package/components/badge/style.js +25 -1
- package/components/bottom-app-bar/style.js +92 -1
- package/components/button/button-base-style.js +28 -1
- package/components/button/button-base.js +8 -1
- package/components/button/index.js +18 -8
- package/components/button/style.js +111 -2
- package/components/button-icon/index.js +22 -5
- package/components/button-icon/style.js +103 -2
- package/components/card/index.js +5 -1
- package/components/card/style.js +72 -1
- package/components/checkbox/index.js +50 -7
- package/components/checkbox/style.js +131 -1
- package/components/chip/index.js +33 -9
- package/components/chip/style.js +205 -2
- package/components/circular-progress/index.js +39 -5
- package/components/circular-progress/style.js +136 -1
- package/components/collapse/collapse-item-style.js +21 -1
- package/components/collapse/collapse-item.js +10 -2
- package/components/collapse/collapse-style.js +5 -1
- package/components/collapse/collapse.js +4 -1
- package/components/dialog/index.js +35 -7
- package/components/dialog/style.js +116 -1
- package/components/divider/style.js +18 -1
- package/components/dropdown/index.js +8 -1
- package/components/dropdown/style.js +11 -1
- package/components/fab/index.js +13 -5
- package/components/fab/style.js +153 -4
- package/components/icon/index.js +5 -1
- package/components/icon/style.js +29 -1
- package/components/layout/layout-item-style.js +6 -1
- package/components/layout/layout-main-style.js +7 -1
- package/components/layout/layout-style.js +11 -1
- package/components/linear-progress/index.js +6 -2
- package/components/linear-progress/style.js +73 -1
- package/components/list/list-item-style.js +153 -2
- package/components/list/list-item.js +27 -8
- package/components/list/list-style.js +10 -1
- package/components/list/list-subheader-style.js +19 -1
- package/components/menu/menu-item-style.js +125 -1
- package/components/menu/menu-item.js +55 -13
- package/components/menu/menu-style.js +19 -1
- package/components/menu/menu.js +5 -1
- package/components/navigation-bar/navigation-bar-item-style.js +132 -1
- package/components/navigation-bar/navigation-bar-item.js +23 -7
- package/components/navigation-bar/navigation-bar-style.js +28 -1
- package/components/navigation-bar/navigation-bar.js +4 -1
- package/components/navigation-drawer/index.js +12 -1
- package/components/navigation-drawer/style.js +66 -1
- package/components/navigation-rail/navigation-rail-item-style.js +122 -1
- package/components/navigation-rail/navigation-rail-item.js +26 -7
- package/components/navigation-rail/navigation-rail-style.js +79 -1
- package/components/navigation-rail/navigation-rail.js +10 -1
- package/components/radio/radio-group-style.js +20 -1
- package/components/radio/radio-group.js +19 -1
- package/components/radio/radio-style.js +107 -1
- package/components/radio/radio.js +23 -5
- package/components/range-slider/index.d.ts +1 -1
- package/components/range-slider/index.js +53 -5
- package/components/ripple/index.js +5 -2
- package/components/ripple/style.js +96 -1
- package/components/segmented-button/segmented-button-group-style.js +28 -1
- package/components/segmented-button/segmented-button-group.js +21 -1
- package/components/segmented-button/segmented-button-style.js +81 -2
- package/components/segmented-button/segmented-button.js +27 -11
- package/components/select/index.js +87 -6
- package/components/select/style.js +27 -1
- package/components/slider/index.js +33 -2
- package/components/slider/slider-base-style.js +173 -1
- package/components/slider/slider-base.js +6 -1
- package/components/slider/style.js +7 -1
- package/components/snackbar/index.js +32 -5
- package/components/snackbar/style.js +100 -1
- package/components/switch/index.js +40 -6
- package/components/switch/style.js +202 -1
- package/components/tabs/tab-panel-style.js +10 -1
- package/components/tabs/tab-style.js +85 -1
- package/components/tabs/tab.js +24 -4
- package/components/tabs/tabs-style.js +138 -1
- package/components/tabs/tabs.js +9 -1
- package/components/text-field/index.js +160 -32
- package/components/text-field/style.js +362 -1
- package/components/tooltip/index.js +10 -1
- package/components/tooltip/style.js +57 -1
- package/components/top-app-bar/top-app-bar-style.js +78 -1
- package/components/top-app-bar/top-app-bar-title-style.js +81 -1
- package/components/top-app-bar/top-app-bar-title.js +17 -3
- package/custom-elements.json +1144 -1101
- package/html-data.en.json +15 -6
- package/html-data.zh-cn.json +15 -6
- package/jsx.en.d.ts +2 -2
- package/jsx.zh-cn.d.ts +2 -2
- package/package.json +2 -2
- package/web-types.en.json +20 -4
- package/web-types.zh-cn.json +20 -4
- package/mdui.esm.js +0 -22
- package/mdui.global.js +0 -22
|
@@ -384,9 +384,25 @@ let TextField = class TextField extends FocusableMixin(MduiElement) {
|
|
|
384
384
|
'is-firefox': navigator.userAgent.includes('Firefox'),
|
|
385
385
|
...invalidClassNameObj,
|
|
386
386
|
});
|
|
387
|
-
return html `<div part="container" class
|
|
387
|
+
return html `<div part="container" class=${className}>
|
|
388
|
+
${this.renderPrefix()}
|
|
389
|
+
<div class="input-container">
|
|
390
|
+
${this.renderLabel()}
|
|
391
|
+
${this.isTextarea
|
|
388
392
|
? this.renderTextArea(hasInputSlot)
|
|
389
|
-
: this.renderInput(hasInputSlot)}
|
|
393
|
+
: this.renderInput(hasInputSlot)}
|
|
394
|
+
${when(hasInputSlot, () => html `<slot name="input" class="input"></slot>`)}
|
|
395
|
+
</div>
|
|
396
|
+
${this.renderClearButton()}${this.renderTogglePasswordButton()}
|
|
397
|
+
${this.renderSuffix(hasErrorIcon)}
|
|
398
|
+
</div>
|
|
399
|
+
${when(hasError || hasHelper || hasCounter, () => html `<div
|
|
400
|
+
part="supporting"
|
|
401
|
+
class=${classMap({ supporting: true, ...invalidClassNameObj })}
|
|
402
|
+
>
|
|
403
|
+
${this.renderHelper(hasError, hasHelper)}
|
|
404
|
+
${this.renderCounter(hasCounter)}
|
|
405
|
+
</div>`)}`;
|
|
390
406
|
}
|
|
391
407
|
onChange() {
|
|
392
408
|
this.value = this.inputRef.value.value;
|
|
@@ -448,62 +464,168 @@ let TextField = class TextField extends FocusableMixin(MduiElement) {
|
|
|
448
464
|
}
|
|
449
465
|
renderLabel() {
|
|
450
466
|
return this.label
|
|
451
|
-
? html `<label
|
|
467
|
+
? html `<label
|
|
468
|
+
part="label"
|
|
469
|
+
class="label"
|
|
470
|
+
${animate({
|
|
452
471
|
keyframeOptions: {
|
|
453
472
|
duration: getDuration(this, 'short4'),
|
|
454
473
|
easing: getEasing(this, 'standard'),
|
|
455
474
|
},
|
|
456
|
-
})}
|
|
475
|
+
})}
|
|
476
|
+
>
|
|
477
|
+
${this.label}
|
|
478
|
+
</label>`
|
|
457
479
|
: nothingTemplate;
|
|
458
480
|
}
|
|
459
481
|
renderPrefix() {
|
|
460
|
-
return html `<slot name="icon" part="icon" class="icon"
|
|
461
|
-
|
|
462
|
-
|
|
482
|
+
return html `<slot name="icon" part="icon" class="icon">
|
|
483
|
+
${this.icon
|
|
484
|
+
? html `<mdui-icon name=${this.icon} class="i"></mdui-icon>`
|
|
485
|
+
: nothingTemplate}
|
|
486
|
+
</slot>
|
|
487
|
+
<slot name="prefix" part="prefix" class="prefix">${this.prefix}</slot>`;
|
|
463
488
|
}
|
|
464
489
|
renderSuffix(hasErrorIcon) {
|
|
465
|
-
return html `<slot name="suffix" part="suffix" class="suffix"
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
490
|
+
return html `<slot name="suffix" part="suffix" class="suffix">
|
|
491
|
+
${this.suffix}
|
|
492
|
+
</slot>
|
|
493
|
+
${hasErrorIcon
|
|
494
|
+
? html `<slot name="error-icon" part="error-icon" class="right-icon">
|
|
495
|
+
${this.errorIcon
|
|
496
|
+
? html `<mdui-icon name=${this.errorIcon} class="i"></mdui-icon>`
|
|
497
|
+
: html `<mdui-icon-error class="i"></mdui-icon-error>`}
|
|
498
|
+
</slot>`
|
|
499
|
+
: html `<slot
|
|
500
|
+
name="end-icon"
|
|
501
|
+
part="end-icon"
|
|
502
|
+
class="end-icon right-icon"
|
|
503
|
+
>
|
|
504
|
+
${this.endIcon
|
|
505
|
+
? html `<mdui-icon name=${this.endIcon} class="i"></mdui-icon>`
|
|
506
|
+
: nothingTemplate}
|
|
507
|
+
</slot>`}`;
|
|
472
508
|
}
|
|
473
509
|
renderClearButton() {
|
|
474
510
|
const hasClearButton = this.clearable &&
|
|
475
511
|
!this.disabled &&
|
|
476
512
|
(!this.readonly || this.readonlyButClearable) &&
|
|
477
513
|
(typeof this.value === 'number' || this.value.length > 0);
|
|
478
|
-
return when(hasClearButton, () => html `<slot
|
|
479
|
-
|
|
480
|
-
|
|
514
|
+
return when(hasClearButton, () => html `<slot
|
|
515
|
+
name="clear-button"
|
|
516
|
+
part="clear-button"
|
|
517
|
+
class="right-icon"
|
|
518
|
+
@click=${this.onClear}
|
|
519
|
+
>
|
|
520
|
+
<mdui-button-icon tabindex="-1">
|
|
521
|
+
<slot name="clear-icon" part="clear-icon">
|
|
522
|
+
${this.clearIcon
|
|
523
|
+
? html `<mdui-icon name=${this.clearIcon} class="i"></mdui-icon>`
|
|
524
|
+
: html `<mdui-icon-cancel--outlined
|
|
525
|
+
class="i"
|
|
526
|
+
></mdui-icon-cancel--outlined>`}
|
|
527
|
+
</slot>
|
|
528
|
+
</mdui-button-icon>
|
|
529
|
+
</slot>`);
|
|
481
530
|
}
|
|
482
531
|
renderTogglePasswordButton() {
|
|
483
532
|
const hasTogglePasswordButton = this.type === 'password' && this.togglePassword && !this.disabled;
|
|
484
|
-
return when(hasTogglePasswordButton, () => html `<slot
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
533
|
+
return when(hasTogglePasswordButton, () => html `<slot
|
|
534
|
+
name="toggle-password-button"
|
|
535
|
+
part="toggle-password-button"
|
|
536
|
+
class="right-icon"
|
|
537
|
+
@click=${this.onTogglePassword}
|
|
538
|
+
>
|
|
539
|
+
<mdui-button-icon tabindex="-1">
|
|
540
|
+
${this.isPasswordVisible
|
|
541
|
+
? html `<slot name="show-password-icon" part="show-password-icon">
|
|
542
|
+
${this.showPasswordIcon
|
|
543
|
+
? html `<mdui-icon
|
|
544
|
+
name=${this.showPasswordIcon}
|
|
545
|
+
class="i"
|
|
546
|
+
></mdui-icon>`
|
|
547
|
+
: html `<mdui-icon-visibility-off
|
|
548
|
+
class="i"
|
|
549
|
+
></mdui-icon-visibility-off>`}
|
|
550
|
+
</slot>`
|
|
551
|
+
: html `<slot name="hide-password-icon" part="hide-password-icon">
|
|
552
|
+
${this.hidePasswordIcon
|
|
553
|
+
? html `<mdui-icon
|
|
554
|
+
name=${this.hidePasswordIcon}
|
|
555
|
+
class="i"
|
|
556
|
+
></mdui-icon>`
|
|
557
|
+
: html `<mdui-icon-visibility
|
|
558
|
+
class="i"
|
|
559
|
+
></mdui-icon-visibility>`}
|
|
560
|
+
</slot>`}
|
|
561
|
+
</mdui-button-icon>
|
|
562
|
+
</slot>`);
|
|
491
563
|
}
|
|
492
564
|
renderInput(hasInputSlot) {
|
|
493
|
-
return html `<input
|
|
565
|
+
return html `<input
|
|
566
|
+
${ref(this.inputRef)}
|
|
567
|
+
part="input"
|
|
568
|
+
class="input ${classMap({ 'hide-input': hasInputSlot })}"
|
|
569
|
+
type=${this.type === 'password' && this.isPasswordVisible
|
|
494
570
|
? 'text'
|
|
495
|
-
: this.type}
|
|
571
|
+
: this.type}
|
|
572
|
+
name=${ifDefined(this.name)}
|
|
573
|
+
.value=${live(this.value)}
|
|
574
|
+
placeholder=${ifDefined(
|
|
496
575
|
// @ts-ignore
|
|
497
576
|
!this.label || this.isFocusedStyle || this.hasValue
|
|
498
577
|
? this.placeholder
|
|
499
|
-
: undefined)}
|
|
578
|
+
: undefined)}
|
|
579
|
+
?readonly=${this.readonly}
|
|
580
|
+
?disabled=${this.disabled}
|
|
581
|
+
?required=${this.required}
|
|
582
|
+
minlength=${ifDefined(this.minlength)}
|
|
583
|
+
maxlength=${ifDefined(this.maxlength)}
|
|
584
|
+
min=${ifDefined(this.min)}
|
|
585
|
+
max=${ifDefined(this.max)}
|
|
586
|
+
step=${ifDefined(this.step)}
|
|
587
|
+
autocapitalize=${ifDefined(this.type === 'password' ? 'off' : this.autocapitalize)}
|
|
588
|
+
autocomplete=${ifDefined(this.type === 'password' ? 'off' : this.autocomplete)}
|
|
589
|
+
autocorrect=${ifDefined(this.type === 'password' ? 'off' : this.autocorrect)}
|
|
590
|
+
spellcheck=${ifDefined(this.spellcheck)}
|
|
591
|
+
pattern=${ifDefined(this.pattern)}
|
|
592
|
+
enterkeyhint=${ifDefined(this.enterkeyhint)}
|
|
593
|
+
inputmode=${ifDefined(this.inputmode)}
|
|
594
|
+
@change=${this.onChange}
|
|
595
|
+
@input=${this.onInput}
|
|
596
|
+
@invalid=${this.onInvalid}
|
|
597
|
+
@keydown=${this.onKeyDown}
|
|
598
|
+
/>`;
|
|
500
599
|
}
|
|
501
600
|
renderTextArea(hasInputSlot) {
|
|
502
|
-
return html `<textarea
|
|
601
|
+
return html `<textarea
|
|
602
|
+
${ref(this.inputRef)}
|
|
603
|
+
part="input"
|
|
604
|
+
class="input ${classMap({ 'hide-input': hasInputSlot })}"
|
|
605
|
+
name=${ifDefined(this.name)}
|
|
606
|
+
.value=${live(this.value)}
|
|
607
|
+
placeholder=${ifDefined(
|
|
503
608
|
// @ts-ignore
|
|
504
609
|
!this.label || this.isFocusedStyle || this.hasValue
|
|
505
610
|
? this.placeholder
|
|
506
|
-
: undefined)}
|
|
611
|
+
: undefined)}
|
|
612
|
+
?readonly=${this.readonly}
|
|
613
|
+
?disabled=${this.disabled}
|
|
614
|
+
?required=${this.required}
|
|
615
|
+
minlength=${ifDefined(this.minlength)}
|
|
616
|
+
maxlength=${ifDefined(this.maxlength)}
|
|
617
|
+
rows=${this.rows ?? 1}
|
|
618
|
+
autocapitalize=${ifDefined(this.autocapitalize)}
|
|
619
|
+
autocorrect=${ifDefined(this.autocorrect)}
|
|
620
|
+
spellcheck=${ifDefined(this.spellcheck)}
|
|
621
|
+
enterkeyhint=${ifDefined(this.enterkeyhint)}
|
|
622
|
+
inputmode=${ifDefined(this.inputmode)}
|
|
623
|
+
@change=${this.onChange}
|
|
624
|
+
@input=${this.onInput}
|
|
625
|
+
@invalid=${this.onInvalid}
|
|
626
|
+
@keydown=${this.onKeyDown}
|
|
627
|
+
@keyup=${this.onTextAreaKeyUp}
|
|
628
|
+
></textarea>`;
|
|
507
629
|
}
|
|
508
630
|
/**
|
|
509
631
|
* @param hasError 是否包含错误提示
|
|
@@ -511,15 +633,21 @@ let TextField = class TextField extends FocusableMixin(MduiElement) {
|
|
|
511
633
|
*/
|
|
512
634
|
renderHelper(hasError, hasHelper) {
|
|
513
635
|
return hasError
|
|
514
|
-
? html `<div part="error" class="error"
|
|
636
|
+
? html `<div part="error" class="error">
|
|
637
|
+
${this.error || this.inputRef.value.validationMessage}
|
|
638
|
+
</div>`
|
|
515
639
|
: hasHelper
|
|
516
|
-
? html `<slot name="helper" part="helper" class="helper"
|
|
640
|
+
? html `<slot name="helper" part="helper" class="helper">
|
|
641
|
+
${this.helper}
|
|
642
|
+
</slot>`
|
|
517
643
|
: // 右边有 counter,需要占位
|
|
518
644
|
html `<span></span>`;
|
|
519
645
|
}
|
|
520
646
|
renderCounter(hasCounter) {
|
|
521
647
|
return hasCounter
|
|
522
|
-
? html `<div part="counter" class="counter"
|
|
648
|
+
? html `<div part="counter" class="counter">
|
|
649
|
+
${this.value.length}/${this.maxlength}
|
|
650
|
+
</div>`
|
|
523
651
|
: nothingTemplate;
|
|
524
652
|
}
|
|
525
653
|
};
|
|
@@ -1,2 +1,363 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{display:inline-block;width:100%}:host([disabled]){pointer-events:none}:host([type=hidden]){display:none}.container{position:relative;display:flex;align-items:center;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard);padding:0 1rem}.container.has-icon{padding-left:.75rem}.container.has-end-icon,.container.has-error-icon{padding-right:.75rem}:host([variant=filled]) .container{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-on-surface-variant));background-color:rgb(var(--mdui-color-surface-container-highest));border-radius:var(--mdui-shape-corner-extra-small) var(--mdui-shape-corner-extra-small) 0 0}:host([variant=filled]) .container.invalid,:host([variant=filled]) .container.invalid-style{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-error))}:host([variant=filled]:hover) .container{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-on-surface))}:host([variant=filled]:hover) .container.invalid,:host([variant=filled]:hover) .container.invalid-style{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-on-error-container))}:host([variant=filled][focused-style]) .container,:host([variant=filled][focused]) .container{box-shadow:inset 0 -.125rem 0 0 rgb(var(--mdui-color-primary))}:host([variant=filled][focused-style]) .container.invalid,:host([variant=filled][focused-style]) .container.invalid-style,:host([variant=filled][focused]) .container.invalid,:host([variant=filled][focused]) .container.invalid-style{box-shadow:inset 0 -.125rem 0 0 rgb(var(--mdui-color-error))}:host([variant=filled][disabled]) .container{box-shadow:inset 0 -.0625rem 0 0 rgba(var(--mdui-color-on-surface),38%);background-color:rgba(var(--mdui-color-on-surface),4%)}:host([variant=outlined]) .container{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-outline));border-radius:var(--mdui-shape-corner-extra-small)}:host([variant=outlined]) .container.invalid,:host([variant=outlined]) .container.invalid-style{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-error))}:host([variant=outlined]:hover) .container{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-on-surface))}:host([variant=outlined]:hover) .container.invalid,:host([variant=outlined]:hover) .container.invalid-style{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-on-error-container))}:host([variant=outlined][focused-style]) .container,:host([variant=outlined][focused]) .container{box-shadow:inset 0 0 0 .125rem rgb(var(--mdui-color-primary))}:host([variant=outlined][focused-style]) .container.invalid,:host([variant=outlined][focused-style]) .container.invalid-style,:host([variant=outlined][focused]) .container.invalid,:host([variant=outlined][focused]) .container.invalid-style{box-shadow:inset 0 0 0 .125rem rgb(var(--mdui-color-error))}:host([variant=outlined][disabled]) .container{box-shadow:inset 0 0 0 .125rem rgba(var(--mdui-color-on-surface),12%)}.icon,.prefix,.right-icon,.suffix{display:flex;-webkit-user-select:none;user-select:none;color:rgb(var(--mdui-color-on-surface-variant))}:host([disabled]) .icon,:host([disabled]) .prefix,:host([disabled]) .right-icon,:host([disabled]) .suffix{color:rgba(var(--mdui-color-on-surface),38%)}.invalid .right-icon,.invalid .suffix,.invalid-style .right-icon,.invalid-style .suffix{color:rgb(var(--mdui-color-error))}:host(:hover) .invalid .right-icon,:host(:hover) .invalid .suffix,:host(:hover) .invalid-style .right-icon,:host(:hover) .invalid-style .suffix{color:rgb(var(--mdui-color-on-error-container))}:host([focused-style]) .invalid .right-icon,:host([focused-style]) .invalid .suffix,:host([focused-style]) .invalid-style .right-icon,:host([focused-style]) .invalid-style .suffix,:host([focused]) .invalid .right-icon,:host([focused]) .invalid .suffix,:host([focused]) .invalid-style .right-icon,:host([focused]) .invalid-style .suffix{color:rgb(var(--mdui-color-error))}.icon,.right-icon{font-size:1.5rem}.icon mdui-button-icon,.right-icon mdui-button-icon,::slotted(mdui-button-icon[slot]){margin-left:-.5rem;margin-right:-.5rem}.icon .i,.right-icon .i,::slotted([slot$=icon]){font-size:inherit}.has-icon .icon{margin-right:1rem}.has-end-icon .end-icon,.right-icon:not(.end-icon){margin-left:1rem}.prefix,.suffix{display:none;font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height)}:host([variant=filled][label]) .prefix,:host([variant=filled][label]) .suffix{padding-top:1rem}.has-value .prefix,.has-value .suffix,:host([focused-style]) .prefix,:host([focused-style]) .suffix,:host([focused]) .prefix,:host([focused]) .suffix{display:flex}.prefix{padding-right:.125rem}.suffix{padding-left:.125rem}.input-container{width:100%}.label{position:absolute;pointer-events:none;max-width:calc(100% - 1rem);display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;top:1rem;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height)}.invalid .label,.invalid-style .label{color:rgb(var(--mdui-color-error))}:host([variant=outlined]) .label{padding:0 .25rem;margin:0 -.25rem}:host([variant=outlined]:hover) .label{color:rgb(var(--mdui-color-on-surface))}:host([variant=filled]:hover) .invalid .label,:host([variant=filled]:hover) .invalid-style .label,:host([variant=outlined]:hover) .invalid .label,:host([variant=outlined]:hover) .invalid-style .label{color:rgb(var(--mdui-color-on-error-container))}:host([variant=filled][focused-style]) .label,:host([variant=filled][focused]) .label,:host([variant=outlined][focused-style]) .label,:host([variant=outlined][focused]) .label{color:rgb(var(--mdui-color-primary))}:host([variant=filled]) .has-value .label,:host([variant=filled][focused-style]) .label,:host([variant=filled][focused]) .label,:host([variant=filled][type=date]) .label,:host([variant=filled][type=datetime-local]) .label,:host([variant=filled][type=month]) .label,:host([variant=filled][type=time]) .label,:host([variant=filled][type=week]) .label{font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height);top:.25rem}:host([variant=outlined]) .has-value .label,:host([variant=outlined][focused-style]) .label,:host([variant=outlined][focused]) .label,:host([variant=outlined][type=date]) .label,:host([variant=outlined][type=datetime-local]) .label,:host([variant=outlined][type=month]) .label,:host([variant=outlined][type=time]) .label,:host([variant=outlined][type=week]) .label{font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height);top:-.5rem;left:.75rem;background-color:rgb(var(--mdui-color-background))}:host([variant=filled][focused-style]) .invalid .label,:host([variant=filled][focused-style]) .invalid-style .label,:host([variant=filled][focused]) .invalid .label,:host([variant=filled][focused]) .invalid-style .label,:host([variant=outlined][focused-style]) .invalid .label,:host([variant=outlined][focused-style]) .invalid-style .label,:host([variant=outlined][focused]) .invalid .label,:host([variant=outlined][focused]) .invalid-style .label{color:rgb(var(--mdui-color-error))}:host([variant=filled][disabled]) .label,:host([variant=outlined][disabled]) .label{color:rgba(var(--mdui-color-on-surface),38%)}.input{display:flex;flex-wrap:wrap;width:100%;border:none;outline:0;background:0 0;-webkit-appearance:none;appearance:none;resize:none;cursor:inherit;font-family:inherit;padding:1rem 0;font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height);color:rgb(var(--mdui-color-on-surface));caret-color:rgb(var(--mdui-color-primary))}.input.hide-input{opacity:0;height:0;padding:0!important;overflow:hidden}.input::placeholder{color:rgb(var(--mdui-color-on-surface-variant))}.invalid .input,.invalid-style .input{caret-color:rgb(var(--mdui-color-error))}:host([disabled]) .input{color:rgba(var(--mdui-color-on-surface),38%)}:host([end-aligned]) .input{text-align:right}:host([variant=filled]) .label+.input{padding:1.5rem 0 .5rem 0}.supporting{display:flex;justify-content:space-between;padding:.25rem 1rem;color:rgb(var(--mdui-color-on-surface-variant))}.supporting.invalid,.supporting.invalid-style{color:rgb(var(--mdui-color-error))}.helper{display:block;opacity:1;transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}:host([disabled]) .helper{color:rgba(var(--mdui-color-on-surface),38%)}:host([helper-on-focus]) .helper{opacity:0}:host([helper-on-focus][focused-style]) .helper,:host([helper-on-focus][focused]) .helper{opacity:1}.error{font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}.counter{flex-wrap:nowrap;padding-left:1rem;font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}::-ms-reveal{display:none}.is-firefox .input[type=date],.is-firefox .input[type=datetime-local],.is-firefox .input[type=time]{-webkit-clip-path:inset(0 2em 0 0);clip-path:inset(0 2em 0 0)}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;display:none}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}`;
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
:host([disabled]) {
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
}
|
|
10
|
+
:host([type='hidden']) {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
.container {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
transition: box-shadow var(--mdui-motion-duration-short4)
|
|
18
|
+
var(--mdui-motion-easing-standard);
|
|
19
|
+
padding: 0rem 1rem;
|
|
20
|
+
}
|
|
21
|
+
.container.has-icon {
|
|
22
|
+
padding-left: 0.75rem;
|
|
23
|
+
}
|
|
24
|
+
.container.has-end-icon,
|
|
25
|
+
.container.has-error-icon {
|
|
26
|
+
padding-right: 0.75rem;
|
|
27
|
+
}
|
|
28
|
+
:host([variant='filled']) .container {
|
|
29
|
+
box-shadow: inset 0 -0.0625rem 0 0 rgb(var(--mdui-color-on-surface-variant));
|
|
30
|
+
background-color: rgb(var(--mdui-color-surface-container-highest));
|
|
31
|
+
border-radius: var(--mdui-shape-corner-extra-small)
|
|
32
|
+
var(--mdui-shape-corner-extra-small) 0 0;
|
|
33
|
+
}
|
|
34
|
+
:host([variant='filled']) .container.invalid,
|
|
35
|
+
:host([variant='filled']) .container.invalid-style {
|
|
36
|
+
box-shadow: inset 0 -0.0625rem 0 0 rgb(var(--mdui-color-error));
|
|
37
|
+
}
|
|
38
|
+
:host([variant='filled']:hover) .container {
|
|
39
|
+
box-shadow: inset 0 -0.0625rem 0 0 rgb(var(--mdui-color-on-surface));
|
|
40
|
+
}
|
|
41
|
+
:host([variant='filled']:hover) .container.invalid,
|
|
42
|
+
:host([variant='filled']:hover) .container.invalid-style {
|
|
43
|
+
box-shadow: inset 0 -0.0625rem 0 0 rgb(var(--mdui-color-on-error-container));
|
|
44
|
+
}
|
|
45
|
+
:host([variant='filled'][focused]) .container,
|
|
46
|
+
:host([variant='filled'][focused-style]) .container {
|
|
47
|
+
box-shadow: inset 0 -0.125rem 0 0 rgb(var(--mdui-color-primary));
|
|
48
|
+
}
|
|
49
|
+
:host([variant='filled'][focused]) .container.invalid,
|
|
50
|
+
:host([variant='filled'][focused-style]) .container.invalid,
|
|
51
|
+
:host([variant='filled'][focused]) .container.invalid-style,
|
|
52
|
+
:host([variant='filled'][focused-style]) .container.invalid-style {
|
|
53
|
+
box-shadow: inset 0 -0.125rem 0 0 rgb(var(--mdui-color-error));
|
|
54
|
+
}
|
|
55
|
+
:host([variant='filled'][disabled]) .container {
|
|
56
|
+
box-shadow: inset 0 -0.0625rem 0 0 rgba(var(--mdui-color-on-surface), 38%);
|
|
57
|
+
background-color: rgba(var(--mdui-color-on-surface), 4%);
|
|
58
|
+
}
|
|
59
|
+
:host([variant='outlined']) .container {
|
|
60
|
+
box-shadow: inset 0 0 0 0.0625rem rgb(var(--mdui-color-outline));
|
|
61
|
+
border-radius: var(--mdui-shape-corner-extra-small);
|
|
62
|
+
}
|
|
63
|
+
:host([variant='outlined']) .container.invalid,
|
|
64
|
+
:host([variant='outlined']) .container.invalid-style {
|
|
65
|
+
box-shadow: inset 0 0 0 0.0625rem rgb(var(--mdui-color-error));
|
|
66
|
+
}
|
|
67
|
+
:host([variant='outlined']:hover) .container {
|
|
68
|
+
box-shadow: inset 0 0 0 0.0625rem rgb(var(--mdui-color-on-surface));
|
|
69
|
+
}
|
|
70
|
+
:host([variant='outlined']:hover) .container.invalid,
|
|
71
|
+
:host([variant='outlined']:hover) .container.invalid-style {
|
|
72
|
+
box-shadow: inset 0 0 0 0.0625rem rgb(var(--mdui-color-on-error-container));
|
|
73
|
+
}
|
|
74
|
+
:host([variant='outlined'][focused]) .container,
|
|
75
|
+
:host([variant='outlined'][focused-style]) .container {
|
|
76
|
+
box-shadow: inset 0 0 0 0.125rem rgb(var(--mdui-color-primary));
|
|
77
|
+
}
|
|
78
|
+
:host([variant='outlined'][focused]) .container.invalid,
|
|
79
|
+
:host([variant='outlined'][focused-style]) .container.invalid,
|
|
80
|
+
:host([variant='outlined'][focused]) .container.invalid-style,
|
|
81
|
+
:host([variant='outlined'][focused-style]) .container.invalid-style {
|
|
82
|
+
box-shadow: inset 0 0 0 0.125rem rgb(var(--mdui-color-error));
|
|
83
|
+
}
|
|
84
|
+
:host([variant='outlined'][disabled]) .container {
|
|
85
|
+
box-shadow: inset 0 0 0 0.125rem rgba(var(--mdui-color-on-surface), 12%);
|
|
86
|
+
}
|
|
87
|
+
.icon,
|
|
88
|
+
.right-icon,
|
|
89
|
+
.prefix,
|
|
90
|
+
.suffix {
|
|
91
|
+
display: flex;
|
|
92
|
+
-webkit-user-select: none;
|
|
93
|
+
user-select: none;
|
|
94
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
95
|
+
}
|
|
96
|
+
:host([disabled]) .icon,
|
|
97
|
+
:host([disabled]) .right-icon,
|
|
98
|
+
:host([disabled]) .prefix,
|
|
99
|
+
:host([disabled]) .suffix {
|
|
100
|
+
color: rgba(var(--mdui-color-on-surface), 38%);
|
|
101
|
+
}
|
|
102
|
+
.invalid .right-icon,
|
|
103
|
+
.invalid .suffix,
|
|
104
|
+
.invalid-style .right-icon,
|
|
105
|
+
.invalid-style .suffix {
|
|
106
|
+
color: rgb(var(--mdui-color-error));
|
|
107
|
+
}
|
|
108
|
+
:host(:hover) .invalid .right-icon,
|
|
109
|
+
:host(:hover) .invalid .suffix,
|
|
110
|
+
:host(:hover) .invalid-style .right-icon,
|
|
111
|
+
:host(:hover) .invalid-style .suffix {
|
|
112
|
+
color: rgb(var(--mdui-color-on-error-container));
|
|
113
|
+
}
|
|
114
|
+
:host([focused]) .invalid .right-icon,
|
|
115
|
+
:host([focused]) .invalid .suffix,
|
|
116
|
+
:host([focused-style]) .invalid .right-icon,
|
|
117
|
+
:host([focused-style]) .invalid .suffix,
|
|
118
|
+
:host([focused]) .invalid-style .right-icon,
|
|
119
|
+
:host([focused]) .invalid-style .suffix,
|
|
120
|
+
:host([focused-style]) .invalid-style .right-icon,
|
|
121
|
+
:host([focused-style]) .invalid-style .suffix {
|
|
122
|
+
color: rgb(var(--mdui-color-error));
|
|
123
|
+
}
|
|
124
|
+
.icon,
|
|
125
|
+
.right-icon {
|
|
126
|
+
font-size: 1.5rem;
|
|
127
|
+
}
|
|
128
|
+
.icon mdui-button-icon,
|
|
129
|
+
.right-icon mdui-button-icon,
|
|
130
|
+
::slotted(mdui-button-icon[slot]) {
|
|
131
|
+
margin-left: -0.5rem;
|
|
132
|
+
margin-right: -0.5rem;
|
|
133
|
+
}
|
|
134
|
+
.icon .i,
|
|
135
|
+
.right-icon .i,
|
|
136
|
+
::slotted([slot$='icon']) {
|
|
137
|
+
font-size: inherit;
|
|
138
|
+
}
|
|
139
|
+
.has-icon .icon {
|
|
140
|
+
margin-right: 1rem;
|
|
141
|
+
}
|
|
142
|
+
.right-icon:not(.end-icon),
|
|
143
|
+
.has-end-icon .end-icon {
|
|
144
|
+
margin-left: 1rem;
|
|
145
|
+
}
|
|
146
|
+
.prefix,
|
|
147
|
+
.suffix {
|
|
148
|
+
display: none;
|
|
149
|
+
font-size: var(--mdui-typescale-body-large-size);
|
|
150
|
+
font-weight: var(--mdui-typescale-body-large-weight);
|
|
151
|
+
letter-spacing: var(--mdui-typescale-body-large-tracking);
|
|
152
|
+
line-height: var(--mdui-typescale-body-large-line-height);
|
|
153
|
+
}
|
|
154
|
+
:host([variant='filled'][label]) .prefix,
|
|
155
|
+
:host([variant='filled'][label]) .suffix {
|
|
156
|
+
padding-top: 1rem;
|
|
157
|
+
}
|
|
158
|
+
:host([focused]) .prefix,
|
|
159
|
+
:host([focused]) .suffix,
|
|
160
|
+
:host([focused-style]) .prefix,
|
|
161
|
+
:host([focused-style]) .suffix,
|
|
162
|
+
.has-value .prefix,
|
|
163
|
+
.has-value .suffix {
|
|
164
|
+
display: flex;
|
|
165
|
+
}
|
|
166
|
+
.prefix {
|
|
167
|
+
padding-right: 0.125rem;
|
|
168
|
+
}
|
|
169
|
+
.suffix {
|
|
170
|
+
padding-left: 0.125rem;
|
|
171
|
+
}
|
|
172
|
+
.input-container {
|
|
173
|
+
width: 100%;
|
|
174
|
+
}
|
|
175
|
+
.label {
|
|
176
|
+
position: absolute;
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
max-width: calc(100% - 1rem);
|
|
179
|
+
display: -webkit-box;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
-webkit-box-orient: vertical;
|
|
182
|
+
-webkit-line-clamp: 1;
|
|
183
|
+
top: 1rem;
|
|
184
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
185
|
+
font-size: var(--mdui-typescale-body-large-size);
|
|
186
|
+
font-weight: var(--mdui-typescale-body-large-weight);
|
|
187
|
+
letter-spacing: var(--mdui-typescale-body-large-tracking);
|
|
188
|
+
line-height: var(--mdui-typescale-body-large-line-height);
|
|
189
|
+
}
|
|
190
|
+
.invalid .label,
|
|
191
|
+
.invalid-style .label {
|
|
192
|
+
color: rgb(var(--mdui-color-error));
|
|
193
|
+
}
|
|
194
|
+
:host([variant='outlined']) .label {
|
|
195
|
+
padding: 0rem 0.25rem;
|
|
196
|
+
margin: 0rem -0.25rem;
|
|
197
|
+
}
|
|
198
|
+
:host([variant='outlined']:hover) .label {
|
|
199
|
+
color: rgb(var(--mdui-color-on-surface));
|
|
200
|
+
}
|
|
201
|
+
:host([variant='filled']:hover) .invalid .label,
|
|
202
|
+
:host([variant='outlined']:hover) .invalid .label,
|
|
203
|
+
:host([variant='filled']:hover) .invalid-style .label,
|
|
204
|
+
:host([variant='outlined']:hover) .invalid-style .label {
|
|
205
|
+
color: rgb(var(--mdui-color-on-error-container));
|
|
206
|
+
}
|
|
207
|
+
:host([variant='filled'][focused]) .label,
|
|
208
|
+
:host([variant='filled'][focused-style]) .label,
|
|
209
|
+
:host([variant='outlined'][focused]) .label,
|
|
210
|
+
:host([variant='outlined'][focused-style]) .label {
|
|
211
|
+
color: rgb(var(--mdui-color-primary));
|
|
212
|
+
}
|
|
213
|
+
:host([variant='filled'][focused]) .label,
|
|
214
|
+
:host([variant='filled'][focused-style]) .label,
|
|
215
|
+
:host([variant='filled']) .has-value .label,
|
|
216
|
+
:host([variant='filled'][type='date']) .label,
|
|
217
|
+
:host([variant='filled'][type='datetime-local']) .label,
|
|
218
|
+
:host([variant='filled'][type='month']) .label,
|
|
219
|
+
:host([variant='filled'][type='time']) .label,
|
|
220
|
+
:host([variant='filled'][type='week']) .label {
|
|
221
|
+
font-size: var(--mdui-typescale-body-small-size);
|
|
222
|
+
font-weight: var(--mdui-typescale-body-small-weight);
|
|
223
|
+
letter-spacing: var(--mdui-typescale-body-small-tracking);
|
|
224
|
+
line-height: var(--mdui-typescale-body-small-line-height);
|
|
225
|
+
top: 0.25rem;
|
|
226
|
+
}
|
|
227
|
+
:host([variant='outlined'][focused]) .label,
|
|
228
|
+
:host([variant='outlined'][focused-style]) .label,
|
|
229
|
+
:host([variant='outlined']) .has-value .label,
|
|
230
|
+
:host([variant='outlined'][type='date']) .label,
|
|
231
|
+
:host([variant='outlined'][type='datetime-local']) .label,
|
|
232
|
+
:host([variant='outlined'][type='month']) .label,
|
|
233
|
+
:host([variant='outlined'][type='time']) .label,
|
|
234
|
+
:host([variant='outlined'][type='week']) .label {
|
|
235
|
+
font-size: var(--mdui-typescale-body-small-size);
|
|
236
|
+
font-weight: var(--mdui-typescale-body-small-weight);
|
|
237
|
+
letter-spacing: var(--mdui-typescale-body-small-tracking);
|
|
238
|
+
line-height: var(--mdui-typescale-body-small-line-height);
|
|
239
|
+
top: -0.5rem;
|
|
240
|
+
left: 0.75rem;
|
|
241
|
+
background-color: rgb(var(--mdui-color-background));
|
|
242
|
+
}
|
|
243
|
+
:host([variant='filled'][focused]) .invalid .label,
|
|
244
|
+
:host([variant='filled'][focused-style]) .invalid .label,
|
|
245
|
+
:host([variant='outlined'][focused]) .invalid .label,
|
|
246
|
+
:host([variant='outlined'][focused-style]) .invalid .label,
|
|
247
|
+
:host([variant='filled'][focused]) .invalid-style .label,
|
|
248
|
+
:host([variant='filled'][focused-style]) .invalid-style .label,
|
|
249
|
+
:host([variant='outlined'][focused]) .invalid-style .label,
|
|
250
|
+
:host([variant='outlined'][focused-style]) .invalid-style .label {
|
|
251
|
+
color: rgb(var(--mdui-color-error));
|
|
252
|
+
}
|
|
253
|
+
:host([variant='filled'][disabled]) .label,
|
|
254
|
+
:host([variant='outlined'][disabled]) .label {
|
|
255
|
+
color: rgba(var(--mdui-color-on-surface), 38%);
|
|
256
|
+
}
|
|
257
|
+
.input {
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-wrap: wrap;
|
|
260
|
+
width: 100%;
|
|
261
|
+
border: none;
|
|
262
|
+
outline: none;
|
|
263
|
+
background: none;
|
|
264
|
+
-webkit-appearance: none;
|
|
265
|
+
appearance: none;
|
|
266
|
+
resize: none;
|
|
267
|
+
cursor: inherit;
|
|
268
|
+
font-family: inherit;
|
|
269
|
+
padding: 1rem 0rem;
|
|
270
|
+
font-size: var(--mdui-typescale-body-large-size);
|
|
271
|
+
font-weight: var(--mdui-typescale-body-large-weight);
|
|
272
|
+
letter-spacing: var(--mdui-typescale-body-large-tracking);
|
|
273
|
+
line-height: var(--mdui-typescale-body-large-line-height);
|
|
274
|
+
color: rgb(var(--mdui-color-on-surface));
|
|
275
|
+
caret-color: rgb(var(--mdui-color-primary));
|
|
276
|
+
}
|
|
277
|
+
.input.hide-input {
|
|
278
|
+
opacity: 0;
|
|
279
|
+
height: 0;
|
|
280
|
+
padding: 0 !important;
|
|
281
|
+
overflow: hidden;
|
|
282
|
+
}
|
|
283
|
+
.input::placeholder {
|
|
284
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
285
|
+
}
|
|
286
|
+
.invalid .input,
|
|
287
|
+
.invalid-style .input {
|
|
288
|
+
caret-color: rgb(var(--mdui-color-error));
|
|
289
|
+
}
|
|
290
|
+
:host([disabled]) .input {
|
|
291
|
+
color: rgba(var(--mdui-color-on-surface), 38%);
|
|
292
|
+
}
|
|
293
|
+
:host([end-aligned]) .input {
|
|
294
|
+
text-align: right;
|
|
295
|
+
}
|
|
296
|
+
:host([variant='filled']) .label + .input {
|
|
297
|
+
padding: 1.5rem 0rem 0.5rem 0rem;
|
|
298
|
+
}
|
|
299
|
+
.supporting {
|
|
300
|
+
display: flex;
|
|
301
|
+
justify-content: space-between;
|
|
302
|
+
padding: 0.25rem 1rem;
|
|
303
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
304
|
+
}
|
|
305
|
+
.supporting.invalid,
|
|
306
|
+
.supporting.invalid-style {
|
|
307
|
+
color: rgb(var(--mdui-color-error));
|
|
308
|
+
}
|
|
309
|
+
.helper {
|
|
310
|
+
display: block;
|
|
311
|
+
opacity: 1;
|
|
312
|
+
transition: opacity var(--mdui-motion-duration-short4)
|
|
313
|
+
var(--mdui-motion-easing-linear);
|
|
314
|
+
font-size: var(--mdui-typescale-body-small-size);
|
|
315
|
+
font-weight: var(--mdui-typescale-body-small-weight);
|
|
316
|
+
letter-spacing: var(--mdui-typescale-body-small-tracking);
|
|
317
|
+
line-height: var(--mdui-typescale-body-small-line-height);
|
|
318
|
+
}
|
|
319
|
+
:host([disabled]) .helper {
|
|
320
|
+
color: rgba(var(--mdui-color-on-surface), 38%);
|
|
321
|
+
}
|
|
322
|
+
:host([helper-on-focus]) .helper {
|
|
323
|
+
opacity: 0;
|
|
324
|
+
}
|
|
325
|
+
:host([helper-on-focus][focused]) .helper,
|
|
326
|
+
:host([helper-on-focus][focused-style]) .helper {
|
|
327
|
+
opacity: 1;
|
|
328
|
+
}
|
|
329
|
+
.error {
|
|
330
|
+
font-size: var(--mdui-typescale-body-small-size);
|
|
331
|
+
font-weight: var(--mdui-typescale-body-small-weight);
|
|
332
|
+
letter-spacing: var(--mdui-typescale-body-small-tracking);
|
|
333
|
+
line-height: var(--mdui-typescale-body-small-line-height);
|
|
334
|
+
}
|
|
335
|
+
.counter {
|
|
336
|
+
flex-wrap: nowrap;
|
|
337
|
+
padding-left: 1rem;
|
|
338
|
+
font-size: var(--mdui-typescale-body-small-size);
|
|
339
|
+
font-weight: var(--mdui-typescale-body-small-weight);
|
|
340
|
+
letter-spacing: var(--mdui-typescale-body-small-tracking);
|
|
341
|
+
line-height: var(--mdui-typescale-body-small-line-height);
|
|
342
|
+
}
|
|
343
|
+
::-ms-reveal {
|
|
344
|
+
display: none;
|
|
345
|
+
}
|
|
346
|
+
.is-firefox .input[type='date'],
|
|
347
|
+
.is-firefox .input[type='datetime-local'],
|
|
348
|
+
.is-firefox .input[type='time'] {
|
|
349
|
+
-webkit-clip-path: inset(0 2em 0 0);
|
|
350
|
+
clip-path: inset(0 2em 0 0);
|
|
351
|
+
}
|
|
352
|
+
.input[type='number']::-webkit-outer-spin-button,
|
|
353
|
+
.input[type='number']::-webkit-inner-spin-button {
|
|
354
|
+
-webkit-appearance: none;
|
|
355
|
+
display: none;
|
|
356
|
+
}
|
|
357
|
+
.input[type='number'] {
|
|
358
|
+
-moz-appearance: textfield;
|
|
359
|
+
}
|
|
360
|
+
.input[type='search']::-webkit-search-cancel-button {
|
|
361
|
+
-webkit-appearance: none;
|
|
362
|
+
}
|
|
363
|
+
`;
|
|
@@ -215,7 +215,16 @@ let Tooltip = class Tooltip extends MduiElement {
|
|
|
215
215
|
const hasHeadline = this.isRich() &&
|
|
216
216
|
(this.headline || this.hasSlotController.test('headline'));
|
|
217
217
|
const hasAction = this.isRich() && this.hasSlotController.test('action');
|
|
218
|
-
return html `<slot></slot
|
|
218
|
+
return html `<slot></slot>
|
|
219
|
+
<div ${ref(this.popupRef)} part="popup" class="popup" hidden>
|
|
220
|
+
${when(hasHeadline, () => html `<slot name="headline" part="headline" class="headline">
|
|
221
|
+
${this.headline}
|
|
222
|
+
</slot>`)}
|
|
223
|
+
<slot name="content" part="content" class="content">
|
|
224
|
+
${this.content}
|
|
225
|
+
</slot>
|
|
226
|
+
${when(hasAction, () => html `<slot name="action" part="action" class="action"></slot>`)}
|
|
227
|
+
</div>`;
|
|
219
228
|
}
|
|
220
229
|
isRich() {
|
|
221
230
|
return this.variant === 'rich';
|