@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
@@ -5,10 +5,14 @@ import VarFormDetails from '../form-details';
5
5
  import { computed, defineComponent, ref, watch, nextTick } from 'vue';
6
6
  import { isArray, isEmpty } from '../utils/shared';
7
7
  import { props } from './props';
8
- import { useValidation } from '../utils/components';
8
+ import { useValidation, createNamespace, call } from '../utils/components';
9
9
  import { useOptions } from './provide';
10
10
  import { useForm } from '../form/provide';
11
11
  import { toPxNum } from '../utils/elements';
12
+ var {
13
+ n,
14
+ classes
15
+ } = createNamespace('select');
12
16
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
13
17
 
14
18
  var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
@@ -17,19 +21,8 @@ var _hoisted_1 = {
17
21
  key: 0
18
22
  };
19
23
  var _hoisted_2 = {
20
- key: 0,
21
- class: "var-select__chips"
22
- };
23
- var _hoisted_3 = {
24
- key: 1,
25
- class: "var-select__values"
26
- };
27
- var _hoisted_4 = {
28
24
  key: 1
29
25
  };
30
- var _hoisted_5 = {
31
- class: "var-select__scroller"
32
- };
33
26
  export function render(_ctx, _cache) {
34
27
  var _component_var_chip = _resolveComponent("var-chip");
35
28
 
@@ -40,43 +33,50 @@ export function render(_ctx, _cache) {
40
33
  var _component_var_form_details = _resolveComponent("var-form-details");
41
34
 
42
35
  return _openBlock(), _createElementBlock("div", {
43
- class: _normalizeClass(["var-select var--box", [_ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
36
+ class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
44
37
  onClick: _cache[3] || (_cache[3] = function () {
45
38
  return _ctx.handleClick && _ctx.handleClick(...arguments);
46
39
  })
47
40
  }, [_createElementVNode("div", {
48
- class: _normalizeClass(["var-select__controller", [_ctx.isFocus ? 'var-select--focus' : null, _ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
41
+ class: _normalizeClass(_ctx.classes(_ctx.n('controller'), [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
49
42
  style: _normalizeStyle({
50
43
  color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
51
44
  })
52
45
  }, [_createElementVNode("div", {
53
- class: _normalizeClass(["var-select__icon", [!_ctx.hint ? 'var-select--non-hint' : null]])
46
+ class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
54
47
  }, [_renderSlot(_ctx.$slots, "prepend-icon")], 2
55
48
  /* CLASS */
56
49
  ), _createVNode(_component_var_menu, {
57
- class: "var-select__menu",
50
+ class: _normalizeClass(_ctx.n('menu')),
58
51
  "var-select-cover": "",
59
52
  "offset-y": _ctx.offsetY,
60
53
  show: _ctx.isFocus,
61
54
  "onUpdate:show": _cache[2] || (_cache[2] = $event => _ctx.isFocus = $event),
62
55
  onClose: _ctx.handleBlur
63
56
  }, {
64
- menu: _withCtx(() => [_createElementVNode("div", _hoisted_5, [_renderSlot(_ctx.$slots, "default")])]),
57
+ menu: _withCtx(() => [_createElementVNode("div", {
58
+ class: _normalizeClass(_ctx.n('scroller'))
59
+ }, [_renderSlot(_ctx.$slots, "default")], 2
60
+ /* CLASS */
61
+ )]),
65
62
  default: _withCtx(() => [_createElementVNode("div", {
66
- class: _normalizeClass(["var-select__wrap", [!_ctx.hint ? 'var-select--non-hint' : null]]),
63
+ class: _normalizeClass(_ctx.classes(_ctx.n('wrap'), [!_ctx.hint, _ctx.n('--non-hint')])),
67
64
  ref: "wrapEl",
68
65
  onClick: _cache[1] || (_cache[1] = function () {
69
66
  return _ctx.handleFocus && _ctx.handleFocus(...arguments);
70
67
  })
71
68
  }, [_createElementVNode("div", {
72
- class: _normalizeClass(["var-select__select", [_ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
69
+ class: _normalizeClass(_ctx.classes(_ctx.n('select'), [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
73
70
  style: _normalizeStyle({
74
71
  textAlign: _ctx.textAlign,
75
72
  color: _ctx.textColor
76
73
  })
77
- }, [_ctx.multiple ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.chip ? (_openBlock(), _createElementBlock("div", _hoisted_2, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.labels, l => {
74
+ }, [_ctx.multiple ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.chip ? (_openBlock(), _createElementBlock("div", {
75
+ key: 0,
76
+ class: _normalizeClass(_ctx.n('chips'))
77
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.labels, l => {
78
78
  return _openBlock(), _createBlock(_component_var_chip, {
79
- class: "var-select__chip",
79
+ class: _normalizeClass(_ctx.n('chip')),
80
80
  "var-select-cover": "",
81
81
  closable: "",
82
82
  size: "small",
@@ -93,15 +93,20 @@ export function render(_ctx, _cache) {
93
93
 
94
94
  }, 1032
95
95
  /* PROPS, DYNAMIC_SLOTS */
96
- , ["type", "onClose"]);
96
+ , ["class", "type", "onClose"]);
97
97
  }), 128
98
98
  /* KEYED_FRAGMENT */
99
- ))])) : (_openBlock(), _createElementBlock("div", _hoisted_3, _toDisplayString(_ctx.labels.join(_ctx.separator)), 1
100
- /* TEXT */
101
- ))])) : (_openBlock(), _createElementBlock("span", _hoisted_4, _toDisplayString(_ctx.label), 1
99
+ ))], 2
100
+ /* CLASS */
101
+ )) : (_openBlock(), _createElementBlock("div", {
102
+ key: 1,
103
+ class: _normalizeClass(_ctx.n('values'))
104
+ }, _toDisplayString(_ctx.labels.join(_ctx.separator)), 3
105
+ /* TEXT, CLASS */
106
+ ))])) : (_openBlock(), _createElementBlock("span", _hoisted_2, _toDisplayString(_ctx.label), 1
102
107
  /* TEXT */
103
108
  )), _createVNode(_component_var_icon, {
104
- class: _normalizeClass(["var-select__arrow", [_ctx.isFocus ? 'var-select--arrow-rotate' : null]]),
109
+ class: _normalizeClass(_ctx.classes(_ctx.n('arrow'), [_ctx.isFocus, _ctx.n('--arrow-rotate')])),
105
110
  "var-select-cover": "",
106
111
  name: "menu-down",
107
112
  transition: 300
@@ -110,7 +115,7 @@ export function render(_ctx, _cache) {
110
115
  , ["class"])], 6
111
116
  /* CLASS, STYLE */
112
117
  ), _createElementVNode("label", {
113
- class: _normalizeClass(["var-select__placeholder var--ellipsis", [_ctx.isFocus ? 'var-select--focus' : null, _ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null, _ctx.computePlaceholderState(), !_ctx.hint ? 'var-select--placeholder-non-hint' : null]]),
118
+ class: _normalizeClass(_ctx.classes(_ctx.n('placeholder'), 'var--ellipsis', [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], _ctx.computePlaceholderState(), [!_ctx.hint, _ctx.n('--placeholder-non-hint')])),
114
119
  style: _normalizeStyle({
115
120
  color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
116
121
  })
@@ -124,28 +129,28 @@ export function render(_ctx, _cache) {
124
129
 
125
130
  }, 8
126
131
  /* PROPS */
127
- , ["offset-y", "show", "onClose"]), _createElementVNode("div", {
128
- class: _normalizeClass(["var-select__icon", [!_ctx.hint ? 'var-select--non-hint' : null]])
132
+ , ["class", "offset-y", "show", "onClose"]), _createElementVNode("div", {
133
+ class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
129
134
  }, [_renderSlot(_ctx.$slots, "append-icon", {}, () => [_ctx.clearable ? (_openBlock(), _createBlock(_component_var_icon, {
130
135
  key: 0,
131
- class: "var-select__clear-icon",
136
+ class: _normalizeClass(_ctx.n('clear-icon')),
132
137
  name: "close-circle",
133
138
  size: "14px",
134
139
  onClick: _ctx.handleClear
135
140
  }, null, 8
136
141
  /* PROPS */
137
- , ["onClick"])) : _createCommentVNode("v-if", true)])], 2
142
+ , ["class", "onClick"])) : _createCommentVNode("v-if", true)])], 2
138
143
  /* CLASS */
139
144
  )], 6
140
145
  /* CLASS, STYLE */
141
146
  ), _ctx.line ? (_openBlock(), _createElementBlock("div", {
142
147
  key: 0,
143
- class: _normalizeClass(["var-select__line", [_ctx.formDisabled || _ctx.disabled ? 'var-select--line-disabled' : null, _ctx.errorMessage ? 'var-select--line-error' : null]]),
148
+ class: _normalizeClass(_ctx.classes(_ctx.n('line'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
144
149
  style: _normalizeStyle({
145
150
  background: !_ctx.errorMessage ? _ctx.blurColor : undefined
146
151
  })
147
152
  }, [_createElementVNode("div", {
148
- class: _normalizeClass(["var-select__dot", [_ctx.isFocus ? 'var-select--spread' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--line-disabled' : null, _ctx.errorMessage ? 'var-select--line-error' : null]]),
153
+ class: _normalizeClass(_ctx.classes(_ctx.n('dot'), [_ctx.isFocus, _ctx.n('--spread')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
149
154
  style: _normalizeStyle({
150
155
  background: !_ctx.errorMessage ? _ctx.focusColor : undefined
151
156
  })
@@ -269,11 +274,11 @@ export default defineComponent({
269
274
  } = props;
270
275
 
271
276
  if (!hint && !isEmpty(modelValue)) {
272
- return 'var-select--placeholder-hidden';
277
+ return n('--placeholder-hidden');
273
278
  }
274
279
 
275
280
  if (hint && (!isEmpty(modelValue) || isFocus.value)) {
276
- return 'var-select--placeholder-hint';
281
+ return n('--placeholder-hint');
277
282
  }
278
283
  };
279
284
 
@@ -300,7 +305,7 @@ export default defineComponent({
300
305
  wrapWidth.value = getWrapWidth();
301
306
  offsetY.value = getOffsetY() + toPxNum(props.offsetY);
302
307
  isFocus.value = true;
303
- onFocus == null ? void 0 : onFocus();
308
+ call(onFocus);
304
309
  validateWithTrigger('onFocus');
305
310
  };
306
311
 
@@ -315,13 +320,11 @@ export default defineComponent({
315
320
  return;
316
321
  }
317
322
 
318
- onBlur == null ? void 0 : onBlur();
323
+ call(onBlur);
319
324
  validateWithTrigger('onBlur');
320
325
  };
321
326
 
322
327
  var onSelect = option => {
323
- var _props$onUpdateModel;
324
-
325
328
  var {
326
329
  disabled,
327
330
  readonly,
@@ -339,15 +342,13 @@ export default defineComponent({
339
342
  } = _ref4;
340
343
  return selected.value;
341
344
  }).map(findValueOrLabel) : findValueOrLabel(option);
342
- (_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, selectedValue);
343
- onChange == null ? void 0 : onChange(selectedValue);
345
+ call(props['onUpdate:modelValue'], selectedValue);
346
+ call(onChange, selectedValue);
344
347
  validateWithTrigger('onChange');
345
348
  !multiple && (isFocus.value = false);
346
349
  };
347
350
 
348
351
  var handleClear = () => {
349
- var _props$onUpdateModel2;
350
-
351
352
  var {
352
353
  disabled,
353
354
  readonly,
@@ -361,8 +362,8 @@ export default defineComponent({
361
362
  }
362
363
 
363
364
  var changedModelValue = multiple ? [] : undefined;
364
- (_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, changedModelValue);
365
- onClear == null ? void 0 : onClear(changedModelValue);
365
+ call(props['onUpdate:modelValue'], changedModelValue);
366
+ call(onClear, changedModelValue);
366
367
  validateWithTrigger('onClear');
367
368
  };
368
369
 
@@ -376,13 +377,11 @@ export default defineComponent({
376
377
  return;
377
378
  }
378
379
 
379
- onClick == null ? void 0 : onClick(e);
380
+ call(onClick, e);
380
381
  validateWithTrigger('onClick');
381
382
  };
382
383
 
383
384
  var handleClose = text => {
384
- var _props$onUpdateModel3;
385
-
386
385
  var {
387
386
  disabled,
388
387
  readonly,
@@ -406,8 +405,8 @@ export default defineComponent({
406
405
 
407
406
  return value !== ((_value$value = option.value.value) != null ? _value$value : option.label.value);
408
407
  });
409
- (_props$onUpdateModel3 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel3.call(props, currentModelValue);
410
- onClose == null ? void 0 : onClose(currentModelValue);
408
+ call(props['onUpdate:modelValue'], currentModelValue);
409
+ call(onClose, currentModelValue);
411
410
  validateWithTrigger('onClose');
412
411
  };
413
412
 
@@ -444,9 +443,7 @@ export default defineComponent({
444
443
 
445
444
 
446
445
  var reset = () => {
447
- var _props$onUpdateModel4;
448
-
449
- (_props$onUpdateModel4 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel4.call(props, props.multiple ? [] : undefined);
446
+ call(props['onUpdate:modelValue'], props.multiple ? [] : undefined);
450
447
  resetValidation();
451
448
  };
452
449
 
@@ -474,7 +471,7 @@ export default defineComponent({
474
471
  resetValidation
475
472
  };
476
473
  bindOptions(selectProvider);
477
- bindForm == null ? void 0 : bindForm(selectProvider);
474
+ call(bindForm, selectProvider);
478
475
  return {
479
476
  wrapEl,
480
477
  offsetY,
@@ -483,6 +480,8 @@ export default defineComponent({
483
480
  formDisabled: form == null ? void 0 : form.disabled,
484
481
  label,
485
482
  labels,
483
+ n,
484
+ classes,
486
485
  computePlaceholderState,
487
486
  handleFocus,
488
487
  handleBlur,
@@ -2,114 +2,101 @@ import { defineComponent } from 'vue';
2
2
  import { props } from './props';
3
3
  import { toSizeUnit } from '../utils/elements';
4
4
  import { toNumber } from '../utils/shared';
5
- import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, renderList as _renderList, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
6
-
7
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
8
-
9
- var _hoisted_1 = {
10
- class: "var--box var-skeleton"
11
- };
12
- var _hoisted_2 = {
13
- key: 0,
14
- class: "var-skeleton__data"
15
- };
16
- var _hoisted_3 = {
17
- key: 1,
18
- class: "var-skeleton__content"
19
- };
20
-
21
- var _hoisted_4 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
22
- class: "var-skeleton--animation"
23
- }, null, -1
24
- /* HOISTED */
25
- ));
26
-
27
- var _hoisted_5 = [_hoisted_4];
28
- var _hoisted_6 = {
29
- class: "var-skeleton__article"
30
- };
31
-
32
- var _hoisted_7 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
33
- class: "var-skeleton--animation"
34
- }, null, -1
35
- /* HOISTED */
36
- ));
37
-
38
- var _hoisted_8 = [_hoisted_7];
39
- var _hoisted_9 = {
40
- class: "var-skeleton__section"
41
- };
42
-
43
- var _hoisted_10 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
44
- class: "var-skeleton--animation"
45
- }, null, -1
46
- /* HOISTED */
47
- ));
48
-
49
- var _hoisted_11 = [_hoisted_10];
50
-
51
- var _hoisted_12 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
52
- class: "var-skeleton--animation"
53
- }, null, -1
54
- /* HOISTED */
55
- ));
56
-
57
- var _hoisted_13 = [_hoisted_12];
58
-
59
- var _hoisted_14 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
60
- class: "var-skeleton--animation"
61
- }, null, -1
62
- /* HOISTED */
63
- ));
64
-
65
- var _hoisted_15 = [_hoisted_14];
5
+ import { createNamespace } from '../utils/components';
6
+ var {
7
+ n,
8
+ classes
9
+ } = createNamespace('skeleton');
10
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, renderList as _renderList, Fragment as _Fragment } from "vue";
66
11
  export function render(_ctx, _cache) {
67
- return _openBlock(), _createElementBlock("div", _hoisted_1, [!_ctx.loading ? (_openBlock(), _createElementBlock("div", _hoisted_2, [_renderSlot(_ctx.$slots, "default")])) : _createCommentVNode("v-if", true), _ctx.loading && !_ctx.fullscreen ? (_openBlock(), _createElementBlock("div", _hoisted_3, [_ctx.card ? (_openBlock(), _createElementBlock("div", {
12
+ return _openBlock(), _createElementBlock("div", {
13
+ class: _normalizeClass(_ctx.classes('var--box', _ctx.n()))
14
+ }, [!_ctx.loading ? (_openBlock(), _createElementBlock("div", {
15
+ key: 0,
16
+ class: _normalizeClass(_ctx.n('data'))
17
+ }, [_renderSlot(_ctx.$slots, "default")], 2
18
+ /* CLASS */
19
+ )) : _createCommentVNode("v-if", true), _ctx.loading && !_ctx.fullscreen ? (_openBlock(), _createElementBlock("div", {
20
+ key: 1,
21
+ class: _normalizeClass(_ctx.n('content'))
22
+ }, [_ctx.card ? (_openBlock(), _createElementBlock("div", {
68
23
  key: 0,
69
- class: "var-skeleton__card",
24
+ class: _normalizeClass(_ctx.n('card')),
70
25
  style: _normalizeStyle({
71
26
  height: _ctx.toSizeUnit(_ctx.cardHeight)
72
27
  })
73
- }, _hoisted_5, 4
74
- /* STYLE */
75
- )) : _createCommentVNode("v-if", true), _createElementVNode("div", _hoisted_6, [_ctx.avatar ? (_openBlock(), _createElementBlock("div", {
28
+ }, [_createElementVNode("div", {
29
+ class: _normalizeClass(_ctx.n('--animation'))
30
+ }, null, 2
31
+ /* CLASS */
32
+ )], 6
33
+ /* CLASS, STYLE */
34
+ )) : _createCommentVNode("v-if", true), _createElementVNode("div", {
35
+ class: _normalizeClass(_ctx.n('article'))
36
+ }, [_ctx.avatar ? (_openBlock(), _createElementBlock("div", {
76
37
  key: 0,
77
- class: "var-skeleton__avatar",
38
+ class: _normalizeClass(_ctx.n('avatar')),
78
39
  style: _normalizeStyle({
79
40
  width: _ctx.toSizeUnit(_ctx.avatarSize),
80
41
  height: _ctx.toSizeUnit(_ctx.avatarSize)
81
42
  })
82
- }, _hoisted_8, 4
83
- /* STYLE */
84
- )) : _createCommentVNode("v-if", true), _createElementVNode("div", _hoisted_9, [_ctx.title ? (_openBlock(), _createElementBlock("div", {
43
+ }, [_createElementVNode("div", {
44
+ class: _normalizeClass(_ctx.n('--animation'))
45
+ }, null, 2
46
+ /* CLASS */
47
+ )], 6
48
+ /* CLASS, STYLE */
49
+ )) : _createCommentVNode("v-if", true), _createElementVNode("div", {
50
+ class: _normalizeClass(_ctx.n('section'))
51
+ }, [_ctx.title ? (_openBlock(), _createElementBlock("div", {
85
52
  key: 0,
86
- class: "var-skeleton__title",
53
+ class: _normalizeClass(_ctx.n('title')),
87
54
  style: _normalizeStyle({
88
55
  width: _ctx.toSizeUnit(_ctx.titleWidth)
89
56
  })
90
- }, _hoisted_11, 4
91
- /* STYLE */
57
+ }, [_createElementVNode("div", {
58
+ class: _normalizeClass(_ctx.n('--animation'))
59
+ }, null, 2
60
+ /* CLASS */
61
+ )], 6
62
+ /* CLASS, STYLE */
92
63
  )) : _createCommentVNode("v-if", true), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.toNumber(_ctx.rows), (r, index) => {
93
64
  return _openBlock(), _createElementBlock("div", {
94
- class: "var-skeleton__row",
65
+ class: _normalizeClass(_ctx.n('row')),
95
66
  key: r,
96
67
  style: _normalizeStyle({
97
68
  width: _ctx.toSizeUnit(_ctx.rowsWidth[index])
98
69
  })
99
- }, _hoisted_13, 4
100
- /* STYLE */
70
+ }, [_createElementVNode("div", {
71
+ class: _normalizeClass(_ctx.n('--animation'))
72
+ }, null, 2
73
+ /* CLASS */
74
+ )], 6
75
+ /* CLASS, STYLE */
101
76
  );
102
77
  }), 128
103
78
  /* KEYED_FRAGMENT */
104
- ))])])])) : _createCommentVNode("v-if", true), _ctx.loading && _ctx.fullscreen ? (_openBlock(), _createElementBlock("div", {
79
+ ))], 2
80
+ /* CLASS */
81
+ )], 2
82
+ /* CLASS */
83
+ )], 2
84
+ /* CLASS */
85
+ )) : _createCommentVNode("v-if", true), _ctx.loading && _ctx.fullscreen ? (_openBlock(), _createElementBlock("div", {
105
86
  key: 2,
106
- class: "var-skeleton__fullscreen",
87
+ class: _normalizeClass(_ctx.n('fullscreen')),
107
88
  style: _normalizeStyle({
108
89
  zIndex: _ctx.toNumber(_ctx.fullscreenZIndex)
109
90
  })
110
- }, _hoisted_15, 4
111
- /* STYLE */
112
- )) : _createCommentVNode("v-if", true)]);
91
+ }, [_createElementVNode("div", {
92
+ class: _normalizeClass(_ctx.n('--animation'))
93
+ }, null, 2
94
+ /* CLASS */
95
+ )], 6
96
+ /* CLASS, STYLE */
97
+ )) : _createCommentVNode("v-if", true)], 2
98
+ /* CLASS */
99
+ );
113
100
  }
114
101
  export default defineComponent({
115
102
  render,
@@ -118,6 +105,8 @@ export default defineComponent({
118
105
 
119
106
  setup() {
120
107
  return {
108
+ n,
109
+ classes,
121
110
  toSizeUnit,
122
111
  toNumber
123
112
  };