@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/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 hezhengxu2018
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 hezhengxu2018
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en-US.md
CHANGED
|
@@ -21,9 +21,9 @@ https://element-plus.silver-formily.org/
|
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
```bash
|
|
25
25
|
pnpm add @silver-formily/element-plus
|
|
26
|
-
|
|
26
|
+
```
|
|
27
27
|
|
|
28
28
|
This package relies on peer dependencies such as Formily, Element Plus, Vue, and @silver-formily/vue. Refer to the documentation or package.json for compatible versions and setup details.
|
|
29
29
|
|
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/__builtins__/configs/index.ts"],"sourcesContent":["export const stylePrefix = 'formily-element-plus'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/__builtins__/configs/index.ts"],"sourcesContent":["export const stylePrefix = 'formily-element-plus'\n"],"names":["stylePrefix"],"mappings":"AAAO,MAAMA,IAAc;"}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import { stylePrefix as r } from "./configs/index.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { composeExport as y, hasSlotContent as D, isVnodeEmpty as E, isVueOptions as P, useCleanAttrs as V } from "./shared/utils.mjs";
|
|
2
|
+
import { loadElConfigProvider as i } from "./shared/load-config-provider.mjs";
|
|
3
|
+
import { getTransitionDuration as p, loading as m, useDebonceSubmitting as s } from "./shared/loading.mjs";
|
|
4
|
+
import { lt as l, quickVersionCompare as f } from "./shared/simple-version-compare.mjs";
|
|
5
|
+
import { mapReadPretty as d } from "./shared/transform-component.mjs";
|
|
6
|
+
import { compatibleUnderlineProp as c, composeExport as g, hasSlotContent as C, isVnodeEmpty as P, isVueOptions as b, useCleanAttrs as y } from "./shared/utils.mjs";
|
|
8
7
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
P as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
c as compatibleUnderlineProp,
|
|
9
|
+
g as composeExport,
|
|
10
|
+
p as getTransitionDuration,
|
|
11
|
+
C as hasSlotContent,
|
|
12
|
+
P as isVnodeEmpty,
|
|
13
|
+
b as isVueOptions,
|
|
14
|
+
i as loadElConfigProvider,
|
|
15
|
+
m as loading,
|
|
16
|
+
l as lt,
|
|
17
|
+
d as mapReadPretty,
|
|
18
|
+
f as quickVersionCompare,
|
|
19
19
|
r as stylePrefix,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
n as useDebounceFn,
|
|
23
|
-
s as useResizeObserver,
|
|
24
|
-
i as useThrottleFn
|
|
20
|
+
y as useCleanAttrs,
|
|
21
|
+
s as useDebonceSubmitting
|
|
25
22
|
};
|
|
26
23
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { composeExport as g, hasSlotContent as C, isVnodeEmpty as D, isVueOptions as E, useCleanAttrs as V } from "./utils.mjs";
|
|
1
|
+
import { loadElConfigProvider as t } from "./load-config-provider.mjs";
|
|
2
|
+
import { getTransitionDuration as i, loading as n, useDebonceSubmitting as p } from "./loading.mjs";
|
|
3
|
+
import { lt as a, quickVersionCompare as s } from "./simple-version-compare.mjs";
|
|
4
|
+
import { mapReadPretty as d } from "./transform-component.mjs";
|
|
5
|
+
import { compatibleUnderlineProp as u, composeExport as x, hasSlotContent as c, isVnodeEmpty as g, isVueOptions as C, useCleanAttrs as b } from "./utils.mjs";
|
|
7
6
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
t as useResizeObserver,
|
|
22
|
-
n as useThrottleFn
|
|
7
|
+
u as compatibleUnderlineProp,
|
|
8
|
+
x as composeExport,
|
|
9
|
+
i as getTransitionDuration,
|
|
10
|
+
c as hasSlotContent,
|
|
11
|
+
g as isVnodeEmpty,
|
|
12
|
+
C as isVueOptions,
|
|
13
|
+
t as loadElConfigProvider,
|
|
14
|
+
n as loading,
|
|
15
|
+
a as lt,
|
|
16
|
+
d as mapReadPretty,
|
|
17
|
+
s as quickVersionCompare,
|
|
18
|
+
b as useCleanAttrs,
|
|
19
|
+
p as useDebonceSubmitting
|
|
23
20
|
};
|
|
24
21
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { reaction as r } from "@formily/reactive";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useDebounceFn as s } from "@vueuse/core";
|
|
3
|
+
import { ElLoading as a } from "element-plus";
|
|
4
|
+
import { ref as u } from "vue";
|
|
5
5
|
async function p(i = "Loading...", t) {
|
|
6
6
|
let n;
|
|
7
7
|
const e = setTimeout(() => {
|
|
8
|
-
n =
|
|
8
|
+
n = a.service({
|
|
9
9
|
text: i,
|
|
10
10
|
background: "transparent"
|
|
11
11
|
});
|
|
@@ -32,7 +32,7 @@ function c(i = "--el-transition-duration", t = 200) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function b(i) {
|
|
35
|
-
const t =
|
|
35
|
+
const t = u(!1), n = c(), e = s(() => {
|
|
36
36
|
t.value = !1;
|
|
37
37
|
}, () => n);
|
|
38
38
|
return r(() => i.submitting, (o) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.mjs","sources":["../../../src/__builtins__/shared/loading.ts"],"sourcesContent":["import type { Form } from '@formily/core'\
|
|
1
|
+
{"version":3,"file":"loading.mjs","sources":["../../../src/__builtins__/shared/loading.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport { reaction } from '@formily/reactive'\nimport { useDebounceFn } from '@vueuse/core'\nimport { ElLoading } from 'element-plus'\nimport { ref } from 'vue'\n\nexport async function loading(loadingText = 'Loading...', processor: () => Promise<any>) {\n let loadingInstance\n const loading = setTimeout(() => {\n loadingInstance = ElLoading.service({\n text: loadingText,\n background: 'transparent',\n })\n }, 100)\n try {\n return await processor()\n }\n finally {\n loadingInstance?.close()\n clearTimeout(loading)\n }\n}\n\n/**\n * 获取当前element-plus的过渡时长并转换为毫秒\n * @param cssVarName CSS 变量名,默认为 '--el-transition-duration'\n * @param defaultValue 默认值(毫秒),默认为 200\n * @returns 过渡时长(毫秒)\n */\nexport function getTransitionDuration(cssVarName = '--el-transition-duration', defaultValue = 200): number {\n const cssVar = getComputedStyle(document.documentElement)\n .getPropertyValue(cssVarName)\n .trim()\n if (!cssVar) {\n return defaultValue\n }\n const durationMatch = cssVar.match(/^([\\d.]+)\\s*(s|ms)?$/)\n if (!durationMatch) {\n return defaultValue\n }\n\n const value = Number.parseFloat(durationMatch[1])\n const unit = durationMatch[2] || 'ms'\n\n switch (unit) {\n case 's': {\n return value * 1000\n }\n case 'ms': {\n return value\n }\n }\n}\n\nexport function useDebonceSubmitting(form: Form) {\n const internalSubmitting = ref(false)\n const transitionDuration = getTransitionDuration()\n\n const setSubmittingFalse = useDebounceFn(() => {\n internalSubmitting.value = false\n }, () => transitionDuration)\n\n reaction(() => form.submitting, (val) => {\n if (val === false) {\n setSubmittingFalse()\n }\n else {\n internalSubmitting.value = val\n }\n })\n\n return {\n internalSubmitting,\n }\n}\n"],"names":["loading","loadingText","processor","loadingInstance","ElLoading","getTransitionDuration","cssVarName","defaultValue","cssVar","durationMatch","value","useDebonceSubmitting","form","internalSubmitting","ref","transitionDuration","setSubmittingFalse","useDebounceFn","reaction","val"],"mappings":";;;;AAMA,eAAsBA,EAAQC,IAAc,cAAcC,GAA+B;AACvF,MAAIC;AACJ,QAAMH,IAAU,WAAW,MAAM;AAC/B,IAAAG,IAAkBC,EAAU,QAAQ;AAAA,MAClC,MAAMH;AAAA,MACN,YAAY;AAAA,IAAA,CACb;AAAA,EACH,GAAG,GAAG;AACN,MAAI;AACF,WAAO,MAAMC,EAAA;AAAA,EACf,UAAA;AAEE,IAAAC,GAAiB,MAAA,GACjB,aAAaH,CAAO;AAAA,EACtB;AACF;AAQO,SAASK,EAAsBC,IAAa,4BAA4BC,IAAe,KAAa;AACzG,QAAMC,IAAS,iBAAiB,SAAS,eAAe,EACrD,iBAAiBF,CAAU,EAC3B,KAAA;AACH,MAAI,CAACE;AACH,WAAOD;AAET,QAAME,IAAgBD,EAAO,MAAM,sBAAsB;AACzD,MAAI,CAACC;AACH,WAAOF;AAGT,QAAMG,IAAQ,OAAO,WAAWD,EAAc,CAAC,CAAC;AAGhD,UAFaA,EAAc,CAAC,KAAK,MAEzB;AAAA,IACN,KAAK;AACH,aAAOC,IAAQ;AAAA,IAEjB,KAAK;AACH,aAAOA;AAAA,EACT;AAEJ;AAEO,SAASC,EAAqBC,GAAY;AAC/C,QAAMC,IAAqBC,EAAI,EAAK,GAC9BC,IAAqBV,EAAA,GAErBW,IAAqBC,EAAc,MAAM;AAC7C,IAAAJ,EAAmB,QAAQ;AAAA,EAC7B,GAAG,MAAME,CAAkB;AAE3B,SAAAG,EAAS,MAAMN,EAAK,YAAY,CAACO,MAAQ;AACvC,IAAIA,MAAQ,KACVH,EAAA,IAGAH,EAAmB,QAAQM;AAAA,EAE/B,CAAC,GAEM;AAAA,IACL,oBAAAN;AAAA,EAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-version-compare.mjs","sources":["../../../src/__builtins__/shared/simple-version-compare.ts"],"sourcesContent":["function normalizeVersion(v: string) {\
|
|
1
|
+
{"version":3,"file":"simple-version-compare.mjs","sources":["../../../src/__builtins__/shared/simple-version-compare.ts"],"sourcesContent":["function normalizeVersion(v: string) {\n return v.split('.').map((n) => {\n const num = Number.parseInt(n, 10)\n return Number.isNaN(num) ? '0'.padStart(10, '0') : num.toString().padStart(10, '0')\n }).join('.')\n}\n\nexport function quickVersionCompare(v1: string, v2: string): number {\n const nv1 = normalizeVersion(v1)\n const nv2 = normalizeVersion(v2)\n return nv1 > nv2 ? 1 : (nv1 < nv2 ? -1 : 0)\n}\n\nexport function lt(v1: string, v2: string): boolean {\n return quickVersionCompare(v1, v2) < 0\n}\n"],"names":["normalizeVersion","v","n","num","quickVersionCompare","v1","v2","nv1","nv2","lt"],"mappings":"AAAA,SAASA,EAAiBC,GAAW;AACnC,SAAOA,EAAE,MAAM,GAAG,EAAE,IAAI,CAACC,MAAM;AAC7B,UAAMC,IAAM,OAAO,SAASD,GAAG,EAAE;AACjC,WAAO,OAAO,MAAMC,CAAG,IAAI,IAAI,SAAS,IAAI,GAAG,IAAIA,EAAI,SAAA,EAAW,SAAS,IAAI,GAAG;AAAA,EACpF,CAAC,EAAE,KAAK,GAAG;AACb;AAEO,SAASC,EAAoBC,GAAYC,GAAoB;AAClE,QAAMC,IAAMP,EAAiBK,CAAE,GACzBG,IAAMR,EAAiBM,CAAE;AAC/B,SAAOC,IAAMC,IAAM,IAAKD,IAAMC,IAAM,KAAK;AAC3C;AAEO,SAASC,EAAGJ,GAAYC,GAAqB;AAClD,SAAOF,EAAoBC,GAAIC,CAAE,IAAI;AACvC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-component.mjs","sources":["../../../src/__builtins__/shared/transform-component.ts"],"sourcesContent":["import type { IComponentMapper } from '@silver-formily/vue'\
|
|
1
|
+
{"version":3,"file":"transform-component.mjs","sources":["../../../src/__builtins__/shared/transform-component.ts"],"sourcesContent":["import type { IComponentMapper } from '@silver-formily/vue'\nimport type { Component } from 'vue'\nimport { isVoidField } from '@formily/core'\nimport { observer } from '@silver-formily/reactive-vue'\nimport { useField } from '@silver-formily/vue'\nimport { defineComponent, h } from 'vue'\n\n// fork from https://github.com/alibaba/formily/blob/7c64c671252adf85471ac5aabfddbaf4fc537354/packages/vue/src/shared/connect.ts#L65\nexport function mapReadPretty(\n component: Component,\n readPrettyProps?: Record<string, any>,\n): IComponentMapper {\n const mapper = (target: Component) => {\n return observer(\n defineComponent({\n name: target.name ? `Read${target.name}` : `ReadComponent`,\n setup(props, { attrs, slots, listeners }: Record<string, any>) {\n const fieldRef = useField()\n return () => {\n const field = fieldRef.value\n const isEditableReadPretty = !!field?.data?.readPretty\n return h(\n field && !isVoidField(field) && (field.pattern === 'readPretty' || isEditableReadPretty)\n ? component\n : target,\n {\n attrs: {\n ...readPrettyProps,\n ...attrs,\n },\n on: listeners,\n },\n slots,\n )\n }\n },\n }),\n )\n }\n\n return mapper as unknown as IComponentMapper\n}\n"],"names":["mapReadPretty","component","readPrettyProps","target","observer","defineComponent","props","attrs","slots","listeners","fieldRef","useField","field","isEditableReadPretty","h","isVoidField"],"mappings":";;;;AAQO,SAASA,EACdC,GACAC,GACkB;AA6BlB,SA5Be,CAACC,MACPC;AAAA,IACLC,EAAgB;AAAA,MACd,MAAMF,EAAO,OAAO,OAAOA,EAAO,IAAI,KAAK;AAAA,MAC3C,MAAMG,GAAO,EAAE,OAAAC,GAAO,OAAAC,GAAO,WAAAC,KAAkC;AAC7D,cAAMC,IAAWC,EAAA;AACjB,eAAO,MAAM;AACX,gBAAMC,IAAQF,EAAS,OACjBG,IAAuB,CAAC,CAACD,GAAO,MAAM;AAC5C,iBAAOE;AAAA,YACLF,KAAS,CAACG,EAAYH,CAAK,MAAMA,EAAM,YAAY,gBAAgBC,KAC/DZ,IACAE;AAAA,YACJ;AAAA,cACE,OAAO;AAAA,gBACL,GAAGD;AAAA,gBACH,GAAGK;AAAA,cAAA;AAAA,cAEL,IAAIE;AAAA,YAAA;AAAA,YAEND;AAAA,UAAA;AAAA,QAEJ;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EAAA;AAKP;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface UseEnterSubmitOptions {
|
|
3
|
+
visible: Ref<boolean>;
|
|
4
|
+
resolve: () => void;
|
|
5
|
+
submitting: Ref<boolean>;
|
|
6
|
+
getContainer: () => HTMLElement | null;
|
|
7
|
+
enabled?: Ref<boolean> | boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function useEnterSubmit({ visible, resolve, submitting, getContainer, enabled }: UseEnterSubmitOptions): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEventListener as d } from "@vueuse/core";
|
|
2
|
+
import { computed as g, watch as p, onBeforeUnmount as y } from "vue";
|
|
3
|
+
const a = globalThis.window === void 0 ? void 0 : globalThis;
|
|
4
|
+
function E({ visible: n, resolve: s, submitting: l, getContainer: f, enabled: o = !0 }) {
|
|
5
|
+
let e = null;
|
|
6
|
+
const i = g(() => typeof o == "boolean" ? o : o?.value ?? !0), c = (t) => {
|
|
7
|
+
if (t.isComposing || t.shiftKey || t.altKey || t.ctrlKey || t.metaKey || !n.value || !i.value || l.value || t.defaultPrevented)
|
|
8
|
+
return !0;
|
|
9
|
+
const r = f();
|
|
10
|
+
return !!(!r || !(t.target instanceof Node) || !r.contains(t.target) || t.target?.closest("textarea,[contenteditable=true]"));
|
|
11
|
+
}, m = (t) => {
|
|
12
|
+
t.key !== "Enter" || c(t) || (t.preventDefault(), s());
|
|
13
|
+
}, u = (t) => {
|
|
14
|
+
e && (e(), e = null), t && a && (e = d(a, "keydown", m, {
|
|
15
|
+
passive: !1
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
p([n, i], ([t, r]) => {
|
|
19
|
+
u(t && r);
|
|
20
|
+
}, { immediate: !0 }), y(() => u(!1));
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
E as useEnterSubmit
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=use-enter-submit.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-enter-submit.mjs","sources":["../../../src/__builtins__/shared/use-enter-submit.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { computed, onBeforeUnmount, watch } from 'vue'\n\nexport interface UseEnterSubmitOptions {\n visible: Ref<boolean>\n resolve: () => void\n submitting: Ref<boolean>\n getContainer: () => HTMLElement | null\n enabled?: Ref<boolean> | boolean\n}\n\nconst runtimeWindow = globalThis.window === undefined ? undefined : globalThis\n\nexport function useEnterSubmit({ visible, resolve, submitting, getContainer, enabled = true }: UseEnterSubmitOptions) {\n let stopListener: (() => void) | null = null\n const enabledRef = computed(() => {\n if (typeof enabled === 'boolean')\n return enabled\n\n return enabled?.value ?? true\n })\n\n const shouldSkipSubmit = (event: KeyboardEvent) => {\n if (\n event.isComposing\n || event.shiftKey\n || event.altKey\n || event.ctrlKey\n || event.metaKey\n || !visible.value\n || !enabledRef.value\n || submitting.value\n || event.defaultPrevented\n ) {\n return true\n }\n\n const container = getContainer()\n if (!container || !(event.target instanceof Node) || !container.contains(event.target))\n return true\n\n const target = event.target as HTMLElement | null\n if (target?.closest('textarea,[contenteditable=true]'))\n return true\n\n return false\n }\n\n const handleEnterSubmit = (event: KeyboardEvent) => {\n if (event.key !== 'Enter' || shouldSkipSubmit(event))\n return\n\n event.preventDefault()\n resolve()\n }\n\n const toggleListener = (shouldListen: boolean) => {\n if (stopListener) {\n stopListener()\n stopListener = null\n }\n\n if (shouldListen && runtimeWindow) {\n stopListener = useEventListener(runtimeWindow, 'keydown', handleEnterSubmit, {\n passive: false,\n })\n }\n }\n\n watch([visible, enabledRef], ([visibleValue, enabledValue]) => {\n toggleListener(visibleValue && enabledValue)\n }, { immediate: true })\n\n onBeforeUnmount(() => toggleListener(false))\n}\n"],"names":["runtimeWindow","useEnterSubmit","visible","resolve","submitting","getContainer","enabled","stopListener","enabledRef","computed","shouldSkipSubmit","event","container","handleEnterSubmit","toggleListener","shouldListen","useEventListener","watch","visibleValue","enabledValue","onBeforeUnmount"],"mappings":";;AAYA,MAAMA,IAAgB,WAAW,WAAW,SAAY,SAAY;AAE7D,SAASC,EAAe,EAAE,SAAAC,GAAS,SAAAC,GAAS,YAAAC,GAAY,cAAAC,GAAc,SAAAC,IAAU,MAA+B;AACpH,MAAIC,IAAoC;AACxC,QAAMC,IAAaC,EAAS,MACtB,OAAOH,KAAY,YACdA,IAEFA,GAAS,SAAS,EAC1B,GAEKI,IAAmB,CAACC,MAAyB;AACjD,QACEA,EAAM,eACHA,EAAM,YACNA,EAAM,UACNA,EAAM,WACNA,EAAM,WACN,CAACT,EAAQ,SACT,CAACM,EAAW,SACZJ,EAAW,SACXO,EAAM;AAET,aAAO;AAGT,UAAMC,IAAYP,EAAA;AAKlB,WAJI,IAACO,KAAa,EAAED,EAAM,kBAAkB,SAAS,CAACC,EAAU,SAASD,EAAM,MAAM,KAGtEA,EAAM,QACT,QAAQ,iCAAiC;AAAA,EAIvD,GAEME,IAAoB,CAACF,MAAyB;AAClD,IAAIA,EAAM,QAAQ,WAAWD,EAAiBC,CAAK,MAGnDA,EAAM,eAAA,GACNR,EAAA;AAAA,EACF,GAEMW,IAAiB,CAACC,MAA0B;AAChD,IAAIR,MACFA,EAAA,GACAA,IAAe,OAGbQ,KAAgBf,MAClBO,IAAeS,EAAiBhB,GAAe,WAAWa,GAAmB;AAAA,MAC3E,SAAS;AAAA,IAAA,CACV;AAAA,EAEL;AAEA,EAAAI,EAAM,CAACf,GAASM,CAAU,GAAG,CAAC,CAACU,GAAcC,CAAY,MAAM;AAC7D,IAAAL,EAAeI,KAAgBC,CAAY;AAAA,EAC7C,GAAG,EAAE,WAAW,IAAM,GAEtBC,EAAgB,MAAMN,EAAe,EAAK,CAAC;AAC7C;"}
|
|
@@ -6,3 +6,4 @@ export declare function isVueOptions(options: any): options is Component;
|
|
|
6
6
|
export declare function composeExport<T0 extends object, T1 extends object>(s0: T0, s1: T1): T0 & T1;
|
|
7
7
|
export declare function isVnodeEmpty(vnodes: Array<VNode>): boolean;
|
|
8
8
|
export declare function hasSlotContent(slot: Slot<any> | undefined): boolean;
|
|
9
|
+
export declare function compatibleUnderlineProp(): false | "never";
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import { isPlainObj as
|
|
2
|
-
import { useAttrs as i } from "element-plus";
|
|
3
|
-
import { computed as
|
|
1
|
+
import { isPlainObj as u } from "@formily/shared";
|
|
2
|
+
import { useAttrs as i, version as a } from "element-plus";
|
|
3
|
+
import { computed as f, Comment as s, Text as p, Fragment as c } from "vue";
|
|
4
|
+
import { lt as m } from "./simple-version-compare.mjs";
|
|
4
5
|
import { o as n } from "../../vendor/lodash.mjs";
|
|
5
|
-
function
|
|
6
|
+
function O(t = []) {
|
|
6
7
|
const r = i();
|
|
7
8
|
return {
|
|
8
|
-
props:
|
|
9
|
+
props: f(() => {
|
|
9
10
|
const e = ["value", "onChange", "attrs", "on", "readOnly"];
|
|
10
|
-
return
|
|
11
|
+
return u(r.value.attrs) ? n({ ...r.value, ...r.value.attrs }, e.concat(t)) : n(r.value, e.concat(t));
|
|
11
12
|
})
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function C(t) {
|
|
15
16
|
return t && (typeof t.template == "string" || typeof t.render == "function");
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function T(t, r) {
|
|
18
19
|
return Object.assign(t, r);
|
|
19
20
|
}
|
|
20
21
|
/* istanbul ignore next -- @preserve */
|
|
21
|
-
function
|
|
22
|
-
return t.every((r) => !!(r.type === s || r.type ===
|
|
22
|
+
function o(t) {
|
|
23
|
+
return t.every((r) => !!(r.type === s || r.type === p && typeof r.children == "string" && !r.children.trim() || r.type === c && o(r.children)));
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return t ? !
|
|
25
|
+
function b(t) {
|
|
26
|
+
return t ? !o(t()) : !1;
|
|
27
|
+
}
|
|
28
|
+
function d() {
|
|
29
|
+
/* istanbul ignore next -- @preserve */
|
|
30
|
+
return m(a, "2.9.9") ? !1 : "never";
|
|
26
31
|
}
|
|
27
32
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
d as compatibleUnderlineProp,
|
|
34
|
+
T as composeExport,
|
|
35
|
+
b as hasSlotContent,
|
|
36
|
+
o as isVnodeEmpty,
|
|
37
|
+
C as isVueOptions,
|
|
38
|
+
O as useCleanAttrs
|
|
33
39
|
};
|
|
34
40
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../src/__builtins__/shared/utils.ts"],"sourcesContent":["import type { Component, ComputedRef, Slot, VNode } from 'vue'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../src/__builtins__/shared/utils.ts"],"sourcesContent":["import type { Component, ComputedRef, Slot, VNode } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { useAttrs, version } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { Comment, computed, Fragment, Text } from 'vue'\nimport { lt } from './simple-version-compare'\n\nexport function useCleanAttrs(removeAttrsList: string[] = []): {\n props: ComputedRef<Record<string, any>>\n} {\n const attrs = useAttrs()\n const props = computed(() => {\n const DEFAULT_REMOVE_ATTRS = ['value', 'onChange', 'attrs', 'on', 'readOnly']\n if (isPlainObj(attrs.value.attrs)) {\n return omit({ ...attrs.value, ...attrs.value.attrs }, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n }\n return omit(attrs.value, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n })\n return {\n props,\n }\n}\n\nexport function isVueOptions(options: any): options is Component {\n return (\n options\n && (typeof options.template === 'string'\n || typeof options.render === 'function')\n )\n}\n\nexport function composeExport<T0 extends object, T1 extends object>(\n s0: T0,\n s1: T1,\n): T0 & T1 {\n return Object.assign(s0, s1)\n}\n\n// Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77\n/* istanbul ignore next -- @preserve */\nexport function isVnodeEmpty(vnodes: Array<VNode>) {\n return vnodes.every((node: VNode) => {\n if (node.type === Comment) {\n return true\n }\n\n if (node.type === Text && typeof node.children === 'string' && !node.children.trim()) {\n return true\n }\n\n if (\n node.type === Fragment\n && isVnodeEmpty(node.children as Array<VNode>)\n ) {\n return true\n }\n\n return false\n })\n}\n\nexport function hasSlotContent(slot: Slot<any> | undefined) {\n if (!slot) {\n return false\n }\n return !isVnodeEmpty(slot())\n}\n\nexport function compatibleUnderlineProp() {\n /* istanbul ignore next -- @preserve */\n return lt(version, '2.9.9') ? false : 'never'\n}\n"],"names":["useCleanAttrs","removeAttrsList","attrs","useAttrs","computed","DEFAULT_REMOVE_ATTRS","isPlainObj","omit","isVueOptions","options","composeExport","s0","s1","isVnodeEmpty","vnodes","node","Comment","Text","Fragment","hasSlotContent","slot","compatibleUnderlineProp","lt","version"],"mappings":";;;;;AAOO,SAASA,EAAcC,IAA4B,IAExD;AACA,QAAMC,IAAQC,EAAA;AAQd,SAAO;AAAA,IACL,OARYC,EAAS,MAAM;AAC3B,YAAMC,IAAuB,CAAC,SAAS,YAAY,SAAS,MAAM,UAAU;AAC5E,aAAIC,EAAWJ,EAAM,MAAM,KAAK,IACvBK,EAAK,EAAE,GAAGL,EAAM,OAAO,GAAGA,EAAM,MAAM,MAAA,GAASG,EAAqB,OAAOJ,CAAe,CAAC,IAE7FM,EAAKL,EAAM,OAAOG,EAAqB,OAAOJ,CAAe,CAAC;AAAA,IACvE,CAAC;AAAA,EAEC;AAEJ;AAEO,SAASO,EAAaC,GAAoC;AAC/D,SACEA,MACI,OAAOA,EAAQ,YAAa,YAC3B,OAAOA,EAAQ,UAAW;AAEnC;AAEO,SAASC,EACdC,GACAC,GACS;AACT,SAAO,OAAO,OAAOD,GAAIC,CAAE;AAC7B;AAGA;AACO,SAASC,EAAaC,GAAsB;AACjD,SAAOA,EAAO,MAAM,CAACC,MACf,GAAAA,EAAK,SAASC,KAIdD,EAAK,SAASE,KAAQ,OAAOF,EAAK,YAAa,YAAY,CAACA,EAAK,SAAS,KAAA,KAK5EA,EAAK,SAASG,KACXL,EAAaE,EAAK,QAAwB,EAMhD;AACH;AAEO,SAASI,EAAeC,GAA6B;AAC1D,SAAKA,IAGE,CAACP,EAAaO,GAAM,IAFlB;AAGX;AAEO,SAASC,IAA0B;AAAA,EAAA;AAExC,SAAOC,EAAGC,GAAS,OAAO,IAAI,KAAQ;AACxC;"}
|