@varlet/ui 1.26.9 → 1.27.0-alpha.1649265140569

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 (247) hide show
  1. package/README.en-US.md +1 -1
  2. package/README.md +1 -1
  3. package/es/action-sheet/ActionSheet.js +29 -27
  4. package/es/app-bar/AppBar.js +32 -27
  5. package/es/back-top/BackTop.js +9 -2
  6. package/es/badge/Badge.js +22 -14
  7. package/es/bottom-navigation/BottomNavigation.js +204 -0
  8. package/es/bottom-navigation/BottomNavigationSfc.css +0 -0
  9. package/es/bottom-navigation/BottomNavigationSfc.less +0 -0
  10. package/es/bottom-navigation/bottomNavigation.css +1 -0
  11. package/es/bottom-navigation/bottomNavigation.less +51 -0
  12. package/es/bottom-navigation/index.js +8 -0
  13. package/es/bottom-navigation/props.js +40 -0
  14. package/es/bottom-navigation/provide.js +17 -0
  15. package/es/bottom-navigation/style/index.js +4 -0
  16. package/es/bottom-navigation/style/less.js +4 -0
  17. package/es/bottom-navigation-item/BottomNavigationItem.js +122 -0
  18. package/es/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  19. package/es/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  20. package/es/bottom-navigation-item/bottomNavigationItem.css +1 -0
  21. package/es/bottom-navigation-item/bottomNavigationItem.less +78 -0
  22. package/es/bottom-navigation-item/index.js +8 -0
  23. package/es/bottom-navigation-item/props.js +22 -0
  24. package/es/bottom-navigation-item/provide.js +21 -0
  25. package/es/bottom-navigation-item/style/index.js +6 -0
  26. package/es/bottom-navigation-item/style/less.js +6 -0
  27. package/es/button/Button.js +12 -5
  28. package/es/card/Card.js +33 -28
  29. package/es/cell/Cell.js +26 -15
  30. package/es/checkbox/Checkbox.js +28 -26
  31. package/es/checkbox-group/CheckboxGroup.js +21 -25
  32. package/es/chip/Chip.js +16 -7
  33. package/es/chip/chip.css +1 -1
  34. package/es/chip/chip.less +11 -11
  35. package/es/col/Col.js +12 -5
  36. package/es/collapse/Collapse.js +15 -12
  37. package/es/collapse-item/CollapseItem.js +31 -30
  38. package/es/collapse-item/collapseItem.css +1 -1
  39. package/es/collapse-item/collapseItem.less +16 -16
  40. package/es/countdown/Countdown.js +14 -11
  41. package/es/counter/Counter.js +30 -27
  42. package/es/date-picker/DatePicker.js +28 -23
  43. package/es/date-picker/date-picker.css +1 -1
  44. package/es/date-picker/date-picker.less +22 -20
  45. package/es/date-picker/src/day-picker-panel.js +41 -34
  46. package/es/date-picker/src/month-picker-panel.js +27 -21
  47. package/es/date-picker/src/panel-header.js +16 -11
  48. package/es/date-picker/src/year-picker-panel.js +17 -9
  49. package/es/dialog/Dialog.js +36 -40
  50. package/es/divider/Divider.js +16 -12
  51. package/es/form/Form.js +11 -8
  52. package/es/form-details/FormDetails.js +27 -22
  53. package/es/icon/Icon.js +8 -1
  54. package/es/image/Image.js +19 -12
  55. package/es/image-preview/ImagePreview.js +35 -34
  56. package/es/index-anchor/IndexAnchor.js +8 -1
  57. package/es/index-bar/IndexBar.js +22 -20
  58. package/es/index.js +10 -0
  59. package/es/input/Input.js +45 -44
  60. package/es/lazy/index.js +2 -1
  61. package/es/less.js +2 -0
  62. package/es/list/List.js +39 -38
  63. package/es/loading/Loading.js +31 -23
  64. package/es/loading/loading.css +1 -1
  65. package/es/loading/loading.less +32 -32
  66. package/es/menu/Menu.js +12 -10
  67. package/es/option/Option.js +16 -11
  68. package/es/pagination/Pagination.js +34 -44
  69. package/es/pagination/pagination.css +1 -1
  70. package/es/pagination/pagination.less +8 -8
  71. package/es/picker/Picker.js +51 -47
  72. package/es/popup/Popup.js +9 -5
  73. package/es/progress/Progress.js +44 -35
  74. package/es/progress/progress.css +1 -1
  75. package/es/progress/progress.less +12 -12
  76. package/es/pull-refresh/PullRefresh.js +13 -10
  77. package/es/radio/Radio.js +25 -25
  78. package/es/radio-group/RadioGroup.js +19 -19
  79. package/es/rate/Rate.js +27 -25
  80. package/es/ripple/index.js +6 -2
  81. package/es/row/Row.js +11 -4
  82. package/es/select/Select.js +53 -54
  83. package/es/skeleton/Skeleton.js +70 -81
  84. package/es/slider/Slider.js +44 -40
  85. package/es/slider/slider.css +1 -1
  86. package/es/slider/slider.less +5 -5
  87. package/es/snackbar/Snackbar.js +9 -5
  88. package/es/snackbar/core.js +20 -26
  89. package/es/snackbar/snackbar.css +1 -1
  90. package/es/snackbar/snackbar.less +66 -68
  91. package/es/snackbar/style/index.js +1 -1
  92. package/es/snackbar/style/less.js +1 -1
  93. package/es/space/Space.js +8 -3
  94. package/es/step/Step.js +25 -23
  95. package/es/step/step.css +1 -1
  96. package/es/step/step.less +10 -10
  97. package/es/steps/Steps.js +12 -5
  98. package/es/sticky/Sticky.js +14 -7
  99. package/es/style-provider/StyleProvider.js +6 -2
  100. package/es/style.css +1 -1
  101. package/es/style.js +2 -0
  102. package/es/swipe/Swipe.js +22 -16
  103. package/es/swipe-item/SwipeItem.js +9 -4
  104. package/es/switch/Switch.js +25 -23
  105. package/es/switch/switch.css +1 -1
  106. package/es/switch/switch.less +2 -2
  107. package/es/tab/Tab.js +8 -1
  108. package/es/tab-item/TabItem.js +8 -1
  109. package/es/table/Table.js +27 -20
  110. package/es/tabs/Tabs.js +23 -14
  111. package/es/tabs-items/TabsItems.js +10 -5
  112. package/es/themes/dark/bottomNavigation.js +4 -0
  113. package/es/themes/dark/bottomNavigationItem.js +3 -0
  114. package/es/themes/dark/index.js +3 -1
  115. package/es/time-picker/TimePicker.js +47 -38
  116. package/es/time-picker/clock.js +26 -22
  117. package/es/time-picker/timePicker.css +1 -1
  118. package/es/time-picker/timePicker.less +11 -11
  119. package/es/umdIndex.js +10 -0
  120. package/es/uploader/Uploader.js +62 -57
  121. package/es/utils/components.js +35 -0
  122. package/es/varlet.esm.js +2093 -1504
  123. package/highlight/attributes.json +48 -0
  124. package/highlight/tags.json +20 -0
  125. package/highlight/web-types.json +155 -1
  126. package/lib/action-sheet/ActionSheet.js +30 -26
  127. package/lib/app-bar/AppBar.js +31 -24
  128. package/lib/back-top/BackTop.js +11 -2
  129. package/lib/badge/Badge.js +23 -13
  130. package/lib/bottom-navigation/BottomNavigation.js +221 -0
  131. package/lib/bottom-navigation/BottomNavigationSfc.css +0 -0
  132. package/lib/bottom-navigation/BottomNavigationSfc.less +0 -0
  133. package/lib/bottom-navigation/bottomNavigation.css +1 -0
  134. package/lib/bottom-navigation/bottomNavigation.less +51 -0
  135. package/lib/bottom-navigation/index.js +17 -0
  136. package/lib/bottom-navigation/props.js +45 -0
  137. package/lib/bottom-navigation/provide.js +27 -0
  138. package/lib/bottom-navigation/style/index.js +4 -0
  139. package/lib/bottom-navigation/style/less.js +4 -0
  140. package/lib/bottom-navigation-item/BottomNavigationItem.js +140 -0
  141. package/lib/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  142. package/lib/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  143. package/lib/bottom-navigation-item/bottomNavigationItem.css +1 -0
  144. package/lib/bottom-navigation-item/bottomNavigationItem.less +78 -0
  145. package/lib/bottom-navigation-item/index.js +17 -0
  146. package/lib/bottom-navigation-item/props.js +27 -0
  147. package/lib/bottom-navigation-item/provide.js +28 -0
  148. package/lib/bottom-navigation-item/style/index.js +6 -0
  149. package/lib/bottom-navigation-item/style/less.js +6 -0
  150. package/lib/button/Button.js +13 -4
  151. package/lib/card/Card.js +34 -27
  152. package/lib/cell/Cell.js +26 -13
  153. package/lib/checkbox/Checkbox.js +26 -23
  154. package/lib/checkbox-group/CheckboxGroup.js +19 -22
  155. package/lib/chip/Chip.js +18 -7
  156. package/lib/chip/chip.css +1 -1
  157. package/lib/chip/chip.less +11 -11
  158. package/lib/col/Col.js +14 -5
  159. package/lib/collapse/Collapse.js +15 -10
  160. package/lib/collapse-item/CollapseItem.js +31 -28
  161. package/lib/collapse-item/collapseItem.css +1 -1
  162. package/lib/collapse-item/collapseItem.less +16 -16
  163. package/lib/countdown/Countdown.js +14 -10
  164. package/lib/counter/Counter.js +29 -26
  165. package/lib/date-picker/DatePicker.js +30 -23
  166. package/lib/date-picker/date-picker.css +1 -1
  167. package/lib/date-picker/date-picker.less +22 -20
  168. package/lib/date-picker/src/day-picker-panel.js +41 -32
  169. package/lib/date-picker/src/month-picker-panel.js +27 -19
  170. package/lib/date-picker/src/panel-header.js +16 -9
  171. package/lib/date-picker/src/year-picker-panel.js +19 -9
  172. package/lib/dialog/Dialog.js +36 -38
  173. package/lib/divider/Divider.js +16 -10
  174. package/lib/form/Form.js +11 -6
  175. package/lib/form-details/FormDetails.js +27 -20
  176. package/lib/icon/Icon.js +10 -1
  177. package/lib/image/Image.js +20 -11
  178. package/lib/image-preview/ImagePreview.js +35 -33
  179. package/lib/index-anchor/IndexAnchor.js +10 -1
  180. package/lib/index-bar/IndexBar.js +24 -20
  181. package/lib/index.js +6 -0
  182. package/lib/input/Input.js +45 -43
  183. package/lib/lazy/index.js +3 -1
  184. package/lib/less.js +2 -0
  185. package/lib/list/List.js +39 -36
  186. package/lib/loading/Loading.js +33 -23
  187. package/lib/loading/loading.css +1 -1
  188. package/lib/loading/loading.less +32 -32
  189. package/lib/menu/Menu.js +12 -9
  190. package/lib/option/Option.js +16 -9
  191. package/lib/pagination/Pagination.js +36 -44
  192. package/lib/pagination/pagination.css +1 -1
  193. package/lib/pagination/pagination.less +8 -8
  194. package/lib/picker/Picker.js +51 -46
  195. package/lib/popup/Popup.js +9 -4
  196. package/lib/progress/Progress.js +45 -34
  197. package/lib/progress/progress.css +1 -1
  198. package/lib/progress/progress.less +12 -12
  199. package/lib/pull-refresh/PullRefresh.js +14 -10
  200. package/lib/radio/Radio.js +23 -22
  201. package/lib/radio-group/RadioGroup.js +17 -16
  202. package/lib/rate/Rate.js +27 -24
  203. package/lib/ripple/index.js +7 -2
  204. package/lib/row/Row.js +12 -3
  205. package/lib/select/Select.js +53 -53
  206. package/lib/skeleton/Skeleton.js +69 -78
  207. package/lib/slider/Slider.js +42 -38
  208. package/lib/slider/slider.css +1 -1
  209. package/lib/slider/slider.less +5 -5
  210. package/lib/snackbar/Snackbar.js +9 -4
  211. package/lib/snackbar/core.js +20 -25
  212. package/lib/snackbar/snackbar.css +1 -1
  213. package/lib/snackbar/snackbar.less +66 -68
  214. package/lib/space/Space.js +9 -3
  215. package/lib/step/Step.js +26 -22
  216. package/lib/step/step.css +1 -1
  217. package/lib/step/step.less +10 -10
  218. package/lib/steps/Steps.js +13 -4
  219. package/lib/sticky/Sticky.js +15 -6
  220. package/lib/style-provider/StyleProvider.js +8 -2
  221. package/lib/style.css +1 -1
  222. package/lib/style.js +2 -0
  223. package/lib/swipe/Swipe.js +23 -16
  224. package/lib/swipe-item/SwipeItem.js +10 -3
  225. package/lib/switch/Switch.js +23 -20
  226. package/lib/switch/switch.css +1 -1
  227. package/lib/switch/switch.less +2 -2
  228. package/lib/tab/Tab.js +10 -1
  229. package/lib/tab-item/TabItem.js +10 -1
  230. package/lib/table/Table.js +27 -18
  231. package/lib/tabs/Tabs.js +25 -14
  232. package/lib/tabs-items/TabsItems.js +11 -4
  233. package/lib/themes/dark/bottomNavigation.js +9 -0
  234. package/lib/themes/dark/bottomNavigationItem.js +8 -0
  235. package/lib/themes/dark/index.js +5 -1
  236. package/lib/time-picker/TimePicker.js +49 -38
  237. package/lib/time-picker/clock.js +26 -20
  238. package/lib/time-picker/timePicker.css +1 -1
  239. package/lib/time-picker/timePicker.less +11 -11
  240. package/lib/uploader/Uploader.js +60 -55
  241. package/lib/utils/components.js +39 -0
  242. package/package.json +5 -5
  243. package/types/bottomNavigation.d.ts +19 -0
  244. package/types/bottomNavigationItem.d.ts +16 -0
  245. package/types/global.d.ts +2 -0
  246. package/types/index.d.ts +2 -0
  247. package/umd/varlet.js +4 -4
@@ -8,31 +8,28 @@ import VarButton from '../../button';
8
8
  import { defineComponent, ref, computed, watch, onMounted, reactive } from 'vue';
9
9
  import { WEEK_HEADER } from '../props';
10
10
  import { toNumber } from '../../utils/shared';
11
+ import { createNamespace } from '../../utils/components';
11
12
  import { pack } from '../../locale';
12
13
  dayjs.extend(isSameOrBefore);
13
14
  dayjs.extend(isSameOrAfter);
14
- import { resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, Transition as _Transition, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
15
-
16
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
17
-
18
- var _hoisted_1 = {
19
- class: "var-day-picker__panel"
20
- };
21
- var _hoisted_2 = {
22
- class: "var-day-picker__content"
23
- };
24
- var _hoisted_3 = {
25
- class: "var-day-picker__head"
26
- };
27
- var _hoisted_4 = {
28
- class: "var-day-picker__body"
29
- };
15
+ var {
16
+ n,
17
+ classes
18
+ } = createNamespace('day-picker');
19
+ var {
20
+ n: nDate
21
+ } = createNamespace('date-picker');
22
+ import { resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, Transition as _Transition } from "vue";
30
23
  export function render(_ctx, _cache) {
31
24
  var _component_panel_header = _resolveComponent("panel-header");
32
25
 
33
26
  var _component_var_button = _resolveComponent("var-button");
34
27
 
35
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, [_createVNode(_component_panel_header, {
28
+ return _openBlock(), _createElementBlock("div", {
29
+ class: _normalizeClass(_ctx.n())
30
+ }, [_createElementVNode("div", {
31
+ class: _normalizeClass(_ctx.n('content'))
32
+ }, [_createVNode(_component_panel_header, {
36
33
  ref: "headerEl",
37
34
  type: "day",
38
35
  date: _ctx.preview,
@@ -42,11 +39,13 @@ export function render(_ctx, _cache) {
42
39
  }, null, 8
43
40
  /* PROPS */
44
41
  , ["date", "disabled", "onCheckPanel", "onCheckDate"]), _createVNode(_Transition, {
45
- name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
42
+ name: "" + _ctx.nDate() + (_ctx.reverse ? '-reverse' : '') + "-translatex"
46
43
  }, {
47
44
  default: _withCtx(() => [(_openBlock(), _createElementBlock("div", {
48
45
  key: _ctx.panelKey
49
- }, [_createElementVNode("ul", _hoisted_3, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sortWeekList, week => {
46
+ }, [_createElementVNode("ul", {
47
+ class: _normalizeClass(_ctx.n('head'))
48
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sortWeekList, week => {
50
49
  return _openBlock(), _createElementBlock("li", {
51
50
  key: week.index
52
51
  }, _toDisplayString(_ctx.getDayAbbr(week.index)), 1
@@ -54,14 +53,15 @@ export function render(_ctx, _cache) {
54
53
  );
55
54
  }), 128
56
55
  /* KEYED_FRAGMENT */
57
- ))]), _createElementVNode("ul", _hoisted_4, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.days, (day, index) => {
56
+ ))], 2
57
+ /* CLASS */
58
+ ), _createElementVNode("ul", {
59
+ class: _normalizeClass(_ctx.n('body'))
60
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.days, (day, index) => {
58
61
  return _openBlock(), _createElementBlock("li", {
59
62
  key: index
60
63
  }, [_createVNode(_component_var_button, _mergeProps({
61
64
  type: "primary",
62
- class: ["var-day-picker__button", {
63
- 'var-day-picker__button--usable': day > 0
64
- }],
65
65
  "var-day-picker-cover": "",
66
66
  round: "",
67
67
  ripple: false
@@ -76,16 +76,22 @@ export function render(_ctx, _cache) {
76
76
 
77
77
  }, 1040
78
78
  /* FULL_PROPS, DYNAMIC_SLOTS */
79
- , ["class", "onClick"])]);
79
+ , ["onClick"])]);
80
80
  }), 128
81
81
  /* KEYED_FRAGMENT */
82
- ))])]))]),
82
+ ))], 2
83
+ /* CLASS */
84
+ )]))]),
83
85
  _: 1
84
86
  /* STABLE */
85
87
 
86
88
  }, 8
87
89
  /* PROPS */
88
- , ["name"])])]);
90
+ , ["name"])], 2
91
+ /* CLASS */
92
+ )], 2
93
+ /* CLASS */
94
+ );
89
95
  }
90
96
  export default defineComponent({
91
97
  render,
@@ -233,7 +239,8 @@ export default defineComponent({
233
239
  return {
234
240
  text: true,
235
241
  outline: false,
236
- textColor: ''
242
+ textColor: '',
243
+ class: n('button')
237
244
  };
238
245
  }
239
246
 
@@ -289,18 +296,16 @@ export default defineComponent({
289
296
  if (disabled) return '';
290
297
  if (computeOutline()) return color != null ? color : '';
291
298
  if (dayExist()) return '';
292
- return 'var-date-picker-color-cover';
299
+ return nDate() + "-color-cover";
293
300
  };
294
301
 
295
- var isCover = textColorOrCover().startsWith('var-date-picker');
302
+ var isCover = textColorOrCover().startsWith(nDate());
296
303
  return {
297
304
  text: computeText(),
298
305
  outline: computeOutline(),
299
306
  textColor: isCover ? '' : textColorOrCover(),
300
- 'var-date-picker-color-cover': isCover,
301
- class: {
302
- 'var-day-picker__button-disabled': disabled
303
- }
307
+ [nDate() + "-color-cover"]: isCover,
308
+ class: classes(n('button'), n('button--usable'), [disabled, n('button--disabled')])
304
309
  };
305
310
  };
306
311
 
@@ -312,7 +317,7 @@ export default defineComponent({
312
317
 
313
318
  var chooseDay = (day, event) => {
314
319
  var buttonEl = event.currentTarget;
315
- if (buttonEl.classList.contains('var-day-picker__button-disabled')) return;
320
+ if (buttonEl.classList.contains(n('button--disabled'))) return;
316
321
  emit('choose-day', day);
317
322
  }; // expose for internal
318
323
 
@@ -330,6 +335,8 @@ export default defineComponent({
330
335
  initHeader();
331
336
  });
332
337
  return {
338
+ n,
339
+ nDate,
333
340
  days,
334
341
  reverse,
335
342
  headerEl,
@@ -8,25 +8,28 @@ import { MONTH_LIST } from '../props';
8
8
  import PanelHeader from './panel-header.js'
9
9
  import VarButton from '../../button';
10
10
  import { toNumber } from '../../utils/shared';
11
+ import { createNamespace } from '../../utils/components';
11
12
  import { pack } from '../../locale';
12
13
  dayjs.extend(isSameOrBefore);
13
14
  dayjs.extend(isSameOrAfter);
14
- import { resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, Transition as _Transition, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
15
-
16
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
17
-
18
- var _hoisted_1 = {
19
- class: "var-month-picker__panel"
20
- };
21
- var _hoisted_2 = {
22
- class: "var-month-picker__content"
23
- };
15
+ var {
16
+ n,
17
+ classes
18
+ } = createNamespace('month-picker');
19
+ var {
20
+ n: nDate
21
+ } = createNamespace('date-picker');
22
+ import { resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, Transition as _Transition, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode } from "vue";
24
23
  export function render(_ctx, _cache) {
25
24
  var _component_panel_header = _resolveComponent("panel-header");
26
25
 
27
26
  var _component_var_button = _resolveComponent("var-button");
28
27
 
29
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, [_createVNode(_component_panel_header, {
28
+ return _openBlock(), _createElementBlock("div", {
29
+ class: _normalizeClass(_ctx.n())
30
+ }, [_createElementVNode("div", {
31
+ class: _normalizeClass(_ctx.n('content'))
32
+ }, [_createVNode(_component_panel_header, {
30
33
  ref: "headerEl",
31
34
  type: "month",
32
35
  date: _ctx.preview,
@@ -36,7 +39,7 @@ export function render(_ctx, _cache) {
36
39
  }, null, 8
37
40
  /* PROPS */
38
41
  , ["date", "disabled", "onCheckPanel", "onCheckDate"]), _createVNode(_Transition, {
39
- name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
42
+ name: "" + _ctx.nDate() + (_ctx.reverse ? '-reverse' : '') + "-translatex"
40
43
  }, {
41
44
  default: _withCtx(() => [(_openBlock(), _createElementBlock("ul", {
42
45
  key: _ctx.panelKey
@@ -45,7 +48,6 @@ export function render(_ctx, _cache) {
45
48
  key: month.index
46
49
  }, [_createVNode(_component_var_button, _mergeProps({
47
50
  type: "primary",
48
- class: "var-month-picker__button",
49
51
  "var-month-picker-cover": "",
50
52
  ripple: false
51
53
  }, _extends({}, _ctx.buttonProps(month.index)), {
@@ -68,7 +70,11 @@ export function render(_ctx, _cache) {
68
70
 
69
71
  }, 8
70
72
  /* PROPS */
71
- , ["name"])])]);
73
+ , ["name"])], 2
74
+ /* CLASS */
75
+ )], 2
76
+ /* CLASS */
77
+ );
72
78
  }
73
79
  export default defineComponent({
74
80
  render,
@@ -216,25 +222,23 @@ export default defineComponent({
216
222
  if (disabled) return '';
217
223
  if (computeOutline()) return color != null ? color : '';
218
224
  if (monthExist()) return '';
219
- return 'var-date-picker-color-cover';
225
+ return nDate() + "-color-cover";
220
226
  };
221
227
 
222
- var isCover = textColorOrCover().startsWith('var-date-picker');
228
+ var isCover = textColorOrCover().startsWith(nDate());
223
229
  return {
224
230
  outline: computeOutline(),
225
231
  text: computeText(),
226
232
  color: !computeText() ? color : '',
227
233
  textColor: isCover ? '' : textColorOrCover(),
228
- 'var-date-picker-color-cover': isCover,
229
- class: {
230
- 'var-month-picker__button-disabled': disabled
231
- }
234
+ [nDate() + "-color-cover"]: isCover,
235
+ class: classes(n('button'), [disabled, n('button--disabled')])
232
236
  };
233
237
  };
234
238
 
235
239
  var chooseMonth = (month, event) => {
236
240
  var buttonEl = event.currentTarget;
237
- if (buttonEl.classList.contains('var-month-picker__button-disabled')) return;
241
+ if (buttonEl.classList.contains(n('button--disabled'))) return;
238
242
  emit('choose-month', month);
239
243
  };
240
244
 
@@ -262,6 +266,8 @@ export default defineComponent({
262
266
  immediate: true
263
267
  });
264
268
  return {
269
+ n,
270
+ nDate,
265
271
  pack,
266
272
  MONTH_LIST,
267
273
  headerEl,
@@ -2,20 +2,20 @@ import VarButton from '../../button';
2
2
  import VarIcon from '../../icon';
3
3
  import { defineComponent, ref, computed, watch } from 'vue';
4
4
  import { toNumber } from '../../utils/shared';
5
+ import { createNamespace } from '../../utils/components';
5
6
  import { pack } from '../../locale';
6
- import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, Transition as _Transition, createElementVNode as _createElementVNode, 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-picker-header"
12
- };
7
+ var {
8
+ n
9
+ } = createNamespace('picker-header');
10
+ import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, Transition as _Transition, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode } from "vue";
13
11
  export function render(_ctx, _cache) {
14
12
  var _component_var_icon = _resolveComponent("var-icon");
15
13
 
16
14
  var _component_var_button = _resolveComponent("var-button");
17
15
 
18
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createVNode(_component_var_button, {
16
+ return _openBlock(), _createElementBlock("div", {
17
+ class: _normalizeClass(_ctx.n())
18
+ }, [_createVNode(_component_var_button, {
19
19
  round: "",
20
20
  text: "",
21
21
  style: {
@@ -33,7 +33,7 @@ export function render(_ctx, _cache) {
33
33
  }, 8
34
34
  /* PROPS */
35
35
  , ["disabled"]), _createElementVNode("div", {
36
- class: "var-picker-header__value",
36
+ class: _normalizeClass(_ctx.n('value')),
37
37
  onClick: _cache[1] || (_cache[1] = $event => _ctx.$emit('check-panel'))
38
38
  }, [_createVNode(_Transition, {
39
39
  name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
@@ -48,7 +48,9 @@ export function render(_ctx, _cache) {
48
48
 
49
49
  }, 8
50
50
  /* PROPS */
51
- , ["name"])]), _createVNode(_component_var_button, {
51
+ , ["name"])], 2
52
+ /* CLASS */
53
+ ), _createVNode(_component_var_button, {
52
54
  round: "",
53
55
  text: "",
54
56
  style: {
@@ -65,7 +67,9 @@ export function render(_ctx, _cache) {
65
67
 
66
68
  }, 8
67
69
  /* PROPS */
68
- , ["disabled"])]);
70
+ , ["disabled"])], 2
71
+ /* CLASS */
72
+ );
69
73
  }
70
74
  export default defineComponent({
71
75
  render,
@@ -123,6 +127,7 @@ export default defineComponent({
123
127
  forwardOrBackNum.value = 0;
124
128
  });
125
129
  return {
130
+ n,
126
131
  reverse,
127
132
  showDate,
128
133
  checkDate
@@ -1,29 +1,35 @@
1
1
  import { defineComponent, computed, onMounted } from 'vue';
2
2
  import dayjs from 'dayjs/esm';
3
3
  import { toNumber } from '../../utils/shared';
4
+ import { createNamespace } from '../../utils/components';
5
+ var {
6
+ n,
7
+ classes
8
+ } = createNamespace('year-picker');
4
9
  import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
5
10
 
6
11
  var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
7
12
 
8
- var _hoisted_1 = {
9
- class: "var-year-picker__panel"
10
- };
11
- var _hoisted_2 = ["onClick"];
13
+ var _hoisted_1 = ["onClick"];
12
14
  export function render(_ctx, _cache) {
13
- return _openBlock(), _createElementBlock("ul", _hoisted_1, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.yearList, year => {
15
+ return _openBlock(), _createElementBlock("ul", {
16
+ class: _normalizeClass(_ctx.n())
17
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.yearList, year => {
14
18
  return _openBlock(), _createElementBlock("li", {
15
19
  key: year,
16
- class: _normalizeClass([year === _ctx.toNumber(_ctx.preview) ? 'var-year-picker__panel--active' : null]),
20
+ class: _normalizeClass(_ctx.classes(_ctx.n('item'), [year === _ctx.toNumber(_ctx.preview), _ctx.n('item--active')])),
17
21
  style: _normalizeStyle({
18
22
  color: year === _ctx.toNumber(_ctx.preview) ? _ctx.componentProps.color : ''
19
23
  }),
20
24
  onClick: $event => _ctx.chooseYear(year)
21
25
  }, _toDisplayString(year), 15
22
26
  /* TEXT, CLASS, STYLE, PROPS */
23
- , _hoisted_2);
27
+ , _hoisted_1);
24
28
  }), 128
25
29
  /* KEYED_FRAGMENT */
26
- ))]);
30
+ ))], 2
31
+ /* CLASS */
32
+ );
27
33
  }
28
34
  export default defineComponent({
29
35
  render,
@@ -83,12 +89,14 @@ export default defineComponent({
83
89
  };
84
90
 
85
91
  onMounted(() => {
86
- var activeEl = document.querySelector('.var-year-picker__panel--active');
92
+ var activeEl = document.querySelector("." + n('item--active'));
87
93
  activeEl == null ? void 0 : activeEl.scrollIntoView({
88
94
  block: 'center'
89
95
  });
90
96
  });
91
97
  return {
98
+ n,
99
+ classes,
92
100
  yearList,
93
101
  chooseYear,
94
102
  toNumber
@@ -4,23 +4,19 @@ import { props } from './props';
4
4
  import { defineComponent, ref, watch } from 'vue';
5
5
  import { dt } from '../utils/shared';
6
6
  import { pack } from '../locale';
7
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
8
-
9
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
10
-
11
- var _hoisted_1 = {
12
- class: "var-dialog__title"
13
- };
14
- var _hoisted_2 = {
15
- class: "var-dialog__actions"
16
- };
7
+ import { call, createNamespace } from '../utils/components';
8
+ var {
9
+ n,
10
+ classes
11
+ } = createNamespace('dialog');
12
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps } from "vue";
17
13
  export function render(_ctx, _cache) {
18
14
  var _component_var_button = _resolveComponent("var-button");
19
15
 
20
16
  var _component_var_popup = _resolveComponent("var-popup");
21
17
 
22
18
  return _openBlock(), _createBlock(_component_var_popup, {
23
- class: "var-dialog__popup",
19
+ class: _normalizeClass(_ctx.n('popup')),
24
20
  "var-dialog-cover": "",
25
21
  show: _ctx.popupShow,
26
22
  overlay: _ctx.overlay,
@@ -37,22 +33,28 @@ export function render(_ctx, _cache) {
37
33
  onClickOverlay: _ctx.handleClickOverlay
38
34
  }, {
39
35
  default: _withCtx(() => [_createElementVNode("div", _mergeProps({
40
- class: ["var--box var-dialog", _ctx.dialogClass],
36
+ class: _ctx.classes('var--box', _ctx.n(), _ctx.dialogClass),
41
37
  style: _ctx.dialogStyle
42
- }, _ctx.$attrs), [_createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "title", {}, () => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.dialogTitle)), 1
38
+ }, _ctx.$attrs), [_createElementVNode("div", {
39
+ class: _normalizeClass(_ctx.n('title'))
40
+ }, [_renderSlot(_ctx.$slots, "title", {}, () => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.dialogTitle)), 1
43
41
  /* TEXT */
44
- )])]), _createElementVNode("div", {
45
- class: "var-dialog__message",
42
+ )])], 2
43
+ /* CLASS */
44
+ ), _createElementVNode("div", {
45
+ class: _normalizeClass(_ctx.n('message')),
46
46
  style: _normalizeStyle({
47
47
  textAlign: _ctx.messageAlign
48
48
  })
49
49
  }, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.message), 1
50
50
  /* TEXT */
51
- )])], 4
52
- /* STYLE */
53
- ), _createElementVNode("div", _hoisted_2, [_ctx.cancelButton ? (_openBlock(), _createBlock(_component_var_button, {
51
+ )])], 6
52
+ /* CLASS, STYLE */
53
+ ), _createElementVNode("div", {
54
+ class: _normalizeClass(_ctx.n('actions'))
55
+ }, [_ctx.cancelButton ? (_openBlock(), _createBlock(_component_var_button, {
54
56
  key: 0,
55
- class: "var-dialog__button var-dialog__cancel-button",
57
+ class: _normalizeClass(_ctx.classes(_ctx.n('button'), _ctx.n('cancel-button'))),
56
58
  "var-dialog-cover": "",
57
59
  text: "",
58
60
  "text-color": _ctx.cancelButtonTextColor,
@@ -67,9 +69,9 @@ export function render(_ctx, _cache) {
67
69
 
68
70
  }, 8
69
71
  /* PROPS */
70
- , ["text-color", "color", "onClick"])) : _createCommentVNode("v-if", true), _ctx.confirmButton ? (_openBlock(), _createBlock(_component_var_button, {
72
+ , ["class", "text-color", "color", "onClick"])) : _createCommentVNode("v-if", true), _ctx.confirmButton ? (_openBlock(), _createBlock(_component_var_button, {
71
73
  key: 1,
72
- class: "var-dialog__button var-dialog__confirm-button",
74
+ class: _normalizeClass(_ctx.classes(_ctx.n('button'), _ctx.n('confirm-button'))),
73
75
  "var-dialog-cover": "",
74
76
  text: "",
75
77
  "text-color": _ctx.confirmButtonTextColor,
@@ -84,7 +86,9 @@ export function render(_ctx, _cache) {
84
86
 
85
87
  }, 8
86
88
  /* PROPS */
87
- , ["text-color", "color", "onClick"])) : _createCommentVNode("v-if", true)])], 16
89
+ , ["class", "text-color", "color", "onClick"])) : _createCommentVNode("v-if", true)], 2
90
+ /* CLASS */
91
+ )], 16
88
92
  /* FULL_PROPS */
89
93
  )]),
90
94
  _: 3
@@ -92,7 +96,7 @@ export function render(_ctx, _cache) {
92
96
 
93
97
  }, 8
94
98
  /* PROPS */
95
- , ["show", "overlay", "overlay-class", "overlay-style", "lock-scroll", "close-on-click-overlay", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange", "onClickOverlay"]);
99
+ , ["class", "show", "overlay", "overlay-class", "overlay-style", "lock-scroll", "close-on-click-overlay", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange", "onClickOverlay"]);
96
100
  }
97
101
  export default defineComponent({
98
102
  render,
@@ -108,21 +112,15 @@ export default defineComponent({
108
112
  var popupShow = ref(false);
109
113
  var popupCloseOnClickOverlay = ref(false);
110
114
 
111
- var done = () => {
112
- var _props$onUpdateShow;
113
-
114
- return (_props$onUpdateShow = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow.call(props, false);
115
- };
115
+ var done = () => call(props['onUpdate:show'], false);
116
116
 
117
117
  var handleClickOverlay = () => {
118
- var _props$onUpdateShow2;
119
-
120
118
  var {
121
119
  closeOnClickOverlay,
122
120
  onClickOverlay,
123
121
  onBeforeClose
124
122
  } = props;
125
- onClickOverlay == null ? void 0 : onClickOverlay();
123
+ call(onClickOverlay);
126
124
 
127
125
  if (!closeOnClickOverlay) {
128
126
  return;
@@ -133,41 +131,37 @@ export default defineComponent({
133
131
  return;
134
132
  }
135
133
 
136
- (_props$onUpdateShow2 = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow2.call(props, false);
134
+ call(props['onUpdate:show'], false);
137
135
  };
138
136
 
139
137
  var confirm = () => {
140
- var _props$onUpdateShow3;
141
-
142
138
  var {
143
139
  onBeforeClose,
144
140
  onConfirm
145
141
  } = props;
146
- onConfirm == null ? void 0 : onConfirm();
142
+ call(onConfirm);
147
143
 
148
144
  if (onBeforeClose != null) {
149
145
  onBeforeClose('confirm', done);
150
146
  return;
151
147
  }
152
148
 
153
- (_props$onUpdateShow3 = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow3.call(props, false);
149
+ call(props['onUpdate:show'], false);
154
150
  };
155
151
 
156
152
  var cancel = () => {
157
- var _props$onUpdateShow4;
158
-
159
153
  var {
160
154
  onBeforeClose,
161
155
  onCancel
162
156
  } = props;
163
- onCancel == null ? void 0 : onCancel();
157
+ call(onCancel);
164
158
 
165
159
  if (onBeforeClose != null) {
166
160
  onBeforeClose('cancel', done);
167
161
  return;
168
162
  }
169
163
 
170
- (_props$onUpdateShow4 = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow4.call(props, false);
164
+ call(props['onUpdate:show'], false);
171
165
  };
172
166
 
173
167
  watch(() => props.show, newValue => {
@@ -186,6 +180,8 @@ export default defineComponent({
186
180
  immediate: true
187
181
  });
188
182
  return {
183
+ n,
184
+ classes,
189
185
  pack,
190
186
  dt,
191
187
  popupShow,
@@ -4,20 +4,21 @@ import { defineComponent, computed, reactive, onMounted, onUpdated, toRefs } fro
4
4
  import { toSizeUnit } from '../utils/elements';
5
5
  import { isBool, toNumber } from '../utils/shared';
6
6
  import { props } from './props';
7
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
8
-
9
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
10
-
11
- var _hoisted_1 = {
12
- key: 0,
13
- class: "var-divider__text"
14
- };
7
+ import { createNamespace } from '../utils/components';
8
+ var {
9
+ n,
10
+ classes
11
+ } = createNamespace('divider');
12
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle } from "vue";
15
13
  export function render(_ctx, _cache) {
16
14
  return _openBlock(), _createElementBlock("div", {
17
- class: _normalizeClass(["var-divider var--box", [_ctx.vertical ? 'var-divider--vertical' : null, _ctx.withText ? 'var-divider--with-text' : null, _ctx.isInset ? 'var-divider--inset' : null, _ctx.dashed ? 'var-divider--dashed' : null]]),
15
+ class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [_ctx.vertical, _ctx.n('--vertical')], [_ctx.withText, _ctx.n('--with-text')], [_ctx.isInset, _ctx.n('--inset')], [_ctx.dashed, _ctx.n('--dashed')])),
18
16
  style: _normalizeStyle(_ctx.style)
19
- }, [_renderSlot(_ctx.$slots, "default", {}, () => [_ctx.description ? (_openBlock(), _createElementBlock("span", _hoisted_1, _toDisplayString(_ctx.description), 1
20
- /* TEXT */
17
+ }, [_renderSlot(_ctx.$slots, "default", {}, () => [_ctx.description ? (_openBlock(), _createElementBlock("span", {
18
+ key: 0,
19
+ class: _normalizeClass(_ctx.n('text'))
20
+ }, _toDisplayString(_ctx.description), 3
21
+ /* TEXT, CLASS */
21
22
  )) : _createCommentVNode("v-if", true)])], 6
22
23
  /* CLASS, STYLE */
23
24
  );
@@ -68,7 +69,10 @@ export default defineComponent({
68
69
  onUpdated(() => {
69
70
  checkHasText();
70
71
  });
71
- return _extends({}, toRefs(state), {
72
+ return _extends({
73
+ n,
74
+ classes
75
+ }, toRefs(state), {
72
76
  style,
73
77
  isInset
74
78
  });
package/es/form/Form.js CHANGED
@@ -5,15 +5,17 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
5
5
  import { defineComponent, computed } from 'vue';
6
6
  import { props } from './props';
7
7
  import { useFormItems } from './provide';
8
- import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
9
-
10
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
11
-
12
- var _hoisted_1 = {
13
- class: "var-form"
14
- };
8
+ import { createNamespace } from '../utils/components';
9
+ var {
10
+ n
11
+ } = createNamespace('form');
12
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
15
13
  export function render(_ctx, _cache) {
16
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")]);
14
+ return _openBlock(), _createElementBlock("div", {
15
+ class: _normalizeClass(_ctx.n())
16
+ }, [_renderSlot(_ctx.$slots, "default")], 2
17
+ /* CLASS */
18
+ );
17
19
  }
18
20
  export default defineComponent({
19
21
  render,
@@ -66,6 +68,7 @@ export default defineComponent({
66
68
  };
67
69
  bindFormItems(formProvider);
68
70
  return {
71
+ n,
69
72
  validate,
70
73
  reset,
71
74
  resetValidation