@varlet/ui 1.26.9 → 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 (243) 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/image/Image.js +19 -12
  53. package/es/image-preview/ImagePreview.js +35 -34
  54. package/es/index-anchor/IndexAnchor.js +8 -1
  55. package/es/index-bar/IndexBar.js +22 -20
  56. package/es/index.js +10 -0
  57. package/es/input/Input.js +45 -44
  58. package/es/lazy/index.js +2 -1
  59. package/es/less.js +2 -0
  60. package/es/list/List.js +39 -38
  61. package/es/loading/Loading.js +31 -23
  62. package/es/loading/loading.css +1 -1
  63. package/es/loading/loading.less +32 -32
  64. package/es/menu/Menu.js +12 -10
  65. package/es/option/Option.js +16 -11
  66. package/es/pagination/Pagination.js +34 -44
  67. package/es/pagination/pagination.css +1 -1
  68. package/es/pagination/pagination.less +8 -8
  69. package/es/picker/Picker.js +51 -47
  70. package/es/popup/Popup.js +9 -5
  71. package/es/progress/Progress.js +44 -35
  72. package/es/progress/progress.css +1 -1
  73. package/es/progress/progress.less +12 -12
  74. package/es/pull-refresh/PullRefresh.js +13 -10
  75. package/es/radio/Radio.js +25 -25
  76. package/es/radio-group/RadioGroup.js +19 -19
  77. package/es/rate/Rate.js +27 -25
  78. package/es/ripple/index.js +6 -2
  79. package/es/row/Row.js +11 -4
  80. package/es/select/Select.js +53 -54
  81. package/es/skeleton/Skeleton.js +70 -81
  82. package/es/slider/Slider.js +44 -40
  83. package/es/slider/slider.css +1 -1
  84. package/es/slider/slider.less +5 -5
  85. package/es/snackbar/Snackbar.js +9 -5
  86. package/es/snackbar/core.js +20 -26
  87. package/es/snackbar/snackbar.css +1 -1
  88. package/es/snackbar/snackbar.less +66 -68
  89. package/es/space/Space.js +8 -3
  90. package/es/step/Step.js +25 -23
  91. package/es/step/step.css +1 -1
  92. package/es/step/step.less +10 -10
  93. package/es/steps/Steps.js +12 -5
  94. package/es/sticky/Sticky.js +14 -7
  95. package/es/style-provider/StyleProvider.js +6 -2
  96. package/es/style.css +1 -1
  97. package/es/style.js +2 -0
  98. package/es/swipe/Swipe.js +22 -16
  99. package/es/swipe-item/SwipeItem.js +9 -4
  100. package/es/switch/Switch.js +25 -23
  101. package/es/switch/switch.css +1 -1
  102. package/es/switch/switch.less +2 -2
  103. package/es/tab/Tab.js +8 -1
  104. package/es/tab-item/TabItem.js +8 -1
  105. package/es/table/Table.js +27 -20
  106. package/es/tabs/Tabs.js +16 -11
  107. package/es/tabs-items/TabsItems.js +10 -5
  108. package/es/themes/dark/bottomNavigation.js +4 -0
  109. package/es/themes/dark/bottomNavigationItem.js +3 -0
  110. package/es/themes/dark/index.js +3 -1
  111. package/es/time-picker/TimePicker.js +47 -38
  112. package/es/time-picker/clock.js +26 -22
  113. package/es/time-picker/timePicker.css +1 -1
  114. package/es/time-picker/timePicker.less +11 -11
  115. package/es/umdIndex.js +10 -0
  116. package/es/uploader/Uploader.js +62 -57
  117. package/es/utils/components.js +35 -0
  118. package/es/varlet.esm.js +2082 -1527
  119. package/highlight/attributes.json +48 -0
  120. package/highlight/tags.json +20 -0
  121. package/highlight/web-types.json +155 -1
  122. package/lib/action-sheet/ActionSheet.js +30 -26
  123. package/lib/app-bar/AppBar.js +31 -24
  124. package/lib/back-top/BackTop.js +11 -2
  125. package/lib/badge/Badge.js +23 -13
  126. package/lib/bottom-navigation/BottomNavigation.js +183 -0
  127. package/lib/bottom-navigation/BottomNavigationSfc.css +0 -0
  128. package/lib/bottom-navigation/BottomNavigationSfc.less +0 -0
  129. package/lib/bottom-navigation/bottomNavigation.css +1 -0
  130. package/lib/bottom-navigation/bottomNavigation.less +49 -0
  131. package/lib/bottom-navigation/index.js +17 -0
  132. package/lib/bottom-navigation/props.js +45 -0
  133. package/lib/bottom-navigation/provide.js +27 -0
  134. package/lib/bottom-navigation/style/index.js +4 -0
  135. package/lib/bottom-navigation/style/less.js +4 -0
  136. package/lib/bottom-navigation-item/BottomNavigationItem.js +140 -0
  137. package/lib/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  138. package/lib/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  139. package/lib/bottom-navigation-item/bottomNavigationItem.css +1 -0
  140. package/lib/bottom-navigation-item/bottomNavigationItem.less +78 -0
  141. package/lib/bottom-navigation-item/index.js +17 -0
  142. package/lib/bottom-navigation-item/props.js +27 -0
  143. package/lib/bottom-navigation-item/provide.js +28 -0
  144. package/lib/bottom-navigation-item/style/index.js +6 -0
  145. package/lib/bottom-navigation-item/style/less.js +6 -0
  146. package/lib/button/Button.js +13 -4
  147. package/lib/card/Card.js +34 -27
  148. package/lib/cell/Cell.js +26 -13
  149. package/lib/checkbox/Checkbox.js +26 -23
  150. package/lib/checkbox-group/CheckboxGroup.js +19 -22
  151. package/lib/chip/Chip.js +18 -7
  152. package/lib/chip/chip.css +1 -1
  153. package/lib/chip/chip.less +11 -11
  154. package/lib/col/Col.js +14 -5
  155. package/lib/collapse/Collapse.js +15 -10
  156. package/lib/collapse-item/CollapseItem.js +31 -28
  157. package/lib/collapse-item/collapseItem.css +1 -1
  158. package/lib/collapse-item/collapseItem.less +16 -16
  159. package/lib/countdown/Countdown.js +14 -10
  160. package/lib/counter/Counter.js +29 -26
  161. package/lib/date-picker/DatePicker.js +30 -23
  162. package/lib/date-picker/date-picker.css +1 -1
  163. package/lib/date-picker/date-picker.less +22 -20
  164. package/lib/date-picker/src/day-picker-panel.js +41 -32
  165. package/lib/date-picker/src/month-picker-panel.js +27 -19
  166. package/lib/date-picker/src/panel-header.js +16 -9
  167. package/lib/date-picker/src/year-picker-panel.js +19 -9
  168. package/lib/dialog/Dialog.js +36 -38
  169. package/lib/divider/Divider.js +16 -10
  170. package/lib/form/Form.js +11 -6
  171. package/lib/form-details/FormDetails.js +27 -20
  172. package/lib/icon/Icon.js +10 -1
  173. package/lib/image/Image.js +20 -11
  174. package/lib/image-preview/ImagePreview.js +35 -33
  175. package/lib/index-anchor/IndexAnchor.js +10 -1
  176. package/lib/index-bar/IndexBar.js +24 -20
  177. package/lib/index.js +6 -0
  178. package/lib/input/Input.js +45 -43
  179. package/lib/lazy/index.js +3 -1
  180. package/lib/less.js +2 -0
  181. package/lib/list/List.js +39 -36
  182. package/lib/loading/Loading.js +33 -23
  183. package/lib/loading/loading.css +1 -1
  184. package/lib/loading/loading.less +32 -32
  185. package/lib/menu/Menu.js +12 -9
  186. package/lib/option/Option.js +16 -9
  187. package/lib/pagination/Pagination.js +36 -44
  188. package/lib/pagination/pagination.css +1 -1
  189. package/lib/pagination/pagination.less +8 -8
  190. package/lib/picker/Picker.js +51 -46
  191. package/lib/popup/Popup.js +9 -4
  192. package/lib/progress/Progress.js +45 -34
  193. package/lib/progress/progress.css +1 -1
  194. package/lib/progress/progress.less +12 -12
  195. package/lib/pull-refresh/PullRefresh.js +14 -10
  196. package/lib/radio/Radio.js +23 -22
  197. package/lib/radio-group/RadioGroup.js +17 -16
  198. package/lib/rate/Rate.js +27 -24
  199. package/lib/ripple/index.js +7 -2
  200. package/lib/row/Row.js +12 -3
  201. package/lib/select/Select.js +53 -53
  202. package/lib/skeleton/Skeleton.js +69 -78
  203. package/lib/slider/Slider.js +42 -38
  204. package/lib/slider/slider.css +1 -1
  205. package/lib/slider/slider.less +5 -5
  206. package/lib/snackbar/Snackbar.js +9 -4
  207. package/lib/snackbar/core.js +20 -25
  208. package/lib/snackbar/snackbar.css +1 -1
  209. package/lib/snackbar/snackbar.less +66 -68
  210. package/lib/space/Space.js +9 -3
  211. package/lib/step/Step.js +26 -22
  212. package/lib/step/step.css +1 -1
  213. package/lib/step/step.less +10 -10
  214. package/lib/steps/Steps.js +13 -4
  215. package/lib/sticky/Sticky.js +15 -6
  216. package/lib/style-provider/StyleProvider.js +8 -2
  217. package/lib/style.css +1 -1
  218. package/lib/style.js +2 -0
  219. package/lib/swipe/Swipe.js +23 -16
  220. package/lib/swipe-item/SwipeItem.js +10 -3
  221. package/lib/switch/Switch.js +23 -20
  222. package/lib/switch/switch.css +1 -1
  223. package/lib/switch/switch.less +2 -2
  224. package/lib/tab/Tab.js +10 -1
  225. package/lib/tab-item/TabItem.js +10 -1
  226. package/lib/table/Table.js +27 -18
  227. package/lib/tabs/Tabs.js +18 -11
  228. package/lib/tabs-items/TabsItems.js +11 -4
  229. package/lib/themes/dark/bottomNavigation.js +9 -0
  230. package/lib/themes/dark/bottomNavigationItem.js +8 -0
  231. package/lib/themes/dark/index.js +5 -1
  232. package/lib/time-picker/TimePicker.js +49 -38
  233. package/lib/time-picker/clock.js +26 -20
  234. package/lib/time-picker/timePicker.css +1 -1
  235. package/lib/time-picker/timePicker.less +11 -11
  236. package/lib/uploader/Uploader.js +60 -55
  237. package/lib/utils/components.js +39 -0
  238. package/package.json +4 -4
  239. package/types/bottomNavigation.d.ts +19 -0
  240. package/types/bottomNavigationItem.d.ts +16 -0
  241. package/types/global.d.ts +2 -0
  242. package/types/index.d.ts +2 -0
  243. package/umd/varlet.js +4 -4
package/es/swipe/Swipe.js CHANGED
@@ -7,20 +7,24 @@ import { useSwipeItems } from './provide';
7
7
  import { doubleRaf, nextTickFrame } from '../utils/elements';
8
8
  import { props } from './props';
9
9
  import { isNumber, toNumber } from '../utils/shared';
10
+ import { call, createNamespace } from '../utils/components';
10
11
  var SWIPE_DELAY = 250;
11
12
  var SWIPE_DISTANCE = 20;
13
+ var {
14
+ n,
15
+ classes
16
+ } = createNamespace('swipe');
12
17
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
13
18
 
14
19
  var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
15
20
 
16
- var _hoisted_1 = {
17
- class: "var-swipe",
18
- ref: "swipeEl"
19
- };
20
- var _hoisted_2 = ["onClick"];
21
+ var _hoisted_1 = ["onClick"];
21
22
  export function render(_ctx, _cache) {
22
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
23
- class: _normalizeClass(["var-swipe__track", [_ctx.vertical ? 'var-swipe--vertical' : null]]),
23
+ return _openBlock(), _createElementBlock("div", {
24
+ class: _normalizeClass(_ctx.n()),
25
+ ref: "swipeEl"
26
+ }, [_createElementVNode("div", {
27
+ class: _normalizeClass(_ctx.classes(_ctx.n('track'), [_ctx.vertical, _ctx.n('--vertical')])),
24
28
  style: _normalizeStyle({
25
29
  width: !_ctx.vertical ? _ctx.trackSize + "px" : undefined,
26
30
  height: _ctx.vertical ? _ctx.trackSize + "px" : undefined,
@@ -43,10 +47,10 @@ export function render(_ctx, _cache) {
43
47
  length: _ctx.length
44
48
  }, () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock("div", {
45
49
  key: 0,
46
- class: _normalizeClass(["var-swipe__indicators", [_ctx.vertical ? 'var-swipe--indicators-vertical' : null]])
50
+ class: _normalizeClass(_ctx.classes(_ctx.n('indicators'), [_ctx.vertical, _ctx.n('--indicators-vertical')]))
47
51
  }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.length, (l, idx) => {
48
52
  return _openBlock(), _createElementBlock("div", {
49
- class: _normalizeClass(["var-swipe__indicator", [_ctx.index === idx ? 'var-swipe--indicator-active' : null, _ctx.vertical ? 'var-swipe--indicator-vertical' : null]]),
53
+ class: _normalizeClass(_ctx.classes(_ctx.n('indicator'), [_ctx.index === idx, _ctx.n('--indicator-active')], [_ctx.vertical, _ctx.n('--indicator-vertical')])),
50
54
  style: _normalizeStyle({
51
55
  background: _ctx.indicatorColor
52
56
  }),
@@ -54,13 +58,13 @@ export function render(_ctx, _cache) {
54
58
  onClick: $event => _ctx.to(idx)
55
59
  }, null, 14
56
60
  /* CLASS, STYLE, PROPS */
57
- , _hoisted_2);
61
+ , _hoisted_1);
58
62
  }), 128
59
63
  /* KEYED_FRAGMENT */
60
64
  ))], 2
61
65
  /* CLASS */
62
- )) : _createCommentVNode("v-if", true)])], 512
63
- /* NEED_PATCH */
66
+ )) : _createCommentVNode("v-if", true)])], 2
67
+ /* CLASS */
64
68
  );
65
69
  }
66
70
  export default defineComponent({
@@ -183,7 +187,7 @@ export default defineComponent({
183
187
 
184
188
  nextTickFrame(() => {
185
189
  lockDuration.value = false;
186
- fn == null ? void 0 : fn();
190
+ call(fn);
187
191
  });
188
192
  };
189
193
 
@@ -291,7 +295,7 @@ export default defineComponent({
291
295
  var prevIndex = index.value;
292
296
  index.value = swipeIndexToIndex(swipeIndex);
293
297
  startAutoplay();
294
- prevIndex !== index.value && (onChange == null ? void 0 : onChange(index.value));
298
+ prevIndex !== index.value && call(onChange, index.value);
295
299
  }; // expose
296
300
 
297
301
 
@@ -321,7 +325,7 @@ export default defineComponent({
321
325
  } = props;
322
326
  var currentIndex = index.value;
323
327
  index.value = boundaryIndex(currentIndex + 1);
324
- onChange == null ? void 0 : onChange(index.value);
328
+ call(onChange, index.value);
325
329
  fixPosition(() => {
326
330
  if (currentIndex === length.value - 1 && loop) {
327
331
  findSwipeItem(0).setTranslate(trackSize.value);
@@ -347,7 +351,7 @@ export default defineComponent({
347
351
  } = props;
348
352
  var currentIndex = index.value;
349
353
  index.value = boundaryIndex(currentIndex - 1);
350
- onChange == null ? void 0 : onChange(index.value);
354
+ call(onChange, index.value);
351
355
  fixPosition(() => {
352
356
  if (currentIndex === 0 && loop) {
353
357
  findSwipeItem(length.value - 1).setTranslate(-trackSize.value);
@@ -394,6 +398,8 @@ export default defineComponent({
394
398
  stopAutoplay();
395
399
  });
396
400
  return {
401
+ n,
402
+ classes,
397
403
  length,
398
404
  index,
399
405
  swipeEl,
@@ -1,16 +1,20 @@
1
1
  import { defineComponent, ref } from 'vue';
2
2
  import { useSwipe } from './provide';
3
- import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
3
+ import { createNamespace } from '../utils/components';
4
+ var {
5
+ n
6
+ } = createNamespace('swipe-item');
7
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
4
8
  export function render(_ctx, _cache) {
5
9
  return _openBlock(), _createElementBlock("div", {
6
- class: "var-swipe-item",
10
+ class: _normalizeClass(_ctx.n()),
7
11
  style: _normalizeStyle({
8
12
  width: !_ctx.vertical ? _ctx.size + "px" : undefined,
9
13
  height: _ctx.vertical ? _ctx.size + "px" : undefined,
10
14
  transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)"
11
15
  })
12
- }, [_renderSlot(_ctx.$slots, "default")], 4
13
- /* STYLE */
16
+ }, [_renderSlot(_ctx.$slots, "default")], 6
17
+ /* CLASS, STYLE */
14
18
  );
15
19
  }
16
20
  export default defineComponent({
@@ -39,6 +43,7 @@ export default defineComponent({
39
43
  };
40
44
  bindSwipe(swipeItemProvider);
41
45
  return {
46
+ n,
42
47
  size,
43
48
  vertical,
44
49
  translate
@@ -1,18 +1,16 @@
1
1
  import { defineComponent, computed, nextTick } from 'vue';
2
- import { useValidation } from '../utils/components';
2
+ import { useValidation, createNamespace, call } from '../utils/components';
3
3
  import { toNumber } from '../utils/shared';
4
4
  import { useForm } from '../form/provide';
5
5
  import { props } from './props';
6
6
  import VarFormDetails from '../form-details';
7
7
  import VarLoading from '../loading';
8
8
  import Ripple from '../ripple';
9
- import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
10
-
11
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
12
-
13
- var _hoisted_1 = {
14
- class: "var-switch"
15
- };
9
+ var {
10
+ n,
11
+ classes
12
+ } = createNamespace('switch');
13
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createVNode as _createVNode } from "vue";
16
14
  export function render(_ctx, _cache) {
17
15
  var _component_var_loading = _resolveComponent("var-loading");
18
16
 
@@ -20,23 +18,25 @@ export function render(_ctx, _cache) {
20
18
 
21
19
  var _directive_ripple = _resolveDirective("ripple");
22
20
 
23
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
24
- class: _normalizeClass(["var-switch-block", [_ctx.disabled || _ctx.formDisabled ? 'var-switch__disable' : null]]),
21
+ return _openBlock(), _createElementBlock("div", {
22
+ class: _normalizeClass(_ctx.n())
23
+ }, [_createElementVNode("div", {
24
+ class: _normalizeClass(_ctx.classes(_ctx.n('block'), [_ctx.disabled || _ctx.formDisabled, _ctx.n('--disable')])),
25
25
  onClick: _cache[0] || (_cache[0] = function () {
26
26
  return _ctx.switchActive && _ctx.switchActive(...arguments);
27
27
  }),
28
28
  style: _normalizeStyle(_ctx.styleComputed.switch)
29
29
  }, [_createElementVNode("div", {
30
30
  style: _normalizeStyle(_ctx.styleComputed.track),
31
- class: _normalizeClass(["var-switch__track", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__track-active' : null, _ctx.errorMessage ? 'var-switch__track-error' : null]])
31
+ class: _normalizeClass(_ctx.classes(_ctx.n('track'), [_ctx.modelValue === _ctx.activeValue, _ctx.n('track-active')], [_ctx.errorMessage, _ctx.n('track-error')]))
32
32
  }, null, 6
33
33
  /* CLASS, STYLE */
34
34
  ), _withDirectives((_openBlock(), _createElementBlock("div", {
35
- class: "var-switch__ripple",
35
+ class: _normalizeClass(_ctx.n('ripple')),
36
36
  style: _normalizeStyle(_ctx.styleComputed.ripple)
37
37
  }, [_createElementVNode("div", {
38
38
  style: _normalizeStyle(_ctx.styleComputed.handle),
39
- class: _normalizeClass(["var-switch__handle var-elevation--2", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__handle-active' : null, _ctx.errorMessage ? 'var-switch__handle-error' : null]])
39
+ class: _normalizeClass(_ctx.classes(_ctx.n('handle'), 'var-elevation--2', [_ctx.modelValue === _ctx.activeValue, _ctx.n('handle-active')], [_ctx.errorMessage, _ctx.n('handle-error')]))
40
40
  }, [_ctx.loading ? (_openBlock(), _createBlock(_component_var_loading, {
41
41
  key: 0,
42
42
  radius: _ctx.toNumber(_ctx.size) / 2 - 2
@@ -44,8 +44,8 @@ export function render(_ctx, _cache) {
44
44
  /* PROPS */
45
45
  , ["radius"])) : _createCommentVNode("v-if", true)], 6
46
46
  /* CLASS, STYLE */
47
- )], 4
48
- /* STYLE */
47
+ )], 6
48
+ /* CLASS, STYLE */
49
49
  )), [[_directive_ripple, {
50
50
  disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled
51
51
  }]])], 6
@@ -54,7 +54,9 @@ export function render(_ctx, _cache) {
54
54
  "error-message": _ctx.errorMessage
55
55
  }, null, 8
56
56
  /* PROPS */
57
- , ["error-message"])]);
57
+ , ["error-message"])], 2
58
+ /* CLASS */
59
+ );
58
60
  }
59
61
  export default defineComponent({
60
62
  render,
@@ -135,18 +137,16 @@ export default defineComponent({
135
137
  inactiveValue,
136
138
  'onUpdate:modelValue': updateModelValue
137
139
  } = props;
138
- onClick == null ? void 0 : onClick(event);
140
+ call(onClick, event);
139
141
  if (disabled || loading || readonly || form != null && form.disabled.value || form != null && form.readonly.value) return;
140
142
  var newValue = modelValue === activeValue ? inactiveValue : activeValue;
141
- onChange == null ? void 0 : onChange(newValue);
142
- updateModelValue == null ? void 0 : updateModelValue(newValue);
143
+ call(onChange, newValue);
144
+ call(updateModelValue, newValue);
143
145
  validateWithTrigger();
144
146
  };
145
147
 
146
148
  var reset = () => {
147
- var _props$onUpdateModel;
148
-
149
- (_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, props.inactiveValue);
149
+ call(props['onUpdate:modelValue'], props.inactiveValue);
150
150
  resetValidation();
151
151
  };
152
152
 
@@ -155,8 +155,10 @@ export default defineComponent({
155
155
  validate,
156
156
  resetValidation
157
157
  };
158
- bindForm == null ? void 0 : bindForm(switchProvider);
158
+ call(bindForm, switchProvider);
159
159
  return {
160
+ n,
161
+ classes,
160
162
  switchActive,
161
163
  toNumber,
162
164
  styleComputed,
@@ -1 +1 @@
1
- :root { --switch-track-background: #fff; --switch-track-active-background: var(--color-primary); --switch-track-error-background: var(--color-danger); --switch-ripple-color: var(--color-primary); --switch-handle-background: #fff; --switch-handle-color: #fff; --switch-handle-active-background: var(--color-primary); --switch-handle-error-background: var(--color-danger);}.var-switch { display: inline-block;}.var-switch-block { position: relative; display: flex; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; justify-content: center;}.var-switch__disable { filter: opacity(0.6); cursor: not-allowed;}.var-switch__track { background: var(--switch-track-background); transition: background-color 0.25s; filter: opacity(0.6);}.var-switch__track-active { background-color: var(--switch-track-active-background);}.var-switch__track-error { background-color: var(--switch-track-error-background) !important;}.var-switch__ripple { position: absolute; display: flex; align-items: center; justify-content: center; color: var(--switch-ripple-color); border-radius: 50%; overflow: hidden; transition: 0.3s var(--cubic-bezier);}.var-switch__handle { border-radius: 50%; background-color: var(--switch-handle-background); display: flex; align-items: center; justify-content: center; color: var(--switch-handle-color); transition: background-color 0.25s;}.var-switch__handle-active { background-color: var(--switch-handle-active-background);}.var-switch__handle-error { background-color: var(--switch-handle-error-background) !important;}
1
+ :root { --switch-track-background: #fff; --switch-track-active-background: var(--color-primary); --switch-track-error-background: var(--color-danger); --switch-ripple-color: var(--color-primary); --switch-handle-background: #fff; --switch-handle-color: #fff; --switch-handle-active-background: var(--color-primary); --switch-handle-error-background: var(--color-danger);}.var-switch { display: inline-block;}.var-switch__block { position: relative; display: flex; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; justify-content: center;}.var-switch--disable { filter: opacity(0.6); cursor: not-allowed;}.var-switch__track { background: var(--switch-track-background); transition: background-color 0.25s; filter: opacity(0.6);}.var-switch__track-active { background-color: var(--switch-track-active-background);}.var-switch__track-error { background-color: var(--switch-track-error-background) !important;}.var-switch__ripple { position: absolute; display: flex; align-items: center; justify-content: center; color: var(--switch-ripple-color); border-radius: 50%; overflow: hidden; transition: 0.3s var(--cubic-bezier);}.var-switch__handle { border-radius: 50%; background-color: var(--switch-handle-background); display: flex; align-items: center; justify-content: center; color: var(--switch-handle-color); transition: background-color 0.25s;}.var-switch__handle-active { background-color: var(--switch-handle-active-background);}.var-switch__handle-error { background-color: var(--switch-handle-error-background) !important;}
@@ -21,7 +21,7 @@
21
21
  .var-switch {
22
22
  display: inline-block;
23
23
 
24
- &-block {
24
+ &__block {
25
25
  position: relative;
26
26
  display: flex;
27
27
  cursor: pointer;
@@ -30,7 +30,7 @@
30
30
  justify-content: center;
31
31
  }
32
32
 
33
- &__disable {
33
+ &--disable {
34
34
  filter: opacity(0.6);
35
35
  cursor: not-allowed;
36
36
  }
package/es/tab/Tab.js CHANGED
@@ -1,13 +1,18 @@
1
1
  import Ripple from '../ripple';
2
2
  import { defineComponent, ref, computed, watch } from 'vue';
3
3
  import { props } from './props';
4
+ import { createNamespace } from '../utils/components';
4
5
  import { useTabs } from './provide';
6
+ var {
7
+ n,
8
+ classes
9
+ } = createNamespace('tab');
5
10
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
6
11
  export function render(_ctx, _cache) {
7
12
  var _directive_ripple = _resolveDirective("ripple");
8
13
 
9
14
  return _withDirectives((_openBlock(), _createElementBlock("div", {
10
- class: _normalizeClass(["var-tab var--box", [_ctx.computeColorClass(), "var-tab--" + _ctx.itemDirection]]),
15
+ class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', _ctx.computeColorClass(), _ctx.n("--" + _ctx.itemDirection))),
11
16
  ref: "tabEl",
12
17
  style: _normalizeStyle({
13
18
  color: _ctx.computeColorStyle()
@@ -90,6 +95,8 @@ export default defineComponent({
90
95
  watch(() => props.name, resize);
91
96
  watch(() => props.disabled, resize);
92
97
  return {
98
+ n,
99
+ classes,
93
100
  tabEl,
94
101
  active,
95
102
  activeColor,
@@ -2,12 +2,17 @@ import VarSwipeItem from '../swipe-item';
2
2
  import { defineComponent, ref, computed } from 'vue';
3
3
  import { useTabsItems } from './provide';
4
4
  import { props } from './props';
5
+ import { createNamespace } from '../utils/components';
6
+ var {
7
+ n,
8
+ classes
9
+ } = createNamespace('tab-item');
5
10
  import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
6
11
  export function render(_ctx, _cache) {
7
12
  var _component_var_swipe_item = _resolveComponent("var-swipe-item");
8
13
 
9
14
  return _openBlock(), _createBlock(_component_var_swipe_item, {
10
- class: _normalizeClass(["var-tab-item", [!_ctx.current && 'var-tab-item--inactive']]),
15
+ class: _normalizeClass(_ctx.classes(_ctx.n(), [!_ctx.current, _ctx.n('--inactive')])),
11
16
  "var-tab-item-cover": ""
12
17
  }, {
13
18
  default: _withCtx(() => [_ctx.initSlot ? _renderSlot(_ctx.$slots, "default", {
@@ -52,6 +57,8 @@ export default defineComponent({
52
57
  };
53
58
  bindTabsItems(tabItemProvider);
54
59
  return {
60
+ n,
61
+ classes,
55
62
  current,
56
63
  initSlot
57
64
  };
package/es/table/Table.js CHANGED
@@ -1,28 +1,33 @@
1
1
  import { defineComponent } from 'vue';
2
2
  import { toSizeUnit } from '../utils/elements';
3
- import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
4
-
5
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
6
-
7
- var _hoisted_1 = {
8
- class: "var-table var-elevation--1 var--box"
9
- };
10
- var _hoisted_2 = {
11
- class: "var-table__main"
12
- };
13
- var _hoisted_3 = {
14
- key: 0,
15
- class: "var-table__footer"
16
- };
3
+ import { createNamespace } from '../utils/components';
4
+ var {
5
+ n,
6
+ classes
7
+ } = createNamespace('table');
8
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
17
9
  export function render(_ctx, _cache) {
18
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, [_createElementVNode("table", {
19
- class: "var-table__table",
10
+ return _openBlock(), _createElementBlock("div", {
11
+ class: _normalizeClass(_ctx.classes(_ctx.n(), 'var-elevation--1 var--box'))
12
+ }, [_createElementVNode("div", {
13
+ class: _normalizeClass(_ctx.n('main'))
14
+ }, [_createElementVNode("table", {
15
+ class: _normalizeClass(_ctx.n('table')),
20
16
  style: _normalizeStyle({
21
17
  width: _ctx.toSizeUnit(_ctx.fullWidth)
22
18
  })
23
- }, [_renderSlot(_ctx.$slots, "default")], 4
24
- /* STYLE */
25
- )]), _ctx.$slots.footer ? (_openBlock(), _createElementBlock("div", _hoisted_3, [_renderSlot(_ctx.$slots, "footer")])) : _createCommentVNode("v-if", true)]);
19
+ }, [_renderSlot(_ctx.$slots, "default")], 6
20
+ /* CLASS, STYLE */
21
+ )], 2
22
+ /* CLASS */
23
+ ), _ctx.$slots.footer ? (_openBlock(), _createElementBlock("div", {
24
+ key: 0,
25
+ class: _normalizeClass(_ctx.n('footer'))
26
+ }, [_renderSlot(_ctx.$slots, "footer")], 2
27
+ /* CLASS */
28
+ )) : _createCommentVNode("v-if", true)], 2
29
+ /* CLASS */
30
+ );
26
31
  }
27
32
  export default defineComponent({
28
33
  render,
@@ -36,7 +41,9 @@ export default defineComponent({
36
41
 
37
42
  setup() {
38
43
  return {
39
- toSizeUnit
44
+ toSizeUnit,
45
+ n,
46
+ classes
40
47
  };
41
48
  }
42
49
 
package/es/tabs/Tabs.js CHANGED
@@ -8,21 +8,26 @@ import { props } from './props';
8
8
  import { useTabList } from './provide';
9
9
  import { isNumber, linear } from '../utils/shared';
10
10
  import { toSizeUnit, scrollTo, doubleRaf } from '../utils/elements';
11
+ import { createNamespace, call } from '../utils/components';
12
+ var {
13
+ n,
14
+ classes
15
+ } = createNamespace('tabs');
11
16
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
12
17
  export function render(_ctx, _cache) {
13
18
  return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
14
19
  "offset-top": _ctx.sticky ? _ctx.offsetTop : null
15
20
  }, {
16
21
  default: _withCtx(() => [_createElementVNode("div", _mergeProps({
17
- class: ["var-tabs var--box", ["var-tabs--item-" + _ctx.itemDirection, "var-tabs--layout-" + _ctx.layoutDirection + "-padding", _ctx.elevation ? "var-elevation--4" : null, _ctx.fixedBottom ? 'var-tabs--fixed-bottom' : null]],
22
+ class: _ctx.classes(_ctx.n(), 'var--box', _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, 'var-elevation--4'], [_ctx.fixedBottom, _ctx.n('--fixed-bottom')]),
18
23
  style: {
19
24
  background: _ctx.color
20
25
  }
21
26
  }, _ctx.$attrs), [_createElementVNode("div", {
22
- class: _normalizeClass(["var-tabs__tab-wrap", [_ctx.scrollable ? "var-tabs--layout-" + _ctx.layoutDirection + "-scrollable" : null, "var-tabs--layout-" + _ctx.layoutDirection]]),
23
- ref: "scrollerEl"
27
+ ref: "scrollerEl",
28
+ class: _normalizeClass(_ctx.classes(_ctx.n('tab-wrap'), [_ctx.scrollable, _ctx.n("--layout-" + _ctx.layoutDirection + "-scrollable")], _ctx.n("--layout-" + _ctx.layoutDirection)))
24
29
  }, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("div", {
25
- class: _normalizeClass(["var-tabs__indicator", ["var-tabs--layout-" + _ctx.layoutDirection + "-indicator"]]),
30
+ class: _normalizeClass(_ctx.classes(_ctx.n('indicator'), _ctx.n("--layout-" + _ctx.layoutDirection + "-indicator"))),
26
31
  style: _normalizeStyle({
27
32
  width: _ctx.layoutDirection === 'horizontal' ? _ctx.indicatorWidth : _ctx.toSizeUnit(_ctx.indicatorSize),
28
33
  height: _ctx.layoutDirection === 'horizontal' ? _ctx.toSizeUnit(_ctx.indicatorSize) : _ctx.indicatorHeight,
@@ -71,7 +76,7 @@ export default defineComponent({
71
76
  } = useTabList();
72
77
 
73
78
  var onTabClick = tab => {
74
- var _tab$name$value, _props$onUpdateActiv;
79
+ var _tab$name$value;
75
80
 
76
81
  var currentActive = (_tab$name$value = tab.name.value) != null ? _tab$name$value : tab.index.value;
77
82
  var {
@@ -79,9 +84,9 @@ export default defineComponent({
79
84
  onChange,
80
85
  onClick
81
86
  } = props;
82
- (_props$onUpdateActiv = props['onUpdate:active']) == null ? void 0 : _props$onUpdateActiv.call(props, currentActive);
83
- onClick == null ? void 0 : onClick(currentActive);
84
- currentActive !== active && (onChange == null ? void 0 : onChange(currentActive));
87
+ call(props['onUpdate:active'], currentActive);
88
+ call(onClick, currentActive);
89
+ currentActive !== active && call(onChange, currentActive);
85
90
  };
86
91
 
87
92
  var matchName = () => {
@@ -103,8 +108,6 @@ export default defineComponent({
103
108
  };
104
109
 
105
110
  var matchBoundary = () => {
106
- var _props$onUpdateActiv2, _props$onUpdateActiv3;
107
-
108
111
  if (length.value === 0) {
109
112
  return;
110
113
  }
@@ -112,7 +115,7 @@ export default defineComponent({
112
115
  var {
113
116
  active
114
117
  } = props;
115
- isNumber(active) ? active > length.value - 1 ? (_props$onUpdateActiv2 = props['onUpdate:active']) == null ? void 0 : _props$onUpdateActiv2.call(props, length.value - 1) : (_props$onUpdateActiv3 = props['onUpdate:active']) == null ? void 0 : _props$onUpdateActiv3.call(props, 0) : null;
118
+ isNumber(active) ? active > length.value - 1 ? call(props['onUpdate:active'], length.value - 1) : call(props['onUpdate:active'], 0) : null;
116
119
  return matchIndex();
117
120
  };
118
121
 
@@ -201,6 +204,8 @@ export default defineComponent({
201
204
  scrollerEl,
202
205
  Transition,
203
206
  toSizeUnit,
207
+ n,
208
+ classes,
204
209
  resize
205
210
  };
206
211
  }
@@ -2,12 +2,16 @@ import VarSwipe from '../swipe';
2
2
  import { defineComponent, watch, ref } from 'vue';
3
3
  import { useTabItem } from './provide';
4
4
  import { props } from './props';
5
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
5
+ import { call, createNamespace } from '../utils/components';
6
+ var {
7
+ n
8
+ } = createNamespace('tabs-items');
9
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
6
10
  export function render(_ctx, _cache) {
7
11
  var _component_var_swipe = _resolveComponent("var-swipe");
8
12
 
9
13
  return _openBlock(), _createBlock(_component_var_swipe, {
10
- class: "var-tabs-items",
14
+ class: _normalizeClass(_ctx.n()),
11
15
  ref: "swipe",
12
16
  loop: _ctx.loop,
13
17
  touchable: _ctx.canSwipe,
@@ -20,7 +24,7 @@ export function render(_ctx, _cache) {
20
24
 
21
25
  }, 8
22
26
  /* PROPS */
23
- , ["loop", "touchable", "onChange"]);
27
+ , ["class", "loop", "touchable", "onChange"]);
24
28
  }
25
29
  export default defineComponent({
26
30
  render,
@@ -80,7 +84,7 @@ export default defineComponent({
80
84
  };
81
85
 
82
86
  var handleSwipeChange = currentIndex => {
83
- var _tabItem$name$value, _props$onUpdateActiv;
87
+ var _tabItem$name$value;
84
88
 
85
89
  var tabItem = tabItemList.find(_ref4 => {
86
90
  var {
@@ -89,7 +93,7 @@ export default defineComponent({
89
93
  return index.value === currentIndex;
90
94
  });
91
95
  var active = (_tabItem$name$value = tabItem.name.value) != null ? _tabItem$name$value : tabItem.index.value;
92
- (_props$onUpdateActiv = props['onUpdate:active']) == null ? void 0 : _props$onUpdateActiv.call(props, active);
96
+ call(props['onUpdate:active'], active);
93
97
  };
94
98
 
95
99
  var tabsItemsProvider = {};
@@ -98,6 +102,7 @@ export default defineComponent({
98
102
  watch(() => length.value, () => handleActiveChange(props.active));
99
103
  return {
100
104
  swipe,
105
+ n,
101
106
  handleSwipeChange
102
107
  };
103
108
  }
@@ -0,0 +1,4 @@
1
+ export default {
2
+ '--bottom-navigation-background-color': '#272727',
3
+ '--bottom-navigation-border-color': '#444'
4
+ };
@@ -0,0 +1,3 @@
1
+ export default {
2
+ '--bottom-navigation-item-active-background-color': '#272727'
3
+ };
@@ -27,6 +27,8 @@ import timePicker from './timePicker';
27
27
  import uploader from './uploader';
28
28
  import tabs from './tabs';
29
29
  import appBar from './appBar';
30
+ import bottomNavigation from './bottomNavigation';
31
+ import bottomNavigationItem from './bottomNavigationItem';
30
32
  export default _extends({
31
33
  // common
32
34
  '--color-body': '#1e1e1e',
@@ -38,4 +40,4 @@ export default _extends({
38
40
  '--color-danger': '#ef5350',
39
41
  '--color-disabled': '#404040',
40
42
  '--color-text-disabled': '#757575'
41
- }, button, cell, card, timePicker, datePicker, skeleton, tabs, tab, popup, dialog, actionSheet, chip, badge, uploader, collapse, pullRefresh, switchThemes, steps, pagination, table, input, select, radio, checkbox, divider, picker, appBar);
43
+ }, button, cell, card, timePicker, datePicker, skeleton, tabs, tab, popup, dialog, actionSheet, chip, badge, uploader, collapse, pullRefresh, switchThemes, steps, pagination, table, input, select, radio, checkbox, divider, picker, appBar, bottomNavigation, bottomNavigationItem);