zartui 3.1.15 → 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/lazyload/vue-lazyload/index.d.ts +55 -55
- 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/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- 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/lazyload/vue-lazyload/index.d.ts +55 -55
- 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/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 +28 -3
- package/lib/zartui.es.js +28 -3
- package/lib/zartui.js +28 -3
- package/lib/zartui.min.js +1 -1
- package/package.json +79 -79
package/es/cell/Cell.d.ts
CHANGED
|
@@ -194,8 +194,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
194
194
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
195
195
|
}, {
|
|
196
196
|
replace: boolean;
|
|
197
|
-
value: string;
|
|
198
197
|
center: boolean;
|
|
198
|
+
value: string;
|
|
199
199
|
border: boolean;
|
|
200
200
|
direction: CellDirection;
|
|
201
201
|
isLink: boolean;
|
package/es/cell/index.d.ts
CHANGED
|
@@ -97,8 +97,8 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
|
97
97
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
98
98
|
}, {
|
|
99
99
|
replace: boolean;
|
|
100
|
-
value: string;
|
|
101
100
|
center: boolean;
|
|
101
|
+
value: string;
|
|
102
102
|
border: boolean;
|
|
103
103
|
direction: import("./types").CellDirection;
|
|
104
104
|
isLink: boolean;
|
|
@@ -3,10 +3,10 @@ import type { VNode, ComponentPublicInstance } from 'vue';
|
|
|
3
3
|
import type { Numeric } from '../utils';
|
|
4
4
|
export type DropdownItemOptionValue = Numeric | boolean | string;
|
|
5
5
|
export type DropdownItemOption = {
|
|
6
|
-
text
|
|
6
|
+
text?: string;
|
|
7
7
|
icon?: string;
|
|
8
|
-
value
|
|
9
|
-
selected
|
|
8
|
+
value?: DropdownItemOptionValue;
|
|
9
|
+
selected?: boolean;
|
|
10
10
|
[key: PropertyKey]: any;
|
|
11
11
|
};
|
|
12
12
|
export type DropdownItemExpose = {
|
package/es/field/Field.d.ts
CHANGED
|
@@ -382,11 +382,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
382
382
|
onClickRightIcon?: ((...args: any[]) => any) | undefined;
|
|
383
383
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
384
384
|
}, {
|
|
385
|
+
center: boolean;
|
|
385
386
|
type: FieldType;
|
|
386
387
|
autofocus: boolean;
|
|
387
388
|
disabled: boolean;
|
|
388
389
|
value: string;
|
|
389
|
-
center: boolean;
|
|
390
390
|
border: boolean;
|
|
391
391
|
direction: import("../cell").CellDirection;
|
|
392
392
|
isLink: boolean;
|
package/es/field/index.d.ts
CHANGED
|
@@ -227,11 +227,11 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
|
227
227
|
onClickRightIcon?: ((...args: any[]) => any) | undefined;
|
|
228
228
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
229
229
|
}, {
|
|
230
|
+
center: boolean;
|
|
230
231
|
type: import("./types").FieldType;
|
|
231
232
|
autofocus: boolean;
|
|
232
233
|
disabled: boolean;
|
|
233
234
|
value: string;
|
|
234
|
-
center: boolean;
|
|
235
235
|
border: boolean;
|
|
236
236
|
direction: import("..").CellDirection;
|
|
237
237
|
isLink: boolean;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import type { App } from 'vue';
|
|
2
|
-
|
|
3
|
-
declare type ListenEvent =
|
|
4
|
-
| 'scroll'
|
|
5
|
-
| 'wheel'
|
|
6
|
-
| 'mousewheel'
|
|
7
|
-
| 'resize'
|
|
8
|
-
| 'animationend'
|
|
9
|
-
| 'transitionend'
|
|
10
|
-
| 'touchmove';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line
|
|
13
|
-
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
|
14
|
-
|
|
15
|
-
declare type Filter = {
|
|
16
|
-
webp?: Callback;
|
|
17
|
-
progressive?: Callback;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
declare type Adapter = {
|
|
21
|
-
error?: Callback;
|
|
22
|
-
loaded?: Callback;
|
|
23
|
-
loading?: Callback;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export declare type LazyloadOptions = {
|
|
27
|
-
error?: string;
|
|
28
|
-
filter?: Filter;
|
|
29
|
-
silent?: boolean;
|
|
30
|
-
adapter?: Adapter;
|
|
31
|
-
loading?: string;
|
|
32
|
-
attempt?: number;
|
|
33
|
-
preLoad?: number;
|
|
34
|
-
observer?: boolean;
|
|
35
|
-
lazyImage?: boolean;
|
|
36
|
-
throttleWait?: number;
|
|
37
|
-
listenEvents?: ListenEvent[];
|
|
38
|
-
dispatchEvent?: boolean;
|
|
39
|
-
lazyComponent?: boolean;
|
|
40
|
-
observerOptions?: IntersectionObserverInit;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export declare const Lazyload: {
|
|
44
|
-
install(app: App, options?: LazyloadOptions): void;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
declare module '@vue/runtime-core' {
|
|
48
|
-
interface ComponentCustomProperties {
|
|
49
|
-
$Lazyload: {
|
|
50
|
-
$on: (event: string, handler: Callback) => void;
|
|
51
|
-
$off: (event: string, handler?: Callback) => void;
|
|
52
|
-
$once: (event: string, handler: Callback) => void;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare type ListenEvent =
|
|
4
|
+
| 'scroll'
|
|
5
|
+
| 'wheel'
|
|
6
|
+
| 'mousewheel'
|
|
7
|
+
| 'resize'
|
|
8
|
+
| 'animationend'
|
|
9
|
+
| 'transitionend'
|
|
10
|
+
| 'touchmove';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
|
14
|
+
|
|
15
|
+
declare type Filter = {
|
|
16
|
+
webp?: Callback;
|
|
17
|
+
progressive?: Callback;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare type Adapter = {
|
|
21
|
+
error?: Callback;
|
|
22
|
+
loaded?: Callback;
|
|
23
|
+
loading?: Callback;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export declare type LazyloadOptions = {
|
|
27
|
+
error?: string;
|
|
28
|
+
filter?: Filter;
|
|
29
|
+
silent?: boolean;
|
|
30
|
+
adapter?: Adapter;
|
|
31
|
+
loading?: string;
|
|
32
|
+
attempt?: number;
|
|
33
|
+
preLoad?: number;
|
|
34
|
+
observer?: boolean;
|
|
35
|
+
lazyImage?: boolean;
|
|
36
|
+
throttleWait?: number;
|
|
37
|
+
listenEvents?: ListenEvent[];
|
|
38
|
+
dispatchEvent?: boolean;
|
|
39
|
+
lazyComponent?: boolean;
|
|
40
|
+
observerOptions?: IntersectionObserverInit;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export declare const Lazyload: {
|
|
44
|
+
install(app: App, options?: LazyloadOptions): void;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare module '@vue/runtime-core' {
|
|
48
|
+
interface ComponentCustomProperties {
|
|
49
|
+
$Lazyload: {
|
|
50
|
+
$on: (event: string, handler: Callback) => void;
|
|
51
|
+
$off: (event: string, handler?: Callback) => void;
|
|
52
|
+
$once: (event: string, handler: Callback) => void;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
|
-
import { ref, watch, reactive, nextTick, defineComponent } from "vue";
|
|
3
|
-
import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
|
|
2
|
+
import { ref, watch, reactive, nextTick, defineComponent, computed } from "vue";
|
|
3
|
+
import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp, getTargetDom } from "../utils/index.mjs";
|
|
4
4
|
import { useEventListener, useScrollParent } from "@zartui/use";
|
|
5
5
|
import { useTouch } from "../composables/use-touch.mjs";
|
|
6
6
|
import { Loading } from "../loading/index.mjs";
|
|
@@ -17,7 +17,8 @@ const pullRefreshProps = {
|
|
|
17
17
|
loadingText: String,
|
|
18
18
|
pullDistance: numericProp,
|
|
19
19
|
successDuration: makeNumericProp(500),
|
|
20
|
-
animationDuration: makeNumericProp(300)
|
|
20
|
+
animationDuration: makeNumericProp(300),
|
|
21
|
+
scrollElement: null
|
|
21
22
|
};
|
|
22
23
|
var stdin_default = defineComponent({
|
|
23
24
|
name,
|
|
@@ -30,7 +31,17 @@ var stdin_default = defineComponent({
|
|
|
30
31
|
let reachTop;
|
|
31
32
|
const root = ref();
|
|
32
33
|
const track = ref();
|
|
33
|
-
const
|
|
34
|
+
const rootScrollElement = useScrollParent(root);
|
|
35
|
+
const scrollParent = computed(() => {
|
|
36
|
+
if (props.scrollElement) {
|
|
37
|
+
const targetDom = getTargetDom(props.scrollElement);
|
|
38
|
+
if (!targetDom) {
|
|
39
|
+
console.warn("\u8BF7\u68C0\u67E5props scroll-element\u5143\u7D20\u662F\u5426\u5B58\u5728\uFF01");
|
|
40
|
+
}
|
|
41
|
+
return targetDom != null ? targetDom : rootScrollElement.value;
|
|
42
|
+
}
|
|
43
|
+
return rootScrollElement.value;
|
|
44
|
+
});
|
|
34
45
|
const state = reactive({
|
|
35
46
|
status: "normal",
|
|
36
47
|
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/es/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/es/utils/dom.mjs
CHANGED
|
@@ -61,12 +61,27 @@ function colorFromCSSClass(className, defaultColor) {
|
|
|
61
61
|
document.body.removeChild(tmp);
|
|
62
62
|
return !classColor ? defaultColor : classColor;
|
|
63
63
|
}
|
|
64
|
+
const getTargetDom = (target) => {
|
|
65
|
+
if (target) {
|
|
66
|
+
if (typeof target === "string") {
|
|
67
|
+
return document.querySelectorAll(target)[0];
|
|
68
|
+
}
|
|
69
|
+
if (typeof target === "function") {
|
|
70
|
+
return target();
|
|
71
|
+
}
|
|
72
|
+
if (typeof target === "object" && target instanceof window.HTMLElement) {
|
|
73
|
+
return target;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return document.body;
|
|
77
|
+
};
|
|
64
78
|
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
65
79
|
export {
|
|
66
80
|
colorFromCSSClass,
|
|
67
81
|
getElementTop,
|
|
68
82
|
getRootScrollTop,
|
|
69
83
|
getScrollTop,
|
|
84
|
+
getTargetDom,
|
|
70
85
|
isHidden,
|
|
71
86
|
preventDefault,
|
|
72
87
|
resetScroll,
|
package/es/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/es/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
|
+
}
|
package/lib/cell/Cell.d.ts
CHANGED
|
@@ -194,8 +194,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
194
194
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
195
195
|
}, {
|
|
196
196
|
replace: boolean;
|
|
197
|
-
value: string;
|
|
198
197
|
center: boolean;
|
|
198
|
+
value: string;
|
|
199
199
|
border: boolean;
|
|
200
200
|
direction: CellDirection;
|
|
201
201
|
isLink: boolean;
|
package/lib/cell/index.d.ts
CHANGED
|
@@ -97,8 +97,8 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
|
97
97
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
98
98
|
}, {
|
|
99
99
|
replace: boolean;
|
|
100
|
-
value: string;
|
|
101
100
|
center: boolean;
|
|
101
|
+
value: string;
|
|
102
102
|
border: boolean;
|
|
103
103
|
direction: import("./types").CellDirection;
|
|
104
104
|
isLink: boolean;
|
|
@@ -3,10 +3,10 @@ import type { VNode, ComponentPublicInstance } from 'vue';
|
|
|
3
3
|
import type { Numeric } from '../utils';
|
|
4
4
|
export type DropdownItemOptionValue = Numeric | boolean | string;
|
|
5
5
|
export type DropdownItemOption = {
|
|
6
|
-
text
|
|
6
|
+
text?: string;
|
|
7
7
|
icon?: string;
|
|
8
|
-
value
|
|
9
|
-
selected
|
|
8
|
+
value?: DropdownItemOptionValue;
|
|
9
|
+
selected?: boolean;
|
|
10
10
|
[key: PropertyKey]: any;
|
|
11
11
|
};
|
|
12
12
|
export type DropdownItemExpose = {
|
package/lib/field/Field.d.ts
CHANGED
|
@@ -382,11 +382,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
382
382
|
onClickRightIcon?: ((...args: any[]) => any) | undefined;
|
|
383
383
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
384
384
|
}, {
|
|
385
|
+
center: boolean;
|
|
385
386
|
type: FieldType;
|
|
386
387
|
autofocus: boolean;
|
|
387
388
|
disabled: boolean;
|
|
388
389
|
value: string;
|
|
389
|
-
center: boolean;
|
|
390
390
|
border: boolean;
|
|
391
391
|
direction: import("../cell").CellDirection;
|
|
392
392
|
isLink: boolean;
|
package/lib/field/index.d.ts
CHANGED
|
@@ -227,11 +227,11 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
|
227
227
|
onClickRightIcon?: ((...args: any[]) => any) | undefined;
|
|
228
228
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
229
229
|
}, {
|
|
230
|
+
center: boolean;
|
|
230
231
|
type: import("./types").FieldType;
|
|
231
232
|
autofocus: boolean;
|
|
232
233
|
disabled: boolean;
|
|
233
234
|
value: string;
|
|
234
|
-
center: boolean;
|
|
235
235
|
border: boolean;
|
|
236
236
|
direction: import("..").CellDirection;
|
|
237
237
|
isLink: boolean;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import type { App } from 'vue';
|
|
2
|
-
|
|
3
|
-
declare type ListenEvent =
|
|
4
|
-
| 'scroll'
|
|
5
|
-
| 'wheel'
|
|
6
|
-
| 'mousewheel'
|
|
7
|
-
| 'resize'
|
|
8
|
-
| 'animationend'
|
|
9
|
-
| 'transitionend'
|
|
10
|
-
| 'touchmove';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line
|
|
13
|
-
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
|
14
|
-
|
|
15
|
-
declare type Filter = {
|
|
16
|
-
webp?: Callback;
|
|
17
|
-
progressive?: Callback;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
declare type Adapter = {
|
|
21
|
-
error?: Callback;
|
|
22
|
-
loaded?: Callback;
|
|
23
|
-
loading?: Callback;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export declare type LazyloadOptions = {
|
|
27
|
-
error?: string;
|
|
28
|
-
filter?: Filter;
|
|
29
|
-
silent?: boolean;
|
|
30
|
-
adapter?: Adapter;
|
|
31
|
-
loading?: string;
|
|
32
|
-
attempt?: number;
|
|
33
|
-
preLoad?: number;
|
|
34
|
-
observer?: boolean;
|
|
35
|
-
lazyImage?: boolean;
|
|
36
|
-
throttleWait?: number;
|
|
37
|
-
listenEvents?: ListenEvent[];
|
|
38
|
-
dispatchEvent?: boolean;
|
|
39
|
-
lazyComponent?: boolean;
|
|
40
|
-
observerOptions?: IntersectionObserverInit;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export declare const Lazyload: {
|
|
44
|
-
install(app: App, options?: LazyloadOptions): void;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
declare module '@vue/runtime-core' {
|
|
48
|
-
interface ComponentCustomProperties {
|
|
49
|
-
$Lazyload: {
|
|
50
|
-
$on: (event: string, handler: Callback) => void;
|
|
51
|
-
$off: (event: string, handler?: Callback) => void;
|
|
52
|
-
$once: (event: string, handler: Callback) => void;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare type ListenEvent =
|
|
4
|
+
| 'scroll'
|
|
5
|
+
| 'wheel'
|
|
6
|
+
| 'mousewheel'
|
|
7
|
+
| 'resize'
|
|
8
|
+
| 'animationend'
|
|
9
|
+
| 'transitionend'
|
|
10
|
+
| 'touchmove';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
|
14
|
+
|
|
15
|
+
declare type Filter = {
|
|
16
|
+
webp?: Callback;
|
|
17
|
+
progressive?: Callback;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare type Adapter = {
|
|
21
|
+
error?: Callback;
|
|
22
|
+
loaded?: Callback;
|
|
23
|
+
loading?: Callback;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export declare type LazyloadOptions = {
|
|
27
|
+
error?: string;
|
|
28
|
+
filter?: Filter;
|
|
29
|
+
silent?: boolean;
|
|
30
|
+
adapter?: Adapter;
|
|
31
|
+
loading?: string;
|
|
32
|
+
attempt?: number;
|
|
33
|
+
preLoad?: number;
|
|
34
|
+
observer?: boolean;
|
|
35
|
+
lazyImage?: boolean;
|
|
36
|
+
throttleWait?: number;
|
|
37
|
+
listenEvents?: ListenEvent[];
|
|
38
|
+
dispatchEvent?: boolean;
|
|
39
|
+
lazyComponent?: boolean;
|
|
40
|
+
observerOptions?: IntersectionObserverInit;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export declare const Lazyload: {
|
|
44
|
+
install(app: App, options?: LazyloadOptions): void;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare module '@vue/runtime-core' {
|
|
48
|
+
interface ComponentCustomProperties {
|
|
49
|
+
$Lazyload: {
|
|
50
|
+
$on: (event: string, handler: Callback) => void;
|
|
51
|
+
$off: (event: string, handler?: Callback) => void;
|
|
52
|
+
$once: (event: string, handler: Callback) => void;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -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>;
|