zartui 3.1.15 → 3.1.17-beta.1
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/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/collapse-item/CollapseItem.mjs +2 -1
- package/es/date-time-picker/DateTimePicker.mjs +1 -1
- package/es/dropdown-item/types.d.ts +3 -3
- package/es/field/Field.d.ts +1 -1
- package/es/field/index.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/index.d.ts +55 -55
- package/es/media-picker/MediaPicker.d.ts +4 -0
- package/es/media-picker/MediaPicker.mjs +22 -2
- package/es/media-picker/index.css +1 -1
- package/es/media-picker/index.d.ts +3 -0
- package/es/media-picker/style/index.mjs +1 -0
- package/es/media-picker/type.d.ts +1 -0
- package/es/pull-refresh/PullRefresh.d.ts +5 -1
- package/es/pull-refresh/PullRefresh.mjs +15 -4
- package/es/pull-refresh/index.d.ts +2 -0
- package/es/style/base.css +1 -1
- package/es/style/css-variables.css +1 -1
- package/es/tabs/Tabs.mjs +12 -5
- package/es/utils/dom.d.ts +2 -0
- package/es/utils/dom.mjs +15 -0
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/collapse-item/CollapseItem.js +2 -1
- package/lib/date-time-picker/DateTimePicker.js +1 -1
- package/lib/dropdown-item/types.d.ts +3 -3
- package/lib/field/Field.d.ts +1 -1
- package/lib/field/index.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
- package/lib/media-picker/MediaPicker.d.ts +4 -0
- package/lib/media-picker/MediaPicker.js +22 -2
- package/lib/media-picker/index.css +1 -1
- package/lib/media-picker/index.d.ts +3 -0
- package/lib/media-picker/style/index.js +1 -0
- package/lib/media-picker/type.d.ts +1 -0
- package/lib/pull-refresh/PullRefresh.d.ts +5 -1
- package/lib/pull-refresh/PullRefresh.js +13 -2
- package/lib/pull-refresh/index.d.ts +2 -0
- package/lib/style/base.css +1 -1
- package/lib/style/css-variables.css +1 -1
- package/lib/tabs/Tabs.js +12 -5
- package/lib/utils/dom.d.ts +2 -0
- package/lib/utils/dom.js +15 -0
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +23 -23
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +64 -12
- package/lib/zartui.es.js +64 -12
- package/lib/zartui.js +64 -12
- package/lib/zartui.min.js +1 -1
- package/package.json +79 -79
package/lib/zartui.cjs.js
CHANGED
|
@@ -134,6 +134,20 @@ function colorFromCSSClass(className, defaultColor) {
|
|
|
134
134
|
document.body.removeChild(tmp);
|
|
135
135
|
return !classColor ? defaultColor : classColor;
|
|
136
136
|
}
|
|
137
|
+
const getTargetDom = (target) => {
|
|
138
|
+
if (target) {
|
|
139
|
+
if (typeof target === "string") {
|
|
140
|
+
return document.querySelectorAll(target)[0];
|
|
141
|
+
}
|
|
142
|
+
if (typeof target === "function") {
|
|
143
|
+
return target();
|
|
144
|
+
}
|
|
145
|
+
if (typeof target === "object" && target instanceof window.HTMLElement) {
|
|
146
|
+
return target;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return document.body;
|
|
150
|
+
};
|
|
137
151
|
const { width: windowWidth, height: windowHeight } = use.useWindowSize();
|
|
138
152
|
function addUnit(value) {
|
|
139
153
|
if (isDef(value)) {
|
|
@@ -3908,6 +3922,7 @@ var stdin_default$1v = vue.defineComponent({
|
|
|
3908
3922
|
const root = vue.ref();
|
|
3909
3923
|
const navRef = vue.ref();
|
|
3910
3924
|
const wrapRef = vue.ref();
|
|
3925
|
+
const navTopRef = vue.ref();
|
|
3911
3926
|
const id = useId();
|
|
3912
3927
|
const scroller = use.useScrollParent(root);
|
|
3913
3928
|
const [titleRefs, setTitleRefs] = useRefs();
|
|
@@ -3941,7 +3956,11 @@ var stdin_default$1v = vue.defineComponent({
|
|
|
3941
3956
|
const offsetTopPx = vue.computed(() => unitToPx(props.offsetTop));
|
|
3942
3957
|
const scrollOffset = vue.computed(() => {
|
|
3943
3958
|
if (props.sticky) {
|
|
3944
|
-
|
|
3959
|
+
let navTopHeight = 0;
|
|
3960
|
+
if (navTopRef.value) {
|
|
3961
|
+
navTopHeight = use.useRect(navTopRef.value).height;
|
|
3962
|
+
}
|
|
3963
|
+
return offsetTopPx.value + tabHeight + navTopHeight;
|
|
3945
3964
|
}
|
|
3946
3965
|
return 0;
|
|
3947
3966
|
});
|
|
@@ -4208,7 +4227,7 @@ var stdin_default$1v = vue.defineComponent({
|
|
|
4208
4227
|
scrollIntoView
|
|
4209
4228
|
});
|
|
4210
4229
|
return () => {
|
|
4211
|
-
var _a;
|
|
4230
|
+
var _a, _b;
|
|
4212
4231
|
return vue.createVNode("div", {
|
|
4213
4232
|
"ref": root,
|
|
4214
4233
|
"class": bem$15([props.type])
|
|
@@ -4218,10 +4237,12 @@ var stdin_default$1v = vue.defineComponent({
|
|
|
4218
4237
|
"onScroll": onStickyScroll
|
|
4219
4238
|
}, {
|
|
4220
4239
|
default: () => {
|
|
4221
|
-
var _a2;
|
|
4222
|
-
return [
|
|
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)];
|
|
4223
4244
|
}
|
|
4224
|
-
}) : [renderHeader(), (
|
|
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, {
|
|
4225
4246
|
"count": children.length,
|
|
4226
4247
|
"inited": state.inited,
|
|
4227
4248
|
"animated": props.animated,
|
|
@@ -5652,6 +5673,7 @@ var stdin_default$1i = vue.defineComponent({
|
|
|
5652
5673
|
toggle();
|
|
5653
5674
|
};
|
|
5654
5675
|
const renderTitle = () => {
|
|
5676
|
+
var _a;
|
|
5655
5677
|
const {
|
|
5656
5678
|
titleBackground,
|
|
5657
5679
|
color
|
|
@@ -5665,7 +5687,7 @@ var stdin_default$1i = vue.defineComponent({
|
|
|
5665
5687
|
custom: titleBackground
|
|
5666
5688
|
}),
|
|
5667
5689
|
"style": color ? `background:${color};` : ""
|
|
5668
|
-
}, null), vue.createVNode("span", {
|
|
5690
|
+
}, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : vue.createVNode("span", {
|
|
5669
5691
|
"style": color ? `color:${color};` : "",
|
|
5670
5692
|
"class": bem$V("text", {
|
|
5671
5693
|
custom: titleBackground
|
|
@@ -7193,7 +7215,7 @@ var stdin_default$17 = vue.defineComponent({
|
|
|
7193
7215
|
}
|
|
7194
7216
|
}
|
|
7195
7217
|
onClose();
|
|
7196
|
-
emit("confirm");
|
|
7218
|
+
emit("confirm", currentValue.value);
|
|
7197
7219
|
};
|
|
7198
7220
|
const onOpen = () => {
|
|
7199
7221
|
var _a, _b, _c;
|
|
@@ -13969,6 +13991,7 @@ const FILE_SIZE_LIMIT = 100;
|
|
|
13969
13991
|
const mediaPickerProps = {
|
|
13970
13992
|
disabled: Boolean,
|
|
13971
13993
|
showTitle: Boolean,
|
|
13994
|
+
useFileNameAsLabel: Boolean,
|
|
13972
13995
|
title: makeStringProp("添加附件"),
|
|
13973
13996
|
mediaList: makeArrayProp(),
|
|
13974
13997
|
// 图片压缩后的最大边长
|
|
@@ -14019,7 +14042,8 @@ var stdin_default$A = vue.defineComponent({
|
|
|
14019
14042
|
props: mediaPickerProps,
|
|
14020
14043
|
emits: ["update:mediaList", "delete"],
|
|
14021
14044
|
setup(props, {
|
|
14022
|
-
emit
|
|
14045
|
+
emit,
|
|
14046
|
+
slots
|
|
14023
14047
|
}) {
|
|
14024
14048
|
const videoOptionsVisible = vue.ref(false);
|
|
14025
14049
|
const audioOptionsVisible = vue.ref(false);
|
|
@@ -14303,6 +14327,11 @@ var stdin_default$A = vue.defineComponent({
|
|
|
14303
14327
|
newMedias = newMedias.concat(medias);
|
|
14304
14328
|
}
|
|
14305
14329
|
}).finally(() => {
|
|
14330
|
+
if (props.useFileNameAsLabel) {
|
|
14331
|
+
newMedias.forEach((newMedia) => {
|
|
14332
|
+
newMedia.label = newMedia.originalName;
|
|
14333
|
+
});
|
|
14334
|
+
}
|
|
14306
14335
|
emit("update:mediaList", [...props.mediaList, ...newMedias]);
|
|
14307
14336
|
if (props.afterRead) {
|
|
14308
14337
|
props.afterRead(newMedias);
|
|
@@ -14521,6 +14550,18 @@ var stdin_default$A = vue.defineComponent({
|
|
|
14521
14550
|
}, null);
|
|
14522
14551
|
}
|
|
14523
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
|
+
};
|
|
14524
14565
|
const onDelete = (media, index) => {
|
|
14525
14566
|
if (props.beforeDelete) {
|
|
14526
14567
|
const response = props.beforeDelete(media);
|
|
@@ -14574,7 +14615,7 @@ var stdin_default$A = vue.defineComponent({
|
|
|
14574
14615
|
"key": media.uniqueCode,
|
|
14575
14616
|
"onClick": () => previewMedia(index)
|
|
14576
14617
|
}, {
|
|
14577
|
-
default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
|
|
14618
|
+
default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
|
|
14578
14619
|
});
|
|
14579
14620
|
});
|
|
14580
14621
|
const selectAction = (action) => {
|
|
@@ -15925,7 +15966,8 @@ const pullRefreshProps = {
|
|
|
15925
15966
|
loadingText: String,
|
|
15926
15967
|
pullDistance: numericProp,
|
|
15927
15968
|
successDuration: makeNumericProp(500),
|
|
15928
|
-
animationDuration: makeNumericProp(300)
|
|
15969
|
+
animationDuration: makeNumericProp(300),
|
|
15970
|
+
scrollElement: null
|
|
15929
15971
|
};
|
|
15930
15972
|
var stdin_default$q = vue.defineComponent({
|
|
15931
15973
|
name: name$k,
|
|
@@ -15938,7 +15980,17 @@ var stdin_default$q = vue.defineComponent({
|
|
|
15938
15980
|
let reachTop;
|
|
15939
15981
|
const root = vue.ref();
|
|
15940
15982
|
const track = vue.ref();
|
|
15941
|
-
const
|
|
15983
|
+
const rootScrollElement = use.useScrollParent(root);
|
|
15984
|
+
const scrollParent = vue.computed(() => {
|
|
15985
|
+
if (props.scrollElement) {
|
|
15986
|
+
const targetDom = getTargetDom(props.scrollElement);
|
|
15987
|
+
if (!targetDom) {
|
|
15988
|
+
console.warn("请检查props scroll-element元素是否存在!");
|
|
15989
|
+
}
|
|
15990
|
+
return targetDom != null ? targetDom : rootScrollElement.value;
|
|
15991
|
+
}
|
|
15992
|
+
return rootScrollElement.value;
|
|
15993
|
+
});
|
|
15942
15994
|
const state = vue.reactive({
|
|
15943
15995
|
status: "normal",
|
|
15944
15996
|
distance: 0,
|
|
@@ -20561,7 +20613,7 @@ const Lazyload = {
|
|
|
20561
20613
|
});
|
|
20562
20614
|
}
|
|
20563
20615
|
};
|
|
20564
|
-
const version = "3.1.
|
|
20616
|
+
const version = "3.1.16";
|
|
20565
20617
|
function install(app) {
|
|
20566
20618
|
const components = [
|
|
20567
20619
|
ActionSheet,
|
package/lib/zartui.es.js
CHANGED
|
@@ -132,6 +132,20 @@ function colorFromCSSClass(className, defaultColor) {
|
|
|
132
132
|
document.body.removeChild(tmp);
|
|
133
133
|
return !classColor ? defaultColor : classColor;
|
|
134
134
|
}
|
|
135
|
+
const getTargetDom = (target) => {
|
|
136
|
+
if (target) {
|
|
137
|
+
if (typeof target === "string") {
|
|
138
|
+
return document.querySelectorAll(target)[0];
|
|
139
|
+
}
|
|
140
|
+
if (typeof target === "function") {
|
|
141
|
+
return target();
|
|
142
|
+
}
|
|
143
|
+
if (typeof target === "object" && target instanceof window.HTMLElement) {
|
|
144
|
+
return target;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return document.body;
|
|
148
|
+
};
|
|
135
149
|
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
136
150
|
function addUnit(value) {
|
|
137
151
|
if (isDef(value)) {
|
|
@@ -3906,6 +3920,7 @@ var stdin_default$1v = defineComponent({
|
|
|
3906
3920
|
const root = ref();
|
|
3907
3921
|
const navRef = ref();
|
|
3908
3922
|
const wrapRef = ref();
|
|
3923
|
+
const navTopRef = ref();
|
|
3909
3924
|
const id = useId();
|
|
3910
3925
|
const scroller = useScrollParent(root);
|
|
3911
3926
|
const [titleRefs, setTitleRefs] = useRefs();
|
|
@@ -3939,7 +3954,11 @@ var stdin_default$1v = defineComponent({
|
|
|
3939
3954
|
const offsetTopPx = computed(() => unitToPx(props.offsetTop));
|
|
3940
3955
|
const scrollOffset = computed(() => {
|
|
3941
3956
|
if (props.sticky) {
|
|
3942
|
-
|
|
3957
|
+
let navTopHeight = 0;
|
|
3958
|
+
if (navTopRef.value) {
|
|
3959
|
+
navTopHeight = useRect(navTopRef.value).height;
|
|
3960
|
+
}
|
|
3961
|
+
return offsetTopPx.value + tabHeight + navTopHeight;
|
|
3943
3962
|
}
|
|
3944
3963
|
return 0;
|
|
3945
3964
|
});
|
|
@@ -4206,7 +4225,7 @@ var stdin_default$1v = defineComponent({
|
|
|
4206
4225
|
scrollIntoView
|
|
4207
4226
|
});
|
|
4208
4227
|
return () => {
|
|
4209
|
-
var _a;
|
|
4228
|
+
var _a, _b;
|
|
4210
4229
|
return createVNode("div", {
|
|
4211
4230
|
"ref": root,
|
|
4212
4231
|
"class": bem$15([props.type])
|
|
@@ -4216,10 +4235,12 @@ var stdin_default$1v = defineComponent({
|
|
|
4216
4235
|
"onScroll": onStickyScroll
|
|
4217
4236
|
}, {
|
|
4218
4237
|
default: () => {
|
|
4219
|
-
var _a2;
|
|
4220
|
-
return [
|
|
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)];
|
|
4221
4242
|
}
|
|
4222
|
-
}) : [renderHeader(), (
|
|
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, {
|
|
4223
4244
|
"count": children.length,
|
|
4224
4245
|
"inited": state.inited,
|
|
4225
4246
|
"animated": props.animated,
|
|
@@ -5650,6 +5671,7 @@ var stdin_default$1i = defineComponent({
|
|
|
5650
5671
|
toggle();
|
|
5651
5672
|
};
|
|
5652
5673
|
const renderTitle = () => {
|
|
5674
|
+
var _a;
|
|
5653
5675
|
const {
|
|
5654
5676
|
titleBackground,
|
|
5655
5677
|
color
|
|
@@ -5663,7 +5685,7 @@ var stdin_default$1i = defineComponent({
|
|
|
5663
5685
|
custom: titleBackground
|
|
5664
5686
|
}),
|
|
5665
5687
|
"style": color ? `background:${color};` : ""
|
|
5666
|
-
}, null), createVNode("span", {
|
|
5688
|
+
}, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : createVNode("span", {
|
|
5667
5689
|
"style": color ? `color:${color};` : "",
|
|
5668
5690
|
"class": bem$V("text", {
|
|
5669
5691
|
custom: titleBackground
|
|
@@ -7191,7 +7213,7 @@ var stdin_default$17 = defineComponent({
|
|
|
7191
7213
|
}
|
|
7192
7214
|
}
|
|
7193
7215
|
onClose();
|
|
7194
|
-
emit("confirm");
|
|
7216
|
+
emit("confirm", currentValue.value);
|
|
7195
7217
|
};
|
|
7196
7218
|
const onOpen = () => {
|
|
7197
7219
|
var _a, _b, _c;
|
|
@@ -13967,6 +13989,7 @@ const FILE_SIZE_LIMIT = 100;
|
|
|
13967
13989
|
const mediaPickerProps = {
|
|
13968
13990
|
disabled: Boolean,
|
|
13969
13991
|
showTitle: Boolean,
|
|
13992
|
+
useFileNameAsLabel: Boolean,
|
|
13970
13993
|
title: makeStringProp("添加附件"),
|
|
13971
13994
|
mediaList: makeArrayProp(),
|
|
13972
13995
|
// 图片压缩后的最大边长
|
|
@@ -14017,7 +14040,8 @@ var stdin_default$A = defineComponent({
|
|
|
14017
14040
|
props: mediaPickerProps,
|
|
14018
14041
|
emits: ["update:mediaList", "delete"],
|
|
14019
14042
|
setup(props, {
|
|
14020
|
-
emit
|
|
14043
|
+
emit,
|
|
14044
|
+
slots
|
|
14021
14045
|
}) {
|
|
14022
14046
|
const videoOptionsVisible = ref(false);
|
|
14023
14047
|
const audioOptionsVisible = ref(false);
|
|
@@ -14301,6 +14325,11 @@ var stdin_default$A = defineComponent({
|
|
|
14301
14325
|
newMedias = newMedias.concat(medias);
|
|
14302
14326
|
}
|
|
14303
14327
|
}).finally(() => {
|
|
14328
|
+
if (props.useFileNameAsLabel) {
|
|
14329
|
+
newMedias.forEach((newMedia) => {
|
|
14330
|
+
newMedia.label = newMedia.originalName;
|
|
14331
|
+
});
|
|
14332
|
+
}
|
|
14304
14333
|
emit("update:mediaList", [...props.mediaList, ...newMedias]);
|
|
14305
14334
|
if (props.afterRead) {
|
|
14306
14335
|
props.afterRead(newMedias);
|
|
@@ -14519,6 +14548,18 @@ var stdin_default$A = defineComponent({
|
|
|
14519
14548
|
}, null);
|
|
14520
14549
|
}
|
|
14521
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
|
+
};
|
|
14522
14563
|
const onDelete = (media, index) => {
|
|
14523
14564
|
if (props.beforeDelete) {
|
|
14524
14565
|
const response = props.beforeDelete(media);
|
|
@@ -14572,7 +14613,7 @@ var stdin_default$A = defineComponent({
|
|
|
14572
14613
|
"key": media.uniqueCode,
|
|
14573
14614
|
"onClick": () => previewMedia(index)
|
|
14574
14615
|
}, {
|
|
14575
|
-
default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
|
|
14616
|
+
default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
|
|
14576
14617
|
});
|
|
14577
14618
|
});
|
|
14578
14619
|
const selectAction = (action) => {
|
|
@@ -15923,7 +15964,8 @@ const pullRefreshProps = {
|
|
|
15923
15964
|
loadingText: String,
|
|
15924
15965
|
pullDistance: numericProp,
|
|
15925
15966
|
successDuration: makeNumericProp(500),
|
|
15926
|
-
animationDuration: makeNumericProp(300)
|
|
15967
|
+
animationDuration: makeNumericProp(300),
|
|
15968
|
+
scrollElement: null
|
|
15927
15969
|
};
|
|
15928
15970
|
var stdin_default$q = defineComponent({
|
|
15929
15971
|
name: name$k,
|
|
@@ -15936,7 +15978,17 @@ var stdin_default$q = defineComponent({
|
|
|
15936
15978
|
let reachTop;
|
|
15937
15979
|
const root = ref();
|
|
15938
15980
|
const track = ref();
|
|
15939
|
-
const
|
|
15981
|
+
const rootScrollElement = useScrollParent(root);
|
|
15982
|
+
const scrollParent = computed(() => {
|
|
15983
|
+
if (props.scrollElement) {
|
|
15984
|
+
const targetDom = getTargetDom(props.scrollElement);
|
|
15985
|
+
if (!targetDom) {
|
|
15986
|
+
console.warn("请检查props scroll-element元素是否存在!");
|
|
15987
|
+
}
|
|
15988
|
+
return targetDom != null ? targetDom : rootScrollElement.value;
|
|
15989
|
+
}
|
|
15990
|
+
return rootScrollElement.value;
|
|
15991
|
+
});
|
|
15940
15992
|
const state = reactive({
|
|
15941
15993
|
status: "normal",
|
|
15942
15994
|
distance: 0,
|
|
@@ -20559,7 +20611,7 @@ const Lazyload = {
|
|
|
20559
20611
|
});
|
|
20560
20612
|
}
|
|
20561
20613
|
};
|
|
20562
|
-
const version = "3.1.
|
|
20614
|
+
const version = "3.1.16";
|
|
20563
20615
|
function install(app) {
|
|
20564
20616
|
const components = [
|
|
20565
20617
|
ActionSheet,
|
package/lib/zartui.js
CHANGED
|
@@ -404,6 +404,20 @@
|
|
|
404
404
|
document.body.removeChild(tmp);
|
|
405
405
|
return !classColor ? defaultColor : classColor;
|
|
406
406
|
}
|
|
407
|
+
const getTargetDom = (target) => {
|
|
408
|
+
if (target) {
|
|
409
|
+
if (typeof target === "string") {
|
|
410
|
+
return document.querySelectorAll(target)[0];
|
|
411
|
+
}
|
|
412
|
+
if (typeof target === "function") {
|
|
413
|
+
return target();
|
|
414
|
+
}
|
|
415
|
+
if (typeof target === "object" && target instanceof window.HTMLElement) {
|
|
416
|
+
return target;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return document.body;
|
|
420
|
+
};
|
|
407
421
|
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
408
422
|
function addUnit(value) {
|
|
409
423
|
if (isDef(value)) {
|
|
@@ -4175,6 +4189,7 @@
|
|
|
4175
4189
|
const root = vue.ref();
|
|
4176
4190
|
const navRef = vue.ref();
|
|
4177
4191
|
const wrapRef = vue.ref();
|
|
4192
|
+
const navTopRef = vue.ref();
|
|
4178
4193
|
const id = useId();
|
|
4179
4194
|
const scroller = useScrollParent(root);
|
|
4180
4195
|
const [titleRefs, setTitleRefs] = useRefs();
|
|
@@ -4208,7 +4223,11 @@
|
|
|
4208
4223
|
const offsetTopPx = vue.computed(() => unitToPx(props.offsetTop));
|
|
4209
4224
|
const scrollOffset = vue.computed(() => {
|
|
4210
4225
|
if (props.sticky) {
|
|
4211
|
-
|
|
4226
|
+
let navTopHeight = 0;
|
|
4227
|
+
if (navTopRef.value) {
|
|
4228
|
+
navTopHeight = useRect(navTopRef.value).height;
|
|
4229
|
+
}
|
|
4230
|
+
return offsetTopPx.value + tabHeight + navTopHeight;
|
|
4212
4231
|
}
|
|
4213
4232
|
return 0;
|
|
4214
4233
|
});
|
|
@@ -4475,7 +4494,7 @@
|
|
|
4475
4494
|
scrollIntoView
|
|
4476
4495
|
});
|
|
4477
4496
|
return () => {
|
|
4478
|
-
var _a;
|
|
4497
|
+
var _a, _b;
|
|
4479
4498
|
return vue.createVNode("div", {
|
|
4480
4499
|
"ref": root,
|
|
4481
4500
|
"class": bem$15([props.type])
|
|
@@ -4485,10 +4504,12 @@
|
|
|
4485
4504
|
"onScroll": onStickyScroll
|
|
4486
4505
|
}, {
|
|
4487
4506
|
default: () => {
|
|
4488
|
-
var _a2;
|
|
4489
|
-
return [
|
|
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)];
|
|
4490
4511
|
}
|
|
4491
|
-
}) : [renderHeader(), (
|
|
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, {
|
|
4492
4513
|
"count": children.length,
|
|
4493
4514
|
"inited": state.inited,
|
|
4494
4515
|
"animated": props.animated,
|
|
@@ -5896,6 +5917,7 @@
|
|
|
5896
5917
|
toggle();
|
|
5897
5918
|
};
|
|
5898
5919
|
const renderTitle = () => {
|
|
5920
|
+
var _a;
|
|
5899
5921
|
const {
|
|
5900
5922
|
titleBackground,
|
|
5901
5923
|
color
|
|
@@ -5909,7 +5931,7 @@
|
|
|
5909
5931
|
custom: titleBackground
|
|
5910
5932
|
}),
|
|
5911
5933
|
"style": color ? `background:${color};` : ""
|
|
5912
|
-
}, null), vue.createVNode("span", {
|
|
5934
|
+
}, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : vue.createVNode("span", {
|
|
5913
5935
|
"style": color ? `color:${color};` : "",
|
|
5914
5936
|
"class": bem$V("text", {
|
|
5915
5937
|
custom: titleBackground
|
|
@@ -7437,7 +7459,7 @@
|
|
|
7437
7459
|
}
|
|
7438
7460
|
}
|
|
7439
7461
|
onClose();
|
|
7440
|
-
emit("confirm");
|
|
7462
|
+
emit("confirm", currentValue.value);
|
|
7441
7463
|
};
|
|
7442
7464
|
const onOpen = () => {
|
|
7443
7465
|
var _a, _b, _c;
|
|
@@ -14286,6 +14308,7 @@
|
|
|
14286
14308
|
const mediaPickerProps = {
|
|
14287
14309
|
disabled: Boolean,
|
|
14288
14310
|
showTitle: Boolean,
|
|
14311
|
+
useFileNameAsLabel: Boolean,
|
|
14289
14312
|
title: makeStringProp("添加附件"),
|
|
14290
14313
|
mediaList: makeArrayProp(),
|
|
14291
14314
|
// 图片压缩后的最大边长
|
|
@@ -14336,7 +14359,8 @@
|
|
|
14336
14359
|
props: mediaPickerProps,
|
|
14337
14360
|
emits: ["update:mediaList", "delete"],
|
|
14338
14361
|
setup(props, {
|
|
14339
|
-
emit
|
|
14362
|
+
emit,
|
|
14363
|
+
slots
|
|
14340
14364
|
}) {
|
|
14341
14365
|
const videoOptionsVisible = vue.ref(false);
|
|
14342
14366
|
const audioOptionsVisible = vue.ref(false);
|
|
@@ -14620,6 +14644,11 @@
|
|
|
14620
14644
|
newMedias = newMedias.concat(medias);
|
|
14621
14645
|
}
|
|
14622
14646
|
}).finally(() => {
|
|
14647
|
+
if (props.useFileNameAsLabel) {
|
|
14648
|
+
newMedias.forEach((newMedia) => {
|
|
14649
|
+
newMedia.label = newMedia.originalName;
|
|
14650
|
+
});
|
|
14651
|
+
}
|
|
14623
14652
|
emit("update:mediaList", [...props.mediaList, ...newMedias]);
|
|
14624
14653
|
if (props.afterRead) {
|
|
14625
14654
|
props.afterRead(newMedias);
|
|
@@ -14838,6 +14867,18 @@
|
|
|
14838
14867
|
}, null);
|
|
14839
14868
|
}
|
|
14840
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
|
+
};
|
|
14841
14882
|
const onDelete = (media, index) => {
|
|
14842
14883
|
if (props.beforeDelete) {
|
|
14843
14884
|
const response = props.beforeDelete(media);
|
|
@@ -14891,7 +14932,7 @@
|
|
|
14891
14932
|
"key": media.uniqueCode,
|
|
14892
14933
|
"onClick": () => previewMedia(index)
|
|
14893
14934
|
}, {
|
|
14894
|
-
default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
|
|
14935
|
+
default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
|
|
14895
14936
|
});
|
|
14896
14937
|
});
|
|
14897
14938
|
const selectAction = (action) => {
|
|
@@ -17566,7 +17607,8 @@
|
|
|
17566
17607
|
loadingText: String,
|
|
17567
17608
|
pullDistance: numericProp,
|
|
17568
17609
|
successDuration: makeNumericProp(500),
|
|
17569
|
-
animationDuration: makeNumericProp(300)
|
|
17610
|
+
animationDuration: makeNumericProp(300),
|
|
17611
|
+
scrollElement: null
|
|
17570
17612
|
};
|
|
17571
17613
|
var stdin_default$q = vue.defineComponent({
|
|
17572
17614
|
name: name$k,
|
|
@@ -17579,7 +17621,17 @@
|
|
|
17579
17621
|
let reachTop;
|
|
17580
17622
|
const root = vue.ref();
|
|
17581
17623
|
const track = vue.ref();
|
|
17582
|
-
const
|
|
17624
|
+
const rootScrollElement = useScrollParent(root);
|
|
17625
|
+
const scrollParent = vue.computed(() => {
|
|
17626
|
+
if (props.scrollElement) {
|
|
17627
|
+
const targetDom = getTargetDom(props.scrollElement);
|
|
17628
|
+
if (!targetDom) {
|
|
17629
|
+
console.warn("请检查props scroll-element元素是否存在!");
|
|
17630
|
+
}
|
|
17631
|
+
return targetDom != null ? targetDom : rootScrollElement.value;
|
|
17632
|
+
}
|
|
17633
|
+
return rootScrollElement.value;
|
|
17634
|
+
});
|
|
17583
17635
|
const state = vue.reactive({
|
|
17584
17636
|
status: "normal",
|
|
17585
17637
|
distance: 0,
|
|
@@ -22179,7 +22231,7 @@
|
|
|
22179
22231
|
});
|
|
22180
22232
|
}
|
|
22181
22233
|
};
|
|
22182
|
-
const version = "3.1.
|
|
22234
|
+
const version = "3.1.16";
|
|
22183
22235
|
function install(app) {
|
|
22184
22236
|
const components = [
|
|
22185
22237
|
ActionSheet,
|