zartui 3.1.7-beta.3 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/es/action-sheet/ActionSheet.d.ts +2 -2
- package/es/action-sheet/index.d.ts +2 -2
- package/es/button/Button.d.ts +3 -3
- package/es/button/index.d.ts +3 -3
- package/es/calendar/Calendar.d.ts +2 -2
- package/es/calendar/index.d.ts +2 -2
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.d.ts +1 -1
- package/es/cell/Cell.d.ts +2 -2
- package/es/cell/index.d.ts +2 -2
- package/es/cell-group/CellGroup.d.ts +1 -1
- package/es/cell-group/CellGroup.mjs +2 -1
- package/es/cell-group/index.d.ts +1 -1
- package/es/checkbox/Checkbox.d.ts +26 -12
- package/es/checkbox/Checkbox.mjs +13 -2
- package/es/checkbox/Checker.d.ts +9 -0
- package/es/checkbox/Checker.mjs +10 -10
- package/es/checkbox/index.css +1 -1
- package/es/checkbox/index.d.ts +9 -0
- package/es/composables/use-global-z-index.d.ts +4 -0
- package/es/composables/use-global-z-index.mjs +9 -0
- package/es/composables/use-scope-id.d.ts +3 -0
- package/es/composables/use-scope-id.mjs +9 -0
- package/es/composables/use-sync-prop-ref.d.ts +2 -0
- package/es/composables/use-sync-prop-ref.mjs +18 -0
- package/es/config-provider/ConfigProvider.d.ts +30 -6
- package/es/config-provider/ConfigProvider.mjs +48 -9
- package/es/config-provider/index.d.ts +17 -2
- package/es/date-time-picker/DateTimePicker.d.ts +2 -2
- package/es/date-time-picker/DateTimePickerWrapper.d.ts +2 -2
- package/es/date-time-picker/index.d.ts +2 -2
- package/es/dialog/Dialog.d.ts +1 -1
- package/es/dialog/function-call.d.ts +3 -3
- package/es/dialog/function-call.mjs +1 -1
- package/es/dialog/index.d.ts +1 -1
- package/es/divider/Divider.d.ts +1 -1
- package/es/divider/index.d.ts +1 -1
- package/es/dropdown-item/DropdownItem.mjs +2 -2
- package/es/dropdown-item/types.d.ts +2 -1
- package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/es/dropdown-menu/index.d.ts +1 -1
- package/es/field/Field.d.ts +3 -3
- package/es/field/index.d.ts +3 -3
- package/es/grid/Grid.d.ts +1 -1
- package/es/grid/index.d.ts +1 -1
- package/es/icon/config.mjs +34 -11
- package/es/icon/index.css +1 -1
- package/es/image/Image.d.ts +1 -1
- package/es/image/index.d.ts +1 -1
- package/es/image-preview/ImagePreview.d.ts +17 -1
- package/es/image-preview/ImagePreview.mjs +17 -4
- package/es/image-preview/ImagePreviewItem.d.ts +6 -0
- package/es/image-preview/ImagePreviewItem.mjs +9 -3
- package/es/image-preview/function-call.mjs +1 -0
- package/es/image-preview/index.d.ts +12 -1
- package/es/image-preview/types.d.ts +1 -0
- 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/list/List.d.ts +7 -3
- package/es/list/List.mjs +5 -3
- package/es/list/index.d.ts +2 -0
- package/es/nav-bar/NavBar.d.ts +1 -1
- package/es/nav-bar/index.d.ts +1 -1
- package/es/notify/Notify.d.ts +1 -1
- package/es/notify/index.d.ts +1 -1
- package/es/number-keyboard/NumberKeyboard.d.ts +3 -3
- package/es/number-keyboard/NumberKeyboardKey.d.ts +1 -1
- package/es/number-keyboard/index.d.ts +3 -3
- package/es/popover/Popover.d.ts +1 -1
- package/es/popover/Popover.mjs +16 -12
- package/es/popover/index.d.ts +1 -1
- package/es/popup/Popup.d.ts +2 -2
- package/es/popup/Popup.mjs +9 -10
- package/es/popup/index.d.ts +2 -2
- package/es/search/Search.d.ts +1 -1
- package/es/search/index.d.ts +1 -1
- package/es/skeleton/Skeleton.d.ts +2 -2
- package/es/skeleton/index.d.ts +2 -2
- package/es/stepper/Stepper.d.ts +2 -2
- package/es/stepper/index.d.ts +2 -2
- package/es/steps/Steps.d.ts +1 -1
- package/es/steps/index.d.ts +1 -1
- package/es/sticky/Sticky.d.ts +1 -1
- package/es/sticky/index.d.ts +1 -1
- package/es/swipe/Swipe.mjs +1 -1
- package/es/swipe/index.css +1 -1
- package/es/swipe-cell/SwipeCell.mjs +10 -1
- package/es/tabs/Tabs.d.ts +4 -4
- package/es/tabs/index.d.ts +4 -4
- package/es/tag/Tag.d.ts +1 -1
- package/es/tag/index.d.ts +1 -1
- package/es/text-ellipsis/TextEllipsis.d.ts +17 -4
- package/es/text-ellipsis/TextEllipsis.mjs +52 -30
- package/es/text-ellipsis/index.d.ts +12 -3
- package/es/toast/Toast.d.ts +5 -2
- package/es/toast/Toast.mjs +2 -1
- package/es/toast/index.css +1 -1
- package/es/toast/index.d.ts +4 -2
- package/es/toast/types.d.ts +2 -0
- package/es/uploader/Uploader.d.ts +1 -1
- package/es/uploader/index.d.ts +1 -1
- package/es/utils/interceptor.d.ts +2 -1
- package/es/utils/interceptor.mjs +3 -2
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- package/lib/action-sheet/ActionSheet.d.ts +2 -2
- package/lib/action-sheet/index.d.ts +2 -2
- package/lib/button/Button.d.ts +3 -3
- package/lib/button/index.d.ts +3 -3
- package/lib/calendar/Calendar.d.ts +2 -2
- package/lib/calendar/index.d.ts +2 -2
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cell/Cell.d.ts +2 -2
- package/lib/cell/index.d.ts +2 -2
- package/lib/cell-group/CellGroup.d.ts +1 -1
- package/lib/cell-group/CellGroup.js +2 -1
- package/lib/cell-group/index.d.ts +1 -1
- package/lib/checkbox/Checkbox.d.ts +26 -12
- package/lib/checkbox/Checkbox.js +13 -2
- package/lib/checkbox/Checker.d.ts +9 -0
- package/lib/checkbox/Checker.js +10 -10
- package/lib/checkbox/index.css +1 -1
- package/lib/checkbox/index.d.ts +9 -0
- package/lib/composables/use-global-z-index.d.ts +4 -0
- package/lib/composables/use-global-z-index.js +28 -0
- package/lib/composables/use-scope-id.d.ts +3 -0
- package/lib/composables/use-scope-id.js +28 -0
- package/lib/composables/use-sync-prop-ref.d.ts +2 -0
- package/lib/composables/use-sync-prop-ref.js +37 -0
- package/lib/config-provider/ConfigProvider.d.ts +30 -6
- package/lib/config-provider/ConfigProvider.js +46 -7
- package/lib/config-provider/index.d.ts +17 -2
- package/lib/date-time-picker/DateTimePicker.d.ts +2 -2
- package/lib/date-time-picker/DateTimePickerWrapper.d.ts +2 -2
- package/lib/date-time-picker/index.d.ts +2 -2
- package/lib/dialog/Dialog.d.ts +1 -1
- package/lib/dialog/function-call.d.ts +3 -3
- package/lib/dialog/function-call.js +1 -1
- package/lib/dialog/index.d.ts +1 -1
- package/lib/divider/Divider.d.ts +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/dropdown-item/DropdownItem.js +2 -2
- package/lib/dropdown-item/types.d.ts +2 -1
- package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/lib/dropdown-menu/index.d.ts +1 -1
- package/lib/field/Field.d.ts +3 -3
- package/lib/field/index.d.ts +3 -3
- package/lib/grid/Grid.d.ts +1 -1
- package/lib/grid/index.d.ts +1 -1
- package/lib/icon/config.js +34 -11
- package/lib/icon/index.css +1 -1
- package/lib/image/Image.d.ts +1 -1
- package/lib/image/index.d.ts +1 -1
- package/lib/image-preview/ImagePreview.d.ts +17 -1
- package/lib/image-preview/ImagePreview.js +17 -4
- package/lib/image-preview/ImagePreviewItem.d.ts +6 -0
- package/lib/image-preview/ImagePreviewItem.js +9 -3
- package/lib/image-preview/function-call.js +1 -0
- package/lib/image-preview/index.d.ts +12 -1
- package/lib/image-preview/types.d.ts +1 -0
- 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/list/List.d.ts +7 -3
- package/lib/list/List.js +4 -2
- package/lib/list/index.d.ts +2 -0
- package/lib/nav-bar/NavBar.d.ts +1 -1
- package/lib/nav-bar/index.d.ts +1 -1
- package/lib/notify/Notify.d.ts +1 -1
- package/lib/notify/index.d.ts +1 -1
- package/lib/number-keyboard/NumberKeyboard.d.ts +3 -3
- package/lib/number-keyboard/NumberKeyboardKey.d.ts +1 -1
- package/lib/number-keyboard/index.d.ts +3 -3
- package/lib/popover/Popover.d.ts +1 -1
- package/lib/popover/Popover.js +16 -12
- package/lib/popover/index.d.ts +1 -1
- package/lib/popup/Popup.d.ts +2 -2
- package/lib/popup/Popup.js +8 -9
- package/lib/popup/index.d.ts +2 -2
- package/lib/search/Search.d.ts +1 -1
- package/lib/search/index.d.ts +1 -1
- package/lib/skeleton/Skeleton.d.ts +2 -2
- package/lib/skeleton/index.d.ts +2 -2
- package/lib/stepper/Stepper.d.ts +2 -2
- package/lib/stepper/index.d.ts +2 -2
- package/lib/steps/Steps.d.ts +1 -1
- package/lib/steps/index.d.ts +1 -1
- package/lib/sticky/Sticky.d.ts +1 -1
- package/lib/sticky/index.d.ts +1 -1
- package/lib/swipe/Swipe.js +1 -1
- package/lib/swipe/index.css +1 -1
- package/lib/swipe-cell/SwipeCell.js +10 -1
- package/lib/tabs/Tabs.d.ts +4 -4
- package/lib/tabs/index.d.ts +4 -4
- package/lib/tag/Tag.d.ts +1 -1
- package/lib/tag/index.d.ts +1 -1
- package/lib/text-ellipsis/TextEllipsis.d.ts +17 -4
- package/lib/text-ellipsis/TextEllipsis.js +51 -29
- package/lib/text-ellipsis/index.d.ts +12 -3
- package/lib/toast/Toast.d.ts +5 -2
- package/lib/toast/Toast.js +2 -1
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.d.ts +4 -2
- package/lib/toast/types.d.ts +2 -0
- package/lib/uploader/Uploader.d.ts +1 -1
- package/lib/uploader/index.d.ts +1 -1
- package/lib/utils/interceptor.d.ts +2 -1
- package/lib/utils/interceptor.js +3 -2
- 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 +214 -88
- package/lib/zartui.es.js +215 -89
- package/lib/zartui.js +214 -88
- package/lib/zartui.min.js +1 -1
- package/package.json +18 -9
package/lib/zartui.js
CHANGED
|
@@ -639,7 +639,8 @@
|
|
|
639
639
|
function callInterceptor(interceptor, {
|
|
640
640
|
args = [],
|
|
641
641
|
done,
|
|
642
|
-
canceled
|
|
642
|
+
canceled,
|
|
643
|
+
error
|
|
643
644
|
}) {
|
|
644
645
|
if (interceptor) {
|
|
645
646
|
const returnVal = interceptor.apply(null, args);
|
|
@@ -650,7 +651,7 @@
|
|
|
650
651
|
} else if (canceled) {
|
|
651
652
|
canceled();
|
|
652
653
|
}
|
|
653
|
-
}).catch(noop);
|
|
654
|
+
}).catch(error || noop);
|
|
654
655
|
} else if (returnVal) {
|
|
655
656
|
done();
|
|
656
657
|
} else if (canceled) {
|
|
@@ -767,32 +768,53 @@
|
|
|
767
768
|
}
|
|
768
769
|
});
|
|
769
770
|
const Badge = withInstall(stdin_default$1P);
|
|
771
|
+
let globalZIndex = 2e3;
|
|
772
|
+
const useGlobalZIndex = () => ++globalZIndex;
|
|
773
|
+
const setGlobalZIndex = (val) => {
|
|
774
|
+
globalZIndex = val;
|
|
775
|
+
};
|
|
770
776
|
const [name$1k, bem$1g] = createNamespace("config-provider");
|
|
771
777
|
const CONFIG_PROVIDER_KEY = Symbol(name$1k);
|
|
772
778
|
const configProviderProps = {
|
|
773
779
|
tag: makeStringProp("div"),
|
|
774
780
|
theme: makeStringProp("light"),
|
|
781
|
+
zIndex: Number,
|
|
775
782
|
themeVars: Object,
|
|
783
|
+
themeVarsDark: Object,
|
|
784
|
+
themeVarsLight: Object,
|
|
785
|
+
themeVarsScope: makeStringProp("local"),
|
|
776
786
|
iconPrefix: String
|
|
777
787
|
};
|
|
788
|
+
function insertDash(str) {
|
|
789
|
+
return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
|
|
790
|
+
}
|
|
778
791
|
function mapThemeVarsToCSSVars(themeVars) {
|
|
779
792
|
const cssVars = {};
|
|
780
793
|
Object.keys(themeVars).forEach((key) => {
|
|
781
|
-
|
|
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 =
|
|
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) =>
|
|
5369
|
+
vue.watch(() => props.modelValue, (value) => {
|
|
5370
|
+
if (props.indeterminate === null) {
|
|
5371
|
+
emit("change", value);
|
|
5372
|
+
}
|
|
5373
|
+
});
|
|
5317
5374
|
useExpose({
|
|
5318
5375
|
toggle,
|
|
5319
5376
|
props,
|
|
@@ -7407,7 +7464,7 @@
|
|
|
7407
7464
|
}
|
|
7408
7465
|
function showDialog(options) {
|
|
7409
7466
|
if (!inBrowser$1) {
|
|
7410
|
-
return Promise.resolve();
|
|
7467
|
+
return Promise.resolve(void 0);
|
|
7411
7468
|
}
|
|
7412
7469
|
return new Promise((resolve, reject) => {
|
|
7413
7470
|
if (!instance$2) {
|
|
@@ -7720,7 +7777,7 @@
|
|
|
7720
7777
|
if (props.multiSelect) {
|
|
7721
7778
|
return vue.createVNode(Cell, {
|
|
7722
7779
|
"role": "menuitem",
|
|
7723
|
-
"key": option.value,
|
|
7780
|
+
"key": String(option.value),
|
|
7724
7781
|
"title-icon": option.icon,
|
|
7725
7782
|
"title": option.text,
|
|
7726
7783
|
"direction": "horizontal",
|
|
@@ -7739,7 +7796,7 @@
|
|
|
7739
7796
|
}
|
|
7740
7797
|
return vue.createVNode(Cell, {
|
|
7741
7798
|
"role": "menuitem",
|
|
7742
|
-
"key": option.value,
|
|
7799
|
+
"key": String(option.value),
|
|
7743
7800
|
"title-icon": option.icon,
|
|
7744
7801
|
"title": option.text,
|
|
7745
7802
|
"direction": "horizontal",
|
|
@@ -10080,7 +10137,9 @@
|
|
|
10080
10137
|
minZoom: makeRequiredProp(numericProp),
|
|
10081
10138
|
maxZoom: makeRequiredProp(numericProp),
|
|
10082
10139
|
rootWidth: makeRequiredProp(Number),
|
|
10083
|
-
rootHeight: makeRequiredProp(Number)
|
|
10140
|
+
rootHeight: makeRequiredProp(Number),
|
|
10141
|
+
disableZoom: Boolean,
|
|
10142
|
+
closeOnClickOverlay: Boolean
|
|
10084
10143
|
},
|
|
10085
10144
|
emits: ["scale", "close", "longPress"],
|
|
10086
10145
|
setup(props, {
|
|
@@ -10218,7 +10277,8 @@
|
|
|
10218
10277
|
setScale(scale);
|
|
10219
10278
|
}
|
|
10220
10279
|
};
|
|
10221
|
-
const checkTap = () => {
|
|
10280
|
+
const checkTap = (event) => {
|
|
10281
|
+
var _a;
|
|
10222
10282
|
if (fingerNum > 1) {
|
|
10223
10283
|
return;
|
|
10224
10284
|
}
|
|
@@ -10236,6 +10296,9 @@
|
|
|
10236
10296
|
doubleTapTimer = null;
|
|
10237
10297
|
toggleScale();
|
|
10238
10298
|
} else {
|
|
10299
|
+
if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
|
10300
|
+
return;
|
|
10301
|
+
}
|
|
10239
10302
|
doubleTapTimer = setTimeout(() => {
|
|
10240
10303
|
emit("close");
|
|
10241
10304
|
doubleTapTimer = null;
|
|
@@ -10273,7 +10336,7 @@
|
|
|
10273
10336
|
}
|
|
10274
10337
|
}
|
|
10275
10338
|
preventDefault(event, stopPropagation2);
|
|
10276
|
-
checkTap();
|
|
10339
|
+
checkTap(event);
|
|
10277
10340
|
touch.reset();
|
|
10278
10341
|
};
|
|
10279
10342
|
const onLoad = (event) => {
|
|
@@ -10327,7 +10390,7 @@
|
|
|
10327
10390
|
}
|
|
10328
10391
|
});
|
|
10329
10392
|
const [name$A, bem$z] = createNamespace("image-preview");
|
|
10330
|
-
const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate"];
|
|
10393
|
+
const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
|
|
10331
10394
|
const imagePreviewProps = {
|
|
10332
10395
|
show: Boolean,
|
|
10333
10396
|
loop: truthProp,
|
|
@@ -10347,7 +10410,9 @@
|
|
|
10347
10410
|
startPosition: makeNumericProp(0),
|
|
10348
10411
|
showIndicators: Boolean,
|
|
10349
10412
|
closeOnPopstate: truthProp,
|
|
10350
|
-
|
|
10413
|
+
closeOnClickOverlay: truthProp,
|
|
10414
|
+
closeIconPosition: makeStringProp("top-right"),
|
|
10415
|
+
teleport: [String, Object]
|
|
10351
10416
|
};
|
|
10352
10417
|
var stdin_default$R = vue.defineComponent({
|
|
10353
10418
|
name: name$A,
|
|
@@ -10361,7 +10426,8 @@
|
|
|
10361
10426
|
const state = vue.reactive({
|
|
10362
10427
|
active: 0,
|
|
10363
10428
|
rootWidth: 0,
|
|
10364
|
-
rootHeight: 0
|
|
10429
|
+
rootHeight: 0,
|
|
10430
|
+
disableZoom: false
|
|
10365
10431
|
});
|
|
10366
10432
|
const resize2 = () => {
|
|
10367
10433
|
if (swipeRef.value) {
|
|
@@ -10417,6 +10483,12 @@
|
|
|
10417
10483
|
}, [slots.cover()]);
|
|
10418
10484
|
}
|
|
10419
10485
|
};
|
|
10486
|
+
const onDragStart = () => {
|
|
10487
|
+
state.disableZoom = true;
|
|
10488
|
+
};
|
|
10489
|
+
const onDragEnd = () => {
|
|
10490
|
+
state.disableZoom = false;
|
|
10491
|
+
};
|
|
10420
10492
|
const renderImages = () => vue.createVNode(Swipe, {
|
|
10421
10493
|
"ref": swipeRef,
|
|
10422
10494
|
"lazyRender": true,
|
|
@@ -10426,7 +10498,9 @@
|
|
|
10426
10498
|
"initialSwipe": props.startPosition,
|
|
10427
10499
|
"showIndicators": props.showIndicators,
|
|
10428
10500
|
"indicatorColor": "white",
|
|
10429
|
-
"onChange": setActive
|
|
10501
|
+
"onChange": setActive,
|
|
10502
|
+
"onDragEnd": onDragEnd,
|
|
10503
|
+
"onDragStart": onDragStart
|
|
10430
10504
|
}, {
|
|
10431
10505
|
default: () => [props.images.map((image, index) => vue.createVNode(stdin_default$S, {
|
|
10432
10506
|
"src": image.url,
|
|
@@ -10436,6 +10510,8 @@
|
|
|
10436
10510
|
"minZoom": props.minZoom,
|
|
10437
10511
|
"rootWidth": state.rootWidth,
|
|
10438
10512
|
"rootHeight": state.rootHeight,
|
|
10513
|
+
"disableZoom": state.disableZoom,
|
|
10514
|
+
"closeOnClickOverlay": props.closeOnClickOverlay,
|
|
10439
10515
|
"onScale": emitScale,
|
|
10440
10516
|
"onClose": emitClose,
|
|
10441
10517
|
"onLongPress": () => emit("longPress", {
|
|
@@ -10518,6 +10594,7 @@
|
|
|
10518
10594
|
swipeDuration: 300,
|
|
10519
10595
|
showIndicators: false,
|
|
10520
10596
|
closeOnPopstate: true,
|
|
10597
|
+
closeOnClickOverlay: true,
|
|
10521
10598
|
closeIconPosition: "top-right"
|
|
10522
10599
|
};
|
|
10523
10600
|
function initInstance$1() {
|
|
@@ -10912,6 +10989,7 @@
|
|
|
10912
10989
|
offset: makeNumericProp(300),
|
|
10913
10990
|
loading: Boolean,
|
|
10914
10991
|
finished: Boolean,
|
|
10992
|
+
scroller: Object,
|
|
10915
10993
|
errorText: String,
|
|
10916
10994
|
direction: makeStringProp("down"),
|
|
10917
10995
|
loadingText: String,
|
|
@@ -10931,6 +11009,7 @@
|
|
|
10931
11009
|
const placeholder = vue.ref();
|
|
10932
11010
|
const tabStatus = useTabStatus();
|
|
10933
11011
|
const scrollParent = useScrollParent(root);
|
|
11012
|
+
const scroller = vue.computed(() => props.scroller || scrollParent.value);
|
|
10934
11013
|
const check = () => {
|
|
10935
11014
|
vue.nextTick(() => {
|
|
10936
11015
|
if (loading.value || props.finished || props.error || // skip check when inside an inactive tab
|
|
@@ -10941,7 +11020,7 @@
|
|
|
10941
11020
|
direction
|
|
10942
11021
|
} = props;
|
|
10943
11022
|
const offset2 = +props.offset;
|
|
10944
|
-
const scrollParentRect = useRect(
|
|
11023
|
+
const scrollParentRect = useRect(scroller);
|
|
10945
11024
|
if (!scrollParentRect.height || isHidden(root)) {
|
|
10946
11025
|
return;
|
|
10947
11026
|
}
|
|
@@ -11022,7 +11101,7 @@
|
|
|
11022
11101
|
check
|
|
11023
11102
|
});
|
|
11024
11103
|
useEventListener("scroll", check, {
|
|
11025
|
-
target:
|
|
11104
|
+
target: scroller,
|
|
11026
11105
|
passive: true
|
|
11027
11106
|
});
|
|
11028
11107
|
return () => {
|
|
@@ -15654,6 +15733,20 @@
|
|
|
15654
15733
|
requires: ["popperOffsets"],
|
|
15655
15734
|
fn: offset
|
|
15656
15735
|
};
|
|
15736
|
+
const useSyncPropRef = (getProp, setProp) => {
|
|
15737
|
+
const propRef = vue.ref(getProp());
|
|
15738
|
+
vue.watch(getProp, (value) => {
|
|
15739
|
+
if (value !== propRef.value) {
|
|
15740
|
+
propRef.value = value;
|
|
15741
|
+
}
|
|
15742
|
+
});
|
|
15743
|
+
vue.watch(propRef, (value) => {
|
|
15744
|
+
if (value !== getProp()) {
|
|
15745
|
+
setProp(value);
|
|
15746
|
+
}
|
|
15747
|
+
});
|
|
15748
|
+
return propRef;
|
|
15749
|
+
};
|
|
15657
15750
|
var __async = (__this, __arguments, generator) => {
|
|
15658
15751
|
return new Promise((resolve, reject) => {
|
|
15659
15752
|
var fulfilled = (value) => {
|
|
@@ -15675,7 +15768,7 @@
|
|
|
15675
15768
|
});
|
|
15676
15769
|
};
|
|
15677
15770
|
const [name$m, bem$l] = createNamespace("popover");
|
|
15678
|
-
const popupProps = ["
|
|
15771
|
+
const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
|
|
15679
15772
|
const popoverProps = {
|
|
15680
15773
|
show: Boolean,
|
|
15681
15774
|
theme: makeStringProp("light"),
|
|
@@ -15718,6 +15811,7 @@
|
|
|
15718
15811
|
const wrapperRef = vue.ref();
|
|
15719
15812
|
const popoverRef = vue.ref();
|
|
15720
15813
|
const arrowRef = vue.ref();
|
|
15814
|
+
const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
|
|
15721
15815
|
const getPopoverOptions = () => ({
|
|
15722
15816
|
placement: props.placement,
|
|
15723
15817
|
modifiers: [{
|
|
@@ -15740,7 +15834,7 @@
|
|
|
15740
15834
|
};
|
|
15741
15835
|
const updateLocation = () => {
|
|
15742
15836
|
vue.nextTick(() => {
|
|
15743
|
-
if (!
|
|
15837
|
+
if (!show.value) {
|
|
15744
15838
|
return;
|
|
15745
15839
|
}
|
|
15746
15840
|
if (!popper) {
|
|
@@ -15754,10 +15848,12 @@
|
|
|
15754
15848
|
}
|
|
15755
15849
|
});
|
|
15756
15850
|
};
|
|
15757
|
-
const updateShow = (value) =>
|
|
15851
|
+
const updateShow = (value) => {
|
|
15852
|
+
show.value = value;
|
|
15853
|
+
};
|
|
15758
15854
|
const onClickWrapper = () => {
|
|
15759
15855
|
if (props.trigger === "click") {
|
|
15760
|
-
|
|
15856
|
+
show.value = !show.value;
|
|
15761
15857
|
}
|
|
15762
15858
|
};
|
|
15763
15859
|
const onClickAction = (action, index) => {
|
|
@@ -15770,12 +15866,12 @@
|
|
|
15770
15866
|
action.selected = true;
|
|
15771
15867
|
emit("select", action, index);
|
|
15772
15868
|
if (props.closeOnClickAction) {
|
|
15773
|
-
|
|
15869
|
+
show.value = false;
|
|
15774
15870
|
}
|
|
15775
15871
|
};
|
|
15776
15872
|
const onClickAway = () => {
|
|
15777
|
-
if (
|
|
15778
|
-
|
|
15873
|
+
if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
|
|
15874
|
+
show.value = false;
|
|
15779
15875
|
}
|
|
15780
15876
|
};
|
|
15781
15877
|
const renderActionContent = (action, index) => {
|
|
@@ -15892,7 +15988,7 @@
|
|
|
15892
15988
|
popper = null;
|
|
15893
15989
|
}
|
|
15894
15990
|
});
|
|
15895
|
-
vue.watch(() => [
|
|
15991
|
+
vue.watch(() => [show.value, props.offset, props.placement], updateLocation);
|
|
15896
15992
|
useClickAway(wrapperRef, onClickAway, {
|
|
15897
15993
|
eventName: "touchstart"
|
|
15898
15994
|
});
|
|
@@ -15904,14 +16000,13 @@
|
|
|
15904
16000
|
"onClick": onClickWrapper
|
|
15905
16001
|
}, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), vue.createVNode(Popup, vue.mergeProps({
|
|
15906
16002
|
"ref": popoverRef,
|
|
15907
|
-
"
|
|
16003
|
+
"show": show.value,
|
|
16004
|
+
"class": bem$l([props.theme, show.value ? "show" : "hidden"]),
|
|
15908
16005
|
"position": "",
|
|
15909
16006
|
"transition": "zt-popover-zoom",
|
|
15910
16007
|
"lockScroll": false,
|
|
15911
16008
|
"onUpdate:show": updateShow
|
|
15912
|
-
}, attrs, pick(props, popupProps), {
|
|
15913
|
-
"show": true
|
|
15914
|
-
}), {
|
|
16009
|
+
}, attrs, useScopeId(), pick(props, popupProps)), {
|
|
15915
16010
|
default: () => [props.showArrow && vue.createVNode("div", {
|
|
15916
16011
|
"class": bem$l("arrow"),
|
|
15917
16012
|
"ref": arrowRef
|
|
@@ -18024,6 +18119,7 @@
|
|
|
18024
18119
|
let opened;
|
|
18025
18120
|
let lockClick2;
|
|
18026
18121
|
let startOffset;
|
|
18122
|
+
let isInBeforeClosing;
|
|
18027
18123
|
const root = vue.ref();
|
|
18028
18124
|
const leftRef = vue.ref();
|
|
18029
18125
|
const rightRef = vue.ref();
|
|
@@ -18100,14 +18196,22 @@
|
|
|
18100
18196
|
}
|
|
18101
18197
|
};
|
|
18102
18198
|
const onClick = (position = "outside") => {
|
|
18199
|
+
if (isInBeforeClosing)
|
|
18200
|
+
return;
|
|
18103
18201
|
emit("click", position);
|
|
18104
18202
|
if (opened && !lockClick2) {
|
|
18203
|
+
isInBeforeClosing = true;
|
|
18105
18204
|
callInterceptor(props.beforeClose, {
|
|
18106
18205
|
args: [{
|
|
18107
18206
|
name: props.name,
|
|
18108
18207
|
position
|
|
18109
18208
|
}],
|
|
18110
|
-
done: () =>
|
|
18209
|
+
done: () => {
|
|
18210
|
+
isInBeforeClosing = false;
|
|
18211
|
+
close(position);
|
|
18212
|
+
},
|
|
18213
|
+
canceled: () => isInBeforeClosing = false,
|
|
18214
|
+
error: () => isInBeforeClosing = false
|
|
18111
18215
|
});
|
|
18112
18216
|
}
|
|
18113
18217
|
};
|
|
@@ -18776,10 +18880,11 @@
|
|
|
18776
18880
|
const [name$2, bem$2] = createNamespace("text-ellipsis");
|
|
18777
18881
|
const textEllipsisProps = {
|
|
18778
18882
|
rows: makeNumericProp(1),
|
|
18883
|
+
dots: makeStringProp("..."),
|
|
18779
18884
|
content: makeStringProp(""),
|
|
18780
18885
|
expandText: makeStringProp(""),
|
|
18781
18886
|
collapseText: makeStringProp(""),
|
|
18782
|
-
|
|
18887
|
+
position: makeStringProp("end")
|
|
18783
18888
|
};
|
|
18784
18889
|
var stdin_default$7 = vue.defineComponent({
|
|
18785
18890
|
name: name$2,
|
|
@@ -18792,6 +18897,7 @@
|
|
|
18792
18897
|
const expanded = vue.ref(false);
|
|
18793
18898
|
const hasAction = vue.ref(false);
|
|
18794
18899
|
const root = vue.ref();
|
|
18900
|
+
const actionText = vue.computed(() => expanded.value ? props.collapseText : props.expandText);
|
|
18795
18901
|
const pxToNum = (value) => {
|
|
18796
18902
|
if (!value)
|
|
18797
18903
|
return 0;
|
|
@@ -18821,23 +18927,52 @@
|
|
|
18821
18927
|
const calcEllipsisText = (container2, maxHeight2) => {
|
|
18822
18928
|
const {
|
|
18823
18929
|
content,
|
|
18824
|
-
|
|
18930
|
+
position,
|
|
18931
|
+
dots
|
|
18825
18932
|
} = props;
|
|
18826
|
-
const
|
|
18827
|
-
|
|
18828
|
-
|
|
18829
|
-
|
|
18830
|
-
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18933
|
+
const end2 = content.length;
|
|
18934
|
+
const calcEllipse = () => {
|
|
18935
|
+
const tail = (left2, right2) => {
|
|
18936
|
+
if (right2 - left2 <= 1) {
|
|
18937
|
+
if (position === "end") {
|
|
18938
|
+
return content.slice(0, left2) + dots;
|
|
18939
|
+
}
|
|
18940
|
+
return dots + content.slice(right2, end2);
|
|
18941
|
+
}
|
|
18942
|
+
const middle2 = Math.round((left2 + right2) / 2);
|
|
18943
|
+
if (position === "end") {
|
|
18944
|
+
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
|
18945
|
+
} else {
|
|
18946
|
+
container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
|
|
18947
|
+
}
|
|
18948
|
+
if (container2.offsetHeight > maxHeight2) {
|
|
18949
|
+
if (position === "end") {
|
|
18950
|
+
return tail(left2, middle2);
|
|
18951
|
+
}
|
|
18952
|
+
return tail(middle2, right2);
|
|
18953
|
+
}
|
|
18954
|
+
if (position === "end") {
|
|
18955
|
+
return tail(middle2, right2);
|
|
18956
|
+
}
|
|
18957
|
+
return tail(left2, middle2);
|
|
18958
|
+
};
|
|
18959
|
+
container2.innerText = tail(0, end2);
|
|
18960
|
+
};
|
|
18961
|
+
const middleTail = (leftPart, rightPart) => {
|
|
18962
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
|
18963
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
|
18838
18964
|
}
|
|
18839
|
-
|
|
18840
|
-
|
|
18965
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
|
18966
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
|
18967
|
+
container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end2) + props.expandText;
|
|
18968
|
+
if (container2.offsetHeight >= maxHeight2) {
|
|
18969
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
|
18970
|
+
}
|
|
18971
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
|
18972
|
+
};
|
|
18973
|
+
const middle = 0 + end2 >> 1;
|
|
18974
|
+
props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end2]) : calcEllipse();
|
|
18975
|
+
return container2.innerText;
|
|
18841
18976
|
};
|
|
18842
18977
|
const container = cloneContainer();
|
|
18843
18978
|
if (!container)
|
|
@@ -18847,7 +18982,7 @@
|
|
|
18847
18982
|
paddingTop,
|
|
18848
18983
|
lineHeight
|
|
18849
18984
|
} = container.style;
|
|
18850
|
-
const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
|
|
18985
|
+
const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
|
|
18851
18986
|
if (maxHeight < container.offsetHeight) {
|
|
18852
18987
|
hasAction.value = true;
|
|
18853
18988
|
text.value = calcEllipsisText(container, maxHeight);
|
|
@@ -18861,26 +18996,17 @@
|
|
|
18861
18996
|
expanded.value = !expanded.value;
|
|
18862
18997
|
emit("clickAction", event);
|
|
18863
18998
|
};
|
|
18864
|
-
const formatSearchKeyword = (keywords, text2) => {
|
|
18865
|
-
if (!keywords)
|
|
18866
|
-
return text2;
|
|
18867
|
-
const replaceReg = new RegExp(keywords, "ig");
|
|
18868
|
-
const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1);">${keywords}</span>`;
|
|
18869
|
-
return text2.replace(replaceReg, replaceString);
|
|
18870
|
-
};
|
|
18871
18999
|
const renderAction = () => vue.createVNode("span", {
|
|
18872
19000
|
"class": bem$2("action"),
|
|
18873
19001
|
"onClick": onClickAction
|
|
18874
|
-
}, [
|
|
19002
|
+
}, [actionText.value]);
|
|
18875
19003
|
vue.onMounted(calcEllipsised);
|
|
18876
|
-
vue.watch(() => [props.content, props.rows], calcEllipsised);
|
|
19004
|
+
vue.watch(() => [props.content, props.rows, props.position], calcEllipsised);
|
|
18877
19005
|
useEventListener("resize", calcEllipsised);
|
|
18878
19006
|
return () => vue.createVNode("div", {
|
|
18879
19007
|
"ref": root,
|
|
18880
19008
|
"class": bem$2()
|
|
18881
|
-
}, [
|
|
18882
|
-
"innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
|
|
18883
|
-
}, null), hasAction.value ? renderAction() : null]);
|
|
19009
|
+
}, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
|
|
18884
19010
|
}
|
|
18885
19011
|
});
|
|
18886
19012
|
const TextEllipsis = withInstall(stdin_default$7);
|
|
@@ -20463,7 +20589,7 @@
|
|
|
20463
20589
|
});
|
|
20464
20590
|
}
|
|
20465
20591
|
};
|
|
20466
|
-
const version = "3.1.
|
|
20592
|
+
const version = "3.1.8";
|
|
20467
20593
|
function install(app) {
|
|
20468
20594
|
const components = [
|
|
20469
20595
|
ActionSheet,
|