zartui 3.1.14 → 3.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/date-time-picker/DateTimePicker.mjs +1 -1
- package/es/dropdown-item/types.d.ts +3 -3
- package/es/field/Field.d.ts +1 -1
- package/es/field/index.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/multiple-picker/MultiplePicker.d.ts +16 -1
- package/es/multiple-picker/MultiplePicker.mjs +19 -2
- package/es/multiple-picker/MultiplePickerOptions.mjs +3 -1
- package/es/multiple-picker/index.d.ts +11 -1
- package/es/pull-refresh/PullRefresh.d.ts +5 -1
- package/es/pull-refresh/PullRefresh.mjs +15 -4
- package/es/pull-refresh/index.d.ts +2 -0
- package/es/utils/dom.d.ts +2 -0
- package/es/utils/dom.mjs +15 -0
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/date-time-picker/DateTimePicker.js +1 -1
- package/lib/dropdown-item/types.d.ts +3 -3
- package/lib/field/Field.d.ts +1 -1
- package/lib/field/index.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/multiple-picker/MultiplePicker.d.ts +16 -1
- package/lib/multiple-picker/MultiplePicker.js +19 -2
- package/lib/multiple-picker/MultiplePickerOptions.js +3 -1
- package/lib/multiple-picker/index.d.ts +11 -1
- package/lib/pull-refresh/PullRefresh.d.ts +5 -1
- package/lib/pull-refresh/PullRefresh.js +13 -2
- package/lib/pull-refresh/index.d.ts +2 -0
- package/lib/utils/dom.d.ts +2 -0
- package/lib/utils/dom.js +15 -0
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +49 -7
- package/lib/zartui.es.js +49 -7
- package/lib/zartui.js +49 -7
- package/lib/zartui.min.js +1 -1
- package/package.json +1 -1
|
@@ -51,11 +51,15 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
|
|
|
51
51
|
type: import("vue").PropType<number[]>;
|
|
52
52
|
default: () => number[];
|
|
53
53
|
};
|
|
54
|
+
selectedValue: {
|
|
55
|
+
type: import("vue").PropType<import("../utils").Numeric[]>;
|
|
56
|
+
default: () => import("../utils").Numeric[];
|
|
57
|
+
};
|
|
54
58
|
popup: {
|
|
55
59
|
type: BooleanConstructor;
|
|
56
60
|
default: true;
|
|
57
61
|
};
|
|
58
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
59
63
|
title: StringConstructor;
|
|
60
64
|
loading: BooleanConstructor;
|
|
61
65
|
readonly: BooleanConstructor;
|
|
@@ -106,6 +110,10 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
|
|
|
106
110
|
type: import("vue").PropType<number[]>;
|
|
107
111
|
default: () => number[];
|
|
108
112
|
};
|
|
113
|
+
selectedValue: {
|
|
114
|
+
type: import("vue").PropType<import("../utils").Numeric[]>;
|
|
115
|
+
default: () => import("../utils").Numeric[];
|
|
116
|
+
};
|
|
109
117
|
popup: {
|
|
110
118
|
type: BooleanConstructor;
|
|
111
119
|
default: true;
|
|
@@ -116,6 +124,7 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
|
|
|
116
124
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
117
125
|
"onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
|
|
118
126
|
"onUpdate:selectedIndex"?: ((...args: any[]) => any) | undefined;
|
|
127
|
+
"onUpdate:selectedValue"?: ((...args: any[]) => any) | undefined;
|
|
119
128
|
}, {
|
|
120
129
|
readonly: boolean;
|
|
121
130
|
closeOnClickOverlay: boolean;
|
|
@@ -132,6 +141,7 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
|
|
|
132
141
|
columnCounts: number;
|
|
133
142
|
toolbarPosition: string;
|
|
134
143
|
selectedIndex: number[];
|
|
144
|
+
selectedValue: import("../utils").Numeric[];
|
|
135
145
|
}, {}>>;
|
|
136
146
|
export default MultiplePicker;
|
|
137
147
|
export type { MultiplePickerProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ExtractPropTypes } from 'vue';
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { TargetContainer } from '../utils';
|
|
2
3
|
declare const pullRefreshProps: {
|
|
3
4
|
disabled: BooleanConstructor;
|
|
4
5
|
modelValue: BooleanConstructor;
|
|
@@ -19,6 +20,7 @@ declare const pullRefreshProps: {
|
|
|
19
20
|
type: (NumberConstructor | StringConstructor)[];
|
|
20
21
|
default: number;
|
|
21
22
|
};
|
|
23
|
+
scrollElement: PropType<TargetContainer>;
|
|
22
24
|
};
|
|
23
25
|
export type PullRefreshProps = ExtractPropTypes<typeof pullRefreshProps>;
|
|
24
26
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -41,6 +43,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
43
|
type: (NumberConstructor | StringConstructor)[];
|
|
42
44
|
default: number;
|
|
43
45
|
};
|
|
46
|
+
scrollElement: PropType<TargetContainer>;
|
|
44
47
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
45
48
|
disabled: BooleanConstructor;
|
|
46
49
|
modelValue: BooleanConstructor;
|
|
@@ -61,6 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
64
|
type: (NumberConstructor | StringConstructor)[];
|
|
62
65
|
default: number;
|
|
63
66
|
};
|
|
67
|
+
scrollElement: PropType<TargetContainer>;
|
|
64
68
|
}>> & {
|
|
65
69
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
66
70
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -39,7 +39,8 @@ const pullRefreshProps = {
|
|
|
39
39
|
loadingText: String,
|
|
40
40
|
pullDistance: import_utils.numericProp,
|
|
41
41
|
successDuration: (0, import_utils.makeNumericProp)(500),
|
|
42
|
-
animationDuration: (0, import_utils.makeNumericProp)(300)
|
|
42
|
+
animationDuration: (0, import_utils.makeNumericProp)(300),
|
|
43
|
+
scrollElement: null
|
|
43
44
|
};
|
|
44
45
|
var stdin_default = (0, import_vue2.defineComponent)({
|
|
45
46
|
name,
|
|
@@ -52,7 +53,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
52
53
|
let reachTop;
|
|
53
54
|
const root = (0, import_vue2.ref)();
|
|
54
55
|
const track = (0, import_vue2.ref)();
|
|
55
|
-
const
|
|
56
|
+
const rootScrollElement = (0, import_use.useScrollParent)(root);
|
|
57
|
+
const scrollParent = (0, import_vue2.computed)(() => {
|
|
58
|
+
if (props.scrollElement) {
|
|
59
|
+
const targetDom = (0, import_utils.getTargetDom)(props.scrollElement);
|
|
60
|
+
if (!targetDom) {
|
|
61
|
+
console.warn("\u8BF7\u68C0\u67E5props scroll-element\u5143\u7D20\u662F\u5426\u5B58\u5728\uFF01");
|
|
62
|
+
}
|
|
63
|
+
return targetDom != null ? targetDom : rootScrollElement.value;
|
|
64
|
+
}
|
|
65
|
+
return rootScrollElement.value;
|
|
66
|
+
});
|
|
56
67
|
const state = (0, import_vue2.reactive)({
|
|
57
68
|
status: "normal",
|
|
58
69
|
distance: 0,
|
|
@@ -18,6 +18,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
|
|
|
18
18
|
type: (NumberConstructor | StringConstructor)[];
|
|
19
19
|
default: number;
|
|
20
20
|
};
|
|
21
|
+
scrollElement: import("vue").PropType<import("../utils").TargetContainer>;
|
|
21
22
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
23
|
disabled: BooleanConstructor;
|
|
23
24
|
modelValue: BooleanConstructor;
|
|
@@ -38,6 +39,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
|
|
|
38
39
|
type: (NumberConstructor | StringConstructor)[];
|
|
39
40
|
default: number;
|
|
40
41
|
};
|
|
42
|
+
scrollElement: import("vue").PropType<import("../utils").TargetContainer>;
|
|
41
43
|
}>> & {
|
|
42
44
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
43
45
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
package/lib/utils/dom.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
export type ScrollElement = Element | Window;
|
|
3
|
+
export type TargetContainer = string | HTMLElement | (() => HTMLElement);
|
|
3
4
|
export declare function getScrollTop(el: ScrollElement): number;
|
|
4
5
|
export declare function setScrollTop(el: ScrollElement, value: number): void;
|
|
5
6
|
export declare function getRootScrollTop(): number;
|
|
@@ -10,4 +11,5 @@ export declare const stopPropagation: (event: Event) => void;
|
|
|
10
11
|
export declare function preventDefault(event: Event, isStopPropagation?: boolean): void;
|
|
11
12
|
export declare function isHidden(elementRef: HTMLElement | Ref<HTMLElement | undefined>): boolean;
|
|
12
13
|
export declare function colorFromCSSClass(className: string, defaultColor: string): string;
|
|
14
|
+
export declare const getTargetDom: (target: TargetContainer) => HTMLElement;
|
|
13
15
|
export declare const windowWidth: Ref<number>, windowHeight: Ref<number>;
|
package/lib/utils/dom.js
CHANGED
|
@@ -21,6 +21,7 @@ __export(stdin_exports, {
|
|
|
21
21
|
getElementTop: () => getElementTop,
|
|
22
22
|
getRootScrollTop: () => getRootScrollTop,
|
|
23
23
|
getScrollTop: () => getScrollTop,
|
|
24
|
+
getTargetDom: () => getTargetDom,
|
|
24
25
|
isHidden: () => isHidden,
|
|
25
26
|
preventDefault: () => preventDefault,
|
|
26
27
|
resetScroll: () => resetScroll,
|
|
@@ -94,4 +95,18 @@ function colorFromCSSClass(className, defaultColor) {
|
|
|
94
95
|
document.body.removeChild(tmp);
|
|
95
96
|
return !classColor ? defaultColor : classColor;
|
|
96
97
|
}
|
|
98
|
+
const getTargetDom = (target) => {
|
|
99
|
+
if (target) {
|
|
100
|
+
if (typeof target === "string") {
|
|
101
|
+
return document.querySelectorAll(target)[0];
|
|
102
|
+
}
|
|
103
|
+
if (typeof target === "function") {
|
|
104
|
+
return target();
|
|
105
|
+
}
|
|
106
|
+
if (typeof target === "object" && target instanceof window.HTMLElement) {
|
|
107
|
+
return target;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return document.body;
|
|
111
|
+
};
|
|
97
112
|
const { width: windowWidth, height: windowHeight } = (0, import_use.useWindowSize)();
|