@varlet/ui 1.26.9 → 1.27.0-alpha.1649242923701

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/es/action-sheet/ActionSheet.js +29 -27
  2. package/es/app-bar/AppBar.js +32 -27
  3. package/es/back-top/BackTop.js +9 -2
  4. package/es/badge/Badge.js +22 -14
  5. package/es/bottom-navigation/BottomNavigation.js +167 -0
  6. package/es/bottom-navigation/BottomNavigationSfc.css +0 -0
  7. package/es/bottom-navigation/BottomNavigationSfc.less +0 -0
  8. package/es/bottom-navigation/bottomNavigation.css +1 -0
  9. package/es/bottom-navigation/bottomNavigation.less +49 -0
  10. package/es/bottom-navigation/index.js +8 -0
  11. package/es/bottom-navigation/props.js +40 -0
  12. package/es/bottom-navigation/provide.js +17 -0
  13. package/es/bottom-navigation/style/index.js +4 -0
  14. package/es/bottom-navigation/style/less.js +4 -0
  15. package/es/bottom-navigation-item/BottomNavigationItem.js +122 -0
  16. package/es/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  17. package/es/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  18. package/es/bottom-navigation-item/bottomNavigationItem.css +1 -0
  19. package/es/bottom-navigation-item/bottomNavigationItem.less +78 -0
  20. package/es/bottom-navigation-item/index.js +8 -0
  21. package/es/bottom-navigation-item/props.js +22 -0
  22. package/es/bottom-navigation-item/provide.js +21 -0
  23. package/es/bottom-navigation-item/style/index.js +6 -0
  24. package/es/bottom-navigation-item/style/less.js +6 -0
  25. package/es/button/Button.js +12 -5
  26. package/es/card/Card.js +33 -28
  27. package/es/cell/Cell.js +26 -15
  28. package/es/checkbox/Checkbox.js +28 -26
  29. package/es/checkbox-group/CheckboxGroup.js +21 -25
  30. package/es/chip/Chip.js +16 -7
  31. package/es/chip/chip.css +1 -1
  32. package/es/chip/chip.less +11 -11
  33. package/es/col/Col.js +12 -5
  34. package/es/collapse/Collapse.js +15 -12
  35. package/es/collapse-item/CollapseItem.js +31 -30
  36. package/es/collapse-item/collapseItem.css +1 -1
  37. package/es/collapse-item/collapseItem.less +16 -16
  38. package/es/countdown/Countdown.js +14 -11
  39. package/es/counter/Counter.js +30 -27
  40. package/es/date-picker/DatePicker.js +28 -23
  41. package/es/date-picker/date-picker.css +1 -1
  42. package/es/date-picker/date-picker.less +22 -20
  43. package/es/date-picker/src/day-picker-panel.js +41 -34
  44. package/es/date-picker/src/month-picker-panel.js +27 -21
  45. package/es/date-picker/src/panel-header.js +16 -11
  46. package/es/date-picker/src/year-picker-panel.js +17 -9
  47. package/es/dialog/Dialog.js +36 -40
  48. package/es/divider/Divider.js +16 -12
  49. package/es/form/Form.js +11 -8
  50. package/es/form-details/FormDetails.js +27 -22
  51. package/es/icon/Icon.js +8 -1
  52. package/es/image/Image.js +19 -12
  53. package/es/image-preview/ImagePreview.js +35 -34
  54. package/es/index-anchor/IndexAnchor.js +8 -1
  55. package/es/index-bar/IndexBar.js +22 -20
  56. package/es/index.js +10 -0
  57. package/es/input/Input.js +45 -44
  58. package/es/lazy/index.js +2 -1
  59. package/es/less.js +2 -0
  60. package/es/list/List.js +39 -38
  61. package/es/loading/Loading.js +31 -23
  62. package/es/loading/loading.css +1 -1
  63. package/es/loading/loading.less +32 -32
  64. package/es/menu/Menu.js +12 -10
  65. package/es/option/Option.js +16 -11
  66. package/es/pagination/Pagination.js +34 -44
  67. package/es/pagination/pagination.css +1 -1
  68. package/es/pagination/pagination.less +8 -8
  69. package/es/picker/Picker.js +51 -47
  70. package/es/popup/Popup.js +9 -5
  71. package/es/progress/Progress.js +44 -35
  72. package/es/progress/progress.css +1 -1
  73. package/es/progress/progress.less +12 -12
  74. package/es/pull-refresh/PullRefresh.js +13 -10
  75. package/es/radio/Radio.js +25 -25
  76. package/es/radio-group/RadioGroup.js +19 -19
  77. package/es/rate/Rate.js +27 -25
  78. package/es/ripple/index.js +6 -2
  79. package/es/row/Row.js +11 -4
  80. package/es/select/Select.js +53 -54
  81. package/es/skeleton/Skeleton.js +70 -81
  82. package/es/slider/Slider.js +44 -40
  83. package/es/slider/slider.css +1 -1
  84. package/es/slider/slider.less +5 -5
  85. package/es/snackbar/Snackbar.js +9 -5
  86. package/es/snackbar/core.js +20 -26
  87. package/es/snackbar/snackbar.css +1 -1
  88. package/es/snackbar/snackbar.less +66 -68
  89. package/es/space/Space.js +8 -3
  90. package/es/step/Step.js +25 -23
  91. package/es/step/step.css +1 -1
  92. package/es/step/step.less +10 -10
  93. package/es/steps/Steps.js +12 -5
  94. package/es/sticky/Sticky.js +14 -7
  95. package/es/style-provider/StyleProvider.js +6 -2
  96. package/es/style.css +1 -1
  97. package/es/style.js +2 -0
  98. package/es/swipe/Swipe.js +22 -16
  99. package/es/swipe-item/SwipeItem.js +9 -4
  100. package/es/switch/Switch.js +25 -23
  101. package/es/switch/switch.css +1 -1
  102. package/es/switch/switch.less +2 -2
  103. package/es/tab/Tab.js +8 -1
  104. package/es/tab-item/TabItem.js +8 -1
  105. package/es/table/Table.js +27 -20
  106. package/es/tabs/Tabs.js +16 -11
  107. package/es/tabs-items/TabsItems.js +10 -5
  108. package/es/themes/dark/bottomNavigation.js +4 -0
  109. package/es/themes/dark/bottomNavigationItem.js +3 -0
  110. package/es/themes/dark/index.js +3 -1
  111. package/es/time-picker/TimePicker.js +47 -38
  112. package/es/time-picker/clock.js +26 -22
  113. package/es/time-picker/timePicker.css +1 -1
  114. package/es/time-picker/timePicker.less +11 -11
  115. package/es/umdIndex.js +10 -0
  116. package/es/uploader/Uploader.js +62 -57
  117. package/es/utils/components.js +35 -0
  118. package/es/varlet.esm.js +2082 -1527
  119. package/highlight/attributes.json +48 -0
  120. package/highlight/tags.json +20 -0
  121. package/highlight/web-types.json +155 -1
  122. package/lib/action-sheet/ActionSheet.js +30 -26
  123. package/lib/app-bar/AppBar.js +31 -24
  124. package/lib/back-top/BackTop.js +11 -2
  125. package/lib/badge/Badge.js +23 -13
  126. package/lib/bottom-navigation/BottomNavigation.js +183 -0
  127. package/lib/bottom-navigation/BottomNavigationSfc.css +0 -0
  128. package/lib/bottom-navigation/BottomNavigationSfc.less +0 -0
  129. package/lib/bottom-navigation/bottomNavigation.css +1 -0
  130. package/lib/bottom-navigation/bottomNavigation.less +49 -0
  131. package/lib/bottom-navigation/index.js +17 -0
  132. package/lib/bottom-navigation/props.js +45 -0
  133. package/lib/bottom-navigation/provide.js +27 -0
  134. package/lib/bottom-navigation/style/index.js +4 -0
  135. package/lib/bottom-navigation/style/less.js +4 -0
  136. package/lib/bottom-navigation-item/BottomNavigationItem.js +140 -0
  137. package/lib/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  138. package/lib/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
  139. package/lib/bottom-navigation-item/bottomNavigationItem.css +1 -0
  140. package/lib/bottom-navigation-item/bottomNavigationItem.less +78 -0
  141. package/lib/bottom-navigation-item/index.js +17 -0
  142. package/lib/bottom-navigation-item/props.js +27 -0
  143. package/lib/bottom-navigation-item/provide.js +28 -0
  144. package/lib/bottom-navigation-item/style/index.js +6 -0
  145. package/lib/bottom-navigation-item/style/less.js +6 -0
  146. package/lib/button/Button.js +13 -4
  147. package/lib/card/Card.js +34 -27
  148. package/lib/cell/Cell.js +26 -13
  149. package/lib/checkbox/Checkbox.js +26 -23
  150. package/lib/checkbox-group/CheckboxGroup.js +19 -22
  151. package/lib/chip/Chip.js +18 -7
  152. package/lib/chip/chip.css +1 -1
  153. package/lib/chip/chip.less +11 -11
  154. package/lib/col/Col.js +14 -5
  155. package/lib/collapse/Collapse.js +15 -10
  156. package/lib/collapse-item/CollapseItem.js +31 -28
  157. package/lib/collapse-item/collapseItem.css +1 -1
  158. package/lib/collapse-item/collapseItem.less +16 -16
  159. package/lib/countdown/Countdown.js +14 -10
  160. package/lib/counter/Counter.js +29 -26
  161. package/lib/date-picker/DatePicker.js +30 -23
  162. package/lib/date-picker/date-picker.css +1 -1
  163. package/lib/date-picker/date-picker.less +22 -20
  164. package/lib/date-picker/src/day-picker-panel.js +41 -32
  165. package/lib/date-picker/src/month-picker-panel.js +27 -19
  166. package/lib/date-picker/src/panel-header.js +16 -9
  167. package/lib/date-picker/src/year-picker-panel.js +19 -9
  168. package/lib/dialog/Dialog.js +36 -38
  169. package/lib/divider/Divider.js +16 -10
  170. package/lib/form/Form.js +11 -6
  171. package/lib/form-details/FormDetails.js +27 -20
  172. package/lib/icon/Icon.js +10 -1
  173. package/lib/image/Image.js +20 -11
  174. package/lib/image-preview/ImagePreview.js +35 -33
  175. package/lib/index-anchor/IndexAnchor.js +10 -1
  176. package/lib/index-bar/IndexBar.js +24 -20
  177. package/lib/index.js +6 -0
  178. package/lib/input/Input.js +45 -43
  179. package/lib/lazy/index.js +3 -1
  180. package/lib/less.js +2 -0
  181. package/lib/list/List.js +39 -36
  182. package/lib/loading/Loading.js +33 -23
  183. package/lib/loading/loading.css +1 -1
  184. package/lib/loading/loading.less +32 -32
  185. package/lib/menu/Menu.js +12 -9
  186. package/lib/option/Option.js +16 -9
  187. package/lib/pagination/Pagination.js +36 -44
  188. package/lib/pagination/pagination.css +1 -1
  189. package/lib/pagination/pagination.less +8 -8
  190. package/lib/picker/Picker.js +51 -46
  191. package/lib/popup/Popup.js +9 -4
  192. package/lib/progress/Progress.js +45 -34
  193. package/lib/progress/progress.css +1 -1
  194. package/lib/progress/progress.less +12 -12
  195. package/lib/pull-refresh/PullRefresh.js +14 -10
  196. package/lib/radio/Radio.js +23 -22
  197. package/lib/radio-group/RadioGroup.js +17 -16
  198. package/lib/rate/Rate.js +27 -24
  199. package/lib/ripple/index.js +7 -2
  200. package/lib/row/Row.js +12 -3
  201. package/lib/select/Select.js +53 -53
  202. package/lib/skeleton/Skeleton.js +69 -78
  203. package/lib/slider/Slider.js +42 -38
  204. package/lib/slider/slider.css +1 -1
  205. package/lib/slider/slider.less +5 -5
  206. package/lib/snackbar/Snackbar.js +9 -4
  207. package/lib/snackbar/core.js +20 -25
  208. package/lib/snackbar/snackbar.css +1 -1
  209. package/lib/snackbar/snackbar.less +66 -68
  210. package/lib/space/Space.js +9 -3
  211. package/lib/step/Step.js +26 -22
  212. package/lib/step/step.css +1 -1
  213. package/lib/step/step.less +10 -10
  214. package/lib/steps/Steps.js +13 -4
  215. package/lib/sticky/Sticky.js +15 -6
  216. package/lib/style-provider/StyleProvider.js +8 -2
  217. package/lib/style.css +1 -1
  218. package/lib/style.js +2 -0
  219. package/lib/swipe/Swipe.js +23 -16
  220. package/lib/swipe-item/SwipeItem.js +10 -3
  221. package/lib/switch/Switch.js +23 -20
  222. package/lib/switch/switch.css +1 -1
  223. package/lib/switch/switch.less +2 -2
  224. package/lib/tab/Tab.js +10 -1
  225. package/lib/tab-item/TabItem.js +10 -1
  226. package/lib/table/Table.js +27 -18
  227. package/lib/tabs/Tabs.js +18 -11
  228. package/lib/tabs-items/TabsItems.js +11 -4
  229. package/lib/themes/dark/bottomNavigation.js +9 -0
  230. package/lib/themes/dark/bottomNavigationItem.js +8 -0
  231. package/lib/themes/dark/index.js +5 -1
  232. package/lib/time-picker/TimePicker.js +49 -38
  233. package/lib/time-picker/clock.js +26 -20
  234. package/lib/time-picker/timePicker.css +1 -1
  235. package/lib/time-picker/timePicker.less +11 -11
  236. package/lib/uploader/Uploader.js +60 -55
  237. package/lib/utils/components.js +39 -0
  238. package/package.json +4 -4
  239. package/types/bottomNavigation.d.ts +19 -0
  240. package/types/bottomNavigationItem.d.ts +16 -0
  241. package/types/global.d.ts +2 -0
  242. package/types/index.d.ts +2 -0
  243. package/umd/varlet.js +4 -4
@@ -12,21 +12,24 @@ var _shared = require("../utils/shared");
12
12
 
13
13
  var _props = require("./props");
14
14
 
15
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
+ var _components = require("../utils/components");
16
16
 
17
- var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
17
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
18
 
19
- var _hoisted_1 = {
20
- key: 0,
21
- class: "var-divider__text"
22
- };
19
+ var {
20
+ n,
21
+ classes
22
+ } = (0, _components.createNamespace)('divider');
23
23
 
24
24
  function render(_ctx, _cache) {
25
25
  return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
26
- class: (0, _vue.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]]),
26
+ class: (0, _vue.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')])),
27
27
  style: (0, _vue.normalizeStyle)(_ctx.style)
28
- }, [(0, _vue.renderSlot)(_ctx.$slots, "default", {}, () => [_ctx.description ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("span", _hoisted_1, (0, _vue.toDisplayString)(_ctx.description), 1
29
- /* TEXT */
28
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "default", {}, () => [_ctx.description ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("span", {
29
+ key: 0,
30
+ class: (0, _vue.normalizeClass)(_ctx.n('text'))
31
+ }, (0, _vue.toDisplayString)(_ctx.description), 3
32
+ /* TEXT, CLASS */
30
33
  )) : (0, _vue.createCommentVNode)("v-if", true)])], 6
31
34
  /* CLASS, STYLE */
32
35
  );
@@ -78,7 +81,10 @@ var _default = (0, _vue.defineComponent)({
78
81
  (0, _vue.onUpdated)(() => {
79
82
  checkHasText();
80
83
  });
81
- return _extends({}, (0, _vue.toRefs)(state), {
84
+ return _extends({
85
+ n,
86
+ classes
87
+ }, (0, _vue.toRefs)(state), {
82
88
  style,
83
89
  isInset
84
90
  });
package/lib/form/Form.js CHANGED
@@ -10,18 +10,22 @@ var _props = require("./props");
10
10
 
11
11
  var _provide = require("./provide");
12
12
 
13
+ var _components = require("../utils/components");
14
+
13
15
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
14
16
 
15
17
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
18
 
17
- var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
18
-
19
- var _hoisted_1 = {
20
- class: "var-form"
21
- };
19
+ var {
20
+ n
21
+ } = (0, _components.createNamespace)('form');
22
22
 
23
23
  function render(_ctx, _cache) {
24
- return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [(0, _vue.renderSlot)(_ctx.$slots, "default")]);
24
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
25
+ class: (0, _vue.normalizeClass)(_ctx.n())
26
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "default")], 2
27
+ /* CLASS */
28
+ );
25
29
  }
26
30
 
27
31
  var _default = (0, _vue.defineComponent)({
@@ -75,6 +79,7 @@ var _default = (0, _vue.defineComponent)({
75
79
  };
76
80
  bindFormItems(formProvider);
77
81
  return {
82
+ n,
78
83
  validate,
79
84
  reset,
80
85
  resetValidation
@@ -6,40 +6,47 @@ exports.render = render;
6
6
 
7
7
  var _vue = require("vue");
8
8
 
9
- var _props = require("./props");
9
+ var _components = require("../utils/components");
10
10
 
11
- var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
11
+ var _props = require("./props");
12
12
 
13
- var _hoisted_1 = {
14
- key: 0,
15
- class: "var-form-details"
16
- };
17
- var _hoisted_2 = {
18
- class: "var-form-details__message"
19
- };
20
- var _hoisted_3 = {
21
- class: "var-form-details__length"
22
- };
13
+ var {
14
+ n
15
+ } = (0, _components.createNamespace)('form-details');
23
16
 
24
17
  function render(_ctx, _cache) {
25
18
  return (0, _vue.openBlock)(), (0, _vue.createBlock)(_vue.Transition, {
26
- name: "var-form-details"
19
+ name: _ctx.n()
27
20
  }, {
28
- default: (0, _vue.withCtx)(() => [_ctx.errorMessage || _ctx.maxlengthText ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [(0, _vue.createElementVNode)("div", _hoisted_2, (0, _vue.toDisplayString)(_ctx.errorMessage), 1
29
- /* TEXT */
30
- ), (0, _vue.createElementVNode)("div", _hoisted_3, (0, _vue.toDisplayString)(_ctx.maxlengthText), 1
31
- /* TEXT */
32
- )])) : (0, _vue.createCommentVNode)("v-if", true)]),
21
+ default: (0, _vue.withCtx)(() => [_ctx.errorMessage || _ctx.maxlengthText ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
22
+ key: 0,
23
+ class: (0, _vue.normalizeClass)(_ctx.n())
24
+ }, [(0, _vue.createElementVNode)("div", {
25
+ class: (0, _vue.normalizeClass)(_ctx.n('message'))
26
+ }, (0, _vue.toDisplayString)(_ctx.errorMessage), 3
27
+ /* TEXT, CLASS */
28
+ ), (0, _vue.createElementVNode)("div", {
29
+ class: (0, _vue.normalizeClass)(_ctx.n('length'))
30
+ }, (0, _vue.toDisplayString)(_ctx.maxlengthText), 3
31
+ /* TEXT, CLASS */
32
+ )], 2
33
+ /* CLASS */
34
+ )) : (0, _vue.createCommentVNode)("v-if", true)]),
33
35
  _: 1
34
36
  /* STABLE */
35
37
 
36
- });
38
+ }, 8
39
+ /* PROPS */
40
+ , ["name"]);
37
41
  }
38
42
 
39
43
  var _default = (0, _vue.defineComponent)({
40
44
  render,
41
45
  name: 'VarFormDetails',
42
- props: _props.props
46
+ props: _props.props,
47
+ setup: () => ({
48
+ n
49
+ })
43
50
  });
44
51
 
45
52
  exports.default = _default;
package/lib/icon/Icon.js CHANGED
@@ -12,13 +12,20 @@ var _props = require("./props");
12
12
 
13
13
  var _elements = require("../utils/elements");
14
14
 
15
+ var _components = require("../utils/components");
16
+
15
17
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
16
18
 
17
19
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
18
20
 
21
+ var {
22
+ n,
23
+ classes
24
+ } = (0, _components.createNamespace)('icon');
25
+
19
26
  function render(_ctx, _cache) {
20
27
  return (0, _vue.openBlock)(), (0, _vue.createBlock)((0, _vue.resolveDynamicComponent)(_ctx.isURL(_ctx.name) ? 'img' : 'i'), {
21
- class: (0, _vue.normalizeClass)(["var-icon", [_ctx.namespace + "--set", _ctx.isURL(_ctx.name) ? 'var-icon__image' : _ctx.namespace + "-" + _ctx.nextName, _ctx.shrinking ? 'var-icon--shrinking' : null]]),
28
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.namespace + "--set", [_ctx.isURL(_ctx.name), _ctx.n('image'), _ctx.namespace + "-" + _ctx.nextName], [_ctx.shrinking, _ctx.n('--shrinking')])),
22
29
  style: (0, _vue.normalizeStyle)({
23
30
  color: _ctx.color,
24
31
  transition: "transform " + _ctx.toNumber(_ctx.transition) + "ms",
@@ -70,6 +77,8 @@ var _default = (0, _vue.defineComponent)({
70
77
  immediate: true
71
78
  });
72
79
  return {
80
+ n,
81
+ classes,
73
82
  nextName,
74
83
  shrinking,
75
84
  isURL: _shared.isURL,
@@ -14,8 +14,15 @@ var _props = require("./props");
14
14
 
15
15
  var _elements = require("../utils/elements");
16
16
 
17
+ var _components = require("../utils/components");
18
+
17
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
20
 
21
+ var {
22
+ n,
23
+ classes
24
+ } = (0, _components.createNamespace)('image');
25
+
19
26
  var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
20
27
 
21
28
  var _hoisted_1 = ["alt", "lazy-error", "lazy-loading"];
@@ -27,7 +34,7 @@ function render(_ctx, _cache) {
27
34
  var _directive_ripple = (0, _vue.resolveDirective)("ripple");
28
35
 
29
36
  return (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
30
- class: (0, _vue.normalizeClass)(["var-image var--box", [!_ctx.block ? 'var--inline-block' : null]]),
37
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), 'var--box', [!_ctx.block, 'var--inline-block'])),
31
38
  style: (0, _vue.normalizeStyle)({
32
39
  width: _ctx.toSizeUnit(_ctx.width),
33
40
  height: _ctx.toSizeUnit(_ctx.height),
@@ -35,7 +42,7 @@ function render(_ctx, _cache) {
35
42
  })
36
43
  }, [_ctx.lazy ? (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("img", {
37
44
  key: 0,
38
- class: "var-image__image",
45
+ class: (0, _vue.normalizeClass)(_ctx.n('image')),
39
46
  alt: _ctx.alt,
40
47
  "lazy-error": _ctx.error,
41
48
  "lazy-loading": _ctx.loading,
@@ -51,11 +58,11 @@ function render(_ctx, _cache) {
51
58
  onClick: _cache[2] || (_cache[2] = function () {
52
59
  return _ctx.onClick && _ctx.onClick(...arguments);
53
60
  })
54
- }, null, 44
55
- /* STYLE, PROPS, HYDRATE_EVENTS */
61
+ }, null, 46
62
+ /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
56
63
  , _hoisted_1)), [[_directive_lazy, _ctx.src]]) : ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("img", {
57
64
  key: 1,
58
- class: "var-image__image",
65
+ class: (0, _vue.normalizeClass)(_ctx.n('image')),
59
66
  alt: _ctx.alt,
60
67
  style: (0, _vue.normalizeStyle)({
61
68
  objectFit: _ctx.fit
@@ -70,8 +77,8 @@ function render(_ctx, _cache) {
70
77
  onClick: _cache[5] || (_cache[5] = function () {
71
78
  return _ctx.onClick && _ctx.onClick(...arguments);
72
79
  })
73
- }, null, 44
74
- /* STYLE, PROPS, HYDRATE_EVENTS */
80
+ }, null, 46
81
+ /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
75
82
  , _hoisted_2))], 6
76
83
  /* CLASS, STYLE */
77
84
  )), [[_directive_ripple, {
@@ -98,10 +105,10 @@ var _default = (0, _vue.defineComponent)({
98
105
  } = props;
99
106
 
100
107
  if (lazy) {
101
- el._lazy.state === 'success' && (onLoad == null ? void 0 : onLoad(e));
102
- el._lazy.state === 'error' && (onError == null ? void 0 : onError(e));
108
+ el._lazy.state === 'success' && (0, _components.call)(onLoad, e);
109
+ el._lazy.state === 'error' && (0, _components.call)(onError, e);
103
110
  } else {
104
- onLoad == null ? void 0 : onLoad(e);
111
+ (0, _components.call)(onLoad, e);
105
112
  }
106
113
  };
107
114
 
@@ -110,10 +117,12 @@ var _default = (0, _vue.defineComponent)({
110
117
  lazy,
111
118
  onError
112
119
  } = props;
113
- !lazy && (onError == null ? void 0 : onError(e));
120
+ !lazy && (0, _components.call)(onError, e);
114
121
  };
115
122
 
116
123
  return {
124
+ n,
125
+ classes,
117
126
  toSizeUnit: _elements.toSizeUnit,
118
127
  handleLoad,
119
128
  handleError
@@ -18,8 +18,14 @@ var _props = require("./props");
18
18
 
19
19
  var _shared = require("../utils/shared");
20
20
 
21
+ var _components = require("../utils/components");
22
+
21
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
24
 
25
+ var {
26
+ n,
27
+ classes
28
+ } = (0, _components.createNamespace)('image-preview');
23
29
  var DISTANCE_OFFSET = 12;
24
30
  var EVENT_DELAY = 200;
25
31
  var TAP_DELAY = 350;
@@ -28,13 +34,6 @@ var ANIMATION_DURATION = 200;
28
34
  var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
29
35
 
30
36
  var _hoisted_1 = ["src", "alt"];
31
- var _hoisted_2 = {
32
- key: 0,
33
- class: "var-image-preview__indicators"
34
- };
35
- var _hoisted_3 = {
36
- class: "var-image-preview__extra"
37
- };
38
37
 
39
38
  function render(_ctx, _cache) {
40
39
  var _component_var_swipe_item = (0, _vue.resolveComponent)("var-swipe-item");
@@ -46,7 +45,7 @@ function render(_ctx, _cache) {
46
45
  var _component_var_popup = (0, _vue.resolveComponent)("var-popup");
47
46
 
48
47
  return (0, _vue.openBlock)(), (0, _vue.createBlock)(_component_var_popup, {
49
- class: "var-image-preview__popup",
48
+ class: (0, _vue.normalizeClass)(_ctx.n('popup')),
50
49
  "var-image-preview-cover": "",
51
50
  transition: "var-fade",
52
51
  show: _ctx.popupShow,
@@ -61,7 +60,7 @@ function render(_ctx, _cache) {
61
60
  onRouteChange: _ctx.onRouteChange
62
61
  }, {
63
62
  default: (0, _vue.withCtx)(() => [(0, _vue.createVNode)(_component_var_swipe, (0, _vue.mergeProps)({
64
- class: "var-image-preview__swipe",
63
+ class: _ctx.n('swipe'),
65
64
  "var-image-preview-cover": "",
66
65
  touchable: _ctx.canSwipe,
67
66
  indicator: _ctx.indicator && _ctx.images.length > 1,
@@ -71,12 +70,12 @@ function render(_ctx, _cache) {
71
70
  }, _ctx.$attrs), {
72
71
  default: (0, _vue.withCtx)(() => [((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)(_ctx.images, image => {
73
72
  return (0, _vue.openBlock)(), (0, _vue.createBlock)(_component_var_swipe_item, {
74
- class: "var-image-preview__swipe-item",
73
+ class: (0, _vue.normalizeClass)(_ctx.n('swipe-item')),
75
74
  "var-image-preview-cover": "",
76
75
  key: image
77
76
  }, {
78
77
  default: (0, _vue.withCtx)(() => [(0, _vue.createElementVNode)("div", {
79
- class: "var-image-preview__zoom-container",
78
+ class: (0, _vue.normalizeClass)(_ctx.n('zoom-container')),
80
79
  style: (0, _vue.normalizeStyle)({
81
80
  transform: "scale(" + _ctx.scale + ") translate(" + _ctx.translateX + "px, " + _ctx.translateY + "px)",
82
81
  transitionTimingFunction: _ctx.transitionTimingFunction,
@@ -92,20 +91,20 @@ function render(_ctx, _cache) {
92
91
  return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
93
92
  })
94
93
  }, [(0, _vue.createElementVNode)("img", {
95
- class: "var-image-preview__image",
94
+ class: (0, _vue.normalizeClass)(_ctx.n('image')),
96
95
  src: image,
97
96
  alt: image
98
- }, null, 8
99
- /* PROPS */
100
- , _hoisted_1)], 36
101
- /* STYLE, HYDRATE_EVENTS */
97
+ }, null, 10
98
+ /* CLASS, PROPS */
99
+ , _hoisted_1)], 38
100
+ /* CLASS, STYLE, HYDRATE_EVENTS */
102
101
  )]),
103
102
  _: 2
104
103
  /* DYNAMIC */
105
104
 
106
- }, 1024
107
- /* DYNAMIC_SLOTS */
108
- );
105
+ }, 1032
106
+ /* PROPS, DYNAMIC_SLOTS */
107
+ , ["class"]);
109
108
  }), 128
110
109
  /* KEYED_FRAGMENT */
111
110
  ))]),
@@ -117,8 +116,11 @@ function render(_ctx, _cache) {
117
116
  return [(0, _vue.renderSlot)(_ctx.$slots, "indicator", {
118
117
  index: index,
119
118
  length: length
120
- }, () => [_ctx.indicator && _ctx.images.length > 1 ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_2, (0, _vue.toDisplayString)(index + 1) + " / " + (0, _vue.toDisplayString)(length), 1
121
- /* TEXT */
119
+ }, () => [_ctx.indicator && _ctx.images.length > 1 ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
120
+ key: 0,
121
+ class: (0, _vue.normalizeClass)(_ctx.n('indicators'))
122
+ }, (0, _vue.toDisplayString)(index + 1) + " / " + (0, _vue.toDisplayString)(length), 3
123
+ /* TEXT, CLASS */
122
124
  )) : (0, _vue.createCommentVNode)("v-if", true)])];
123
125
  }),
124
126
  _: 3
@@ -126,21 +128,25 @@ function render(_ctx, _cache) {
126
128
 
127
129
  }, 16
128
130
  /* FULL_PROPS */
129
- , ["touchable", "indicator", "initial-index", "loop", "onChange"]), (0, _vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_ctx.closeable ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_var_icon, {
131
+ , ["class", "touchable", "indicator", "initial-index", "loop", "onChange"]), (0, _vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_ctx.closeable ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_var_icon, {
130
132
  key: 0,
131
- class: "var-image-preview__close-icon",
133
+ class: (0, _vue.normalizeClass)(_ctx.n('close-icon')),
132
134
  name: "close-circle",
133
135
  "var-image-preview-cover": "",
134
136
  onClick: _ctx.close
135
137
  }, null, 8
136
138
  /* PROPS */
137
- , ["onClick"])) : (0, _vue.createCommentVNode)("v-if", true)]), (0, _vue.createElementVNode)("div", _hoisted_3, [(0, _vue.renderSlot)(_ctx.$slots, "extra")])]),
139
+ , ["class", "onClick"])) : (0, _vue.createCommentVNode)("v-if", true)]), (0, _vue.createElementVNode)("div", {
140
+ class: (0, _vue.normalizeClass)(_ctx.n('extra'))
141
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "extra")], 2
142
+ /* CLASS */
143
+ )]),
138
144
  _: 3
139
145
  /* FORWARDED */
140
146
 
141
147
  }, 8
142
148
  /* PROPS */
143
- , ["show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
149
+ , ["class", "show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
144
150
  }
145
151
 
146
152
  var _default = (0, _vue.defineComponent)({
@@ -341,19 +347,13 @@ var _default = (0, _vue.defineComponent)({
341
347
  };
342
348
 
343
349
  var close = () => {
344
- var _props$onUpdateShow2;
345
-
346
350
  if (scale.value > 1) {
347
351
  zoomOut();
348
- setTimeout(() => {
349
- var _props$onUpdateShow;
350
-
351
- return (_props$onUpdateShow = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow.call(props, false);
352
- }, ANIMATION_DURATION);
352
+ setTimeout(() => (0, _components.call)(props['onUpdate:show'], false), ANIMATION_DURATION);
353
353
  return;
354
354
  }
355
355
 
356
- (_props$onUpdateShow2 = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow2.call(props, false);
356
+ (0, _components.call)(props['onUpdate:show'], false);
357
357
  };
358
358
 
359
359
  (0, _vue.watch)(() => props.show, newValue => {
@@ -362,6 +362,8 @@ var _default = (0, _vue.defineComponent)({
362
362
  immediate: true
363
363
  });
364
364
  return {
365
+ n,
366
+ classes,
365
367
  initialIndex,
366
368
  popupShow,
367
369
  scale,
@@ -12,8 +12,15 @@ var _provide = require("./provide");
12
12
 
13
13
  var _props = require("./props");
14
14
 
15
+ var _components = require("../utils/components");
16
+
15
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
18
 
19
+ var {
20
+ n,
21
+ classes
22
+ } = (0, _components.createNamespace)('index-anchor');
23
+
17
24
  function render(_ctx, _cache) {
18
25
  return (0, _vue.openBlock)(), (0, _vue.createBlock)((0, _vue.resolveDynamicComponent)(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
19
26
  "offset-top": _ctx.sticky ? _ctx.stickyOffsetTop : null,
@@ -23,7 +30,7 @@ function render(_ctx, _cache) {
23
30
  ref: "anchorEl"
24
31
  }, {
25
32
  default: (0, _vue.withCtx)(() => [(0, _vue.createElementVNode)("div", (0, _vue.mergeProps)({
26
- class: "var-index-anchor"
33
+ class: _ctx.n()
27
34
  }, _ctx.$attrs), [(0, _vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, _vue.createTextVNode)((0, _vue.toDisplayString)(_ctx.name), 1
28
35
  /* TEXT */
29
36
  )])], 16
@@ -82,6 +89,8 @@ var _default = (0, _vue.defineComponent)({
82
89
  };
83
90
  bindIndexBar(indexAnchorProvider);
84
91
  return {
92
+ n,
93
+ classes,
85
94
  name,
86
95
  anchorEl,
87
96
  active,
@@ -14,21 +14,27 @@ var _provide = require("./provide");
14
14
 
15
15
  var _props = require("./props");
16
16
 
17
+ var _components = require("../utils/components");
18
+
17
19
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
18
20
 
19
21
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
20
22
 
23
+ var {
24
+ n,
25
+ classes
26
+ } = (0, _components.createNamespace)('index-bar');
27
+
21
28
  var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
22
29
 
23
- var _hoisted_1 = {
24
- class: "var-index-bar",
25
- ref: "barEl"
26
- };
27
- var _hoisted_2 = ["onClick"];
30
+ var _hoisted_1 = ["onClick"];
28
31
 
29
32
  function render(_ctx, _cache) {
30
- return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [(0, _vue.renderSlot)(_ctx.$slots, "default"), (0, _vue.createElementVNode)("ul", {
31
- class: "var-index-bar__anchor-list",
33
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
34
+ class: (0, _vue.normalizeClass)(_ctx.n()),
35
+ ref: "barEl"
36
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "default"), (0, _vue.createElementVNode)("ul", {
37
+ class: (0, _vue.normalizeClass)(_ctx.n('anchor-list')),
32
38
  style: (0, _vue.normalizeStyle)({
33
39
  zIndex: _ctx.toNumber(_ctx.zIndex) + 2,
34
40
  display: _ctx.hideList ? 'none' : 'block'
@@ -36,22 +42,20 @@ function render(_ctx, _cache) {
36
42
  }, [((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)(_ctx.anchorNameList, anchorName => {
37
43
  return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("li", {
38
44
  key: anchorName,
39
- class: (0, _vue.normalizeClass)(["var-index-bar__anchor-item", {
40
- 'var-index-bar__anchor-item--active': _ctx.active === anchorName
41
- }]),
45
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('anchor-item'), [_ctx.active === anchorName, _ctx.n('anchor-item--active')])),
42
46
  style: (0, _vue.normalizeStyle)({
43
47
  color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : ''
44
48
  }),
45
49
  onClick: $event => _ctx.anchorClick(anchorName)
46
50
  }, (0, _vue.toDisplayString)(anchorName), 15
47
51
  /* TEXT, CLASS, STYLE, PROPS */
48
- , _hoisted_2);
52
+ , _hoisted_1);
49
53
  }), 128
50
54
  /* KEYED_FRAGMENT */
51
- ))], 4
52
- /* STYLE */
53
- )], 512
54
- /* NEED_PATCH */
55
+ ))], 6
56
+ /* CLASS, STYLE */
57
+ )], 2
58
+ /* CLASS */
55
59
  );
56
60
  }
57
61
 
@@ -88,7 +92,7 @@ var _default = (0, _vue.defineComponent)({
88
92
  var anchorName = (0, _shared.isPlainObject)(anchor) ? anchor.name.value : anchor;
89
93
  if (anchorName === active.value || anchorName === undefined) return;
90
94
  active.value = anchorName;
91
- props.onChange == null ? void 0 : props.onChange(anchorName);
95
+ (0, _components.call)(props.onChange, anchorName);
92
96
  };
93
97
 
94
98
  var handleScroll = () => {
@@ -118,7 +122,7 @@ var _default = (0, _vue.defineComponent)({
118
122
  var {
119
123
  offsetTop
120
124
  } = barEl.value;
121
- if (manualCall) props.onClick == null ? void 0 : props.onClick(anchorName);
125
+ if (manualCall) (0, _components.call)(props.onClick, anchorName);
122
126
  if (anchorName === active.value) return;
123
127
  var indexAnchor = indexAnchors.find(_ref2 => {
124
128
  var {
@@ -169,11 +173,11 @@ var _default = (0, _vue.defineComponent)({
169
173
  scroller.value.addEventListener('scroll', handleScroll);
170
174
  }));
171
175
  (0, _vue.onBeforeUnmount)(() => {
172
- var _scroller$value;
173
-
174
- (_scroller$value = scroller.value) == null ? void 0 : _scroller$value.removeEventListener('scroll', handleScroll);
176
+ (0, _components.call)(scroller.value.removeEventListener, 'scroll', handleScroll);
175
177
  });
176
178
  return {
179
+ n,
180
+ classes,
177
181
  barEl,
178
182
  active,
179
183
  zIndex,
package/lib/index.js CHANGED
@@ -2,6 +2,8 @@ var ActionSheet = require('./action-sheet')['default']
2
2
  var AppBar = require('./app-bar')['default']
3
3
  var BackTop = require('./back-top')['default']
4
4
  var Badge = require('./badge')['default']
5
+ var BottomNavigation = require('./bottom-navigation')['default']
6
+ var BottomNavigationItem = require('./bottom-navigation-item')['default']
5
7
  var Button = require('./button')['default']
6
8
  var Card = require('./card')['default']
7
9
  var Cell = require('./cell')['default']
@@ -67,6 +69,8 @@ function install(app) {
67
69
  AppBar.install && app.use(AppBar)
68
70
  BackTop.install && app.use(BackTop)
69
71
  Badge.install && app.use(Badge)
72
+ BottomNavigation.install && app.use(BottomNavigation)
73
+ BottomNavigationItem.install && app.use(BottomNavigationItem)
70
74
  Button.install && app.use(Button)
71
75
  Card.install && app.use(Card)
72
76
  Cell.install && app.use(Cell)
@@ -134,6 +138,8 @@ module.exports = {
134
138
  AppBar,
135
139
  BackTop,
136
140
  Badge,
141
+ BottomNavigation,
142
+ BottomNavigationItem,
137
143
  Button,
138
144
  Card,
139
145
  Cell,