@varlet/ui 1.26.8 → 1.27.0-alpha.1649242923701

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 (245) hide show
  1. package/es/action-sheet/ActionSheet.js +29 -27
  2. package/es/app-bar/AppBar.js +32 -27
  3. package/es/back-top/BackTop.js +9 -2
  4. package/es/badge/Badge.js +22 -14
  5. package/es/bottom-navigation/BottomNavigation.js +167 -0
  6. package/es/bottom-navigation/BottomNavigationSfc.css +0 -0
  7. package/es/bottom-navigation/BottomNavigationSfc.less +0 -0
  8. package/es/bottom-navigation/bottomNavigation.css +1 -0
  9. package/es/bottom-navigation/bottomNavigation.less +49 -0
  10. package/es/bottom-navigation/index.js +8 -0
  11. package/es/bottom-navigation/props.js +40 -0
  12. package/es/bottom-navigation/provide.js +17 -0
  13. package/es/bottom-navigation/style/index.js +4 -0
  14. package/es/bottom-navigation/style/less.js +4 -0
  15. package/es/bottom-navigation-item/BottomNavigationItem.js +122 -0
  16. package/es/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  17. package/es/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  18. package/es/bottom-navigation-item/bottomNavigationItem.css +1 -0
  19. package/es/bottom-navigation-item/bottomNavigationItem.less +78 -0
  20. package/es/bottom-navigation-item/index.js +8 -0
  21. package/es/bottom-navigation-item/props.js +22 -0
  22. package/es/bottom-navigation-item/provide.js +21 -0
  23. package/es/bottom-navigation-item/style/index.js +6 -0
  24. package/es/bottom-navigation-item/style/less.js +6 -0
  25. package/es/button/Button.js +12 -5
  26. package/es/card/Card.js +33 -28
  27. package/es/cell/Cell.js +26 -15
  28. package/es/checkbox/Checkbox.js +28 -26
  29. package/es/checkbox-group/CheckboxGroup.js +21 -25
  30. package/es/chip/Chip.js +16 -7
  31. package/es/chip/chip.css +1 -1
  32. package/es/chip/chip.less +11 -11
  33. package/es/col/Col.js +12 -5
  34. package/es/collapse/Collapse.js +15 -12
  35. package/es/collapse-item/CollapseItem.js +31 -30
  36. package/es/collapse-item/collapseItem.css +1 -1
  37. package/es/collapse-item/collapseItem.less +16 -16
  38. package/es/countdown/Countdown.js +14 -11
  39. package/es/counter/Counter.js +30 -27
  40. package/es/date-picker/DatePicker.js +28 -23
  41. package/es/date-picker/date-picker.css +1 -1
  42. package/es/date-picker/date-picker.less +22 -20
  43. package/es/date-picker/src/day-picker-panel.js +41 -34
  44. package/es/date-picker/src/month-picker-panel.js +27 -21
  45. package/es/date-picker/src/panel-header.js +16 -11
  46. package/es/date-picker/src/year-picker-panel.js +17 -9
  47. package/es/dialog/Dialog.js +36 -40
  48. package/es/divider/Divider.js +16 -12
  49. package/es/form/Form.js +11 -8
  50. package/es/form-details/FormDetails.js +27 -22
  51. package/es/icon/Icon.js +8 -1
  52. package/es/icon/icon.css +1 -1
  53. package/es/image/Image.js +19 -12
  54. package/es/image-preview/ImagePreview.js +35 -34
  55. package/es/index-anchor/IndexAnchor.js +8 -1
  56. package/es/index-bar/IndexBar.js +22 -20
  57. package/es/index.js +10 -0
  58. package/es/input/Input.js +45 -44
  59. package/es/lazy/index.js +2 -1
  60. package/es/less.js +2 -0
  61. package/es/list/List.js +39 -38
  62. package/es/loading/Loading.js +31 -23
  63. package/es/loading/loading.css +1 -1
  64. package/es/loading/loading.less +32 -32
  65. package/es/menu/Menu.js +12 -10
  66. package/es/option/Option.js +16 -11
  67. package/es/pagination/Pagination.js +34 -44
  68. package/es/pagination/pagination.css +1 -1
  69. package/es/pagination/pagination.less +8 -8
  70. package/es/picker/Picker.js +51 -47
  71. package/es/popup/Popup.js +9 -5
  72. package/es/progress/Progress.js +44 -35
  73. package/es/progress/progress.css +1 -1
  74. package/es/progress/progress.less +12 -12
  75. package/es/pull-refresh/PullRefresh.js +13 -10
  76. package/es/radio/Radio.js +25 -25
  77. package/es/radio-group/RadioGroup.js +19 -19
  78. package/es/rate/Rate.js +27 -25
  79. package/es/ripple/index.js +6 -2
  80. package/es/row/Row.js +11 -4
  81. package/es/select/Select.js +53 -54
  82. package/es/skeleton/Skeleton.js +70 -81
  83. package/es/slider/Slider.js +44 -40
  84. package/es/slider/slider.css +1 -1
  85. package/es/slider/slider.less +5 -5
  86. package/es/snackbar/Snackbar.js +9 -5
  87. package/es/snackbar/core.js +20 -26
  88. package/es/snackbar/snackbar.css +1 -1
  89. package/es/snackbar/snackbar.less +66 -68
  90. package/es/space/Space.js +8 -3
  91. package/es/step/Step.js +25 -23
  92. package/es/step/step.css +1 -1
  93. package/es/step/step.less +10 -10
  94. package/es/steps/Steps.js +12 -5
  95. package/es/sticky/Sticky.js +14 -7
  96. package/es/style-provider/StyleProvider.js +6 -2
  97. package/es/style.css +1 -1
  98. package/es/style.js +2 -0
  99. package/es/swipe/Swipe.js +22 -16
  100. package/es/swipe-item/SwipeItem.js +9 -4
  101. package/es/switch/Switch.js +25 -23
  102. package/es/switch/switch.css +1 -1
  103. package/es/switch/switch.less +2 -2
  104. package/es/tab/Tab.js +8 -1
  105. package/es/tab-item/TabItem.js +8 -1
  106. package/es/table/Table.js +27 -20
  107. package/es/tabs/Tabs.js +16 -11
  108. package/es/tabs-items/TabsItems.js +10 -5
  109. package/es/themes/dark/bottomNavigation.js +4 -0
  110. package/es/themes/dark/bottomNavigationItem.js +3 -0
  111. package/es/themes/dark/index.js +3 -1
  112. package/es/time-picker/TimePicker.js +47 -38
  113. package/es/time-picker/clock.js +26 -22
  114. package/es/time-picker/timePicker.css +1 -1
  115. package/es/time-picker/timePicker.less +11 -11
  116. package/es/umdIndex.js +10 -0
  117. package/es/uploader/Uploader.js +62 -57
  118. package/es/utils/components.js +35 -0
  119. package/es/varlet.esm.js +2082 -1527
  120. package/highlight/attributes.json +48 -0
  121. package/highlight/tags.json +20 -0
  122. package/highlight/web-types.json +155 -1
  123. package/lib/action-sheet/ActionSheet.js +30 -26
  124. package/lib/app-bar/AppBar.js +31 -24
  125. package/lib/back-top/BackTop.js +11 -2
  126. package/lib/badge/Badge.js +23 -13
  127. package/lib/bottom-navigation/BottomNavigation.js +183 -0
  128. package/lib/bottom-navigation/BottomNavigationSfc.css +0 -0
  129. package/lib/bottom-navigation/BottomNavigationSfc.less +0 -0
  130. package/lib/bottom-navigation/bottomNavigation.css +1 -0
  131. package/lib/bottom-navigation/bottomNavigation.less +49 -0
  132. package/lib/bottom-navigation/index.js +17 -0
  133. package/lib/bottom-navigation/props.js +45 -0
  134. package/lib/bottom-navigation/provide.js +27 -0
  135. package/lib/bottom-navigation/style/index.js +4 -0
  136. package/lib/bottom-navigation/style/less.js +4 -0
  137. package/lib/bottom-navigation-item/BottomNavigationItem.js +140 -0
  138. package/lib/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  139. package/lib/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  140. package/lib/bottom-navigation-item/bottomNavigationItem.css +1 -0
  141. package/lib/bottom-navigation-item/bottomNavigationItem.less +78 -0
  142. package/lib/bottom-navigation-item/index.js +17 -0
  143. package/lib/bottom-navigation-item/props.js +27 -0
  144. package/lib/bottom-navigation-item/provide.js +28 -0
  145. package/lib/bottom-navigation-item/style/index.js +6 -0
  146. package/lib/bottom-navigation-item/style/less.js +6 -0
  147. package/lib/button/Button.js +13 -4
  148. package/lib/card/Card.js +34 -27
  149. package/lib/cell/Cell.js +26 -13
  150. package/lib/checkbox/Checkbox.js +26 -23
  151. package/lib/checkbox-group/CheckboxGroup.js +19 -22
  152. package/lib/chip/Chip.js +18 -7
  153. package/lib/chip/chip.css +1 -1
  154. package/lib/chip/chip.less +11 -11
  155. package/lib/col/Col.js +14 -5
  156. package/lib/collapse/Collapse.js +15 -10
  157. package/lib/collapse-item/CollapseItem.js +31 -28
  158. package/lib/collapse-item/collapseItem.css +1 -1
  159. package/lib/collapse-item/collapseItem.less +16 -16
  160. package/lib/countdown/Countdown.js +14 -10
  161. package/lib/counter/Counter.js +29 -26
  162. package/lib/date-picker/DatePicker.js +30 -23
  163. package/lib/date-picker/date-picker.css +1 -1
  164. package/lib/date-picker/date-picker.less +22 -20
  165. package/lib/date-picker/src/day-picker-panel.js +41 -32
  166. package/lib/date-picker/src/month-picker-panel.js +27 -19
  167. package/lib/date-picker/src/panel-header.js +16 -9
  168. package/lib/date-picker/src/year-picker-panel.js +19 -9
  169. package/lib/dialog/Dialog.js +36 -38
  170. package/lib/divider/Divider.js +16 -10
  171. package/lib/form/Form.js +11 -6
  172. package/lib/form-details/FormDetails.js +27 -20
  173. package/lib/icon/Icon.js +10 -1
  174. package/lib/icon/icon.css +1 -1
  175. package/lib/image/Image.js +20 -11
  176. package/lib/image-preview/ImagePreview.js +35 -33
  177. package/lib/index-anchor/IndexAnchor.js +10 -1
  178. package/lib/index-bar/IndexBar.js +24 -20
  179. package/lib/index.js +6 -0
  180. package/lib/input/Input.js +45 -43
  181. package/lib/lazy/index.js +3 -1
  182. package/lib/less.js +2 -0
  183. package/lib/list/List.js +39 -36
  184. package/lib/loading/Loading.js +33 -23
  185. package/lib/loading/loading.css +1 -1
  186. package/lib/loading/loading.less +32 -32
  187. package/lib/menu/Menu.js +12 -9
  188. package/lib/option/Option.js +16 -9
  189. package/lib/pagination/Pagination.js +36 -44
  190. package/lib/pagination/pagination.css +1 -1
  191. package/lib/pagination/pagination.less +8 -8
  192. package/lib/picker/Picker.js +51 -46
  193. package/lib/popup/Popup.js +9 -4
  194. package/lib/progress/Progress.js +45 -34
  195. package/lib/progress/progress.css +1 -1
  196. package/lib/progress/progress.less +12 -12
  197. package/lib/pull-refresh/PullRefresh.js +14 -10
  198. package/lib/radio/Radio.js +23 -22
  199. package/lib/radio-group/RadioGroup.js +17 -16
  200. package/lib/rate/Rate.js +27 -24
  201. package/lib/ripple/index.js +7 -2
  202. package/lib/row/Row.js +12 -3
  203. package/lib/select/Select.js +53 -53
  204. package/lib/skeleton/Skeleton.js +69 -78
  205. package/lib/slider/Slider.js +42 -38
  206. package/lib/slider/slider.css +1 -1
  207. package/lib/slider/slider.less +5 -5
  208. package/lib/snackbar/Snackbar.js +9 -4
  209. package/lib/snackbar/core.js +20 -25
  210. package/lib/snackbar/snackbar.css +1 -1
  211. package/lib/snackbar/snackbar.less +66 -68
  212. package/lib/space/Space.js +9 -3
  213. package/lib/step/Step.js +26 -22
  214. package/lib/step/step.css +1 -1
  215. package/lib/step/step.less +10 -10
  216. package/lib/steps/Steps.js +13 -4
  217. package/lib/sticky/Sticky.js +15 -6
  218. package/lib/style-provider/StyleProvider.js +8 -2
  219. package/lib/style.css +1 -1
  220. package/lib/style.js +2 -0
  221. package/lib/swipe/Swipe.js +23 -16
  222. package/lib/swipe-item/SwipeItem.js +10 -3
  223. package/lib/switch/Switch.js +23 -20
  224. package/lib/switch/switch.css +1 -1
  225. package/lib/switch/switch.less +2 -2
  226. package/lib/tab/Tab.js +10 -1
  227. package/lib/tab-item/TabItem.js +10 -1
  228. package/lib/table/Table.js +27 -18
  229. package/lib/tabs/Tabs.js +18 -11
  230. package/lib/tabs-items/TabsItems.js +11 -4
  231. package/lib/themes/dark/bottomNavigation.js +9 -0
  232. package/lib/themes/dark/bottomNavigationItem.js +8 -0
  233. package/lib/themes/dark/index.js +5 -1
  234. package/lib/time-picker/TimePicker.js +49 -38
  235. package/lib/time-picker/clock.js +26 -20
  236. package/lib/time-picker/timePicker.css +1 -1
  237. package/lib/time-picker/timePicker.less +11 -11
  238. package/lib/uploader/Uploader.js +60 -55
  239. package/lib/utils/components.js +39 -0
  240. package/package.json +4 -4
  241. package/types/bottomNavigation.d.ts +19 -0
  242. package/types/bottomNavigationItem.d.ts +16 -0
  243. package/types/global.d.ts +2 -0
  244. package/types/index.d.ts +2 -0
  245. package/umd/varlet.js +4 -4
@@ -124,22 +124,22 @@
124
124
  align-items: center;
125
125
  justify-content: center;
126
126
 
127
- &-large {
127
+ &--large {
128
128
  width: @loading-large-width;
129
129
  height: @loading-large-height;
130
130
  }
131
131
 
132
- &-normal {
132
+ &--normal {
133
133
  width: @loading-normal-width;
134
134
  height: @loading-normal-height;
135
135
  }
136
136
 
137
- &-small {
137
+ &--small {
138
138
  width: @loading-small-width;
139
139
  height: @loading-small-height;
140
140
  }
141
141
 
142
- &-mini {
142
+ &--mini {
143
143
  width: @loading-mini-width;
144
144
  height: @loading-mini-height;
145
145
  }
@@ -171,22 +171,22 @@
171
171
  }
172
172
  }
173
173
 
174
- &-item-large {
174
+ &-item--large {
175
175
  width: @loading-wave-size-item-width;
176
176
  margin-left: @loading-wave-size-item-margin;
177
177
  }
178
178
 
179
- &-item-normal {
179
+ &-item--normal {
180
180
  width: @loading-wave-size-item-width - 1;
181
181
  margin-left: @loading-wave-size-item-margin - 1;
182
182
  }
183
183
 
184
- &-item-small {
184
+ &-item--small {
185
185
  width: @loading-wave-size-item-width - 2;
186
186
  margin-left: @loading-wave-size-item-margin - 2;
187
187
  }
188
188
 
189
- &-item-mini {
189
+ &-item--mini {
190
190
  width: @loading-wave-size-item-width - 3;
191
191
  margin-left: @loading-wave-size-item-margin - 3;
192
192
  }
@@ -211,22 +211,22 @@
211
211
  display: flex;
212
212
  align-items: center;
213
213
 
214
- &-large {
214
+ &--large {
215
215
  width: @loading-large-width;
216
216
  height: @loading-large-height;
217
217
  }
218
218
 
219
- &-normal {
219
+ &--normal {
220
220
  width: @loading-normal-width;
221
221
  height: @loading-normal-height;
222
222
  }
223
223
 
224
- &-small {
224
+ &--small {
225
225
  width: @loading-small-width;
226
226
  height: @loading-small-height;
227
227
  }
228
228
 
229
- &-mini {
229
+ &--mini {
230
230
  width: @loading-mini-width;
231
231
  height: @loading-mini-height;
232
232
  }
@@ -254,25 +254,25 @@
254
254
  }
255
255
  }
256
256
 
257
- &-item-large {
257
+ &-item--large {
258
258
  height: @loading-cube-size-item-height;
259
259
  width: @loading-cube-size-item-width;
260
260
  margin-left: @loading-cube-size-item-margin;
261
261
  }
262
262
 
263
- &-item-normal {
263
+ &-item--normal {
264
264
  height: @loading-cube-size-item-height - 2;
265
265
  width: @loading-cube-size-item-width - 2;
266
266
  margin-left: @loading-cube-size-item-margin - 1;
267
267
  }
268
268
 
269
- &-item-small {
269
+ &-item--small {
270
270
  height: @loading-cube-size-item-height - 4;
271
271
  width: @loading-cube-size-item-width - 4;
272
272
  margin-left: @loading-cube-size-item-margin - 2;
273
273
  }
274
274
 
275
- &-item-mini {
275
+ &-item--mini {
276
276
  height: @loading-cube-size-item-height - 6;
277
277
  width: @loading-cube-size-item-width - 6;
278
278
  margin-left: @loading-cube-size-item-margin - 3;
@@ -299,22 +299,22 @@
299
299
  justify-content: center;
300
300
  align-items: center;
301
301
 
302
- &-large {
302
+ &--large {
303
303
  width: @loading-large-width;
304
304
  height: @loading-large-height;
305
305
  }
306
306
 
307
- &-normal {
307
+ &--normal {
308
308
  width: @loading-normal-width;
309
309
  height: @loading-normal-height;
310
310
  }
311
311
 
312
- &-small {
312
+ &--small {
313
313
  width: @loading-small-width;
314
314
  height: @loading-small-height;
315
315
  }
316
316
 
317
- &-mini {
317
+ &--mini {
318
318
  width: @loading-mini-width;
319
319
  height: @loading-mini-height;
320
320
  }
@@ -355,22 +355,22 @@
355
355
  }
356
356
  }
357
357
 
358
- &-item-large {
358
+ &-item--large {
359
359
  height: @loading-rect-size-item-height;
360
360
  width: @loading-rect-size-item-width;
361
361
  }
362
362
 
363
- &-item-normal {
363
+ &-item--normal {
364
364
  height: @loading-rect-size-item-height * 0.9;
365
365
  width: @loading-rect-size-item-width * 0.8;
366
366
  }
367
367
 
368
- &-item-small {
368
+ &-item--small {
369
369
  height: @loading-rect-size-item-height * 0.8;
370
370
  width: @loading-rect-size-item-width * 0.6;
371
371
  }
372
372
 
373
- &-item-mini {
373
+ &-item--mini {
374
374
  height: @loading-rect-size-item-height * 0.7;
375
375
  width: @loading-rect-size-item-width * 0.4;
376
376
  }
@@ -403,22 +403,22 @@
403
403
  align-items: center;
404
404
  flex-flow: nowrap;
405
405
 
406
- &-large {
406
+ &--large {
407
407
  width: @loading-large-width;
408
408
  height: @loading-large-height;
409
409
  }
410
410
 
411
- &-normal {
411
+ &--normal {
412
412
  width: @loading-normal-width;
413
413
  height: @loading-normal-height;
414
414
  }
415
415
 
416
- &-small {
416
+ &--small {
417
417
  width: @loading-small-width;
418
418
  height: @loading-small-height;
419
419
  }
420
420
 
421
- &-mini {
421
+ &--mini {
422
422
  width: @loading-mini-width;
423
423
  height: @loading-mini-height;
424
424
  }
@@ -440,22 +440,22 @@
440
440
  }
441
441
  }
442
442
 
443
- &-item-large {
443
+ &-item--large {
444
444
  height: @loading-disappear-size-item-height;
445
445
  width: @loading-disappear-size-item-width;
446
446
  }
447
447
 
448
- &-item-normal {
448
+ &-item--normal {
449
449
  height: @loading-disappear-size-item-height * 0.8;
450
450
  width: @loading-disappear-size-item-width * 0.8;
451
451
  }
452
452
 
453
- &-item-small {
453
+ &-item--small {
454
454
  height: @loading-disappear-size-item-height * 0.6;
455
455
  width: @loading-disappear-size-item-width * 0.6;
456
456
  }
457
457
 
458
- &-item-mini {
458
+ &-item--mini {
459
459
  height: @loading-disappear-size-item-height * 0.4;
460
460
  width: @loading-disappear-size-item-width * 0.4;
461
461
  }
package/es/menu/Menu.js CHANGED
@@ -8,7 +8,7 @@ import { defineComponent, ref, computed, watch, onMounted, onUnmounted, Transiti
8
8
  import { props } from './props';
9
9
  import { getLeft, getTop, toSizeUnit } from '../utils/elements';
10
10
  import { useZIndex } from '../context/zIndex';
11
- import { exposeApis, useTeleport } from '../utils/components';
11
+ import { call, createNamespace, exposeApis, useTeleport } from '../utils/components';
12
12
 
13
13
 
14
14
 
@@ -17,6 +17,10 @@ function _isSlot(s) {
17
17
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
18
18
  }
19
19
 
20
+ var {
21
+ n,
22
+ classes
23
+ } = createNamespace('menu');
20
24
  export default defineComponent({
21
25
  name: 'VarMenu',
22
26
  props,
@@ -47,8 +51,6 @@ export default defineComponent({
47
51
  };
48
52
 
49
53
  var handleMenuClose = () => {
50
- var _props$onUpdateShow;
51
-
52
54
  if (clickSelf) {
53
55
  clickSelf = false;
54
56
  return;
@@ -58,7 +60,7 @@ export default defineComponent({
58
60
  return;
59
61
  }
60
62
 
61
- (_props$onUpdateShow = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow.call(props, false);
63
+ call(props['onUpdate:show'], false);
62
64
  }; // expose
63
65
 
64
66
 
@@ -77,18 +79,18 @@ export default defineComponent({
77
79
  });
78
80
 
79
81
  var renderTransition = () => _createVNode(Transition, {
80
- "name": "var-menu",
82
+ "name": n(),
81
83
  "onAfterEnter": props.onOpened,
82
84
  "onAfterLeave": props.onClosed
83
85
  }, {
84
86
  default: () => [_withDirectives(_createVNode("div", {
85
- "class": "var-menu__menu var-elevation--3",
87
+ "class": classes(n('menu'), 'var-elevation--3'),
86
88
  "ref": menu,
87
89
  "style": transitionStyle.value,
88
90
  "onClick": event => {
89
91
  event.stopPropagation();
90
92
  }
91
- }, [slots.menu == null ? void 0 : slots.menu()]), [[_vShow, props.show]])]
93
+ }, [call(slots.menu)]), [[_vShow, props.show]])]
92
94
  });
93
95
 
94
96
  watch(() => props.alignment, resize);
@@ -104,7 +106,7 @@ export default defineComponent({
104
106
  resize();
105
107
  }
106
108
 
107
- newValue ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
109
+ newValue ? call(onOpen) : call(onClose);
108
110
  });
109
111
 
110
112
  return function (_x) {
@@ -132,10 +134,10 @@ export default defineComponent({
132
134
  var _slot;
133
135
 
134
136
  return _createVNode("div", {
135
- "class": "var-menu",
137
+ "class": n(),
136
138
  "ref": host,
137
139
  "onClick": handleClick
138
- }, [slots.default == null ? void 0 : slots.default(), to.value ? _createVNode(Teleport, {
140
+ }, [call(slots.default), to.value ? _createVNode(Teleport, {
139
141
  "to": to.value,
140
142
  "disabled": disabled.value
141
143
  }, _isSlot(_slot = renderTransition()) ? _slot : {
@@ -2,21 +2,20 @@ import VarCheckbox from '../checkbox';
2
2
  import Ripple from '../ripple';
3
3
  import { defineComponent, computed, ref, watch } from 'vue';
4
4
  import { useSelect } from './provide';
5
+ import { createNamespace } from '../utils/components';
5
6
  import { props } from './props';
6
- import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
-
8
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
9
-
10
- var _hoisted_1 = {
11
- class: "var-option__text var--ellipsis"
12
- };
7
+ var {
8
+ n,
9
+ classes
10
+ } = createNamespace('option');
11
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
13
12
  export function render(_ctx, _cache) {
14
13
  var _component_var_checkbox = _resolveComponent("var-checkbox");
15
14
 
16
15
  var _directive_ripple = _resolveDirective("ripple");
17
16
 
18
17
  return _withDirectives((_openBlock(), _createElementBlock("div", {
19
- class: _normalizeClass(["var-option var--box", [_ctx.optionSelected ? 'var-option--selected-color' : null]]),
18
+ class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [_ctx.optionSelected, _ctx.n('--selected-color')])),
20
19
  style: _normalizeStyle({
21
20
  width: _ctx.wrapWidth,
22
21
  color: _ctx.optionSelected ? _ctx.focusColor : undefined
@@ -25,7 +24,7 @@ export function render(_ctx, _cache) {
25
24
  return _ctx.handleClick && _ctx.handleClick(...arguments);
26
25
  })
27
26
  }, [_createElementVNode("div", {
28
- class: _normalizeClass(["var-option__cover", [_ctx.optionSelected ? 'var-option--selected-background' : null]]),
27
+ class: _normalizeClass(_ctx.classes(_ctx.n('cover'), [_ctx.optionSelected, _ctx.n('--selected-background')])),
29
28
  style: _normalizeStyle({
30
29
  background: _ctx.optionSelected ? _ctx.focusColor : undefined
31
30
  })
@@ -41,9 +40,13 @@ export function render(_ctx, _cache) {
41
40
  onChange: _ctx.handleSelect
42
41
  }, null, 8
43
42
  /* PROPS */
44
- , ["checked-color", "modelValue", "onChange"])) : _createCommentVNode("v-if", true), _createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.label), 1
43
+ , ["checked-color", "modelValue", "onChange"])) : _createCommentVNode("v-if", true), _createElementVNode("div", {
44
+ class: _normalizeClass(_ctx.classes(_ctx.n('text'), 'var--ellipsis'))
45
+ }, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.label), 1
45
46
  /* TEXT */
46
- )])])], 6
47
+ )])], 2
48
+ /* CLASS */
49
+ )], 6
47
50
  /* CLASS, STYLE */
48
51
  )), [[_directive_ripple]]);
49
52
  }
@@ -100,6 +103,8 @@ export default defineComponent({
100
103
  });
101
104
  bindSelect(optionProvider);
102
105
  return {
106
+ n,
107
+ classes,
103
108
  optionSelected,
104
109
  wrapWidth,
105
110
  multiple,
@@ -7,18 +7,16 @@ import { defineComponent, ref, computed, watch } from 'vue';
7
7
  import { props } from './porps';
8
8
  import { isNumber, toNumber } from '../utils/shared';
9
9
  import { pack } from '../locale';
10
+ import { createNamespace } from '../utils/components';
11
+ var {
12
+ n,
13
+ classes
14
+ } = createNamespace('pagination');
10
15
  import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, withKeys as _withKeys, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
11
16
 
12
17
  var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
13
18
 
14
- var _hoisted_1 = {
15
- class: "var-pagination"
16
- };
17
- var _hoisted_2 = ["item-mode", "onClick"];
18
- var _hoisted_3 = {
19
- key: 4,
20
- class: "var-pagination__total"
21
- };
19
+ var _hoisted_1 = ["item-mode", "onClick"];
22
20
  export function render(_ctx, _cache) {
23
21
  var _component_var_icon = _resolveComponent("var-icon");
24
22
 
@@ -30,12 +28,10 @@ export function render(_ctx, _cache) {
30
28
 
31
29
  var _directive_ripple = _resolveDirective("ripple");
32
30
 
33
- return _openBlock(), _createElementBlock("ul", _hoisted_1, [_withDirectives((_openBlock(), _createElementBlock("li", {
34
- class: _normalizeClass(["var-pagination__item var-pagination__prev", {
35
- 'var-pagination__item-disabled': _ctx.current <= 1 || _ctx.disabled,
36
- 'var-pagination__item-hover': _ctx.simple,
37
- 'var-elevation--2': !_ctx.simple
38
- }]),
31
+ return _openBlock(), _createElementBlock("ul", {
32
+ class: _normalizeClass(_ctx.n())
33
+ }, [_withDirectives((_openBlock(), _createElementBlock("li", {
34
+ class: _normalizeClass(_ctx.classes(_ctx.n('item'), _ctx.n('prev'), [_ctx.current <= 1 || _ctx.disabled, _ctx.n('item--disabled')], [_ctx.simple, _ctx.n('item--hover'), 'var-elevation--2'])),
39
35
  onClick: _cache[0] || (_cache[0] = $event => _ctx.clickItem('prev'))
40
36
  }, [_renderSlot(_ctx.$slots, "prev", {}, () => [_createVNode(_component_var_icon, {
41
37
  name: "chevron-left"
@@ -45,9 +41,7 @@ export function render(_ctx, _cache) {
45
41
  disabled: _ctx.current <= 1 || _ctx.disabled
46
42
  }]]), _ctx.simple ? (_openBlock(), _createElementBlock("li", {
47
43
  key: 0,
48
- class: _normalizeClass(["var-pagination__simple", {
49
- 'var-pagination__item-disabled': _ctx.disabled
50
- }])
44
+ class: _normalizeClass(_ctx.classes(_ctx.n('simple'), [_ctx.disabled, _ctx.n('item--disabled')]))
51
45
  }, [_createVNode(_component_var_input, {
52
46
  modelValue: _ctx.simpleValue,
53
47
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.simpleValue = $event),
@@ -67,28 +61,19 @@ export function render(_ctx, _cache) {
67
61
  return _withDirectives((_openBlock(), _createElementBlock("li", {
68
62
  key: _ctx.toNumber(item) + index,
69
63
  "item-mode": _ctx.getMode(item, index),
70
- class: _normalizeClass(["var-pagination__item var-elevation--2", {
71
- 'var-pagination__item-active': item === _ctx.current && !_ctx.disabled,
72
- 'var-pagination__item-hide': _ctx.isHideEllipsis(item, index),
73
- 'var-pagination__item-disabled': _ctx.disabled,
74
- 'var-pagination__item-disabled-active': item === _ctx.current && _ctx.disabled
75
- }]),
64
+ class: _normalizeClass(_ctx.classes(_ctx.n('item'), 'var-elevation--2', [item === _ctx.current && !_ctx.disabled, _ctx.n('item--active')], [_ctx.isHideEllipsis(item, index), _ctx.n('item--hide')], [_ctx.disabled, _ctx.n('item--disabled')], [item === _ctx.current && _ctx.disabled, _ctx.n('item--disabled--active')])),
76
65
  onClick: $event => _ctx.clickItem(item, index)
77
66
  }, [_createTextVNode(_toDisplayString(item), 1
78
67
  /* TEXT */
79
68
  )], 10
80
69
  /* CLASS, PROPS */
81
- , _hoisted_2)), [[_directive_ripple, {
70
+ , _hoisted_1)), [[_directive_ripple, {
82
71
  disabled: _ctx.disabled
83
72
  }]]);
84
73
  }), 128
85
74
  /* KEYED_FRAGMENT */
86
75
  )), _withDirectives((_openBlock(), _createElementBlock("li", {
87
- class: _normalizeClass(["var-pagination__item var-pagination__next", {
88
- 'var-pagination__item-disabled': _ctx.current >= _ctx.pageCount || _ctx.disabled,
89
- 'var-pagination__item-hover': _ctx.simple,
90
- 'var-elevation--2': !_ctx.simple
91
- }]),
76
+ class: _normalizeClass(_ctx.classes(_ctx.n('item'), _ctx.n('next'), [_ctx.current >= _ctx.pageCount || _ctx.disabled, _ctx.n('item--disabled')], [_ctx.simple, _ctx.n('item--hover'), 'var-elevation--2'])),
92
77
  onClick: _cache[4] || (_cache[4] = $event => _ctx.clickItem('next'))
93
78
  }, [_renderSlot(_ctx.$slots, "next", {}, () => [_createVNode(_component_var_icon, {
94
79
  name: "chevron-right"
@@ -98,9 +83,7 @@ export function render(_ctx, _cache) {
98
83
  disabled: _ctx.current >= _ctx.pageCount || _ctx.disabled
99
84
  }]]), _ctx.showSizeChanger ? (_openBlock(), _createElementBlock("li", {
100
85
  key: 2,
101
- class: _normalizeClass(["var-pagination__size", {
102
- 'var-pagination__item-disabled': _ctx.disabled
103
- }])
86
+ class: _normalizeClass(_ctx.classes(_ctx.n('size'), [_ctx.disabled, _ctx.n('item--disabled')]))
104
87
  }, [_createVNode(_component_var_menu, {
105
88
  show: _ctx.menuVisible,
106
89
  "onUpdate:show": _cache[6] || (_cache[6] = $event => _ctx.menuVisible = $event),
@@ -108,9 +91,7 @@ export function render(_ctx, _cache) {
108
91
  }, {
109
92
  menu: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sizeOption, (option, index) => {
110
93
  return _withDirectives((_openBlock(), _createBlock(_component_var_cell, {
111
- class: _normalizeClass(["var-pagination__list", {
112
- 'var-pagination__list-active': _ctx.size === option
113
- }]),
94
+ class: _normalizeClass(_ctx.classes(_ctx.n('list'), [_ctx.size === option, _ctx.n('list--active')])),
114
95
  key: index,
115
96
  onClick: $event => _ctx.clickSize(option)
116
97
  }, {
@@ -127,7 +108,7 @@ export function render(_ctx, _cache) {
127
108
  /* KEYED_FRAGMENT */
128
109
  ))]),
129
110
  default: _withCtx(() => [_createElementVNode("div", {
130
- class: "var-pagination__size-open",
111
+ class: _normalizeClass(_ctx.n('size--open')),
131
112
  style: {
132
113
  "display": "flex"
133
114
  },
@@ -137,10 +118,14 @@ export function render(_ctx, _cache) {
137
118
  }, [_createElementVNode("span", null, _toDisplayString(_ctx.size) + _toDisplayString(_ctx.pack.paginationItem) + " / " + _toDisplayString(_ctx.pack.paginationPage), 1
138
119
  /* TEXT */
139
120
  ), _createVNode(_component_var_icon, {
140
- class: "var-pagination__size-open-icon",
121
+ class: _normalizeClass(_ctx.n('size--open-icon')),
141
122
  "var-pagination-cover": "",
142
123
  name: "menu-down"
143
- })])]),
124
+ }, null, 8
125
+ /* PROPS */
126
+ , ["class"])], 2
127
+ /* CLASS */
128
+ )]),
144
129
  _: 1
145
130
  /* STABLE */
146
131
 
@@ -150,9 +135,7 @@ export function render(_ctx, _cache) {
150
135
  /* CLASS */
151
136
  )) : _createCommentVNode("v-if", true), _ctx.showQuickJumper && !_ctx.simple ? (_openBlock(), _createElementBlock("li", {
152
137
  key: 3,
153
- class: _normalizeClass(["var-pagination__quickly", {
154
- 'var-pagination__item-disabled': _ctx.disabled
155
- }])
138
+ class: _normalizeClass(_ctx.classes(_ctx.n('quickly'), [_ctx.disabled, 'item--disabled']))
156
139
  }, [_createTextVNode(_toDisplayString(_ctx.pack.paginationJump) + " ", 1
157
140
  /* TEXT */
158
141
  ), _createVNode(_component_var_input, {
@@ -166,9 +149,14 @@ export function render(_ctx, _cache) {
166
149
  /* PROPS */
167
150
  , ["modelValue", "disabled"])], 2
168
151
  /* CLASS */
169
- )) : _createCommentVNode("v-if", true), _ctx.totalText ? (_openBlock(), _createElementBlock("li", _hoisted_3, _toDisplayString(_ctx.totalText), 1
170
- /* TEXT */
171
- )) : _createCommentVNode("v-if", true)]);
152
+ )) : _createCommentVNode("v-if", true), _ctx.totalText ? (_openBlock(), _createElementBlock("li", {
153
+ key: 4,
154
+ class: _normalizeClass(_ctx.n('total'))
155
+ }, _toDisplayString(_ctx.totalText), 3
156
+ /* TEXT, CLASS */
157
+ )) : _createCommentVNode("v-if", true)], 2
158
+ /* CLASS */
159
+ );
172
160
  }
173
161
  export default defineComponent({
174
162
  render,
@@ -345,6 +333,8 @@ export default defineComponent({
345
333
  immediate: true
346
334
  });
347
335
  return {
336
+ n,
337
+ classes,
348
338
  pack,
349
339
  current,
350
340
  menuVisible,
@@ -1 +1 @@
1
- :root { --pagination-font-size: var(--font-size-md); --pagination-active-color: #fff; --pagination-active-bg-color: var(--color-primary); --pagination-hover-bg-color: #edf5ff; --pagination-total-margin: 0 12px; --pagination-total-line-height: 24px; --pagination-item-width: 32px; --pagination-item-height: 32px; --pagination-item-margin: 0 6px; --pagination-item-background: #fff; --pagination-item-border-radius: 4px; --pagination-list-bg-color: #fff; --pagination-list-active-bg-color: #edf5ff; --pagination-list-active-color: var(--color-primary); --pagination-input-width: 32px; --pagination-simple-padding: 0 0 2px 0; --pagination-disabled-color: var(--color-text-disabled); --pagination-bg-disabled-color: var(--color-disabled); --pagination-size-line-height: 24px;}.pagination-flex-nowrap { display: flex; white-space: nowrap; align-items: center;}.var-pagination { display: flex; align-items: center; list-style: none; margin: 0; font-size: var(--pagination-font-size); padding: 0;}.var-pagination__item { display: inline-flex; min-width: var(--pagination-item-width); align-items: center; justify-content: center; margin: var(--pagination-item-margin); height: var(--pagination-item-height); cursor: pointer; border-radius: var(--pagination-item-border-radius); outline: none; transition: all 0.25s; user-select: none; background: var(--pagination-item-background);}.var-pagination__item:hover { background-color: var(--pagination-hover-bg-color);}.var-pagination__item-active { color: var(--pagination-active-color); background-color: var(--pagination-active-bg-color) !important;}.var-pagination__item-disabled-active { background: var(--pagination-bg-disabled-color);}.var-pagination__item-hide { display: none;}.var-pagination__item-disabled { cursor: default !important; color: var(--pagination-disabled-color);}.var-pagination__item-disabled:hover { background-color: unset;}.var-pagination__item-hover:hover { background: inherit;}.var-pagination__prev { margin-left: 0;}.var-pagination__total { display: flex; white-space: nowrap; align-items: center; line-height: var(--pagination-total-line-height); margin: var(--pagination-total-margin);}.var-pagination__size { display: flex; white-space: nowrap; align-items: center; line-height: var(--pagination-size-line-height); margin: var(--pagination-item-margin);}.var-pagination__size-open { display: flex; align-items: center; cursor: pointer;}.var-pagination__list { background-color: var(--pagination-list-bg-color); cursor: pointer; transition: all 0.25s;}.var-pagination__list:hover { color: var(--pagination-list-active-color); background-color: var(--pagination-hover-bg-color);}.var-pagination__list-active { background-color: var(--pagination-list-active-bg-color) !important; color: var(--pagination-list-active-color);}.var-pagination__quickly,.var-pagination__simple { display: flex; white-space: nowrap; align-items: center;}.var-pagination__quickly [var-pagination-cover],.var-pagination__simple [var-pagination-cover] { width: var(--pagination-input-width);}.var-pagination__quickly [var-pagination-cover] .var-input__wrap,.var-pagination__simple [var-pagination-cover] .var-input__wrap { padding: 0;}.var-pagination__quickly [var-pagination-cover] .var-input__input,.var-pagination__simple [var-pagination-cover] .var-input__input { height: auto; text-align: center;}.var-pagination__quickly { margin: var(--pagination-item-margin);}.var-pagination__quickly [var-pagination-cover] { margin-left: 6px;}.var-pagination__size-open-icon[var-pagination-cover] { font-size: inherit;}.var-pagination--simple-padding { padding: var(--pagination-simple-padding);}
1
+ :root { --pagination-font-size: var(--font-size-md); --pagination-active-color: #fff; --pagination-active-bg-color: var(--color-primary); --pagination-hover-bg-color: #edf5ff; --pagination-total-margin: 0 12px; --pagination-total-line-height: 24px; --pagination-item-width: 32px; --pagination-item-height: 32px; --pagination-item-margin: 0 6px; --pagination-item-background: #fff; --pagination-item-border-radius: 4px; --pagination-list-bg-color: #fff; --pagination-list-active-bg-color: #edf5ff; --pagination-list-active-color: var(--color-primary); --pagination-input-width: 32px; --pagination-simple-padding: 0 0 2px 0; --pagination-disabled-color: var(--color-text-disabled); --pagination-bg-disabled-color: var(--color-disabled); --pagination-size-line-height: 24px;}.pagination-flex-nowrap { display: flex; white-space: nowrap; align-items: center;}.var-pagination { display: flex; align-items: center; list-style: none; margin: 0; font-size: var(--pagination-font-size); padding: 0;}.var-pagination__item { display: inline-flex; min-width: var(--pagination-item-width); align-items: center; justify-content: center; margin: var(--pagination-item-margin); height: var(--pagination-item-height); cursor: pointer; border-radius: var(--pagination-item-border-radius); outline: none; transition: all 0.25s; user-select: none; background: var(--pagination-item-background);}.var-pagination__item:hover { background-color: var(--pagination-hover-bg-color);}.var-pagination__item--active { color: var(--pagination-active-color); background-color: var(--pagination-active-bg-color) !important;}.var-pagination__item--disabled--active { background: var(--pagination-bg-disabled-color);}.var-pagination__item--hide { display: none;}.var-pagination__item--disabled { cursor: default !important; color: var(--pagination-disabled-color);}.var-pagination__item--disabled:hover { background-color: unset;}.var-pagination__item--hover:hover { background: inherit;}.var-pagination__prev { margin-left: 0;}.var-pagination__total { display: flex; white-space: nowrap; align-items: center; line-height: var(--pagination-total-line-height); margin: var(--pagination-total-margin);}.var-pagination__size { display: flex; white-space: nowrap; align-items: center; line-height: var(--pagination-size-line-height); margin: var(--pagination-item-margin);}.var-pagination__size--open { display: flex; align-items: center; cursor: pointer;}.var-pagination__list { background-color: var(--pagination-list-bg-color); cursor: pointer; transition: all 0.25s;}.var-pagination__list:hover { color: var(--pagination-list-active-color); background-color: var(--pagination-hover-bg-color);}.var-pagination__list--active { background-color: var(--pagination-list-active-bg-color) !important; color: var(--pagination-list-active-color);}.var-pagination__quickly,.var-pagination__simple { display: flex; white-space: nowrap; align-items: center;}.var-pagination__quickly [var-pagination-cover],.var-pagination__simple [var-pagination-cover] { width: var(--pagination-input-width);}.var-pagination__quickly [var-pagination-cover] .var-input__wrap,.var-pagination__simple [var-pagination-cover] .var-input__wrap { padding: 0;}.var-pagination__quickly [var-pagination-cover] .var-input__input,.var-pagination__simple [var-pagination-cover] .var-input__input { height: auto; text-align: center;}.var-pagination__quickly { margin: var(--pagination-item-margin);}.var-pagination__quickly [var-pagination-cover] { margin-left: 6px;}.var-pagination__size--open-icon[var-pagination-cover] { font-size: inherit;}.var-pagination--simple-padding { padding: var(--pagination-simple-padding);}
@@ -73,20 +73,20 @@
73
73
  background-color: var(--pagination-hover-bg-color);
74
74
  }
75
75
 
76
- &-active {
76
+ &--active {
77
77
  color: var(--pagination-active-color);
78
78
  background-color: var(--pagination-active-bg-color) !important;
79
79
  }
80
80
 
81
- &-disabled-active {
81
+ &--disabled--active {
82
82
  background: var(--pagination-bg-disabled-color);
83
83
  }
84
84
 
85
- &-hide {
85
+ &--hide {
86
86
  display: none;
87
87
  }
88
88
 
89
- &-disabled {
89
+ &--disabled {
90
90
  cursor: default !important;
91
91
  color: var(--pagination-disabled-color);
92
92
 
@@ -95,7 +95,7 @@
95
95
  }
96
96
  }
97
97
 
98
- &-hover {
98
+ &--hover {
99
99
  &:hover {
100
100
  background: inherit;
101
101
  }
@@ -119,7 +119,7 @@
119
119
  line-height: var(--pagination-size-line-height);
120
120
  margin: var(--pagination-item-margin);
121
121
 
122
- &-open {
122
+ &--open {
123
123
  display: flex;
124
124
  align-items: center;
125
125
  cursor: pointer;
@@ -136,7 +136,7 @@
136
136
  background-color: var(--pagination-hover-bg-color);
137
137
  }
138
138
 
139
- &-active {
139
+ &--active {
140
140
  background-color: var(--pagination-list-active-bg-color) !important;
141
141
  color: var(--pagination-list-active-color);
142
142
  }
@@ -168,7 +168,7 @@
168
168
  }
169
169
  }
170
170
 
171
- &__size-open-icon[var-pagination-cover] {
171
+ &__size--open-icon[var-pagination-cover] {
172
172
  font-size: inherit;
173
173
  }
174
174