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.
Files changed (98) hide show
  1. package/components/avatar/index.js +7 -2
  2. package/components/avatar/style.js +31 -1
  3. package/components/badge/style.js +25 -1
  4. package/components/bottom-app-bar/style.js +92 -1
  5. package/components/button/button-base-style.js +28 -1
  6. package/components/button/button-base.js +8 -1
  7. package/components/button/index.js +18 -8
  8. package/components/button/style.js +111 -2
  9. package/components/button-icon/index.js +22 -5
  10. package/components/button-icon/style.js +103 -2
  11. package/components/card/index.js +5 -1
  12. package/components/card/style.js +72 -1
  13. package/components/checkbox/index.js +50 -7
  14. package/components/checkbox/style.js +131 -1
  15. package/components/chip/index.js +33 -9
  16. package/components/chip/style.js +205 -2
  17. package/components/circular-progress/index.js +39 -5
  18. package/components/circular-progress/style.js +136 -1
  19. package/components/collapse/collapse-item-style.js +21 -1
  20. package/components/collapse/collapse-item.js +10 -2
  21. package/components/collapse/collapse-style.js +5 -1
  22. package/components/collapse/collapse.js +4 -1
  23. package/components/dialog/index.js +35 -7
  24. package/components/dialog/style.js +116 -1
  25. package/components/divider/style.js +18 -1
  26. package/components/dropdown/index.js +8 -1
  27. package/components/dropdown/style.js +11 -1
  28. package/components/fab/index.js +13 -5
  29. package/components/fab/style.js +153 -4
  30. package/components/icon/index.js +5 -1
  31. package/components/icon/style.js +29 -1
  32. package/components/layout/layout-item-style.js +6 -1
  33. package/components/layout/layout-main-style.js +7 -1
  34. package/components/layout/layout-style.js +11 -1
  35. package/components/linear-progress/index.js +6 -2
  36. package/components/linear-progress/style.js +73 -1
  37. package/components/list/list-item-style.js +153 -2
  38. package/components/list/list-item.js +27 -8
  39. package/components/list/list-style.js +10 -1
  40. package/components/list/list-subheader-style.js +19 -1
  41. package/components/menu/menu-item-style.js +125 -1
  42. package/components/menu/menu-item.js +55 -13
  43. package/components/menu/menu-style.js +19 -1
  44. package/components/menu/menu.js +5 -1
  45. package/components/navigation-bar/navigation-bar-item-style.js +132 -1
  46. package/components/navigation-bar/navigation-bar-item.js +23 -7
  47. package/components/navigation-bar/navigation-bar-style.js +28 -1
  48. package/components/navigation-bar/navigation-bar.js +4 -1
  49. package/components/navigation-drawer/index.js +12 -1
  50. package/components/navigation-drawer/style.js +66 -1
  51. package/components/navigation-rail/navigation-rail-item-style.js +122 -1
  52. package/components/navigation-rail/navigation-rail-item.js +26 -7
  53. package/components/navigation-rail/navigation-rail-style.js +79 -1
  54. package/components/navigation-rail/navigation-rail.js +10 -1
  55. package/components/radio/radio-group-style.js +20 -1
  56. package/components/radio/radio-group.js +19 -1
  57. package/components/radio/radio-style.js +107 -1
  58. package/components/radio/radio.js +23 -5
  59. package/components/range-slider/index.d.ts +1 -1
  60. package/components/range-slider/index.js +53 -5
  61. package/components/ripple/index.js +5 -2
  62. package/components/ripple/style.js +96 -1
  63. package/components/segmented-button/segmented-button-group-style.js +28 -1
  64. package/components/segmented-button/segmented-button-group.js +21 -1
  65. package/components/segmented-button/segmented-button-style.js +81 -2
  66. package/components/segmented-button/segmented-button.js +27 -11
  67. package/components/select/index.js +87 -6
  68. package/components/select/style.js +27 -1
  69. package/components/slider/index.js +33 -2
  70. package/components/slider/slider-base-style.js +173 -1
  71. package/components/slider/slider-base.js +6 -1
  72. package/components/slider/style.js +7 -1
  73. package/components/snackbar/index.js +32 -5
  74. package/components/snackbar/style.js +100 -1
  75. package/components/switch/index.js +40 -6
  76. package/components/switch/style.js +202 -1
  77. package/components/tabs/tab-panel-style.js +10 -1
  78. package/components/tabs/tab-style.js +85 -1
  79. package/components/tabs/tab.js +24 -4
  80. package/components/tabs/tabs-style.js +138 -1
  81. package/components/tabs/tabs.js +9 -1
  82. package/components/text-field/index.js +160 -32
  83. package/components/text-field/style.js +362 -1
  84. package/components/tooltip/index.js +10 -1
  85. package/components/tooltip/style.js +57 -1
  86. package/components/top-app-bar/top-app-bar-style.js +78 -1
  87. package/components/top-app-bar/top-app-bar-title-style.js +81 -1
  88. package/components/top-app-bar/top-app-bar-title.js +17 -3
  89. package/custom-elements.json +1144 -1101
  90. package/html-data.en.json +15 -6
  91. package/html-data.zh-cn.json +15 -6
  92. package/jsx.en.d.ts +2 -2
  93. package/jsx.zh-cn.d.ts +2 -2
  94. package/package.json +2 -2
  95. package/web-types.en.json +20 -4
  96. package/web-types.zh-cn.json +20 -4
  97. package/mdui.esm.js +0 -22
  98. package/mdui.global.js +0 -22
@@ -1,2 +1,137 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{position:relative;display:inline-block;width:2.5rem;height:2.5rem;stroke:rgb(var(--mdui-color-primary))}.progress{position:relative;display:inline-block;width:100%;height:100%;text-align:left;transition:opacity var(--mdui-motion-duration-medium1) var(--mdui-motion-easing-linear)}.determinate svg{transform:rotate(-90deg);fill:transparent}.determinate .track{stroke:transparent}.determinate .circle{stroke:inherit;transition:stroke-dashoffset var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard)}.indeterminate{font-size:0;letter-spacing:0;white-space:nowrap;animation:mdui-comp-circular-progress-rotate 1568ms var(--mdui-motion-easing-linear) infinite}.indeterminate .circle,.indeterminate .layer{position:absolute;width:100%;height:100%}.indeterminate .layer{animation:mdui-comp-circular-progress-layer-rotate 5332ms var(--mdui-motion-easing-standard) infinite both}.indeterminate .circle{fill:transparent;stroke:inherit}.indeterminate .gap-patch{position:absolute;top:0;left:47.5%;width:5%;height:100%;overflow:hidden}.indeterminate .gap-patch .circle{left:-900%;width:2000%;transform:rotate(180deg)}.indeterminate .clipper{position:relative;display:inline-block;width:50%;height:100%;overflow:hidden}.indeterminate .clipper .circle{width:200%}.indeterminate .clipper.left .circle{animation:mdui-comp-circular-progress-left-spin 1333ms var(--mdui-motion-easing-standard) infinite both}.indeterminate .clipper.right .circle{left:-100%;animation:mdui-comp-circular-progress-right-spin 1333ms var(--mdui-motion-easing-standard) infinite both}@keyframes mdui-comp-circular-progress-rotate{to{transform:rotate(360deg)}}@keyframes mdui-comp-circular-progress-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdui-comp-circular-progress-left-spin{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes mdui-comp-circular-progress-right-spin{0%{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}100%{transform:rotate(-265deg)}}`;
2
+ export const style = css `
3
+ :host {
4
+ position: relative;
5
+ display: inline-block;
6
+ width: 2.5rem;
7
+ height: 2.5rem;
8
+ stroke: rgb(var(--mdui-color-primary));
9
+ }
10
+ .progress {
11
+ position: relative;
12
+ display: inline-block;
13
+ width: 100%;
14
+ height: 100%;
15
+ text-align: left;
16
+ transition: opacity var(--mdui-motion-duration-medium1)
17
+ var(--mdui-motion-easing-linear);
18
+ }
19
+ .determinate svg {
20
+ transform: rotate(-90deg);
21
+ fill: transparent;
22
+ }
23
+ .determinate .track {
24
+ stroke: transparent;
25
+ }
26
+ .determinate .circle {
27
+ stroke: inherit;
28
+ transition: stroke-dashoffset var(--mdui-motion-duration-long2)
29
+ var(--mdui-motion-easing-standard);
30
+ }
31
+ .indeterminate {
32
+ font-size: 0;
33
+ letter-spacing: 0;
34
+ white-space: nowrap;
35
+ animation: mdui-comp-circular-progress-rotate 1568ms
36
+ var(--mdui-motion-easing-linear) infinite;
37
+ }
38
+ .indeterminate .layer,
39
+ .indeterminate .circle {
40
+ position: absolute;
41
+ width: 100%;
42
+ height: 100%;
43
+ }
44
+ .indeterminate .layer {
45
+ animation: mdui-comp-circular-progress-layer-rotate 5332ms
46
+ var(--mdui-motion-easing-standard) infinite both;
47
+ }
48
+ .indeterminate .circle {
49
+ fill: transparent;
50
+ stroke: inherit;
51
+ }
52
+ .indeterminate .gap-patch {
53
+ position: absolute;
54
+ top: 0;
55
+ left: 47.5%;
56
+ width: 5%;
57
+ height: 100%;
58
+ overflow: hidden;
59
+ }
60
+ .indeterminate .gap-patch .circle {
61
+ left: -900%;
62
+ width: 2000%;
63
+ transform: rotate(180deg);
64
+ }
65
+ .indeterminate .clipper {
66
+ position: relative;
67
+ display: inline-block;
68
+ width: 50%;
69
+ height: 100%;
70
+ overflow: hidden;
71
+ }
72
+ .indeterminate .clipper .circle {
73
+ width: 200%;
74
+ }
75
+ .indeterminate .clipper.left .circle {
76
+ animation: mdui-comp-circular-progress-left-spin 1333ms
77
+ var(--mdui-motion-easing-standard) infinite both;
78
+ }
79
+ .indeterminate .clipper.right .circle {
80
+ left: -100%;
81
+ animation: mdui-comp-circular-progress-right-spin 1333ms
82
+ var(--mdui-motion-easing-standard) infinite both;
83
+ }
84
+ @keyframes mdui-comp-circular-progress-rotate {
85
+ to {
86
+ transform: rotate(360deg);
87
+ }
88
+ }
89
+ @keyframes mdui-comp-circular-progress-layer-rotate {
90
+ 12.5% {
91
+ transform: rotate(135deg);
92
+ }
93
+ 25% {
94
+ transform: rotate(270deg);
95
+ }
96
+ 37.5% {
97
+ transform: rotate(405deg);
98
+ }
99
+ 50% {
100
+ transform: rotate(540deg);
101
+ }
102
+ 62.5% {
103
+ transform: rotate(675deg);
104
+ }
105
+ 75% {
106
+ transform: rotate(810deg);
107
+ }
108
+ 87.5% {
109
+ transform: rotate(945deg);
110
+ }
111
+ 100% {
112
+ transform: rotate(1080deg);
113
+ }
114
+ }
115
+ @keyframes mdui-comp-circular-progress-left-spin {
116
+ 0% {
117
+ transform: rotate(265deg);
118
+ }
119
+ 50% {
120
+ transform: rotate(130deg);
121
+ }
122
+ 100% {
123
+ transform: rotate(265deg);
124
+ }
125
+ }
126
+ @keyframes mdui-comp-circular-progress-right-spin {
127
+ 0% {
128
+ transform: rotate(-265deg);
129
+ }
130
+ 50% {
131
+ transform: rotate(-130deg);
132
+ }
133
+ 100% {
134
+ transform: rotate(-265deg);
135
+ }
136
+ }
137
+ `;
@@ -1,2 +1,22 @@
1
1
  import { css } from 'lit';
2
- export const collapseItemStyle = css `:host{display:flex;flex-direction:column}.header{display:block}.body{display:block;overflow:hidden;transition:height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-emphasized)}.body.opened{overflow:visible}.body.active{transition-duration:var(--mdui-motion-duration-medium4)}`;
2
+ export const collapseItemStyle = css `
3
+ :host {
4
+ display: flex;
5
+ flex-direction: column;
6
+ }
7
+ .header {
8
+ display: block;
9
+ }
10
+ .body {
11
+ display: block;
12
+ overflow: hidden;
13
+ transition: height var(--mdui-motion-duration-short4)
14
+ var(--mdui-motion-easing-emphasized);
15
+ }
16
+ .body.opened {
17
+ overflow: visible;
18
+ }
19
+ .body.active {
20
+ transition-duration: var(--mdui-motion-duration-medium4);
21
+ }
22
+ `;
@@ -68,10 +68,18 @@ let CollapseItem = class CollapseItem extends MduiElement {
68
68
  this.updateBodyHeight();
69
69
  }
70
70
  render() {
71
- return html `<slot name="header" part="header" class="header">${this.header}</slot><slot part="body" class="body ${classMap({
71
+ return html `<slot name="header" part="header" class="header">
72
+ ${this.header}
73
+ </slot>
74
+ <slot
75
+ part="body"
76
+ class="body ${classMap({
72
77
  opened: this.state === 'opened',
73
78
  active: this.active,
74
- })}" ${ref(this.bodyRef)} @transitionend="${this.onTransitionEnd}"></slot>`;
79
+ })}"
80
+ ${ref(this.bodyRef)}
81
+ @transitionend=${this.onTransitionEnd}
82
+ ></slot>`;
75
83
  }
76
84
  onTransitionEnd(event) {
77
85
  if (event.target === this.bodyRef.value) {
@@ -1,2 +1,6 @@
1
1
  import { css } from 'lit';
2
- export const collapseStyle = css `:host{display:block}`;
2
+ export const collapseStyle = css `
3
+ :host {
4
+ display: block;
5
+ }
6
+ `;
@@ -85,7 +85,10 @@ let Collapse = class Collapse extends MduiElement {
85
85
  this.updateItems();
86
86
  }
87
87
  render() {
88
- return html `<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`;
88
+ return html `<slot
89
+ @slotchange=${this.onSlotChange}
90
+ @click=${this.onClick}
91
+ ></slot>`;
89
92
  }
90
93
  setActiveKeys(activeKeys) {
91
94
  if (!arraysEqualIgnoreOrder(this.activeKeys, activeKeys)) {
@@ -218,11 +218,33 @@ let Dialog = class Dialog extends MduiElement {
218
218
  const hasDescription = !!this.description || this.hasSlotController.test('description');
219
219
  const hasHeader = hasIcon || hasHeadline || this.hasSlotController.test('header');
220
220
  const hasBody = hasDescription || hasDefaultSlot;
221
- return html `<div ${ref(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}" tabindex="-1"></div><div ${ref(this.panelRef)} part="panel" class="panel ${classMap({
221
+ return html `<div
222
+ ${ref(this.overlayRef)}
223
+ part="overlay"
224
+ class="overlay"
225
+ @click=${this.onOverlayClick}
226
+ tabindex="-1"
227
+ ></div>
228
+ <div
229
+ ${ref(this.panelRef)}
230
+ part="panel"
231
+ class="panel ${classMap({
222
232
  'has-icon': hasIcon,
223
233
  'has-description': hasDescription,
224
234
  'has-default': hasDefaultSlot,
225
- })}" tabindex="0">${when(hasHeader, () => html `<slot name="header" part="header" class="header">${when(hasIcon, () => this.renderIcon())} ${when(hasHeadline, () => this.renderHeadline())}</slot>`)} ${when(hasBody, () => html `<div ${ref(this.bodyRef)} part="body" class="body">${when(hasDescription, () => this.renderDescription())}<slot></slot></div>`)} ${when(hasActionSlot, () => html `<slot name="action" part="action" class="action"></slot>`)}</div>`;
235
+ })}"
236
+ tabindex="0"
237
+ >
238
+ ${when(hasHeader, () => html `<slot name="header" part="header" class="header">
239
+ ${when(hasIcon, () => this.renderIcon())}
240
+ ${when(hasHeadline, () => this.renderHeadline())}
241
+ </slot>`)}
242
+ ${when(hasBody, () => html `<div ${ref(this.bodyRef)} part="body" class="body">
243
+ ${when(hasDescription, () => this.renderDescription())}
244
+ <slot></slot>
245
+ </div>`)}
246
+ ${when(hasActionSlot, () => html `<slot name="action" part="action" class="action"></slot>`)}
247
+ </div>`;
226
248
  }
227
249
  onOverlayClick() {
228
250
  this.emit('overlay-click');
@@ -232,15 +254,21 @@ let Dialog = class Dialog extends MduiElement {
232
254
  this.open = false;
233
255
  }
234
256
  renderIcon() {
235
- return html `<slot name="icon" part="icon" class="icon">${this.icon
236
- ? html `<mdui-icon name="${this.icon}"></mdui-icon>`
237
- : nothingTemplate}</slot>`;
257
+ return html `<slot name="icon" part="icon" class="icon">
258
+ ${this.icon
259
+ ? html `<mdui-icon name=${this.icon}></mdui-icon>`
260
+ : nothingTemplate}
261
+ </slot>`;
238
262
  }
239
263
  renderHeadline() {
240
- return html `<slot name="headline" part="headline" class="headline">${this.headline}</slot>`;
264
+ return html `<slot name="headline" part="headline" class="headline">
265
+ ${this.headline}
266
+ </slot>`;
241
267
  }
242
268
  renderDescription() {
243
- return html `<slot name="description" part="description" class="description">${this.description}</slot>`;
269
+ return html `<slot name="description" part="description" class="description">
270
+ ${this.description}
271
+ </slot>`;
244
272
  }
245
273
  };
246
274
  Dialog.styles = [componentStyle, style];
@@ -1,2 +1,117 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{--shape-corner:var(--mdui-shape-corner-extra-large);--z-index:2300;position:fixed;z-index:var(--z-index);display:none;align-items:center;justify-content:center;inset:0;padding:3rem}::slotted(mdui-top-app-bar[slot=header]){position:absolute;border-top-left-radius:var(--mdui-shape-corner-extra-large);border-top-right-radius:var(--mdui-shape-corner-extra-large);background-color:rgb(var(--mdui-color-surface-container-high))}:host([fullscreen]){--shape-corner:var(--mdui-shape-corner-none);padding:0}:host([fullscreen]) ::slotted(mdui-top-app-bar[slot=header]){border-top-left-radius:var(--mdui-shape-corner-none);border-top-right-radius:var(--mdui-shape-corner-none)}.overlay{position:fixed;inset:0;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{position:relative;display:flex;flex-direction:column;max-height:100%;border-radius:var(--shape-corner);outline:0;transform-origin:top;min-width:17.5rem;max-width:35rem;padding:1.5rem;background-color:rgb(var(--mdui-color-surface-container-high));box-shadow:var(--mdui-elevation-level3)}:host([fullscreen]) .panel{width:100%;max-width:100%;height:100%;max-height:100%;box-shadow:var(--mdui-elevation-level0)}.header{display:flex;flex-direction:column}.has-icon .header{align-items:center}.icon{display:flex;color:rgb(var(--mdui-color-secondary));font-size:1.5rem}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}.headline{display:flex;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.icon+.headline{padding-top:1rem}.body{overflow:auto}.header+.body{margin-top:1rem}.description{display:flex;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([fullscreen]) .description{color:rgb(var(--mdui-color-on-surface))}.has-description.has-default .description{margin-bottom:1rem}.action{display:flex;justify-content:flex-end;padding-top:1.5rem}.action::slotted(:not(:first-child)){margin-left:.5rem}:host([stacked-actions]) .action{flex-direction:column;align-items:end}:host([stacked-actions]) .action::slotted(:not(:first-child)){margin-left:0;margin-top:.5rem}`;
2
+ export const style = css `
3
+ :host {
4
+ --shape-corner: var(--mdui-shape-corner-extra-large);
5
+ --z-index: 2300;
6
+ position: fixed;
7
+ z-index: var(--z-index);
8
+ display: none;
9
+ align-items: center;
10
+ justify-content: center;
11
+ inset: 0;
12
+ padding: 3rem;
13
+ }
14
+ ::slotted(mdui-top-app-bar[slot='header']) {
15
+ position: absolute;
16
+ border-top-left-radius: var(--mdui-shape-corner-extra-large);
17
+ border-top-right-radius: var(--mdui-shape-corner-extra-large);
18
+ background-color: rgb(var(--mdui-color-surface-container-high));
19
+ }
20
+ :host([fullscreen]) {
21
+ --shape-corner: var(--mdui-shape-corner-none);
22
+ padding: 0;
23
+ }
24
+ :host([fullscreen]) ::slotted(mdui-top-app-bar[slot='header']) {
25
+ border-top-left-radius: var(--mdui-shape-corner-none);
26
+ border-top-right-radius: var(--mdui-shape-corner-none);
27
+ }
28
+ .overlay {
29
+ position: fixed;
30
+ inset: 0;
31
+ background-color: rgba(var(--mdui-color-scrim), 0.4);
32
+ }
33
+ .panel {
34
+ position: relative;
35
+ display: flex;
36
+ flex-direction: column;
37
+ max-height: 100%;
38
+ border-radius: var(--shape-corner);
39
+ outline: none;
40
+ transform-origin: top;
41
+ min-width: 17.5rem;
42
+ max-width: 35rem;
43
+ padding: 1.5rem;
44
+ background-color: rgb(var(--mdui-color-surface-container-high));
45
+ box-shadow: var(--mdui-elevation-level3);
46
+ }
47
+ :host([fullscreen]) .panel {
48
+ width: 100%;
49
+ max-width: 100%;
50
+ height: 100%;
51
+ max-height: 100%;
52
+ box-shadow: var(--mdui-elevation-level0);
53
+ }
54
+ .header {
55
+ display: flex;
56
+ flex-direction: column;
57
+ }
58
+ .has-icon .header {
59
+ align-items: center;
60
+ }
61
+ .icon {
62
+ display: flex;
63
+ color: rgb(var(--mdui-color-secondary));
64
+ font-size: 1.5rem;
65
+ }
66
+ .icon mdui-icon,
67
+ ::slotted([slot='icon']) {
68
+ font-size: inherit;
69
+ }
70
+ .headline {
71
+ display: flex;
72
+ color: rgb(var(--mdui-color-on-surface));
73
+ font-size: var(--mdui-typescale-headline-small-size);
74
+ font-weight: var(--mdui-typescale-headline-small-weight);
75
+ letter-spacing: var(--mdui-typescale-headline-small-tracking);
76
+ line-height: var(--mdui-typescale-headline-small-line-height);
77
+ }
78
+ .icon + .headline {
79
+ padding-top: 1rem;
80
+ }
81
+ .body {
82
+ overflow: auto;
83
+ }
84
+ .header + .body {
85
+ margin-top: 1rem;
86
+ }
87
+ .description {
88
+ display: flex;
89
+ color: rgb(var(--mdui-color-on-surface-variant));
90
+ font-size: var(--mdui-typescale-body-medium-size);
91
+ font-weight: var(--mdui-typescale-body-medium-weight);
92
+ letter-spacing: var(--mdui-typescale-body-medium-tracking);
93
+ line-height: var(--mdui-typescale-body-medium-line-height);
94
+ }
95
+ :host([fullscreen]) .description {
96
+ color: rgb(var(--mdui-color-on-surface));
97
+ }
98
+ .has-description.has-default .description {
99
+ margin-bottom: 1rem;
100
+ }
101
+ .action {
102
+ display: flex;
103
+ justify-content: flex-end;
104
+ padding-top: 1.5rem;
105
+ }
106
+ .action::slotted(:not(:first-child)) {
107
+ margin-left: 0.5rem;
108
+ }
109
+ :host([stacked-actions]) .action {
110
+ flex-direction: column;
111
+ align-items: end;
112
+ }
113
+ :host([stacked-actions]) .action::slotted(:not(:first-child)) {
114
+ margin-left: 0rem;
115
+ margin-top: 0.5rem;
116
+ }
117
+ `;
@@ -1,2 +1,19 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{display:block;height:.0625rem;background-color:rgb(var(--mdui-color-surface-variant))}:host([inset]){margin-left:1rem}:host([middle]){margin-left:1rem;margin-right:1rem}:host([vertical]){height:100%;width:.0625rem}`;
2
+ export const style = css `
3
+ :host {
4
+ display: block;
5
+ height: 0.0625rem;
6
+ background-color: rgb(var(--mdui-color-surface-variant));
7
+ }
8
+ :host([inset]) {
9
+ margin-left: 1rem;
10
+ }
11
+ :host([middle]) {
12
+ margin-left: 1rem;
13
+ margin-right: 1rem;
14
+ }
15
+ :host([vertical]) {
16
+ height: 100%;
17
+ width: 0.0625rem;
18
+ }
19
+ `;
@@ -234,7 +234,14 @@ let Dropdown = class Dropdown extends MduiElement {
234
234
  });
235
235
  }
236
236
  render() {
237
- return html `<slot name="trigger" part="trigger" class="trigger"></slot><slot ${ref(this.panelRef)} part="panel" class="panel" hidden @click="${this.onPanelClick}"></slot>`;
237
+ return html `<slot name="trigger" part="trigger" class="trigger"></slot>
238
+ <slot
239
+ ${ref(this.panelRef)}
240
+ part="panel"
241
+ class="panel"
242
+ hidden
243
+ @click=${this.onPanelClick}
244
+ ></slot>`;
238
245
  }
239
246
  /**
240
247
  * 获取 dropdown 打开、关闭动画的 CSS scaleX 或 scaleY
@@ -1,2 +1,12 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{--z-index:2100;display:contents}.panel{display:block;position:fixed;z-index:var(--z-index)}`;
2
+ export const style = css `
3
+ :host {
4
+ --z-index: 2100;
5
+ display: contents;
6
+ }
7
+ .panel {
8
+ display: block;
9
+ position: fixed;
10
+ z-index: var(--z-index);
11
+ }
12
+ `;
@@ -94,14 +94,20 @@ let Fab = class Fab extends ButtonBase {
94
94
  button: true,
95
95
  'has-icon': this.icon || this.hasSlotController.test('icon'),
96
96
  });
97
- return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()
97
+ return html `<mdui-ripple
98
+ ${ref(this.rippleRef)}
99
+ .noRipple=${this.noRipple}
100
+ ></mdui-ripple>
101
+ ${this.isButton()
98
102
  ? this.renderButton({
99
103
  className,
100
104
  part: 'button',
101
105
  content: this.renderInner(),
102
106
  })
103
107
  : this.disabled || this.loading
104
- ? html `<span part="button" class="_a ${className}">${this.renderInner()}</span>`
108
+ ? html `<span part="button" class="_a ${className}">
109
+ ${this.renderInner()}
110
+ </span>`
105
111
  : this.renderAnchor({
106
112
  className,
107
113
  part: 'button',
@@ -115,9 +121,11 @@ let Fab = class Fab extends ButtonBase {
115
121
  if (this.loading) {
116
122
  return this.renderLoading();
117
123
  }
118
- return html `<slot name="icon" part="icon" class="icon">${this.icon
119
- ? html `<mdui-icon name="${this.icon}"></mdui-icon>`
120
- : nothingTemplate}</slot>`;
124
+ return html `<slot name="icon" part="icon" class="icon">
125
+ ${this.icon
126
+ ? html `<mdui-icon name=${this.icon}></mdui-icon>`
127
+ : nothingTemplate}
128
+ </slot>`;
121
129
  }
122
130
  renderInner() {
123
131
  return [this.renderIcon(), this.renderLabel()];
@@ -1,8 +1,157 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{--shape-corner-small:var(--mdui-shape-corner-small);--shape-corner-normal:var(--mdui-shape-corner-large);--shape-corner-large:var(--mdui-shape-corner-extra-large);position:relative;display:inline-block;overflow:hidden;text-align:center;border-radius:var(--shape-corner-normal);cursor:pointer;-webkit-tap-highlight-color:transparent;transition-property:box-shadow;transition-timing-function:var(--mdui-motion-easing-emphasized);transition-duration:var(--mdui-motion-duration-medium4);width:3.5rem;height:3.5rem;box-shadow:var(--mdui-elevation-level3);font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{padding:0 1rem}:host([size=small]) .button{padding:0 .5rem}:host([size=large]) .button{padding:0 1.875rem}:host([lowered]){box-shadow:var(--mdui-elevation-level1)}:host([focus-visible]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][focus-visible]){box-shadow:var(--mdui-elevation-level1)}:host([pressed]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][pressed]){box-shadow:var(--mdui-elevation-level1)}:host([hover]){box-shadow:var(--mdui-elevation-level4)}:host([lowered][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=primary]){color:rgb(var(--mdui-color-on-primary-container));background-color:rgb(var(--mdui-color-primary-container));--mdui-comp-ripple-state-layer-color:var(
2
+ export const style = css `
3
+ /**
4
+ * mdui-fab 组件。默认为 variant="primary" size="normal"
5
+ */
6
+ :host {
7
+ --shape-corner-small: var(--mdui-shape-corner-small);
8
+ --shape-corner-normal: var(--mdui-shape-corner-large);
9
+ --shape-corner-large: var(--mdui-shape-corner-extra-large);
10
+ position: relative;
11
+ display: inline-block;
12
+ overflow: hidden;
13
+ text-align: center;
14
+ border-radius: var(--shape-corner-normal);
15
+ cursor: pointer;
16
+ -webkit-tap-highlight-color: transparent;
17
+ transition-property: box-shadow;
18
+ transition-timing-function: var(--mdui-motion-easing-emphasized);
19
+ transition-duration: var(--mdui-motion-duration-medium4);
20
+ width: 3.5rem;
21
+ height: 3.5rem;
22
+ box-shadow: var(--mdui-elevation-level3);
23
+ font-size: var(--mdui-typescale-label-large-size);
24
+ font-weight: var(--mdui-typescale-label-large-weight);
25
+ letter-spacing: var(--mdui-typescale-label-large-tracking);
26
+ line-height: var(--mdui-typescale-label-large-line-height);
27
+ }
28
+ .button {
29
+ padding: 0rem 1rem;
30
+ }
31
+ :host([size='small']) .button {
32
+ padding: 0rem 0.5rem;
33
+ }
34
+ :host([size='large']) .button {
35
+ padding: 0rem 1.875rem;
36
+ }
37
+ :host([lowered]) {
38
+ box-shadow: var(--mdui-elevation-level1);
39
+ }
40
+ :host([focus-visible]) {
41
+ box-shadow: var(--mdui-elevation-level3);
42
+ }
43
+ :host([lowered][focus-visible]) {
44
+ box-shadow: var(--mdui-elevation-level1);
45
+ }
46
+ :host([pressed]) {
47
+ box-shadow: var(--mdui-elevation-level3);
48
+ }
49
+ :host([lowered][pressed]) {
50
+ box-shadow: var(--mdui-elevation-level1);
51
+ }
52
+ :host([hover]) {
53
+ box-shadow: var(--mdui-elevation-level4);
54
+ }
55
+ :host([lowered][hover]) {
56
+ box-shadow: var(--mdui-elevation-level2);
57
+ }
58
+ :host([variant='primary']) {
59
+ color: rgb(var(--mdui-color-on-primary-container));
60
+ background-color: rgb(var(--mdui-color-primary-container));
61
+ --mdui-comp-ripple-state-layer-color: var(
3
62
  --mdui-color-on-primary-container
4
- )}:host([variant=surface]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-high));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=surface][lowered]){background-color:rgb(var(--mdui-color-surface-container-low))}:host([variant=secondary]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
63
+ );
64
+ }
65
+ :host([variant='surface']) {
66
+ color: rgb(var(--mdui-color-primary));
67
+ background-color: rgb(var(--mdui-color-surface-container-high));
68
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
69
+ }
70
+ :host([variant='surface'][lowered]) {
71
+ background-color: rgb(var(--mdui-color-surface-container-low));
72
+ }
73
+ :host([variant='secondary']) {
74
+ color: rgb(var(--mdui-color-on-secondary-container));
75
+ background-color: rgb(var(--mdui-color-secondary-container));
76
+ --mdui-comp-ripple-state-layer-color: var(
5
77
  --mdui-color-on-secondary-container
6
- )}:host([variant=tertiary]){color:rgb(var(--mdui-color-on-tertiary-container));background-color:rgb(var(--mdui-color-tertiary-container));--mdui-comp-ripple-state-layer-color:var(
78
+ );
79
+ }
80
+ :host([variant='tertiary']) {
81
+ color: rgb(var(--mdui-color-on-tertiary-container));
82
+ background-color: rgb(var(--mdui-color-tertiary-container));
83
+ --mdui-comp-ripple-state-layer-color: var(
7
84
  --mdui-color-on-tertiary-container
8
- )}:host([size=small]){border-radius:var(--shape-corner-small);width:2.5rem;height:2.5rem}:host([size=large]){border-radius:var(--shape-corner-large);width:6rem;height:6rem}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){color:rgba(var(--mdui-color-on-surface),38%);background-color:rgba(var(--mdui-color-on-surface),12%);box-shadow:var(--mdui-elevation-level0)}:host([extended]){width:auto}.label{display:inline-flex;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear) var(--mdui-motion-duration-short2);padding-left:.25rem;padding-right:.25rem}.has-icon .label{margin-left:.5rem}:host([size=small]) .has-icon .label{margin-left:.25rem}:host([size=large]) .has-icon .label{margin-left:1rem}:host(:not([extended])) .label{opacity:0;transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1)}:host([size=large]) .label{font-size:1.5em}.icon{display:inline-flex;font-size:1.71428571em}:host([size=large]) .icon{font-size:2.57142857em}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}mdui-circular-progress{display:inline-flex;width:1.5rem;height:1.5rem}:host([size=large]) mdui-circular-progress{width:2.25rem;height:2.25rem}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;
85
+ );
86
+ }
87
+ :host([size='small']) {
88
+ border-radius: var(--shape-corner-small);
89
+ width: 2.5rem;
90
+ height: 2.5rem;
91
+ }
92
+ :host([size='large']) {
93
+ border-radius: var(--shape-corner-large);
94
+ width: 6rem;
95
+ height: 6rem;
96
+ }
97
+ :host([disabled]),
98
+ :host([loading]) {
99
+ cursor: default;
100
+ pointer-events: none;
101
+ }
102
+ :host([disabled]) {
103
+ color: rgba(var(--mdui-color-on-surface), 38%);
104
+ background-color: rgba(var(--mdui-color-on-surface), 12%);
105
+ box-shadow: var(--mdui-elevation-level0);
106
+ }
107
+ :host([extended]) {
108
+ width: auto;
109
+ }
110
+ .label {
111
+ display: inline-flex;
112
+ transition: opacity var(--mdui-motion-duration-short2)
113
+ var(--mdui-motion-easing-linear) var(--mdui-motion-duration-short2);
114
+ padding-left: 0.25rem;
115
+ padding-right: 0.25rem;
116
+ }
117
+ .has-icon .label {
118
+ margin-left: 0.5rem;
119
+ }
120
+ :host([size='small']) .has-icon .label {
121
+ margin-left: 0.25rem;
122
+ }
123
+ :host([size='large']) .has-icon .label {
124
+ margin-left: 1rem;
125
+ }
126
+ :host(:not([extended])) .label {
127
+ opacity: 0;
128
+ transition-delay: 0ms;
129
+ transition-duration: var(--mdui-motion-duration-short1);
130
+ }
131
+ :host([size='large']) .label {
132
+ font-size: 1.5em;
133
+ }
134
+ .icon {
135
+ display: inline-flex;
136
+ font-size: 1.71428571em;
137
+ }
138
+ :host([size='large']) .icon {
139
+ font-size: 2.57142857em;
140
+ }
141
+ .icon mdui-icon,
142
+ ::slotted([slot='icon']) {
143
+ font-size: inherit;
144
+ }
145
+ mdui-circular-progress {
146
+ display: inline-flex;
147
+ width: 1.5rem;
148
+ height: 1.5rem;
149
+ }
150
+ :host([size='large']) mdui-circular-progress {
151
+ width: 2.25rem;
152
+ height: 2.25rem;
153
+ }
154
+ :host([disabled]) mdui-circular-progress {
155
+ stroke: rgba(var(--mdui-color-on-surface), 38%);
156
+ }
157
+ `;
@@ -34,7 +34,11 @@ let Icon = class Icon extends MduiElement {
34
34
  ['sharp', 'Material Icons Sharp'],
35
35
  ['two-tone', 'Material Icons Two Tone'],
36
36
  ]);
37
- return html `<span style="${styleMap({ fontFamily: familyMap.get(variant) })}">${name}</span>`;
37
+ return html `<span
38
+ style=${styleMap({ fontFamily: familyMap.get(variant) })}
39
+ >
40
+ ${name}
41
+ </span>`;
38
42
  }
39
43
  if (this.src) {
40
44
  return html `${until(ajax({ url: this.src }).then(unsafeSVG))}`;