zartui 3.1.7 → 3.1.9

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 (300) hide show
  1. package/README.md +23 -0
  2. package/es/action-sheet/ActionSheet.d.ts +2 -2
  3. package/es/action-sheet/index.css +1 -1
  4. package/es/action-sheet/index.d.ts +2 -2
  5. package/es/avatar/index.css +1 -1
  6. package/es/badge/index.css +1 -1
  7. package/es/button/Button.d.ts +3 -3
  8. package/es/button/index.css +1 -1
  9. package/es/button/index.d.ts +3 -3
  10. package/es/calendar/Calendar.d.ts +2 -2
  11. package/es/calendar/index.css +1 -1
  12. package/es/calendar/index.d.ts +2 -2
  13. package/es/cascader/Cascader.d.ts +1 -1
  14. package/es/cascader/index.d.ts +1 -1
  15. package/es/cell/Cell.d.ts +2 -2
  16. package/es/cell/index.css +1 -1
  17. package/es/cell/index.d.ts +2 -2
  18. package/es/cell-group/CellGroup.d.ts +1 -1
  19. package/es/cell-group/CellGroup.mjs +2 -1
  20. package/es/cell-group/index.d.ts +1 -1
  21. package/es/checkbox/Checkbox.d.ts +26 -12
  22. package/es/checkbox/Checkbox.mjs +13 -2
  23. package/es/checkbox/Checker.d.ts +9 -0
  24. package/es/checkbox/Checker.mjs +10 -10
  25. package/es/checkbox/index.css +1 -1
  26. package/es/checkbox/index.d.ts +9 -0
  27. package/es/collapse-item/index.css +1 -1
  28. package/es/composables/use-global-z-index.d.ts +4 -0
  29. package/es/composables/use-global-z-index.mjs +9 -0
  30. package/es/composables/use-scope-id.d.ts +3 -0
  31. package/es/composables/use-scope-id.mjs +9 -0
  32. package/es/composables/use-sync-prop-ref.d.ts +2 -0
  33. package/es/composables/use-sync-prop-ref.mjs +18 -0
  34. package/es/config-provider/ConfigProvider.d.ts +30 -6
  35. package/es/config-provider/ConfigProvider.mjs +48 -9
  36. package/es/config-provider/index.d.ts +17 -2
  37. package/es/date-time-picker/DateTimePicker.d.ts +2 -2
  38. package/es/date-time-picker/DateTimePickerWrapper.d.ts +2 -2
  39. package/es/date-time-picker/index.d.ts +2 -2
  40. package/es/dialog/Dialog.d.ts +1 -1
  41. package/es/dialog/function-call.d.ts +3 -3
  42. package/es/dialog/function-call.mjs +1 -1
  43. package/es/dialog/index.css +1 -1
  44. package/es/dialog/index.d.ts +1 -1
  45. package/es/divider/Divider.d.ts +1 -1
  46. package/es/divider/index.d.ts +1 -1
  47. package/es/dropdown-item/DropdownItem.mjs +2 -2
  48. package/es/dropdown-item/types.d.ts +2 -1
  49. package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
  50. package/es/dropdown-menu/index.d.ts +1 -1
  51. package/es/empty/index.css +1 -1
  52. package/es/field/Field.d.ts +3 -3
  53. package/es/field/Field.mjs +2 -0
  54. package/es/field/index.css +1 -1
  55. package/es/field/index.d.ts +3 -3
  56. package/es/grid/Grid.d.ts +1 -1
  57. package/es/grid/index.d.ts +1 -1
  58. package/es/hierarchy-select/HierarchySelect.d.ts +16 -1
  59. package/es/hierarchy-select/HierarchySelect.mjs +8 -5
  60. package/es/hierarchy-select/index.css +1 -1
  61. package/es/hierarchy-select/index.d.ts +11 -1
  62. package/es/icon/config.mjs +34 -11
  63. package/es/icon/index.css +1 -1
  64. package/es/image/Image.d.ts +1 -1
  65. package/es/image/index.css +1 -1
  66. package/es/image/index.d.ts +1 -1
  67. package/es/image-preview/ImagePreview.d.ts +17 -1
  68. package/es/image-preview/ImagePreview.mjs +17 -4
  69. package/es/image-preview/ImagePreviewItem.d.ts +6 -0
  70. package/es/image-preview/ImagePreviewItem.mjs +9 -3
  71. package/es/image-preview/function-call.mjs +1 -0
  72. package/es/image-preview/index.d.ts +12 -1
  73. package/es/image-preview/types.d.ts +1 -0
  74. package/es/index-bar/IndexBar.d.ts +16 -1
  75. package/es/index-bar/IndexBar.mjs +6 -3
  76. package/es/index-bar/index.d.ts +12 -1
  77. package/es/index.d.ts +1 -1
  78. package/es/index.mjs +1 -1
  79. package/es/lazyload/vue-lazyload/index.d.ts +55 -55
  80. package/es/list/List.d.ts +7 -3
  81. package/es/list/List.mjs +5 -3
  82. package/es/list/index.css +1 -1
  83. package/es/list/index.d.ts +2 -0
  84. package/es/loading/index.css +1 -1
  85. package/es/media-picker/index.css +1 -1
  86. package/es/multiple-picker/index.css +1 -1
  87. package/es/nav-bar/NavBar.d.ts +1 -1
  88. package/es/nav-bar/index.d.ts +1 -1
  89. package/es/notify/Notify.d.ts +1 -1
  90. package/es/notify/index.d.ts +1 -1
  91. package/es/number-keyboard/NumberKeyboard.d.ts +3 -3
  92. package/es/number-keyboard/NumberKeyboard.mjs +5 -20
  93. package/es/number-keyboard/NumberKeyboardKey.d.ts +1 -1
  94. package/es/number-keyboard/index.css +1 -1
  95. package/es/number-keyboard/index.d.ts +3 -3
  96. package/es/number-keyboard/style/index.mjs +0 -1
  97. package/es/picker/index.css +1 -1
  98. package/es/popover/Popover.d.ts +1 -1
  99. package/es/popover/Popover.mjs +16 -12
  100. package/es/popover/index.d.ts +1 -1
  101. package/es/popup/Popup.d.ts +2 -2
  102. package/es/popup/Popup.mjs +9 -10
  103. package/es/popup/index.css +1 -1
  104. package/es/popup/index.d.ts +2 -2
  105. package/es/radio/index.css +1 -1
  106. package/es/radio-picker/index.css +1 -1
  107. package/es/search/Search.d.ts +1 -1
  108. package/es/search/index.css +1 -1
  109. package/es/search/index.d.ts +1 -1
  110. package/es/skeleton/Skeleton.d.ts +2 -2
  111. package/es/skeleton/index.d.ts +2 -2
  112. package/es/step/index.css +1 -1
  113. package/es/stepper/Stepper.d.ts +2 -2
  114. package/es/stepper/index.d.ts +2 -2
  115. package/es/steps/Steps.d.ts +1 -1
  116. package/es/steps/index.d.ts +1 -1
  117. package/es/sticky/Sticky.d.ts +1 -1
  118. package/es/sticky/index.d.ts +1 -1
  119. package/es/style/base.css +1 -1
  120. package/es/style/css-variables.css +1 -1
  121. package/es/swipe/Swipe.mjs +1 -1
  122. package/es/swipe/index.css +1 -1
  123. package/es/swipe-cell/SwipeCell.mjs +10 -1
  124. package/es/tabbar-item/index.css +1 -1
  125. package/es/table/index.css +1 -1
  126. package/es/tabs/Tabs.d.ts +4 -4
  127. package/es/tabs/index.d.ts +4 -4
  128. package/es/tag/Tag.d.ts +1 -1
  129. package/es/tag/index.d.ts +1 -1
  130. package/es/text-ellipsis/TextEllipsis.d.ts +17 -4
  131. package/es/text-ellipsis/TextEllipsis.mjs +52 -30
  132. package/es/text-ellipsis/index.css +1 -1
  133. package/es/text-ellipsis/index.d.ts +12 -3
  134. package/es/time-picker/index.css +1 -1
  135. package/es/timeline/index.css +1 -1
  136. package/es/toast/Toast.d.ts +5 -2
  137. package/es/toast/Toast.mjs +2 -1
  138. package/es/toast/index.css +1 -1
  139. package/es/toast/index.d.ts +4 -2
  140. package/es/toast/types.d.ts +2 -0
  141. package/es/uploader/Uploader.d.ts +1 -1
  142. package/es/uploader/index.css +1 -1
  143. package/es/uploader/index.d.ts +1 -1
  144. package/es/utils/interceptor.d.ts +2 -1
  145. package/es/utils/interceptor.mjs +3 -2
  146. package/es/vue-sfc-shim.d.ts +6 -6
  147. package/es/vue-tsx-shim.d.ts +23 -23
  148. package/lib/action-sheet/ActionSheet.d.ts +2 -2
  149. package/lib/action-sheet/index.css +1 -1
  150. package/lib/action-sheet/index.d.ts +2 -2
  151. package/lib/avatar/index.css +1 -1
  152. package/lib/badge/index.css +1 -1
  153. package/lib/button/Button.d.ts +3 -3
  154. package/lib/button/index.css +1 -1
  155. package/lib/button/index.d.ts +3 -3
  156. package/lib/calendar/Calendar.d.ts +2 -2
  157. package/lib/calendar/index.css +1 -1
  158. package/lib/calendar/index.d.ts +2 -2
  159. package/lib/cascader/Cascader.d.ts +1 -1
  160. package/lib/cascader/index.d.ts +1 -1
  161. package/lib/cell/Cell.d.ts +2 -2
  162. package/lib/cell/index.css +1 -1
  163. package/lib/cell/index.d.ts +2 -2
  164. package/lib/cell-group/CellGroup.d.ts +1 -1
  165. package/lib/cell-group/CellGroup.js +2 -1
  166. package/lib/cell-group/index.d.ts +1 -1
  167. package/lib/checkbox/Checkbox.d.ts +26 -12
  168. package/lib/checkbox/Checkbox.js +13 -2
  169. package/lib/checkbox/Checker.d.ts +9 -0
  170. package/lib/checkbox/Checker.js +10 -10
  171. package/lib/checkbox/index.css +1 -1
  172. package/lib/checkbox/index.d.ts +9 -0
  173. package/lib/collapse-item/index.css +1 -1
  174. package/lib/composables/use-global-z-index.d.ts +4 -0
  175. package/lib/composables/use-global-z-index.js +28 -0
  176. package/lib/composables/use-scope-id.d.ts +3 -0
  177. package/lib/composables/use-scope-id.js +28 -0
  178. package/lib/composables/use-sync-prop-ref.d.ts +2 -0
  179. package/lib/composables/use-sync-prop-ref.js +37 -0
  180. package/lib/config-provider/ConfigProvider.d.ts +30 -6
  181. package/lib/config-provider/ConfigProvider.js +46 -7
  182. package/lib/config-provider/index.d.ts +17 -2
  183. package/lib/date-time-picker/DateTimePicker.d.ts +2 -2
  184. package/lib/date-time-picker/DateTimePickerWrapper.d.ts +2 -2
  185. package/lib/date-time-picker/index.d.ts +2 -2
  186. package/lib/dialog/Dialog.d.ts +1 -1
  187. package/lib/dialog/function-call.d.ts +3 -3
  188. package/lib/dialog/function-call.js +1 -1
  189. package/lib/dialog/index.css +1 -1
  190. package/lib/dialog/index.d.ts +1 -1
  191. package/lib/divider/Divider.d.ts +1 -1
  192. package/lib/divider/index.d.ts +1 -1
  193. package/lib/dropdown-item/DropdownItem.js +2 -2
  194. package/lib/dropdown-item/types.d.ts +2 -1
  195. package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
  196. package/lib/dropdown-menu/index.d.ts +1 -1
  197. package/lib/empty/index.css +1 -1
  198. package/lib/field/Field.d.ts +3 -3
  199. package/lib/field/Field.js +2 -0
  200. package/lib/field/index.css +1 -1
  201. package/lib/field/index.d.ts +3 -3
  202. package/lib/grid/Grid.d.ts +1 -1
  203. package/lib/grid/index.d.ts +1 -1
  204. package/lib/hierarchy-select/HierarchySelect.d.ts +16 -1
  205. package/lib/hierarchy-select/HierarchySelect.js +7 -4
  206. package/lib/hierarchy-select/index.css +1 -1
  207. package/lib/hierarchy-select/index.d.ts +11 -1
  208. package/lib/icon/config.js +34 -11
  209. package/lib/icon/index.css +1 -1
  210. package/lib/image/Image.d.ts +1 -1
  211. package/lib/image/index.css +1 -1
  212. package/lib/image/index.d.ts +1 -1
  213. package/lib/image-preview/ImagePreview.d.ts +17 -1
  214. package/lib/image-preview/ImagePreview.js +17 -4
  215. package/lib/image-preview/ImagePreviewItem.d.ts +6 -0
  216. package/lib/image-preview/ImagePreviewItem.js +9 -3
  217. package/lib/image-preview/function-call.js +1 -0
  218. package/lib/image-preview/index.d.ts +12 -1
  219. package/lib/image-preview/types.d.ts +1 -0
  220. package/lib/index-bar/IndexBar.d.ts +16 -1
  221. package/lib/index-bar/IndexBar.js +5 -2
  222. package/lib/index-bar/index.d.ts +12 -1
  223. package/lib/index.css +1 -1
  224. package/lib/index.d.ts +1 -1
  225. package/lib/index.js +1 -1
  226. package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
  227. package/lib/list/List.d.ts +7 -3
  228. package/lib/list/List.js +4 -2
  229. package/lib/list/index.css +1 -1
  230. package/lib/list/index.d.ts +2 -0
  231. package/lib/loading/index.css +1 -1
  232. package/lib/media-picker/index.css +1 -1
  233. package/lib/multiple-picker/index.css +1 -1
  234. package/lib/nav-bar/NavBar.d.ts +1 -1
  235. package/lib/nav-bar/index.d.ts +1 -1
  236. package/lib/notify/Notify.d.ts +1 -1
  237. package/lib/notify/index.d.ts +1 -1
  238. package/lib/number-keyboard/NumberKeyboard.d.ts +3 -3
  239. package/lib/number-keyboard/NumberKeyboard.js +4 -19
  240. package/lib/number-keyboard/NumberKeyboardKey.d.ts +1 -1
  241. package/lib/number-keyboard/index.css +1 -1
  242. package/lib/number-keyboard/index.d.ts +3 -3
  243. package/lib/number-keyboard/style/index.js +0 -1
  244. package/lib/picker/index.css +1 -1
  245. package/lib/popover/Popover.d.ts +1 -1
  246. package/lib/popover/Popover.js +16 -12
  247. package/lib/popover/index.d.ts +1 -1
  248. package/lib/popup/Popup.d.ts +2 -2
  249. package/lib/popup/Popup.js +8 -9
  250. package/lib/popup/index.css +1 -1
  251. package/lib/popup/index.d.ts +2 -2
  252. package/lib/radio/index.css +1 -1
  253. package/lib/radio-picker/index.css +1 -1
  254. package/lib/search/Search.d.ts +1 -1
  255. package/lib/search/index.css +1 -1
  256. package/lib/search/index.d.ts +1 -1
  257. package/lib/skeleton/Skeleton.d.ts +2 -2
  258. package/lib/skeleton/index.d.ts +2 -2
  259. package/lib/step/index.css +1 -1
  260. package/lib/stepper/Stepper.d.ts +2 -2
  261. package/lib/stepper/index.d.ts +2 -2
  262. package/lib/steps/Steps.d.ts +1 -1
  263. package/lib/steps/index.d.ts +1 -1
  264. package/lib/sticky/Sticky.d.ts +1 -1
  265. package/lib/sticky/index.d.ts +1 -1
  266. package/lib/style/base.css +1 -1
  267. package/lib/style/css-variables.css +1 -1
  268. package/lib/swipe/Swipe.js +1 -1
  269. package/lib/swipe/index.css +1 -1
  270. package/lib/swipe-cell/SwipeCell.js +10 -1
  271. package/lib/tabbar-item/index.css +1 -1
  272. package/lib/table/index.css +1 -1
  273. package/lib/tabs/Tabs.d.ts +4 -4
  274. package/lib/tabs/index.d.ts +4 -4
  275. package/lib/tag/Tag.d.ts +1 -1
  276. package/lib/tag/index.d.ts +1 -1
  277. package/lib/text-ellipsis/TextEllipsis.d.ts +17 -4
  278. package/lib/text-ellipsis/TextEllipsis.js +51 -29
  279. package/lib/text-ellipsis/index.css +1 -1
  280. package/lib/text-ellipsis/index.d.ts +12 -3
  281. package/lib/time-picker/index.css +1 -1
  282. package/lib/timeline/index.css +1 -1
  283. package/lib/toast/Toast.d.ts +5 -2
  284. package/lib/toast/Toast.js +2 -1
  285. package/lib/toast/index.css +1 -1
  286. package/lib/toast/index.d.ts +4 -2
  287. package/lib/toast/types.d.ts +2 -0
  288. package/lib/uploader/Uploader.d.ts +1 -1
  289. package/lib/uploader/index.css +1 -1
  290. package/lib/uploader/index.d.ts +1 -1
  291. package/lib/utils/interceptor.d.ts +2 -1
  292. package/lib/utils/interceptor.js +3 -2
  293. package/lib/vue-sfc-shim.d.ts +6 -6
  294. package/lib/vue-tsx-shim.d.ts +23 -23
  295. package/lib/web-types.json +1 -1
  296. package/lib/zartui.cjs.js +230 -112
  297. package/lib/zartui.es.js +231 -113
  298. package/lib/zartui.js +230 -112
  299. package/lib/zartui.min.js +1 -1
  300. package/package.json +21 -11
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",
@@ -9403,6 +9460,7 @@
9403
9460
  });
9404
9461
  return () => {
9405
9462
  const disabled = getProp("disabled");
9463
+ const readonly = getProp("readonly");
9406
9464
  const labelAlign = getProp("labelAlign");
9407
9465
  const Label = renderLabel();
9408
9466
  const TitleIcon = renderTitleIcon();
@@ -9414,6 +9472,7 @@
9414
9472
  "class": bem$G({
9415
9473
  error: showError.value,
9416
9474
  disabled,
9475
+ readonly,
9417
9476
  [`label-${labelAlign}`]: labelAlign,
9418
9477
  "error-message": props.errorMessage !== "" && typeof props.errorMessage !== "undefined",
9419
9478
  description: props.description !== "" && typeof props.description !== "undefined",
@@ -9859,12 +9918,27 @@
9859
9918
  }, [item[props.textKey]])]))])]);
9860
9919
  }
9861
9920
  });
9921
+ const useSyncPropRef = (getProp, setProp) => {
9922
+ const propRef = vue.ref(getProp());
9923
+ vue.watch(getProp, (value) => {
9924
+ if (value !== propRef.value) {
9925
+ propRef.value = value;
9926
+ }
9927
+ });
9928
+ vue.watch(propRef, (value) => {
9929
+ if (value !== getProp()) {
9930
+ setProp(value);
9931
+ }
9932
+ });
9933
+ return propRef;
9934
+ };
9862
9935
  const [name$B, bem$B] = createNamespace("hierarchy-select");
9863
9936
  const hierarchySelectProps = {
9864
9937
  treeData: {
9865
9938
  type: Array,
9866
9939
  default: () => []
9867
9940
  },
9941
+ checkedList: makeArrayProp([]),
9868
9942
  disableParent: {
9869
9943
  type: Boolean,
9870
9944
  default: false
@@ -9884,11 +9958,12 @@
9884
9958
  var stdin_default$T = vue.defineComponent({
9885
9959
  name: name$B,
9886
9960
  props: hierarchySelectProps,
9887
- emits: ["asyncGetter", "selected", "change"],
9961
+ emits: ["asyncGetter", "selected", "change", "update:checkedList"],
9888
9962
  setup(props, {
9889
- emit
9963
+ emit,
9964
+ slots
9890
9965
  }) {
9891
- const checkedList = vue.ref([]);
9966
+ const checkedList = useSyncPropRef(() => props.checkedList, (value) => emit("update:checkedList", value));
9892
9967
  const choosedValue = vue.ref();
9893
9968
  const dataList = vue.ref(deepClone(props.treeData));
9894
9969
  const breadcrumbData = vue.ref([]);
@@ -10057,7 +10132,7 @@
10057
10132
  "onClick": () => {
10058
10133
  selected(item);
10059
10134
  }
10060
- }, [item[props.textKey]]), vue.createVNode("div", {
10135
+ }, [slots.content ? slots.content(item) : item[props.textKey]]), vue.createVNode("div", {
10061
10136
  "class": bem$B("item-nav"),
10062
10137
  "onClick": () => {
10063
10138
  toNextLevel(item, index);
@@ -10080,7 +10155,9 @@
10080
10155
  minZoom: makeRequiredProp(numericProp),
10081
10156
  maxZoom: makeRequiredProp(numericProp),
10082
10157
  rootWidth: makeRequiredProp(Number),
10083
- rootHeight: makeRequiredProp(Number)
10158
+ rootHeight: makeRequiredProp(Number),
10159
+ disableZoom: Boolean,
10160
+ closeOnClickOverlay: Boolean
10084
10161
  },
10085
10162
  emits: ["scale", "close", "longPress"],
10086
10163
  setup(props, {
@@ -10218,7 +10295,8 @@
10218
10295
  setScale(scale);
10219
10296
  }
10220
10297
  };
10221
- const checkTap = () => {
10298
+ const checkTap = (event) => {
10299
+ var _a;
10222
10300
  if (fingerNum > 1) {
10223
10301
  return;
10224
10302
  }
@@ -10236,6 +10314,9 @@
10236
10314
  doubleTapTimer = null;
10237
10315
  toggleScale();
10238
10316
  } else {
10317
+ if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
10318
+ return;
10319
+ }
10239
10320
  doubleTapTimer = setTimeout(() => {
10240
10321
  emit("close");
10241
10322
  doubleTapTimer = null;
@@ -10273,7 +10354,7 @@
10273
10354
  }
10274
10355
  }
10275
10356
  preventDefault(event, stopPropagation2);
10276
- checkTap();
10357
+ checkTap(event);
10277
10358
  touch.reset();
10278
10359
  };
10279
10360
  const onLoad = (event) => {
@@ -10327,7 +10408,7 @@
10327
10408
  }
10328
10409
  });
10329
10410
  const [name$A, bem$z] = createNamespace("image-preview");
10330
- const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate"];
10411
+ const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
10331
10412
  const imagePreviewProps = {
10332
10413
  show: Boolean,
10333
10414
  loop: truthProp,
@@ -10347,7 +10428,9 @@
10347
10428
  startPosition: makeNumericProp(0),
10348
10429
  showIndicators: Boolean,
10349
10430
  closeOnPopstate: truthProp,
10350
- closeIconPosition: makeStringProp("top-right")
10431
+ closeOnClickOverlay: truthProp,
10432
+ closeIconPosition: makeStringProp("top-right"),
10433
+ teleport: [String, Object]
10351
10434
  };
10352
10435
  var stdin_default$R = vue.defineComponent({
10353
10436
  name: name$A,
@@ -10361,7 +10444,8 @@
10361
10444
  const state = vue.reactive({
10362
10445
  active: 0,
10363
10446
  rootWidth: 0,
10364
- rootHeight: 0
10447
+ rootHeight: 0,
10448
+ disableZoom: false
10365
10449
  });
10366
10450
  const resize2 = () => {
10367
10451
  if (swipeRef.value) {
@@ -10417,6 +10501,12 @@
10417
10501
  }, [slots.cover()]);
10418
10502
  }
10419
10503
  };
10504
+ const onDragStart = () => {
10505
+ state.disableZoom = true;
10506
+ };
10507
+ const onDragEnd = () => {
10508
+ state.disableZoom = false;
10509
+ };
10420
10510
  const renderImages = () => vue.createVNode(Swipe, {
10421
10511
  "ref": swipeRef,
10422
10512
  "lazyRender": true,
@@ -10426,7 +10516,9 @@
10426
10516
  "initialSwipe": props.startPosition,
10427
10517
  "showIndicators": props.showIndicators,
10428
10518
  "indicatorColor": "white",
10429
- "onChange": setActive
10519
+ "onChange": setActive,
10520
+ "onDragEnd": onDragEnd,
10521
+ "onDragStart": onDragStart
10430
10522
  }, {
10431
10523
  default: () => [props.images.map((image, index) => vue.createVNode(stdin_default$S, {
10432
10524
  "src": image.url,
@@ -10436,6 +10528,8 @@
10436
10528
  "minZoom": props.minZoom,
10437
10529
  "rootWidth": state.rootWidth,
10438
10530
  "rootHeight": state.rootHeight,
10531
+ "disableZoom": state.disableZoom,
10532
+ "closeOnClickOverlay": props.closeOnClickOverlay,
10439
10533
  "onScale": emitScale,
10440
10534
  "onClose": emitClose,
10441
10535
  "onLongPress": () => emit("longPress", {
@@ -10518,6 +10612,7 @@
10518
10612
  swipeDuration: 300,
10519
10613
  showIndicators: false,
10520
10614
  closeOnPopstate: true,
10615
+ closeOnClickOverlay: true,
10521
10616
  closeIconPosition: "top-right"
10522
10617
  };
10523
10618
  function initInstance$1() {
@@ -10575,6 +10670,7 @@
10575
10670
  const indexBarProps = {
10576
10671
  sticky: truthProp,
10577
10672
  zIndex: numericProp,
10673
+ activeAnchor: makeNumericProp(""),
10578
10674
  teleport: [String, Object],
10579
10675
  highlightColor: String,
10580
10676
  stickyOffsetTop: makeNumberProp(0),
@@ -10587,14 +10683,14 @@
10587
10683
  var stdin_default$Q = vue.defineComponent({
10588
10684
  name: name$z,
10589
10685
  props: indexBarProps,
10590
- emits: ["select", "change"],
10686
+ emits: ["select", "change", "anchorClick", "update:activeAnchor"],
10591
10687
  setup(props, {
10592
10688
  emit,
10593
10689
  slots
10594
10690
  }) {
10595
10691
  const root = vue.ref();
10596
10692
  const sidebar = vue.ref();
10597
- const activeAnchor = vue.ref("");
10693
+ const activeAnchor = useSyncPropRef(() => props.activeAnchor, (value) => emit("update:activeAnchor", value));
10598
10694
  const touchIndex = vue.ref("");
10599
10695
  const touch = useTouch();
10600
10696
  const scrollParent = useScrollParent(root);
@@ -10696,6 +10792,7 @@
10696
10792
  }
10697
10793
  });
10698
10794
  const scrollTo = (index) => {
10795
+ emit("anchorClick", index);
10699
10796
  selectActiveIndex = String(index);
10700
10797
  const match = getMatchAnchor(selectActiveIndex);
10701
10798
  if (match) {
@@ -10912,6 +11009,7 @@
10912
11009
  offset: makeNumericProp(300),
10913
11010
  loading: Boolean,
10914
11011
  finished: Boolean,
11012
+ scroller: Object,
10915
11013
  errorText: String,
10916
11014
  direction: makeStringProp("down"),
10917
11015
  loadingText: String,
@@ -10931,6 +11029,7 @@
10931
11029
  const placeholder = vue.ref();
10932
11030
  const tabStatus = useTabStatus();
10933
11031
  const scrollParent = useScrollParent(root);
11032
+ const scroller = vue.computed(() => props.scroller || scrollParent.value);
10934
11033
  const check = () => {
10935
11034
  vue.nextTick(() => {
10936
11035
  if (loading.value || props.finished || props.error || // skip check when inside an inactive tab
@@ -10941,7 +11040,7 @@
10941
11040
  direction
10942
11041
  } = props;
10943
11042
  const offset2 = +props.offset;
10944
- const scrollParentRect = useRect(scrollParent);
11043
+ const scrollParentRect = useRect(scroller);
10945
11044
  if (!scrollParentRect.height || isHidden(root)) {
10946
11045
  return;
10947
11046
  }
@@ -11022,7 +11121,7 @@
11022
11121
  check
11023
11122
  });
11024
11123
  useEventListener("scroll", check, {
11025
- target: scrollParent,
11124
+ target: scroller,
11026
11125
  passive: true
11027
11126
  });
11028
11127
  return () => {
@@ -14145,13 +14244,10 @@
14145
14244
  };
14146
14245
  const renderTitle = () => {
14147
14246
  const {
14148
- title,
14149
- theme,
14150
- closeButtonText
14247
+ title
14151
14248
  } = props;
14152
14249
  const leftSlot = slots["title-left"];
14153
- const showClose = closeButtonText && theme === "default";
14154
- const showTitle = title || showClose || leftSlot;
14250
+ const showTitle = title || leftSlot;
14155
14251
  if (!showTitle) {
14156
14252
  return;
14157
14253
  }
@@ -14159,7 +14255,7 @@
14159
14255
  "class": bem$n("header")
14160
14256
  }, [leftSlot && vue.createVNode("span", {
14161
14257
  "class": bem$n("title-left")
14162
- }, [leftSlot()]), title && vue.createVNode("h2", {
14258
+ }, [leftSlot()]), title && vue.createVNode("div", {
14163
14259
  "class": bem$n("title")
14164
14260
  }, [title])]);
14165
14261
  };
@@ -14214,11 +14310,8 @@
14214
14310
  return () => {
14215
14311
  const Title = renderTitle();
14216
14312
  const {
14217
- theme,
14218
- closeButtonText,
14219
14313
  title
14220
14314
  } = props;
14221
- const showClose = closeButtonText && theme === "default";
14222
14315
  const Content = vue.createVNode(vue.Transition, {
14223
14316
  "name": props.transition ? "zt-slide-up" : ""
14224
14317
  }, {
@@ -14235,15 +14328,7 @@
14235
14328
  "class": [bem$n("body"), title ? "" : bem$n("body-no-title")]
14236
14329
  }, [vue.createVNode("div", {
14237
14330
  "class": bem$n("keys")
14238
- }, [renderKeys()]), renderSidebar()]), showClose && vue.createVNode("div", {
14239
- "class": bem$n("finish-button-box")
14240
- }, [vue.createVNode(stdin_default$1B, {
14241
- "type": "primary",
14242
- "block": true,
14243
- "text": closeButtonText,
14244
- "class": [bem$n("finish-button"), HAPTICS_FEEDBACK],
14245
- "onClick": onClose
14246
- }, null)])]), [[vue.vShow, props.show]])]
14331
+ }, [renderKeys()]), renderSidebar()])]), [[vue.vShow, props.show]])]
14247
14332
  });
14248
14333
  if (props.teleport) {
14249
14334
  return vue.createVNode(vue.Teleport, {
@@ -15675,7 +15760,7 @@
15675
15760
  });
15676
15761
  };
15677
15762
  const [name$m, bem$l] = createNamespace("popover");
15678
- const popupProps = ["show", "overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
15763
+ const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
15679
15764
  const popoverProps = {
15680
15765
  show: Boolean,
15681
15766
  theme: makeStringProp("light"),
@@ -15718,6 +15803,7 @@
15718
15803
  const wrapperRef = vue.ref();
15719
15804
  const popoverRef = vue.ref();
15720
15805
  const arrowRef = vue.ref();
15806
+ const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
15721
15807
  const getPopoverOptions = () => ({
15722
15808
  placement: props.placement,
15723
15809
  modifiers: [{
@@ -15740,7 +15826,7 @@
15740
15826
  };
15741
15827
  const updateLocation = () => {
15742
15828
  vue.nextTick(() => {
15743
- if (!props.show) {
15829
+ if (!show.value) {
15744
15830
  return;
15745
15831
  }
15746
15832
  if (!popper) {
@@ -15754,10 +15840,12 @@
15754
15840
  }
15755
15841
  });
15756
15842
  };
15757
- const updateShow = (value) => emit("update:show", value);
15843
+ const updateShow = (value) => {
15844
+ show.value = value;
15845
+ };
15758
15846
  const onClickWrapper = () => {
15759
15847
  if (props.trigger === "click") {
15760
- updateShow(!props.show);
15848
+ show.value = !show.value;
15761
15849
  }
15762
15850
  };
15763
15851
  const onClickAction = (action, index) => {
@@ -15770,12 +15858,12 @@
15770
15858
  action.selected = true;
15771
15859
  emit("select", action, index);
15772
15860
  if (props.closeOnClickAction) {
15773
- updateShow(false);
15861
+ show.value = false;
15774
15862
  }
15775
15863
  };
15776
15864
  const onClickAway = () => {
15777
- if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
15778
- updateShow(false);
15865
+ if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
15866
+ show.value = false;
15779
15867
  }
15780
15868
  };
15781
15869
  const renderActionContent = (action, index) => {
@@ -15892,7 +15980,7 @@
15892
15980
  popper = null;
15893
15981
  }
15894
15982
  });
15895
- vue.watch(() => [props.show, props.offset, props.placement], updateLocation);
15983
+ vue.watch(() => [show.value, props.offset, props.placement], updateLocation);
15896
15984
  useClickAway(wrapperRef, onClickAway, {
15897
15985
  eventName: "touchstart"
15898
15986
  });
@@ -15904,14 +15992,13 @@
15904
15992
  "onClick": onClickWrapper
15905
15993
  }, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), vue.createVNode(Popup, vue.mergeProps({
15906
15994
  "ref": popoverRef,
15907
- "class": bem$l([props.theme, props.show ? "show" : "hidden"]),
15995
+ "show": show.value,
15996
+ "class": bem$l([props.theme, show.value ? "show" : "hidden"]),
15908
15997
  "position": "",
15909
15998
  "transition": "zt-popover-zoom",
15910
15999
  "lockScroll": false,
15911
16000
  "onUpdate:show": updateShow
15912
- }, attrs, pick(props, popupProps), {
15913
- "show": true
15914
- }), {
16001
+ }, attrs, useScopeId(), pick(props, popupProps)), {
15915
16002
  default: () => [props.showArrow && vue.createVNode("div", {
15916
16003
  "class": bem$l("arrow"),
15917
16004
  "ref": arrowRef
@@ -18024,6 +18111,7 @@
18024
18111
  let opened;
18025
18112
  let lockClick2;
18026
18113
  let startOffset;
18114
+ let isInBeforeClosing;
18027
18115
  const root = vue.ref();
18028
18116
  const leftRef = vue.ref();
18029
18117
  const rightRef = vue.ref();
@@ -18100,14 +18188,22 @@
18100
18188
  }
18101
18189
  };
18102
18190
  const onClick = (position = "outside") => {
18191
+ if (isInBeforeClosing)
18192
+ return;
18103
18193
  emit("click", position);
18104
18194
  if (opened && !lockClick2) {
18195
+ isInBeforeClosing = true;
18105
18196
  callInterceptor(props.beforeClose, {
18106
18197
  args: [{
18107
18198
  name: props.name,
18108
18199
  position
18109
18200
  }],
18110
- done: () => close(position)
18201
+ done: () => {
18202
+ isInBeforeClosing = false;
18203
+ close(position);
18204
+ },
18205
+ canceled: () => isInBeforeClosing = false,
18206
+ error: () => isInBeforeClosing = false
18111
18207
  });
18112
18208
  }
18113
18209
  };
@@ -18776,10 +18872,11 @@
18776
18872
  const [name$2, bem$2] = createNamespace("text-ellipsis");
18777
18873
  const textEllipsisProps = {
18778
18874
  rows: makeNumericProp(1),
18875
+ dots: makeStringProp("..."),
18779
18876
  content: makeStringProp(""),
18780
18877
  expandText: makeStringProp(""),
18781
18878
  collapseText: makeStringProp(""),
18782
- highlight: makeStringProp("")
18879
+ position: makeStringProp("end")
18783
18880
  };
18784
18881
  var stdin_default$7 = vue.defineComponent({
18785
18882
  name: name$2,
@@ -18792,6 +18889,7 @@
18792
18889
  const expanded = vue.ref(false);
18793
18890
  const hasAction = vue.ref(false);
18794
18891
  const root = vue.ref();
18892
+ const actionText = vue.computed(() => expanded.value ? props.collapseText : props.expandText);
18795
18893
  const pxToNum = (value) => {
18796
18894
  if (!value)
18797
18895
  return 0;
@@ -18821,23 +18919,52 @@
18821
18919
  const calcEllipsisText = (container2, maxHeight2) => {
18822
18920
  const {
18823
18921
  content,
18824
- expandText
18922
+ position,
18923
+ dots
18825
18924
  } = 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;
18925
+ const end2 = content.length;
18926
+ const calcEllipse = () => {
18927
+ const tail = (left2, right2) => {
18928
+ if (right2 - left2 <= 1) {
18929
+ if (position === "end") {
18930
+ return content.slice(0, left2) + dots;
18931
+ }
18932
+ return dots + content.slice(right2, end2);
18933
+ }
18934
+ const middle2 = Math.round((left2 + right2) / 2);
18935
+ if (position === "end") {
18936
+ container2.innerText = content.slice(0, middle2) + dots + actionText.value;
18937
+ } else {
18938
+ container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
18939
+ }
18940
+ if (container2.offsetHeight > maxHeight2) {
18941
+ if (position === "end") {
18942
+ return tail(left2, middle2);
18943
+ }
18944
+ return tail(middle2, right2);
18945
+ }
18946
+ if (position === "end") {
18947
+ return tail(middle2, right2);
18948
+ }
18949
+ return tail(left2, middle2);
18950
+ };
18951
+ container2.innerText = tail(0, end2);
18952
+ };
18953
+ const middleTail = (leftPart, rightPart) => {
18954
+ if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
18955
+ return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
18838
18956
  }
18839
- }
18840
- return content.slice(0, res) + dot;
18957
+ const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
18958
+ const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
18959
+ container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end2) + props.expandText;
18960
+ if (container2.offsetHeight >= maxHeight2) {
18961
+ return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
18962
+ }
18963
+ return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
18964
+ };
18965
+ const middle = 0 + end2 >> 1;
18966
+ props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end2]) : calcEllipse();
18967
+ return container2.innerText;
18841
18968
  };
18842
18969
  const container = cloneContainer();
18843
18970
  if (!container)
@@ -18847,7 +18974,7 @@
18847
18974
  paddingTop,
18848
18975
  lineHeight
18849
18976
  } = container.style;
18850
- const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
18977
+ const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
18851
18978
  if (maxHeight < container.offsetHeight) {
18852
18979
  hasAction.value = true;
18853
18980
  text.value = calcEllipsisText(container, maxHeight);
@@ -18861,26 +18988,17 @@
18861
18988
  expanded.value = !expanded.value;
18862
18989
  emit("clickAction", event);
18863
18990
  };
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
18991
  const renderAction = () => vue.createVNode("span", {
18872
18992
  "class": bem$2("action"),
18873
18993
  "onClick": onClickAction
18874
- }, [expanded.value ? props.collapseText : props.expandText]);
18994
+ }, [actionText.value]);
18875
18995
  vue.onMounted(calcEllipsised);
18876
- vue.watch(() => [props.content, props.rows], calcEllipsised);
18996
+ vue.watch(() => [props.content, props.rows, props.position], calcEllipsised);
18877
18997
  useEventListener("resize", calcEllipsised);
18878
18998
  return () => vue.createVNode("div", {
18879
18999
  "ref": root,
18880
19000
  "class": bem$2()
18881
- }, [vue.createVNode("span", {
18882
- "innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
18883
- }, null), hasAction.value ? renderAction() : null]);
19001
+ }, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
18884
19002
  }
18885
19003
  });
18886
19004
  const TextEllipsis = withInstall(stdin_default$7);
@@ -20463,7 +20581,7 @@
20463
20581
  });
20464
20582
  }
20465
20583
  };
20466
- const version = "3.1.7";
20584
+ const version = "3.1.9";
20467
20585
  function install(app) {
20468
20586
  const components = [
20469
20587
  ActionSheet,