zartui 3.1.7 → 3.1.8

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 (220) hide show
  1. package/README.md +25 -0
  2. package/es/action-sheet/ActionSheet.d.ts +2 -2
  3. package/es/action-sheet/index.d.ts +2 -2
  4. package/es/button/Button.d.ts +3 -3
  5. package/es/button/index.d.ts +3 -3
  6. package/es/calendar/Calendar.d.ts +2 -2
  7. package/es/calendar/index.d.ts +2 -2
  8. package/es/cascader/Cascader.d.ts +1 -1
  9. package/es/cascader/index.d.ts +1 -1
  10. package/es/cell/Cell.d.ts +2 -2
  11. package/es/cell/index.d.ts +2 -2
  12. package/es/cell-group/CellGroup.d.ts +1 -1
  13. package/es/cell-group/CellGroup.mjs +2 -1
  14. package/es/cell-group/index.d.ts +1 -1
  15. package/es/checkbox/Checkbox.d.ts +26 -12
  16. package/es/checkbox/Checkbox.mjs +13 -2
  17. package/es/checkbox/Checker.d.ts +9 -0
  18. package/es/checkbox/Checker.mjs +10 -10
  19. package/es/checkbox/index.css +1 -1
  20. package/es/checkbox/index.d.ts +9 -0
  21. package/es/composables/use-global-z-index.d.ts +4 -0
  22. package/es/composables/use-global-z-index.mjs +9 -0
  23. package/es/composables/use-scope-id.d.ts +3 -0
  24. package/es/composables/use-scope-id.mjs +9 -0
  25. package/es/composables/use-sync-prop-ref.d.ts +2 -0
  26. package/es/composables/use-sync-prop-ref.mjs +18 -0
  27. package/es/config-provider/ConfigProvider.d.ts +30 -6
  28. package/es/config-provider/ConfigProvider.mjs +48 -9
  29. package/es/config-provider/index.d.ts +17 -2
  30. package/es/date-time-picker/DateTimePicker.d.ts +2 -2
  31. package/es/date-time-picker/DateTimePickerWrapper.d.ts +2 -2
  32. package/es/date-time-picker/index.d.ts +2 -2
  33. package/es/dialog/Dialog.d.ts +1 -1
  34. package/es/dialog/function-call.d.ts +3 -3
  35. package/es/dialog/function-call.mjs +1 -1
  36. package/es/dialog/index.d.ts +1 -1
  37. package/es/divider/Divider.d.ts +1 -1
  38. package/es/divider/index.d.ts +1 -1
  39. package/es/dropdown-item/DropdownItem.mjs +2 -2
  40. package/es/dropdown-item/types.d.ts +2 -1
  41. package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
  42. package/es/dropdown-menu/index.d.ts +1 -1
  43. package/es/field/Field.d.ts +3 -3
  44. package/es/field/index.d.ts +3 -3
  45. package/es/grid/Grid.d.ts +1 -1
  46. package/es/grid/index.d.ts +1 -1
  47. package/es/icon/config.mjs +34 -11
  48. package/es/icon/index.css +1 -1
  49. package/es/image/Image.d.ts +1 -1
  50. package/es/image/index.d.ts +1 -1
  51. package/es/image-preview/ImagePreview.d.ts +17 -1
  52. package/es/image-preview/ImagePreview.mjs +17 -4
  53. package/es/image-preview/ImagePreviewItem.d.ts +6 -0
  54. package/es/image-preview/ImagePreviewItem.mjs +9 -3
  55. package/es/image-preview/function-call.mjs +1 -0
  56. package/es/image-preview/index.d.ts +12 -1
  57. package/es/image-preview/types.d.ts +1 -0
  58. package/es/index.d.ts +1 -1
  59. package/es/index.mjs +1 -1
  60. package/es/lazyload/vue-lazyload/index.d.ts +55 -55
  61. package/es/list/List.d.ts +7 -3
  62. package/es/list/List.mjs +5 -3
  63. package/es/list/index.d.ts +2 -0
  64. package/es/nav-bar/NavBar.d.ts +1 -1
  65. package/es/nav-bar/index.d.ts +1 -1
  66. package/es/notify/Notify.d.ts +1 -1
  67. package/es/notify/index.d.ts +1 -1
  68. package/es/number-keyboard/NumberKeyboard.d.ts +3 -3
  69. package/es/number-keyboard/NumberKeyboardKey.d.ts +1 -1
  70. package/es/number-keyboard/index.d.ts +3 -3
  71. package/es/popover/Popover.d.ts +1 -1
  72. package/es/popover/Popover.mjs +16 -12
  73. package/es/popover/index.d.ts +1 -1
  74. package/es/popup/Popup.d.ts +2 -2
  75. package/es/popup/Popup.mjs +9 -10
  76. package/es/popup/index.d.ts +2 -2
  77. package/es/search/Search.d.ts +1 -1
  78. package/es/search/index.d.ts +1 -1
  79. package/es/skeleton/Skeleton.d.ts +2 -2
  80. package/es/skeleton/index.d.ts +2 -2
  81. package/es/stepper/Stepper.d.ts +2 -2
  82. package/es/stepper/index.d.ts +2 -2
  83. package/es/steps/Steps.d.ts +1 -1
  84. package/es/steps/index.d.ts +1 -1
  85. package/es/sticky/Sticky.d.ts +1 -1
  86. package/es/sticky/index.d.ts +1 -1
  87. package/es/swipe/Swipe.mjs +1 -1
  88. package/es/swipe/index.css +1 -1
  89. package/es/swipe-cell/SwipeCell.mjs +10 -1
  90. package/es/tabs/Tabs.d.ts +4 -4
  91. package/es/tabs/index.d.ts +4 -4
  92. package/es/tag/Tag.d.ts +1 -1
  93. package/es/tag/index.d.ts +1 -1
  94. package/es/text-ellipsis/TextEllipsis.d.ts +17 -4
  95. package/es/text-ellipsis/TextEllipsis.mjs +52 -30
  96. package/es/text-ellipsis/index.d.ts +12 -3
  97. package/es/toast/Toast.d.ts +5 -2
  98. package/es/toast/Toast.mjs +2 -1
  99. package/es/toast/index.css +1 -1
  100. package/es/toast/index.d.ts +4 -2
  101. package/es/toast/types.d.ts +2 -0
  102. package/es/uploader/Uploader.d.ts +1 -1
  103. package/es/uploader/index.d.ts +1 -1
  104. package/es/utils/interceptor.d.ts +2 -1
  105. package/es/utils/interceptor.mjs +3 -2
  106. package/es/vue-sfc-shim.d.ts +6 -6
  107. package/es/vue-tsx-shim.d.ts +23 -23
  108. package/lib/action-sheet/ActionSheet.d.ts +2 -2
  109. package/lib/action-sheet/index.d.ts +2 -2
  110. package/lib/button/Button.d.ts +3 -3
  111. package/lib/button/index.d.ts +3 -3
  112. package/lib/calendar/Calendar.d.ts +2 -2
  113. package/lib/calendar/index.d.ts +2 -2
  114. package/lib/cascader/Cascader.d.ts +1 -1
  115. package/lib/cascader/index.d.ts +1 -1
  116. package/lib/cell/Cell.d.ts +2 -2
  117. package/lib/cell/index.d.ts +2 -2
  118. package/lib/cell-group/CellGroup.d.ts +1 -1
  119. package/lib/cell-group/CellGroup.js +2 -1
  120. package/lib/cell-group/index.d.ts +1 -1
  121. package/lib/checkbox/Checkbox.d.ts +26 -12
  122. package/lib/checkbox/Checkbox.js +13 -2
  123. package/lib/checkbox/Checker.d.ts +9 -0
  124. package/lib/checkbox/Checker.js +10 -10
  125. package/lib/checkbox/index.css +1 -1
  126. package/lib/checkbox/index.d.ts +9 -0
  127. package/lib/composables/use-global-z-index.d.ts +4 -0
  128. package/lib/composables/use-global-z-index.js +28 -0
  129. package/lib/composables/use-scope-id.d.ts +3 -0
  130. package/lib/composables/use-scope-id.js +28 -0
  131. package/lib/composables/use-sync-prop-ref.d.ts +2 -0
  132. package/lib/composables/use-sync-prop-ref.js +37 -0
  133. package/lib/config-provider/ConfigProvider.d.ts +30 -6
  134. package/lib/config-provider/ConfigProvider.js +46 -7
  135. package/lib/config-provider/index.d.ts +17 -2
  136. package/lib/date-time-picker/DateTimePicker.d.ts +2 -2
  137. package/lib/date-time-picker/DateTimePickerWrapper.d.ts +2 -2
  138. package/lib/date-time-picker/index.d.ts +2 -2
  139. package/lib/dialog/Dialog.d.ts +1 -1
  140. package/lib/dialog/function-call.d.ts +3 -3
  141. package/lib/dialog/function-call.js +1 -1
  142. package/lib/dialog/index.d.ts +1 -1
  143. package/lib/divider/Divider.d.ts +1 -1
  144. package/lib/divider/index.d.ts +1 -1
  145. package/lib/dropdown-item/DropdownItem.js +2 -2
  146. package/lib/dropdown-item/types.d.ts +2 -1
  147. package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
  148. package/lib/dropdown-menu/index.d.ts +1 -1
  149. package/lib/field/Field.d.ts +3 -3
  150. package/lib/field/index.d.ts +3 -3
  151. package/lib/grid/Grid.d.ts +1 -1
  152. package/lib/grid/index.d.ts +1 -1
  153. package/lib/icon/config.js +34 -11
  154. package/lib/icon/index.css +1 -1
  155. package/lib/image/Image.d.ts +1 -1
  156. package/lib/image/index.d.ts +1 -1
  157. package/lib/image-preview/ImagePreview.d.ts +17 -1
  158. package/lib/image-preview/ImagePreview.js +17 -4
  159. package/lib/image-preview/ImagePreviewItem.d.ts +6 -0
  160. package/lib/image-preview/ImagePreviewItem.js +9 -3
  161. package/lib/image-preview/function-call.js +1 -0
  162. package/lib/image-preview/index.d.ts +12 -1
  163. package/lib/image-preview/types.d.ts +1 -0
  164. package/lib/index.css +1 -1
  165. package/lib/index.d.ts +1 -1
  166. package/lib/index.js +1 -1
  167. package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
  168. package/lib/list/List.d.ts +7 -3
  169. package/lib/list/List.js +4 -2
  170. package/lib/list/index.d.ts +2 -0
  171. package/lib/nav-bar/NavBar.d.ts +1 -1
  172. package/lib/nav-bar/index.d.ts +1 -1
  173. package/lib/notify/Notify.d.ts +1 -1
  174. package/lib/notify/index.d.ts +1 -1
  175. package/lib/number-keyboard/NumberKeyboard.d.ts +3 -3
  176. package/lib/number-keyboard/NumberKeyboardKey.d.ts +1 -1
  177. package/lib/number-keyboard/index.d.ts +3 -3
  178. package/lib/popover/Popover.d.ts +1 -1
  179. package/lib/popover/Popover.js +16 -12
  180. package/lib/popover/index.d.ts +1 -1
  181. package/lib/popup/Popup.d.ts +2 -2
  182. package/lib/popup/Popup.js +8 -9
  183. package/lib/popup/index.d.ts +2 -2
  184. package/lib/search/Search.d.ts +1 -1
  185. package/lib/search/index.d.ts +1 -1
  186. package/lib/skeleton/Skeleton.d.ts +2 -2
  187. package/lib/skeleton/index.d.ts +2 -2
  188. package/lib/stepper/Stepper.d.ts +2 -2
  189. package/lib/stepper/index.d.ts +2 -2
  190. package/lib/steps/Steps.d.ts +1 -1
  191. package/lib/steps/index.d.ts +1 -1
  192. package/lib/sticky/Sticky.d.ts +1 -1
  193. package/lib/sticky/index.d.ts +1 -1
  194. package/lib/swipe/Swipe.js +1 -1
  195. package/lib/swipe/index.css +1 -1
  196. package/lib/swipe-cell/SwipeCell.js +10 -1
  197. package/lib/tabs/Tabs.d.ts +4 -4
  198. package/lib/tabs/index.d.ts +4 -4
  199. package/lib/tag/Tag.d.ts +1 -1
  200. package/lib/tag/index.d.ts +1 -1
  201. package/lib/text-ellipsis/TextEllipsis.d.ts +17 -4
  202. package/lib/text-ellipsis/TextEllipsis.js +51 -29
  203. package/lib/text-ellipsis/index.d.ts +12 -3
  204. package/lib/toast/Toast.d.ts +5 -2
  205. package/lib/toast/Toast.js +2 -1
  206. package/lib/toast/index.css +1 -1
  207. package/lib/toast/index.d.ts +4 -2
  208. package/lib/toast/types.d.ts +2 -0
  209. package/lib/uploader/Uploader.d.ts +1 -1
  210. package/lib/uploader/index.d.ts +1 -1
  211. package/lib/utils/interceptor.d.ts +2 -1
  212. package/lib/utils/interceptor.js +3 -2
  213. package/lib/vue-sfc-shim.d.ts +6 -6
  214. package/lib/vue-tsx-shim.d.ts +23 -23
  215. package/lib/web-types.json +1 -1
  216. package/lib/zartui.cjs.js +214 -88
  217. package/lib/zartui.es.js +215 -89
  218. package/lib/zartui.js +214 -88
  219. package/lib/zartui.min.js +1 -1
  220. package/package.json +19 -9
package/lib/zartui.cjs.js CHANGED
@@ -369,7 +369,8 @@ const LONG_PRESS_START_TIME = 500;
369
369
  function callInterceptor(interceptor, {
370
370
  args = [],
371
371
  done,
372
- canceled
372
+ canceled,
373
+ error
373
374
  }) {
374
375
  if (interceptor) {
375
376
  const returnVal = interceptor.apply(null, args);
@@ -380,7 +381,7 @@ function callInterceptor(interceptor, {
380
381
  } else if (canceled) {
381
382
  canceled();
382
383
  }
383
- }).catch(noop);
384
+ }).catch(error || noop);
384
385
  } else if (returnVal) {
385
386
  done();
386
387
  } else if (canceled) {
@@ -497,32 +498,53 @@ var stdin_default$1P = vue.defineComponent({
497
498
  }
498
499
  });
499
500
  const Badge = withInstall(stdin_default$1P);
501
+ let globalZIndex = 2e3;
502
+ const useGlobalZIndex = () => ++globalZIndex;
503
+ const setGlobalZIndex = (val) => {
504
+ globalZIndex = val;
505
+ };
500
506
  const [name$1k, bem$1g] = createNamespace("config-provider");
501
507
  const CONFIG_PROVIDER_KEY = Symbol(name$1k);
502
508
  const configProviderProps = {
503
509
  tag: makeStringProp("div"),
504
510
  theme: makeStringProp("light"),
511
+ zIndex: Number,
505
512
  themeVars: Object,
513
+ themeVarsDark: Object,
514
+ themeVarsLight: Object,
515
+ themeVarsScope: makeStringProp("local"),
506
516
  iconPrefix: String
507
517
  };
518
+ function insertDash(str) {
519
+ return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
520
+ }
508
521
  function mapThemeVarsToCSSVars(themeVars) {
509
522
  const cssVars = {};
510
523
  Object.keys(themeVars).forEach((key) => {
511
- cssVars[`--zt-${kebabCase(key)}`] = themeVars[key];
524
+ const formattedKey = insertDash(kebabCase(key));
525
+ cssVars[`--zt-${formattedKey}`] = themeVars[key];
512
526
  });
513
527
  return cssVars;
514
528
  }
529
+ function syncThemeVarsOnRoot(newStyle = {}, oldStyle = {}) {
530
+ Object.keys(newStyle).forEach((key) => {
531
+ if (newStyle[key] !== oldStyle[key]) {
532
+ document.documentElement.style.setProperty(key, newStyle[key]);
533
+ }
534
+ });
535
+ Object.keys(oldStyle).forEach((key) => {
536
+ if (!newStyle[key]) {
537
+ document.documentElement.style.removeProperty(key);
538
+ }
539
+ });
540
+ }
515
541
  var stdin_default$1O = vue.defineComponent({
516
542
  name: name$1k,
517
543
  props: configProviderProps,
518
544
  setup(props, {
519
545
  slots
520
546
  }) {
521
- const style = vue.computed(() => {
522
- if (props.themeVars) {
523
- return mapThemeVarsToCSSVars(props.themeVars);
524
- }
525
- });
547
+ const style = vue.computed(() => mapThemeVarsToCSSVars(extend({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
526
548
  if (inBrowser) {
527
549
  const addTheme = () => {
528
550
  document.documentElement.classList.add(`zt-theme-${props.theme}`);
@@ -541,11 +563,32 @@ var stdin_default$1O = vue.defineComponent({
541
563
  vue.onActivated(addTheme);
542
564
  vue.onDeactivated(removeTheme);
543
565
  vue.onBeforeUnmount(removeTheme);
566
+ vue.watch(style, (newStyle, oldStyle) => {
567
+ if (props.themeVarsScope === "global") {
568
+ syncThemeVarsOnRoot(newStyle, oldStyle);
569
+ }
570
+ });
571
+ vue.watch(() => props.themeVarsScope, (newScope, oldScope) => {
572
+ if (oldScope === "global") {
573
+ syncThemeVarsOnRoot({}, style.value);
574
+ }
575
+ if (newScope === "global") {
576
+ syncThemeVarsOnRoot(style.value, {});
577
+ }
578
+ });
579
+ if (props.themeVarsScope === "global") {
580
+ syncThemeVarsOnRoot(style.value, {});
581
+ }
544
582
  }
545
583
  vue.provide(CONFIG_PROVIDER_KEY, props);
584
+ vue.watchEffect(() => {
585
+ if (props.zIndex !== void 0) {
586
+ setGlobalZIndex(props.zIndex);
587
+ }
588
+ });
546
589
  return () => vue.createVNode(props.tag, {
547
590
  "class": bem$1g(),
548
- "style": style.value
591
+ "style": props.themeVarsScope === "local" ? style.value : void 0
549
592
  }, {
550
593
  default: () => {
551
594
  var _a;
@@ -772,6 +815,11 @@ function onPopupReopen(callback) {
772
815
  });
773
816
  }
774
817
  }
818
+ const useScopeId = () => {
819
+ var _a;
820
+ const { scopeId } = ((_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode) || {};
821
+ return scopeId ? { [scopeId]: "" } : null;
822
+ };
775
823
  const [name$1i, bem$1e] = createNamespace("overlay");
776
824
  const overlayProps = {
777
825
  show: Boolean,
@@ -831,7 +879,6 @@ const popupProps$2 = extend({}, popupSharedProps, {
831
879
  slideable: Boolean
832
880
  });
833
881
  const [name$1h, bem$1d] = createNamespace("popup");
834
- let globalZIndex = 2e3;
835
882
  var stdin_default$1K = vue.defineComponent({
836
883
  name: name$1h,
837
884
  inheritAttrs: false,
@@ -868,11 +915,8 @@ var stdin_default$1K = vue.defineComponent({
868
915
  contentStyle.value = `height:${props.sliderContentHeight}px;`;
869
916
  }
870
917
  if (!opened) {
871
- if (props.zIndex !== void 0) {
872
- globalZIndex = +props.zIndex;
873
- }
874
918
  opened = true;
875
- zIndex.value = ++globalZIndex;
919
+ zIndex.value = props.zIndex !== void 0 ? +props.zIndex : useGlobalZIndex();
876
920
  emit("open");
877
921
  }
878
922
  };
@@ -929,14 +973,15 @@ var stdin_default$1K = vue.defineComponent({
929
973
  });
930
974
  const renderOverlay = () => {
931
975
  if (props.overlay) {
932
- return vue.createVNode(Overlay, {
976
+ return vue.createVNode(Overlay, vue.mergeProps({
933
977
  "show": props.show,
934
978
  "class": props.overlayClass,
935
979
  "zIndex": zIndex.value,
936
980
  "duration": props.duration,
937
- "customStyle": props.overlayStyle,
981
+ "customStyle": props.overlayStyle
982
+ }, useScopeId(), {
938
983
  "onClick": onClickOverlay
939
- }, {
984
+ }), {
940
985
  default: slots["overlay-content"]
941
986
  });
942
987
  }
@@ -979,7 +1024,7 @@ var stdin_default$1K = vue.defineComponent({
979
1024
  "zt-safe-area-bottom": safeAreaInsetBottom
980
1025
  }],
981
1026
  "onKeydown": onKeydown
982
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props.show]]);
1027
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props.show]]);
983
1028
  });
984
1029
  const sliderRenderPopup = lazyRender(() => {
985
1030
  var _a, _b;
@@ -1825,6 +1870,7 @@ const toastProps = {
1825
1870
  duration: makeNumberProp(2e3),
1826
1871
  position: makeStringProp("middle"),
1827
1872
  teleport: [String, Object],
1873
+ wordBreak: String,
1828
1874
  className: unknownProp,
1829
1875
  iconPrefix: String,
1830
1876
  transition: makeStringProp("zt-fade"),
@@ -1910,7 +1956,7 @@ var stdin_default$1z = vue.defineComponent({
1910
1956
  vue.onMounted(toggleClickable);
1911
1957
  vue.onUnmounted(toggleClickable);
1912
1958
  return () => vue.createVNode(Popup, vue.mergeProps({
1913
- "class": [bem$16([props.position, {
1959
+ "class": [bem$16([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
1914
1960
  [props.type]: !props.icon
1915
1961
  }]), props.className],
1916
1962
  "lockScroll": false,
@@ -3413,7 +3459,7 @@ var stdin_default$1s = vue.defineComponent({
3413
3459
  const trackStyle = vue.computed(() => {
3414
3460
  const style = {
3415
3461
  transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
3416
- transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
3462
+ transform: `translate${props.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
3417
3463
  };
3418
3464
  if (size.value) {
3419
3465
  const mainAxis = props.vertical ? "height" : "width";
@@ -4814,7 +4860,7 @@ var stdin_default$1k = vue.defineComponent({
4814
4860
  }), {
4815
4861
  [BORDER_TOP_BOTTOM]: props.border && !props.inset
4816
4862
  }]
4817
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
4863
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
4818
4864
  };
4819
4865
  const renderTitle = () => vue.createVNode("div", {
4820
4866
  "class": bem$X("title", {
@@ -4908,7 +4954,11 @@ var stdin_default$1i = vue.defineComponent({
4908
4954
  role: String,
4909
4955
  parent: Object,
4910
4956
  checked: Boolean,
4911
- bindGroup: truthProp
4957
+ bindGroup: truthProp,
4958
+ indeterminate: {
4959
+ type: Boolean,
4960
+ default: null
4961
+ }
4912
4962
  }),
4913
4963
  emits: ["click", "toggle"],
4914
4964
  setup(props, {
@@ -4947,14 +4997,16 @@ var stdin_default$1i = vue.defineComponent({
4947
4997
  const {
4948
4998
  bem: bem2,
4949
4999
  shape,
4950
- checked
5000
+ checked,
5001
+ indeterminate
4951
5002
  } = props;
4952
5003
  const iconSize = props.iconSize || getParentProp("iconSize");
4953
5004
  return vue.createVNode("div", {
4954
5005
  "ref": iconRef,
4955
5006
  "class": bem2("icon", [shape, {
4956
5007
  disabled: disabled.value,
4957
- checked
5008
+ checked,
5009
+ indeterminate
4958
5010
  }]),
4959
5011
  "style": {
4960
5012
  fontSize: addUnit(iconSize)
@@ -4962,14 +5014,8 @@ var stdin_default$1i = vue.defineComponent({
4962
5014
  }, [slots.icon ? slots.icon({
4963
5015
  checked,
4964
5016
  disabled: disabled.value
4965
- }) : props.role === "radio" ? vue.createVNode(Icon, {
4966
- "style": iconStyle.value
4967
- }, {
4968
- default: () => [checked ? vue.createVNode("div", {
4969
- "class": bem2("dot")
4970
- }, null) : ""]
4971
5017
  }) : vue.createVNode(Icon, {
4972
- "name": "checkbox-select",
5018
+ "name": indeterminate ? "minus" : "checkbox-select",
4973
5019
  "style": iconStyle.value
4974
5020
  }, null)]);
4975
5021
  };
@@ -4999,7 +5045,11 @@ var stdin_default$1i = vue.defineComponent({
4999
5045
  });
5000
5046
  const [name$W, bem$V] = createNamespace("checkbox");
5001
5047
  const checkboxProps = extend({}, checkerProps, {
5002
- bindGroup: truthProp
5048
+ bindGroup: truthProp,
5049
+ indeterminate: {
5050
+ type: Boolean,
5051
+ default: null
5052
+ }
5003
5053
  });
5004
5054
  var stdin_default$1h = vue.defineComponent({
5005
5055
  name: name$W,
@@ -5050,9 +5100,16 @@ var stdin_default$1h = vue.defineComponent({
5050
5100
  setParentValue(newValue);
5051
5101
  } else {
5052
5102
  emit("update:modelValue", newValue);
5103
+ if (props.indeterminate !== null) {
5104
+ emit("change", newValue);
5105
+ }
5053
5106
  }
5054
5107
  };
5055
- vue.watch(() => props.modelValue, (value) => emit("change", value));
5108
+ vue.watch(() => props.modelValue, (value) => {
5109
+ if (props.indeterminate === null) {
5110
+ emit("change", value);
5111
+ }
5112
+ });
5056
5113
  useExpose({
5057
5114
  toggle,
5058
5115
  props,
@@ -7163,7 +7220,7 @@ function initInstance$2() {
7163
7220
  }
7164
7221
  function showDialog(options) {
7165
7222
  if (!inBrowser) {
7166
- return Promise.resolve();
7223
+ return Promise.resolve(void 0);
7167
7224
  }
7168
7225
  return new Promise((resolve, reject) => {
7169
7226
  if (!instance$2) {
@@ -7479,7 +7536,7 @@ var stdin_default$10 = vue.defineComponent({
7479
7536
  if (props.multiSelect) {
7480
7537
  return vue.createVNode(Cell, {
7481
7538
  "role": "menuitem",
7482
- "key": option.value,
7539
+ "key": String(option.value),
7483
7540
  "title-icon": option.icon,
7484
7541
  "title": option.text,
7485
7542
  "direction": "horizontal",
@@ -7498,7 +7555,7 @@ var stdin_default$10 = vue.defineComponent({
7498
7555
  }
7499
7556
  return vue.createVNode(Cell, {
7500
7557
  "role": "menuitem",
7501
- "key": option.value,
7558
+ "key": String(option.value),
7502
7559
  "title-icon": option.icon,
7503
7560
  "title": option.text,
7504
7561
  "direction": "horizontal",
@@ -9842,7 +9899,9 @@ var stdin_default$S = vue.defineComponent({
9842
9899
  minZoom: makeRequiredProp(numericProp),
9843
9900
  maxZoom: makeRequiredProp(numericProp),
9844
9901
  rootWidth: makeRequiredProp(Number),
9845
- rootHeight: makeRequiredProp(Number)
9902
+ rootHeight: makeRequiredProp(Number),
9903
+ disableZoom: Boolean,
9904
+ closeOnClickOverlay: Boolean
9846
9905
  },
9847
9906
  emits: ["scale", "close", "longPress"],
9848
9907
  setup(props, {
@@ -9980,7 +10039,8 @@ var stdin_default$S = vue.defineComponent({
9980
10039
  setScale(scale);
9981
10040
  }
9982
10041
  };
9983
- const checkTap = () => {
10042
+ const checkTap = (event) => {
10043
+ var _a;
9984
10044
  if (fingerNum > 1) {
9985
10045
  return;
9986
10046
  }
@@ -9998,6 +10058,9 @@ var stdin_default$S = vue.defineComponent({
9998
10058
  doubleTapTimer = null;
9999
10059
  toggleScale();
10000
10060
  } else {
10061
+ if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
10062
+ return;
10063
+ }
10001
10064
  doubleTapTimer = setTimeout(() => {
10002
10065
  emit("close");
10003
10066
  doubleTapTimer = null;
@@ -10035,7 +10098,7 @@ var stdin_default$S = vue.defineComponent({
10035
10098
  }
10036
10099
  }
10037
10100
  preventDefault(event, stopPropagation2);
10038
- checkTap();
10101
+ checkTap(event);
10039
10102
  touch.reset();
10040
10103
  };
10041
10104
  const onLoad = (event) => {
@@ -10089,7 +10152,7 @@ var stdin_default$S = vue.defineComponent({
10089
10152
  }
10090
10153
  });
10091
10154
  const [name$A, bem$z] = createNamespace("image-preview");
10092
- const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate"];
10155
+ const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
10093
10156
  const imagePreviewProps = {
10094
10157
  show: Boolean,
10095
10158
  loop: truthProp,
@@ -10109,7 +10172,9 @@ const imagePreviewProps = {
10109
10172
  startPosition: makeNumericProp(0),
10110
10173
  showIndicators: Boolean,
10111
10174
  closeOnPopstate: truthProp,
10112
- closeIconPosition: makeStringProp("top-right")
10175
+ closeOnClickOverlay: truthProp,
10176
+ closeIconPosition: makeStringProp("top-right"),
10177
+ teleport: [String, Object]
10113
10178
  };
10114
10179
  var stdin_default$R = vue.defineComponent({
10115
10180
  name: name$A,
@@ -10123,7 +10188,8 @@ var stdin_default$R = vue.defineComponent({
10123
10188
  const state = vue.reactive({
10124
10189
  active: 0,
10125
10190
  rootWidth: 0,
10126
- rootHeight: 0
10191
+ rootHeight: 0,
10192
+ disableZoom: false
10127
10193
  });
10128
10194
  const resize2 = () => {
10129
10195
  if (swipeRef.value) {
@@ -10179,6 +10245,12 @@ var stdin_default$R = vue.defineComponent({
10179
10245
  }, [slots.cover()]);
10180
10246
  }
10181
10247
  };
10248
+ const onDragStart = () => {
10249
+ state.disableZoom = true;
10250
+ };
10251
+ const onDragEnd = () => {
10252
+ state.disableZoom = false;
10253
+ };
10182
10254
  const renderImages = () => vue.createVNode(Swipe, {
10183
10255
  "ref": swipeRef,
10184
10256
  "lazyRender": true,
@@ -10188,7 +10260,9 @@ var stdin_default$R = vue.defineComponent({
10188
10260
  "initialSwipe": props.startPosition,
10189
10261
  "showIndicators": props.showIndicators,
10190
10262
  "indicatorColor": "white",
10191
- "onChange": setActive
10263
+ "onChange": setActive,
10264
+ "onDragEnd": onDragEnd,
10265
+ "onDragStart": onDragStart
10192
10266
  }, {
10193
10267
  default: () => [props.images.map((image, index) => vue.createVNode(stdin_default$S, {
10194
10268
  "src": image.url,
@@ -10198,6 +10272,8 @@ var stdin_default$R = vue.defineComponent({
10198
10272
  "minZoom": props.minZoom,
10199
10273
  "rootWidth": state.rootWidth,
10200
10274
  "rootHeight": state.rootHeight,
10275
+ "disableZoom": state.disableZoom,
10276
+ "closeOnClickOverlay": props.closeOnClickOverlay,
10201
10277
  "onScale": emitScale,
10202
10278
  "onClose": emitClose,
10203
10279
  "onLongPress": () => emit("longPress", {
@@ -10280,6 +10356,7 @@ const defaultConfig = {
10280
10356
  swipeDuration: 300,
10281
10357
  showIndicators: false,
10282
10358
  closeOnPopstate: true,
10359
+ closeOnClickOverlay: true,
10283
10360
  closeIconPosition: "top-right"
10284
10361
  };
10285
10362
  function initInstance$1() {
@@ -10677,6 +10754,7 @@ const listProps = {
10677
10754
  offset: makeNumericProp(300),
10678
10755
  loading: Boolean,
10679
10756
  finished: Boolean,
10757
+ scroller: Object,
10680
10758
  errorText: String,
10681
10759
  direction: makeStringProp("down"),
10682
10760
  loadingText: String,
@@ -10696,6 +10774,7 @@ var stdin_default$O = vue.defineComponent({
10696
10774
  const placeholder = vue.ref();
10697
10775
  const tabStatus = useTabStatus();
10698
10776
  const scrollParent = use.useScrollParent(root);
10777
+ const scroller = vue.computed(() => props.scroller || scrollParent.value);
10699
10778
  const check = () => {
10700
10779
  vue.nextTick(() => {
10701
10780
  if (loading.value || props.finished || props.error || // skip check when inside an inactive tab
@@ -10706,7 +10785,7 @@ var stdin_default$O = vue.defineComponent({
10706
10785
  direction
10707
10786
  } = props;
10708
10787
  const offset = +props.offset;
10709
- const scrollParentRect = use.useRect(scrollParent);
10788
+ const scrollParentRect = use.useRect(scroller);
10710
10789
  if (!scrollParentRect.height || isHidden(root)) {
10711
10790
  return;
10712
10791
  }
@@ -10787,7 +10866,7 @@ var stdin_default$O = vue.defineComponent({
10787
10866
  check
10788
10867
  });
10789
10868
  use.useEventListener("scroll", check, {
10790
- target: scrollParent,
10869
+ target: scroller,
10791
10870
  passive: true
10792
10871
  });
10793
10872
  return () => {
@@ -14013,6 +14092,20 @@ var stdin_default$u = vue.defineComponent({
14013
14092
  }
14014
14093
  });
14015
14094
  const PasswordInput = withInstall(stdin_default$u);
14095
+ const useSyncPropRef = (getProp, setProp) => {
14096
+ const propRef = vue.ref(getProp());
14097
+ vue.watch(getProp, (value) => {
14098
+ if (value !== propRef.value) {
14099
+ propRef.value = value;
14100
+ }
14101
+ });
14102
+ vue.watch(propRef, (value) => {
14103
+ if (value !== getProp()) {
14104
+ setProp(value);
14105
+ }
14106
+ });
14107
+ return propRef;
14108
+ };
14016
14109
  var __async = (__this, __arguments, generator) => {
14017
14110
  return new Promise((resolve, reject) => {
14018
14111
  var fulfilled = (value) => {
@@ -14034,7 +14127,7 @@ var __async = (__this, __arguments, generator) => {
14034
14127
  });
14035
14128
  };
14036
14129
  const [name$m, bem$l] = createNamespace("popover");
14037
- const popupProps = ["show", "overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
14130
+ const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
14038
14131
  const popoverProps = {
14039
14132
  show: Boolean,
14040
14133
  theme: makeStringProp("light"),
@@ -14077,6 +14170,7 @@ var stdin_default$t = vue.defineComponent({
14077
14170
  const wrapperRef = vue.ref();
14078
14171
  const popoverRef = vue.ref();
14079
14172
  const arrowRef = vue.ref();
14173
+ const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
14080
14174
  const getPopoverOptions = () => ({
14081
14175
  placement: props.placement,
14082
14176
  modifiers: [{
@@ -14099,7 +14193,7 @@ var stdin_default$t = vue.defineComponent({
14099
14193
  };
14100
14194
  const updateLocation = () => {
14101
14195
  vue.nextTick(() => {
14102
- if (!props.show) {
14196
+ if (!show.value) {
14103
14197
  return;
14104
14198
  }
14105
14199
  if (!popper) {
@@ -14113,10 +14207,12 @@ var stdin_default$t = vue.defineComponent({
14113
14207
  }
14114
14208
  });
14115
14209
  };
14116
- const updateShow = (value) => emit("update:show", value);
14210
+ const updateShow = (value) => {
14211
+ show.value = value;
14212
+ };
14117
14213
  const onClickWrapper = () => {
14118
14214
  if (props.trigger === "click") {
14119
- updateShow(!props.show);
14215
+ show.value = !show.value;
14120
14216
  }
14121
14217
  };
14122
14218
  const onClickAction = (action, index) => {
@@ -14129,12 +14225,12 @@ var stdin_default$t = vue.defineComponent({
14129
14225
  action.selected = true;
14130
14226
  emit("select", action, index);
14131
14227
  if (props.closeOnClickAction) {
14132
- updateShow(false);
14228
+ show.value = false;
14133
14229
  }
14134
14230
  };
14135
14231
  const onClickAway = () => {
14136
- if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
14137
- updateShow(false);
14232
+ if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
14233
+ show.value = false;
14138
14234
  }
14139
14235
  };
14140
14236
  const renderActionContent = (action, index) => {
@@ -14251,7 +14347,7 @@ var stdin_default$t = vue.defineComponent({
14251
14347
  popper = null;
14252
14348
  }
14253
14349
  });
14254
- vue.watch(() => [props.show, props.offset, props.placement], updateLocation);
14350
+ vue.watch(() => [show.value, props.offset, props.placement], updateLocation);
14255
14351
  use.useClickAway(wrapperRef, onClickAway, {
14256
14352
  eventName: "touchstart"
14257
14353
  });
@@ -14263,14 +14359,13 @@ var stdin_default$t = vue.defineComponent({
14263
14359
  "onClick": onClickWrapper
14264
14360
  }, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), vue.createVNode(Popup, vue.mergeProps({
14265
14361
  "ref": popoverRef,
14266
- "class": bem$l([props.theme, props.show ? "show" : "hidden"]),
14362
+ "show": show.value,
14363
+ "class": bem$l([props.theme, show.value ? "show" : "hidden"]),
14267
14364
  "position": "",
14268
14365
  "transition": "zt-popover-zoom",
14269
14366
  "lockScroll": false,
14270
14367
  "onUpdate:show": updateShow
14271
- }, attrs, pick(props, popupProps), {
14272
- "show": true
14273
- }), {
14368
+ }, attrs, useScopeId(), pick(props, popupProps)), {
14274
14369
  default: () => [props.showArrow && vue.createVNode("div", {
14275
14370
  "class": bem$l("arrow"),
14276
14371
  "ref": arrowRef
@@ -16386,6 +16481,7 @@ var stdin_default$e = vue.defineComponent({
16386
16481
  let opened;
16387
16482
  let lockClick2;
16388
16483
  let startOffset;
16484
+ let isInBeforeClosing;
16389
16485
  const root = vue.ref();
16390
16486
  const leftRef = vue.ref();
16391
16487
  const rightRef = vue.ref();
@@ -16462,14 +16558,22 @@ var stdin_default$e = vue.defineComponent({
16462
16558
  }
16463
16559
  };
16464
16560
  const onClick = (position = "outside") => {
16561
+ if (isInBeforeClosing)
16562
+ return;
16465
16563
  emit("click", position);
16466
16564
  if (opened && !lockClick2) {
16565
+ isInBeforeClosing = true;
16467
16566
  callInterceptor(props.beforeClose, {
16468
16567
  args: [{
16469
16568
  name: props.name,
16470
16569
  position
16471
16570
  }],
16472
- done: () => close(position)
16571
+ done: () => {
16572
+ isInBeforeClosing = false;
16573
+ close(position);
16574
+ },
16575
+ canceled: () => isInBeforeClosing = false,
16576
+ error: () => isInBeforeClosing = false
16473
16577
  });
16474
16578
  }
16475
16579
  };
@@ -17141,10 +17245,11 @@ const Tag = withInstall(stdin_default$8);
17141
17245
  const [name$2, bem$2] = createNamespace("text-ellipsis");
17142
17246
  const textEllipsisProps = {
17143
17247
  rows: makeNumericProp(1),
17248
+ dots: makeStringProp("..."),
17144
17249
  content: makeStringProp(""),
17145
17250
  expandText: makeStringProp(""),
17146
17251
  collapseText: makeStringProp(""),
17147
- highlight: makeStringProp("")
17252
+ position: makeStringProp("end")
17148
17253
  };
17149
17254
  var stdin_default$7 = vue.defineComponent({
17150
17255
  name: name$2,
@@ -17157,6 +17262,7 @@ var stdin_default$7 = vue.defineComponent({
17157
17262
  const expanded = vue.ref(false);
17158
17263
  const hasAction = vue.ref(false);
17159
17264
  const root = vue.ref();
17265
+ const actionText = vue.computed(() => expanded.value ? props.collapseText : props.expandText);
17160
17266
  const pxToNum = (value) => {
17161
17267
  if (!value)
17162
17268
  return 0;
@@ -17186,23 +17292,52 @@ var stdin_default$7 = vue.defineComponent({
17186
17292
  const calcEllipsisText = (container2, maxHeight2) => {
17187
17293
  const {
17188
17294
  content,
17189
- expandText
17295
+ position,
17296
+ dots
17190
17297
  } = props;
17191
- const dot = "...";
17192
- let left = 0;
17193
- let right = content.length;
17194
- let res = -1;
17195
- while (left <= right) {
17196
- const mid = Math.floor((left + right) / 2);
17197
- container2.innerText = content.slice(0, mid) + dot + expandText;
17198
- if (container2.offsetHeight <= maxHeight2) {
17199
- left = mid + 1;
17200
- res = mid;
17201
- } else {
17202
- right = mid - 1;
17298
+ const end = content.length;
17299
+ const calcEllipse = () => {
17300
+ const tail = (left, right) => {
17301
+ if (right - left <= 1) {
17302
+ if (position === "end") {
17303
+ return content.slice(0, left) + dots;
17304
+ }
17305
+ return dots + content.slice(right, end);
17306
+ }
17307
+ const middle2 = Math.round((left + right) / 2);
17308
+ if (position === "end") {
17309
+ container2.innerText = content.slice(0, middle2) + dots + actionText.value;
17310
+ } else {
17311
+ container2.innerText = dots + content.slice(middle2, end) + actionText.value;
17312
+ }
17313
+ if (container2.offsetHeight > maxHeight2) {
17314
+ if (position === "end") {
17315
+ return tail(left, middle2);
17316
+ }
17317
+ return tail(middle2, right);
17318
+ }
17319
+ if (position === "end") {
17320
+ return tail(middle2, right);
17321
+ }
17322
+ return tail(left, middle2);
17323
+ };
17324
+ container2.innerText = tail(0, end);
17325
+ };
17326
+ const middleTail = (leftPart, rightPart) => {
17327
+ if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
17328
+ return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
17203
17329
  }
17204
- }
17205
- return content.slice(0, res) + dot;
17330
+ const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
17331
+ const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
17332
+ container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end) + props.expandText;
17333
+ if (container2.offsetHeight >= maxHeight2) {
17334
+ return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
17335
+ }
17336
+ return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
17337
+ };
17338
+ const middle = 0 + end >> 1;
17339
+ props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end]) : calcEllipse();
17340
+ return container2.innerText;
17206
17341
  };
17207
17342
  const container = cloneContainer();
17208
17343
  if (!container)
@@ -17212,7 +17347,7 @@ var stdin_default$7 = vue.defineComponent({
17212
17347
  paddingTop,
17213
17348
  lineHeight
17214
17349
  } = container.style;
17215
- const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
17350
+ const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
17216
17351
  if (maxHeight < container.offsetHeight) {
17217
17352
  hasAction.value = true;
17218
17353
  text.value = calcEllipsisText(container, maxHeight);
@@ -17226,26 +17361,17 @@ var stdin_default$7 = vue.defineComponent({
17226
17361
  expanded.value = !expanded.value;
17227
17362
  emit("clickAction", event);
17228
17363
  };
17229
- const formatSearchKeyword = (keywords, text2) => {
17230
- if (!keywords)
17231
- return text2;
17232
- const replaceReg = new RegExp(keywords, "ig");
17233
- const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1);">${keywords}</span>`;
17234
- return text2.replace(replaceReg, replaceString);
17235
- };
17236
17364
  const renderAction = () => vue.createVNode("span", {
17237
17365
  "class": bem$2("action"),
17238
17366
  "onClick": onClickAction
17239
- }, [expanded.value ? props.collapseText : props.expandText]);
17367
+ }, [actionText.value]);
17240
17368
  vue.onMounted(calcEllipsised);
17241
- vue.watch(() => [props.content, props.rows], calcEllipsised);
17369
+ vue.watch(() => [props.content, props.rows, props.position], calcEllipsised);
17242
17370
  use.useEventListener("resize", calcEllipsised);
17243
17371
  return () => vue.createVNode("div", {
17244
17372
  "ref": root,
17245
17373
  "class": bem$2()
17246
- }, [vue.createVNode("span", {
17247
- "innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
17248
- }, null), hasAction.value ? renderAction() : null]);
17374
+ }, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
17249
17375
  }
17250
17376
  });
17251
17377
  const TextEllipsis = withInstall(stdin_default$7);
@@ -18845,7 +18971,7 @@ const Lazyload = {
18845
18971
  });
18846
18972
  }
18847
18973
  };
18848
- const version = "3.1.7";
18974
+ const version = "3.1.8";
18849
18975
  function install(app) {
18850
18976
  const components = [
18851
18977
  ActionSheet,