zartui 3.1.7 → 3.1.9
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 +23 -0
- package/es/action-sheet/ActionSheet.d.ts +2 -2
- package/es/action-sheet/index.css +1 -1
- package/es/action-sheet/index.d.ts +2 -2
- package/es/avatar/index.css +1 -1
- package/es/badge/index.css +1 -1
- package/es/button/Button.d.ts +3 -3
- package/es/button/index.css +1 -1
- package/es/button/index.d.ts +3 -3
- package/es/calendar/Calendar.d.ts +2 -2
- package/es/calendar/index.css +1 -1
- 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.css +1 -1
- 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/collapse-item/index.css +1 -1
- 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.css +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/empty/index.css +1 -1
- package/es/field/Field.d.ts +3 -3
- package/es/field/Field.mjs +2 -0
- package/es/field/index.css +1 -1
- 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/hierarchy-select/HierarchySelect.d.ts +16 -1
- package/es/hierarchy-select/HierarchySelect.mjs +8 -5
- package/es/hierarchy-select/index.css +1 -1
- package/es/hierarchy-select/index.d.ts +11 -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.css +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-bar/IndexBar.d.ts +16 -1
- package/es/index-bar/IndexBar.mjs +6 -3
- package/es/index-bar/index.d.ts +12 -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/list/List.d.ts +7 -3
- package/es/list/List.mjs +5 -3
- package/es/list/index.css +1 -1
- package/es/list/index.d.ts +2 -0
- package/es/loading/index.css +1 -1
- package/es/media-picker/index.css +1 -1
- package/es/multiple-picker/index.css +1 -1
- 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/NumberKeyboard.mjs +5 -20
- package/es/number-keyboard/NumberKeyboardKey.d.ts +1 -1
- package/es/number-keyboard/index.css +1 -1
- package/es/number-keyboard/index.d.ts +3 -3
- package/es/number-keyboard/style/index.mjs +0 -1
- package/es/picker/index.css +1 -1
- 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.css +1 -1
- package/es/popup/index.d.ts +2 -2
- package/es/radio/index.css +1 -1
- package/es/radio-picker/index.css +1 -1
- package/es/search/Search.d.ts +1 -1
- package/es/search/index.css +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/step/index.css +1 -1
- 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/style/base.css +1 -1
- package/es/style/css-variables.css +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/tabbar-item/index.css +1 -1
- package/es/table/index.css +1 -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.css +1 -1
- package/es/text-ellipsis/index.d.ts +12 -3
- package/es/time-picker/index.css +1 -1
- package/es/timeline/index.css +1 -1
- 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.css +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.css +1 -1
- package/lib/action-sheet/index.d.ts +2 -2
- package/lib/avatar/index.css +1 -1
- package/lib/badge/index.css +1 -1
- package/lib/button/Button.d.ts +3 -3
- package/lib/button/index.css +1 -1
- package/lib/button/index.d.ts +3 -3
- package/lib/calendar/Calendar.d.ts +2 -2
- package/lib/calendar/index.css +1 -1
- 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.css +1 -1
- 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/collapse-item/index.css +1 -1
- 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.css +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/empty/index.css +1 -1
- package/lib/field/Field.d.ts +3 -3
- package/lib/field/Field.js +2 -0
- package/lib/field/index.css +1 -1
- 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/hierarchy-select/HierarchySelect.d.ts +16 -1
- package/lib/hierarchy-select/HierarchySelect.js +7 -4
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/hierarchy-select/index.d.ts +11 -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.css +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-bar/IndexBar.d.ts +16 -1
- package/lib/index-bar/IndexBar.js +5 -2
- package/lib/index-bar/index.d.ts +12 -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/list/List.d.ts +7 -3
- package/lib/list/List.js +4 -2
- package/lib/list/index.css +1 -1
- package/lib/list/index.d.ts +2 -0
- package/lib/loading/index.css +1 -1
- package/lib/media-picker/index.css +1 -1
- package/lib/multiple-picker/index.css +1 -1
- 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/NumberKeyboard.js +4 -19
- package/lib/number-keyboard/NumberKeyboardKey.d.ts +1 -1
- package/lib/number-keyboard/index.css +1 -1
- package/lib/number-keyboard/index.d.ts +3 -3
- package/lib/number-keyboard/style/index.js +0 -1
- package/lib/picker/index.css +1 -1
- 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.css +1 -1
- package/lib/popup/index.d.ts +2 -2
- package/lib/radio/index.css +1 -1
- package/lib/radio-picker/index.css +1 -1
- package/lib/search/Search.d.ts +1 -1
- package/lib/search/index.css +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/step/index.css +1 -1
- 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/style/base.css +1 -1
- package/lib/style/css-variables.css +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/tabbar-item/index.css +1 -1
- package/lib/table/index.css +1 -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.css +1 -1
- package/lib/text-ellipsis/index.d.ts +12 -3
- package/lib/time-picker/index.css +1 -1
- package/lib/timeline/index.css +1 -1
- 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.css +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 +230 -112
- package/lib/zartui.es.js +231 -113
- package/lib/zartui.js +230 -112
- package/lib/zartui.min.js +1 -1
- package/package.json +21 -11
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",
|
|
@@ -9160,6 +9217,7 @@ var stdin_default$_ = defineComponent({
|
|
|
9160
9217
|
});
|
|
9161
9218
|
return () => {
|
|
9162
9219
|
const disabled = getProp("disabled");
|
|
9220
|
+
const readonly = getProp("readonly");
|
|
9163
9221
|
const labelAlign = getProp("labelAlign");
|
|
9164
9222
|
const Label = renderLabel();
|
|
9165
9223
|
const TitleIcon = renderTitleIcon();
|
|
@@ -9171,6 +9229,7 @@ var stdin_default$_ = defineComponent({
|
|
|
9171
9229
|
"class": bem$G({
|
|
9172
9230
|
error: showError.value,
|
|
9173
9231
|
disabled,
|
|
9232
|
+
readonly,
|
|
9174
9233
|
[`label-${labelAlign}`]: labelAlign,
|
|
9175
9234
|
"error-message": props.errorMessage !== "" && typeof props.errorMessage !== "undefined",
|
|
9176
9235
|
description: props.description !== "" && typeof props.description !== "undefined",
|
|
@@ -9619,12 +9678,27 @@ var stdin_default$U = defineComponent({
|
|
|
9619
9678
|
}, [item[props.textKey]])]))])]);
|
|
9620
9679
|
}
|
|
9621
9680
|
});
|
|
9681
|
+
const useSyncPropRef = (getProp, setProp) => {
|
|
9682
|
+
const propRef = ref(getProp());
|
|
9683
|
+
watch(getProp, (value) => {
|
|
9684
|
+
if (value !== propRef.value) {
|
|
9685
|
+
propRef.value = value;
|
|
9686
|
+
}
|
|
9687
|
+
});
|
|
9688
|
+
watch(propRef, (value) => {
|
|
9689
|
+
if (value !== getProp()) {
|
|
9690
|
+
setProp(value);
|
|
9691
|
+
}
|
|
9692
|
+
});
|
|
9693
|
+
return propRef;
|
|
9694
|
+
};
|
|
9622
9695
|
const [name$B, bem$B] = createNamespace("hierarchy-select");
|
|
9623
9696
|
const hierarchySelectProps = {
|
|
9624
9697
|
treeData: {
|
|
9625
9698
|
type: Array,
|
|
9626
9699
|
default: () => []
|
|
9627
9700
|
},
|
|
9701
|
+
checkedList: makeArrayProp([]),
|
|
9628
9702
|
disableParent: {
|
|
9629
9703
|
type: Boolean,
|
|
9630
9704
|
default: false
|
|
@@ -9644,11 +9718,12 @@ const hierarchySelectProps = {
|
|
|
9644
9718
|
var stdin_default$T = defineComponent({
|
|
9645
9719
|
name: name$B,
|
|
9646
9720
|
props: hierarchySelectProps,
|
|
9647
|
-
emits: ["asyncGetter", "selected", "change"],
|
|
9721
|
+
emits: ["asyncGetter", "selected", "change", "update:checkedList"],
|
|
9648
9722
|
setup(props, {
|
|
9649
|
-
emit
|
|
9723
|
+
emit,
|
|
9724
|
+
slots
|
|
9650
9725
|
}) {
|
|
9651
|
-
const checkedList =
|
|
9726
|
+
const checkedList = useSyncPropRef(() => props.checkedList, (value) => emit("update:checkedList", value));
|
|
9652
9727
|
const choosedValue = ref();
|
|
9653
9728
|
const dataList = ref(deepClone(props.treeData));
|
|
9654
9729
|
const breadcrumbData = ref([]);
|
|
@@ -9817,7 +9892,7 @@ var stdin_default$T = defineComponent({
|
|
|
9817
9892
|
"onClick": () => {
|
|
9818
9893
|
selected(item);
|
|
9819
9894
|
}
|
|
9820
|
-
}, [item[props.textKey]]), createVNode("div", {
|
|
9895
|
+
}, [slots.content ? slots.content(item) : item[props.textKey]]), createVNode("div", {
|
|
9821
9896
|
"class": bem$B("item-nav"),
|
|
9822
9897
|
"onClick": () => {
|
|
9823
9898
|
toNextLevel(item, index);
|
|
@@ -9840,7 +9915,9 @@ var stdin_default$S = defineComponent({
|
|
|
9840
9915
|
minZoom: makeRequiredProp(numericProp),
|
|
9841
9916
|
maxZoom: makeRequiredProp(numericProp),
|
|
9842
9917
|
rootWidth: makeRequiredProp(Number),
|
|
9843
|
-
rootHeight: makeRequiredProp(Number)
|
|
9918
|
+
rootHeight: makeRequiredProp(Number),
|
|
9919
|
+
disableZoom: Boolean,
|
|
9920
|
+
closeOnClickOverlay: Boolean
|
|
9844
9921
|
},
|
|
9845
9922
|
emits: ["scale", "close", "longPress"],
|
|
9846
9923
|
setup(props, {
|
|
@@ -9978,7 +10055,8 @@ var stdin_default$S = defineComponent({
|
|
|
9978
10055
|
setScale(scale);
|
|
9979
10056
|
}
|
|
9980
10057
|
};
|
|
9981
|
-
const checkTap = () => {
|
|
10058
|
+
const checkTap = (event) => {
|
|
10059
|
+
var _a;
|
|
9982
10060
|
if (fingerNum > 1) {
|
|
9983
10061
|
return;
|
|
9984
10062
|
}
|
|
@@ -9996,6 +10074,9 @@ var stdin_default$S = defineComponent({
|
|
|
9996
10074
|
doubleTapTimer = null;
|
|
9997
10075
|
toggleScale();
|
|
9998
10076
|
} else {
|
|
10077
|
+
if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
|
10078
|
+
return;
|
|
10079
|
+
}
|
|
9999
10080
|
doubleTapTimer = setTimeout(() => {
|
|
10000
10081
|
emit("close");
|
|
10001
10082
|
doubleTapTimer = null;
|
|
@@ -10033,7 +10114,7 @@ var stdin_default$S = defineComponent({
|
|
|
10033
10114
|
}
|
|
10034
10115
|
}
|
|
10035
10116
|
preventDefault(event, stopPropagation2);
|
|
10036
|
-
checkTap();
|
|
10117
|
+
checkTap(event);
|
|
10037
10118
|
touch.reset();
|
|
10038
10119
|
};
|
|
10039
10120
|
const onLoad = (event) => {
|
|
@@ -10087,7 +10168,7 @@ var stdin_default$S = defineComponent({
|
|
|
10087
10168
|
}
|
|
10088
10169
|
});
|
|
10089
10170
|
const [name$A, bem$z] = createNamespace("image-preview");
|
|
10090
|
-
const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate"];
|
|
10171
|
+
const popupProps$1 = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
|
|
10091
10172
|
const imagePreviewProps = {
|
|
10092
10173
|
show: Boolean,
|
|
10093
10174
|
loop: truthProp,
|
|
@@ -10107,7 +10188,9 @@ const imagePreviewProps = {
|
|
|
10107
10188
|
startPosition: makeNumericProp(0),
|
|
10108
10189
|
showIndicators: Boolean,
|
|
10109
10190
|
closeOnPopstate: truthProp,
|
|
10110
|
-
|
|
10191
|
+
closeOnClickOverlay: truthProp,
|
|
10192
|
+
closeIconPosition: makeStringProp("top-right"),
|
|
10193
|
+
teleport: [String, Object]
|
|
10111
10194
|
};
|
|
10112
10195
|
var stdin_default$R = defineComponent({
|
|
10113
10196
|
name: name$A,
|
|
@@ -10121,7 +10204,8 @@ var stdin_default$R = defineComponent({
|
|
|
10121
10204
|
const state = reactive({
|
|
10122
10205
|
active: 0,
|
|
10123
10206
|
rootWidth: 0,
|
|
10124
|
-
rootHeight: 0
|
|
10207
|
+
rootHeight: 0,
|
|
10208
|
+
disableZoom: false
|
|
10125
10209
|
});
|
|
10126
10210
|
const resize2 = () => {
|
|
10127
10211
|
if (swipeRef.value) {
|
|
@@ -10177,6 +10261,12 @@ var stdin_default$R = defineComponent({
|
|
|
10177
10261
|
}, [slots.cover()]);
|
|
10178
10262
|
}
|
|
10179
10263
|
};
|
|
10264
|
+
const onDragStart = () => {
|
|
10265
|
+
state.disableZoom = true;
|
|
10266
|
+
};
|
|
10267
|
+
const onDragEnd = () => {
|
|
10268
|
+
state.disableZoom = false;
|
|
10269
|
+
};
|
|
10180
10270
|
const renderImages = () => createVNode(Swipe, {
|
|
10181
10271
|
"ref": swipeRef,
|
|
10182
10272
|
"lazyRender": true,
|
|
@@ -10186,7 +10276,9 @@ var stdin_default$R = defineComponent({
|
|
|
10186
10276
|
"initialSwipe": props.startPosition,
|
|
10187
10277
|
"showIndicators": props.showIndicators,
|
|
10188
10278
|
"indicatorColor": "white",
|
|
10189
|
-
"onChange": setActive
|
|
10279
|
+
"onChange": setActive,
|
|
10280
|
+
"onDragEnd": onDragEnd,
|
|
10281
|
+
"onDragStart": onDragStart
|
|
10190
10282
|
}, {
|
|
10191
10283
|
default: () => [props.images.map((image, index) => createVNode(stdin_default$S, {
|
|
10192
10284
|
"src": image.url,
|
|
@@ -10196,6 +10288,8 @@ var stdin_default$R = defineComponent({
|
|
|
10196
10288
|
"minZoom": props.minZoom,
|
|
10197
10289
|
"rootWidth": state.rootWidth,
|
|
10198
10290
|
"rootHeight": state.rootHeight,
|
|
10291
|
+
"disableZoom": state.disableZoom,
|
|
10292
|
+
"closeOnClickOverlay": props.closeOnClickOverlay,
|
|
10199
10293
|
"onScale": emitScale,
|
|
10200
10294
|
"onClose": emitClose,
|
|
10201
10295
|
"onLongPress": () => emit("longPress", {
|
|
@@ -10278,6 +10372,7 @@ const defaultConfig = {
|
|
|
10278
10372
|
swipeDuration: 300,
|
|
10279
10373
|
showIndicators: false,
|
|
10280
10374
|
closeOnPopstate: true,
|
|
10375
|
+
closeOnClickOverlay: true,
|
|
10281
10376
|
closeIconPosition: "top-right"
|
|
10282
10377
|
};
|
|
10283
10378
|
function initInstance$1() {
|
|
@@ -10335,6 +10430,7 @@ const [name$z, bem$y] = createNamespace("index-bar");
|
|
|
10335
10430
|
const indexBarProps = {
|
|
10336
10431
|
sticky: truthProp,
|
|
10337
10432
|
zIndex: numericProp,
|
|
10433
|
+
activeAnchor: makeNumericProp(""),
|
|
10338
10434
|
teleport: [String, Object],
|
|
10339
10435
|
highlightColor: String,
|
|
10340
10436
|
stickyOffsetTop: makeNumberProp(0),
|
|
@@ -10347,14 +10443,14 @@ const INDEX_BAR_KEY = Symbol(name$z);
|
|
|
10347
10443
|
var stdin_default$Q = defineComponent({
|
|
10348
10444
|
name: name$z,
|
|
10349
10445
|
props: indexBarProps,
|
|
10350
|
-
emits: ["select", "change"],
|
|
10446
|
+
emits: ["select", "change", "anchorClick", "update:activeAnchor"],
|
|
10351
10447
|
setup(props, {
|
|
10352
10448
|
emit,
|
|
10353
10449
|
slots
|
|
10354
10450
|
}) {
|
|
10355
10451
|
const root = ref();
|
|
10356
10452
|
const sidebar = ref();
|
|
10357
|
-
const activeAnchor =
|
|
10453
|
+
const activeAnchor = useSyncPropRef(() => props.activeAnchor, (value) => emit("update:activeAnchor", value));
|
|
10358
10454
|
const touchIndex = ref("");
|
|
10359
10455
|
const touch = useTouch();
|
|
10360
10456
|
const scrollParent = useScrollParent(root);
|
|
@@ -10456,6 +10552,7 @@ var stdin_default$Q = defineComponent({
|
|
|
10456
10552
|
}
|
|
10457
10553
|
});
|
|
10458
10554
|
const scrollTo = (index) => {
|
|
10555
|
+
emit("anchorClick", index);
|
|
10459
10556
|
selectActiveIndex = String(index);
|
|
10460
10557
|
const match = getMatchAnchor(selectActiveIndex);
|
|
10461
10558
|
if (match) {
|
|
@@ -10675,6 +10772,7 @@ const listProps = {
|
|
|
10675
10772
|
offset: makeNumericProp(300),
|
|
10676
10773
|
loading: Boolean,
|
|
10677
10774
|
finished: Boolean,
|
|
10775
|
+
scroller: Object,
|
|
10678
10776
|
errorText: String,
|
|
10679
10777
|
direction: makeStringProp("down"),
|
|
10680
10778
|
loadingText: String,
|
|
@@ -10694,6 +10792,7 @@ var stdin_default$O = defineComponent({
|
|
|
10694
10792
|
const placeholder = ref();
|
|
10695
10793
|
const tabStatus = useTabStatus();
|
|
10696
10794
|
const scrollParent = useScrollParent(root);
|
|
10795
|
+
const scroller = computed(() => props.scroller || scrollParent.value);
|
|
10697
10796
|
const check = () => {
|
|
10698
10797
|
nextTick(() => {
|
|
10699
10798
|
if (loading.value || props.finished || props.error || // skip check when inside an inactive tab
|
|
@@ -10704,7 +10803,7 @@ var stdin_default$O = defineComponent({
|
|
|
10704
10803
|
direction
|
|
10705
10804
|
} = props;
|
|
10706
10805
|
const offset2 = +props.offset;
|
|
10707
|
-
const scrollParentRect = useRect(
|
|
10806
|
+
const scrollParentRect = useRect(scroller);
|
|
10708
10807
|
if (!scrollParentRect.height || isHidden(root)) {
|
|
10709
10808
|
return;
|
|
10710
10809
|
}
|
|
@@ -10785,7 +10884,7 @@ var stdin_default$O = defineComponent({
|
|
|
10785
10884
|
check
|
|
10786
10885
|
});
|
|
10787
10886
|
useEventListener("scroll", check, {
|
|
10788
|
-
target:
|
|
10887
|
+
target: scroller,
|
|
10789
10888
|
passive: true
|
|
10790
10889
|
});
|
|
10791
10890
|
return () => {
|
|
@@ -13826,13 +13925,10 @@ var stdin_default$v = defineComponent({
|
|
|
13826
13925
|
};
|
|
13827
13926
|
const renderTitle = () => {
|
|
13828
13927
|
const {
|
|
13829
|
-
title
|
|
13830
|
-
theme,
|
|
13831
|
-
closeButtonText
|
|
13928
|
+
title
|
|
13832
13929
|
} = props;
|
|
13833
13930
|
const leftSlot = slots["title-left"];
|
|
13834
|
-
const
|
|
13835
|
-
const showTitle = title || showClose || leftSlot;
|
|
13931
|
+
const showTitle = title || leftSlot;
|
|
13836
13932
|
if (!showTitle) {
|
|
13837
13933
|
return;
|
|
13838
13934
|
}
|
|
@@ -13840,7 +13936,7 @@ var stdin_default$v = defineComponent({
|
|
|
13840
13936
|
"class": bem$n("header")
|
|
13841
13937
|
}, [leftSlot && createVNode("span", {
|
|
13842
13938
|
"class": bem$n("title-left")
|
|
13843
|
-
}, [leftSlot()]), title && createVNode("
|
|
13939
|
+
}, [leftSlot()]), title && createVNode("div", {
|
|
13844
13940
|
"class": bem$n("title")
|
|
13845
13941
|
}, [title])]);
|
|
13846
13942
|
};
|
|
@@ -13895,11 +13991,8 @@ var stdin_default$v = defineComponent({
|
|
|
13895
13991
|
return () => {
|
|
13896
13992
|
const Title = renderTitle();
|
|
13897
13993
|
const {
|
|
13898
|
-
theme,
|
|
13899
|
-
closeButtonText,
|
|
13900
13994
|
title
|
|
13901
13995
|
} = props;
|
|
13902
|
-
const showClose = closeButtonText && theme === "default";
|
|
13903
13996
|
const Content = createVNode(Transition, {
|
|
13904
13997
|
"name": props.transition ? "zt-slide-up" : ""
|
|
13905
13998
|
}, {
|
|
@@ -13916,15 +14009,7 @@ var stdin_default$v = defineComponent({
|
|
|
13916
14009
|
"class": [bem$n("body"), title ? "" : bem$n("body-no-title")]
|
|
13917
14010
|
}, [createVNode("div", {
|
|
13918
14011
|
"class": bem$n("keys")
|
|
13919
|
-
}, [renderKeys()]), renderSidebar()]),
|
|
13920
|
-
"class": bem$n("finish-button-box")
|
|
13921
|
-
}, [createVNode(stdin_default$1B, {
|
|
13922
|
-
"type": "primary",
|
|
13923
|
-
"block": true,
|
|
13924
|
-
"text": closeButtonText,
|
|
13925
|
-
"class": [bem$n("finish-button"), HAPTICS_FEEDBACK],
|
|
13926
|
-
"onClick": onClose
|
|
13927
|
-
}, null)])]), [[vShow, props.show]])]
|
|
14012
|
+
}, [renderKeys()]), renderSidebar()])]), [[vShow, props.show]])]
|
|
13928
14013
|
});
|
|
13929
14014
|
if (props.teleport) {
|
|
13930
14015
|
return createVNode(Teleport, {
|
|
@@ -14032,7 +14117,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14032
14117
|
});
|
|
14033
14118
|
};
|
|
14034
14119
|
const [name$m, bem$l] = createNamespace("popover");
|
|
14035
|
-
const popupProps = ["
|
|
14120
|
+
const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
|
|
14036
14121
|
const popoverProps = {
|
|
14037
14122
|
show: Boolean,
|
|
14038
14123
|
theme: makeStringProp("light"),
|
|
@@ -14075,6 +14160,7 @@ var stdin_default$t = defineComponent({
|
|
|
14075
14160
|
const wrapperRef = ref();
|
|
14076
14161
|
const popoverRef = ref();
|
|
14077
14162
|
const arrowRef = ref();
|
|
14163
|
+
const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
|
|
14078
14164
|
const getPopoverOptions = () => ({
|
|
14079
14165
|
placement: props.placement,
|
|
14080
14166
|
modifiers: [{
|
|
@@ -14097,7 +14183,7 @@ var stdin_default$t = defineComponent({
|
|
|
14097
14183
|
};
|
|
14098
14184
|
const updateLocation = () => {
|
|
14099
14185
|
nextTick(() => {
|
|
14100
|
-
if (!
|
|
14186
|
+
if (!show.value) {
|
|
14101
14187
|
return;
|
|
14102
14188
|
}
|
|
14103
14189
|
if (!popper) {
|
|
@@ -14111,10 +14197,12 @@ var stdin_default$t = defineComponent({
|
|
|
14111
14197
|
}
|
|
14112
14198
|
});
|
|
14113
14199
|
};
|
|
14114
|
-
const updateShow = (value) =>
|
|
14200
|
+
const updateShow = (value) => {
|
|
14201
|
+
show.value = value;
|
|
14202
|
+
};
|
|
14115
14203
|
const onClickWrapper = () => {
|
|
14116
14204
|
if (props.trigger === "click") {
|
|
14117
|
-
|
|
14205
|
+
show.value = !show.value;
|
|
14118
14206
|
}
|
|
14119
14207
|
};
|
|
14120
14208
|
const onClickAction = (action, index) => {
|
|
@@ -14127,12 +14215,12 @@ var stdin_default$t = defineComponent({
|
|
|
14127
14215
|
action.selected = true;
|
|
14128
14216
|
emit("select", action, index);
|
|
14129
14217
|
if (props.closeOnClickAction) {
|
|
14130
|
-
|
|
14218
|
+
show.value = false;
|
|
14131
14219
|
}
|
|
14132
14220
|
};
|
|
14133
14221
|
const onClickAway = () => {
|
|
14134
|
-
if (
|
|
14135
|
-
|
|
14222
|
+
if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
|
|
14223
|
+
show.value = false;
|
|
14136
14224
|
}
|
|
14137
14225
|
};
|
|
14138
14226
|
const renderActionContent = (action, index) => {
|
|
@@ -14249,7 +14337,7 @@ var stdin_default$t = defineComponent({
|
|
|
14249
14337
|
popper = null;
|
|
14250
14338
|
}
|
|
14251
14339
|
});
|
|
14252
|
-
watch(() => [
|
|
14340
|
+
watch(() => [show.value, props.offset, props.placement], updateLocation);
|
|
14253
14341
|
useClickAway(wrapperRef, onClickAway, {
|
|
14254
14342
|
eventName: "touchstart"
|
|
14255
14343
|
});
|
|
@@ -14261,14 +14349,13 @@ var stdin_default$t = defineComponent({
|
|
|
14261
14349
|
"onClick": onClickWrapper
|
|
14262
14350
|
}, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), createVNode(Popup, mergeProps({
|
|
14263
14351
|
"ref": popoverRef,
|
|
14264
|
-
"
|
|
14352
|
+
"show": show.value,
|
|
14353
|
+
"class": bem$l([props.theme, show.value ? "show" : "hidden"]),
|
|
14265
14354
|
"position": "",
|
|
14266
14355
|
"transition": "zt-popover-zoom",
|
|
14267
14356
|
"lockScroll": false,
|
|
14268
14357
|
"onUpdate:show": updateShow
|
|
14269
|
-
}, attrs, pick(props, popupProps), {
|
|
14270
|
-
"show": true
|
|
14271
|
-
}), {
|
|
14358
|
+
}, attrs, useScopeId(), pick(props, popupProps)), {
|
|
14272
14359
|
default: () => [props.showArrow && createVNode("div", {
|
|
14273
14360
|
"class": bem$l("arrow"),
|
|
14274
14361
|
"ref": arrowRef
|
|
@@ -16384,6 +16471,7 @@ var stdin_default$e = defineComponent({
|
|
|
16384
16471
|
let opened;
|
|
16385
16472
|
let lockClick2;
|
|
16386
16473
|
let startOffset;
|
|
16474
|
+
let isInBeforeClosing;
|
|
16387
16475
|
const root = ref();
|
|
16388
16476
|
const leftRef = ref();
|
|
16389
16477
|
const rightRef = ref();
|
|
@@ -16460,14 +16548,22 @@ var stdin_default$e = defineComponent({
|
|
|
16460
16548
|
}
|
|
16461
16549
|
};
|
|
16462
16550
|
const onClick = (position = "outside") => {
|
|
16551
|
+
if (isInBeforeClosing)
|
|
16552
|
+
return;
|
|
16463
16553
|
emit("click", position);
|
|
16464
16554
|
if (opened && !lockClick2) {
|
|
16555
|
+
isInBeforeClosing = true;
|
|
16465
16556
|
callInterceptor(props.beforeClose, {
|
|
16466
16557
|
args: [{
|
|
16467
16558
|
name: props.name,
|
|
16468
16559
|
position
|
|
16469
16560
|
}],
|
|
16470
|
-
done: () =>
|
|
16561
|
+
done: () => {
|
|
16562
|
+
isInBeforeClosing = false;
|
|
16563
|
+
close(position);
|
|
16564
|
+
},
|
|
16565
|
+
canceled: () => isInBeforeClosing = false,
|
|
16566
|
+
error: () => isInBeforeClosing = false
|
|
16471
16567
|
});
|
|
16472
16568
|
}
|
|
16473
16569
|
};
|
|
@@ -17139,10 +17235,11 @@ const Tag = withInstall(stdin_default$8);
|
|
|
17139
17235
|
const [name$2, bem$2] = createNamespace("text-ellipsis");
|
|
17140
17236
|
const textEllipsisProps = {
|
|
17141
17237
|
rows: makeNumericProp(1),
|
|
17238
|
+
dots: makeStringProp("..."),
|
|
17142
17239
|
content: makeStringProp(""),
|
|
17143
17240
|
expandText: makeStringProp(""),
|
|
17144
17241
|
collapseText: makeStringProp(""),
|
|
17145
|
-
|
|
17242
|
+
position: makeStringProp("end")
|
|
17146
17243
|
};
|
|
17147
17244
|
var stdin_default$7 = defineComponent({
|
|
17148
17245
|
name: name$2,
|
|
@@ -17155,6 +17252,7 @@ var stdin_default$7 = defineComponent({
|
|
|
17155
17252
|
const expanded = ref(false);
|
|
17156
17253
|
const hasAction = ref(false);
|
|
17157
17254
|
const root = ref();
|
|
17255
|
+
const actionText = computed(() => expanded.value ? props.collapseText : props.expandText);
|
|
17158
17256
|
const pxToNum = (value) => {
|
|
17159
17257
|
if (!value)
|
|
17160
17258
|
return 0;
|
|
@@ -17184,23 +17282,52 @@ var stdin_default$7 = defineComponent({
|
|
|
17184
17282
|
const calcEllipsisText = (container2, maxHeight2) => {
|
|
17185
17283
|
const {
|
|
17186
17284
|
content,
|
|
17187
|
-
|
|
17285
|
+
position,
|
|
17286
|
+
dots
|
|
17188
17287
|
} = props;
|
|
17189
|
-
const
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
|
|
17288
|
+
const end = content.length;
|
|
17289
|
+
const calcEllipse = () => {
|
|
17290
|
+
const tail = (left, right) => {
|
|
17291
|
+
if (right - left <= 1) {
|
|
17292
|
+
if (position === "end") {
|
|
17293
|
+
return content.slice(0, left) + dots;
|
|
17294
|
+
}
|
|
17295
|
+
return dots + content.slice(right, end);
|
|
17296
|
+
}
|
|
17297
|
+
const middle2 = Math.round((left + right) / 2);
|
|
17298
|
+
if (position === "end") {
|
|
17299
|
+
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
|
17300
|
+
} else {
|
|
17301
|
+
container2.innerText = dots + content.slice(middle2, end) + actionText.value;
|
|
17302
|
+
}
|
|
17303
|
+
if (container2.offsetHeight > maxHeight2) {
|
|
17304
|
+
if (position === "end") {
|
|
17305
|
+
return tail(left, middle2);
|
|
17306
|
+
}
|
|
17307
|
+
return tail(middle2, right);
|
|
17308
|
+
}
|
|
17309
|
+
if (position === "end") {
|
|
17310
|
+
return tail(middle2, right);
|
|
17311
|
+
}
|
|
17312
|
+
return tail(left, middle2);
|
|
17313
|
+
};
|
|
17314
|
+
container2.innerText = tail(0, end);
|
|
17315
|
+
};
|
|
17316
|
+
const middleTail = (leftPart, rightPart) => {
|
|
17317
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
|
17318
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
|
17201
17319
|
}
|
|
17202
|
-
|
|
17203
|
-
|
|
17320
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
|
17321
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
|
17322
|
+
container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end) + props.expandText;
|
|
17323
|
+
if (container2.offsetHeight >= maxHeight2) {
|
|
17324
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
|
17325
|
+
}
|
|
17326
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
|
17327
|
+
};
|
|
17328
|
+
const middle = 0 + end >> 1;
|
|
17329
|
+
props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end]) : calcEllipse();
|
|
17330
|
+
return container2.innerText;
|
|
17204
17331
|
};
|
|
17205
17332
|
const container = cloneContainer();
|
|
17206
17333
|
if (!container)
|
|
@@ -17210,7 +17337,7 @@ var stdin_default$7 = defineComponent({
|
|
|
17210
17337
|
paddingTop,
|
|
17211
17338
|
lineHeight
|
|
17212
17339
|
} = container.style;
|
|
17213
|
-
const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
|
|
17340
|
+
const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
|
|
17214
17341
|
if (maxHeight < container.offsetHeight) {
|
|
17215
17342
|
hasAction.value = true;
|
|
17216
17343
|
text.value = calcEllipsisText(container, maxHeight);
|
|
@@ -17224,26 +17351,17 @@ var stdin_default$7 = defineComponent({
|
|
|
17224
17351
|
expanded.value = !expanded.value;
|
|
17225
17352
|
emit("clickAction", event);
|
|
17226
17353
|
};
|
|
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
17354
|
const renderAction = () => createVNode("span", {
|
|
17235
17355
|
"class": bem$2("action"),
|
|
17236
17356
|
"onClick": onClickAction
|
|
17237
|
-
}, [
|
|
17357
|
+
}, [actionText.value]);
|
|
17238
17358
|
onMounted(calcEllipsised);
|
|
17239
|
-
watch(() => [props.content, props.rows], calcEllipsised);
|
|
17359
|
+
watch(() => [props.content, props.rows, props.position], calcEllipsised);
|
|
17240
17360
|
useEventListener("resize", calcEllipsised);
|
|
17241
17361
|
return () => createVNode("div", {
|
|
17242
17362
|
"ref": root,
|
|
17243
17363
|
"class": bem$2()
|
|
17244
|
-
}, [
|
|
17245
|
-
"innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
|
|
17246
|
-
}, null), hasAction.value ? renderAction() : null]);
|
|
17364
|
+
}, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
|
|
17247
17365
|
}
|
|
17248
17366
|
});
|
|
17249
17367
|
const TextEllipsis = withInstall(stdin_default$7);
|
|
@@ -18843,7 +18961,7 @@ const Lazyload = {
|
|
|
18843
18961
|
});
|
|
18844
18962
|
}
|
|
18845
18963
|
};
|
|
18846
|
-
const version = "3.1.
|
|
18964
|
+
const version = "3.1.9";
|
|
18847
18965
|
function install(app) {
|
|
18848
18966
|
const components = [
|
|
18849
18967
|
ActionSheet,
|