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,203 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);--shape-corner-thumb:var(--mdui-shape-corner-full);position:relative;display:inline-block;cursor:pointer;-webkit-tap-highlight-color:transparent;height:2.5rem}:host([disabled]){cursor:default;pointer-events:none}label{display:inline-flex;align-items:center;width:100%;height:100%;white-space:nowrap;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}.track{position:relative;display:flex;align-items:center;border-radius:var(--shape-corner);transition-property:background-color,border-width;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard);height:2rem;width:3.25rem;border:.125rem solid rgb(var(--mdui-color-outline));background-color:rgb(var(--mdui-color-surface-container-highest))}:host([checked]) .track{background-color:rgb(var(--mdui-color-primary));border-width:0}.invalid .track{background-color:rgb(var(--mdui-color-error-container));border-color:rgb(var(--mdui-color-error))}:host([disabled]) .track{background-color:rgba(var(--mdui-color-surface-container-highest),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled][checked]) .track{background-color:rgba(var(--mdui-color-on-surface),.12)}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.25rem;height:1.25rem;margin:0 0 0 .625rem}mdui-ripple{border-radius:50%;transition-property:left,top;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard);width:2.5rem;height:2.5rem}.thumb{position:absolute;display:flex;align-items:center;justify-content:center;border-radius:var(--shape-corner-thumb);transition-property:width,height,left,background-color;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard);height:1rem;width:1rem;left:.375rem;background-color:rgb(var(--mdui-color-outline));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.thumb mdui-ripple{left:-.75rem;top:-.75rem}.has-unchecked-icon .thumb{height:1.5rem;width:1.5rem;left:.125rem}.has-unchecked-icon .thumb mdui-ripple{left:-.5rem;top:-.5rem}:host([focus-visible]) .thumb,:host([hover]) .thumb,:host([pressed]) .thumb{background-color:rgb(var(--mdui-color-on-surface-variant))}:host([checked]) .thumb{height:1.5rem;width:1.5rem;left:1.5rem;background-color:rgb(var(--mdui-color-on-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([checked]) .thumb mdui-ripple{left:-.5rem;top:-.5rem}:host([pressed]) .thumb{height:1.75rem;width:1.75rem;left:0}:host([pressed]) .thumb mdui-ripple{left:-.375rem;top:-.375rem}:host([pressed][checked]) .thumb{left:1.375rem}:host([focus-visible][checked]) .thumb,:host([hover][checked]) .thumb,:host([pressed][checked]) .thumb{background-color:rgb(var(--mdui-color-primary-container))}.invalid .thumb{background-color:rgb(var(--mdui-color-error));--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}:host([focus-visible]) .invalid .thumb,:host([hover]) .invalid .thumb,:host([pressed]) .invalid .thumb{background-color:rgb(var(--mdui-color-error))}:host([disabled]) .thumb{background-color:rgba(var(--mdui-color-on-surface),.38)}:host([disabled][checked]) .thumb{background-color:rgb(var(--mdui-color-surface))}.checked-icon,.unchecked-icon{display:flex;position:absolute;transition-property:opacity,transform;font-size:1rem}.unchecked-icon{opacity:1;transform:scale(1);transition-delay:var(--mdui-motion-duration-short1);transition-duration:var(--mdui-motion-duration-short3);transition-timing-function:var(--mdui-motion-easing-linear);color:rgb(var(--mdui-color-surface-container-highest))}:host([checked]) .unchecked-icon{opacity:0;transform:scale(.92);transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1)}:host([disabled]) .unchecked-icon{color:rgba(var(--mdui-color-surface-container-highest),.38)}.checked-icon{opacity:0;transform:scale(.92);transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1);transition-timing-function:var(--mdui-motion-easing-linear);color:rgb(var(--mdui-color-on-primary-container))}:host([checked]) .checked-icon{opacity:1;transform:scale(1);transition-delay:var(--mdui-motion-duration-short1);transition-duration:var(--mdui-motion-duration-short3)}.invalid .checked-icon{color:rgb(var(--mdui-color-error-container))}:host([disabled]) .checked-icon{color:rgba(var(--mdui-color-on-surface),.38)}.checked-icon .i,.unchecked-icon .i,::slotted([slot=checked-icon]),::slotted([slot=unchecked-icon]){font-size:inherit;color:inherit}`;
2
+ export const style = css `
3
+ :host {
4
+ --shape-corner: var(--mdui-shape-corner-full);
5
+ --shape-corner-thumb: var(--mdui-shape-corner-full);
6
+ position: relative;
7
+ display: inline-block;
8
+ cursor: pointer;
9
+ -webkit-tap-highlight-color: transparent;
10
+ height: 2.5rem;
11
+ }
12
+ :host([disabled]) {
13
+ cursor: default;
14
+ pointer-events: none;
15
+ }
16
+ label {
17
+ display: inline-flex;
18
+ align-items: center;
19
+ width: 100%;
20
+ height: 100%;
21
+ white-space: nowrap;
22
+ cursor: inherit;
23
+ -webkit-user-select: none;
24
+ user-select: none;
25
+ touch-action: manipulation;
26
+ zoom: 1;
27
+ -webkit-user-drag: none;
28
+ }
29
+ /* 轨道 */
30
+ .track {
31
+ position: relative;
32
+ display: flex;
33
+ align-items: center;
34
+ border-radius: var(--shape-corner);
35
+ transition-property: background-color, border-width;
36
+ transition-duration: var(--mdui-motion-duration-short4);
37
+ transition-timing-function: var(--mdui-motion-easing-standard);
38
+ height: 2rem;
39
+ width: 3.25rem;
40
+ border: 0.125rem solid rgb(var(--mdui-color-outline));
41
+ background-color: rgb(var(--mdui-color-surface-container-highest));
42
+ }
43
+ :host([checked]) .track {
44
+ background-color: rgb(var(--mdui-color-primary));
45
+ border-width: 0rem;
46
+ }
47
+ .invalid .track {
48
+ background-color: rgb(var(--mdui-color-error-container));
49
+ border-color: rgb(var(--mdui-color-error));
50
+ }
51
+ :host([disabled]) .track {
52
+ background-color: rgba(var(--mdui-color-surface-container-highest), 0.12);
53
+ border-color: rgba(var(--mdui-color-on-surface), 0.12);
54
+ }
55
+ :host([disabled][checked]) .track {
56
+ background-color: rgba(var(--mdui-color-on-surface), 0.12);
57
+ }
58
+ /* 隐藏系统 input 标签,用自定义的图标代替 */
59
+ input {
60
+ position: absolute;
61
+ padding: 0;
62
+ opacity: 0;
63
+ pointer-events: none;
64
+ width: 1.25rem;
65
+ height: 1.25rem;
66
+ margin: 0rem 0rem 0rem 0.625rem;
67
+ }
68
+ mdui-ripple {
69
+ border-radius: 50%;
70
+ transition-property: left, top;
71
+ transition-duration: var(--mdui-motion-duration-short4);
72
+ transition-timing-function: var(--mdui-motion-easing-standard);
73
+ width: 2.5rem;
74
+ height: 2.5rem;
75
+ }
76
+ .thumb {
77
+ position: absolute;
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ border-radius: var(--shape-corner-thumb);
82
+ transition-property: width, height, left, background-color;
83
+ transition-duration: var(--mdui-motion-duration-short4);
84
+ transition-timing-function: var(--mdui-motion-easing-standard);
85
+ height: 1rem;
86
+ width: 1rem;
87
+ left: 0.375rem;
88
+ background-color: rgb(var(--mdui-color-outline));
89
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
90
+ }
91
+ .thumb mdui-ripple {
92
+ left: -0.75rem;
93
+ top: -0.75rem;
94
+ }
95
+ .has-unchecked-icon .thumb {
96
+ height: 1.5rem;
97
+ width: 1.5rem;
98
+ left: 0.125rem;
99
+ }
100
+ .has-unchecked-icon .thumb mdui-ripple {
101
+ left: -0.5rem;
102
+ top: -0.5rem;
103
+ }
104
+ :host([hover]) .thumb,
105
+ :host([focus-visible]) .thumb,
106
+ :host([pressed]) .thumb {
107
+ background-color: rgb(var(--mdui-color-on-surface-variant));
108
+ }
109
+ :host([checked]) .thumb {
110
+ height: 1.5rem;
111
+ width: 1.5rem;
112
+ left: 1.5rem;
113
+ background-color: rgb(var(--mdui-color-on-primary));
114
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
115
+ }
116
+ :host([checked]) .thumb mdui-ripple {
117
+ left: -0.5rem;
118
+ top: -0.5rem;
119
+ }
120
+ :host([pressed]) .thumb {
121
+ height: 1.75rem;
122
+ width: 1.75rem;
123
+ left: 0rem;
124
+ }
125
+ :host([pressed]) .thumb mdui-ripple {
126
+ left: -0.375rem;
127
+ top: -0.375rem;
128
+ }
129
+ :host([pressed][checked]) .thumb {
130
+ left: 1.375rem;
131
+ }
132
+ :host([hover][checked]) .thumb,
133
+ :host([focus-visible][checked]) .thumb,
134
+ :host([pressed][checked]) .thumb {
135
+ background-color: rgb(var(--mdui-color-primary-container));
136
+ }
137
+ .invalid .thumb {
138
+ background-color: rgb(var(--mdui-color-error));
139
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-error);
140
+ }
141
+ :host([hover]) .invalid .thumb,
142
+ :host([focus-visible]) .invalid .thumb,
143
+ :host([pressed]) .invalid .thumb {
144
+ background-color: rgb(var(--mdui-color-error));
145
+ }
146
+ :host([disabled]) .thumb {
147
+ background-color: rgba(var(--mdui-color-on-surface), 0.38);
148
+ }
149
+ :host([disabled][checked]) .thumb {
150
+ background-color: rgb(var(--mdui-color-surface));
151
+ }
152
+ .unchecked-icon,
153
+ .checked-icon {
154
+ display: flex;
155
+ position: absolute;
156
+ transition-property: opacity, transform;
157
+ font-size: 1rem;
158
+ }
159
+ .unchecked-icon {
160
+ opacity: 1;
161
+ transform: scale(1);
162
+ transition-delay: var(--mdui-motion-duration-short1);
163
+ transition-duration: var(--mdui-motion-duration-short3);
164
+ transition-timing-function: var(--mdui-motion-easing-linear);
165
+ color: rgb(var(--mdui-color-surface-container-highest));
166
+ }
167
+ :host([checked]) .unchecked-icon {
168
+ opacity: 0;
169
+ transform: scale(0.92);
170
+ transition-delay: 0ms;
171
+ transition-duration: var(--mdui-motion-duration-short1);
172
+ }
173
+ :host([disabled]) .unchecked-icon {
174
+ color: rgba(var(--mdui-color-surface-container-highest), 0.38);
175
+ }
176
+ .checked-icon {
177
+ opacity: 0;
178
+ transform: scale(0.92);
179
+ transition-delay: 0ms;
180
+ transition-duration: var(--mdui-motion-duration-short1);
181
+ transition-timing-function: var(--mdui-motion-easing-linear);
182
+ color: rgb(var(--mdui-color-on-primary-container));
183
+ }
184
+ :host([checked]) .checked-icon {
185
+ opacity: 1;
186
+ transform: scale(1);
187
+ transition-delay: var(--mdui-motion-duration-short1);
188
+ transition-duration: var(--mdui-motion-duration-short3);
189
+ }
190
+ .invalid .checked-icon {
191
+ color: rgb(var(--mdui-color-error-container));
192
+ }
193
+ :host([disabled]) .checked-icon {
194
+ color: rgba(var(--mdui-color-on-surface), 0.38);
195
+ }
196
+ .unchecked-icon .i,
197
+ .checked-icon .i,
198
+ ::slotted([slot='unchecked-icon']),
199
+ ::slotted([slot='checked-icon']) {
200
+ font-size: inherit;
201
+ color: inherit;
202
+ }
203
+ `;
@@ -1,2 +1,11 @@
1
1
  import { css } from 'lit';
2
- export const tabPanelStyle = css `:host{display:block;overflow-y:auto;flex:1 1 auto}:host(:not([active])){display:none}`;
2
+ export const tabPanelStyle = css `
3
+ :host {
4
+ display: block;
5
+ overflow-y: auto;
6
+ flex: 1 1 auto;
7
+ }
8
+ :host(:not([active])) {
9
+ display: none;
10
+ }
11
+ `;
@@ -1,2 +1,86 @@
1
1
  import { css } from 'lit';
2
- export const tabStyle = css `:host{position:relative;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}.container{display:flex;justify-content:center;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;height:100%}.preset{flex-direction:column;min-height:3rem;padding:.625rem 1rem}:host([inline]) .preset{flex-direction:row}.icon-container,.label-container{position:relative;display:flex;align-items:center;justify-content:center}.icon-container ::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}.icon-container ::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.label-container ::slotted([slot=badge]){position:absolute;left:100%;bottom:100%;transform:translate(-.75rem,.625rem)}.label-container ::slotted([slot=badge][variant=small]){transform:translate(-.375rem,.375rem)}.icon,.label{display:flex;color:rgb(var(--mdui-color-on-surface-variant))}:host([focused]) .icon,:host([focused]) .label,:host([hover]) .icon,:host([hover]) .label,:host([pressed]) .icon,:host([pressed]) .label{color:rgb(var(--mdui-color-on-surface))}:host([active]) .icon,:host([active]) .label{color:rgb(var(--mdui-color-primary))}:host([active]) .variant-secondary .icon,:host([active]) .variant-secondary .label{color:rgb(var(--mdui-color-on-surface))}.icon{font-size:1.5rem}.label{font-size:var(--mdui-typescale-title-small-size);font-weight:var(--mdui-typescale-title-small-weight);letter-spacing:var(--mdui-typescale-title-small-tracking);line-height:var(--mdui-typescale-title-small-line-height)}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit;color:inherit}`;
2
+ export const tabStyle = css `
3
+ :host {
4
+ position: relative;
5
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
6
+ }
7
+ :host([active]) {
8
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
9
+ }
10
+ .container {
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ cursor: pointer;
15
+ -webkit-user-select: none;
16
+ user-select: none;
17
+ -webkit-tap-highlight-color: transparent;
18
+ height: 100%;
19
+ }
20
+ .preset {
21
+ flex-direction: column;
22
+ min-height: 3rem;
23
+ padding: 0.625rem 1rem;
24
+ }
25
+ :host([inline]) .preset {
26
+ flex-direction: row;
27
+ }
28
+ .icon-container,
29
+ .label-container {
30
+ position: relative;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ }
35
+ .icon-container ::slotted([slot='badge']) {
36
+ position: absolute;
37
+ transform: translate(50%, -50%);
38
+ }
39
+ .icon-container ::slotted([slot='badge'][variant='small']) {
40
+ transform: translate(0.5625rem, -0.5625rem);
41
+ }
42
+ .label-container ::slotted([slot='badge']) {
43
+ position: absolute;
44
+ left: 100%;
45
+ bottom: 100%;
46
+ transform: translate(-0.75rem, 0.625rem);
47
+ }
48
+ .label-container ::slotted([slot='badge'][variant='small']) {
49
+ transform: translate(-0.375rem, 0.375rem);
50
+ }
51
+ .icon,
52
+ .label {
53
+ display: flex;
54
+ color: rgb(var(--mdui-color-on-surface-variant));
55
+ }
56
+ :host([hover]) .icon,
57
+ :host([hover]) .label,
58
+ :host([focused]) .icon,
59
+ :host([focused]) .label,
60
+ :host([pressed]) .icon,
61
+ :host([pressed]) .label {
62
+ color: rgb(var(--mdui-color-on-surface));
63
+ }
64
+ :host([active]) .icon,
65
+ :host([active]) .label {
66
+ color: rgb(var(--mdui-color-primary));
67
+ }
68
+ :host([active]) .variant-secondary .icon,
69
+ :host([active]) .variant-secondary .label {
70
+ color: rgb(var(--mdui-color-on-surface));
71
+ }
72
+ .icon {
73
+ font-size: 1.5rem;
74
+ }
75
+ .label {
76
+ font-size: var(--mdui-typescale-title-small-size);
77
+ font-weight: var(--mdui-typescale-title-small-weight);
78
+ letter-spacing: var(--mdui-typescale-title-small-tracking);
79
+ line-height: var(--mdui-typescale-title-small-line-height);
80
+ }
81
+ .icon mdui-icon,
82
+ ::slotted([slot='icon']) {
83
+ font-size: inherit;
84
+ color: inherit;
85
+ }
86
+ `;
@@ -77,13 +77,33 @@ let Tab = class Tab extends RippleMixin(FocusableMixin(MduiElement)) {
77
77
  const hasIcon = this.icon || this.hasSlotController.test('icon');
78
78
  const hasCustomSlot = this.hasSlotController.test('custom');
79
79
  const renderBadge = () => html `<slot name="badge"></slot>`;
80
- return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><div part="container" class="${classMap({
80
+ return html `<mdui-ripple
81
+ ${ref(this.rippleRef)}
82
+ .noRipple=${this.noRipple}
83
+ ></mdui-ripple>
84
+ <div
85
+ part="container"
86
+ class=${classMap({
81
87
  container: true,
82
88
  preset: !hasCustomSlot,
83
89
  'variant-secondary': this.variant === 'secondary',
84
- })}"><slot name="custom"><div class="icon-container">${when(hasIcon || this.icon, renderBadge)}<slot name="icon" part="icon" class="icon">${this.icon
85
- ? html `<mdui-icon name="${this.icon}"></mdui-icon>`
86
- : nothingTemplate}</slot></div><div class="label-container">${when(!hasIcon, renderBadge)}<slot part="label" class="label"></slot></div></slot></div>`;
90
+ })}
91
+ >
92
+ <slot name="custom">
93
+ <div class="icon-container">
94
+ ${when(hasIcon || this.icon, renderBadge)}
95
+ <slot name="icon" part="icon" class="icon">
96
+ ${this.icon
97
+ ? html `<mdui-icon name=${this.icon}></mdui-icon>`
98
+ : nothingTemplate}
99
+ </slot>
100
+ </div>
101
+ <div class="label-container">
102
+ ${when(!hasIcon, renderBadge)}
103
+ <slot part="label" class="label"></slot>
104
+ </div>
105
+ </slot>
106
+ </div>`;
87
107
  }
88
108
  };
89
109
  Tab.styles = [componentStyle, tabStyle];
@@ -1,2 +1,139 @@
1
1
  import { css } from 'lit';
2
- export const tabsStyle = css `:host{position:relative;display:flex}:host([placement^=top]){flex-direction:column}:host([placement^=bottom]){flex-direction:column-reverse}:host([placement^=left]){flex-direction:row}:host([placement^=right]){flex-direction:row-reverse}.container{position:relative;display:flex;flex:0 0 auto;overflow-x:auto;background-color:rgb(var(--mdui-color-surface))}:host([placement^=bottom]) .container,:host([placement^=top]) .container{flex-direction:row}:host([placement^=left]) .container,:host([placement^=right]) .container{flex-direction:column}:host([placement$='-start']) .container{justify-content:flex-start}:host([placement=bottom]) .container,:host([placement=left]) .container,:host([placement=right]) .container,:host([placement=top]) .container{justify-content:center}:host([placement$='-end']) .container{justify-content:flex-end}.container::after{content:' ';position:absolute;background-color:rgb(var(--mdui-color-surface-variant))}:host([placement^=bottom]) .container::after,:host([placement^=top]) .container::after{left:0;width:100%;height:.0625rem}:host([placement^=top]) .container::after{bottom:0}:host([placement^=bottom]) .container::after{top:0}:host([placement^=left]) .container::after,:host([placement^=right]) .container::after{top:0;height:100%;width:.0625rem}:host([placement^=left]) .container::after{right:0}:host([placement^=right]) .container::after{left:0}.indicator{position:absolute;z-index:1;background-color:rgb(var(--mdui-color-primary))}.container:not(.initial) .indicator{transition-duration:var(--mdui-motion-duration-medium2);transition-timing-function:var(--mdui-motion-easing-standard-decelerate)}:host([placement^=bottom]) .indicator,:host([placement^=top]) .indicator{transition-property:transform,left,width}:host([placement^=left]) .indicator,:host([placement^=right]) .indicator{transition-property:transform,top,height}:host([placement^=top]) .indicator{bottom:0}:host([placement^=bottom]) .indicator{top:0}:host([placement^=left]) .indicator{right:0}:host([placement^=right]) .indicator{left:0}:host([placement^=bottom][variant=primary]) .indicator,:host([placement^=top][variant=primary]) .indicator{height:.1875rem}:host([placement^=bottom][variant=secondary]) .indicator,:host([placement^=top][variant=secondary]) .indicator{height:.125rem}:host([placement^=left][variant=primary]) .indicator,:host([placement^=right][variant=primary]) .indicator{width:.1875rem}:host([placement^=left][variant=secondary]) .indicator,:host([placement^=right][variant=secondary]) .indicator{width:.125rem}:host([placement^=top][variant=primary]) .indicator{border-top-left-radius:.1875rem;border-top-right-radius:.1875rem}:host([placement^=bottom][variant=primary]) .indicator{border-bottom-right-radius:.1875rem;border-bottom-left-radius:.1875rem}:host([placement^=left][variant=primary]) .indicator{border-top-left-radius:.1875rem;border-bottom-left-radius:.1875rem}:host([placement^=right][variant=primary]) .indicator{border-top-right-radius:.1875rem;border-bottom-right-radius:.1875rem}:host([full-width]) ::slotted(mdui-tab){flex:1}`;
2
+ export const tabsStyle = css `
3
+ :host {
4
+ position: relative;
5
+ display: flex;
6
+ }
7
+ :host([placement^='top']) {
8
+ flex-direction: column;
9
+ }
10
+ :host([placement^='bottom']) {
11
+ flex-direction: column-reverse;
12
+ }
13
+ :host([placement^='left']) {
14
+ flex-direction: row;
15
+ }
16
+ :host([placement^='right']) {
17
+ flex-direction: row-reverse;
18
+ }
19
+ .container {
20
+ position: relative;
21
+ display: flex;
22
+ flex: 0 0 auto;
23
+ overflow-x: auto;
24
+ background-color: rgb(var(--mdui-color-surface));
25
+ }
26
+ :host([placement^='top']) .container,
27
+ :host([placement^='bottom']) .container {
28
+ flex-direction: row;
29
+ }
30
+ :host([placement^='left']) .container,
31
+ :host([placement^='right']) .container {
32
+ flex-direction: column;
33
+ }
34
+ :host([placement$='-start']) .container {
35
+ justify-content: flex-start;
36
+ }
37
+ :host([placement='top']) .container,
38
+ :host([placement='bottom']) .container,
39
+ :host([placement='left']) .container,
40
+ :host([placement='right']) .container {
41
+ justify-content: center;
42
+ }
43
+ :host([placement$='-end']) .container {
44
+ justify-content: flex-end;
45
+ }
46
+ .container::after {
47
+ content: ' ';
48
+ position: absolute;
49
+ background-color: rgb(var(--mdui-color-surface-variant));
50
+ }
51
+ :host([placement^='top']) .container::after,
52
+ :host([placement^='bottom']) .container::after {
53
+ left: 0;
54
+ width: 100%;
55
+ height: 0.0625rem;
56
+ }
57
+ :host([placement^='top']) .container::after {
58
+ bottom: 0;
59
+ }
60
+ :host([placement^='bottom']) .container::after {
61
+ top: 0;
62
+ }
63
+ :host([placement^='left']) .container::after,
64
+ :host([placement^='right']) .container::after {
65
+ top: 0;
66
+ height: 100%;
67
+ width: 0.0625rem;
68
+ }
69
+ :host([placement^='left']) .container::after {
70
+ right: 0;
71
+ }
72
+ :host([placement^='right']) .container::after {
73
+ left: 0;
74
+ }
75
+ .indicator {
76
+ position: absolute;
77
+ z-index: 1;
78
+ background-color: rgb(var(--mdui-color-primary));
79
+ }
80
+ .container:not(.initial) .indicator {
81
+ transition-duration: var(--mdui-motion-duration-medium2);
82
+ transition-timing-function: var(--mdui-motion-easing-standard-decelerate);
83
+ }
84
+ :host([placement^='top']) .indicator,
85
+ :host([placement^='bottom']) .indicator {
86
+ transition-property: transform, left, width;
87
+ }
88
+ :host([placement^='left']) .indicator,
89
+ :host([placement^='right']) .indicator {
90
+ transition-property: transform, top, height;
91
+ }
92
+ :host([placement^='top']) .indicator {
93
+ bottom: 0;
94
+ }
95
+ :host([placement^='bottom']) .indicator {
96
+ top: 0;
97
+ }
98
+ :host([placement^='left']) .indicator {
99
+ right: 0;
100
+ }
101
+ :host([placement^='right']) .indicator {
102
+ left: 0;
103
+ }
104
+ :host([placement^='top'][variant='primary']) .indicator,
105
+ :host([placement^='bottom'][variant='primary']) .indicator {
106
+ height: 0.1875rem;
107
+ }
108
+ :host([placement^='top'][variant='secondary']) .indicator,
109
+ :host([placement^='bottom'][variant='secondary']) .indicator {
110
+ height: 0.125rem;
111
+ }
112
+ :host([placement^='left'][variant='primary']) .indicator,
113
+ :host([placement^='right'][variant='primary']) .indicator {
114
+ width: 0.1875rem;
115
+ }
116
+ :host([placement^='left'][variant='secondary']) .indicator,
117
+ :host([placement^='right'][variant='secondary']) .indicator {
118
+ width: 0.125rem;
119
+ }
120
+ :host([placement^='top'][variant='primary']) .indicator {
121
+ border-top-left-radius: 0.1875rem;
122
+ border-top-right-radius: 0.1875rem;
123
+ }
124
+ :host([placement^='bottom'][variant='primary']) .indicator {
125
+ border-bottom-right-radius: 0.1875rem;
126
+ border-bottom-left-radius: 0.1875rem;
127
+ }
128
+ :host([placement^='left'][variant='primary']) .indicator {
129
+ border-top-left-radius: 0.1875rem;
130
+ border-bottom-left-radius: 0.1875rem;
131
+ }
132
+ :host([placement^='right'][variant='primary']) .indicator {
133
+ border-top-right-radius: 0.1875rem;
134
+ border-bottom-right-radius: 0.1875rem;
135
+ }
136
+ :host([full-width]) ::slotted(mdui-tab) {
137
+ flex: 1;
138
+ }
139
+ `;
@@ -107,7 +107,15 @@ let Tabs = class Tabs extends MduiElement {
107
107
  this.observeResize = observeResize(this.containerRef.value, () => this.updateIndicator());
108
108
  }
109
109
  render() {
110
- return html `<div ${ref(this.containerRef)} part="container" class="container ${classMap({ initial: this.isInitial })}"><slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot><div ${ref(this.indicatorRef)} part="indicator" class="indicator"></div></div><slot name="panel" @slotchange="${this.onSlotChange}"></slot>`;
110
+ return html `<div
111
+ ${ref(this.containerRef)}
112
+ part="container"
113
+ class="container ${classMap({ initial: this.isInitial })}"
114
+ >
115
+ <slot @slotchange=${this.onSlotChange} @click=${this.onClick}></slot>
116
+ <div ${ref(this.indicatorRef)} part="indicator" class="indicator"></div>
117
+ </div>
118
+ <slot name="panel" @slotchange=${this.onSlotChange}></slot>`;
111
119
  }
112
120
  async onSlotChange() {
113
121
  await this.definedController.whenDefined();