@silver-formily/element-plus 2.2.0 → 2.4.0
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 -21
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +18 -21
- package/esm/__builtins__/index.mjs.map +1 -1
- package/esm/__builtins__/shared/index.d.ts +0 -1
- package/esm/__builtins__/shared/index.mjs +18 -21
- package/esm/__builtins__/shared/index.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs +5 -5
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.d.ts +9 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs +25 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -0
- package/esm/__builtins__/shared/utils.d.ts +1 -0
- package/esm/__builtins__/shared/utils.mjs +23 -17
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +56 -52
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.d.ts +0 -1
- package/esm/array-base/utils.mjs +45 -46
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/index.mjs +36 -33
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +39 -37
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +9 -2
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +38 -34
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +38 -36
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +12 -5
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/index.mjs +63 -60
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/utils.mjs +18 -11
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +28 -25
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/autocomplete/autocomplete.d.ts +1222 -0
- package/esm/autocomplete/index.d.ts +639 -0
- package/esm/autocomplete/index.mjs +116 -0
- package/esm/autocomplete/index.mjs.map +1 -0
- package/esm/cascader/index.mjs +22 -18
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.d.ts +42 -42
- package/esm/checkbox/index.mjs +20 -16
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +210 -0
- package/esm/color-picker/index.mjs +17 -0
- package/esm/color-picker/index.mjs.map +1 -0
- package/esm/color-picker-panel/index.d.ts +129 -0
- package/esm/color-picker-panel/index.mjs +25 -0
- package/esm/color-picker-panel/index.mjs.map +1 -0
- package/esm/date-picker/index.mjs +18 -37
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.d.ts +4 -0
- package/esm/date-picker/utils.mjs +27 -0
- package/esm/date-picker/utils.mjs.map +1 -0
- package/esm/date-picker-panel/index.d.ts +143 -0
- package/esm/date-picker-panel/index.mjs +30 -0
- package/esm/date-picker-panel/index.mjs.map +1 -0
- package/esm/editable/editable.d.ts +2 -0
- package/esm/editable/index.d.ts +1 -0
- package/esm/editable/index.mjs +71 -66
- package/esm/editable/index.mjs.map +1 -1
- package/esm/env.d.mjs +2 -0
- package/esm/env.d.mjs.map +1 -0
- package/esm/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/form-button-group.d.ts +10 -1
- package/esm/form-button-group/index.d.ts +18 -3
- package/esm/form-button-group/index.mjs +47 -28
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +9 -2
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +21 -18
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/dialog-content.d.ts +789 -3
- package/esm/form-dialog/index.mjs +97 -86
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +1 -0
- package/esm/form-drawer/drawer-content.d.ts +919 -3
- package/esm/form-drawer/index.mjs +92 -82
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +1 -0
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +26 -22
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.d.ts +1 -0
- package/esm/form-item/index.mjs +102 -99
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/types.d.ts +4 -0
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +18 -14
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs +23 -23
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +30 -27
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.mjs +24 -22
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.d.ts +8 -0
- package/esm/index.mjs +90 -74
- package/esm/index.mjs.map +1 -1
- package/esm/input/index.mjs +30 -26
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.d.ts +21 -21
- package/esm/input-number/index.mjs +11 -8
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +32 -0
- package/esm/input-tag/index.mjs +50 -0
- package/esm/input-tag/index.mjs.map +1 -0
- package/esm/input-tag/input-tag.d.ts +32 -0
- package/esm/mention/index.d.ts +50 -0
- package/esm/mention/index.mjs +97 -0
- package/esm/mention/index.mjs.map +1 -0
- package/esm/mention/mention.d.ts +51 -0
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/color-picker.d.ts +5 -0
- package/esm/preview-text/index.d.ts +5 -0
- package/esm/preview-text/index.mjs +184 -145
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.d.ts +5 -0
- package/esm/query-form/default-components.mjs +47 -0
- package/esm/query-form/default-components.mjs.map +1 -0
- package/esm/query-form/hooks.d.ts +25 -0
- package/esm/query-form/hooks.mjs +29 -0
- package/esm/query-form/hooks.mjs.map +1 -0
- package/esm/query-form/index.d.ts +117 -0
- package/esm/query-form/index.mjs +337 -0
- package/esm/query-form/index.mjs.map +1 -0
- package/esm/query-form/query-form-light.d.ts +27 -0
- package/esm/query-form/query-form.d.ts +52 -0
- package/esm/query-form/types.d.ts +44 -0
- package/esm/query-form/types.mjs +2 -0
- package/esm/query-form/types.mjs.map +1 -0
- package/esm/query-form-item/index.d.ts +151 -0
- package/esm/query-form-item/index.mjs +188 -0
- package/esm/query-form-item/index.mjs.map +1 -0
- package/esm/query-form-item/query-form-item.d.ts +96 -0
- package/esm/query-form-item/types.d.ts +46 -0
- package/esm/query-form-item/types.mjs +2 -0
- package/esm/query-form-item/types.mjs.map +1 -0
- package/esm/radio/index.d.ts +36 -36
- package/esm/radio/index.mjs +29 -25
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.mjs +13 -10
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.mjs +16 -12
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/select/index.mjs +26 -22
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.mjs +36 -33
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/shared/overlay-elements.d.ts +6 -0
- package/esm/shared/overlay-elements.mjs +19 -0
- package/esm/shared/overlay-elements.mjs.map +1 -0
- package/esm/slider/index.mjs +13 -10
- package/esm/slider/index.mjs.map +1 -1
- package/esm/styles/form-button-group/index.css +1 -1
- package/esm/styles/form-item/index.css +1 -1
- package/esm/styles/preview-text/index.css +1 -1
- package/esm/styles/query-form/index.css +1 -0
- package/esm/styles/query-form-item/index.css +1 -0
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +12 -12
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.mjs +9 -6
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.mjs +9 -6
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +33 -29
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.mjs +18 -14
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.d.ts +1 -1
- package/esm/upload/index.mjs +10 -7
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +2 -2
- package/esm/vendor/lodash.mjs +751 -663
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +115 -113
- package/esm/__builtins__/shared/hooks.d.ts +0 -7
- package/esm/__builtins__/shared/hooks.mjs +0 -59
- package/esm/__builtins__/shared/hooks.mjs.map +0 -1
package/esm/vendor/sizes.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.mjs","sources":["../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.22_typescript@5.9.3_/node_modules/element-plus/es/utils/typescript.mjs","../../src/pagination/components/sizes.ts"],"sourcesContent":["const mutable = (val) => val;\n\nexport { mutable };\n//# sourceMappingURL=typescript.mjs.map\n","import type { ExtractPropTypes } from 'vue'\
|
|
1
|
+
{"version":3,"file":"sizes.mjs","sources":["../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.22_typescript@5.9.3_/node_modules/element-plus/es/utils/typescript.mjs","../../src/pagination/components/sizes.ts"],"sourcesContent":["const mutable = (val) => val;\n\nexport { mutable };\n//# sourceMappingURL=typescript.mjs.map\n","import type { ExtractPropTypes } from 'vue'\nimport type Sizes from './sizes.vue'\nimport { componentSizes } from 'element-plus'\nimport { buildProps, definePropType, mutable } from 'element-plus/es/utils/index'\n\nexport const paginationSizesProps = buildProps({\n pageSize: {\n type: Number,\n required: true,\n },\n pageSizes: {\n type: definePropType<number[]>(Array),\n default: () => mutable([10, 20, 30, 40, 50, 100] as const),\n },\n popperClass: {\n type: String,\n },\n disabled: Boolean,\n teleported: Boolean,\n size: {\n type: String,\n values: componentSizes,\n },\n appendSizeTo: String,\n} as const)\n\nexport type PaginationSizesProps = ExtractPropTypes<typeof paginationSizesProps>\n\nexport type SizesInstance = InstanceType<typeof Sizes> & unknown\n"],"names":["mutable","val","paginationSizesProps","buildProps","definePropType","componentSizes"],"mappings":";;AAAK,MAACA,IAAU,CAACC,MAAQA,GCKZC,IAAuBC,EAAW;AAAA,EAC7C,UAAU;AAAA,IACR,MAAM;AAAA,IACN,UAAU;AAAA,EAAA;AAAA,EAEZ,WAAW;AAAA,IACT,MAAMC,EAAyB,KAAK;AAAA,IACpC,SAAS,MAAMJ,EAAQ,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG,CAAU;AAAA,EAAA;AAAA,EAE3D,aAAa;AAAA,IACX,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQK;AAAA,EAAA;AAAA,EAEV,cAAc;AAChB,CAAU;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,113 +1,115 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@silver-formily/element-plus",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"description": "Formily 的 Element Plus 封装",
|
|
6
|
-
"author": "hezhengxu",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"homepage": "https://element-plus.silver-formily.org/",
|
|
9
|
-
"sideEffects": [
|
|
10
|
-
"**/*.css"
|
|
11
|
-
],
|
|
12
|
-
"main": "esm",
|
|
13
|
-
"types": "esm/index.d.ts",
|
|
14
|
-
"files": [
|
|
15
|
-
"esm"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"create:style": "tsx build/create-style",
|
|
19
|
-
"build": "vite build",
|
|
20
|
-
"docs:dev": "vitepress dev docs",
|
|
21
|
-
"docs:build": "vitepress build docs",
|
|
22
|
-
"docs:preview": "vitepress preview docs",
|
|
23
|
-
"test": "vitest --ui",
|
|
24
|
-
"coverage": "vitest run --coverage --browser.headless",
|
|
25
|
-
"lint": "eslint .",
|
|
26
|
-
"lint:fix": "eslint . --fix",
|
|
27
|
-
"commit": "czg",
|
|
28
|
-
"lint-staged": "lint-staged",
|
|
29
|
-
"release": "release-it",
|
|
30
|
-
"prepublishOnly": "pnpm run build",
|
|
31
|
-
"postinstall": "husky"
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"@formily/core": "^2.0.8",
|
|
35
|
-
"@formily/grid": "^2.0.8",
|
|
36
|
-
"@formily/json-schema": "^2.0.8",
|
|
37
|
-
"@formily/reactive": "^2.0.8",
|
|
38
|
-
"@formily/shared": "^2.0.8",
|
|
39
|
-
"@silver-formily/reactive-vue": "^1",
|
|
40
|
-
"@silver-formily/vue": "^2.
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@
|
|
51
|
-
"@commitlint/
|
|
52
|
-
"@
|
|
53
|
-
"@eslint/
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/markdown-it
|
|
61
|
-
"@types/
|
|
62
|
-
"@
|
|
63
|
-
"@vitejs/plugin-vue
|
|
64
|
-
"@
|
|
65
|
-
"@vitest/
|
|
66
|
-
"@vitest/
|
|
67
|
-
"@
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"eslint
|
|
73
|
-
"eslint-plugin-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"vite
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"vitepress
|
|
99
|
-
"vitepress-plugin
|
|
100
|
-
"vitepress-
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@silver-formily/element-plus",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.4.0",
|
|
5
|
+
"description": "Formily 的 Element Plus 封装",
|
|
6
|
+
"author": "hezhengxu",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://element-plus.silver-formily.org/",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"**/*.css"
|
|
11
|
+
],
|
|
12
|
+
"main": "esm",
|
|
13
|
+
"types": "esm/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"esm"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"create:style": "tsx build/create-style",
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"docs:dev": "vitepress dev docs",
|
|
21
|
+
"docs:build": "vitepress build docs",
|
|
22
|
+
"docs:preview": "vitepress preview docs",
|
|
23
|
+
"test": "vitest --ui",
|
|
24
|
+
"coverage": "vitest run --coverage --browser.headless",
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"lint:fix": "eslint . --fix",
|
|
27
|
+
"commit": "czg",
|
|
28
|
+
"lint-staged": "lint-staged",
|
|
29
|
+
"release": "release-it",
|
|
30
|
+
"prepublishOnly": "pnpm run build",
|
|
31
|
+
"postinstall": "husky"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@formily/core": "^2.0.8",
|
|
35
|
+
"@formily/grid": "^2.0.8",
|
|
36
|
+
"@formily/json-schema": "^2.0.8",
|
|
37
|
+
"@formily/reactive": "^2.0.8",
|
|
38
|
+
"@formily/shared": "^2.0.8",
|
|
39
|
+
"@silver-formily/reactive-vue": "^1",
|
|
40
|
+
"@silver-formily/vue": "^2.3.1",
|
|
41
|
+
"@vueuse/core": "*",
|
|
42
|
+
"element-plus": "^2.1.8",
|
|
43
|
+
"vue": "^3.3.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@element-plus/icons-vue": "^2.3.0",
|
|
47
|
+
"vue-draggable-plus": "^0.5.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@antfu/eslint-config": "^4.19.0",
|
|
51
|
+
"@commitlint/cli": "^19.8.1",
|
|
52
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
53
|
+
"@eslint/js": "^9.36.0",
|
|
54
|
+
"@eslint/markdown": "^6.6.0",
|
|
55
|
+
"@iconify-json/ri": "^1.2.5",
|
|
56
|
+
"@mdit-vue/shared": "^2.1.4",
|
|
57
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
58
|
+
"@shikijs/langs": "^3.13.0",
|
|
59
|
+
"@types/lodash-es": "^4.17.12",
|
|
60
|
+
"@types/markdown-it": "^14.1.2",
|
|
61
|
+
"@types/markdown-it-container": "^2.0.10",
|
|
62
|
+
"@types/node": "^20.19.19",
|
|
63
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
64
|
+
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
65
|
+
"@vitest/browser": "^3.2.4",
|
|
66
|
+
"@vitest/coverage-istanbul": "^3.2.4",
|
|
67
|
+
"@vitest/ui": "^3.2.4",
|
|
68
|
+
"@vue/shared": "^3.5.22",
|
|
69
|
+
"baseline-browser-mapping": "^2.9.11",
|
|
70
|
+
"cz-git": "^1.12.0",
|
|
71
|
+
"czg": "^1.12.0",
|
|
72
|
+
"eslint": "^9.36.0",
|
|
73
|
+
"eslint-plugin-format": "^1.4.0",
|
|
74
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
75
|
+
"eslint-plugin-vue": "^10.5.0",
|
|
76
|
+
"execa": "^9.6.0",
|
|
77
|
+
"fast-glob": "^3.3.3",
|
|
78
|
+
"husky": "^9.1.7",
|
|
79
|
+
"lint-staged": "^16.2.3",
|
|
80
|
+
"lodash-es": "^4.17.21",
|
|
81
|
+
"markdown-it": "^14.1.0",
|
|
82
|
+
"markdown-it-container": "^4.0.0",
|
|
83
|
+
"normalize.css": "^8.0.1",
|
|
84
|
+
"nprogress": "^0.2.0",
|
|
85
|
+
"playwright": "^1.55.1",
|
|
86
|
+
"release-it": "^19.0.5",
|
|
87
|
+
"rimraf": "^6.0.1",
|
|
88
|
+
"sass-embedded": "^1.93.2",
|
|
89
|
+
"shiki": "^3.13.0",
|
|
90
|
+
"tsx": "^4.20.6",
|
|
91
|
+
"typescript": "^5.9.3",
|
|
92
|
+
"unocss": "^66.5.2",
|
|
93
|
+
"unplugin-icons": "^22.4.2",
|
|
94
|
+
"unplugin-vue-components": "^28.8.0",
|
|
95
|
+
"vite": "^7.0.0",
|
|
96
|
+
"vite-plugin-dts": "^4.5.4",
|
|
97
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
98
|
+
"vitepress": "2.0.0-alpha.12",
|
|
99
|
+
"vitepress-better-demo-plugin": "^0.6.2",
|
|
100
|
+
"vitepress-plugin-group-icons": "^1.6.5",
|
|
101
|
+
"vitepress-plugin-nprogress": "^0.1.1",
|
|
102
|
+
"vitepress-theme-element-plus": "^1.3.1",
|
|
103
|
+
"vitest": "^3.2.4",
|
|
104
|
+
"vitest-browser-vue": "^0.2.0",
|
|
105
|
+
"vue-eslint-parser": "^10.2.0"
|
|
106
|
+
},
|
|
107
|
+
"config": {
|
|
108
|
+
"commitizen": {
|
|
109
|
+
"path": "./node_modules/cz-git"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"lint-staged": {
|
|
113
|
+
"*.{vue,js,ts,jsx,tsx,md,json}": "eslint --fix"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
export declare function useDebounceFn<T extends (...args: any[]) => any>(fn: T, delay: number | (() => number)): T;
|
|
3
|
-
export declare function useThrottleFn<T extends (...args: any[]) => any>(fn: T, delay: number, trailing?: boolean, leading?: boolean): T;
|
|
4
|
-
export declare function useResizeObserver(target: Ref<Element | null> | Element | null, callback: (entries: ResizeObserverEntry[], observer: ResizeObserver) => void, options?: ResizeObserverOptions): {
|
|
5
|
-
isSupported: boolean;
|
|
6
|
-
stop: () => void;
|
|
7
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { watch as f, onUnmounted as m } from "vue";
|
|
2
|
-
function T(e, o) {
|
|
3
|
-
let u = null;
|
|
4
|
-
return ((...l) => {
|
|
5
|
-
u !== null && clearTimeout(u);
|
|
6
|
-
const t = typeof o == "function" ? o() : o;
|
|
7
|
-
u = setTimeout(() => {
|
|
8
|
-
e(...l), u = null;
|
|
9
|
-
}, t);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function b(e, o, u = !0, l = !0) {
|
|
13
|
-
let t = null, n = 0, s = null;
|
|
14
|
-
return ((...r) => {
|
|
15
|
-
const i = Date.now();
|
|
16
|
-
if (n === 0 && l) {
|
|
17
|
-
n = i, e(...r);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
n === 0 && !l && (n = i);
|
|
21
|
-
const c = o - (i - n);
|
|
22
|
-
s = r, t !== null && clearTimeout(t), c <= 0 && n !== i ? (n = i, e(...r), s = null) : u && (t = setTimeout(() => {
|
|
23
|
-
n = Date.now(), s !== null && (e(...s), s = null), t = null;
|
|
24
|
-
}, c));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function p(e, o, u) {
|
|
28
|
-
let l = null;
|
|
29
|
-
const t = globalThis.window !== void 0 && "ResizeObserver" in globalThis, n = () => {
|
|
30
|
-
l && (l.disconnect(), l = null);
|
|
31
|
-
}, s = () => {
|
|
32
|
-
n();
|
|
33
|
-
}, r = () => {
|
|
34
|
-
n();
|
|
35
|
-
/* istanbul ignore if @preserve */
|
|
36
|
-
if (!t)
|
|
37
|
-
return;
|
|
38
|
-
const i = e && "value" in e ? e.value : e;
|
|
39
|
-
i && (l = new ResizeObserver(o), l.observe(i, u));
|
|
40
|
-
};
|
|
41
|
-
return e && "value" in e ? f(
|
|
42
|
-
e,
|
|
43
|
-
() => {
|
|
44
|
-
r();
|
|
45
|
-
},
|
|
46
|
-
{ immediate: !0, flush: "post" }
|
|
47
|
-
) : r(), m(() => {
|
|
48
|
-
n();
|
|
49
|
-
}), {
|
|
50
|
-
isSupported: t,
|
|
51
|
-
stop: s
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
T as useDebounceFn,
|
|
56
|
-
p as useResizeObserver,
|
|
57
|
-
b as useThrottleFn
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=hooks.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.mjs","sources":["../../../src/__builtins__/shared/hooks.ts"],"sourcesContent":["import type { Ref } from 'vue'\r\nimport { onUnmounted, watch } from 'vue'\r\n\r\nexport function useDebounceFn<T extends (...args: any[]) => any>(\r\n fn: T,\r\n delay: number | (() => number),\r\n): T {\r\n let timeoutId: ReturnType<typeof setTimeout> | null = null\r\n\r\n return ((...args: Parameters<T>) => {\r\n if (timeoutId !== null) {\r\n clearTimeout(timeoutId)\r\n }\r\n\r\n const delayMs = typeof delay === 'function' ? delay() : delay\r\n\r\n timeoutId = setTimeout(() => {\r\n fn(...args)\r\n timeoutId = null\r\n }, delayMs)\r\n }) as T\r\n}\r\n\r\nexport function useThrottleFn<T extends (...args: any[]) => any>(\r\n fn: T,\r\n delay: number,\r\n trailing = true,\r\n leading = true,\r\n): T {\r\n let timeoutId: ReturnType<typeof setTimeout> | null = null\r\n let lastCallTime = 0\r\n let lastArgs: Parameters<T> | null = null\r\n\r\n return ((...args: Parameters<T>) => {\r\n const now = Date.now()\r\n if (lastCallTime === 0 && leading) {\r\n lastCallTime = now\r\n fn(...args)\r\n return\r\n }\r\n if (lastCallTime === 0 && !leading) {\r\n lastCallTime = now\r\n }\r\n\r\n const remainingTime = delay - (now - lastCallTime)\r\n\r\n lastArgs = args\r\n\r\n if (timeoutId !== null) {\r\n clearTimeout(timeoutId)\r\n }\r\n\r\n if (remainingTime <= 0 && lastCallTime !== now) {\r\n lastCallTime = now\r\n fn(...args)\r\n lastArgs = null\r\n }\r\n else if (trailing) {\r\n timeoutId = setTimeout(() => {\r\n lastCallTime = Date.now()\r\n if (lastArgs !== null) {\r\n fn(...lastArgs)\r\n lastArgs = null\r\n }\r\n timeoutId = null\r\n }, remainingTime)\r\n }\r\n }) as T\r\n}\r\n\r\nexport function useResizeObserver(\r\n target: Ref<Element | null> | Element | null,\r\n callback: (entries: ResizeObserverEntry[], observer: ResizeObserver) => void,\r\n options?: ResizeObserverOptions,\r\n): {\r\n isSupported: boolean\r\n stop: () => void\r\n} {\r\n let observer: ResizeObserver | null = null\r\n const isSupported = globalThis.window !== undefined && 'ResizeObserver' in globalThis\r\n\r\n const cleanup = () => {\r\n if (observer) {\r\n observer.disconnect()\r\n observer = null\r\n }\r\n }\r\n\r\n const stop = () => {\r\n cleanup()\r\n }\r\n\r\n const start = () => {\r\n cleanup()\r\n\r\n /* istanbul ignore if @preserve */\r\n if (!isSupported) {\r\n return\r\n }\r\n\r\n const element = (target && 'value' in target ? target.value : target) as Element\r\n\r\n if (!element) {\r\n return\r\n }\r\n\r\n observer = new ResizeObserver(callback)\r\n observer.observe(element, options)\r\n }\r\n\r\n if (target && 'value' in target) {\r\n watch(\r\n target,\r\n () => {\r\n start()\r\n },\r\n { immediate: true, flush: 'post' },\r\n )\r\n }\r\n else {\r\n start()\r\n }\r\n onUnmounted(() => {\r\n cleanup()\r\n })\r\n\r\n return {\r\n isSupported,\r\n stop,\r\n }\r\n}\r\n"],"names":["useDebounceFn","fn","delay","timeoutId","args","delayMs","useThrottleFn","trailing","leading","lastCallTime","lastArgs","now","remainingTime","useResizeObserver","target","callback","options","observer","isSupported","cleanup","stop","start","element","watch","onUnmounted"],"mappings":";AAGO,SAASA,EACdC,GACAC,GACG;AACH,MAAIC,IAAkD;AAEtD,UAAQ,IAAIC,MAAwB;AAClC,IAAID,MAAc,QAChB,aAAaA,CAAS;AAGxB,UAAME,IAAU,OAAOH,KAAU,aAAaA,MAAUA;AAExD,IAAAC,IAAY,WAAW,MAAM;AAC3B,MAAAF,EAAG,GAAGG,CAAI,GACVD,IAAY;AAAA,IACd,GAAGE,CAAO;AAAA,EACZ;AACF;AAEO,SAASC,EACdL,GACAC,GACAK,IAAW,IACXC,IAAU,IACP;AACH,MAAIL,IAAkD,MAClDM,IAAe,GACfC,IAAiC;AAErC,UAAQ,IAAIN,MAAwB;AAClC,UAAMO,IAAM,KAAK,IAAA;AACjB,QAAIF,MAAiB,KAAKD,GAAS;AACjC,MAAAC,IAAeE,GACfV,EAAG,GAAGG,CAAI;AACV;AAAA,IACF;AACA,IAAIK,MAAiB,KAAK,CAACD,MACzBC,IAAeE;AAGjB,UAAMC,IAAgBV,KAASS,IAAMF;AAErC,IAAAC,IAAWN,GAEPD,MAAc,QAChB,aAAaA,CAAS,GAGpBS,KAAiB,KAAKH,MAAiBE,KACzCF,IAAeE,GACfV,EAAG,GAAGG,CAAI,GACVM,IAAW,QAEJH,MACPJ,IAAY,WAAW,MAAM;AAC3B,MAAAM,IAAe,KAAK,IAAA,GAChBC,MAAa,SACfT,EAAG,GAAGS,CAAQ,GACdA,IAAW,OAEbP,IAAY;AAAA,IACd,GAAGS,CAAa;AAAA,EAEpB;AACF;AAEO,SAASC,EACdC,GACAC,GACAC,GAIA;AACA,MAAIC,IAAkC;AACtC,QAAMC,IAAc,WAAW,WAAW,UAAa,oBAAoB,YAErEC,IAAU,MAAM;AACpB,IAAIF,MACFA,EAAS,WAAA,GACTA,IAAW;AAAA,EAEf,GAEMG,IAAO,MAAM;AACjB,IAAAD,EAAA;AAAA,EACF,GAEME,IAAQ,MAAM;AAClB,IAAAF,EAAA;AAAA,IAAQ;AAGR,QAAI,CAACD;AACH;AAGF,UAAMI,IAAWR,KAAU,WAAWA,IAASA,EAAO,QAAQA;AAE9D,IAAKQ,MAILL,IAAW,IAAI,eAAeF,CAAQ,GACtCE,EAAS,QAAQK,GAASN,CAAO;AAAA,EACnC;AAEA,SAAIF,KAAU,WAAWA,IACvBS;AAAA,IACET;AAAA,IACA,MAAM;AACJ,MAAAO,EAAA;AAAA,IACF;AAAA,IACA,EAAE,WAAW,IAAM,OAAO,OAAA;AAAA,EAAO,IAInCA,EAAA,GAEFG,EAAY,MAAM;AAChB,IAAAL,EAAA;AAAA,EACF,CAAC,GAEM;AAAA,IACL,aAAAD;AAAA,IACA,MAAAE;AAAA,EAAA;AAEJ;"}
|