@varlet/ui 2.16.7 → 2.16.8-alpha.1695118057982

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 (348) hide show
  1. package/es/action-sheet/ActionSheet.mjs +97 -67
  2. package/es/action-sheet/index.mjs +43 -28
  3. package/es/action-sheet/props.mjs +39 -8
  4. package/es/app-bar/AppBar.mjs +129 -56
  5. package/es/app-bar/index.mjs +10 -5
  6. package/es/app-bar/props.mjs +6 -3
  7. package/es/avatar/Avatar.mjs +97 -87
  8. package/es/avatar/index.mjs +10 -5
  9. package/es/avatar/props.mjs +8 -5
  10. package/es/avatar-group/AvatarGroup.mjs +26 -20
  11. package/es/avatar-group/index.mjs +10 -5
  12. package/es/avatar-group/props.mjs +5 -2
  13. package/es/back-top/BackTop.mjs +71 -53
  14. package/es/back-top/index.mjs +10 -5
  15. package/es/back-top/props.mjs +6 -3
  16. package/es/badge/Badge.mjs +74 -46
  17. package/es/badge/index.mjs +10 -5
  18. package/es/badge/props.mjs +7 -4
  19. package/es/bottom-navigation/BottomNavigation.mjs +100 -97
  20. package/es/bottom-navigation/index.mjs +10 -5
  21. package/es/bottom-navigation/props.mjs +7 -4
  22. package/es/bottom-navigation/provide.mjs +13 -9
  23. package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
  24. package/es/bottom-navigation-item/index.mjs +10 -5
  25. package/es/bottom-navigation-item/props.mjs +7 -4
  26. package/es/bottom-navigation-item/provide.mjs +14 -11
  27. package/es/breadcrumb/Breadcrumb.mjs +51 -36
  28. package/es/breadcrumb/index.mjs +10 -5
  29. package/es/breadcrumb/props.mjs +6 -3
  30. package/es/breadcrumb/provide.mjs +12 -11
  31. package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
  32. package/es/breadcrumbs/index.mjs +10 -5
  33. package/es/breadcrumbs/props.mjs +6 -3
  34. package/es/breadcrumbs/provide.mjs +11 -9
  35. package/es/button/Button.mjs +88 -90
  36. package/es/button/index.mjs +10 -5
  37. package/es/button/props.mjs +31 -10
  38. package/es/button/provide.mjs +8 -9
  39. package/es/button-group/ButtonGroup.mjs +38 -26
  40. package/es/button-group/index.mjs +8 -4
  41. package/es/button-group/props.mjs +8 -5
  42. package/es/button-group/provide.mjs +9 -9
  43. package/es/card/Card.mjs +292 -189
  44. package/es/card/index.mjs +10 -5
  45. package/es/card/props.mjs +9 -6
  46. package/es/cell/Cell.mjs +96 -52
  47. package/es/cell/index.mjs +10 -5
  48. package/es/cell/props.mjs +6 -3
  49. package/es/checkbox/Checkbox.mjs +136 -130
  50. package/es/checkbox/index.mjs +10 -5
  51. package/es/checkbox/props.mjs +9 -6
  52. package/es/checkbox/provide.mjs +10 -9
  53. package/es/checkbox-group/CheckboxGroup.mjs +63 -96
  54. package/es/checkbox-group/index.mjs +10 -5
  55. package/es/checkbox-group/props.mjs +9 -6
  56. package/es/checkbox-group/provide.mjs +11 -9
  57. package/es/chip/Chip.mjs +66 -50
  58. package/es/chip/index.mjs +10 -5
  59. package/es/chip/props.mjs +10 -7
  60. package/es/col/Col.mjs +60 -55
  61. package/es/col/index.mjs +10 -5
  62. package/es/col/props.mjs +7 -4
  63. package/es/col/provide.mjs +8 -9
  64. package/es/collapse/Collapse.mjs +70 -73
  65. package/es/collapse/index.mjs +10 -5
  66. package/es/collapse/props.mjs +7 -4
  67. package/es/collapse/provide.mjs +11 -9
  68. package/es/collapse-item/CollapseItem.mjs +156 -93
  69. package/es/collapse-item/index.mjs +10 -5
  70. package/es/collapse-item/props.mjs +6 -3
  71. package/es/collapse-item/provide.mjs +12 -11
  72. package/es/context/index.mjs +9 -5
  73. package/es/context/lock.mjs +18 -22
  74. package/es/context/zIndex.mjs +19 -16
  75. package/es/countdown/Countdown.mjs +73 -70
  76. package/es/countdown/index.mjs +10 -5
  77. package/es/countdown/props.mjs +7 -4
  78. package/es/counter/Counter.mjs +169 -173
  79. package/es/counter/index.mjs +10 -5
  80. package/es/counter/props.mjs +8 -5
  81. package/es/counter/provide.ts +3 -0
  82. package/es/date-picker/DatePicker.mjs +411 -304
  83. package/es/date-picker/index.mjs +10 -5
  84. package/es/date-picker/props.mjs +71 -45
  85. package/es/date-picker/src/day-picker-panel.mjs +270 -208
  86. package/es/date-picker/src/month-picker-panel.mjs +205 -175
  87. package/es/date-picker/src/panel-header.mjs +101 -83
  88. package/es/date-picker/src/year-picker-panel.mjs +64 -54
  89. package/es/dialog/Dialog.mjs +171 -106
  90. package/es/dialog/index.mjs +49 -33
  91. package/es/dialog/props.mjs +39 -9
  92. package/es/divider/Divider.mjs +56 -51
  93. package/es/divider/index.mjs +10 -5
  94. package/es/divider/props.mjs +5 -2
  95. package/es/drag/Drag.mjs +126 -144
  96. package/es/drag/index.mjs +10 -5
  97. package/es/drag/props.mjs +8 -5
  98. package/es/ellipsis/Ellipsis.mjs +81 -50
  99. package/es/ellipsis/index.mjs +8 -4
  100. package/es/ellipsis/props.mjs +5 -2
  101. package/es/fab/Fab.mjs +73 -75
  102. package/es/fab/index.mjs +8 -4
  103. package/es/fab/props.mjs +14 -11
  104. package/es/field-decorator/FieldDecorator.mjs +215 -110
  105. package/es/field-decorator/props.mjs +9 -6
  106. package/es/form/Form.mjs +69 -79
  107. package/es/form/index.mjs +11 -6
  108. package/es/form/props.mjs +6 -3
  109. package/es/form/provide.mjs +35 -22
  110. package/es/form-details/FormDetails.mjs +81 -39
  111. package/es/form-details/index.mjs +10 -5
  112. package/es/form-details/props.mjs +7 -4
  113. package/es/hover/index.mjs +37 -40
  114. package/es/hover-overlay/HoverOverlay.mjs +18 -14
  115. package/es/hover-overlay/index.mjs +13 -8
  116. package/es/hover-overlay/props.mjs +5 -2
  117. package/es/icon/Icon.mjs +50 -33
  118. package/es/icon/index.mjs +10 -5
  119. package/es/icon/props.mjs +7 -4
  120. package/es/image/Image.mjs +76 -82
  121. package/es/image/index.mjs +10 -5
  122. package/es/image/props.mjs +7 -4
  123. package/es/image-preview/ImagePreview.mjs +176 -193
  124. package/es/image-preview/index.mjs +44 -30
  125. package/es/image-preview/props.mjs +34 -9
  126. package/es/index-anchor/IndexAnchor.mjs +45 -42
  127. package/es/index-anchor/index.mjs +10 -5
  128. package/es/index-anchor/props.mjs +5 -2
  129. package/es/index-anchor/provide.mjs +12 -11
  130. package/es/index-bar/IndexBar.mjs +130 -131
  131. package/es/index-bar/index.mjs +10 -5
  132. package/es/index-bar/props.mjs +6 -3
  133. package/es/index-bar/provide.mjs +11 -9
  134. package/es/index.bundle.mjs +1 -1
  135. package/es/index.mjs +1 -1
  136. package/es/input/Input.mjs +231 -247
  137. package/es/input/index.mjs +10 -5
  138. package/es/input/props.mjs +38 -8
  139. package/es/input/provide.ts +3 -0
  140. package/es/lazy/index.mjs +94 -87
  141. package/es/link/Link.mjs +39 -45
  142. package/es/link/index.mjs +10 -5
  143. package/es/link/props.mjs +8 -5
  144. package/es/list/List.mjs +144 -97
  145. package/es/list/index.mjs +10 -5
  146. package/es/list/props.mjs +8 -5
  147. package/es/list/provide.mjs +8 -9
  148. package/es/loading/Loading.mjs +165 -72
  149. package/es/loading/index.mjs +10 -5
  150. package/es/loading/props.mjs +7 -4
  151. package/es/loading-bar/LoadingBar.mjs +19 -16
  152. package/es/loading-bar/index.mjs +37 -30
  153. package/es/loading-bar/props.mjs +5 -2
  154. package/es/locale/en-US.mjs +76 -73
  155. package/es/locale/index.mjs +52 -41
  156. package/es/locale/zh-CN.mjs +76 -73
  157. package/es/menu/Menu.mjs +76 -57
  158. package/es/menu/index.mjs +10 -5
  159. package/es/menu/props.mjs +11 -8
  160. package/es/menu/usePopover.mjs +214 -207
  161. package/es/option/Option.mjs +86 -70
  162. package/es/option/index.mjs +10 -5
  163. package/es/option/props.mjs +5 -2
  164. package/es/option/provide.mjs +10 -11
  165. package/es/overlay/Overlay.mjs +29 -31
  166. package/es/overlay/index.mjs +10 -5
  167. package/es/overlay/props.mjs +7 -4
  168. package/es/pagination/Pagination.mjs +334 -202
  169. package/es/pagination/index.mjs +10 -5
  170. package/es/pagination/props.mjs +8 -5
  171. package/es/paper/Paper.mjs +43 -31
  172. package/es/paper/index.mjs +10 -5
  173. package/es/paper/props.mjs +6 -3
  174. package/es/picker/Picker.mjs +288 -224
  175. package/es/picker/index.mjs +24 -23
  176. package/es/picker/props.mjs +37 -7
  177. package/es/popup/Popup.mjs +68 -58
  178. package/es/popup/index.mjs +10 -5
  179. package/es/popup/props.mjs +9 -6
  180. package/es/popup/provide.mjs +12 -15
  181. package/es/progress/Progress.mjs +186 -114
  182. package/es/progress/index.mjs +10 -5
  183. package/es/progress/props.mjs +7 -4
  184. package/es/pull-refresh/PullRefresh.mjs +136 -116
  185. package/es/pull-refresh/index.mjs +10 -5
  186. package/es/pull-refresh/props.mjs +8 -5
  187. package/es/radio/Radio.mjs +122 -118
  188. package/es/radio/index.mjs +10 -5
  189. package/es/radio/props.mjs +8 -5
  190. package/es/radio/provide.mjs +8 -9
  191. package/es/radio-group/RadioGroup.mjs +50 -58
  192. package/es/radio-group/index.mjs +10 -5
  193. package/es/radio-group/props.mjs +10 -7
  194. package/es/radio-group/provide.mjs +11 -9
  195. package/es/rate/Rate.mjs +103 -132
  196. package/es/rate/index.mjs +10 -5
  197. package/es/rate/props.mjs +10 -7
  198. package/es/rate/provide.ts +3 -0
  199. package/es/result/Empty.mjs +21 -12
  200. package/es/result/Error.mjs +18 -9
  201. package/es/result/Info.mjs +18 -9
  202. package/es/result/Question.mjs +18 -9
  203. package/es/result/Result.mjs +102 -55
  204. package/es/result/Success.mjs +84 -40
  205. package/es/result/Warning.mjs +18 -9
  206. package/es/result/index.mjs +10 -5
  207. package/es/result/props.mjs +6 -3
  208. package/es/ripple/index.mjs +89 -101
  209. package/es/row/Row.mjs +40 -45
  210. package/es/row/index.mjs +10 -5
  211. package/es/row/props.mjs +8 -5
  212. package/es/row/provide.mjs +9 -9
  213. package/es/select/Select.mjs +308 -298
  214. package/es/select/index.mjs +10 -5
  215. package/es/select/props.mjs +40 -10
  216. package/es/select/provide.mjs +9 -9
  217. package/es/skeleton/Skeleton.mjs +182 -71
  218. package/es/skeleton/index.mjs +10 -5
  219. package/es/skeleton/props.mjs +5 -2
  220. package/es/slider/Slider.mjs +310 -260
  221. package/es/slider/index.mjs +10 -5
  222. package/es/slider/props.mjs +15 -11
  223. package/es/slider/provide.ts +3 -0
  224. package/es/snackbar/Snackbar.mjs +47 -34
  225. package/es/snackbar/core.mjs +140 -77
  226. package/es/snackbar/index.mjs +111 -97
  227. package/es/snackbar/props.mjs +35 -14
  228. package/es/space/Space.mjs +30 -28
  229. package/es/space/index.mjs +10 -5
  230. package/es/space/margin.mjs +22 -23
  231. package/es/space/props.mjs +8 -5
  232. package/es/step/Step.mjs +96 -74
  233. package/es/step/index.mjs +10 -5
  234. package/es/step/props.mjs +6 -3
  235. package/es/step/provide.mjs +10 -11
  236. package/es/steps/Steps.mjs +31 -30
  237. package/es/steps/index.mjs +10 -5
  238. package/es/steps/props.mjs +7 -4
  239. package/es/steps/provide.mjs +9 -8
  240. package/es/sticky/Sticky.mjs +104 -92
  241. package/es/sticky/index.mjs +10 -5
  242. package/es/sticky/props.mjs +6 -3
  243. package/es/style-provider/StyleProvider.mjs +19 -18
  244. package/es/style-provider/index.mjs +15 -11
  245. package/es/style-provider/props.mjs +6 -3
  246. package/es/swipe/Swipe.mjs +281 -268
  247. package/es/swipe/index.mjs +10 -5
  248. package/es/swipe/props.mjs +6 -3
  249. package/es/swipe/provide.mjs +11 -9
  250. package/es/swipe-item/SwipeItem.mjs +29 -29
  251. package/es/swipe-item/index.mjs +8 -4
  252. package/es/swipe-item/provide.mjs +10 -11
  253. package/es/switch/Switch.mjs +143 -103
  254. package/es/switch/index.mjs +10 -5
  255. package/es/switch/props.mjs +7 -4
  256. package/es/switch/provide.ts +3 -0
  257. package/es/tab/Tab.mjs +48 -61
  258. package/es/tab/index.mjs +10 -5
  259. package/es/tab/props.mjs +6 -3
  260. package/es/tab/provide.mjs +10 -11
  261. package/es/tab-item/TabItem.mjs +27 -32
  262. package/es/tab-item/index.mjs +10 -5
  263. package/es/tab-item/props.mjs +5 -2
  264. package/es/tab-item/provide.mjs +17 -18
  265. package/es/table/Table.mjs +54 -25
  266. package/es/table/index.mjs +10 -5
  267. package/es/table/props.mjs +6 -3
  268. package/es/tabs/Tabs.mjs +162 -134
  269. package/es/tabs/index.mjs +10 -5
  270. package/es/tabs/props.mjs +15 -12
  271. package/es/tabs/provide.mjs +9 -9
  272. package/es/tabs-items/TabsItems.mjs +61 -65
  273. package/es/tabs-items/index.mjs +10 -5
  274. package/es/tabs-items/props.mjs +7 -4
  275. package/es/tabs-items/provide.mjs +11 -9
  276. package/es/themes/dark/actionSheet.mjs +8 -5
  277. package/es/themes/dark/appBar.mjs +6 -3
  278. package/es/themes/dark/avatar.mjs +7 -4
  279. package/es/themes/dark/badge.mjs +6 -3
  280. package/es/themes/dark/bottomNavigation.mjs +7 -4
  281. package/es/themes/dark/bottomNavigationItem.mjs +6 -3
  282. package/es/themes/dark/breadcrumb.mjs +6 -3
  283. package/es/themes/dark/button.mjs +7 -4
  284. package/es/themes/dark/card.mjs +10 -7
  285. package/es/themes/dark/cell.mjs +7 -4
  286. package/es/themes/dark/checkbox.mjs +7 -4
  287. package/es/themes/dark/chip.mjs +7 -4
  288. package/es/themes/dark/collapse.mjs +8 -5
  289. package/es/themes/dark/countdown.mjs +6 -3
  290. package/es/themes/dark/datePicker.mjs +10 -7
  291. package/es/themes/dark/dialog.mjs +8 -5
  292. package/es/themes/dark/divider.mjs +7 -4
  293. package/es/themes/dark/fieldDecorator.mjs +7 -4
  294. package/es/themes/dark/index.mjs +69 -51
  295. package/es/themes/dark/link.mjs +6 -3
  296. package/es/themes/dark/menu.mjs +6 -3
  297. package/es/themes/dark/option.mjs +6 -3
  298. package/es/themes/dark/pagination.mjs +11 -8
  299. package/es/themes/dark/paper.mjs +6 -3
  300. package/es/themes/dark/picker.mjs +11 -8
  301. package/es/themes/dark/popup.mjs +6 -3
  302. package/es/themes/dark/progress.mjs +6 -3
  303. package/es/themes/dark/pullRefresh.mjs +6 -3
  304. package/es/themes/dark/radio.mjs +7 -4
  305. package/es/themes/dark/result.mjs +12 -9
  306. package/es/themes/dark/select.mjs +6 -3
  307. package/es/themes/dark/skeleton.mjs +11 -6
  308. package/es/themes/dark/steps.mjs +8 -5
  309. package/es/themes/dark/switch.mjs +7 -4
  310. package/es/themes/dark/tab.mjs +6 -3
  311. package/es/themes/dark/table.mjs +12 -9
  312. package/es/themes/dark/tabs.mjs +6 -3
  313. package/es/themes/dark/timePicker.mjs +9 -6
  314. package/es/themes/dark/uploader.mjs +10 -7
  315. package/es/themes/dark/watermark.mjs +6 -3
  316. package/es/themes/index.mjs +7 -5
  317. package/es/time-picker/TimePicker.mjs +297 -232
  318. package/es/time-picker/clock.mjs +222 -172
  319. package/es/time-picker/index.mjs +10 -5
  320. package/es/time-picker/props.mjs +14 -8
  321. package/es/time-picker/utils.mjs +46 -86
  322. package/es/tooltip/Tooltip.mjs +82 -62
  323. package/es/tooltip/index.mjs +10 -5
  324. package/es/tooltip/props.mjs +12 -9
  325. package/es/uploader/Uploader.mjs +315 -308
  326. package/es/uploader/index.mjs +10 -5
  327. package/es/uploader/props.mjs +10 -7
  328. package/es/uploader/provide.ts +3 -0
  329. package/es/utils/components.mjs +158 -127
  330. package/es/utils/elements.mjs +106 -123
  331. package/es/utils/logger.mjs +9 -5
  332. package/es/utils/shared.mjs +25 -23
  333. package/es/utils/test.mjs +105 -93
  334. package/es/varlet.esm.js +12464 -13425
  335. package/es/watermark/Watermark.mjs +191 -109
  336. package/es/watermark/index.mjs +8 -4
  337. package/es/watermark/props.mjs +8 -5
  338. package/highlight/web-types.en-US.json +3 -3
  339. package/highlight/web-types.zh-CN.json +2 -2
  340. package/lib/varlet.cjs.js +9187 -10199
  341. package/package.json +7 -7
  342. package/umd/varlet.js +4 -4
  343. package/es/counter/provide.mjs +0 -1
  344. package/es/input/provide.mjs +0 -1
  345. package/es/rate/provide.mjs +0 -1
  346. package/es/slider/provide.mjs +0 -1
  347. package/es/switch/provide.mjs +0 -1
  348. package/es/uploader/provide.mjs +0 -1
@@ -1,74 +1,90 @@
1
- import { isVNode as _isVNode, createVNode as _createVNode, mergeProps as _mergeProps, resolveDirective as _resolveDirective } from "vue";
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
3
- import VarSnackbarCore from './core.mjs';
4
- import VarSnackbar from './Snackbar.mjs';
5
- import context from '../context/index.mjs';
6
- import { reactive, TransitionGroup } from 'vue';
7
- import { call, mountInstance, withInstall } from '../utils/components.mjs';
8
- import { isFunction, isPlainObject, isString, toNumber } from '@varlet/shared';
9
- function _isSlot(s) {
10
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
11
- }
12
- export var SNACKBAR_TYPE = ['loading', 'success', 'warning', 'info', 'error'];
13
- var sid = 0;
14
- var isMount = false;
15
- var unmount;
16
- var isAllowMultiple = false;
17
- var defaultOptionsValue = {
18
- type: undefined,
19
- content: '',
20
- icon: '',
21
- action: '',
22
- position: 'top',
23
- duration: 3000,
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
18
+ import VarSnackbarCore from "./core.mjs";
19
+ import VarSnackbar from "./Snackbar.mjs";
20
+ import context from "../context/index.mjs";
21
+ import { reactive, TransitionGroup } from "vue";
22
+ import { call, mountInstance, withInstall } from "../utils/components.mjs";
23
+ import { isFunction, isPlainObject, isString, toNumber } from "@varlet/shared";
24
+ const SNACKBAR_TYPE = ["loading", "success", "warning", "info", "error"];
25
+ let sid = 0;
26
+ let isMount = false;
27
+ let unmount;
28
+ let isAllowMultiple = false;
29
+ const defaultOptionsValue = {
30
+ type: void 0,
31
+ content: "",
32
+ icon: "",
33
+ action: "",
34
+ position: "top",
35
+ duration: 3e3,
24
36
  vertical: false,
25
- contentClass: undefined,
26
- loadingType: 'circle',
27
- loadingSize: 'normal',
37
+ contentClass: void 0,
38
+ loadingType: "circle",
39
+ loadingSize: "normal",
28
40
  lockScroll: false,
29
- teleport: 'body',
41
+ teleport: "body",
30
42
  forbidClick: false,
31
- onOpen: () => {},
32
- onOpened: () => {},
33
- onClose: () => {},
34
- onClosed: () => {}
43
+ onOpen: () => {
44
+ },
45
+ onOpened: () => {
46
+ },
47
+ onClose: () => {
48
+ },
49
+ onClosed: () => {
50
+ }
35
51
  };
36
- var uniqSnackbarOptions = reactive([]);
37
- var defaultOptions = defaultOptionsValue;
38
- var transitionGroupProps = {
39
- name: 'var-snackbar-fade',
40
- tag: 'div',
41
- class: 'var-transition-group'
52
+ let uniqSnackbarOptions = reactive([]);
53
+ let defaultOptions = defaultOptionsValue;
54
+ const transitionGroupProps = {
55
+ name: "var-snackbar-fade",
56
+ tag: "div",
57
+ class: "var-transition-group"
42
58
  };
43
- var getSlotValue = value => () => isFunction(value) ? value() : value;
44
- var TransitionGroupHost = {
59
+ const getSlotValue = (value) => () => isFunction(value) ? value() : value;
60
+ const TransitionGroupHost = {
45
61
  setup() {
46
62
  return () => {
47
- var snackbarList = uniqSnackbarOptions.map(_ref => {
48
- var {
49
- id,
50
- reactiveSnackOptions,
51
- _update
52
- } = _ref;
53
- var transitionGroupEl = document.querySelector('.var-transition-group');
54
- if (reactiveSnackOptions.forbidClick || reactiveSnackOptions.type === 'loading') {
63
+ const snackbarList = uniqSnackbarOptions.map(({
64
+ id,
65
+ reactiveSnackOptions,
66
+ _update
67
+ }) => {
68
+ const transitionGroupEl = document.querySelector(".var-transition-group");
69
+ if (reactiveSnackOptions.forbidClick || reactiveSnackOptions.type === "loading") {
55
70
  ;
56
- transitionGroupEl.classList.add('var-pointer-auto');
71
+ transitionGroupEl.classList.add("var-pointer-auto");
57
72
  } else {
58
73
  ;
59
- transitionGroupEl.classList.remove('var-pointer-auto');
74
+ transitionGroupEl.classList.remove("var-pointer-auto");
60
75
  }
61
- if (isAllowMultiple) reactiveSnackOptions.position = 'top';
62
- var position = isAllowMultiple ? 'relative' : 'absolute';
63
- var style = _extends({
76
+ if (isAllowMultiple)
77
+ reactiveSnackOptions.position = "top";
78
+ const position = isAllowMultiple ? "relative" : "absolute";
79
+ const style = __spreadValues({
64
80
  position
65
81
  }, getTop(reactiveSnackOptions.position));
66
- var {
82
+ const {
67
83
  content,
68
84
  icon,
69
85
  action
70
86
  } = reactiveSnackOptions;
71
- var slots = {
87
+ const slots = {
72
88
  default: getSlotValue(content),
73
89
  icon: getSlotValue(icon),
74
90
  action: getSlotValue(action)
@@ -78,8 +94,8 @@ var TransitionGroupHost = {
78
94
  "style": style,
79
95
  "data-id": id,
80
96
  "_update": _update,
81
- 'show': reactiveSnackOptions.show,
82
- "onUpdate:show": $event => reactiveSnackOptions.show = $event
97
+ "show": reactiveSnackOptions.show,
98
+ "onUpdate:show": ($event) => reactiveSnackOptions.show = $event
83
99
  }), slots);
84
100
  });
85
101
  return _createVNode(TransitionGroup, _mergeProps(transitionGroupProps, {
@@ -88,31 +104,31 @@ var TransitionGroupHost = {
88
104
  },
89
105
  "onAfterEnter": opened,
90
106
  "onAfterLeave": removeUniqOption
91
- }), _isSlot(snackbarList) ? snackbarList : {
107
+ }), {
92
108
  default: () => [snackbarList]
93
109
  });
94
110
  };
95
111
  }
96
112
  };
97
- var Snackbar = function (options) {
98
- var snackOptions = normalizeOptions(options);
99
- var reactiveSnackOptions = reactive(_extends({}, defaultOptions, snackOptions));
113
+ const Snackbar = function(options) {
114
+ const snackOptions = normalizeOptions(options);
115
+ const reactiveSnackOptions = reactive(__spreadValues(__spreadValues({}, defaultOptions), snackOptions));
100
116
  reactiveSnackOptions.show = true;
101
117
  if (!isMount) {
102
118
  isMount = true;
103
119
  unmount = mountInstance(TransitionGroupHost).unmountInstance;
104
120
  }
105
- var {
121
+ const {
106
122
  length
107
123
  } = uniqSnackbarOptions;
108
- var uniqSnackbarOptionItem = {
124
+ const uniqSnackbarOptionItem = {
109
125
  id: sid++,
110
126
  reactiveSnackOptions
111
127
  };
112
128
  if (length === 0 || isAllowMultiple) {
113
129
  addUniqOption(uniqSnackbarOptionItem);
114
130
  } else {
115
- var _update = "update-" + sid;
131
+ const _update = `update-${sid}`;
116
132
  updateUniqOption(reactiveSnackOptions, _update);
117
133
  }
118
134
  return {
@@ -125,8 +141,8 @@ var Snackbar = function (options) {
125
141
  }
126
142
  };
127
143
  };
128
- SNACKBAR_TYPE.forEach(type => {
129
- Snackbar[type] = options => {
144
+ SNACKBAR_TYPE.forEach((type) => {
145
+ Snackbar[type] = (options) => {
130
146
  if (isPlainObject(options)) {
131
147
  options.type = type;
132
148
  } else {
@@ -138,44 +154,41 @@ SNACKBAR_TYPE.forEach(type => {
138
154
  return Snackbar(options);
139
155
  };
140
156
  });
141
- Snackbar.allowMultiple = function (bool) {
142
- if (bool === void 0) {
143
- bool = false;
144
- }
157
+ Snackbar.allowMultiple = function(bool = false) {
145
158
  if (bool !== isAllowMultiple) {
146
- uniqSnackbarOptions.forEach(option => {
159
+ uniqSnackbarOptions.forEach((option) => {
147
160
  option.reactiveSnackOptions.show = false;
148
161
  });
149
162
  isAllowMultiple = bool;
150
163
  }
151
164
  };
152
- Snackbar.clear = function () {
153
- uniqSnackbarOptions.forEach(option => {
165
+ Snackbar.clear = function() {
166
+ uniqSnackbarOptions.forEach((option) => {
154
167
  option.reactiveSnackOptions.show = false;
155
168
  });
156
169
  };
157
- Snackbar.setDefaultOptions = function (options) {
170
+ Snackbar.setDefaultOptions = function(options) {
158
171
  defaultOptions = options;
159
172
  };
160
- Snackbar.resetDefaultOptions = function () {
173
+ Snackbar.resetDefaultOptions = function() {
161
174
  defaultOptions = defaultOptionsValue;
162
175
  };
163
176
  function opened(element) {
164
- var id = element.getAttribute('data-id');
165
- var option = uniqSnackbarOptions.find(option => option.id === toNumber(id));
177
+ const id = element.getAttribute("data-id");
178
+ const option = uniqSnackbarOptions.find((option2) => option2.id === toNumber(id));
166
179
  if (option) {
167
180
  call(option.reactiveSnackOptions.onOpened);
168
181
  }
169
182
  }
170
183
  function removeUniqOption(element) {
171
- element.parentElement && element.parentElement.classList.remove('var-pointer-auto');
172
- var id = element.getAttribute('data-id');
173
- var option = uniqSnackbarOptions.find(option => option.id === toNumber(id));
184
+ element.parentElement && element.parentElement.classList.remove("var-pointer-auto");
185
+ const id = element.getAttribute("data-id");
186
+ const option = uniqSnackbarOptions.find((option2) => option2.id === toNumber(id));
174
187
  if (option) {
175
188
  option.animationEnd = true;
176
189
  call(option.reactiveSnackOptions.onClosed);
177
190
  }
178
- var isAllAnimationEnd = uniqSnackbarOptions.every(option => option.animationEnd);
191
+ const isAllAnimationEnd = uniqSnackbarOptions.every((option2) => option2.animationEnd);
179
192
  if (isAllAnimationEnd) {
180
193
  call(unmount);
181
194
  uniqSnackbarOptions = reactive([]);
@@ -185,33 +198,34 @@ function removeUniqOption(element) {
185
198
  function addUniqOption(uniqSnackbarOptionItem) {
186
199
  uniqSnackbarOptions.push(uniqSnackbarOptionItem);
187
200
  }
188
- function normalizeOptions(options) {
189
- if (options === void 0) {
190
- options = {};
191
- }
201
+ function normalizeOptions(options = {}) {
192
202
  return isString(options) ? {
193
203
  content: options
194
204
  } : options;
195
205
  }
196
206
  function updateUniqOption(reactiveSnackOptions, _update) {
197
- var [firstOption] = uniqSnackbarOptions;
198
- firstOption.reactiveSnackOptions = _extends({}, firstOption.reactiveSnackOptions, reactiveSnackOptions);
207
+ const [firstOption] = uniqSnackbarOptions;
208
+ firstOption.reactiveSnackOptions = __spreadValues(__spreadValues({}, firstOption.reactiveSnackOptions), reactiveSnackOptions);
199
209
  firstOption._update = _update;
200
210
  }
201
- function getTop(position) {
202
- if (position === void 0) {
203
- position = 'top';
204
- }
205
- if (position === 'bottom') return {
206
- [position]: '5%'
207
- };
211
+ function getTop(position = "top") {
212
+ if (position === "bottom")
213
+ return {
214
+ [position]: "5%"
215
+ };
208
216
  return {
209
- top: position === 'top' ? '5%' : '45%'
217
+ top: position === "top" ? "5%" : "45%"
210
218
  };
211
219
  }
212
220
  Snackbar.Component = VarSnackbar;
213
221
  withInstall(VarSnackbar);
214
222
  withInstall(VarSnackbar, Snackbar);
215
- export { props as snackbarProps } from './props.mjs';
216
- export var _SnackbarComponent = VarSnackbar;
217
- export default Snackbar;
223
+ import { props } from "./props.mjs";
224
+ const _SnackbarComponent = VarSnackbar;
225
+ var stdin_default = Snackbar;
226
+ export {
227
+ SNACKBAR_TYPE,
228
+ _SnackbarComponent,
229
+ stdin_default as default,
230
+ props as snackbarProps
231
+ };
@@ -1,11 +1,29 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
- import { defineListenerProp, pickProps } from '../utils/components.mjs';
3
- import { props as loadingProps } from '../loading/props.mjs';
4
- export var props = {
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineListenerProp, pickProps } from "../utils/components.mjs";
21
+ import { props as loadingProps } from "../loading/props.mjs";
22
+ const props = {
5
23
  type: String,
6
24
  position: {
7
25
  type: String,
8
- default: 'top'
26
+ default: "top"
9
27
  },
10
28
  content: {
11
29
  type: [String, Function, Object]
@@ -13,26 +31,29 @@ export var props = {
13
31
  contentClass: String,
14
32
  duration: {
15
33
  type: Number,
16
- default: 3000
34
+ default: 3e3
17
35
  },
18
36
  vertical: Boolean,
19
- loadingType: pickProps(loadingProps, 'type'),
20
- loadingSize: pickProps(loadingProps, 'size'),
21
- loadingRadius: pickProps(loadingProps, 'radius'),
22
- loadingColor: _extends({}, pickProps(loadingProps, 'color'), {
23
- default: 'currentColor'
37
+ loadingType: pickProps(loadingProps, "type"),
38
+ loadingSize: pickProps(loadingProps, "size"),
39
+ loadingRadius: pickProps(loadingProps, "radius"),
40
+ loadingColor: __spreadProps(__spreadValues({}, pickProps(loadingProps, "color")), {
41
+ default: "currentColor"
24
42
  }),
25
43
  lockScroll: Boolean,
26
44
  show: Boolean,
27
45
  teleport: {
28
46
  type: [String, Object, Boolean],
29
- default: 'body'
47
+ default: "body"
30
48
  },
31
49
  forbidClick: Boolean,
32
50
  onOpen: defineListenerProp(),
33
51
  onOpened: defineListenerProp(),
34
52
  onClose: defineListenerProp(),
35
53
  onClosed: defineListenerProp(),
36
- 'onUpdate:show': defineListenerProp(),
54
+ "onUpdate:show": defineListenerProp(),
37
55
  _update: String
38
- };
56
+ };
57
+ export {
58
+ props
59
+ };
@@ -1,44 +1,43 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { defineComponent } from 'vue';
3
- import { props } from './props.mjs';
4
- import { isArray } from '@varlet/shared';
5
- import { call, createNamespace, flatFragment } from '../utils/components.mjs';
6
- import { padStartFlex, toSizeUnit } from '../utils/elements.mjs';
7
- import { computeMargin } from './margin.mjs';
2
+ import { defineComponent } from "vue";
3
+ import { props } from "./props.mjs";
4
+ import { isArray } from "@varlet/shared";
5
+ import { call, createNamespace, flatFragment } from "../utils/components.mjs";
6
+ import { padStartFlex, toSizeUnit } from "../utils/elements.mjs";
7
+ import { computeMargin } from "./margin.mjs";
8
8
 
9
9
 
10
- var isInternalSize = size => ['mini', 'small', 'normal', 'large'].includes(size);
11
- var {
10
+ const isInternalSize = (size) => ["mini", "small", "normal", "large"].includes(size);
11
+ const {
12
12
  name,
13
13
  n,
14
14
  classes
15
- } = createNamespace('space');
16
- function getSize(size, isInternalSize) {
17
- return isInternalSize ? ["var(--space-size-" + size + "-y)", "var(--space-size-" + size + "-x)"] : isArray(size) ? size.map(toSizeUnit) : [toSizeUnit(size), toSizeUnit(size)];
15
+ } = createNamespace("space");
16
+ function getSize(size, isInternalSize2) {
17
+ return isInternalSize2 ? [`var(--space-size-${size}-y)`, `var(--space-size-${size}-x)`] : isArray(size) ? size.map(toSizeUnit) : [toSizeUnit(size), toSizeUnit(size)];
18
18
  }
19
- export default defineComponent({
19
+ var stdin_default = defineComponent({
20
20
  name,
21
21
  props,
22
- setup(props, _ref) {
23
- var {
24
- slots
25
- } = _ref;
22
+ setup(props2, {
23
+ slots
24
+ }) {
26
25
  return () => {
27
- var _call;
28
- var {
26
+ var _a;
27
+ const {
29
28
  inline,
30
29
  justify,
31
30
  align,
32
31
  wrap,
33
32
  direction,
34
33
  size
35
- } = props;
36
- var children = (_call = call(slots.default)) != null ? _call : [];
37
- var [y, x] = getSize(size, isInternalSize(size));
34
+ } = props2;
35
+ let children = (_a = call(slots.default)) != null ? _a : [];
36
+ const [y, x] = getSize(size, isInternalSize(size));
38
37
  children = flatFragment(children);
39
- var lastIndex = children.length - 1;
40
- var spacers = children.map((child, index) => {
41
- var margin = computeMargin(y, x, {
38
+ const lastIndex = children.length - 1;
39
+ const spacers = children.map((child, index) => {
40
+ const margin = computeMargin(y, x, {
42
41
  direction,
43
42
  justify,
44
43
  index,
@@ -51,15 +50,18 @@ export default defineComponent({
51
50
  }, [child]);
52
51
  });
53
52
  return _createVNode("div", {
54
- "class": classes(n(), n('$--box'), [inline, n('--inline')]),
53
+ "class": classes(n(), n("$--box"), [inline, n("--inline")]),
55
54
  "style": {
56
55
  flexDirection: direction,
57
56
  justifyContent: padStartFlex(justify),
58
57
  alignItems: padStartFlex(align),
59
- flexWrap: wrap ? 'wrap' : 'nowrap',
60
- margin: direction === 'row' ? "calc(-1 * " + y + " / 2) 0" : undefined
58
+ flexWrap: wrap ? "wrap" : "nowrap",
59
+ margin: direction === "row" ? `calc(-1 * ${y} / 2) 0` : void 0
61
60
  }
62
61
  }, [spacers]);
63
62
  };
64
63
  }
65
- });
64
+ });
65
+ export {
66
+ stdin_default as default
67
+ };
@@ -1,6 +1,11 @@
1
- import Space from './Space.mjs';
2
- import { withInstall } from '../utils/components.mjs';
1
+ import Space from "./Space.mjs";
2
+ import { withInstall } from "../utils/components.mjs";
3
3
  withInstall(Space);
4
- export { props as spaceProps } from './props.mjs';
5
- export var _SpaceComponent = Space;
6
- export default Space;
4
+ import { props } from "./props.mjs";
5
+ const _SpaceComponent = Space;
6
+ var stdin_default = Space;
7
+ export {
8
+ _SpaceComponent,
9
+ stdin_default as default,
10
+ props as spaceProps
11
+ };
@@ -1,35 +1,34 @@
1
- export function half(value) {
2
- return "calc(" + value + " / 2)";
1
+ function half(value) {
2
+ return `calc(${value} / 2)`;
3
3
  }
4
- export function computeMargin(y, x, options) {
5
- var {
6
- direction,
7
- justify,
8
- index,
9
- lastIndex
10
- } = options;
11
- var margin = '0';
12
- if (direction === 'row') {
13
- if (['flex-start', 'center', 'flex-end', 'start', 'end'].includes(justify)) {
4
+ function computeMargin(y, x, options) {
5
+ const { direction, justify, index, lastIndex } = options;
6
+ let margin = "0";
7
+ if (direction === "row") {
8
+ if (["flex-start", "center", "flex-end", "start", "end"].includes(justify)) {
14
9
  if (index !== lastIndex) {
15
- margin = half(y) + " " + x + " " + half(y) + " 0";
10
+ margin = `${half(y)} ${x} ${half(y)} 0`;
16
11
  } else {
17
- margin = half(y) + " 0";
12
+ margin = `${half(y)} 0`;
18
13
  }
19
- } else if (justify === 'space-around') {
20
- margin = half(y) + " " + half(x);
21
- } else if (justify === 'space-between') {
14
+ } else if (justify === "space-around") {
15
+ margin = `${half(y)} ${half(x)}`;
16
+ } else if (justify === "space-between") {
22
17
  if (index === 0) {
23
- margin = half(y) + " " + half(x) + " " + half(y) + " 0";
18
+ margin = `${half(y)} ${half(x)} ${half(y)} 0`;
24
19
  } else if (index === lastIndex) {
25
- margin = half(y) + " 0 " + half(y) + " " + half(x);
20
+ margin = `${half(y)} 0 ${half(y)} ${half(x)}`;
26
21
  } else {
27
- margin = half(y) + " " + half(x);
22
+ margin = `${half(y)} ${half(x)}`;
28
23
  }
29
24
  }
30
25
  }
31
- if (direction === 'column' && index !== lastIndex) {
32
- margin = "0 0 " + y + " 0";
26
+ if (direction === "column" && index !== lastIndex) {
27
+ margin = `0 0 ${y} 0`;
33
28
  }
34
29
  return margin;
35
- }
30
+ }
31
+ export {
32
+ computeMargin,
33
+ half
34
+ };
@@ -1,7 +1,7 @@
1
- export var props = {
1
+ const props = {
2
2
  size: {
3
3
  type: [String, Number, Array],
4
- default: 'normal'
4
+ default: "normal"
5
5
  },
6
6
  wrap: {
7
7
  type: Boolean,
@@ -9,12 +9,15 @@ export var props = {
9
9
  },
10
10
  direction: {
11
11
  type: String,
12
- default: 'row'
12
+ default: "row"
13
13
  },
14
14
  justify: {
15
15
  type: String,
16
- default: 'flex-start'
16
+ default: "flex-start"
17
17
  },
18
18
  align: String,
19
19
  inline: Boolean
20
- };
20
+ };
21
+ export {
22
+ props
23
+ };