mdui 2.0.5 → 2.1.0

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 (249) hide show
  1. package/components/avatar/index.js +2 -7
  2. package/components/avatar/style.js +1 -31
  3. package/components/badge/style.js +1 -25
  4. package/components/bottom-app-bar/style.js +1 -92
  5. package/components/button/button-base-style.js +1 -28
  6. package/components/button/button-base.js +1 -8
  7. package/components/button/index.js +8 -18
  8. package/components/button/style.js +2 -111
  9. package/components/button-icon/index.js +5 -22
  10. package/components/button-icon/style.js +2 -103
  11. package/components/card/index.js +1 -5
  12. package/components/card/style.js +1 -72
  13. package/components/checkbox/index.js +7 -50
  14. package/components/checkbox/style.js +1 -131
  15. package/components/chip/index.js +9 -33
  16. package/components/chip/style.js +2 -205
  17. package/components/circular-progress/index.js +5 -39
  18. package/components/circular-progress/style.js +1 -136
  19. package/components/collapse/collapse-item-style.js +1 -21
  20. package/components/collapse/collapse-item.js +2 -10
  21. package/components/collapse/collapse-style.js +1 -5
  22. package/components/collapse/collapse.js +1 -4
  23. package/components/dialog/index.js +10 -35
  24. package/components/dialog/style.js +1 -116
  25. package/components/divider/style.js +1 -18
  26. package/components/dropdown/index.js +1 -8
  27. package/components/dropdown/style.js +1 -11
  28. package/components/fab/index.js +5 -13
  29. package/components/fab/style.js +4 -153
  30. package/components/icon/index.js +1 -5
  31. package/components/icon/style.js +1 -29
  32. package/components/layout/layout-item-style.js +1 -6
  33. package/components/layout/layout-main-style.js +1 -7
  34. package/components/layout/layout-style.js +1 -11
  35. package/components/linear-progress/index.js +2 -6
  36. package/components/linear-progress/style.js +1 -73
  37. package/components/list/list-item-style.js +2 -153
  38. package/components/list/list-item.js +8 -27
  39. package/components/list/list-style.js +1 -10
  40. package/components/list/list-subheader-style.js +1 -19
  41. package/components/menu/menu-item-style.js +1 -125
  42. package/components/menu/menu-item.js +13 -55
  43. package/components/menu/menu-style.js +1 -19
  44. package/components/menu/menu.js +1 -5
  45. package/components/navigation-bar/navigation-bar-item-style.js +1 -132
  46. package/components/navigation-bar/navigation-bar-item.js +7 -23
  47. package/components/navigation-bar/navigation-bar-style.js +1 -28
  48. package/components/navigation-bar/navigation-bar.js +1 -4
  49. package/components/navigation-drawer/index.js +1 -12
  50. package/components/navigation-drawer/style.js +1 -66
  51. package/components/navigation-rail/navigation-rail-item-style.js +1 -122
  52. package/components/navigation-rail/navigation-rail-item.js +7 -26
  53. package/components/navigation-rail/navigation-rail-style.js +1 -79
  54. package/components/navigation-rail/navigation-rail.js +1 -10
  55. package/components/radio/radio-group-style.js +1 -20
  56. package/components/radio/radio-group.js +1 -19
  57. package/components/radio/radio-style.js +1 -107
  58. package/components/radio/radio.js +5 -23
  59. package/components/range-slider/index.d.ts +1 -1
  60. package/components/range-slider/index.js +5 -53
  61. package/components/ripple/index.js +2 -5
  62. package/components/ripple/style.js +1 -96
  63. package/components/segmented-button/segmented-button-group-style.js +1 -28
  64. package/components/segmented-button/segmented-button-group.js +1 -21
  65. package/components/segmented-button/segmented-button-style.js +2 -81
  66. package/components/segmented-button/segmented-button.js +11 -27
  67. package/components/select/index.d.ts +18 -0
  68. package/components/select/index.js +42 -87
  69. package/components/select/style.js +1 -27
  70. package/components/slider/index.js +2 -33
  71. package/components/slider/slider-base-style.js +1 -173
  72. package/components/slider/slider-base.js +1 -6
  73. package/components/slider/style.js +1 -7
  74. package/components/snackbar/index.js +5 -32
  75. package/components/snackbar/style.js +1 -100
  76. package/components/switch/index.js +6 -40
  77. package/components/switch/style.js +1 -202
  78. package/components/tabs/tab-panel-style.js +1 -10
  79. package/components/tabs/tab-style.js +1 -85
  80. package/components/tabs/tab.js +4 -24
  81. package/components/tabs/tabs-style.js +1 -138
  82. package/components/tabs/tabs.js +1 -9
  83. package/components/text-field/index.d.ts +2 -0
  84. package/components/text-field/index.js +58 -163
  85. package/components/text-field/style.js +1 -362
  86. package/components/tooltip/index.js +1 -10
  87. package/components/tooltip/style.js +1 -57
  88. package/components/top-app-bar/top-app-bar-style.js +1 -78
  89. package/components/top-app-bar/top-app-bar-title-style.js +1 -81
  90. package/components/top-app-bar/top-app-bar-title.js +3 -17
  91. package/custom-elements.json +1194 -1099
  92. package/functions/alert.d.ts +2 -0
  93. package/functions/alert.js +19 -4
  94. package/functions/confirm.d.ts +4 -0
  95. package/functions/confirm.js +33 -6
  96. package/functions/getLocale.d.ts +6 -0
  97. package/functions/getLocale.js +11 -0
  98. package/functions/getTheme.d.ts +1 -1
  99. package/functions/loadLocale.d.ts +6 -0
  100. package/functions/loadLocale.js +8 -0
  101. package/functions/prompt.d.ts +4 -0
  102. package/functions/prompt.js +35 -8
  103. package/functions/removeColorScheme.js +1 -1
  104. package/functions/setColorScheme.d.ts +1 -1
  105. package/functions/setColorScheme.js +1 -1
  106. package/functions/setLocale.d.ts +6 -0
  107. package/functions/setLocale.js +11 -0
  108. package/functions/setTheme.d.ts +1 -1
  109. package/internal/localeCodes.d.ts +13 -0
  110. package/internal/localeCodes.js +144 -0
  111. package/internal/localize.d.ts +32 -0
  112. package/internal/localize.js +55 -0
  113. package/locales/ar-eg.d.ts +8 -0
  114. package/locales/ar-eg.js +12 -0
  115. package/locales/az-az.d.ts +8 -0
  116. package/locales/az-az.js +12 -0
  117. package/locales/be-by.d.ts +8 -0
  118. package/locales/be-by.js +12 -0
  119. package/locales/bg-bg.d.ts +8 -0
  120. package/locales/bg-bg.js +12 -0
  121. package/locales/bn-bd.d.ts +8 -0
  122. package/locales/bn-bd.js +12 -0
  123. package/locales/ca-es.d.ts +8 -0
  124. package/locales/ca-es.js +12 -0
  125. package/locales/cs-cz.d.ts +8 -0
  126. package/locales/cs-cz.js +12 -0
  127. package/locales/da-dk.d.ts +8 -0
  128. package/locales/da-dk.js +12 -0
  129. package/locales/de-de.d.ts +8 -0
  130. package/locales/de-de.js +12 -0
  131. package/locales/el-gr.d.ts +8 -0
  132. package/locales/el-gr.js +12 -0
  133. package/locales/en-gb.d.ts +8 -0
  134. package/locales/en-gb.js +12 -0
  135. package/locales/es-es.d.ts +8 -0
  136. package/locales/es-es.js +12 -0
  137. package/locales/et-ee.d.ts +8 -0
  138. package/locales/et-ee.js +12 -0
  139. package/locales/fa-ir.d.ts +8 -0
  140. package/locales/fa-ir.js +12 -0
  141. package/locales/fi-fi.d.ts +8 -0
  142. package/locales/fi-fi.js +12 -0
  143. package/locales/fr-be.d.ts +8 -0
  144. package/locales/fr-be.js +12 -0
  145. package/locales/fr-ca.d.ts +8 -0
  146. package/locales/fr-ca.js +12 -0
  147. package/locales/fr-fr.d.ts +8 -0
  148. package/locales/fr-fr.js +12 -0
  149. package/locales/ga-ie.d.ts +8 -0
  150. package/locales/ga-ie.js +12 -0
  151. package/locales/gl-es.d.ts +8 -0
  152. package/locales/gl-es.js +12 -0
  153. package/locales/he-il.d.ts +8 -0
  154. package/locales/he-il.js +12 -0
  155. package/locales/hi-in.d.ts +8 -0
  156. package/locales/hi-in.js +12 -0
  157. package/locales/hr-hr.d.ts +8 -0
  158. package/locales/hr-hr.js +12 -0
  159. package/locales/hu-hu.d.ts +8 -0
  160. package/locales/hu-hu.js +12 -0
  161. package/locales/hy-am.d.ts +8 -0
  162. package/locales/hy-am.js +12 -0
  163. package/locales/id-id.d.ts +8 -0
  164. package/locales/id-id.js +12 -0
  165. package/locales/is-is.d.ts +8 -0
  166. package/locales/is-is.js +12 -0
  167. package/locales/it-it.d.ts +8 -0
  168. package/locales/it-it.js +12 -0
  169. package/locales/ja-jp.d.ts +8 -0
  170. package/locales/ja-jp.js +12 -0
  171. package/locales/ka-ge.d.ts +8 -0
  172. package/locales/ka-ge.js +12 -0
  173. package/locales/kk-kz.d.ts +8 -0
  174. package/locales/kk-kz.js +12 -0
  175. package/locales/km-kh.d.ts +8 -0
  176. package/locales/km-kh.js +12 -0
  177. package/locales/kmr-iq.d.ts +8 -0
  178. package/locales/kmr-iq.js +12 -0
  179. package/locales/kn-in.d.ts +8 -0
  180. package/locales/kn-in.js +12 -0
  181. package/locales/ko-kr.d.ts +8 -0
  182. package/locales/ko-kr.js +12 -0
  183. package/locales/lt-lt.d.ts +8 -0
  184. package/locales/lt-lt.js +12 -0
  185. package/locales/lv-lv.d.ts +8 -0
  186. package/locales/lv-lv.js +12 -0
  187. package/locales/mk-mk.d.ts +8 -0
  188. package/locales/mk-mk.js +12 -0
  189. package/locales/ml-in.d.ts +8 -0
  190. package/locales/ml-in.js +12 -0
  191. package/locales/mn-mn.d.ts +8 -0
  192. package/locales/mn-mn.js +12 -0
  193. package/locales/ms-my.d.ts +8 -0
  194. package/locales/ms-my.js +12 -0
  195. package/locales/nb-no.d.ts +8 -0
  196. package/locales/nb-no.js +12 -0
  197. package/locales/ne-np.d.ts +8 -0
  198. package/locales/ne-np.js +12 -0
  199. package/locales/nl-be.d.ts +8 -0
  200. package/locales/nl-be.js +12 -0
  201. package/locales/nl-nl.d.ts +8 -0
  202. package/locales/nl-nl.js +12 -0
  203. package/locales/pl-pl.d.ts +8 -0
  204. package/locales/pl-pl.js +12 -0
  205. package/locales/pt-br.d.ts +8 -0
  206. package/locales/pt-br.js +12 -0
  207. package/locales/pt-pt.d.ts +8 -0
  208. package/locales/pt-pt.js +12 -0
  209. package/locales/ro-ro.d.ts +8 -0
  210. package/locales/ro-ro.js +12 -0
  211. package/locales/ru-ru.d.ts +8 -0
  212. package/locales/ru-ru.js +12 -0
  213. package/locales/sk-sk.d.ts +8 -0
  214. package/locales/sk-sk.js +12 -0
  215. package/locales/sl-si.d.ts +8 -0
  216. package/locales/sl-si.js +12 -0
  217. package/locales/sr-rs.d.ts +8 -0
  218. package/locales/sr-rs.js +12 -0
  219. package/locales/sv-se.d.ts +8 -0
  220. package/locales/sv-se.js +12 -0
  221. package/locales/ta-in.d.ts +8 -0
  222. package/locales/ta-in.js +12 -0
  223. package/locales/th-th.d.ts +8 -0
  224. package/locales/th-th.js +12 -0
  225. package/locales/tr-tr.d.ts +8 -0
  226. package/locales/tr-tr.js +12 -0
  227. package/locales/uk-ua.d.ts +8 -0
  228. package/locales/uk-ua.js +12 -0
  229. package/locales/ur-pk.d.ts +8 -0
  230. package/locales/ur-pk.js +12 -0
  231. package/locales/vi-vn.d.ts +8 -0
  232. package/locales/vi-vn.js +12 -0
  233. package/locales/zh-cn.d.ts +8 -0
  234. package/locales/zh-cn.js +12 -0
  235. package/locales/zh-hk.d.ts +8 -0
  236. package/locales/zh-hk.js +12 -0
  237. package/locales/zh-tw.d.ts +8 -0
  238. package/locales/zh-tw.js +12 -0
  239. package/mdui.d.ts +5 -0
  240. package/mdui.esm.js +22 -0
  241. package/mdui.global.js +22 -0
  242. package/mdui.js +3 -0
  243. package/package.json +9 -6
  244. package/web-types.en.json +91 -1
  245. package/web-types.zh-cn.json +91 -1
  246. /package/{functions/utils → internal}/colorScheme.d.ts +0 -0
  247. /package/{functions/utils → internal}/colorScheme.js +0 -0
  248. /package/{functions/utils → internal}/theme.d.ts +0 -0
  249. /package/{functions/utils → internal}/theme.js +0 -0
@@ -1,203 +1,2 @@
1
1
  import { css } from 'lit';
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
- `;
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}`;
@@ -1,11 +1,2 @@
1
1
  import { css } from 'lit';
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
- `;
2
+ export const tabPanelStyle = css `:host{display:block;overflow-y:auto;flex:1 1 auto}:host(:not([active])){display:none}`;
@@ -1,86 +1,2 @@
1
1
  import { css } from 'lit';
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
- `;
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}`;
@@ -77,33 +77,13 @@ 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
81
- ${ref(this.rippleRef)}
82
- .noRipple=${this.noRipple}
83
- ></mdui-ripple>
84
- <div
85
- part="container"
86
- class=${classMap({
80
+ return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><div part="container" class="${classMap({
87
81
  container: true,
88
82
  preset: !hasCustomSlot,
89
83
  'variant-secondary': this.variant === 'secondary',
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>`;
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>`;
107
87
  }
108
88
  };
109
89
  Tab.styles = [componentStyle, tabStyle];
@@ -1,139 +1,2 @@
1
1
  import { css } from 'lit';
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
- `;
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}`;
@@ -107,15 +107,7 @@ 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
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>`;
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>`;
119
111
  }
120
112
  async onSlotChange() {
121
113
  await this.definedController.whenDefined();
@@ -367,6 +367,7 @@ export declare class TextField extends TextField_base<TextFieldEventMap> impleme
367
367
  setCustomValidity(message: string): void;
368
368
  protected firstUpdated(_changedProperties: PropertyValues): void;
369
369
  protected render(): TemplateResult;
370
+ private setCustomValidityInternal;
370
371
  private onChange;
371
372
  private onClear;
372
373
  private onInput;
@@ -377,6 +378,7 @@ export declare class TextField extends TextField_base<TextFieldEventMap> impleme
377
378
  */
378
379
  private onTextAreaKeyUp;
379
380
  private onTogglePassword;
381
+ private getPatternErrorMsg;
380
382
  private setTextareaHeight;
381
383
  private renderLabel;
382
384
  private renderPrefix;