zartui 3.1.16 → 3.1.17-beta.2

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.
package/lib/zartui.cjs.js CHANGED
@@ -3922,6 +3922,7 @@ var stdin_default$1v = vue.defineComponent({
3922
3922
  const root = vue.ref();
3923
3923
  const navRef = vue.ref();
3924
3924
  const wrapRef = vue.ref();
3925
+ const navTopRef = vue.ref();
3925
3926
  const id = useId();
3926
3927
  const scroller = use.useScrollParent(root);
3927
3928
  const [titleRefs, setTitleRefs] = useRefs();
@@ -3955,7 +3956,11 @@ var stdin_default$1v = vue.defineComponent({
3955
3956
  const offsetTopPx = vue.computed(() => unitToPx(props.offsetTop));
3956
3957
  const scrollOffset = vue.computed(() => {
3957
3958
  if (props.sticky) {
3958
- return offsetTopPx.value + tabHeight;
3959
+ let navTopHeight = 0;
3960
+ if (navTopRef.value) {
3961
+ navTopHeight = use.useRect(navTopRef.value).height;
3962
+ }
3963
+ return offsetTopPx.value + tabHeight + navTopHeight;
3959
3964
  }
3960
3965
  return 0;
3961
3966
  });
@@ -4222,7 +4227,7 @@ var stdin_default$1v = vue.defineComponent({
4222
4227
  scrollIntoView
4223
4228
  });
4224
4229
  return () => {
4225
- var _a;
4230
+ var _a, _b;
4226
4231
  return vue.createVNode("div", {
4227
4232
  "ref": root,
4228
4233
  "class": bem$15([props.type])
@@ -4232,10 +4237,12 @@ var stdin_default$1v = vue.defineComponent({
4232
4237
  "onScroll": onStickyScroll
4233
4238
  }, {
4234
4239
  default: () => {
4235
- var _a2;
4236
- return [renderHeader(), (_a2 = slots["nav-bottom"]) == null ? void 0 : _a2.call(slots)];
4240
+ var _a2, _b2;
4241
+ return [slots["nav-top"] ? vue.createVNode("div", {
4242
+ "ref": navTopRef
4243
+ }, [(_a2 = slots["nav-top"]) == null ? void 0 : _a2.call(slots)]) : null, renderHeader(), (_b2 = slots["nav-bottom"]) == null ? void 0 : _b2.call(slots)];
4237
4244
  }
4238
- }) : [renderHeader(), (_a = slots["nav-bottom"]) == null ? void 0 : _a.call(slots)], vue.createVNode(stdin_default$1w, {
4245
+ }) : [(_a = slots["nav-top"]) == null ? void 0 : _a.call(slots), renderHeader(), (_b = slots["nav-bottom"]) == null ? void 0 : _b.call(slots)], vue.createVNode(stdin_default$1w, {
4239
4246
  "count": children.length,
4240
4247
  "inited": state.inited,
4241
4248
  "animated": props.animated,
@@ -5666,6 +5673,7 @@ var stdin_default$1i = vue.defineComponent({
5666
5673
  toggle();
5667
5674
  };
5668
5675
  const renderTitle = () => {
5676
+ var _a;
5669
5677
  const {
5670
5678
  titleBackground,
5671
5679
  color
@@ -5679,7 +5687,7 @@ var stdin_default$1i = vue.defineComponent({
5679
5687
  custom: titleBackground
5680
5688
  }),
5681
5689
  "style": color ? `background:${color};` : ""
5682
- }, null), vue.createVNode("span", {
5690
+ }, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : vue.createVNode("span", {
5683
5691
  "style": color ? `color:${color};` : "",
5684
5692
  "class": bem$V("text", {
5685
5693
  custom: titleBackground
@@ -13983,6 +13991,7 @@ const FILE_SIZE_LIMIT = 100;
13983
13991
  const mediaPickerProps = {
13984
13992
  disabled: Boolean,
13985
13993
  showTitle: Boolean,
13994
+ useFileNameAsLabel: Boolean,
13986
13995
  title: makeStringProp("添加附件"),
13987
13996
  mediaList: makeArrayProp(),
13988
13997
  // 图片压缩后的最大边长
@@ -14033,7 +14042,8 @@ var stdin_default$A = vue.defineComponent({
14033
14042
  props: mediaPickerProps,
14034
14043
  emits: ["update:mediaList", "delete"],
14035
14044
  setup(props, {
14036
- emit
14045
+ emit,
14046
+ slots
14037
14047
  }) {
14038
14048
  const videoOptionsVisible = vue.ref(false);
14039
14049
  const audioOptionsVisible = vue.ref(false);
@@ -14317,6 +14327,11 @@ var stdin_default$A = vue.defineComponent({
14317
14327
  newMedias = newMedias.concat(medias);
14318
14328
  }
14319
14329
  }).finally(() => {
14330
+ if (props.useFileNameAsLabel) {
14331
+ newMedias.forEach((newMedia) => {
14332
+ newMedia.label = newMedia.originalName;
14333
+ });
14334
+ }
14320
14335
  emit("update:mediaList", [...props.mediaList, ...newMedias]);
14321
14336
  if (props.afterRead) {
14322
14337
  props.afterRead(newMedias);
@@ -14535,6 +14550,18 @@ var stdin_default$A = vue.defineComponent({
14535
14550
  }, null);
14536
14551
  }
14537
14552
  };
14553
+ const renderMediaLabel = (media) => {
14554
+ if (slots["preview-cover"]) {
14555
+ return slots["preview-cover"]({
14556
+ file: media
14557
+ });
14558
+ }
14559
+ if (!isEmptyValue(media.label)) {
14560
+ return vue.createVNode("div", {
14561
+ "class": bem$t("thumbnail-label")
14562
+ }, [media.label]);
14563
+ }
14564
+ };
14538
14565
  const onDelete = (media, index) => {
14539
14566
  if (props.beforeDelete) {
14540
14567
  const response = props.beforeDelete(media);
@@ -14588,7 +14615,7 @@ var stdin_default$A = vue.defineComponent({
14588
14615
  "key": media.uniqueCode,
14589
14616
  "onClick": () => previewMedia(index)
14590
14617
  }, {
14591
- default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
14618
+ default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
14592
14619
  });
14593
14620
  });
14594
14621
  const selectAction = (action) => {
@@ -20586,7 +20613,7 @@ const Lazyload = {
20586
20613
  });
20587
20614
  }
20588
20615
  };
20589
- const version = "3.1.15";
20616
+ const version = "3.1.16";
20590
20617
  function install(app) {
20591
20618
  const components = [
20592
20619
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -3920,6 +3920,7 @@ var stdin_default$1v = defineComponent({
3920
3920
  const root = ref();
3921
3921
  const navRef = ref();
3922
3922
  const wrapRef = ref();
3923
+ const navTopRef = ref();
3923
3924
  const id = useId();
3924
3925
  const scroller = useScrollParent(root);
3925
3926
  const [titleRefs, setTitleRefs] = useRefs();
@@ -3953,7 +3954,11 @@ var stdin_default$1v = defineComponent({
3953
3954
  const offsetTopPx = computed(() => unitToPx(props.offsetTop));
3954
3955
  const scrollOffset = computed(() => {
3955
3956
  if (props.sticky) {
3956
- return offsetTopPx.value + tabHeight;
3957
+ let navTopHeight = 0;
3958
+ if (navTopRef.value) {
3959
+ navTopHeight = useRect(navTopRef.value).height;
3960
+ }
3961
+ return offsetTopPx.value + tabHeight + navTopHeight;
3957
3962
  }
3958
3963
  return 0;
3959
3964
  });
@@ -4220,7 +4225,7 @@ var stdin_default$1v = defineComponent({
4220
4225
  scrollIntoView
4221
4226
  });
4222
4227
  return () => {
4223
- var _a;
4228
+ var _a, _b;
4224
4229
  return createVNode("div", {
4225
4230
  "ref": root,
4226
4231
  "class": bem$15([props.type])
@@ -4230,10 +4235,12 @@ var stdin_default$1v = defineComponent({
4230
4235
  "onScroll": onStickyScroll
4231
4236
  }, {
4232
4237
  default: () => {
4233
- var _a2;
4234
- return [renderHeader(), (_a2 = slots["nav-bottom"]) == null ? void 0 : _a2.call(slots)];
4238
+ var _a2, _b2;
4239
+ return [slots["nav-top"] ? createVNode("div", {
4240
+ "ref": navTopRef
4241
+ }, [(_a2 = slots["nav-top"]) == null ? void 0 : _a2.call(slots)]) : null, renderHeader(), (_b2 = slots["nav-bottom"]) == null ? void 0 : _b2.call(slots)];
4235
4242
  }
4236
- }) : [renderHeader(), (_a = slots["nav-bottom"]) == null ? void 0 : _a.call(slots)], createVNode(stdin_default$1w, {
4243
+ }) : [(_a = slots["nav-top"]) == null ? void 0 : _a.call(slots), renderHeader(), (_b = slots["nav-bottom"]) == null ? void 0 : _b.call(slots)], createVNode(stdin_default$1w, {
4237
4244
  "count": children.length,
4238
4245
  "inited": state.inited,
4239
4246
  "animated": props.animated,
@@ -5664,6 +5671,7 @@ var stdin_default$1i = defineComponent({
5664
5671
  toggle();
5665
5672
  };
5666
5673
  const renderTitle = () => {
5674
+ var _a;
5667
5675
  const {
5668
5676
  titleBackground,
5669
5677
  color
@@ -5677,7 +5685,7 @@ var stdin_default$1i = defineComponent({
5677
5685
  custom: titleBackground
5678
5686
  }),
5679
5687
  "style": color ? `background:${color};` : ""
5680
- }, null), createVNode("span", {
5688
+ }, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : createVNode("span", {
5681
5689
  "style": color ? `color:${color};` : "",
5682
5690
  "class": bem$V("text", {
5683
5691
  custom: titleBackground
@@ -13981,6 +13989,7 @@ const FILE_SIZE_LIMIT = 100;
13981
13989
  const mediaPickerProps = {
13982
13990
  disabled: Boolean,
13983
13991
  showTitle: Boolean,
13992
+ useFileNameAsLabel: Boolean,
13984
13993
  title: makeStringProp("添加附件"),
13985
13994
  mediaList: makeArrayProp(),
13986
13995
  // 图片压缩后的最大边长
@@ -14031,7 +14040,8 @@ var stdin_default$A = defineComponent({
14031
14040
  props: mediaPickerProps,
14032
14041
  emits: ["update:mediaList", "delete"],
14033
14042
  setup(props, {
14034
- emit
14043
+ emit,
14044
+ slots
14035
14045
  }) {
14036
14046
  const videoOptionsVisible = ref(false);
14037
14047
  const audioOptionsVisible = ref(false);
@@ -14315,6 +14325,11 @@ var stdin_default$A = defineComponent({
14315
14325
  newMedias = newMedias.concat(medias);
14316
14326
  }
14317
14327
  }).finally(() => {
14328
+ if (props.useFileNameAsLabel) {
14329
+ newMedias.forEach((newMedia) => {
14330
+ newMedia.label = newMedia.originalName;
14331
+ });
14332
+ }
14318
14333
  emit("update:mediaList", [...props.mediaList, ...newMedias]);
14319
14334
  if (props.afterRead) {
14320
14335
  props.afterRead(newMedias);
@@ -14533,6 +14548,18 @@ var stdin_default$A = defineComponent({
14533
14548
  }, null);
14534
14549
  }
14535
14550
  };
14551
+ const renderMediaLabel = (media) => {
14552
+ if (slots["preview-cover"]) {
14553
+ return slots["preview-cover"]({
14554
+ file: media
14555
+ });
14556
+ }
14557
+ if (!isEmptyValue(media.label)) {
14558
+ return createVNode("div", {
14559
+ "class": bem$t("thumbnail-label")
14560
+ }, [media.label]);
14561
+ }
14562
+ };
14536
14563
  const onDelete = (media, index) => {
14537
14564
  if (props.beforeDelete) {
14538
14565
  const response = props.beforeDelete(media);
@@ -14586,7 +14613,7 @@ var stdin_default$A = defineComponent({
14586
14613
  "key": media.uniqueCode,
14587
14614
  "onClick": () => previewMedia(index)
14588
14615
  }, {
14589
- default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
14616
+ default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
14590
14617
  });
14591
14618
  });
14592
14619
  const selectAction = (action) => {
@@ -20584,7 +20611,7 @@ const Lazyload = {
20584
20611
  });
20585
20612
  }
20586
20613
  };
20587
- const version = "3.1.15";
20614
+ const version = "3.1.16";
20588
20615
  function install(app) {
20589
20616
  const components = [
20590
20617
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -4189,6 +4189,7 @@
4189
4189
  const root = vue.ref();
4190
4190
  const navRef = vue.ref();
4191
4191
  const wrapRef = vue.ref();
4192
+ const navTopRef = vue.ref();
4192
4193
  const id = useId();
4193
4194
  const scroller = useScrollParent(root);
4194
4195
  const [titleRefs, setTitleRefs] = useRefs();
@@ -4222,7 +4223,11 @@
4222
4223
  const offsetTopPx = vue.computed(() => unitToPx(props.offsetTop));
4223
4224
  const scrollOffset = vue.computed(() => {
4224
4225
  if (props.sticky) {
4225
- return offsetTopPx.value + tabHeight;
4226
+ let navTopHeight = 0;
4227
+ if (navTopRef.value) {
4228
+ navTopHeight = useRect(navTopRef.value).height;
4229
+ }
4230
+ return offsetTopPx.value + tabHeight + navTopHeight;
4226
4231
  }
4227
4232
  return 0;
4228
4233
  });
@@ -4489,7 +4494,7 @@
4489
4494
  scrollIntoView
4490
4495
  });
4491
4496
  return () => {
4492
- var _a;
4497
+ var _a, _b;
4493
4498
  return vue.createVNode("div", {
4494
4499
  "ref": root,
4495
4500
  "class": bem$15([props.type])
@@ -4499,10 +4504,12 @@
4499
4504
  "onScroll": onStickyScroll
4500
4505
  }, {
4501
4506
  default: () => {
4502
- var _a2;
4503
- return [renderHeader(), (_a2 = slots["nav-bottom"]) == null ? void 0 : _a2.call(slots)];
4507
+ var _a2, _b2;
4508
+ return [slots["nav-top"] ? vue.createVNode("div", {
4509
+ "ref": navTopRef
4510
+ }, [(_a2 = slots["nav-top"]) == null ? void 0 : _a2.call(slots)]) : null, renderHeader(), (_b2 = slots["nav-bottom"]) == null ? void 0 : _b2.call(slots)];
4504
4511
  }
4505
- }) : [renderHeader(), (_a = slots["nav-bottom"]) == null ? void 0 : _a.call(slots)], vue.createVNode(stdin_default$1w, {
4512
+ }) : [(_a = slots["nav-top"]) == null ? void 0 : _a.call(slots), renderHeader(), (_b = slots["nav-bottom"]) == null ? void 0 : _b.call(slots)], vue.createVNode(stdin_default$1w, {
4506
4513
  "count": children.length,
4507
4514
  "inited": state.inited,
4508
4515
  "animated": props.animated,
@@ -5910,6 +5917,7 @@
5910
5917
  toggle();
5911
5918
  };
5912
5919
  const renderTitle = () => {
5920
+ var _a;
5913
5921
  const {
5914
5922
  titleBackground,
5915
5923
  color
@@ -5923,7 +5931,7 @@
5923
5931
  custom: titleBackground
5924
5932
  }),
5925
5933
  "style": color ? `background:${color};` : ""
5926
- }, null), vue.createVNode("span", {
5934
+ }, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : vue.createVNode("span", {
5927
5935
  "style": color ? `color:${color};` : "",
5928
5936
  "class": bem$V("text", {
5929
5937
  custom: titleBackground
@@ -14300,6 +14308,7 @@
14300
14308
  const mediaPickerProps = {
14301
14309
  disabled: Boolean,
14302
14310
  showTitle: Boolean,
14311
+ useFileNameAsLabel: Boolean,
14303
14312
  title: makeStringProp("添加附件"),
14304
14313
  mediaList: makeArrayProp(),
14305
14314
  // 图片压缩后的最大边长
@@ -14350,7 +14359,8 @@
14350
14359
  props: mediaPickerProps,
14351
14360
  emits: ["update:mediaList", "delete"],
14352
14361
  setup(props, {
14353
- emit
14362
+ emit,
14363
+ slots
14354
14364
  }) {
14355
14365
  const videoOptionsVisible = vue.ref(false);
14356
14366
  const audioOptionsVisible = vue.ref(false);
@@ -14634,6 +14644,11 @@
14634
14644
  newMedias = newMedias.concat(medias);
14635
14645
  }
14636
14646
  }).finally(() => {
14647
+ if (props.useFileNameAsLabel) {
14648
+ newMedias.forEach((newMedia) => {
14649
+ newMedia.label = newMedia.originalName;
14650
+ });
14651
+ }
14637
14652
  emit("update:mediaList", [...props.mediaList, ...newMedias]);
14638
14653
  if (props.afterRead) {
14639
14654
  props.afterRead(newMedias);
@@ -14852,6 +14867,18 @@
14852
14867
  }, null);
14853
14868
  }
14854
14869
  };
14870
+ const renderMediaLabel = (media) => {
14871
+ if (slots["preview-cover"]) {
14872
+ return slots["preview-cover"]({
14873
+ file: media
14874
+ });
14875
+ }
14876
+ if (!isEmptyValue(media.label)) {
14877
+ return vue.createVNode("div", {
14878
+ "class": bem$t("thumbnail-label")
14879
+ }, [media.label]);
14880
+ }
14881
+ };
14855
14882
  const onDelete = (media, index) => {
14856
14883
  if (props.beforeDelete) {
14857
14884
  const response = props.beforeDelete(media);
@@ -14905,7 +14932,7 @@
14905
14932
  "key": media.uniqueCode,
14906
14933
  "onClick": () => previewMedia(index)
14907
14934
  }, {
14908
- default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
14935
+ default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
14909
14936
  });
14910
14937
  });
14911
14938
  const selectAction = (action) => {
@@ -22204,7 +22231,7 @@
22204
22231
  });
22205
22232
  }
22206
22233
  };
22207
- const version = "3.1.15";
22234
+ const version = "3.1.16";
22208
22235
  function install(app) {
22209
22236
  const components = [
22210
22237
  ActionSheet,