pxd 0.0.61 → 0.0.62
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/LICENSE +21 -0
- package/dist/components/_internal/dismiss-container.d.vue.ts +28 -0
- package/dist/components/_internal/dismiss-container.vue +162 -0
- package/dist/components/_internal/popover-arrow.d.vue.ts +9 -0
- package/dist/components/_internal/popover-arrow.vue +38 -0
- package/dist/components/active-graph/index.vue +4 -4
- package/dist/components/avatar/index.vue +5 -7
- package/dist/components/avatar-group/index.d.vue.ts +0 -1
- package/dist/components/avatar-group/index.vue +1 -1
- package/dist/components/backtop/index.vue +1 -1
- package/dist/components/badge/index.d.vue.ts +6 -2
- package/dist/components/badge/index.vue +18 -4
- package/dist/components/badge/types.d.ts +5 -0
- package/dist/components/book/index.vue +1 -1
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.d.vue.ts +22 -0
- package/dist/components/bubble/index.vue +59 -0
- package/dist/components/bubble/types.d.ts +6 -0
- package/dist/components/button/index.d.vue.ts +0 -2
- package/dist/components/button/index.vue +30 -21
- package/dist/components/button/types.d.ts +3 -2
- package/dist/components/button-group/index.d.vue.ts +14 -0
- package/dist/components/button-group/index.vue +26 -0
- package/dist/components/button-group/types.d.ts +9 -0
- package/dist/components/carousel/index.d.vue.ts +3 -3
- package/dist/components/carousel/index.vue +146 -113
- package/dist/components/carousel/types.d.ts +1 -1
- package/dist/components/carousel-item/index.vue +22 -17
- package/dist/components/checkbox/index.vue +6 -6
- package/dist/components/checkbox-group/index.d.vue.ts +1 -1
- package/dist/components/chip/index.d.vue.ts +1 -5
- package/dist/components/chip/index.vue +4 -4
- package/dist/components/color-selector/index.d.vue.ts +12 -0
- package/dist/components/color-selector/index.vue +64 -0
- package/dist/components/color-selector/types.d.ts +12 -0
- package/dist/components/command-menu/index.d.vue.ts +6 -6
- package/dist/components/command-menu/index.vue +23 -32
- package/dist/components/command-menu/types.d.ts +1 -1
- package/dist/components/command-menu-group/index.vue +15 -6
- package/dist/components/command-menu-group/types.d.ts +1 -1
- package/dist/components/countdown/index.d.vue.ts +11 -11
- package/dist/components/drawer/index.d.vue.ts +8 -8
- package/dist/components/drawer/index.vue +13 -10
- package/dist/components/drawer/types.d.ts +4 -3
- package/dist/components/ellipsis-text/index.d.vue.ts +4 -1
- package/dist/components/ellipsis-text/index.vue +84 -107
- package/dist/components/ellipsis-text/types.d.ts +2 -1
- package/dist/components/error/index.vue +1 -1
- package/dist/components/fader/index.vue +5 -9
- package/dist/components/gauge/index.vue +34 -29
- package/dist/components/grid/index.vue +1 -1
- package/dist/components/grid-item/index.vue +1 -1
- package/dist/components/hold-button/index.d.vue.ts +8 -10
- package/dist/components/hold-button/index.vue +20 -29
- package/dist/components/hold-button/types.d.ts +5 -6
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/input/index.d.vue.ts +8 -8
- package/dist/components/input/index.vue +5 -4
- package/dist/components/intersection-observer/index.vue +4 -4
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/link-button/index.d.vue.ts +4 -4
- package/dist/components/link-button/index.vue +9 -8
- package/dist/components/link-button/types.d.ts +0 -3
- package/dist/components/list/index.d.vue.ts +10 -15
- package/dist/components/list/index.vue +58 -131
- package/dist/components/list/types.d.ts +4 -4
- package/dist/components/list-item/index.d.vue.ts +2 -2
- package/dist/components/list-item/index.vue +44 -39
- package/dist/components/loading-bar/index.vue +8 -7
- package/dist/components/material/index.vue +24 -46
- package/dist/components/menu/index.d.vue.ts +6 -8
- package/dist/components/menu/index.vue +18 -24
- package/dist/components/menu/types.d.ts +1 -2
- package/dist/components/message/composables/use-group-expand.d.ts +13 -0
- package/dist/components/message/composables/use-group-expand.js +50 -0
- package/dist/components/message/composables/use-message-timer.d.ts +9 -0
- package/dist/components/message/composables/use-message-timer.js +61 -0
- package/dist/components/message/composables/use-promise-message.d.ts +4 -0
- package/dist/components/message/composables/use-promise-message.js +49 -0
- package/dist/components/message/index.d.vue.ts +6 -33
- package/dist/components/message/index.vue +33 -185
- package/dist/components/message/types.d.ts +2 -2
- package/dist/components/message-item/index.vue +26 -2
- package/dist/components/modal/index.d.vue.ts +7 -7
- package/dist/components/modal/index.vue +7 -3
- package/dist/components/modal/types.d.ts +7 -3
- package/dist/components/note/index.vue +2 -2
- package/dist/components/number-input/index.d.vue.ts +5 -4
- package/dist/components/number-input/index.vue +3 -0
- package/dist/components/number-input/types.d.ts +1 -0
- package/dist/components/overlay/index.d.vue.ts +6 -3
- package/dist/components/overlay/index.vue +63 -68
- package/dist/components/overlay/types.d.ts +5 -4
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pin-input/index.d.vue.ts +1 -1
- package/dist/components/pin-input/index.vue +7 -6
- package/dist/components/placeholder/index.vue +1 -1
- package/dist/components/popover/index.d.vue.ts +7 -8
- package/dist/components/popover/index.vue +149 -239
- package/dist/components/popover/types.d.ts +5 -5
- package/dist/components/progress/index.vue +1 -1
- package/dist/components/radio/index.vue +2 -2
- package/dist/components/resizable/index.vue +43 -51
- package/dist/components/resizable/types.d.ts +1 -1
- package/dist/components/resizable-handle/index.d.vue.ts +4 -1
- package/dist/components/resizable-handle/index.vue +29 -3
- package/dist/components/resizable-panel/index.vue +3 -7
- package/dist/components/scalable-text/index.d.vue.ts +9 -0
- package/dist/components/scalable-text/index.vue +147 -0
- package/dist/components/scalable-text/types.d.ts +12 -0
- package/dist/components/scrollable/index.d.vue.ts +2 -2
- package/dist/components/scrollable/index.vue +4 -3
- package/dist/components/separator/index.d.vue.ts +6 -0
- package/dist/components/separator/index.vue +18 -0
- package/dist/components/separator/types.d.ts +5 -0
- package/dist/components/skeleton/index.d.vue.ts +1 -1
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +39 -7
- package/dist/components/snippet/index.vue +16 -13
- package/dist/components/spinner/index.vue +3 -1
- package/dist/components/stack/index.d.vue.ts +1 -1
- package/dist/components/stack/index.vue +1 -1
- package/dist/components/switch/index.d.vue.ts +1 -1
- package/dist/components/switch/index.vue +4 -3
- package/dist/components/switch-item/index.vue +1 -1
- package/dist/components/tabs/index.d.vue.ts +12 -0
- package/dist/components/tabs/index.vue +270 -0
- package/dist/components/tabs/types.d.ts +12 -0
- package/dist/components/tabs-item/index.d.vue.ts +4 -0
- package/dist/components/tabs-item/index.vue +16 -0
- package/dist/components/tabs-item/types.d.ts +10 -0
- package/dist/components/text/index.vue +1 -1
- package/dist/components/textarea/index.d.vue.ts +2 -2
- package/dist/components/textarea/index.vue +1 -1
- package/dist/components/time-picker/index.d.vue.ts +3 -5
- package/dist/components/time-picker/index.vue +53 -45
- package/dist/components/time-picker/types.d.ts +1 -2
- package/dist/components/toggle/index.d.vue.ts +0 -2
- package/dist/components/toggle/index.vue +6 -6
- package/dist/components/toggle-button/index.vue +8 -6
- package/dist/components/tooltip/index.d.vue.ts +1 -1
- package/dist/components/tooltip/index.vue +19 -11
- package/dist/components/tooltip/types.d.ts +2 -2
- package/dist/components/virtual-list/index.d.vue.ts +8 -8
- package/dist/components/virtual-list/index.vue +27 -5
- package/dist/components/virtual-list/types.d.ts +3 -0
- package/dist/composables/index.d.ts +4 -1
- package/dist/composables/index.js +4 -1
- package/dist/composables/use-browser-observer.js +2 -2
- package/dist/composables/use-client-online.js +2 -2
- package/dist/composables/use-color-scheme.js +2 -2
- package/dist/composables/use-countdown.js +3 -2
- package/dist/composables/use-deferred-value.js +2 -2
- package/dist/composables/use-delay-destroy.js +11 -6
- package/dist/composables/use-document-hidden.js +2 -2
- package/dist/composables/use-focus-trap.js +2 -2
- package/dist/composables/use-list-filter.d.ts +11 -0
- package/dist/composables/use-list-filter.js +56 -0
- package/dist/composables/use-list-navigation.d.ts +27 -0
- package/dist/composables/use-list-navigation.js +159 -0
- package/dist/composables/use-lock-scroll.js +12 -12
- package/dist/composables/use-media-query.js +2 -2
- package/dist/composables/use-outside-click.d.ts +1 -1
- package/dist/composables/use-outside-click.js +8 -11
- package/dist/composables/use-overlay-manager.d.ts +18 -0
- package/dist/composables/use-overlay-manager.js +80 -0
- package/dist/composables/use-popover-responsive.d.ts +6 -8
- package/dist/composables/use-popover-responsive.js +9 -12
- package/dist/composables/use-repeat-action.js +2 -2
- package/dist/composables/use-swipe-gesture.d.ts +65 -0
- package/dist/composables/use-swipe-gesture.js +99 -0
- package/dist/composables/use-virtual-list.d.ts +5 -3
- package/dist/composables/use-virtual-list.js +25 -14
- package/dist/composables/use-window-size.js +2 -2
- package/dist/constants/size.d.ts +12 -0
- package/dist/constants/size.js +12 -0
- package/dist/contexts/button.d.ts +5 -0
- package/dist/contexts/button.js +5 -0
- package/dist/contexts/carousel.d.ts +2 -1
- package/dist/contexts/list.d.ts +23 -3
- package/dist/contexts/list.js +6 -2
- package/dist/contexts/resizable.d.ts +3 -11
- package/dist/contexts/tabs.d.ts +15 -0
- package/dist/contexts/tabs.js +2 -0
- package/dist/locales/en-us.d.ts +4 -4
- package/dist/locales/en-us.js +4 -4
- package/dist/locales/zh-cn.d.ts +4 -4
- package/dist/locales/zh-cn.js +4 -4
- package/dist/plugins/dayjs-millisecond-token.js +1 -1
- package/dist/styles/source.css +133 -128
- package/dist/styles/styles.css +2 -2
- package/dist/styles/tw.css +133 -128
- package/dist/types/shared/props.d.ts +1 -0
- package/dist/types/shared/utils.d.ts +1 -4
- package/dist/utils/date.d.ts +3 -3
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.js +4 -0
- package/dist/utils/event.d.ts +2 -1
- package/dist/utils/event.js +7 -1
- package/dist/utils/format.d.ts +3 -3
- package/dist/utils/format.js +5 -4
- package/dist/utils/fuzzy-search.d.ts +7 -0
- package/dist/utils/fuzzy-search.js +61 -0
- package/dist/utils/get.d.ts +2 -0
- package/dist/utils/get.js +15 -1
- package/dist/utils/index.d.ts +10 -11
- package/dist/utils/index.js +2 -3
- package/dist/utils/ref.d.ts +2 -2
- package/dist/utils/{throttle.d.ts → timing.d.ts} +1 -0
- package/dist/utils/{throttle.js → timing.js} +4 -2
- package/package.json +67 -63
- package/volar.d.ts +7 -0
- package/dist/components/overlay/overlay-stack.d.ts +0 -3
- package/dist/components/overlay/overlay-stack.js +0 -17
- package/dist/composables/use-pointer-gesture.d.ts +0 -180
- package/dist/composables/use-pointer-gesture.js +0 -406
- package/dist/utils/debounce.d.ts +0 -1
- package/dist/utils/debounce.js +0 -1
- package/dist/utils/regexp.d.ts +0 -8
- package/dist/utils/regexp.js +0 -8
- package/dist/utils/responsive.d.ts +0 -3
- package/dist/utils/responsive.js +0 -14
package/dist/utils/ref.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MaybeElement } from '../types/shared/utils';
|
|
1
|
+
import type { MaybeElement, Nullable } from '../types/shared/utils';
|
|
2
2
|
import type { ComponentPublicInstance, MaybeRefOrGetter } from 'vue';
|
|
3
3
|
export type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends ComponentPublicInstance ? Exclude<MaybeElement, ComponentPublicInstance> : T | undefined;
|
|
4
4
|
export declare function toValue<T>(source: MaybeRefOrGetter<T>): T;
|
|
5
|
-
export declare function unrefElement<T extends MaybeElement>(elRef: MaybeRefOrGetter<T
|
|
5
|
+
export declare function unrefElement<T extends MaybeElement>(elRef: MaybeRefOrGetter<Nullable<T>>): UnRefElementReturn<Nullable<T>>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { raf, caf } from "./event.js";
|
|
2
|
+
export { debounce } from "es-toolkit/function";
|
|
1
3
|
export { throttle } from "es-toolkit/function";
|
|
2
4
|
export function throttleByRaf(callback) {
|
|
3
5
|
let animationFrameId = 0;
|
|
@@ -5,14 +7,14 @@ export function throttleByRaf(callback) {
|
|
|
5
7
|
if (animationFrameId) {
|
|
6
8
|
return;
|
|
7
9
|
}
|
|
8
|
-
animationFrameId =
|
|
10
|
+
animationFrameId = raf(() => {
|
|
9
11
|
animationFrameId = 0;
|
|
10
12
|
callback(...args);
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
throttle2.cancel = () => {
|
|
14
16
|
if (animationFrameId) {
|
|
15
|
-
|
|
17
|
+
caf(animationFrameId);
|
|
16
18
|
animationFrameId = 0;
|
|
17
19
|
}
|
|
18
20
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxd",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62",
|
|
4
4
|
"description": "A Vue 2.7 & 3.2 universal component library. Built-in light/dark theme. PC & mobile ready. Animation-free mode supported.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"component
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"component-library",
|
|
7
|
+
"dark-mode",
|
|
8
|
+
"design-system",
|
|
9
|
+
"responsive",
|
|
10
|
+
"tailwind",
|
|
11
|
+
"typescript",
|
|
9
12
|
"ui",
|
|
10
|
-
"ui framework",
|
|
11
13
|
"vue",
|
|
14
|
+
"vue-components",
|
|
12
15
|
"vue2",
|
|
13
16
|
"vue3"
|
|
14
17
|
],
|
|
@@ -92,69 +95,70 @@
|
|
|
92
95
|
"default": "./dist/utils/*.js"
|
|
93
96
|
}
|
|
94
97
|
},
|
|
98
|
+
"scripts": {
|
|
99
|
+
"dev": "run-s dev:lib dev:docs",
|
|
100
|
+
"dev:lib": "unbuild --stub",
|
|
101
|
+
"dev:docs": "pnpm --filter docs dev",
|
|
102
|
+
"build": "vp run build:core && vp run build:docs",
|
|
103
|
+
"build:lib": "vp run build:core && vp run gen-tw-css-file",
|
|
104
|
+
"build:only": "vp run build:core && vp run build:docs",
|
|
105
|
+
"build:style": "vp run gen-tw-css-file",
|
|
106
|
+
"lint": "git diff --staged --name-only --diff-filter=ACMR| xargs -r vp lint",
|
|
107
|
+
"lint:all": "vp lint",
|
|
108
|
+
"lint:changed": "git diff --name-only --relative --diff-filter=ACMR origin/main ... HEAD | xargs -r vp lint",
|
|
109
|
+
"lint:fix": "vp lint --fix",
|
|
110
|
+
"fmt": "git diff --staged --name-only --diff-filter=ACMR| xargs -r vp fmt",
|
|
111
|
+
"fmt:all": "vp fmt",
|
|
112
|
+
"fmt:changed": "git diff --name-only --relative --diff-filter=ACMR origin/main ... HEAD | xargs -r vp fmt",
|
|
113
|
+
"fmt:check": "vp fmt --check",
|
|
114
|
+
"test": "vp test run",
|
|
115
|
+
"test:watch": "vp test",
|
|
116
|
+
"bump": "pnpx bumpp",
|
|
117
|
+
"preview": "pnpm --filter docs preview",
|
|
118
|
+
"postversion": "vp run gen-volar-dts && vp run update-exports",
|
|
119
|
+
"prepublishOnly": "run-s build:lib"
|
|
120
|
+
},
|
|
95
121
|
"dependencies": {
|
|
96
|
-
"@
|
|
97
|
-
"@
|
|
98
|
-
"@
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
122
|
+
"@any-touch/core": "catalog:default",
|
|
123
|
+
"@any-touch/pan": "catalog:default",
|
|
124
|
+
"@chenglou/pretext": "catalog:default",
|
|
125
|
+
"@floating-ui/dom": "catalog:default",
|
|
126
|
+
"@gdsicon/vue": "catalog:default",
|
|
127
|
+
"@tanstack/virtual-core": "catalog:default",
|
|
128
|
+
"dayjs": "catalog:default",
|
|
129
|
+
"es-toolkit": "catalog:default",
|
|
130
|
+
"focus-trap": "catalog:default",
|
|
131
|
+
"tailwind-merge": "catalog:default",
|
|
132
|
+
"tailwind-variants": "catalog:default"
|
|
104
133
|
},
|
|
105
134
|
"devDependencies": {
|
|
106
|
-
"@tailwindcss/cli": "
|
|
107
|
-
"@tsconfig/node22": "
|
|
108
|
-
"@types/node": "
|
|
109
|
-
"@vitejs/plugin-vue": "
|
|
110
|
-
"@vue/test-utils": "
|
|
111
|
-
"@vue/tsconfig": "
|
|
112
|
-
"eslint-plugin-better-tailwindcss": "
|
|
113
|
-
"fs-extra": "
|
|
114
|
-
"happy-dom": "
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"vitest": "^4.1.0",
|
|
126
|
-
"vue": "^3.5.30",
|
|
127
|
-
"vue-sfc-transformer": "^0.1.17",
|
|
128
|
-
"vue-tsc": "^3.2.5"
|
|
135
|
+
"@tailwindcss/cli": "catalog:default",
|
|
136
|
+
"@tsconfig/node22": "catalog:default",
|
|
137
|
+
"@types/node": "catalog:default",
|
|
138
|
+
"@vitejs/plugin-vue": "catalog:default",
|
|
139
|
+
"@vue/test-utils": "catalog:default",
|
|
140
|
+
"@vue/tsconfig": "catalog:default",
|
|
141
|
+
"eslint-plugin-better-tailwindcss": "catalog:default",
|
|
142
|
+
"fs-extra": "catalog:default",
|
|
143
|
+
"happy-dom": "catalog:default",
|
|
144
|
+
"mkdist": "catalog:default",
|
|
145
|
+
"npm-run-all2": "catalog:default",
|
|
146
|
+
"tinyglobby": "catalog:default",
|
|
147
|
+
"typescript": "catalog:default",
|
|
148
|
+
"unbuild": "catalog:default",
|
|
149
|
+
"unplugin-vue-components": "catalog:default",
|
|
150
|
+
"vite-plus": "catalog:",
|
|
151
|
+
"vue": "catalog:default",
|
|
152
|
+
"vue-sfc-transformer": "catalog:default",
|
|
153
|
+
"vue-tsc": "catalog:default"
|
|
129
154
|
},
|
|
130
155
|
"peerDependencies": {
|
|
131
156
|
"vue": ">=2.7.0 || >=3.2.0"
|
|
132
157
|
},
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"dev:lib": "unbuild --stub",
|
|
139
|
-
"dev:docs": "pnpm --filter docs dev",
|
|
140
|
-
"build": "run-s update-exports build:core build:docs",
|
|
141
|
-
"build:lib": "run-s update-exports build:core build:style",
|
|
142
|
-
"build:core": "mkdist -d --src=src --ext=js --format=esm",
|
|
143
|
-
"build:only": "run-s build:core build:docs",
|
|
144
|
-
"build:docs": "pnpm --filter docs build",
|
|
145
|
-
"build:style": "run-s gen-styles-file gen-tw-css-file",
|
|
146
|
-
"update-exports": "node scripts/update-exports.js",
|
|
147
|
-
"gen-styles-file": "node scripts/gen-css-files.js",
|
|
148
|
-
"gen-tw-css-file": "tailwindcss -i ./dist/styles/source.css -o ./dist/styles/styles.css -m",
|
|
149
|
-
"gen-volar-dts": "node scripts/gen-component-dts.js",
|
|
150
|
-
"lint": "oxlint",
|
|
151
|
-
"lint:fix": "oxlint --fix",
|
|
152
|
-
"fmt": "oxfmt",
|
|
153
|
-
"fmt:check": "oxfmt --check",
|
|
154
|
-
"test": "vitest run",
|
|
155
|
-
"test:watch": "vitest",
|
|
156
|
-
"typecheck": "vue-tsc -p tsconfig.app.json --noEmit",
|
|
157
|
-
"bump": "pnpx bumpp",
|
|
158
|
-
"postversion": "run-s gen-volar-dts update-exports"
|
|
158
|
+
"packageManager": "pnpm@10.33.2",
|
|
159
|
+
"pnpm": {
|
|
160
|
+
"patchedDependencies": {
|
|
161
|
+
"mkdist": "patches/mkdist.patch"
|
|
162
|
+
}
|
|
159
163
|
}
|
|
160
|
-
}
|
|
164
|
+
}
|
package/volar.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ declare module 'vue' {
|
|
|
10
10
|
PBadge: (typeof import('pxd/components/badge'))['default']
|
|
11
11
|
PBook: (typeof import('pxd/components/book'))['default']
|
|
12
12
|
PBrowser: (typeof import('pxd/components/browser'))['default']
|
|
13
|
+
PBubble: (typeof import('pxd/components/bubble'))['default']
|
|
13
14
|
PButton: (typeof import('pxd/components/button'))['default']
|
|
15
|
+
PButtonGroup: (typeof import('pxd/components/button-group'))['default']
|
|
14
16
|
PCarousel: (typeof import('pxd/components/carousel'))['default']
|
|
15
17
|
PCarouselItem: (typeof import('pxd/components/carousel-item'))['default']
|
|
16
18
|
PCheckbox: (typeof import('pxd/components/checkbox'))['default']
|
|
@@ -20,6 +22,7 @@ declare module 'vue' {
|
|
|
20
22
|
PChoiceboxItem: (typeof import('pxd/components/choicebox-item'))['default']
|
|
21
23
|
PCollapse: (typeof import('pxd/components/collapse'))['default']
|
|
22
24
|
PCollapseGroup: (typeof import('pxd/components/collapse-group'))['default']
|
|
25
|
+
PColorSelector: (typeof import('pxd/components/color-selector'))['default']
|
|
23
26
|
PCommandMenu: (typeof import('pxd/components/command-menu'))['default']
|
|
24
27
|
PCommandMenuGroup: (typeof import('pxd/components/command-menu-group'))['default']
|
|
25
28
|
PConfigProvider: (typeof import('pxd/components/config-provider'))['default']
|
|
@@ -65,7 +68,9 @@ declare module 'vue' {
|
|
|
65
68
|
PResizable: (typeof import('pxd/components/resizable'))['default']
|
|
66
69
|
PResizableHandle: (typeof import('pxd/components/resizable-handle'))['default']
|
|
67
70
|
PResizablePanel: (typeof import('pxd/components/resizable-panel'))['default']
|
|
71
|
+
PScalableText: (typeof import('pxd/components/scalable-text'))['default']
|
|
68
72
|
PScrollable: (typeof import('pxd/components/scrollable'))['default']
|
|
73
|
+
PSeparator: (typeof import('pxd/components/separator'))['default']
|
|
69
74
|
PSkeleton: (typeof import('pxd/components/skeleton'))['default']
|
|
70
75
|
PSlider: (typeof import('pxd/components/slider'))['default']
|
|
71
76
|
PSnippet: (typeof import('pxd/components/snippet'))['default']
|
|
@@ -74,6 +79,8 @@ declare module 'vue' {
|
|
|
74
79
|
PStatusDot: (typeof import('pxd/components/status-dot'))['default']
|
|
75
80
|
PSwitch: (typeof import('pxd/components/switch'))['default']
|
|
76
81
|
PSwitchItem: (typeof import('pxd/components/switch-item'))['default']
|
|
82
|
+
PTabs: (typeof import('pxd/components/tabs'))['default']
|
|
83
|
+
PTabsItem: (typeof import('pxd/components/tabs-item'))['default']
|
|
77
84
|
PTeleport: (typeof import('pxd/components/teleport'))['default']
|
|
78
85
|
PText: (typeof import('pxd/components/text'))['default']
|
|
79
86
|
PTextarea: (typeof import('pxd/components/textarea'))['default']
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const overlayStack = [];
|
|
2
|
-
export function pushOverlay(id) {
|
|
3
|
-
const idx = overlayStack.indexOf(id);
|
|
4
|
-
if (idx !== -1) {
|
|
5
|
-
overlayStack.splice(idx, 1);
|
|
6
|
-
}
|
|
7
|
-
overlayStack.push(id);
|
|
8
|
-
}
|
|
9
|
-
export function removeOverlay(id) {
|
|
10
|
-
const idx = overlayStack.indexOf(id);
|
|
11
|
-
if (idx !== -1) {
|
|
12
|
-
overlayStack.splice(idx, 1);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function isTopOverlay(id) {
|
|
16
|
-
return overlayStack[overlayStack.length - 1] === id;
|
|
17
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import type { MaybeElementRef } from '../types/shared/utils';
|
|
2
|
-
type Axis = 'x' | 'y' | 'both';
|
|
3
|
-
type Dir = 'left' | 'right' | 'up' | 'down' | null;
|
|
4
|
-
/**
|
|
5
|
-
* 速度向量。
|
|
6
|
-
* @property x - X 方向速度(px/s)
|
|
7
|
-
* @property y - Y 方向速度(px/s)
|
|
8
|
-
* @property v - 合速度(px/s)
|
|
9
|
-
*/
|
|
10
|
-
interface Velocity {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
v: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* 对外公开的手势状态。
|
|
17
|
-
* @property isActive - 指针是否按下激活
|
|
18
|
-
* @property isDragging - 是否处于拖拽中(超过启动阈值)
|
|
19
|
-
* @property isLongPressing - 是否处于长按态
|
|
20
|
-
* @property direction - 当前判定的方向(可能为 null)
|
|
21
|
-
* @property delta - 自按下以来位移(px)
|
|
22
|
-
* @property velocity - 当前速度(px/s)
|
|
23
|
-
* @property progress - 触发进度(0~1,基于 triggerThreshold)
|
|
24
|
-
*/
|
|
25
|
-
export interface PublicState {
|
|
26
|
-
isActive: boolean;
|
|
27
|
-
isDragging: boolean;
|
|
28
|
-
isLongPressing: boolean;
|
|
29
|
-
direction: Dir;
|
|
30
|
-
delta: {
|
|
31
|
-
x: number;
|
|
32
|
-
y: number;
|
|
33
|
-
};
|
|
34
|
-
velocity: Velocity;
|
|
35
|
-
progress: number;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* usePointerGesture 的可配置项。
|
|
39
|
-
* 如未指定,均有默认值(见 OPTIONS_DEFAULTS)。
|
|
40
|
-
*/
|
|
41
|
-
export interface UsePointerGestureOptions {
|
|
42
|
-
/**
|
|
43
|
-
* 限制生效轴向。
|
|
44
|
-
* 返回 'x' | 'y' | 'both',默认为 'both'。
|
|
45
|
-
*/
|
|
46
|
-
axis?: () => Axis;
|
|
47
|
-
/**
|
|
48
|
-
* 拖拽启动阈值(px)。手指移动距离超过该值后进入拖拽。
|
|
49
|
-
* 默认 6。
|
|
50
|
-
*/
|
|
51
|
-
startThreshold?: number;
|
|
52
|
-
/**
|
|
53
|
-
* 触发阈值(px)。释放时若位移达到该值视为命中触发(kind='threshold')。
|
|
54
|
-
* 默认 80。
|
|
55
|
-
*/
|
|
56
|
-
triggerThreshold?: number;
|
|
57
|
-
/**
|
|
58
|
-
* 甩动触发速度阈值(px/s)。移动中若合速度超过该值将记录可能触发为 'fling'。
|
|
59
|
-
* 默认 1000。
|
|
60
|
-
*/
|
|
61
|
-
velocityThreshold?: number;
|
|
62
|
-
/**
|
|
63
|
-
* 长按判定时长(ms)。到达该时长后进入长按态并触发 onLongPress。
|
|
64
|
-
* 默认 300。
|
|
65
|
-
*/
|
|
66
|
-
longPressMs?: number;
|
|
67
|
-
/**
|
|
68
|
-
* 长按容忍移动距离(px)。在进入拖拽前,若移动超过该距离则取消长按。
|
|
69
|
-
* 默认 4。
|
|
70
|
-
*/
|
|
71
|
-
longPressMoveTolerance?: number;
|
|
72
|
-
/**
|
|
73
|
-
* 是否在拖拽开始时锁定轴向。开启后根据初始位移较大方向锁定为 'x' 或 'y'。
|
|
74
|
-
* 默认 true。
|
|
75
|
-
*/
|
|
76
|
-
lockDirectionOnStart?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* 是否允许在可滚动容器尚可继续滚动时将移动交由滚动,直到触达边缘才接管拖拽。
|
|
79
|
-
* 默认 true。
|
|
80
|
-
*/
|
|
81
|
-
allowScrollUntilEdge?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* 拖拽期间是否调用 preventDefault 阻止滚动。
|
|
84
|
-
* 默认 true。
|
|
85
|
-
*/
|
|
86
|
-
preventScrollOnDrag?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* 是否使用 Pointer Capture(setPointerCapture/releasePointerCapture)。
|
|
89
|
-
* 默认 true。
|
|
90
|
-
*/
|
|
91
|
-
usePointerCapture?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* RTL 支持:
|
|
94
|
-
* - 若为 boolean,true 表示水平方向取反(dx>0 视为向左);false 为自然方向
|
|
95
|
-
* - 若为函数,可根据 dx 自定义返回 'left' 或 'right'
|
|
96
|
-
* 默认 false。
|
|
97
|
-
*/
|
|
98
|
-
rtl?: boolean | ((dx: number) => 'left' | 'right');
|
|
99
|
-
/**
|
|
100
|
-
* 提供一个返回可参与滚动判断的元素(通常为最近滚动容器内的滚动元素)。
|
|
101
|
-
* 若不提供,将自动查找。
|
|
102
|
-
*/
|
|
103
|
-
getScrollable?: () => HTMLElement | null;
|
|
104
|
-
/**
|
|
105
|
-
* 指针按下时回调。
|
|
106
|
-
* @param e - PointerEvent
|
|
107
|
-
* @param ctx - 当前公开状态
|
|
108
|
-
*/
|
|
109
|
-
onStart?: (e: PointerEvent, ctx: PublicState) => void;
|
|
110
|
-
/**
|
|
111
|
-
* 指针移动时回调(拖拽中会持续触发,可用于执行动画)。
|
|
112
|
-
* @param e - PointerEvent
|
|
113
|
-
* @param ctx - 当前公开状态
|
|
114
|
-
*/
|
|
115
|
-
onMove?: (e: PointerEvent, ctx: PublicState) => void;
|
|
116
|
-
/**
|
|
117
|
-
* 指针释放时统一回调。
|
|
118
|
-
* - 命中触发条件时:hit=true,并给出方向 dir 与触发类型 kind('threshold' | 'longpress' | 'fling')
|
|
119
|
-
* - 未命中时:hit=false,dir=null,kind=null;此时会自动调用 onReset 便于复位动画
|
|
120
|
-
* @param hit - 是否命中触发
|
|
121
|
-
* @param dir - 方向(未命中为 null)
|
|
122
|
-
* @param kind - 触发类型(未命中为 null)
|
|
123
|
-
* @param ctx - 当前公开状态
|
|
124
|
-
*/
|
|
125
|
-
onRelease?: (hit: boolean, dir: Dir, kind: null | 'threshold' | 'longpress' | 'fling', ctx: PublicState) => void;
|
|
126
|
-
/**
|
|
127
|
-
* 指针生命周期结束时回调(在 onRelease 之前调用)。
|
|
128
|
-
* @param e - PointerEvent
|
|
129
|
-
* @param ctx - 当前公开状态
|
|
130
|
-
*/
|
|
131
|
-
onEnd?: (e: PointerEvent, ctx: PublicState) => void;
|
|
132
|
-
/**
|
|
133
|
-
* 手势被取消时回调(如 pointercancel 或主动 cancel)。
|
|
134
|
-
* @param e - 事件对象;由 cancel() 触发时为 null
|
|
135
|
-
* @param ctx - 当前公开状态
|
|
136
|
-
*/
|
|
137
|
-
onCancel?: (e: Event | null, ctx: PublicState) => void;
|
|
138
|
-
/**
|
|
139
|
-
* 复位回调:取消或未命中触发条件时会自动调用,便于执行复位动画。
|
|
140
|
-
* @param ctx - 当前公开状态
|
|
141
|
-
*/
|
|
142
|
-
onReset?: (ctx: PublicState) => void;
|
|
143
|
-
/**
|
|
144
|
-
* 长按回调:达到长按时长后触发。
|
|
145
|
-
* @param ctx - 当前公开状态
|
|
146
|
-
*/
|
|
147
|
-
onLongPress?: (ctx: PublicState) => void;
|
|
148
|
-
/**
|
|
149
|
-
* 指针守卫:记录后续是否需要响应事件, 只在 pointer-down 中执行一次
|
|
150
|
-
* 返回 true 表示允许,false 表示阻止触发。
|
|
151
|
-
* @param e - PointerEvent
|
|
152
|
-
*/
|
|
153
|
-
pointerGuard?: (e: PointerEvent) => boolean;
|
|
154
|
-
/**
|
|
155
|
-
* 方向守卫:在记录触发与最终释放判定处均会调用,用于限制允许的触发方向。
|
|
156
|
-
* 返回 true 表示允许,false 表示阻止触发。
|
|
157
|
-
* @param dir - 非空方向
|
|
158
|
-
* @param ctx - 当前公开状态
|
|
159
|
-
*/
|
|
160
|
-
directionGuard?: (dir: Exclude<Dir, null>, ctx: PublicState) => boolean;
|
|
161
|
-
}
|
|
162
|
-
export declare function usePointerGesture(container: MaybeElementRef<HTMLElement>, options?: UsePointerGestureOptions): {
|
|
163
|
-
isActive: import("vue").ShallowRef<boolean, boolean>;
|
|
164
|
-
isDragging: import("vue").ShallowRef<boolean, boolean>;
|
|
165
|
-
isLongPressing: import("vue").ShallowRef<boolean, boolean>;
|
|
166
|
-
direction: import("vue").ShallowRef<Dir, Dir>;
|
|
167
|
-
delta: import("vue").ShallowRef<{
|
|
168
|
-
x: number;
|
|
169
|
-
y: number;
|
|
170
|
-
}, {
|
|
171
|
-
x: number;
|
|
172
|
-
y: number;
|
|
173
|
-
}>;
|
|
174
|
-
velocity: import("vue").ShallowRef<Velocity, Velocity>;
|
|
175
|
-
progress: import("vue").ShallowRef<number, number>;
|
|
176
|
-
reset: () => void;
|
|
177
|
-
cancel: () => void;
|
|
178
|
-
stop: () => void;
|
|
179
|
-
};
|
|
180
|
-
export {};
|