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.js CHANGED
@@ -639,7 +639,8 @@
639
639
  function callInterceptor(interceptor, {
640
640
  args = [],
641
641
  done,
642
- canceled
642
+ canceled,
643
+ error
643
644
  }) {
644
645
  if (interceptor) {
645
646
  const returnVal = interceptor.apply(null, args);
@@ -650,7 +651,7 @@
650
651
  } else if (canceled) {
651
652
  canceled();
652
653
  }
653
- }).catch(noop);
654
+ }).catch(error || noop);
654
655
  } else if (returnVal) {
655
656
  done();
656
657
  } else if (canceled) {
@@ -767,32 +768,53 @@
767
768
  }
768
769
  });
769
770
  const Badge = withInstall(stdin_default$1P);
771
+ let globalZIndex = 2e3;
772
+ const useGlobalZIndex = () => ++globalZIndex;
773
+ const setGlobalZIndex = (val) => {
774
+ globalZIndex = val;
775
+ };
770
776
  const [name$1k, bem$1g] = createNamespace("config-provider");
771
777
  const CONFIG_PROVIDER_KEY = Symbol(name$1k);
772
778
  const configProviderProps = {
773
779
  tag: makeStringProp("div"),
774
780
  theme: makeStringProp("light"),
781
+ zIndex: Number,
775
782
  themeVars: Object,
783
+ themeVarsDark: Object,
784
+ themeVarsLight: Object,
785
+ themeVarsScope: makeStringProp("local"),
776
786
  iconPrefix: String
777
787
  };
788
+ function insertDash(str) {
789
+ return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
790
+ }
778
791
  function mapThemeVarsToCSSVars(themeVars) {
779
792
  const cssVars = {};
780
793
  Object.keys(themeVars).forEach((key) => {
781
- cssVars[`--zt-${kebabCase(key)}`] = themeVars[key];
794
+ const formattedKey = insertDash(kebabCase(key));
795
+ cssVars[`--zt-${formattedKey}`] = themeVars[key];
782
796
  });
783
797
  return cssVars;
784
798
  }
799
+ function syncThemeVarsOnRoot(newStyle = {}, oldStyle = {}) {
800
+ Object.keys(newStyle).forEach((key) => {
801
+ if (newStyle[key] !== oldStyle[key]) {
802
+ document.documentElement.style.setProperty(key, newStyle[key]);
803
+ }
804
+ });
805
+ Object.keys(oldStyle).forEach((key) => {
806
+ if (!newStyle[key]) {
807
+ document.documentElement.style.removeProperty(key);
808
+ }
809
+ });
810
+ }
785
811
  var stdin_default$1O = vue.defineComponent({
786
812
  name: name$1k,
787
813
  props: configProviderProps,
788
814
  setup(props, {
789
815
  slots
790
816
  }) {
791
- const style = vue.computed(() => {
792
- if (props.themeVars) {
793
- return mapThemeVarsToCSSVars(props.themeVars);
794
- }
795
- });
817
+ const style = vue.computed(() => mapThemeVarsToCSSVars(extend({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
796
818
  if (inBrowser$1) {
797
819
  const addTheme = () => {
798
820
  document.documentElement.classList.add(`zt-theme-${props.theme}`);
@@ -811,11 +833,32 @@
811
833
  vue.onActivated(addTheme);
812
834
  vue.onDeactivated(removeTheme);
813
835
  vue.onBeforeUnmount(removeTheme);
836
+ vue.watch(style, (newStyle, oldStyle) => {
837
+ if (props.themeVarsScope === "global") {
838
+ syncThemeVarsOnRoot(newStyle, oldStyle);
839
+ }
840
+ });
841
+ vue.watch(() => props.themeVarsScope, (newScope, oldScope) => {
842
+ if (oldScope === "global") {
843
+ syncThemeVarsOnRoot({}, style.value);
844
+ }
845
+ if (newScope === "global") {
846
+ syncThemeVarsOnRoot(style.value, {});
847
+ }
848
+ });
849
+ if (props.themeVarsScope === "global") {
850
+ syncThemeVarsOnRoot(style.value, {});
851
+ }
814
852
  }
815
853
  vue.provide(CONFIG_PROVIDER_KEY, props);
854
+ vue.watchEffect(() => {
855
+ if (props.zIndex !== void 0) {
856
+ setGlobalZIndex(props.zIndex);
857
+ }
858
+ });
816
859
  return () => vue.createVNode(props.tag, {
817
860
  "class": bem$1g(),
818
- "style": style.value
861
+ "style": props.themeVarsScope === "local" ? style.value : void 0
819
862
  }, {
820
863
  default: () => {
821
864
  var _a;
@@ -1042,6 +1085,11 @@
1042
1085
  });
1043
1086
  }
1044
1087
  }
1088
+ const useScopeId = () => {
1089
+ var _a;
1090
+ const { scopeId } = ((_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode) || {};
1091
+ return scopeId ? { [scopeId]: "" } : null;
1092
+ };
1045
1093
  const [name$1i, bem$1e] = createNamespace("overlay");
1046
1094
  const overlayProps = {
1047
1095
  show: Boolean,
@@ -1101,7 +1149,6 @@
1101
1149
  slideable: Boolean
1102
1150
  });
1103
1151
  const [name$1h, bem$1d] = createNamespace("popup");
1104
- let globalZIndex = 2e3;
1105
1152
  var stdin_default$1K = vue.defineComponent({
1106
1153
  name: name$1h,
1107
1154
  inheritAttrs: false,
@@ -1138,11 +1185,8 @@
1138
1185
  contentStyle.value = `height:${props.sliderContentHeight}px;`;
1139
1186
  }
1140
1187
  if (!opened) {
1141
- if (props.zIndex !== void 0) {
1142
- globalZIndex = +props.zIndex;
1143
- }
1144
1188
  opened = true;
1145
- zIndex.value = ++globalZIndex;
1189
+ zIndex.value = props.zIndex !== void 0 ? +props.zIndex : useGlobalZIndex();
1146
1190
  emit("open");
1147
1191
  }
1148
1192
  };
@@ -1199,14 +1243,15 @@
1199
1243
  });
1200
1244
  const renderOverlay = () => {
1201
1245
  if (props.overlay) {
1202
- return vue.createVNode(Overlay, {
1246
+ return vue.createVNode(Overlay, vue.mergeProps({
1203
1247
  "show": props.show,
1204
1248
  "class": props.overlayClass,
1205
1249
  "zIndex": zIndex.value,
1206
1250
  "duration": props.duration,
1207
- "customStyle": props.overlayStyle,
1251
+ "customStyle": props.overlayStyle
1252
+ }, useScopeId(), {
1208
1253
  "onClick": onClickOverlay
1209
- }, {
1254
+ }), {
1210
1255
  default: slots["overlay-content"]
1211
1256
  });
1212
1257
  }
@@ -1249,7 +1294,7 @@
1249
1294
  "zt-safe-area-bottom": safeAreaInsetBottom
1250
1295
  }],
1251
1296
  "onKeydown": onKeydown
1252
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props.show]]);
1297
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props.show]]);
1253
1298
  });
1254
1299
  const sliderRenderPopup = lazyRender(() => {
1255
1300
  var _a, _b;
@@ -2095,6 +2140,7 @@
2095
2140
  duration: makeNumberProp(2e3),
2096
2141
  position: makeStringProp("middle"),
2097
2142
  teleport: [String, Object],
2143
+ wordBreak: String,
2098
2144
  className: unknownProp,
2099
2145
  iconPrefix: String,
2100
2146
  transition: makeStringProp("zt-fade"),
@@ -2180,7 +2226,7 @@
2180
2226
  vue.onMounted(toggleClickable);
2181
2227
  vue.onUnmounted(toggleClickable);
2182
2228
  return () => vue.createVNode(Popup, vue.mergeProps({
2183
- "class": [bem$16([props.position, {
2229
+ "class": [bem$16([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
2184
2230
  [props.type]: !props.icon
2185
2231
  }]), props.className],
2186
2232
  "lockScroll": false,
@@ -3680,7 +3726,7 @@
3680
3726
  const trackStyle = vue.computed(() => {
3681
3727
  const style = {
3682
3728
  transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
3683
- transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
3729
+ transform: `translate${props.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
3684
3730
  };
3685
3731
  if (size.value) {
3686
3732
  const mainAxis = props.vertical ? "height" : "width";
@@ -5075,7 +5121,7 @@
5075
5121
  }), {
5076
5122
  [BORDER_TOP_BOTTOM]: props.border && !props.inset
5077
5123
  }]
5078
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
5124
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
5079
5125
  };
5080
5126
  const renderTitle = () => vue.createVNode("div", {
5081
5127
  "class": bem$X("title", {
@@ -5169,7 +5215,11 @@
5169
5215
  role: String,
5170
5216
  parent: Object,
5171
5217
  checked: Boolean,
5172
- bindGroup: truthProp
5218
+ bindGroup: truthProp,
5219
+ indeterminate: {
5220
+ type: Boolean,
5221
+ default: null
5222
+ }
5173
5223
  }),
5174
5224
  emits: ["click", "toggle"],
5175
5225
  setup(props, {
@@ -5208,14 +5258,16 @@
5208
5258
  const {
5209
5259
  bem: bem2,
5210
5260
  shape,
5211
- checked
5261
+ checked,
5262
+ indeterminate
5212
5263
  } = props;
5213
5264
  const iconSize = props.iconSize || getParentProp("iconSize");
5214
5265
  return vue.createVNode("div", {
5215
5266
  "ref": iconRef,
5216
5267
  "class": bem2("icon", [shape, {
5217
5268
  disabled: disabled.value,
5218
- checked
5269
+ checked,
5270
+ indeterminate
5219
5271
  }]),
5220
5272
  "style": {
5221
5273
  fontSize: addUnit(iconSize)
@@ -5223,14 +5275,8 @@
5223
5275
  }, [slots.icon ? slots.icon({
5224
5276
  checked,
5225
5277
  disabled: disabled.value
5226
- }) : props.role === "radio" ? vue.createVNode(Icon, {
5227
- "style": iconStyle.value
5228
- }, {
5229
- default: () => [checked ? vue.createVNode("div", {
5230
- "class": bem2("dot")
5231
- }, null) : ""]
5232
5278
  }) : vue.createVNode(Icon, {
5233
- "name": "checkbox-select",
5279
+ "name": indeterminate ? "minus" : "checkbox-select",
5234
5280
  "style": iconStyle.value
5235
5281
  }, null)]);
5236
5282
  };
@@ -5260,7 +5306,11 @@
5260
5306
  });
5261
5307
  const [name$W, bem$V] = createNamespace("checkbox");
5262
5308
  const checkboxProps = extend({}, checkerProps, {
5263
- bindGroup: truthProp
5309
+ bindGroup: truthProp,
5310
+ indeterminate: {
5311
+ type: Boolean,
5312
+ default: null
5313
+ }
5264
5314
  });
5265
5315
  var stdin_default$1h = vue.defineComponent({
5266
5316
  name: name$W,
@@ -5311,9 +5361,16 @@
5311
5361
  setParentValue(newValue);
5312
5362
  } else {
5313
5363
  emit("update:modelValue", newValue);
5364
+ if (props.indeterminate !== null) {
5365
+ emit("change", newValue);
5366
+ }
5314
5367
  }
5315
5368
  };
5316
- vue.watch(() => props.modelValue, (value) => emit("change", value));
5369
+ vue.watch(() => props.modelValue, (value) => {
5370
+ if (props.indeterminate === null) {
5371
+ emit("change", value);
5372
+ }
5373
+ });
5317
5374
  useExpose({
5318
5375
  toggle,
5319
5376
  props,
@@ -7407,7 +7464,7 @@
7407
7464
  }
7408
7465
  function showDialog(options) {
7409
7466
  if (!inBrowser$1) {
7410
- return Promise.resolve();
7467
+ return Promise.resolve(void 0);
7411
7468
  }
7412
7469
  return new Promise((resolve, reject) => {
7413
7470
  if (!instance$2) {
@@ -7720,7 +7777,7 @@
7720
7777
  if (props.multiSelect) {
7721
7778
  return vue.createVNode(Cell, {
7722
7779
  "role": "menuitem",
7723
- "key": option.value,
7780
+ "key": String(option.value),
7724
7781
  "title-icon": option.icon,
7725
7782
  "title": option.text,
7726
7783
  "direction": "horizontal",
@@ -7739,7 +7796,7 @@
7739
7796
  }
7740
7797
  return vue.createVNode(Cell, {
7741
7798
  "role": "menuitem",
7742
- "key": option.value,
7799
+ "key": String(option.value),
7743
7800
  "title-icon": option.icon,
7744
7801
  "title": option.text,
7745
7802
  "direction": "horizontal",
@@ -10080,7 +10137,9 @@
10080
10137
  minZoom: makeRequiredProp(numericProp),
10081
10138
  maxZoom: makeRequiredProp(numericProp),
10082
10139
  rootWidth: makeRequiredProp(Number),
10083
- rootHeight: makeRequiredProp(Number)
10140
+ rootHeight: makeRequiredProp(Number),
10141
+ disableZoom: Boolean,
10142
+ closeOnClickOverlay: Boolean
10084
10143
  },
10085
10144
  emits: ["scale", "close", "longPress"],
10086
10145
  setup(props, {
@@ -10218,7 +10277,8 @@
10218
10277
  setScale(scale);
10219
10278
  }
10220
10279
  };
10221
- const checkTap = () => {
10280
+ const checkTap = (event) => {
10281
+ var _a;
10222
10282
  if (fingerNum > 1) {
10223
10283
  return;
10224
10284
  }
@@ -10236,6 +10296,9 @@
10236
10296
  doubleTapTimer = null;
10237
10297
  toggleScale();
10238
10298
  } else {
10299
+ if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
10300
+ return;
10301
+ }
10239
10302
  doubleTapTimer = setTimeout(() => {
10240
10303
  emit("close");
10241
10304
  doubleTapTimer = null;
@@ -10273,7 +10336,7 @@
10273
10336
  }
10274
10337
  }
10275
10338
  preventDefault(event, stopPropagation2);
10276
- checkTap();
10339
+ checkTap(event);
10277
10340
  touch.reset();
10278
10341
  };
10279
10342
  const onLoad = (event) => {
@@ -10327,7 +10390,7 @@
10327
10390
  }
10328
10391
  });
10329
10392
  const [name$A, bem$z] = createNamespace("image-preview");
10330
- const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate"];
10393
+ const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
10331
10394
  const imagePreviewProps = {
10332
10395
  show: Boolean,
10333
10396
  loop: truthProp,
@@ -10347,7 +10410,9 @@
10347
10410
  startPosition: makeNumericProp(0),
10348
10411
  showIndicators: Boolean,
10349
10412
  closeOnPopstate: truthProp,
10350
- closeIconPosition: makeStringProp("top-right")
10413
+ closeOnClickOverlay: truthProp,
10414
+ closeIconPosition: makeStringProp("top-right"),
10415
+ teleport: [String, Object]
10351
10416
  };
10352
10417
  var stdin_default$R = vue.defineComponent({
10353
10418
  name: name$A,
@@ -10361,7 +10426,8 @@
10361
10426
  const state = vue.reactive({
10362
10427
  active: 0,
10363
10428
  rootWidth: 0,
10364
- rootHeight: 0
10429
+ rootHeight: 0,
10430
+ disableZoom: false
10365
10431
  });
10366
10432
  const resize2 = () => {
10367
10433
  if (swipeRef.value) {
@@ -10417,6 +10483,12 @@
10417
10483
  }, [slots.cover()]);
10418
10484
  }
10419
10485
  };
10486
+ const onDragStart = () => {
10487
+ state.disableZoom = true;
10488
+ };
10489
+ const onDragEnd = () => {
10490
+ state.disableZoom = false;
10491
+ };
10420
10492
  const renderImages = () => vue.createVNode(Swipe, {
10421
10493
  "ref": swipeRef,
10422
10494
  "lazyRender": true,
@@ -10426,7 +10498,9 @@
10426
10498
  "initialSwipe": props.startPosition,
10427
10499
  "showIndicators": props.showIndicators,
10428
10500
  "indicatorColor": "white",
10429
- "onChange": setActive
10501
+ "onChange": setActive,
10502
+ "onDragEnd": onDragEnd,
10503
+ "onDragStart": onDragStart
10430
10504
  }, {
10431
10505
  default: () => [props.images.map((image, index) => vue.createVNode(stdin_default$S, {
10432
10506
  "src": image.url,
@@ -10436,6 +10510,8 @@
10436
10510
  "minZoom": props.minZoom,
10437
10511
  "rootWidth": state.rootWidth,
10438
10512
  "rootHeight": state.rootHeight,
10513
+ "disableZoom": state.disableZoom,
10514
+ "closeOnClickOverlay": props.closeOnClickOverlay,
10439
10515
  "onScale": emitScale,
10440
10516
  "onClose": emitClose,
10441
10517
  "onLongPress": () => emit("longPress", {
@@ -10518,6 +10594,7 @@
10518
10594
  swipeDuration: 300,
10519
10595
  showIndicators: false,
10520
10596
  closeOnPopstate: true,
10597
+ closeOnClickOverlay: true,
10521
10598
  closeIconPosition: "top-right"
10522
10599
  };
10523
10600
  function initInstance$1() {
@@ -10912,6 +10989,7 @@
10912
10989
  offset: makeNumericProp(300),
10913
10990
  loading: Boolean,
10914
10991
  finished: Boolean,
10992
+ scroller: Object,
10915
10993
  errorText: String,
10916
10994
  direction: makeStringProp("down"),
10917
10995
  loadingText: String,
@@ -10931,6 +11009,7 @@
10931
11009
  const placeholder = vue.ref();
10932
11010
  const tabStatus = useTabStatus();
10933
11011
  const scrollParent = useScrollParent(root);
11012
+ const scroller = vue.computed(() => props.scroller || scrollParent.value);
10934
11013
  const check = () => {
10935
11014
  vue.nextTick(() => {
10936
11015
  if (loading.value || props.finished || props.error || // skip check when inside an inactive tab
@@ -10941,7 +11020,7 @@
10941
11020
  direction
10942
11021
  } = props;
10943
11022
  const offset2 = +props.offset;
10944
- const scrollParentRect = useRect(scrollParent);
11023
+ const scrollParentRect = useRect(scroller);
10945
11024
  if (!scrollParentRect.height || isHidden(root)) {
10946
11025
  return;
10947
11026
  }
@@ -11022,7 +11101,7 @@
11022
11101
  check
11023
11102
  });
11024
11103
  useEventListener("scroll", check, {
11025
- target: scrollParent,
11104
+ target: scroller,
11026
11105
  passive: true
11027
11106
  });
11028
11107
  return () => {
@@ -15654,6 +15733,20 @@
15654
15733
  requires: ["popperOffsets"],
15655
15734
  fn: offset
15656
15735
  };
15736
+ const useSyncPropRef = (getProp, setProp) => {
15737
+ const propRef = vue.ref(getProp());
15738
+ vue.watch(getProp, (value) => {
15739
+ if (value !== propRef.value) {
15740
+ propRef.value = value;
15741
+ }
15742
+ });
15743
+ vue.watch(propRef, (value) => {
15744
+ if (value !== getProp()) {
15745
+ setProp(value);
15746
+ }
15747
+ });
15748
+ return propRef;
15749
+ };
15657
15750
  var __async = (__this, __arguments, generator) => {
15658
15751
  return new Promise((resolve, reject) => {
15659
15752
  var fulfilled = (value) => {
@@ -15675,7 +15768,7 @@
15675
15768
  });
15676
15769
  };
15677
15770
  const [name$m, bem$l] = createNamespace("popover");
15678
- const popupProps = ["show", "overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
15771
+ const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
15679
15772
  const popoverProps = {
15680
15773
  show: Boolean,
15681
15774
  theme: makeStringProp("light"),
@@ -15718,6 +15811,7 @@
15718
15811
  const wrapperRef = vue.ref();
15719
15812
  const popoverRef = vue.ref();
15720
15813
  const arrowRef = vue.ref();
15814
+ const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
15721
15815
  const getPopoverOptions = () => ({
15722
15816
  placement: props.placement,
15723
15817
  modifiers: [{
@@ -15740,7 +15834,7 @@
15740
15834
  };
15741
15835
  const updateLocation = () => {
15742
15836
  vue.nextTick(() => {
15743
- if (!props.show) {
15837
+ if (!show.value) {
15744
15838
  return;
15745
15839
  }
15746
15840
  if (!popper) {
@@ -15754,10 +15848,12 @@
15754
15848
  }
15755
15849
  });
15756
15850
  };
15757
- const updateShow = (value) => emit("update:show", value);
15851
+ const updateShow = (value) => {
15852
+ show.value = value;
15853
+ };
15758
15854
  const onClickWrapper = () => {
15759
15855
  if (props.trigger === "click") {
15760
- updateShow(!props.show);
15856
+ show.value = !show.value;
15761
15857
  }
15762
15858
  };
15763
15859
  const onClickAction = (action, index) => {
@@ -15770,12 +15866,12 @@
15770
15866
  action.selected = true;
15771
15867
  emit("select", action, index);
15772
15868
  if (props.closeOnClickAction) {
15773
- updateShow(false);
15869
+ show.value = false;
15774
15870
  }
15775
15871
  };
15776
15872
  const onClickAway = () => {
15777
- if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
15778
- updateShow(false);
15873
+ if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
15874
+ show.value = false;
15779
15875
  }
15780
15876
  };
15781
15877
  const renderActionContent = (action, index) => {
@@ -15892,7 +15988,7 @@
15892
15988
  popper = null;
15893
15989
  }
15894
15990
  });
15895
- vue.watch(() => [props.show, props.offset, props.placement], updateLocation);
15991
+ vue.watch(() => [show.value, props.offset, props.placement], updateLocation);
15896
15992
  useClickAway(wrapperRef, onClickAway, {
15897
15993
  eventName: "touchstart"
15898
15994
  });
@@ -15904,14 +16000,13 @@
15904
16000
  "onClick": onClickWrapper
15905
16001
  }, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), vue.createVNode(Popup, vue.mergeProps({
15906
16002
  "ref": popoverRef,
15907
- "class": bem$l([props.theme, props.show ? "show" : "hidden"]),
16003
+ "show": show.value,
16004
+ "class": bem$l([props.theme, show.value ? "show" : "hidden"]),
15908
16005
  "position": "",
15909
16006
  "transition": "zt-popover-zoom",
15910
16007
  "lockScroll": false,
15911
16008
  "onUpdate:show": updateShow
15912
- }, attrs, pick(props, popupProps), {
15913
- "show": true
15914
- }), {
16009
+ }, attrs, useScopeId(), pick(props, popupProps)), {
15915
16010
  default: () => [props.showArrow && vue.createVNode("div", {
15916
16011
  "class": bem$l("arrow"),
15917
16012
  "ref": arrowRef
@@ -18024,6 +18119,7 @@
18024
18119
  let opened;
18025
18120
  let lockClick2;
18026
18121
  let startOffset;
18122
+ let isInBeforeClosing;
18027
18123
  const root = vue.ref();
18028
18124
  const leftRef = vue.ref();
18029
18125
  const rightRef = vue.ref();
@@ -18100,14 +18196,22 @@
18100
18196
  }
18101
18197
  };
18102
18198
  const onClick = (position = "outside") => {
18199
+ if (isInBeforeClosing)
18200
+ return;
18103
18201
  emit("click", position);
18104
18202
  if (opened && !lockClick2) {
18203
+ isInBeforeClosing = true;
18105
18204
  callInterceptor(props.beforeClose, {
18106
18205
  args: [{
18107
18206
  name: props.name,
18108
18207
  position
18109
18208
  }],
18110
- done: () => close(position)
18209
+ done: () => {
18210
+ isInBeforeClosing = false;
18211
+ close(position);
18212
+ },
18213
+ canceled: () => isInBeforeClosing = false,
18214
+ error: () => isInBeforeClosing = false
18111
18215
  });
18112
18216
  }
18113
18217
  };
@@ -18776,10 +18880,11 @@
18776
18880
  const [name$2, bem$2] = createNamespace("text-ellipsis");
18777
18881
  const textEllipsisProps = {
18778
18882
  rows: makeNumericProp(1),
18883
+ dots: makeStringProp("..."),
18779
18884
  content: makeStringProp(""),
18780
18885
  expandText: makeStringProp(""),
18781
18886
  collapseText: makeStringProp(""),
18782
- highlight: makeStringProp("")
18887
+ position: makeStringProp("end")
18783
18888
  };
18784
18889
  var stdin_default$7 = vue.defineComponent({
18785
18890
  name: name$2,
@@ -18792,6 +18897,7 @@
18792
18897
  const expanded = vue.ref(false);
18793
18898
  const hasAction = vue.ref(false);
18794
18899
  const root = vue.ref();
18900
+ const actionText = vue.computed(() => expanded.value ? props.collapseText : props.expandText);
18795
18901
  const pxToNum = (value) => {
18796
18902
  if (!value)
18797
18903
  return 0;
@@ -18821,23 +18927,52 @@
18821
18927
  const calcEllipsisText = (container2, maxHeight2) => {
18822
18928
  const {
18823
18929
  content,
18824
- expandText
18930
+ position,
18931
+ dots
18825
18932
  } = props;
18826
- const dot = "...";
18827
- let left2 = 0;
18828
- let right2 = content.length;
18829
- let res = -1;
18830
- while (left2 <= right2) {
18831
- const mid = Math.floor((left2 + right2) / 2);
18832
- container2.innerText = content.slice(0, mid) + dot + expandText;
18833
- if (container2.offsetHeight <= maxHeight2) {
18834
- left2 = mid + 1;
18835
- res = mid;
18836
- } else {
18837
- right2 = mid - 1;
18933
+ const end2 = content.length;
18934
+ const calcEllipse = () => {
18935
+ const tail = (left2, right2) => {
18936
+ if (right2 - left2 <= 1) {
18937
+ if (position === "end") {
18938
+ return content.slice(0, left2) + dots;
18939
+ }
18940
+ return dots + content.slice(right2, end2);
18941
+ }
18942
+ const middle2 = Math.round((left2 + right2) / 2);
18943
+ if (position === "end") {
18944
+ container2.innerText = content.slice(0, middle2) + dots + actionText.value;
18945
+ } else {
18946
+ container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
18947
+ }
18948
+ if (container2.offsetHeight > maxHeight2) {
18949
+ if (position === "end") {
18950
+ return tail(left2, middle2);
18951
+ }
18952
+ return tail(middle2, right2);
18953
+ }
18954
+ if (position === "end") {
18955
+ return tail(middle2, right2);
18956
+ }
18957
+ return tail(left2, middle2);
18958
+ };
18959
+ container2.innerText = tail(0, end2);
18960
+ };
18961
+ const middleTail = (leftPart, rightPart) => {
18962
+ if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
18963
+ return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
18838
18964
  }
18839
- }
18840
- return content.slice(0, res) + dot;
18965
+ const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
18966
+ const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
18967
+ container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end2) + props.expandText;
18968
+ if (container2.offsetHeight >= maxHeight2) {
18969
+ return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
18970
+ }
18971
+ return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
18972
+ };
18973
+ const middle = 0 + end2 >> 1;
18974
+ props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end2]) : calcEllipse();
18975
+ return container2.innerText;
18841
18976
  };
18842
18977
  const container = cloneContainer();
18843
18978
  if (!container)
@@ -18847,7 +18982,7 @@
18847
18982
  paddingTop,
18848
18983
  lineHeight
18849
18984
  } = container.style;
18850
- const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
18985
+ const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
18851
18986
  if (maxHeight < container.offsetHeight) {
18852
18987
  hasAction.value = true;
18853
18988
  text.value = calcEllipsisText(container, maxHeight);
@@ -18861,26 +18996,17 @@
18861
18996
  expanded.value = !expanded.value;
18862
18997
  emit("clickAction", event);
18863
18998
  };
18864
- const formatSearchKeyword = (keywords, text2) => {
18865
- if (!keywords)
18866
- return text2;
18867
- const replaceReg = new RegExp(keywords, "ig");
18868
- const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1);">${keywords}</span>`;
18869
- return text2.replace(replaceReg, replaceString);
18870
- };
18871
18999
  const renderAction = () => vue.createVNode("span", {
18872
19000
  "class": bem$2("action"),
18873
19001
  "onClick": onClickAction
18874
- }, [expanded.value ? props.collapseText : props.expandText]);
19002
+ }, [actionText.value]);
18875
19003
  vue.onMounted(calcEllipsised);
18876
- vue.watch(() => [props.content, props.rows], calcEllipsised);
19004
+ vue.watch(() => [props.content, props.rows, props.position], calcEllipsised);
18877
19005
  useEventListener("resize", calcEllipsised);
18878
19006
  return () => vue.createVNode("div", {
18879
19007
  "ref": root,
18880
19008
  "class": bem$2()
18881
- }, [vue.createVNode("span", {
18882
- "innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
18883
- }, null), hasAction.value ? renderAction() : null]);
19009
+ }, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
18884
19010
  }
18885
19011
  });
18886
19012
  const TextEllipsis = withInstall(stdin_default$7);
@@ -20463,7 +20589,7 @@
20463
20589
  });
20464
20590
  }
20465
20591
  };
20466
- const version = "3.1.7";
20592
+ const version = "3.1.8";
20467
20593
  function install(app) {
20468
20594
  const components = [
20469
20595
  ActionSheet,