zartui 3.1.7 → 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 +19 -9
package/lib/zartui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref, ref, reactive, defineComponent, computed, createVNode, watch, onActivated, onDeactivated, onBeforeUnmount, provide, inject, mergeProps, getCurrentInstance, Transition, withDirectives, vShow, nextTick, onMounted, Teleport, Fragment, resolveDirective, onBeforeUpdate, onUnmounted, createApp, createTextVNode,
|
|
1
|
+
import { unref, ref, reactive, defineComponent, computed, createVNode, watch, onActivated, onDeactivated, onBeforeUnmount, provide, watchEffect, inject, mergeProps, getCurrentInstance, Transition, withDirectives, vShow, nextTick, onMounted, Teleport, Fragment, resolveDirective, onBeforeUpdate, onUnmounted, createApp, createTextVNode, withKeys, onUpdated, h } from "vue";
|
|
2
2
|
import { useWindowSize, useRect, onMountedOrActivated, getScrollParent, useEventListener, useToggle, raf, useScrollParent, useChildren, usePageVisibility, doubleRaf, useParent, useCustomFieldValue, useClickAway, CUSTOM_FIELD_INJECTION_KEY, inBrowser as inBrowser$1 } from "@zartui/use";
|
|
3
3
|
import { DATE_FORMAT, formatDate } from "@zartui/date-utils";
|
|
4
4
|
import { autoUpdate, computePosition, offset, shift, limitShift, flip, hide, arrow } from "@floating-ui/vue";
|
|
@@ -367,7 +367,8 @@ const LONG_PRESS_START_TIME = 500;
|
|
|
367
367
|
function callInterceptor(interceptor, {
|
|
368
368
|
args = [],
|
|
369
369
|
done,
|
|
370
|
-
canceled
|
|
370
|
+
canceled,
|
|
371
|
+
error
|
|
371
372
|
}) {
|
|
372
373
|
if (interceptor) {
|
|
373
374
|
const returnVal = interceptor.apply(null, args);
|
|
@@ -378,7 +379,7 @@ function callInterceptor(interceptor, {
|
|
|
378
379
|
} else if (canceled) {
|
|
379
380
|
canceled();
|
|
380
381
|
}
|
|
381
|
-
}).catch(noop);
|
|
382
|
+
}).catch(error || noop);
|
|
382
383
|
} else if (returnVal) {
|
|
383
384
|
done();
|
|
384
385
|
} else if (canceled) {
|
|
@@ -495,32 +496,53 @@ var stdin_default$1P = defineComponent({
|
|
|
495
496
|
}
|
|
496
497
|
});
|
|
497
498
|
const Badge = withInstall(stdin_default$1P);
|
|
499
|
+
let globalZIndex = 2e3;
|
|
500
|
+
const useGlobalZIndex = () => ++globalZIndex;
|
|
501
|
+
const setGlobalZIndex = (val) => {
|
|
502
|
+
globalZIndex = val;
|
|
503
|
+
};
|
|
498
504
|
const [name$1k, bem$1g] = createNamespace("config-provider");
|
|
499
505
|
const CONFIG_PROVIDER_KEY = Symbol(name$1k);
|
|
500
506
|
const configProviderProps = {
|
|
501
507
|
tag: makeStringProp("div"),
|
|
502
508
|
theme: makeStringProp("light"),
|
|
509
|
+
zIndex: Number,
|
|
503
510
|
themeVars: Object,
|
|
511
|
+
themeVarsDark: Object,
|
|
512
|
+
themeVarsLight: Object,
|
|
513
|
+
themeVarsScope: makeStringProp("local"),
|
|
504
514
|
iconPrefix: String
|
|
505
515
|
};
|
|
516
|
+
function insertDash(str) {
|
|
517
|
+
return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
|
|
518
|
+
}
|
|
506
519
|
function mapThemeVarsToCSSVars(themeVars) {
|
|
507
520
|
const cssVars = {};
|
|
508
521
|
Object.keys(themeVars).forEach((key) => {
|
|
509
|
-
|
|
522
|
+
const formattedKey = insertDash(kebabCase(key));
|
|
523
|
+
cssVars[`--zt-${formattedKey}`] = themeVars[key];
|
|
510
524
|
});
|
|
511
525
|
return cssVars;
|
|
512
526
|
}
|
|
527
|
+
function syncThemeVarsOnRoot(newStyle = {}, oldStyle = {}) {
|
|
528
|
+
Object.keys(newStyle).forEach((key) => {
|
|
529
|
+
if (newStyle[key] !== oldStyle[key]) {
|
|
530
|
+
document.documentElement.style.setProperty(key, newStyle[key]);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
Object.keys(oldStyle).forEach((key) => {
|
|
534
|
+
if (!newStyle[key]) {
|
|
535
|
+
document.documentElement.style.removeProperty(key);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}
|
|
513
539
|
var stdin_default$1O = defineComponent({
|
|
514
540
|
name: name$1k,
|
|
515
541
|
props: configProviderProps,
|
|
516
542
|
setup(props, {
|
|
517
543
|
slots
|
|
518
544
|
}) {
|
|
519
|
-
const style = computed(() => {
|
|
520
|
-
if (props.themeVars) {
|
|
521
|
-
return mapThemeVarsToCSSVars(props.themeVars);
|
|
522
|
-
}
|
|
523
|
-
});
|
|
545
|
+
const style = computed(() => mapThemeVarsToCSSVars(extend({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
|
|
524
546
|
if (inBrowser) {
|
|
525
547
|
const addTheme = () => {
|
|
526
548
|
document.documentElement.classList.add(`zt-theme-${props.theme}`);
|
|
@@ -539,11 +561,32 @@ var stdin_default$1O = defineComponent({
|
|
|
539
561
|
onActivated(addTheme);
|
|
540
562
|
onDeactivated(removeTheme);
|
|
541
563
|
onBeforeUnmount(removeTheme);
|
|
564
|
+
watch(style, (newStyle, oldStyle) => {
|
|
565
|
+
if (props.themeVarsScope === "global") {
|
|
566
|
+
syncThemeVarsOnRoot(newStyle, oldStyle);
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
watch(() => props.themeVarsScope, (newScope, oldScope) => {
|
|
570
|
+
if (oldScope === "global") {
|
|
571
|
+
syncThemeVarsOnRoot({}, style.value);
|
|
572
|
+
}
|
|
573
|
+
if (newScope === "global") {
|
|
574
|
+
syncThemeVarsOnRoot(style.value, {});
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
if (props.themeVarsScope === "global") {
|
|
578
|
+
syncThemeVarsOnRoot(style.value, {});
|
|
579
|
+
}
|
|
542
580
|
}
|
|
543
581
|
provide(CONFIG_PROVIDER_KEY, props);
|
|
582
|
+
watchEffect(() => {
|
|
583
|
+
if (props.zIndex !== void 0) {
|
|
584
|
+
setGlobalZIndex(props.zIndex);
|
|
585
|
+
}
|
|
586
|
+
});
|
|
544
587
|
return () => createVNode(props.tag, {
|
|
545
588
|
"class": bem$1g(),
|
|
546
|
-
"style": style.value
|
|
589
|
+
"style": props.themeVarsScope === "local" ? style.value : void 0
|
|
547
590
|
}, {
|
|
548
591
|
default: () => {
|
|
549
592
|
var _a;
|
|
@@ -770,6 +813,11 @@ function onPopupReopen(callback) {
|
|
|
770
813
|
});
|
|
771
814
|
}
|
|
772
815
|
}
|
|
816
|
+
const useScopeId = () => {
|
|
817
|
+
var _a;
|
|
818
|
+
const { scopeId } = ((_a = getCurrentInstance()) == null ? void 0 : _a.vnode) || {};
|
|
819
|
+
return scopeId ? { [scopeId]: "" } : null;
|
|
820
|
+
};
|
|
773
821
|
const [name$1i, bem$1e] = createNamespace("overlay");
|
|
774
822
|
const overlayProps = {
|
|
775
823
|
show: Boolean,
|
|
@@ -829,7 +877,6 @@ const popupProps$2 = extend({}, popupSharedProps, {
|
|
|
829
877
|
slideable: Boolean
|
|
830
878
|
});
|
|
831
879
|
const [name$1h, bem$1d] = createNamespace("popup");
|
|
832
|
-
let globalZIndex = 2e3;
|
|
833
880
|
var stdin_default$1K = defineComponent({
|
|
834
881
|
name: name$1h,
|
|
835
882
|
inheritAttrs: false,
|
|
@@ -866,11 +913,8 @@ var stdin_default$1K = defineComponent({
|
|
|
866
913
|
contentStyle.value = `height:${props.sliderContentHeight}px;`;
|
|
867
914
|
}
|
|
868
915
|
if (!opened) {
|
|
869
|
-
if (props.zIndex !== void 0) {
|
|
870
|
-
globalZIndex = +props.zIndex;
|
|
871
|
-
}
|
|
872
916
|
opened = true;
|
|
873
|
-
zIndex.value =
|
|
917
|
+
zIndex.value = props.zIndex !== void 0 ? +props.zIndex : useGlobalZIndex();
|
|
874
918
|
emit("open");
|
|
875
919
|
}
|
|
876
920
|
};
|
|
@@ -927,14 +971,15 @@ var stdin_default$1K = defineComponent({
|
|
|
927
971
|
});
|
|
928
972
|
const renderOverlay = () => {
|
|
929
973
|
if (props.overlay) {
|
|
930
|
-
return createVNode(Overlay, {
|
|
974
|
+
return createVNode(Overlay, mergeProps({
|
|
931
975
|
"show": props.show,
|
|
932
976
|
"class": props.overlayClass,
|
|
933
977
|
"zIndex": zIndex.value,
|
|
934
978
|
"duration": props.duration,
|
|
935
|
-
"customStyle": props.overlayStyle
|
|
979
|
+
"customStyle": props.overlayStyle
|
|
980
|
+
}, useScopeId(), {
|
|
936
981
|
"onClick": onClickOverlay
|
|
937
|
-
}, {
|
|
982
|
+
}), {
|
|
938
983
|
default: slots["overlay-content"]
|
|
939
984
|
});
|
|
940
985
|
}
|
|
@@ -977,7 +1022,7 @@ var stdin_default$1K = defineComponent({
|
|
|
977
1022
|
"zt-safe-area-bottom": safeAreaInsetBottom
|
|
978
1023
|
}],
|
|
979
1024
|
"onKeydown": onKeydown
|
|
980
|
-
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vShow, props.show]]);
|
|
1025
|
+
}, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vShow, props.show]]);
|
|
981
1026
|
});
|
|
982
1027
|
const sliderRenderPopup = lazyRender(() => {
|
|
983
1028
|
var _a, _b;
|
|
@@ -1823,6 +1868,7 @@ const toastProps = {
|
|
|
1823
1868
|
duration: makeNumberProp(2e3),
|
|
1824
1869
|
position: makeStringProp("middle"),
|
|
1825
1870
|
teleport: [String, Object],
|
|
1871
|
+
wordBreak: String,
|
|
1826
1872
|
className: unknownProp,
|
|
1827
1873
|
iconPrefix: String,
|
|
1828
1874
|
transition: makeStringProp("zt-fade"),
|
|
@@ -1908,7 +1954,7 @@ var stdin_default$1z = defineComponent({
|
|
|
1908
1954
|
onMounted(toggleClickable);
|
|
1909
1955
|
onUnmounted(toggleClickable);
|
|
1910
1956
|
return () => createVNode(Popup, mergeProps({
|
|
1911
|
-
"class": [bem$16([props.position, {
|
|
1957
|
+
"class": [bem$16([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
|
|
1912
1958
|
[props.type]: !props.icon
|
|
1913
1959
|
}]), props.className],
|
|
1914
1960
|
"lockScroll": false,
|
|
@@ -3411,7 +3457,7 @@ var stdin_default$1s = defineComponent({
|
|
|
3411
3457
|
const trackStyle = computed(() => {
|
|
3412
3458
|
const style = {
|
|
3413
3459
|
transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
|
|
3414
|
-
transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
|
|
3460
|
+
transform: `translate${props.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
|
|
3415
3461
|
};
|
|
3416
3462
|
if (size.value) {
|
|
3417
3463
|
const mainAxis = props.vertical ? "height" : "width";
|
|
@@ -4812,7 +4858,7 @@ var stdin_default$1k = defineComponent({
|
|
|
4812
4858
|
}), {
|
|
4813
4859
|
[BORDER_TOP_BOTTOM]: props.border && !props.inset
|
|
4814
4860
|
}]
|
|
4815
|
-
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
4861
|
+
}, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
4816
4862
|
};
|
|
4817
4863
|
const renderTitle = () => createVNode("div", {
|
|
4818
4864
|
"class": bem$X("title", {
|
|
@@ -4906,7 +4952,11 @@ var stdin_default$1i = defineComponent({
|
|
|
4906
4952
|
role: String,
|
|
4907
4953
|
parent: Object,
|
|
4908
4954
|
checked: Boolean,
|
|
4909
|
-
bindGroup: truthProp
|
|
4955
|
+
bindGroup: truthProp,
|
|
4956
|
+
indeterminate: {
|
|
4957
|
+
type: Boolean,
|
|
4958
|
+
default: null
|
|
4959
|
+
}
|
|
4910
4960
|
}),
|
|
4911
4961
|
emits: ["click", "toggle"],
|
|
4912
4962
|
setup(props, {
|
|
@@ -4945,14 +4995,16 @@ var stdin_default$1i = defineComponent({
|
|
|
4945
4995
|
const {
|
|
4946
4996
|
bem: bem2,
|
|
4947
4997
|
shape,
|
|
4948
|
-
checked
|
|
4998
|
+
checked,
|
|
4999
|
+
indeterminate
|
|
4949
5000
|
} = props;
|
|
4950
5001
|
const iconSize = props.iconSize || getParentProp("iconSize");
|
|
4951
5002
|
return createVNode("div", {
|
|
4952
5003
|
"ref": iconRef,
|
|
4953
5004
|
"class": bem2("icon", [shape, {
|
|
4954
5005
|
disabled: disabled.value,
|
|
4955
|
-
checked
|
|
5006
|
+
checked,
|
|
5007
|
+
indeterminate
|
|
4956
5008
|
}]),
|
|
4957
5009
|
"style": {
|
|
4958
5010
|
fontSize: addUnit(iconSize)
|
|
@@ -4960,14 +5012,8 @@ var stdin_default$1i = defineComponent({
|
|
|
4960
5012
|
}, [slots.icon ? slots.icon({
|
|
4961
5013
|
checked,
|
|
4962
5014
|
disabled: disabled.value
|
|
4963
|
-
}) : props.role === "radio" ? createVNode(Icon, {
|
|
4964
|
-
"style": iconStyle.value
|
|
4965
|
-
}, {
|
|
4966
|
-
default: () => [checked ? createVNode("div", {
|
|
4967
|
-
"class": bem2("dot")
|
|
4968
|
-
}, null) : ""]
|
|
4969
5015
|
}) : createVNode(Icon, {
|
|
4970
|
-
"name": "checkbox-select",
|
|
5016
|
+
"name": indeterminate ? "minus" : "checkbox-select",
|
|
4971
5017
|
"style": iconStyle.value
|
|
4972
5018
|
}, null)]);
|
|
4973
5019
|
};
|
|
@@ -4997,7 +5043,11 @@ var stdin_default$1i = defineComponent({
|
|
|
4997
5043
|
});
|
|
4998
5044
|
const [name$W, bem$V] = createNamespace("checkbox");
|
|
4999
5045
|
const checkboxProps = extend({}, checkerProps, {
|
|
5000
|
-
bindGroup: truthProp
|
|
5046
|
+
bindGroup: truthProp,
|
|
5047
|
+
indeterminate: {
|
|
5048
|
+
type: Boolean,
|
|
5049
|
+
default: null
|
|
5050
|
+
}
|
|
5001
5051
|
});
|
|
5002
5052
|
var stdin_default$1h = defineComponent({
|
|
5003
5053
|
name: name$W,
|
|
@@ -5048,9 +5098,16 @@ var stdin_default$1h = defineComponent({
|
|
|
5048
5098
|
setParentValue(newValue);
|
|
5049
5099
|
} else {
|
|
5050
5100
|
emit("update:modelValue", newValue);
|
|
5101
|
+
if (props.indeterminate !== null) {
|
|
5102
|
+
emit("change", newValue);
|
|
5103
|
+
}
|
|
5051
5104
|
}
|
|
5052
5105
|
};
|
|
5053
|
-
watch(() => props.modelValue, (value) =>
|
|
5106
|
+
watch(() => props.modelValue, (value) => {
|
|
5107
|
+
if (props.indeterminate === null) {
|
|
5108
|
+
emit("change", value);
|
|
5109
|
+
}
|
|
5110
|
+
});
|
|
5054
5111
|
useExpose({
|
|
5055
5112
|
toggle,
|
|
5056
5113
|
props,
|
|
@@ -7161,7 +7218,7 @@ function initInstance$2() {
|
|
|
7161
7218
|
}
|
|
7162
7219
|
function showDialog(options) {
|
|
7163
7220
|
if (!inBrowser) {
|
|
7164
|
-
return Promise.resolve();
|
|
7221
|
+
return Promise.resolve(void 0);
|
|
7165
7222
|
}
|
|
7166
7223
|
return new Promise((resolve, reject) => {
|
|
7167
7224
|
if (!instance$2) {
|
|
@@ -7477,7 +7534,7 @@ var stdin_default$10 = defineComponent({
|
|
|
7477
7534
|
if (props.multiSelect) {
|
|
7478
7535
|
return createVNode(Cell, {
|
|
7479
7536
|
"role": "menuitem",
|
|
7480
|
-
"key": option.value,
|
|
7537
|
+
"key": String(option.value),
|
|
7481
7538
|
"title-icon": option.icon,
|
|
7482
7539
|
"title": option.text,
|
|
7483
7540
|
"direction": "horizontal",
|
|
@@ -7496,7 +7553,7 @@ var stdin_default$10 = defineComponent({
|
|
|
7496
7553
|
}
|
|
7497
7554
|
return createVNode(Cell, {
|
|
7498
7555
|
"role": "menuitem",
|
|
7499
|
-
"key": option.value,
|
|
7556
|
+
"key": String(option.value),
|
|
7500
7557
|
"title-icon": option.icon,
|
|
7501
7558
|
"title": option.text,
|
|
7502
7559
|
"direction": "horizontal",
|
|
@@ -9840,7 +9897,9 @@ var stdin_default$S = defineComponent({
|
|
|
9840
9897
|
minZoom: makeRequiredProp(numericProp),
|
|
9841
9898
|
maxZoom: makeRequiredProp(numericProp),
|
|
9842
9899
|
rootWidth: makeRequiredProp(Number),
|
|
9843
|
-
rootHeight: makeRequiredProp(Number)
|
|
9900
|
+
rootHeight: makeRequiredProp(Number),
|
|
9901
|
+
disableZoom: Boolean,
|
|
9902
|
+
closeOnClickOverlay: Boolean
|
|
9844
9903
|
},
|
|
9845
9904
|
emits: ["scale", "close", "longPress"],
|
|
9846
9905
|
setup(props, {
|
|
@@ -9978,7 +10037,8 @@ var stdin_default$S = defineComponent({
|
|
|
9978
10037
|
setScale(scale);
|
|
9979
10038
|
}
|
|
9980
10039
|
};
|
|
9981
|
-
const checkTap = () => {
|
|
10040
|
+
const checkTap = (event) => {
|
|
10041
|
+
var _a;
|
|
9982
10042
|
if (fingerNum > 1) {
|
|
9983
10043
|
return;
|
|
9984
10044
|
}
|
|
@@ -9996,6 +10056,9 @@ var stdin_default$S = defineComponent({
|
|
|
9996
10056
|
doubleTapTimer = null;
|
|
9997
10057
|
toggleScale();
|
|
9998
10058
|
} else {
|
|
10059
|
+
if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
|
10060
|
+
return;
|
|
10061
|
+
}
|
|
9999
10062
|
doubleTapTimer = setTimeout(() => {
|
|
10000
10063
|
emit("close");
|
|
10001
10064
|
doubleTapTimer = null;
|
|
@@ -10033,7 +10096,7 @@ var stdin_default$S = defineComponent({
|
|
|
10033
10096
|
}
|
|
10034
10097
|
}
|
|
10035
10098
|
preventDefault(event, stopPropagation2);
|
|
10036
|
-
checkTap();
|
|
10099
|
+
checkTap(event);
|
|
10037
10100
|
touch.reset();
|
|
10038
10101
|
};
|
|
10039
10102
|
const onLoad = (event) => {
|
|
@@ -10087,7 +10150,7 @@ var stdin_default$S = defineComponent({
|
|
|
10087
10150
|
}
|
|
10088
10151
|
});
|
|
10089
10152
|
const [name$A, bem$z] = createNamespace("image-preview");
|
|
10090
|
-
const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate"];
|
|
10153
|
+
const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
|
|
10091
10154
|
const imagePreviewProps = {
|
|
10092
10155
|
show: Boolean,
|
|
10093
10156
|
loop: truthProp,
|
|
@@ -10107,7 +10170,9 @@ const imagePreviewProps = {
|
|
|
10107
10170
|
startPosition: makeNumericProp(0),
|
|
10108
10171
|
showIndicators: Boolean,
|
|
10109
10172
|
closeOnPopstate: truthProp,
|
|
10110
|
-
|
|
10173
|
+
closeOnClickOverlay: truthProp,
|
|
10174
|
+
closeIconPosition: makeStringProp("top-right"),
|
|
10175
|
+
teleport: [String, Object]
|
|
10111
10176
|
};
|
|
10112
10177
|
var stdin_default$R = defineComponent({
|
|
10113
10178
|
name: name$A,
|
|
@@ -10121,7 +10186,8 @@ var stdin_default$R = defineComponent({
|
|
|
10121
10186
|
const state = reactive({
|
|
10122
10187
|
active: 0,
|
|
10123
10188
|
rootWidth: 0,
|
|
10124
|
-
rootHeight: 0
|
|
10189
|
+
rootHeight: 0,
|
|
10190
|
+
disableZoom: false
|
|
10125
10191
|
});
|
|
10126
10192
|
const resize2 = () => {
|
|
10127
10193
|
if (swipeRef.value) {
|
|
@@ -10177,6 +10243,12 @@ var stdin_default$R = defineComponent({
|
|
|
10177
10243
|
}, [slots.cover()]);
|
|
10178
10244
|
}
|
|
10179
10245
|
};
|
|
10246
|
+
const onDragStart = () => {
|
|
10247
|
+
state.disableZoom = true;
|
|
10248
|
+
};
|
|
10249
|
+
const onDragEnd = () => {
|
|
10250
|
+
state.disableZoom = false;
|
|
10251
|
+
};
|
|
10180
10252
|
const renderImages = () => createVNode(Swipe, {
|
|
10181
10253
|
"ref": swipeRef,
|
|
10182
10254
|
"lazyRender": true,
|
|
@@ -10186,7 +10258,9 @@ var stdin_default$R = defineComponent({
|
|
|
10186
10258
|
"initialSwipe": props.startPosition,
|
|
10187
10259
|
"showIndicators": props.showIndicators,
|
|
10188
10260
|
"indicatorColor": "white",
|
|
10189
|
-
"onChange": setActive
|
|
10261
|
+
"onChange": setActive,
|
|
10262
|
+
"onDragEnd": onDragEnd,
|
|
10263
|
+
"onDragStart": onDragStart
|
|
10190
10264
|
}, {
|
|
10191
10265
|
default: () => [props.images.map((image, index) => createVNode(stdin_default$S, {
|
|
10192
10266
|
"src": image.url,
|
|
@@ -10196,6 +10270,8 @@ var stdin_default$R = defineComponent({
|
|
|
10196
10270
|
"minZoom": props.minZoom,
|
|
10197
10271
|
"rootWidth": state.rootWidth,
|
|
10198
10272
|
"rootHeight": state.rootHeight,
|
|
10273
|
+
"disableZoom": state.disableZoom,
|
|
10274
|
+
"closeOnClickOverlay": props.closeOnClickOverlay,
|
|
10199
10275
|
"onScale": emitScale,
|
|
10200
10276
|
"onClose": emitClose,
|
|
10201
10277
|
"onLongPress": () => emit("longPress", {
|
|
@@ -10278,6 +10354,7 @@ const defaultConfig = {
|
|
|
10278
10354
|
swipeDuration: 300,
|
|
10279
10355
|
showIndicators: false,
|
|
10280
10356
|
closeOnPopstate: true,
|
|
10357
|
+
closeOnClickOverlay: true,
|
|
10281
10358
|
closeIconPosition: "top-right"
|
|
10282
10359
|
};
|
|
10283
10360
|
function initInstance$1() {
|
|
@@ -10675,6 +10752,7 @@ const listProps = {
|
|
|
10675
10752
|
offset: makeNumericProp(300),
|
|
10676
10753
|
loading: Boolean,
|
|
10677
10754
|
finished: Boolean,
|
|
10755
|
+
scroller: Object,
|
|
10678
10756
|
errorText: String,
|
|
10679
10757
|
direction: makeStringProp("down"),
|
|
10680
10758
|
loadingText: String,
|
|
@@ -10694,6 +10772,7 @@ var stdin_default$O = defineComponent({
|
|
|
10694
10772
|
const placeholder = ref();
|
|
10695
10773
|
const tabStatus = useTabStatus();
|
|
10696
10774
|
const scrollParent = useScrollParent(root);
|
|
10775
|
+
const scroller = computed(() => props.scroller || scrollParent.value);
|
|
10697
10776
|
const check = () => {
|
|
10698
10777
|
nextTick(() => {
|
|
10699
10778
|
if (loading.value || props.finished || props.error || // skip check when inside an inactive tab
|
|
@@ -10704,7 +10783,7 @@ var stdin_default$O = defineComponent({
|
|
|
10704
10783
|
direction
|
|
10705
10784
|
} = props;
|
|
10706
10785
|
const offset2 = +props.offset;
|
|
10707
|
-
const scrollParentRect = useRect(
|
|
10786
|
+
const scrollParentRect = useRect(scroller);
|
|
10708
10787
|
if (!scrollParentRect.height || isHidden(root)) {
|
|
10709
10788
|
return;
|
|
10710
10789
|
}
|
|
@@ -10785,7 +10864,7 @@ var stdin_default$O = defineComponent({
|
|
|
10785
10864
|
check
|
|
10786
10865
|
});
|
|
10787
10866
|
useEventListener("scroll", check, {
|
|
10788
|
-
target:
|
|
10867
|
+
target: scroller,
|
|
10789
10868
|
passive: true
|
|
10790
10869
|
});
|
|
10791
10870
|
return () => {
|
|
@@ -14011,6 +14090,20 @@ var stdin_default$u = defineComponent({
|
|
|
14011
14090
|
}
|
|
14012
14091
|
});
|
|
14013
14092
|
const PasswordInput = withInstall(stdin_default$u);
|
|
14093
|
+
const useSyncPropRef = (getProp, setProp) => {
|
|
14094
|
+
const propRef = ref(getProp());
|
|
14095
|
+
watch(getProp, (value) => {
|
|
14096
|
+
if (value !== propRef.value) {
|
|
14097
|
+
propRef.value = value;
|
|
14098
|
+
}
|
|
14099
|
+
});
|
|
14100
|
+
watch(propRef, (value) => {
|
|
14101
|
+
if (value !== getProp()) {
|
|
14102
|
+
setProp(value);
|
|
14103
|
+
}
|
|
14104
|
+
});
|
|
14105
|
+
return propRef;
|
|
14106
|
+
};
|
|
14014
14107
|
var __async = (__this, __arguments, generator) => {
|
|
14015
14108
|
return new Promise((resolve, reject) => {
|
|
14016
14109
|
var fulfilled = (value) => {
|
|
@@ -14032,7 +14125,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14032
14125
|
});
|
|
14033
14126
|
};
|
|
14034
14127
|
const [name$m, bem$l] = createNamespace("popover");
|
|
14035
|
-
const popupProps = ["
|
|
14128
|
+
const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
|
|
14036
14129
|
const popoverProps = {
|
|
14037
14130
|
show: Boolean,
|
|
14038
14131
|
theme: makeStringProp("light"),
|
|
@@ -14075,6 +14168,7 @@ var stdin_default$t = defineComponent({
|
|
|
14075
14168
|
const wrapperRef = ref();
|
|
14076
14169
|
const popoverRef = ref();
|
|
14077
14170
|
const arrowRef = ref();
|
|
14171
|
+
const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
|
|
14078
14172
|
const getPopoverOptions = () => ({
|
|
14079
14173
|
placement: props.placement,
|
|
14080
14174
|
modifiers: [{
|
|
@@ -14097,7 +14191,7 @@ var stdin_default$t = defineComponent({
|
|
|
14097
14191
|
};
|
|
14098
14192
|
const updateLocation = () => {
|
|
14099
14193
|
nextTick(() => {
|
|
14100
|
-
if (!
|
|
14194
|
+
if (!show.value) {
|
|
14101
14195
|
return;
|
|
14102
14196
|
}
|
|
14103
14197
|
if (!popper) {
|
|
@@ -14111,10 +14205,12 @@ var stdin_default$t = defineComponent({
|
|
|
14111
14205
|
}
|
|
14112
14206
|
});
|
|
14113
14207
|
};
|
|
14114
|
-
const updateShow = (value) =>
|
|
14208
|
+
const updateShow = (value) => {
|
|
14209
|
+
show.value = value;
|
|
14210
|
+
};
|
|
14115
14211
|
const onClickWrapper = () => {
|
|
14116
14212
|
if (props.trigger === "click") {
|
|
14117
|
-
|
|
14213
|
+
show.value = !show.value;
|
|
14118
14214
|
}
|
|
14119
14215
|
};
|
|
14120
14216
|
const onClickAction = (action, index) => {
|
|
@@ -14127,12 +14223,12 @@ var stdin_default$t = defineComponent({
|
|
|
14127
14223
|
action.selected = true;
|
|
14128
14224
|
emit("select", action, index);
|
|
14129
14225
|
if (props.closeOnClickAction) {
|
|
14130
|
-
|
|
14226
|
+
show.value = false;
|
|
14131
14227
|
}
|
|
14132
14228
|
};
|
|
14133
14229
|
const onClickAway = () => {
|
|
14134
|
-
if (
|
|
14135
|
-
|
|
14230
|
+
if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
|
|
14231
|
+
show.value = false;
|
|
14136
14232
|
}
|
|
14137
14233
|
};
|
|
14138
14234
|
const renderActionContent = (action, index) => {
|
|
@@ -14249,7 +14345,7 @@ var stdin_default$t = defineComponent({
|
|
|
14249
14345
|
popper = null;
|
|
14250
14346
|
}
|
|
14251
14347
|
});
|
|
14252
|
-
watch(() => [
|
|
14348
|
+
watch(() => [show.value, props.offset, props.placement], updateLocation);
|
|
14253
14349
|
useClickAway(wrapperRef, onClickAway, {
|
|
14254
14350
|
eventName: "touchstart"
|
|
14255
14351
|
});
|
|
@@ -14261,14 +14357,13 @@ var stdin_default$t = defineComponent({
|
|
|
14261
14357
|
"onClick": onClickWrapper
|
|
14262
14358
|
}, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), createVNode(Popup, mergeProps({
|
|
14263
14359
|
"ref": popoverRef,
|
|
14264
|
-
"
|
|
14360
|
+
"show": show.value,
|
|
14361
|
+
"class": bem$l([props.theme, show.value ? "show" : "hidden"]),
|
|
14265
14362
|
"position": "",
|
|
14266
14363
|
"transition": "zt-popover-zoom",
|
|
14267
14364
|
"lockScroll": false,
|
|
14268
14365
|
"onUpdate:show": updateShow
|
|
14269
|
-
}, attrs, pick(props, popupProps), {
|
|
14270
|
-
"show": true
|
|
14271
|
-
}), {
|
|
14366
|
+
}, attrs, useScopeId(), pick(props, popupProps)), {
|
|
14272
14367
|
default: () => [props.showArrow && createVNode("div", {
|
|
14273
14368
|
"class": bem$l("arrow"),
|
|
14274
14369
|
"ref": arrowRef
|
|
@@ -16384,6 +16479,7 @@ var stdin_default$e = defineComponent({
|
|
|
16384
16479
|
let opened;
|
|
16385
16480
|
let lockClick2;
|
|
16386
16481
|
let startOffset;
|
|
16482
|
+
let isInBeforeClosing;
|
|
16387
16483
|
const root = ref();
|
|
16388
16484
|
const leftRef = ref();
|
|
16389
16485
|
const rightRef = ref();
|
|
@@ -16460,14 +16556,22 @@ var stdin_default$e = defineComponent({
|
|
|
16460
16556
|
}
|
|
16461
16557
|
};
|
|
16462
16558
|
const onClick = (position = "outside") => {
|
|
16559
|
+
if (isInBeforeClosing)
|
|
16560
|
+
return;
|
|
16463
16561
|
emit("click", position);
|
|
16464
16562
|
if (opened && !lockClick2) {
|
|
16563
|
+
isInBeforeClosing = true;
|
|
16465
16564
|
callInterceptor(props.beforeClose, {
|
|
16466
16565
|
args: [{
|
|
16467
16566
|
name: props.name,
|
|
16468
16567
|
position
|
|
16469
16568
|
}],
|
|
16470
|
-
done: () =>
|
|
16569
|
+
done: () => {
|
|
16570
|
+
isInBeforeClosing = false;
|
|
16571
|
+
close(position);
|
|
16572
|
+
},
|
|
16573
|
+
canceled: () => isInBeforeClosing = false,
|
|
16574
|
+
error: () => isInBeforeClosing = false
|
|
16471
16575
|
});
|
|
16472
16576
|
}
|
|
16473
16577
|
};
|
|
@@ -17139,10 +17243,11 @@ const Tag = withInstall(stdin_default$8);
|
|
|
17139
17243
|
const [name$2, bem$2] = createNamespace("text-ellipsis");
|
|
17140
17244
|
const textEllipsisProps = {
|
|
17141
17245
|
rows: makeNumericProp(1),
|
|
17246
|
+
dots: makeStringProp("..."),
|
|
17142
17247
|
content: makeStringProp(""),
|
|
17143
17248
|
expandText: makeStringProp(""),
|
|
17144
17249
|
collapseText: makeStringProp(""),
|
|
17145
|
-
|
|
17250
|
+
position: makeStringProp("end")
|
|
17146
17251
|
};
|
|
17147
17252
|
var stdin_default$7 = defineComponent({
|
|
17148
17253
|
name: name$2,
|
|
@@ -17155,6 +17260,7 @@ var stdin_default$7 = defineComponent({
|
|
|
17155
17260
|
const expanded = ref(false);
|
|
17156
17261
|
const hasAction = ref(false);
|
|
17157
17262
|
const root = ref();
|
|
17263
|
+
const actionText = computed(() => expanded.value ? props.collapseText : props.expandText);
|
|
17158
17264
|
const pxToNum = (value) => {
|
|
17159
17265
|
if (!value)
|
|
17160
17266
|
return 0;
|
|
@@ -17184,23 +17290,52 @@ var stdin_default$7 = defineComponent({
|
|
|
17184
17290
|
const calcEllipsisText = (container2, maxHeight2) => {
|
|
17185
17291
|
const {
|
|
17186
17292
|
content,
|
|
17187
|
-
|
|
17293
|
+
position,
|
|
17294
|
+
dots
|
|
17188
17295
|
} = props;
|
|
17189
|
-
const
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
|
|
17296
|
+
const end = content.length;
|
|
17297
|
+
const calcEllipse = () => {
|
|
17298
|
+
const tail = (left, right) => {
|
|
17299
|
+
if (right - left <= 1) {
|
|
17300
|
+
if (position === "end") {
|
|
17301
|
+
return content.slice(0, left) + dots;
|
|
17302
|
+
}
|
|
17303
|
+
return dots + content.slice(right, end);
|
|
17304
|
+
}
|
|
17305
|
+
const middle2 = Math.round((left + right) / 2);
|
|
17306
|
+
if (position === "end") {
|
|
17307
|
+
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
|
17308
|
+
} else {
|
|
17309
|
+
container2.innerText = dots + content.slice(middle2, end) + actionText.value;
|
|
17310
|
+
}
|
|
17311
|
+
if (container2.offsetHeight > maxHeight2) {
|
|
17312
|
+
if (position === "end") {
|
|
17313
|
+
return tail(left, middle2);
|
|
17314
|
+
}
|
|
17315
|
+
return tail(middle2, right);
|
|
17316
|
+
}
|
|
17317
|
+
if (position === "end") {
|
|
17318
|
+
return tail(middle2, right);
|
|
17319
|
+
}
|
|
17320
|
+
return tail(left, middle2);
|
|
17321
|
+
};
|
|
17322
|
+
container2.innerText = tail(0, end);
|
|
17323
|
+
};
|
|
17324
|
+
const middleTail = (leftPart, rightPart) => {
|
|
17325
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
|
17326
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
|
17201
17327
|
}
|
|
17202
|
-
|
|
17203
|
-
|
|
17328
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
|
17329
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
|
17330
|
+
container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end) + props.expandText;
|
|
17331
|
+
if (container2.offsetHeight >= maxHeight2) {
|
|
17332
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
|
17333
|
+
}
|
|
17334
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
|
17335
|
+
};
|
|
17336
|
+
const middle = 0 + end >> 1;
|
|
17337
|
+
props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end]) : calcEllipse();
|
|
17338
|
+
return container2.innerText;
|
|
17204
17339
|
};
|
|
17205
17340
|
const container = cloneContainer();
|
|
17206
17341
|
if (!container)
|
|
@@ -17210,7 +17345,7 @@ var stdin_default$7 = defineComponent({
|
|
|
17210
17345
|
paddingTop,
|
|
17211
17346
|
lineHeight
|
|
17212
17347
|
} = container.style;
|
|
17213
|
-
const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
|
|
17348
|
+
const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
|
|
17214
17349
|
if (maxHeight < container.offsetHeight) {
|
|
17215
17350
|
hasAction.value = true;
|
|
17216
17351
|
text.value = calcEllipsisText(container, maxHeight);
|
|
@@ -17224,26 +17359,17 @@ var stdin_default$7 = defineComponent({
|
|
|
17224
17359
|
expanded.value = !expanded.value;
|
|
17225
17360
|
emit("clickAction", event);
|
|
17226
17361
|
};
|
|
17227
|
-
const formatSearchKeyword = (keywords, text2) => {
|
|
17228
|
-
if (!keywords)
|
|
17229
|
-
return text2;
|
|
17230
|
-
const replaceReg = new RegExp(keywords, "ig");
|
|
17231
|
-
const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1);">${keywords}</span>`;
|
|
17232
|
-
return text2.replace(replaceReg, replaceString);
|
|
17233
|
-
};
|
|
17234
17362
|
const renderAction = () => createVNode("span", {
|
|
17235
17363
|
"class": bem$2("action"),
|
|
17236
17364
|
"onClick": onClickAction
|
|
17237
|
-
}, [
|
|
17365
|
+
}, [actionText.value]);
|
|
17238
17366
|
onMounted(calcEllipsised);
|
|
17239
|
-
watch(() => [props.content, props.rows], calcEllipsised);
|
|
17367
|
+
watch(() => [props.content, props.rows, props.position], calcEllipsised);
|
|
17240
17368
|
useEventListener("resize", calcEllipsised);
|
|
17241
17369
|
return () => createVNode("div", {
|
|
17242
17370
|
"ref": root,
|
|
17243
17371
|
"class": bem$2()
|
|
17244
|
-
}, [
|
|
17245
|
-
"innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
|
|
17246
|
-
}, null), hasAction.value ? renderAction() : null]);
|
|
17372
|
+
}, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
|
|
17247
17373
|
}
|
|
17248
17374
|
});
|
|
17249
17375
|
const TextEllipsis = withInstall(stdin_default$7);
|
|
@@ -18843,7 +18969,7 @@ const Lazyload = {
|
|
|
18843
18969
|
});
|
|
18844
18970
|
}
|
|
18845
18971
|
};
|
|
18846
|
-
const version = "3.1.
|
|
18972
|
+
const version = "3.1.8";
|
|
18847
18973
|
function install(app) {
|
|
18848
18974
|
const components = [
|
|
18849
18975
|
ActionSheet,
|