zartui 3.1.10 → 3.1.11

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 (103) hide show
  1. package/es/cascader/Cascader.d.ts +1 -1
  2. package/es/cascader/index.d.ts +1 -1
  3. package/es/cell/Cell.d.ts +24 -1
  4. package/es/cell/Cell.mjs +30 -5
  5. package/es/cell/index.css +1 -1
  6. package/es/cell/index.d.ts +14 -1
  7. package/es/checkbox/Checkbox.d.ts +1 -1
  8. package/es/checkbox/index.d.ts +1 -1
  9. package/es/checkbox-group/CheckboxGroup.d.ts +1 -1
  10. package/es/checkbox-group/index.d.ts +1 -1
  11. package/es/collapse/Collapse.d.ts +1 -1
  12. package/es/collapse/index.d.ts +1 -1
  13. package/es/date-time-picker/DateTimePicker.d.ts +1 -1
  14. package/es/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
  15. package/es/date-time-picker/index.d.ts +1 -1
  16. package/es/dropdown-item/DropdownItem.d.ts +1 -1
  17. package/es/dropdown-item/index.d.ts +1 -1
  18. package/es/field/Field.d.ts +17 -2
  19. package/es/field/index.d.ts +12 -2
  20. package/es/hierarchy-select/HierarchySelect.mjs +1 -0
  21. package/es/index-bar/IndexBar.mjs +27 -19
  22. package/es/index-bar/index.css +1 -1
  23. package/es/index-bar/types.d.ts +1 -0
  24. package/es/index.d.ts +1 -1
  25. package/es/index.mjs +1 -1
  26. package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
  27. package/es/number-keyboard/index.d.ts +1 -1
  28. package/es/picker/Picker.d.ts +1 -1
  29. package/es/picker/index.d.ts +1 -1
  30. package/es/pull-refresh/PullRefresh.d.ts +1 -1
  31. package/es/pull-refresh/index.d.ts +1 -1
  32. package/es/radio-group/RadioGroup.d.ts +1 -1
  33. package/es/radio-group/index.d.ts +1 -1
  34. package/es/radio-picker/RadioPicker.d.ts +1 -1
  35. package/es/radio-picker/index.d.ts +1 -1
  36. package/es/rate/Rate.d.ts +1 -1
  37. package/es/rate/index.d.ts +1 -1
  38. package/es/search/Search.d.ts +2 -2
  39. package/es/search/index.d.ts +2 -2
  40. package/es/stepper/Stepper.d.ts +1 -1
  41. package/es/stepper/index.d.ts +1 -1
  42. package/es/switch/Switch.d.ts +1 -1
  43. package/es/switch/index.d.ts +1 -1
  44. package/es/tabbar/Tabbar.d.ts +1 -1
  45. package/es/tabbar/index.d.ts +1 -1
  46. package/es/tabbar-item/index.css +1 -1
  47. package/es/time-picker/TimePicker.d.ts +1 -1
  48. package/es/time-picker/index.d.ts +1 -1
  49. package/lib/cascader/Cascader.d.ts +1 -1
  50. package/lib/cascader/index.d.ts +1 -1
  51. package/lib/cell/Cell.d.ts +24 -1
  52. package/lib/cell/Cell.js +28 -3
  53. package/lib/cell/index.css +1 -1
  54. package/lib/cell/index.d.ts +14 -1
  55. package/lib/checkbox/Checkbox.d.ts +1 -1
  56. package/lib/checkbox/index.d.ts +1 -1
  57. package/lib/checkbox-group/CheckboxGroup.d.ts +1 -1
  58. package/lib/checkbox-group/index.d.ts +1 -1
  59. package/lib/collapse/Collapse.d.ts +1 -1
  60. package/lib/collapse/index.d.ts +1 -1
  61. package/lib/date-time-picker/DateTimePicker.d.ts +1 -1
  62. package/lib/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
  63. package/lib/date-time-picker/index.d.ts +1 -1
  64. package/lib/dropdown-item/DropdownItem.d.ts +1 -1
  65. package/lib/dropdown-item/index.d.ts +1 -1
  66. package/lib/field/Field.d.ts +17 -2
  67. package/lib/field/index.d.ts +12 -2
  68. package/lib/hierarchy-select/HierarchySelect.js +1 -0
  69. package/lib/index-bar/IndexBar.js +27 -19
  70. package/lib/index-bar/index.css +1 -1
  71. package/lib/index-bar/types.d.ts +1 -0
  72. package/lib/index.css +1 -1
  73. package/lib/index.d.ts +1 -1
  74. package/lib/index.js +1 -1
  75. package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
  76. package/lib/number-keyboard/index.d.ts +1 -1
  77. package/lib/picker/Picker.d.ts +1 -1
  78. package/lib/picker/index.d.ts +1 -1
  79. package/lib/pull-refresh/PullRefresh.d.ts +1 -1
  80. package/lib/pull-refresh/index.d.ts +1 -1
  81. package/lib/radio-group/RadioGroup.d.ts +1 -1
  82. package/lib/radio-group/index.d.ts +1 -1
  83. package/lib/radio-picker/RadioPicker.d.ts +1 -1
  84. package/lib/radio-picker/index.d.ts +1 -1
  85. package/lib/rate/Rate.d.ts +1 -1
  86. package/lib/rate/index.d.ts +1 -1
  87. package/lib/search/Search.d.ts +2 -2
  88. package/lib/search/index.d.ts +2 -2
  89. package/lib/stepper/Stepper.d.ts +1 -1
  90. package/lib/stepper/index.d.ts +1 -1
  91. package/lib/switch/Switch.d.ts +1 -1
  92. package/lib/switch/index.d.ts +1 -1
  93. package/lib/tabbar/Tabbar.d.ts +1 -1
  94. package/lib/tabbar/index.d.ts +1 -1
  95. package/lib/tabbar-item/index.css +1 -1
  96. package/lib/time-picker/TimePicker.d.ts +1 -1
  97. package/lib/time-picker/index.d.ts +1 -1
  98. package/lib/web-types.json +1 -1
  99. package/lib/zartui.cjs.js +56 -23
  100. package/lib/zartui.es.js +56 -23
  101. package/lib/zartui.js +56 -23
  102. package/lib/zartui.min.js +1 -1
  103. package/package.json +5 -4
package/lib/zartui.cjs.js CHANGED
@@ -4702,18 +4702,21 @@ const cellSharedProps = {
4702
4702
  clickable: {
4703
4703
  type: Boolean,
4704
4704
  default: null
4705
- }
4705
+ },
4706
+ clearable: Boolean,
4707
+ clearIcon: makeStringProp("clear-r")
4706
4708
  };
4707
4709
  const cellProps = extend({}, cellSharedProps, routeProps);
4708
4710
  var stdin_default$1l = vue.defineComponent({
4709
4711
  name: name$Z,
4710
4712
  props: cellProps,
4711
- emits: ["click"],
4713
+ emits: ["click", "clear"],
4712
4714
  setup(props, {
4713
4715
  slots,
4714
4716
  emit
4715
4717
  }) {
4716
4718
  const route2 = useRoute();
4719
+ const clearIconRef = vue.ref();
4717
4720
  const renderLabel = () => {
4718
4721
  const showLabel = slots.label || isDef(props.label);
4719
4722
  if (showLabel) {
@@ -4772,11 +4775,28 @@ var stdin_default$1l = vue.defineComponent({
4772
4775
  emit("click");
4773
4776
  }
4774
4777
  };
4778
+ const onClear = (event) => {
4779
+ preventDefault(event, true);
4780
+ emit("clear", event);
4781
+ };
4782
+ function getClearIconListenerEvent() {
4783
+ if ("ontouchstart" in document.documentElement) {
4784
+ return "touchstart";
4785
+ }
4786
+ return "click";
4787
+ }
4788
+ use.useEventListener(getClearIconListenerEvent(), onClear, {
4789
+ target: vue.computed(() => {
4790
+ var _a;
4791
+ return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
4792
+ })
4793
+ });
4775
4794
  const renderValue = () => {
4776
4795
  var _a;
4777
4796
  const slot = slots.value || slots.default;
4778
4797
  const hasValue = slot || isDef(props.value);
4779
4798
  const isHorizontal = props.direction === "horizontal";
4799
+ const showClear = props.clearable && isDef(props.value) && props.value !== "";
4780
4800
  if (hasValue) {
4781
4801
  return vue.createVNode("div", {
4782
4802
  "class": [bem$Y("value", {
@@ -4785,7 +4805,11 @@ var stdin_default$1l = vue.defineComponent({
4785
4805
  "onClick": () => onClick(isHorizontal)
4786
4806
  }, [slot ? slot() : vue.createVNode("span", {
4787
4807
  "class": bem$Y("value-text")
4788
- }, [props.value]), (_a = slots.extra) == null ? void 0 : _a.call(slots), renderRightIcon()]);
4808
+ }, [props.value]), showClear && vue.createVNode(Icon, {
4809
+ "ref": clearIconRef,
4810
+ "name": props.clearIcon,
4811
+ "class": bem$Y("value-clear")
4812
+ }, null), (_a = slots.extra) == null ? void 0 : _a.call(slots), renderRightIcon()]);
4789
4813
  }
4790
4814
  };
4791
4815
  const renderLeftIcon = () => {
@@ -9899,6 +9923,7 @@ const hierarchySelectProps = {
9899
9923
  asyncGetter: {
9900
9924
  type: Function
9901
9925
  },
9926
+ // 是否开启自动全选、半选功能
9902
9927
  unanimous: {
9903
9928
  type: Boolean,
9904
9929
  default: true
@@ -10752,7 +10777,7 @@ const indexBarProps = {
10752
10777
  default: genAlphabet
10753
10778
  },
10754
10779
  indexBarMaxHeight: makeNumericProp("70vh"),
10755
- contractionPointText: makeStringProp("·")
10780
+ contractionPointText: makeStringProp("")
10756
10781
  };
10757
10782
  const INDEX_BAR_KEY = Symbol(name$z);
10758
10783
  const MIN_CONTRACTION_NUM = 2;
@@ -10768,9 +10793,9 @@ var stdin_default$Q = vue.defineComponent({
10768
10793
  const sidebar = vue.ref();
10769
10794
  const activeAnchor = useSyncPropRef(() => props.activeAnchor, (value) => emit("update:activeAnchor", value));
10770
10795
  const touchIndex = vue.ref("");
10771
- const indexBarMaxHeight = () => {
10796
+ const indexBarMaxHeight = vue.computed(() => {
10772
10797
  return props.indexBarMaxHeight ? unitToPx(props.indexBarMaxHeight) : unitToPx("100vh");
10773
- };
10798
+ });
10774
10799
  const touch = useTouch();
10775
10800
  const scrollParent = use.useScrollParent(root);
10776
10801
  const {
@@ -10969,9 +10994,9 @@ var stdin_default$Q = vue.defineComponent({
10969
10994
  };
10970
10995
  const adaptorIndexListByHeight = () => {
10971
10996
  const actualIndexListHeight = props.indexList.length * getIndexHeight();
10972
- if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight()) {
10997
+ if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight.value) {
10973
10998
  const adaptedIndexList = deepClone(props.indexList);
10974
- const renderedNum = Math.floor(indexBarMaxHeight() / getIndexHeight());
10999
+ const renderedNum = Math.floor(indexBarMaxHeight.value / getIndexHeight());
10975
11000
  const renderedPointNum = Math.floor(renderedNum / MIN_CONTRACTION_NUM);
10976
11001
  const renderedIndexNum = renderedNum - renderedPointNum;
10977
11002
  const hiddenIndexNum = adaptedIndexList.length - renderedIndexNum;
@@ -11029,23 +11054,31 @@ var stdin_default$Q = vue.defineComponent({
11029
11054
  }, [vue.createVNode("div", {
11030
11055
  "class": bem$y("touch-text")
11031
11056
  }, [touchActiveText]), vue.createVNode("svg", {
11032
- "class": bem$y("icon"),
11033
11057
  "xmlns": "http://www.w3.org/2000/svg",
11034
- "viewBox": "0 0 20 32"
11035
- }, [vue.createVNode("defs", null, [vue.createVNode("path", {
11036
- "id": "7rkhbmqvk__gc482iacwa",
11037
- "d": "M0 0H20V32H0z"
11038
- }, null)]), vue.createVNode("g", {
11039
11058
  "fill": "none",
11040
- "fill-rule": "evenodd"
11041
- }, [vue.createVNode("path", {
11042
- "d": "M-1,0 C7.836556,-1.623249e-15 15,7.163444 15,16 C15,24.836556 7.836556,32 -1,32 L-1,32 L-1,32 L-1,0 Z",
11043
- "fill": "#8093AB",
11044
- "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
11059
+ "viewBox": "0 0 20 32",
11060
+ "class": bem$y("icon")
11061
+ }, [vue.createVNode("defs", null, [vue.createVNode("mask", {
11062
+ "id": "ei8r0nsyx__b6fjzymnfa"
11063
+ }, [vue.createVNode("rect", {
11064
+ "width": "20",
11065
+ "height": "32",
11066
+ "rx": "0",
11067
+ "fill": "#FFF"
11068
+ }, null)])]), vue.createVNode("g", {
11069
+ "mask": "url(#ei8r0nsyx__b6fjzymnfa)"
11070
+ }, [vue.createVNode("rect", {
11071
+ "width": "20",
11072
+ "height": "32",
11073
+ "rx": "0"
11074
+ }, null), vue.createVNode("path", {
11075
+ "d": "M-1.0000000000000497,0C7.83656,0,15,7.16344,15,16C15,24.8366,7.83656,32,-1,32L-1.0000000000000497,0Z",
11076
+ "fill-rule": "evenodd",
11077
+ "class": bem$y("icon-fill")
11045
11078
  }, null), vue.createVNode("path", {
11046
- "d": "M12.2406862,7.01475705 L19.4355101,15.3463801 C19.7597461,15.7218113 19.7597461,16.2781887 19.4355101,16.6536199 L12.2406862,24.9852429 C13.9822172,22.423901 15,19.3308084 15,16 C15,12.6691916 13.9822172,9.57609904 12.2406862,7.01475705 Z",
11047
- "fill": "#8093AB",
11048
- "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
11079
+ "d": "M12.243150099299784,24.98157383041382L19.435507386779786,16.65358383041382C19.759737386779786,16.27815383041382,19.759737386779786,15.721773830413818,19.435507386779786,15.346343830413819L12.243151433939785,7.018357001713818C13.983177386779785,9.578993830413818,14.999997386779786,12.670733830413818,14.999997386779786,15.999963830413819C14.999997386779786,19.32917383041382,13.983177386779785,22.420973830413818,12.243150099299784,24.98157383041382Z",
11080
+ "fill-rule": "evenodd",
11081
+ "class": bem$y("icon-fill")
11049
11082
  }, null)])])]), vue.createVNode("div", {
11050
11083
  "data-index": index,
11051
11084
  "data-index-map": contractionPointMapList,
@@ -19393,7 +19426,7 @@ const Lazyload = {
19393
19426
  });
19394
19427
  }
19395
19428
  };
19396
- const version = "3.1.10";
19429
+ const version = "3.1.11";
19397
19430
  function install(app) {
19398
19431
  const components = [
19399
19432
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -4700,18 +4700,21 @@ const cellSharedProps = {
4700
4700
  clickable: {
4701
4701
  type: Boolean,
4702
4702
  default: null
4703
- }
4703
+ },
4704
+ clearable: Boolean,
4705
+ clearIcon: makeStringProp("clear-r")
4704
4706
  };
4705
4707
  const cellProps = extend({}, cellSharedProps, routeProps);
4706
4708
  var stdin_default$1l = defineComponent({
4707
4709
  name: name$Z,
4708
4710
  props: cellProps,
4709
- emits: ["click"],
4711
+ emits: ["click", "clear"],
4710
4712
  setup(props, {
4711
4713
  slots,
4712
4714
  emit
4713
4715
  }) {
4714
4716
  const route2 = useRoute();
4717
+ const clearIconRef = ref();
4715
4718
  const renderLabel = () => {
4716
4719
  const showLabel = slots.label || isDef(props.label);
4717
4720
  if (showLabel) {
@@ -4770,11 +4773,28 @@ var stdin_default$1l = defineComponent({
4770
4773
  emit("click");
4771
4774
  }
4772
4775
  };
4776
+ const onClear = (event) => {
4777
+ preventDefault(event, true);
4778
+ emit("clear", event);
4779
+ };
4780
+ function getClearIconListenerEvent() {
4781
+ if ("ontouchstart" in document.documentElement) {
4782
+ return "touchstart";
4783
+ }
4784
+ return "click";
4785
+ }
4786
+ useEventListener(getClearIconListenerEvent(), onClear, {
4787
+ target: computed(() => {
4788
+ var _a;
4789
+ return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
4790
+ })
4791
+ });
4773
4792
  const renderValue = () => {
4774
4793
  var _a;
4775
4794
  const slot = slots.value || slots.default;
4776
4795
  const hasValue = slot || isDef(props.value);
4777
4796
  const isHorizontal = props.direction === "horizontal";
4797
+ const showClear = props.clearable && isDef(props.value) && props.value !== "";
4778
4798
  if (hasValue) {
4779
4799
  return createVNode("div", {
4780
4800
  "class": [bem$Y("value", {
@@ -4783,7 +4803,11 @@ var stdin_default$1l = defineComponent({
4783
4803
  "onClick": () => onClick(isHorizontal)
4784
4804
  }, [slot ? slot() : createVNode("span", {
4785
4805
  "class": bem$Y("value-text")
4786
- }, [props.value]), (_a = slots.extra) == null ? void 0 : _a.call(slots), renderRightIcon()]);
4806
+ }, [props.value]), showClear && createVNode(Icon, {
4807
+ "ref": clearIconRef,
4808
+ "name": props.clearIcon,
4809
+ "class": bem$Y("value-clear")
4810
+ }, null), (_a = slots.extra) == null ? void 0 : _a.call(slots), renderRightIcon()]);
4787
4811
  }
4788
4812
  };
4789
4813
  const renderLeftIcon = () => {
@@ -9897,6 +9921,7 @@ const hierarchySelectProps = {
9897
9921
  asyncGetter: {
9898
9922
  type: Function
9899
9923
  },
9924
+ // 是否开启自动全选、半选功能
9900
9925
  unanimous: {
9901
9926
  type: Boolean,
9902
9927
  default: true
@@ -10750,7 +10775,7 @@ const indexBarProps = {
10750
10775
  default: genAlphabet
10751
10776
  },
10752
10777
  indexBarMaxHeight: makeNumericProp("70vh"),
10753
- contractionPointText: makeStringProp("·")
10778
+ contractionPointText: makeStringProp("")
10754
10779
  };
10755
10780
  const INDEX_BAR_KEY = Symbol(name$z);
10756
10781
  const MIN_CONTRACTION_NUM = 2;
@@ -10766,9 +10791,9 @@ var stdin_default$Q = defineComponent({
10766
10791
  const sidebar = ref();
10767
10792
  const activeAnchor = useSyncPropRef(() => props.activeAnchor, (value) => emit("update:activeAnchor", value));
10768
10793
  const touchIndex = ref("");
10769
- const indexBarMaxHeight = () => {
10794
+ const indexBarMaxHeight = computed(() => {
10770
10795
  return props.indexBarMaxHeight ? unitToPx(props.indexBarMaxHeight) : unitToPx("100vh");
10771
- };
10796
+ });
10772
10797
  const touch = useTouch();
10773
10798
  const scrollParent = useScrollParent(root);
10774
10799
  const {
@@ -10967,9 +10992,9 @@ var stdin_default$Q = defineComponent({
10967
10992
  };
10968
10993
  const adaptorIndexListByHeight = () => {
10969
10994
  const actualIndexListHeight = props.indexList.length * getIndexHeight();
10970
- if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight()) {
10995
+ if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight.value) {
10971
10996
  const adaptedIndexList = deepClone(props.indexList);
10972
- const renderedNum = Math.floor(indexBarMaxHeight() / getIndexHeight());
10997
+ const renderedNum = Math.floor(indexBarMaxHeight.value / getIndexHeight());
10973
10998
  const renderedPointNum = Math.floor(renderedNum / MIN_CONTRACTION_NUM);
10974
10999
  const renderedIndexNum = renderedNum - renderedPointNum;
10975
11000
  const hiddenIndexNum = adaptedIndexList.length - renderedIndexNum;
@@ -11027,23 +11052,31 @@ var stdin_default$Q = defineComponent({
11027
11052
  }, [createVNode("div", {
11028
11053
  "class": bem$y("touch-text")
11029
11054
  }, [touchActiveText]), createVNode("svg", {
11030
- "class": bem$y("icon"),
11031
11055
  "xmlns": "http://www.w3.org/2000/svg",
11032
- "viewBox": "0 0 20 32"
11033
- }, [createVNode("defs", null, [createVNode("path", {
11034
- "id": "7rkhbmqvk__gc482iacwa",
11035
- "d": "M0 0H20V32H0z"
11036
- }, null)]), createVNode("g", {
11037
11056
  "fill": "none",
11038
- "fill-rule": "evenodd"
11039
- }, [createVNode("path", {
11040
- "d": "M-1,0 C7.836556,-1.623249e-15 15,7.163444 15,16 C15,24.836556 7.836556,32 -1,32 L-1,32 L-1,32 L-1,0 Z",
11041
- "fill": "#8093AB",
11042
- "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
11057
+ "viewBox": "0 0 20 32",
11058
+ "class": bem$y("icon")
11059
+ }, [createVNode("defs", null, [createVNode("mask", {
11060
+ "id": "ei8r0nsyx__b6fjzymnfa"
11061
+ }, [createVNode("rect", {
11062
+ "width": "20",
11063
+ "height": "32",
11064
+ "rx": "0",
11065
+ "fill": "#FFF"
11066
+ }, null)])]), createVNode("g", {
11067
+ "mask": "url(#ei8r0nsyx__b6fjzymnfa)"
11068
+ }, [createVNode("rect", {
11069
+ "width": "20",
11070
+ "height": "32",
11071
+ "rx": "0"
11072
+ }, null), createVNode("path", {
11073
+ "d": "M-1.0000000000000497,0C7.83656,0,15,7.16344,15,16C15,24.8366,7.83656,32,-1,32L-1.0000000000000497,0Z",
11074
+ "fill-rule": "evenodd",
11075
+ "class": bem$y("icon-fill")
11043
11076
  }, null), createVNode("path", {
11044
- "d": "M12.2406862,7.01475705 L19.4355101,15.3463801 C19.7597461,15.7218113 19.7597461,16.2781887 19.4355101,16.6536199 L12.2406862,24.9852429 C13.9822172,22.423901 15,19.3308084 15,16 C15,12.6691916 13.9822172,9.57609904 12.2406862,7.01475705 Z",
11045
- "fill": "#8093AB",
11046
- "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
11077
+ "d": "M12.243150099299784,24.98157383041382L19.435507386779786,16.65358383041382C19.759737386779786,16.27815383041382,19.759737386779786,15.721773830413818,19.435507386779786,15.346343830413819L12.243151433939785,7.018357001713818C13.983177386779785,9.578993830413818,14.999997386779786,12.670733830413818,14.999997386779786,15.999963830413819C14.999997386779786,19.32917383041382,13.983177386779785,22.420973830413818,12.243150099299784,24.98157383041382Z",
11078
+ "fill-rule": "evenodd",
11079
+ "class": bem$y("icon-fill")
11047
11080
  }, null)])])]), createVNode("div", {
11048
11081
  "data-index": index,
11049
11082
  "data-index-map": contractionPointMapList,
@@ -19391,7 +19424,7 @@ const Lazyload = {
19391
19424
  });
19392
19425
  }
19393
19426
  };
19394
- const version = "3.1.10";
19427
+ const version = "3.1.11";
19395
19428
  function install(app) {
19396
19429
  const components = [
19397
19430
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -4963,18 +4963,21 @@
4963
4963
  clickable: {
4964
4964
  type: Boolean,
4965
4965
  default: null
4966
- }
4966
+ },
4967
+ clearable: Boolean,
4968
+ clearIcon: makeStringProp("clear-r")
4967
4969
  };
4968
4970
  const cellProps = extend({}, cellSharedProps, routeProps);
4969
4971
  var stdin_default$1l = vue.defineComponent({
4970
4972
  name: name$Z,
4971
4973
  props: cellProps,
4972
- emits: ["click"],
4974
+ emits: ["click", "clear"],
4973
4975
  setup(props, {
4974
4976
  slots,
4975
4977
  emit
4976
4978
  }) {
4977
4979
  const route2 = useRoute();
4980
+ const clearIconRef = vue.ref();
4978
4981
  const renderLabel = () => {
4979
4982
  const showLabel = slots.label || isDef(props.label);
4980
4983
  if (showLabel) {
@@ -5033,11 +5036,28 @@
5033
5036
  emit("click");
5034
5037
  }
5035
5038
  };
5039
+ const onClear = (event) => {
5040
+ preventDefault(event, true);
5041
+ emit("clear", event);
5042
+ };
5043
+ function getClearIconListenerEvent() {
5044
+ if ("ontouchstart" in document.documentElement) {
5045
+ return "touchstart";
5046
+ }
5047
+ return "click";
5048
+ }
5049
+ useEventListener(getClearIconListenerEvent(), onClear, {
5050
+ target: vue.computed(() => {
5051
+ var _a;
5052
+ return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
5053
+ })
5054
+ });
5036
5055
  const renderValue = () => {
5037
5056
  var _a;
5038
5057
  const slot = slots.value || slots.default;
5039
5058
  const hasValue = slot || isDef(props.value);
5040
5059
  const isHorizontal = props.direction === "horizontal";
5060
+ const showClear = props.clearable && isDef(props.value) && props.value !== "";
5041
5061
  if (hasValue) {
5042
5062
  return vue.createVNode("div", {
5043
5063
  "class": [bem$Y("value", {
@@ -5046,7 +5066,11 @@
5046
5066
  "onClick": () => onClick(isHorizontal)
5047
5067
  }, [slot ? slot() : vue.createVNode("span", {
5048
5068
  "class": bem$Y("value-text")
5049
- }, [props.value]), (_a = slots.extra) == null ? void 0 : _a.call(slots), renderRightIcon()]);
5069
+ }, [props.value]), showClear && vue.createVNode(Icon, {
5070
+ "ref": clearIconRef,
5071
+ "name": props.clearIcon,
5072
+ "class": bem$Y("value-clear")
5073
+ }, null), (_a = slots.extra) == null ? void 0 : _a.call(slots), renderRightIcon()]);
5050
5074
  }
5051
5075
  };
5052
5076
  const renderLeftIcon = () => {
@@ -10137,6 +10161,7 @@
10137
10161
  asyncGetter: {
10138
10162
  type: Function
10139
10163
  },
10164
+ // 是否开启自动全选、半选功能
10140
10165
  unanimous: {
10141
10166
  type: Boolean,
10142
10167
  default: true
@@ -10990,7 +11015,7 @@
10990
11015
  default: genAlphabet
10991
11016
  },
10992
11017
  indexBarMaxHeight: makeNumericProp("70vh"),
10993
- contractionPointText: makeStringProp("·")
11018
+ contractionPointText: makeStringProp("")
10994
11019
  };
10995
11020
  const INDEX_BAR_KEY = Symbol(name$z);
10996
11021
  const MIN_CONTRACTION_NUM = 2;
@@ -11006,9 +11031,9 @@
11006
11031
  const sidebar = vue.ref();
11007
11032
  const activeAnchor = useSyncPropRef(() => props.activeAnchor, (value) => emit("update:activeAnchor", value));
11008
11033
  const touchIndex = vue.ref("");
11009
- const indexBarMaxHeight = () => {
11034
+ const indexBarMaxHeight = vue.computed(() => {
11010
11035
  return props.indexBarMaxHeight ? unitToPx(props.indexBarMaxHeight) : unitToPx("100vh");
11011
- };
11036
+ });
11012
11037
  const touch = useTouch();
11013
11038
  const scrollParent = useScrollParent(root);
11014
11039
  const {
@@ -11207,9 +11232,9 @@
11207
11232
  };
11208
11233
  const adaptorIndexListByHeight = () => {
11209
11234
  const actualIndexListHeight = props.indexList.length * getIndexHeight();
11210
- if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight()) {
11235
+ if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight.value) {
11211
11236
  const adaptedIndexList = deepClone(props.indexList);
11212
- const renderedNum = Math.floor(indexBarMaxHeight() / getIndexHeight());
11237
+ const renderedNum = Math.floor(indexBarMaxHeight.value / getIndexHeight());
11213
11238
  const renderedPointNum = Math.floor(renderedNum / MIN_CONTRACTION_NUM);
11214
11239
  const renderedIndexNum = renderedNum - renderedPointNum;
11215
11240
  const hiddenIndexNum = adaptedIndexList.length - renderedIndexNum;
@@ -11267,23 +11292,31 @@
11267
11292
  }, [vue.createVNode("div", {
11268
11293
  "class": bem$y("touch-text")
11269
11294
  }, [touchActiveText]), vue.createVNode("svg", {
11270
- "class": bem$y("icon"),
11271
11295
  "xmlns": "http://www.w3.org/2000/svg",
11272
- "viewBox": "0 0 20 32"
11273
- }, [vue.createVNode("defs", null, [vue.createVNode("path", {
11274
- "id": "7rkhbmqvk__gc482iacwa",
11275
- "d": "M0 0H20V32H0z"
11276
- }, null)]), vue.createVNode("g", {
11277
11296
  "fill": "none",
11278
- "fill-rule": "evenodd"
11279
- }, [vue.createVNode("path", {
11280
- "d": "M-1,0 C7.836556,-1.623249e-15 15,7.163444 15,16 C15,24.836556 7.836556,32 -1,32 L-1,32 L-1,32 L-1,0 Z",
11281
- "fill": "#8093AB",
11282
- "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
11297
+ "viewBox": "0 0 20 32",
11298
+ "class": bem$y("icon")
11299
+ }, [vue.createVNode("defs", null, [vue.createVNode("mask", {
11300
+ "id": "ei8r0nsyx__b6fjzymnfa"
11301
+ }, [vue.createVNode("rect", {
11302
+ "width": "20",
11303
+ "height": "32",
11304
+ "rx": "0",
11305
+ "fill": "#FFF"
11306
+ }, null)])]), vue.createVNode("g", {
11307
+ "mask": "url(#ei8r0nsyx__b6fjzymnfa)"
11308
+ }, [vue.createVNode("rect", {
11309
+ "width": "20",
11310
+ "height": "32",
11311
+ "rx": "0"
11312
+ }, null), vue.createVNode("path", {
11313
+ "d": "M-1.0000000000000497,0C7.83656,0,15,7.16344,15,16C15,24.8366,7.83656,32,-1,32L-1.0000000000000497,0Z",
11314
+ "fill-rule": "evenodd",
11315
+ "class": bem$y("icon-fill")
11283
11316
  }, null), vue.createVNode("path", {
11284
- "d": "M12.2406862,7.01475705 L19.4355101,15.3463801 C19.7597461,15.7218113 19.7597461,16.2781887 19.4355101,16.6536199 L12.2406862,24.9852429 C13.9822172,22.423901 15,19.3308084 15,16 C15,12.6691916 13.9822172,9.57609904 12.2406862,7.01475705 Z",
11285
- "fill": "#8093AB",
11286
- "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
11317
+ "d": "M12.243150099299784,24.98157383041382L19.435507386779786,16.65358383041382C19.759737386779786,16.27815383041382,19.759737386779786,15.721773830413818,19.435507386779786,15.346343830413819L12.243151433939785,7.018357001713818C13.983177386779785,9.578993830413818,14.999997386779786,12.670733830413818,14.999997386779786,15.999963830413819C14.999997386779786,19.32917383041382,13.983177386779785,22.420973830413818,12.243150099299784,24.98157383041382Z",
11318
+ "fill-rule": "evenodd",
11319
+ "class": bem$y("icon-fill")
11287
11320
  }, null)])])]), vue.createVNode("div", {
11288
11321
  "data-index": index,
11289
11322
  "data-index-map": contractionPointMapList,
@@ -21011,7 +21044,7 @@
21011
21044
  });
21012
21045
  }
21013
21046
  };
21014
- const version = "3.1.10";
21047
+ const version = "3.1.11";
21015
21048
  function install(app) {
21016
21049
  const components = [
21017
21050
  ActionSheet,