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/sticky/Sticky.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
32
|
type: (NumberConstructor | StringConstructor)[];
|
|
33
33
|
default: number;
|
|
34
34
|
};
|
|
35
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
35
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "change")[], "scroll" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
36
36
|
zIndex: (NumberConstructor | StringConstructor)[];
|
|
37
37
|
position: {
|
|
38
38
|
type: PropType<StickyPosition>;
|
package/lib/sticky/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const Sticky: import("../utils").WithInstall<import("vue").Define
|
|
|
13
13
|
type: (NumberConstructor | StringConstructor)[];
|
|
14
14
|
default: number;
|
|
15
15
|
};
|
|
16
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
16
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "change")[], "scroll" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
17
|
zIndex: (NumberConstructor | StringConstructor)[];
|
|
18
18
|
position: {
|
|
19
19
|
type: import("vue").PropType<import("./Sticky").StickyPosition>;
|
package/lib/swipe/Swipe.js
CHANGED
|
@@ -88,7 +88,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
88
88
|
const trackStyle = (0, import_vue2.computed)(() => {
|
|
89
89
|
const style = {
|
|
90
90
|
transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
|
|
91
|
-
transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
|
|
91
|
+
transform: `translate${props.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
|
|
92
92
|
};
|
|
93
93
|
if (size.value) {
|
|
94
94
|
const mainAxis = props.vertical ? "height" : "width";
|
package/lib/swipe/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-swipe-indicator-size: 4px;--zt-swipe-indicator-active-opacity: 1;--zt-swipe-indicator-inactive-opacity: .4;--zt-swipe-indicator-active-background: var(--zt-white);--zt-swipe-indicator-inactive-background: var(--zt-white);--zt-swipe-title-font-size: 16px;--zt-swipe-title-color: var(--zt-white);--zt-footer-padding: 0 16px;--zt-footer-height: 44px}.zt-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.zt-swipe__track{display:flex;height:100
|
|
1
|
+
:root{--zt-swipe-indicator-size: 4px;--zt-swipe-indicator-active-opacity: 1;--zt-swipe-indicator-inactive-opacity: .4;--zt-swipe-indicator-active-background: var(--zt-white);--zt-swipe-indicator-inactive-background: var(--zt-white);--zt-swipe-title-font-size: 16px;--zt-swipe-title-color: var(--zt-white);--zt-footer-padding: 0 16px;--zt-footer-height: 44px}.zt-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.zt-swipe__track{display:flex;height:100%;transition-property:transform}.zt-swipe__track--vertical{flex-direction:column}.zt-swipe__foot{background-image:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.6));height:var(--zt-footer-height);position:absolute;bottom:0;width:100%;padding:var(--zt-footer-padding);display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.zt-swipe__title{font-size:var(--zt-swipe-title-font-size);color:var(--zt-swipe-title-color)}.zt-swipe__indicators{display:flex}.zt-swipe__indicators--vertical{flex-direction:column}.zt-swipe__indicators--vertical .zt-swipe__indicator:not(:last-child){margin-bottom:var(--zt-swipe-indicator-size)}.zt-swipe__indicator{width:var(--zt-swipe-indicator-size);height:var(--zt-swipe-indicator-size);background-color:var(--zt-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--zt-swipe-indicator-inactive-opacity);transition:opacity var(--zt-duration-fast),background-color var(--zt-duration-fast)}.zt-swipe__indicator:not(:last-child){margin-right:var(--zt-swipe-indicator-size)}.zt-swipe__indicator--active{background-color:var(--zt-swipe-indicator-active-background);opacity:var(--zt-swipe-indicator-active-opacity)}
|
|
@@ -47,6 +47,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
47
47
|
let opened;
|
|
48
48
|
let lockClick;
|
|
49
49
|
let startOffset;
|
|
50
|
+
let isInBeforeClosing;
|
|
50
51
|
const root = (0, import_vue2.ref)();
|
|
51
52
|
const leftRef = (0, import_vue2.ref)();
|
|
52
53
|
const rightRef = (0, import_vue2.ref)();
|
|
@@ -123,14 +124,22 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
126
|
const onClick = (position = "outside") => {
|
|
127
|
+
if (isInBeforeClosing)
|
|
128
|
+
return;
|
|
126
129
|
emit("click", position);
|
|
127
130
|
if (opened && !lockClick) {
|
|
131
|
+
isInBeforeClosing = true;
|
|
128
132
|
(0, import_utils.callInterceptor)(props.beforeClose, {
|
|
129
133
|
args: [{
|
|
130
134
|
name: props.name,
|
|
131
135
|
position
|
|
132
136
|
}],
|
|
133
|
-
done: () =>
|
|
137
|
+
done: () => {
|
|
138
|
+
isInBeforeClosing = false;
|
|
139
|
+
close(position);
|
|
140
|
+
},
|
|
141
|
+
canceled: () => isInBeforeClosing = false,
|
|
142
|
+
error: () => isInBeforeClosing = false
|
|
134
143
|
});
|
|
135
144
|
}
|
|
136
145
|
};
|
package/lib/tabs/Tabs.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
88
88
|
};
|
|
89
89
|
titleActiveColor: StringConstructor;
|
|
90
90
|
titleInactiveColor: StringConstructor;
|
|
91
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
91
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "change" | "rendered" | "clickTab" | "update:active")[], "scroll" | "change" | "rendered" | "clickTab" | "update:active", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
92
92
|
type: {
|
|
93
93
|
type: PropType<TabsType>;
|
|
94
94
|
default: TabsType;
|
|
@@ -138,12 +138,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
138
138
|
"onUpdate:active"?: ((...args: any[]) => any) | undefined;
|
|
139
139
|
}, {
|
|
140
140
|
type: TabsType;
|
|
141
|
-
border: boolean;
|
|
142
|
-
duration: string | number;
|
|
143
|
-
lazyRender: boolean;
|
|
144
141
|
ellipsis: boolean;
|
|
145
142
|
sticky: boolean;
|
|
143
|
+
border: boolean;
|
|
146
144
|
active: string | number;
|
|
145
|
+
duration: string | number;
|
|
146
|
+
lazyRender: boolean;
|
|
147
147
|
offsetTop: string | number;
|
|
148
148
|
shrink: boolean;
|
|
149
149
|
animated: boolean;
|
package/lib/tabs/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare const Tabs: import("../utils").WithInstall<import("vue").DefineCo
|
|
|
41
41
|
};
|
|
42
42
|
titleActiveColor: StringConstructor;
|
|
43
43
|
titleInactiveColor: StringConstructor;
|
|
44
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
44
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "change" | "rendered" | "clickTab" | "update:active")[], "scroll" | "change" | "rendered" | "clickTab" | "update:active", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
45
|
type: {
|
|
46
46
|
type: import("vue").PropType<import("./types").TabsType>;
|
|
47
47
|
default: import("./types").TabsType;
|
|
@@ -91,12 +91,12 @@ export declare const Tabs: import("../utils").WithInstall<import("vue").DefineCo
|
|
|
91
91
|
"onUpdate:active"?: ((...args: any[]) => any) | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
type: import("./types").TabsType;
|
|
94
|
-
border: boolean;
|
|
95
|
-
duration: string | number;
|
|
96
|
-
lazyRender: boolean;
|
|
97
94
|
ellipsis: boolean;
|
|
98
95
|
sticky: boolean;
|
|
96
|
+
border: boolean;
|
|
99
97
|
active: string | number;
|
|
98
|
+
duration: string | number;
|
|
99
|
+
lazyRender: boolean;
|
|
100
100
|
offsetTop: string | number;
|
|
101
101
|
shrink: boolean;
|
|
102
102
|
animated: boolean;
|
package/lib/tag/Tag.d.ts
CHANGED
package/lib/tag/index.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ export declare const Tag: import("../utils").WithInstall<import("vue").DefineCom
|
|
|
72
72
|
mark: boolean;
|
|
73
73
|
type: import("./Tag").TagType;
|
|
74
74
|
badge: boolean;
|
|
75
|
-
show: boolean;
|
|
76
75
|
round: boolean;
|
|
76
|
+
show: boolean;
|
|
77
77
|
closeable: boolean;
|
|
78
78
|
plain: boolean;
|
|
79
79
|
badgeWidth: number;
|
|
@@ -4,6 +4,10 @@ export declare const textEllipsisProps: {
|
|
|
4
4
|
type: (NumberConstructor | StringConstructor)[];
|
|
5
5
|
default: number;
|
|
6
6
|
};
|
|
7
|
+
dots: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
7
11
|
content: {
|
|
8
12
|
type: import("vue").PropType<string>;
|
|
9
13
|
default: string;
|
|
@@ -16,7 +20,7 @@ export declare const textEllipsisProps: {
|
|
|
16
20
|
type: import("vue").PropType<string>;
|
|
17
21
|
default: string;
|
|
18
22
|
};
|
|
19
|
-
|
|
23
|
+
position: {
|
|
20
24
|
type: import("vue").PropType<string>;
|
|
21
25
|
default: string;
|
|
22
26
|
};
|
|
@@ -27,6 +31,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
31
|
type: (NumberConstructor | StringConstructor)[];
|
|
28
32
|
default: number;
|
|
29
33
|
};
|
|
34
|
+
dots: {
|
|
35
|
+
type: import("vue").PropType<string>;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
30
38
|
content: {
|
|
31
39
|
type: import("vue").PropType<string>;
|
|
32
40
|
default: string;
|
|
@@ -39,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
39
47
|
type: import("vue").PropType<string>;
|
|
40
48
|
default: string;
|
|
41
49
|
};
|
|
42
|
-
|
|
50
|
+
position: {
|
|
43
51
|
type: import("vue").PropType<string>;
|
|
44
52
|
default: string;
|
|
45
53
|
};
|
|
@@ -48,6 +56,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
56
|
type: (NumberConstructor | StringConstructor)[];
|
|
49
57
|
default: number;
|
|
50
58
|
};
|
|
59
|
+
dots: {
|
|
60
|
+
type: import("vue").PropType<string>;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
51
63
|
content: {
|
|
52
64
|
type: import("vue").PropType<string>;
|
|
53
65
|
default: string;
|
|
@@ -60,7 +72,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
72
|
type: import("vue").PropType<string>;
|
|
61
73
|
default: string;
|
|
62
74
|
};
|
|
63
|
-
|
|
75
|
+
position: {
|
|
64
76
|
type: import("vue").PropType<string>;
|
|
65
77
|
default: string;
|
|
66
78
|
};
|
|
@@ -68,9 +80,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
80
|
onClickAction?: ((...args: any[]) => any) | undefined;
|
|
69
81
|
}, {
|
|
70
82
|
content: string;
|
|
83
|
+
position: string;
|
|
71
84
|
rows: string | number;
|
|
85
|
+
dots: string;
|
|
72
86
|
expandText: string;
|
|
73
87
|
collapseText: string;
|
|
74
|
-
highlight: string;
|
|
75
88
|
}, {}>;
|
|
76
89
|
export default _default;
|
|
@@ -28,10 +28,11 @@ var import_utils = require("../utils");
|
|
|
28
28
|
const [name, bem] = (0, import_utils.createNamespace)("text-ellipsis");
|
|
29
29
|
const textEllipsisProps = {
|
|
30
30
|
rows: (0, import_utils.makeNumericProp)(1),
|
|
31
|
+
dots: (0, import_utils.makeStringProp)("..."),
|
|
31
32
|
content: (0, import_utils.makeStringProp)(""),
|
|
32
33
|
expandText: (0, import_utils.makeStringProp)(""),
|
|
33
34
|
collapseText: (0, import_utils.makeStringProp)(""),
|
|
34
|
-
|
|
35
|
+
position: (0, import_utils.makeStringProp)("end")
|
|
35
36
|
};
|
|
36
37
|
var stdin_default = (0, import_vue2.defineComponent)({
|
|
37
38
|
name,
|
|
@@ -44,6 +45,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
44
45
|
const expanded = (0, import_vue2.ref)(false);
|
|
45
46
|
const hasAction = (0, import_vue2.ref)(false);
|
|
46
47
|
const root = (0, import_vue2.ref)();
|
|
48
|
+
const actionText = (0, import_vue2.computed)(() => expanded.value ? props.collapseText : props.expandText);
|
|
47
49
|
const pxToNum = (value) => {
|
|
48
50
|
if (!value)
|
|
49
51
|
return 0;
|
|
@@ -73,23 +75,52 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
73
75
|
const calcEllipsisText = (container2, maxHeight2) => {
|
|
74
76
|
const {
|
|
75
77
|
content,
|
|
76
|
-
|
|
78
|
+
position,
|
|
79
|
+
dots
|
|
77
80
|
} = props;
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
const end = content.length;
|
|
82
|
+
const calcEllipse = () => {
|
|
83
|
+
const tail = (left, right) => {
|
|
84
|
+
if (right - left <= 1) {
|
|
85
|
+
if (position === "end") {
|
|
86
|
+
return content.slice(0, left) + dots;
|
|
87
|
+
}
|
|
88
|
+
return dots + content.slice(right, end);
|
|
89
|
+
}
|
|
90
|
+
const middle2 = Math.round((left + right) / 2);
|
|
91
|
+
if (position === "end") {
|
|
92
|
+
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
|
93
|
+
} else {
|
|
94
|
+
container2.innerText = dots + content.slice(middle2, end) + actionText.value;
|
|
95
|
+
}
|
|
96
|
+
if (container2.offsetHeight > maxHeight2) {
|
|
97
|
+
if (position === "end") {
|
|
98
|
+
return tail(left, middle2);
|
|
99
|
+
}
|
|
100
|
+
return tail(middle2, right);
|
|
101
|
+
}
|
|
102
|
+
if (position === "end") {
|
|
103
|
+
return tail(middle2, right);
|
|
104
|
+
}
|
|
105
|
+
return tail(left, middle2);
|
|
106
|
+
};
|
|
107
|
+
container2.innerText = tail(0, end);
|
|
108
|
+
};
|
|
109
|
+
const middleTail = (leftPart, rightPart) => {
|
|
110
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
|
111
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
|
90
112
|
}
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
|
114
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
|
115
|
+
container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end) + props.expandText;
|
|
116
|
+
if (container2.offsetHeight >= maxHeight2) {
|
|
117
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
|
118
|
+
}
|
|
119
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
|
120
|
+
};
|
|
121
|
+
const middle = 0 + end >> 1;
|
|
122
|
+
props.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end]) : calcEllipse();
|
|
123
|
+
return container2.innerText;
|
|
93
124
|
};
|
|
94
125
|
const container = cloneContainer();
|
|
95
126
|
if (!container)
|
|
@@ -99,7 +130,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
99
130
|
paddingTop,
|
|
100
131
|
lineHeight
|
|
101
132
|
} = container.style;
|
|
102
|
-
const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
|
|
133
|
+
const maxHeight = Math.ceil((Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
|
|
103
134
|
if (maxHeight < container.offsetHeight) {
|
|
104
135
|
hasAction.value = true;
|
|
105
136
|
text.value = calcEllipsisText(container, maxHeight);
|
|
@@ -113,25 +144,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
113
144
|
expanded.value = !expanded.value;
|
|
114
145
|
emit("clickAction", event);
|
|
115
146
|
};
|
|
116
|
-
const formatSearchKeyword = (keywords, text2) => {
|
|
117
|
-
if (!keywords)
|
|
118
|
-
return text2;
|
|
119
|
-
const replaceReg = new RegExp(keywords, "ig");
|
|
120
|
-
const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1);">${keywords}</span>`;
|
|
121
|
-
return text2.replace(replaceReg, replaceString);
|
|
122
|
-
};
|
|
123
147
|
const renderAction = () => (0, import_vue.createVNode)("span", {
|
|
124
148
|
"class": bem("action"),
|
|
125
149
|
"onClick": onClickAction
|
|
126
|
-
}, [
|
|
150
|
+
}, [actionText.value]);
|
|
127
151
|
(0, import_vue2.onMounted)(calcEllipsised);
|
|
128
|
-
(0, import_vue2.watch)(() => [props.content, props.rows], calcEllipsised);
|
|
152
|
+
(0, import_vue2.watch)(() => [props.content, props.rows, props.position], calcEllipsised);
|
|
129
153
|
(0, import_use.useEventListener)("resize", calcEllipsised);
|
|
130
154
|
return () => (0, import_vue.createVNode)("div", {
|
|
131
155
|
"ref": root,
|
|
132
156
|
"class": bem()
|
|
133
|
-
}, [
|
|
134
|
-
"innerHTML": formatSearchKeyword(props.highlight, expanded.value ? props.content : text.value)
|
|
135
|
-
}, null), hasAction.value ? renderAction() : null]);
|
|
157
|
+
}, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
|
|
136
158
|
}
|
|
137
159
|
});
|
|
@@ -3,6 +3,10 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
|
3
3
|
type: (NumberConstructor | StringConstructor)[];
|
|
4
4
|
default: number;
|
|
5
5
|
};
|
|
6
|
+
dots: {
|
|
7
|
+
type: import("vue").PropType<string>;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
6
10
|
content: {
|
|
7
11
|
type: import("vue").PropType<string>;
|
|
8
12
|
default: string;
|
|
@@ -15,7 +19,7 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
|
15
19
|
type: import("vue").PropType<string>;
|
|
16
20
|
default: string;
|
|
17
21
|
};
|
|
18
|
-
|
|
22
|
+
position: {
|
|
19
23
|
type: import("vue").PropType<string>;
|
|
20
24
|
default: string;
|
|
21
25
|
};
|
|
@@ -24,6 +28,10 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
|
24
28
|
type: (NumberConstructor | StringConstructor)[];
|
|
25
29
|
default: number;
|
|
26
30
|
};
|
|
31
|
+
dots: {
|
|
32
|
+
type: import("vue").PropType<string>;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
27
35
|
content: {
|
|
28
36
|
type: import("vue").PropType<string>;
|
|
29
37
|
default: string;
|
|
@@ -36,7 +44,7 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
|
36
44
|
type: import("vue").PropType<string>;
|
|
37
45
|
default: string;
|
|
38
46
|
};
|
|
39
|
-
|
|
47
|
+
position: {
|
|
40
48
|
type: import("vue").PropType<string>;
|
|
41
49
|
default: string;
|
|
42
50
|
};
|
|
@@ -44,10 +52,11 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
|
44
52
|
onClickAction?: ((...args: any[]) => any) | undefined;
|
|
45
53
|
}, {
|
|
46
54
|
content: string;
|
|
55
|
+
position: string;
|
|
47
56
|
rows: string | number;
|
|
57
|
+
dots: string;
|
|
48
58
|
expandText: string;
|
|
49
59
|
collapseText: string;
|
|
50
|
-
highlight: string;
|
|
51
60
|
}, {}>>;
|
|
52
61
|
export default TextEllipsis;
|
|
53
62
|
export { textEllipsisProps } from './TextEllipsis';
|
package/lib/toast/Toast.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType, CSSProperties, ExtractPropTypes } from 'vue';
|
|
2
2
|
import { LoadingType } from '../loading';
|
|
3
|
-
import type { ToastType, ToastPosition } from './types';
|
|
3
|
+
import type { ToastType, ToastPosition, ToastWordBreak } from './types';
|
|
4
4
|
declare const toastProps: {
|
|
5
5
|
icon: StringConstructor;
|
|
6
6
|
show: BooleanConstructor;
|
|
@@ -20,6 +20,7 @@ declare const toastProps: {
|
|
|
20
20
|
default: ToastPosition;
|
|
21
21
|
};
|
|
22
22
|
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
23
|
+
wordBreak: PropType<ToastWordBreak>;
|
|
23
24
|
className: PropType<unknown>;
|
|
24
25
|
iconPrefix: StringConstructor;
|
|
25
26
|
transition: {
|
|
@@ -53,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
54
|
default: ToastPosition;
|
|
54
55
|
};
|
|
55
56
|
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
57
|
+
wordBreak: PropType<ToastWordBreak>;
|
|
56
58
|
className: PropType<unknown>;
|
|
57
59
|
iconPrefix: StringConstructor;
|
|
58
60
|
transition: {
|
|
@@ -84,6 +86,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
86
|
default: ToastPosition;
|
|
85
87
|
};
|
|
86
88
|
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
89
|
+
wordBreak: PropType<ToastWordBreak>;
|
|
87
90
|
className: PropType<unknown>;
|
|
88
91
|
iconPrefix: StringConstructor;
|
|
89
92
|
transition: {
|
|
@@ -101,8 +104,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
101
104
|
}, {
|
|
102
105
|
type: ToastType;
|
|
103
106
|
position: ToastPosition;
|
|
104
|
-
show: boolean;
|
|
105
107
|
overlay: boolean;
|
|
108
|
+
show: boolean;
|
|
106
109
|
duration: number;
|
|
107
110
|
closeOnClickOverlay: boolean;
|
|
108
111
|
transition: string;
|
package/lib/toast/Toast.js
CHANGED
|
@@ -39,6 +39,7 @@ const toastProps = {
|
|
|
39
39
|
duration: (0, import_utils.makeNumberProp)(2e3),
|
|
40
40
|
position: (0, import_utils.makeStringProp)("middle"),
|
|
41
41
|
teleport: [String, Object],
|
|
42
|
+
wordBreak: String,
|
|
42
43
|
className: import_utils.unknownProp,
|
|
43
44
|
iconPrefix: String,
|
|
44
45
|
transition: (0, import_utils.makeStringProp)("zt-fade"),
|
|
@@ -124,7 +125,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
124
125
|
(0, import_vue2.onMounted)(toggleClickable);
|
|
125
126
|
(0, import_vue2.onUnmounted)(toggleClickable);
|
|
126
127
|
return () => (0, import_vue.createVNode)(import_popup.Popup, (0, import_vue.mergeProps)({
|
|
127
|
-
"class": [bem([props.position, {
|
|
128
|
+
"class": [bem([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
|
|
128
129
|
[props.type]: !props.icon
|
|
129
130
|
}]), props.className],
|
|
130
131
|
"lockScroll": false,
|
package/lib/toast/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-toast-max-width: 70%;--zt-toast-font-size: var(--zt-font-size-md);--zt-toast-text-color: var(--zt-white);--zt-toast-loading-icon-color: var(--zt-white);--zt-toast-line-height: var(--zt-line-height-md);--zt-toast-radius: var(--zt-radius-lg);--zt-toast-background: rgba(45, 75, 115, .8);--zt-toast-icon-size: 36px;--zt-toast-text-min-width: 96px;--zt-toast-text-padding: var(--zt-padding-xs) var(--zt-padding-sm);--zt-toast-default-padding: var(--zt-padding-md);--zt-toast-default-width: 88px;--zt-toast-default-min-height: 84px;--zt-toast-position-top-distance: 20%;--zt-toast-position-bottom-distance: 20%}.zt-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--zt-duration-fast);width:var(--zt-toast-default-width);max-width:var(--zt-toast-max-width);min-height:var(--zt-toast-default-min-height);padding:var(--zt-toast-default-padding);color:var(--zt-toast-text-color);font-size:var(--zt-toast-font-size);line-height:var(--zt-toast-line-height);white-space:pre-wrap;text-align:center;word-break:break-all;background:var(--zt-toast-background);border-radius:var(--zt-toast-radius)}.zt-toast--unclickable{overflow:hidden;cursor:not-allowed}.zt-toast--unclickable *{pointer-events:none}.zt-toast--text,.zt-toast--html{width:-webkit-fit-content;width:fit-content;min-width:var(--zt-toast-text-min-width);min-height:0;padding:var(--zt-toast-text-padding)}.zt-toast--text .zt-toast__text,.zt-toast--html .zt-toast__text{margin-top:0}.zt-toast--top{top:var(--zt-toast-position-top-distance)}.zt-toast--bottom{top:auto;bottom:var(--zt-toast-position-bottom-distance)}.zt-toast__icon{font-size:var(--zt-toast-icon-size)}.zt-toast__loading{padding:var(--zt-padding-base);color:var(--zt-toast-loading-icon-color)}.zt-toast__text{margin-top:var(--zt-padding-xs)}.zt-theme-dark{--zt-toast-background: rgba(255, 255, 255, .1);--zt-toast-text-color: var(--zt-white)}
|
|
1
|
+
:root{--zt-toast-max-width: 70%;--zt-toast-font-size: var(--zt-font-size-md);--zt-toast-text-color: var(--zt-white);--zt-toast-loading-icon-color: var(--zt-white);--zt-toast-line-height: var(--zt-line-height-md);--zt-toast-radius: var(--zt-radius-lg);--zt-toast-background: rgba(45, 75, 115, .8);--zt-toast-icon-size: 36px;--zt-toast-text-min-width: 96px;--zt-toast-text-padding: var(--zt-padding-xs) var(--zt-padding-sm);--zt-toast-default-padding: var(--zt-padding-md);--zt-toast-default-width: 88px;--zt-toast-default-min-height: 84px;--zt-toast-position-top-distance: 20%;--zt-toast-position-bottom-distance: 20%}.zt-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--zt-duration-fast);width:var(--zt-toast-default-width);max-width:var(--zt-toast-max-width);min-height:var(--zt-toast-default-min-height);padding:var(--zt-toast-default-padding);color:var(--zt-toast-text-color);font-size:var(--zt-toast-font-size);line-height:var(--zt-toast-line-height);white-space:pre-wrap;text-align:center;word-break:break-all;background:var(--zt-toast-background);border-radius:var(--zt-toast-radius)}.zt-toast--break-normal{word-break:normal;word-wrap:normal}.zt-toast--break-word{word-break:normal;word-wrap:break-word}.zt-toast--unclickable{overflow:hidden;cursor:not-allowed}.zt-toast--unclickable *{pointer-events:none}.zt-toast--text,.zt-toast--html{width:-webkit-fit-content;width:fit-content;min-width:var(--zt-toast-text-min-width);min-height:0;padding:var(--zt-toast-text-padding)}.zt-toast--text .zt-toast__text,.zt-toast--html .zt-toast__text{margin-top:0}.zt-toast--top{top:var(--zt-toast-position-top-distance)}.zt-toast--bottom{top:auto;bottom:var(--zt-toast-position-bottom-distance)}.zt-toast__icon{font-size:var(--zt-toast-icon-size)}.zt-toast__loading{padding:var(--zt-padding-base);color:var(--zt-toast-loading-icon-color)}.zt-toast__text{margin-top:var(--zt-padding-xs)}.zt-theme-dark{--zt-toast-background: rgba(255, 255, 255, .1);--zt-toast-text-color: var(--zt-white)}
|
package/lib/toast/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
|
|
|
17
17
|
default: import("./types").ToastPosition;
|
|
18
18
|
};
|
|
19
19
|
teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
|
20
|
+
wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
|
|
20
21
|
className: import("vue").PropType<unknown>;
|
|
21
22
|
iconPrefix: StringConstructor;
|
|
22
23
|
transition: {
|
|
@@ -48,6 +49,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
|
|
|
48
49
|
default: import("./types").ToastPosition;
|
|
49
50
|
};
|
|
50
51
|
teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
|
52
|
+
wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
|
|
51
53
|
className: import("vue").PropType<unknown>;
|
|
52
54
|
iconPrefix: StringConstructor;
|
|
53
55
|
transition: {
|
|
@@ -65,8 +67,8 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
|
|
|
65
67
|
}, {
|
|
66
68
|
type: import("./types").ToastType;
|
|
67
69
|
position: import("./types").ToastPosition;
|
|
68
|
-
show: boolean;
|
|
69
70
|
overlay: boolean;
|
|
71
|
+
show: boolean;
|
|
70
72
|
duration: number;
|
|
71
73
|
closeOnClickOverlay: boolean;
|
|
72
74
|
transition: string;
|
|
@@ -76,7 +78,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
|
|
|
76
78
|
export default Toast;
|
|
77
79
|
export { showToast, closeToast, showFailToast, showLoadingToast, showSuccessToast, allowMultipleToast, setToastDefaultOptions, resetToastDefaultOptions, } from './function-call';
|
|
78
80
|
export type { ToastProps } from './Toast';
|
|
79
|
-
export type { ToastType, ToastOptions, ToastPosition } from './types';
|
|
81
|
+
export type { ToastType, ToastOptions, ToastPosition, ToastWordBreak, ToastWrapperInstance, } from './types';
|
|
80
82
|
declare module 'vue' {
|
|
81
83
|
interface GlobalComponents {
|
|
82
84
|
ZtToast: typeof Toast;
|
package/lib/toast/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { LoadingType } from '../loading';
|
|
|
3
3
|
import type { Numeric } from '../utils';
|
|
4
4
|
export type ToastType = 'text' | 'loading' | 'success' | 'warning' | 'html';
|
|
5
5
|
export type ToastPosition = 'top' | 'middle' | 'bottom';
|
|
6
|
+
export type ToastWordBreak = 'break-all' | 'break-word' | 'normal';
|
|
6
7
|
export type ToastOptions = {
|
|
7
8
|
icon?: string;
|
|
8
9
|
type?: ToastType;
|
|
@@ -18,6 +19,7 @@ export type ToastOptions = {
|
|
|
18
19
|
className?: unknown;
|
|
19
20
|
transition?: string;
|
|
20
21
|
iconPrefix?: string;
|
|
22
|
+
wordBreak?: ToastWordBreak;
|
|
21
23
|
loadingType?: LoadingType;
|
|
22
24
|
forbidClick?: boolean;
|
|
23
25
|
closeOnClick?: boolean;
|
|
@@ -197,10 +197,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
197
197
|
name: string | number;
|
|
198
198
|
disabled: boolean;
|
|
199
199
|
accept: string;
|
|
200
|
+
multiple: boolean;
|
|
200
201
|
modelValue: UploaderFileListItem[];
|
|
201
202
|
readonly: boolean;
|
|
202
203
|
lazyLoad: boolean;
|
|
203
|
-
multiple: boolean;
|
|
204
204
|
resultType: UploaderResultType;
|
|
205
205
|
maxCount: string | number;
|
|
206
206
|
imageFit: ImageFit;
|
package/lib/uploader/index.d.ts
CHANGED
|
@@ -130,10 +130,10 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
|
|
|
130
130
|
name: string | number;
|
|
131
131
|
disabled: boolean;
|
|
132
132
|
accept: string;
|
|
133
|
+
multiple: boolean;
|
|
133
134
|
modelValue: import("./types").UploaderFileListItem[];
|
|
134
135
|
readonly: boolean;
|
|
135
136
|
lazyLoad: boolean;
|
|
136
|
-
multiple: boolean;
|
|
137
137
|
resultType: import("./types").UploaderResultType;
|
|
138
138
|
maxCount: string | number;
|
|
139
139
|
imageFit: import("..").ImageFit;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type Interceptor = (...args: any[]) => Promise<boolean> | boolean | undefined | void;
|
|
2
|
-
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, }: {
|
|
2
|
+
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, error, }: {
|
|
3
3
|
args?: unknown[];
|
|
4
4
|
done: () => void;
|
|
5
5
|
canceled?: () => void;
|
|
6
|
+
error?: () => void;
|
|
6
7
|
}): void;
|
package/lib/utils/interceptor.js
CHANGED
|
@@ -25,7 +25,8 @@ var import_validate = require("./validate");
|
|
|
25
25
|
function callInterceptor(interceptor, {
|
|
26
26
|
args = [],
|
|
27
27
|
done,
|
|
28
|
-
canceled
|
|
28
|
+
canceled,
|
|
29
|
+
error
|
|
29
30
|
}) {
|
|
30
31
|
if (interceptor) {
|
|
31
32
|
const returnVal = interceptor.apply(null, args);
|
|
@@ -36,7 +37,7 @@ function callInterceptor(interceptor, {
|
|
|
36
37
|
} else if (canceled) {
|
|
37
38
|
canceled();
|
|
38
39
|
}
|
|
39
|
-
}).catch(import_basic.noop);
|
|
40
|
+
}).catch(error || import_basic.noop);
|
|
40
41
|
} else if (returnVal) {
|
|
41
42
|
done();
|
|
42
43
|
} else if (canceled) {
|
package/lib/vue-sfc-shim.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare module '*.vue' {
|
|
2
|
-
// eslint-disable-next-line
|
|
3
|
-
import { DefineComponent } from 'vue';
|
|
4
|
-
const Component: DefineComponent;
|
|
5
|
-
export default Component;
|
|
6
|
-
}
|
|
1
|
+
declare module '*.vue' {
|
|
2
|
+
// eslint-disable-next-line
|
|
3
|
+
import { DefineComponent } from 'vue';
|
|
4
|
+
const Component: DefineComponent;
|
|
5
|
+
export default Component;
|
|
6
|
+
}
|
package/lib/vue-tsx-shim.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import 'vue';
|
|
2
|
-
|
|
3
|
-
type EventHandler = (...args: any[]) => void;
|
|
4
|
-
|
|
5
|
-
declare module 'vue' {
|
|
6
|
-
interface ComponentCustomProps {
|
|
7
|
-
id?: string;
|
|
8
|
-
role?: string;
|
|
9
|
-
tabindex?: number;
|
|
10
|
-
onClick?: EventHandler;
|
|
11
|
-
onTouchend?: EventHandler;
|
|
12
|
-
onTouchmove?: EventHandler;
|
|
13
|
-
onTouchstart?: EventHandler;
|
|
14
|
-
onTouchcancel?: EventHandler;
|
|
15
|
-
onTouchmovePassive?: EventHandler;
|
|
16
|
-
onTouchstartPassive?: EventHandler;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface HTMLAttributes {
|
|
20
|
-
onTouchmovePassive?: EventHandler;
|
|
21
|
-
onTouchstartPassive?: EventHandler;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
import 'vue';
|
|
2
|
+
|
|
3
|
+
type EventHandler = (...args: any[]) => void;
|
|
4
|
+
|
|
5
|
+
declare module 'vue' {
|
|
6
|
+
interface ComponentCustomProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
tabindex?: number;
|
|
10
|
+
onClick?: EventHandler;
|
|
11
|
+
onTouchend?: EventHandler;
|
|
12
|
+
onTouchmove?: EventHandler;
|
|
13
|
+
onTouchstart?: EventHandler;
|
|
14
|
+
onTouchcancel?: EventHandler;
|
|
15
|
+
onTouchmovePassive?: EventHandler;
|
|
16
|
+
onTouchstartPassive?: EventHandler;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface HTMLAttributes {
|
|
20
|
+
onTouchmovePassive?: EventHandler;
|
|
21
|
+
onTouchstartPassive?: EventHandler;
|
|
22
|
+
}
|
|
23
|
+
}
|