@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
@@ -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
@@ -1,35 +1,40 @@
1
1
  import { defineComponent } from 'vue';
2
+ import { createNamespace } from '../utils/components';
2
3
  import { props } from './props';
3
- import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
4
-
5
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
6
-
7
- var _hoisted_1 = {
8
- key: 0,
9
- class: "var-form-details"
10
- };
11
- var _hoisted_2 = {
12
- class: "var-form-details__message"
13
- };
14
- var _hoisted_3 = {
15
- class: "var-form-details__length"
16
- };
4
+ var {
5
+ n
6
+ } = createNamespace('form-details');
7
+ import { toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createBlock as _createBlock } from "vue";
17
8
  export function render(_ctx, _cache) {
18
9
  return _openBlock(), _createBlock(_Transition, {
19
- name: "var-form-details"
10
+ name: _ctx.n()
20
11
  }, {
21
- default: _withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, _toDisplayString(_ctx.errorMessage), 1
22
- /* TEXT */
23
- ), _createElementVNode("div", _hoisted_3, _toDisplayString(_ctx.maxlengthText), 1
24
- /* TEXT */
25
- )])) : _createCommentVNode("v-if", true)]),
12
+ default: _withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (_openBlock(), _createElementBlock("div", {
13
+ key: 0,
14
+ class: _normalizeClass(_ctx.n())
15
+ }, [_createElementVNode("div", {
16
+ class: _normalizeClass(_ctx.n('message'))
17
+ }, _toDisplayString(_ctx.errorMessage), 3
18
+ /* TEXT, CLASS */
19
+ ), _createElementVNode("div", {
20
+ class: _normalizeClass(_ctx.n('length'))
21
+ }, _toDisplayString(_ctx.maxlengthText), 3
22
+ /* TEXT, CLASS */
23
+ )], 2
24
+ /* CLASS */
25
+ )) : _createCommentVNode("v-if", true)]),
26
26
  _: 1
27
27
  /* STABLE */
28
28
 
29
- });
29
+ }, 8
30
+ /* PROPS */
31
+ , ["name"]);
30
32
  }
31
33
  export default defineComponent({
32
34
  render,
33
35
  name: 'VarFormDetails',
34
- props
36
+ props,
37
+ setup: () => ({
38
+ n
39
+ })
35
40
  });
package/es/icon/Icon.js CHANGED
@@ -6,10 +6,15 @@ import { defineComponent, watch, ref, nextTick } from 'vue';
6
6
  import { isURL, toNumber } from '../utils/shared';
7
7
  import { props } from './props';
8
8
  import { toSizeUnit } from '../utils/elements';
9
+ import { createNamespace } from '../utils/components';
10
+ var {
11
+ n,
12
+ classes
13
+ } = createNamespace('icon');
9
14
  import { resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createBlock as _createBlock } from "vue";
10
15
  export function render(_ctx, _cache) {
11
16
  return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.isURL(_ctx.name) ? 'img' : 'i'), {
12
- class: _normalizeClass(["var-icon", [_ctx.namespace + "--set", _ctx.isURL(_ctx.name) ? 'var-icon__image' : _ctx.namespace + "-" + _ctx.nextName, _ctx.shrinking ? 'var-icon--shrinking' : null]]),
17
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.namespace + "--set", [_ctx.isURL(_ctx.name), _ctx.n('image'), _ctx.namespace + "-" + _ctx.nextName], [_ctx.shrinking, _ctx.n('--shrinking')])),
13
18
  style: _normalizeStyle({
14
19
  color: _ctx.color,
15
20
  transition: "transform " + _ctx.toNumber(_ctx.transition) + "ms",
@@ -60,6 +65,8 @@ export default defineComponent({
60
65
  immediate: true
61
66
  });
62
67
  return {
68
+ n,
69
+ classes,
63
70
  nextName,
64
71
  shrinking,
65
72
  isURL,