fast-element-plus 2.0.17 → 2.0.19
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/CHANGELOG.md +20 -0
- package/CONTRIBUTING.md +8 -0
- package/dist/component.d.ts +27 -33
- package/dist/components/avatar/src/avatar.d.ts +4 -4
- package/dist/components/button/src/button.d.ts +1 -1
- package/dist/components/button/src/button.mjs +2 -2
- package/dist/components/button/src/button.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.d.ts +1 -1
- package/dist/components/contextMenu/src/contextMenu.mjs +2 -2
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/dist/components/dialog/src/dialog.d.ts +2 -2
- package/dist/components/dialog/src/dialog.mjs +3 -3
- package/dist/components/dialog/src/dialog.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +2 -2
- package/dist/components/drawer/src/drawer.mjs +3 -3
- package/dist/components/drawer/src/drawer.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.d.ts +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +1 -1
- package/dist/components/select/src/select.mjs +2 -2
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +10 -4
- package/dist/components/selectPage/src/selectPage.mjs +2 -2
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +1 -1
- package/dist/components/selectV2/src/selectV2.mjs +2 -2
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/src/table.d.ts +1 -1
- package/dist/components/table/src/table.mjs +2 -2
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +6 -6
- package/dist/components/tree/src/tree.d.ts +1 -1
- package/dist/components/tree/src/tree.mjs +2 -2
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +19 -7
- package/dist/components/treeSelect/src/treeSelect.mjs +2 -2
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.mjs +2 -2
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +3 -15
- package/dist/components/uploadImage/src/uploadImage.mjs +1 -10
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/utils/async/index.mjs.map +1 -1
- package/dist/utils/date/index.mjs.map +1 -1
- package/dist/utils/object/index.d.ts +28 -6
- package/dist/utils/object/index.mjs +142 -96
- package/dist/utils/object/index.mjs.map +1 -1
- package/dist/utils/string/index.mjs.map +1 -1
- package/dist/utils/vue/emits.mjs.map +1 -1
- package/dist/utils/vue/install.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Fast.Element.Plus are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [2.0.19] - 2026-09-16
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Made `FaUploadImage` `width` and `height` size only the image frame; the tip now uses the outer available width below the frame, so the component's total height includes the tip.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Confined the `FaUploadImage` loading mask to the image frame when a form stretches the outer component to the full row width.
|
|
14
|
+
- Aligned `FaUpload` trigger and `FaUploadImages` add-card styling with and without drag-and-drop, with width constraints for narrow containers.
|
|
15
|
+
- Added a preview page covering normal and loading states for all three upload components with drag-and-drop enabled or disabled, plus the full-width form case.
|
|
16
|
+
|
|
17
|
+
## [2.0.18] - 2026-09-15
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Disabled drag-and-drop upload by default for `FaUploadImage`; callers can still enable it with `drag`.
|
|
22
|
+
|
|
5
23
|
## [2.0.17] - 2026-09-12
|
|
6
24
|
|
|
7
25
|
### Changed
|
|
@@ -191,6 +209,8 @@ All notable changes to Fast.Element.Plus are documented in this file.
|
|
|
191
209
|
- Scoped Table styles and added responsive IconSelector styling.
|
|
192
210
|
- Improved dialogs, drawers, tables, forms, trees, selectors, car-number input, images, and uploads for dark mode, touch input, and narrow viewports.
|
|
193
211
|
|
|
212
|
+
[2.0.19]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.19
|
|
213
|
+
[2.0.18]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.18
|
|
194
214
|
[2.0.17]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.17
|
|
195
215
|
[2.0.16]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.16
|
|
196
216
|
[2.0.15]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.15
|
package/CONTRIBUTING.md
CHANGED
|
@@ -57,6 +57,14 @@ pnpm format:check
|
|
|
57
57
|
pnpm --config.ignore-scripts=true pack --dry-run
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
## Documentation review
|
|
61
|
+
|
|
62
|
+
Use one release flow: change code → update the package version → review and synchronize affected documentation → update the reviewed documentation version → run tests and the documentation build.
|
|
63
|
+
|
|
64
|
+
The single reviewed documentation version is `docReviewVersion` in the frontmatter of `docs/index.md`. It means the documentation has been checked against that package version; it is not the version in which a component or property was introduced. Before updating it, compare the release changes with source and verify the affected Props, Events, Slots, Exposes, `v-model` contracts, defaults, types, behavior, and examples. Update the field after the review even when no documentation text needs to change. If the change scope is uncertain, widen the review instead of assuming that no documentation update is required.
|
|
65
|
+
|
|
66
|
+
`pnpm test:docs` checks the package/documentation version match, public component API-page coverage, required API references, and Markdown example paths. These stable checks do not prove that every semantic description or example is correct, so never update only `docReviewVersion` to make the test pass.
|
|
67
|
+
|
|
60
68
|
## Dependencies
|
|
61
69
|
|
|
62
70
|
Development tools use reviewed caret ranges and are resolved exactly by `pnpm-lock.yaml`. Before changing a dependency:
|
package/dist/component.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** 默认安装器注册的全部 Fast.Element.Plus 组件。 */
|
|
2
2
|
declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
3
|
fit: {
|
|
4
|
-
type: import("vue").PropType<"
|
|
4
|
+
type: import("vue").PropType<"fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down">;
|
|
5
5
|
default: string;
|
|
6
6
|
};
|
|
7
7
|
icon: {
|
|
@@ -34,7 +34,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
34
34
|
error: (evt: Event) => boolean;
|
|
35
35
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
36
|
fit: {
|
|
37
|
-
type: import("vue").PropType<"
|
|
37
|
+
type: import("vue").PropType<"fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down">;
|
|
38
38
|
default: string;
|
|
39
39
|
};
|
|
40
40
|
icon: {
|
|
@@ -65,7 +65,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
65
65
|
onError?: ((evt: Event) => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
67
|
small: boolean;
|
|
68
|
-
fit: "
|
|
68
|
+
fit: "fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down";
|
|
69
69
|
icon: string | import("vue").Component;
|
|
70
70
|
base64: boolean;
|
|
71
71
|
original: boolean;
|
|
@@ -112,7 +112,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
112
112
|
type: import("vue").ComputedRef<"" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger" | undefined>;
|
|
113
113
|
disabled: import("vue").ComputedRef<boolean | undefined>;
|
|
114
114
|
shouldAddSpace: import("vue").ComputedRef<boolean | undefined>;
|
|
115
|
-
loading: import("vue").
|
|
115
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
116
116
|
doLoading: (loadingFunction: () => void | Promise<void>) => Promise<void>;
|
|
117
117
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
118
118
|
click: (event: MouseEvent, done?: () => void) => boolean;
|
|
@@ -414,7 +414,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
414
414
|
default: () => never[];
|
|
415
415
|
};
|
|
416
416
|
}>, {
|
|
417
|
-
visible: import("vue").
|
|
417
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
418
418
|
open: (axis?: {
|
|
419
419
|
x: number;
|
|
420
420
|
y: number;
|
|
@@ -537,8 +537,8 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
537
537
|
updatePosition: () => void;
|
|
538
538
|
} | undefined>;
|
|
539
539
|
resetPosition: import("vue").ComputedRef<(() => void) | undefined>;
|
|
540
|
-
loading: import("vue").
|
|
541
|
-
visible: import("vue").
|
|
540
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
541
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
542
542
|
open: (openFunction?: () => void | Promise<void>) => Promise<void>;
|
|
543
543
|
close: (closeFunction?: () => void | Promise<void>) => Promise<void>;
|
|
544
544
|
refresh: () => Promise<void>;
|
|
@@ -802,8 +802,8 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
802
802
|
ariaLevel: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "2", boolean>;
|
|
803
803
|
}>, {
|
|
804
804
|
handleClose: import("vue").ComputedRef<(() => void) | undefined>;
|
|
805
|
-
loading: import("vue").
|
|
806
|
-
visible: import("vue").
|
|
805
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
806
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
807
807
|
open: (openFunction?: () => void | Promise<void>) => Promise<void>;
|
|
808
808
|
close: (closeFunction?: () => void | Promise<void>) => Promise<void>;
|
|
809
809
|
refresh: () => Promise<void>;
|
|
@@ -1125,7 +1125,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
1125
1125
|
default: undefined;
|
|
1126
1126
|
};
|
|
1127
1127
|
}>, {
|
|
1128
|
-
show: boolean
|
|
1128
|
+
show: import("vue").ComputedRef<boolean>;
|
|
1129
1129
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1130
1130
|
offset: {
|
|
1131
1131
|
type: (NumberConstructor | StringConstructor)[];
|
|
@@ -1705,7 +1705,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
1705
1705
|
onShow?: (() => any) | undefined;
|
|
1706
1706
|
}>, {
|
|
1707
1707
|
small: boolean;
|
|
1708
|
-
fit: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "
|
|
1708
|
+
fit: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "fill" | "cover" | "none" | "contain" | "scale-down", unknown>;
|
|
1709
1709
|
base64: boolean;
|
|
1710
1710
|
original: boolean;
|
|
1711
1711
|
normal: boolean;
|
|
@@ -1974,7 +1974,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
1974
1974
|
setScrollLeft: import("vue").ComputedRef<((left?: number) => void) | undefined>;
|
|
1975
1975
|
columns: import("vue").ComputedRef<import("element-plus").TableColumnCtx<import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow>[] | undefined>;
|
|
1976
1976
|
updateKeyChildren: import("vue").ComputedRef<((key: string, data: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow[]) => void) | undefined>;
|
|
1977
|
-
loading: import("vue").
|
|
1977
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
1978
1978
|
tableData: import("vue").ComputedRef<import("./components").DefaultRow[]>;
|
|
1979
1979
|
tablePagination: import("vue").ComputedRef<{
|
|
1980
1980
|
pageIndex: number;
|
|
@@ -2333,7 +2333,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
2333
2333
|
setScrollLeft: import("vue").ComputedRef<((left?: number) => void) | undefined>;
|
|
2334
2334
|
columns: import("vue").ComputedRef<import("element-plus").TableColumnCtx<import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow>[] | undefined>;
|
|
2335
2335
|
updateKeyChildren: import("vue").ComputedRef<((key: string, data: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow[]) => void) | undefined>;
|
|
2336
|
-
loading: import("vue").
|
|
2336
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
2337
2337
|
tableData: import("vue").ComputedRef<import("./components").DefaultRow[]>;
|
|
2338
2338
|
tablePagination: import("vue").ComputedRef<{
|
|
2339
2339
|
pageIndex: number;
|
|
@@ -2653,7 +2653,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
2653
2653
|
setScrollLeft: import("vue").ComputedRef<((left?: number) => void) | undefined>;
|
|
2654
2654
|
columns: import("vue").ComputedRef<import("element-plus").TableColumnCtx<import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow>[] | undefined>;
|
|
2655
2655
|
updateKeyChildren: import("vue").ComputedRef<((key: string, data: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow[]) => void) | undefined>;
|
|
2656
|
-
loading: import("vue").
|
|
2656
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
2657
2657
|
tableData: import("vue").ComputedRef<import("./components").DefaultRow[]>;
|
|
2658
2658
|
tablePagination: import("vue").ComputedRef<{
|
|
2659
2659
|
pageIndex: number;
|
|
@@ -2846,7 +2846,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
2846
2846
|
};
|
|
2847
2847
|
renderHeader: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["renderHeader"]>;
|
|
2848
2848
|
sortable: {
|
|
2849
|
-
type: (
|
|
2849
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
2850
2850
|
default: boolean;
|
|
2851
2851
|
};
|
|
2852
2852
|
sortMethod: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["sortMethod"]>;
|
|
@@ -2861,7 +2861,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
2861
2861
|
default: undefined;
|
|
2862
2862
|
};
|
|
2863
2863
|
tooltipFormatter: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["tooltipFormatter"]>;
|
|
2864
|
-
fixed: (
|
|
2864
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
|
2865
2865
|
formatter: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["formatter"]>;
|
|
2866
2866
|
selectable: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["selectable"]>;
|
|
2867
2867
|
reserveSelection: BooleanConstructor;
|
|
@@ -2969,7 +2969,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
2969
2969
|
};
|
|
2970
2970
|
renderHeader: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["renderHeader"]>;
|
|
2971
2971
|
sortable: {
|
|
2972
|
-
type: (
|
|
2972
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
2973
2973
|
default: boolean;
|
|
2974
2974
|
};
|
|
2975
2975
|
sortMethod: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["sortMethod"]>;
|
|
@@ -2984,7 +2984,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
2984
2984
|
default: undefined;
|
|
2985
2985
|
};
|
|
2986
2986
|
tooltipFormatter: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["tooltipFormatter"]>;
|
|
2987
|
-
fixed: (
|
|
2987
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
|
2988
2988
|
formatter: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["formatter"]>;
|
|
2989
2989
|
selectable: import("vue").PropType<import("element-plus").TableColumnCtx<import("./components").DefaultRow>["selectable"]>;
|
|
2990
2990
|
reserveSelection: BooleanConstructor;
|
|
@@ -3256,7 +3256,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
3256
3256
|
focus: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3257
3257
|
blur: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3258
3258
|
selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
|
|
3259
|
-
loading: import("vue").
|
|
3259
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
3260
3260
|
refresh: () => Promise<void>;
|
|
3261
3261
|
setSelection: (value: Exclude<import("./components").ElSelectorModelValue, null | undefined>) => void;
|
|
3262
3262
|
clearSelection: () => void;
|
|
@@ -3492,7 +3492,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
3492
3492
|
focus: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3493
3493
|
blur: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3494
3494
|
selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
|
|
3495
|
-
loading: import("vue").
|
|
3495
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
3496
3496
|
refresh: () => Promise<void>;
|
|
3497
3497
|
setSelection: (value: Exclude<import("./components").ElSelectorModelValue, null | undefined>) => void;
|
|
3498
3498
|
clearSelection: () => void;
|
|
@@ -3710,7 +3710,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
3710
3710
|
focus: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3711
3711
|
blur: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3712
3712
|
selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
|
|
3713
|
-
loading: import("vue").
|
|
3713
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
3714
3714
|
refresh: () => Promise<void>;
|
|
3715
3715
|
setSelection: (value: Exclude<import("./components").ElSelectorModelValue, null | undefined>) => void;
|
|
3716
3716
|
clearSelection: () => void;
|
|
@@ -3963,7 +3963,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
3963
3963
|
focus: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3964
3964
|
blur: import("vue").ComputedRef<(() => void) | undefined>;
|
|
3965
3965
|
selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
|
|
3966
|
-
loading: import("vue").
|
|
3966
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
3967
3967
|
selectedList: import("vue").ComputedRef<{
|
|
3968
3968
|
[x: string]: any;
|
|
3969
3969
|
label?: string | undefined;
|
|
@@ -4388,7 +4388,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
4388
4388
|
blur: import("vue").ComputedRef<(() => void) | undefined>;
|
|
4389
4389
|
selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
|
|
4390
4390
|
scrollTo: import("vue").ComputedRef<((index: number) => void) | undefined>;
|
|
4391
|
-
loading: import("vue").
|
|
4391
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
4392
4392
|
refresh: () => Promise<void>;
|
|
4393
4393
|
setSelection: (value: Exclude<import("./components").ElSelectorModelValue, null | undefined>) => void;
|
|
4394
4394
|
clearSelection: () => void;
|
|
@@ -4806,7 +4806,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
4806
4806
|
append: import("vue").ComputedRef<((data: import("element-plus").TreeNodeData, parentNode: import("element-plus").TreeNodeData | import("element-plus").TreeKey | import("element-plus/es/components/tree/src/model/node.mjs").default) => void) | undefined>;
|
|
4807
4807
|
insertBefore: import("vue").ComputedRef<((data: import("element-plus").TreeNodeData, refNode: import("element-plus").TreeKey | import("element-plus").TreeNodeData | import("element-plus/es/components/tree/src/model/node.mjs").default) => void) | undefined>;
|
|
4808
4808
|
insertAfter: import("vue").ComputedRef<((data: import("element-plus").TreeNodeData, refNode: import("element-plus").TreeKey | import("element-plus").TreeNodeData | import("element-plus/es/components/tree/src/model/node.mjs").default) => void) | undefined>;
|
|
4809
|
-
loading: import("vue").
|
|
4809
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
4810
4810
|
refresh: () => Promise<void>;
|
|
4811
4811
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4812
4812
|
"update:modelValue": (value: string | number | boolean | object | null | undefined) => boolean;
|
|
@@ -5250,7 +5250,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
5250
5250
|
insertAfter: import("vue").ComputedRef<((data: import("element-plus").TreeNodeData, refNode: import("element-plus").TreeKey | import("element-plus").TreeNodeData | import("element-plus/es/components/tree/src/model/node.mjs").default) => void) | undefined>;
|
|
5251
5251
|
treeRef: import("vue").ComputedRef<import("element-plus").TreeInstance | undefined>;
|
|
5252
5252
|
selectRef: import("vue").ComputedRef<import("element-plus").SelectInstance | undefined>;
|
|
5253
|
-
loading: import("vue").
|
|
5253
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
5254
5254
|
refresh: () => Promise<void>;
|
|
5255
5255
|
setSelection: (value: Exclude<import("./components").ElSelectorModelValue, null | undefined>) => void;
|
|
5256
5256
|
clearSelection: () => void;
|
|
@@ -5914,10 +5914,6 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
5914
5914
|
directory: boolean;
|
|
5915
5915
|
maxSize: string | number;
|
|
5916
5916
|
}, import("./utils").TypedSlotsDeclaration<import("./components").FaUploadSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> | import("./utils").TSXWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5917
|
-
drag: {
|
|
5918
|
-
type: BooleanConstructor;
|
|
5919
|
-
default: boolean;
|
|
5920
|
-
};
|
|
5921
5917
|
accept: {
|
|
5922
5918
|
type: StringConstructor;
|
|
5923
5919
|
default: () => string;
|
|
@@ -6046,6 +6042,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
6046
6042
|
method: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "post", boolean>;
|
|
6047
6043
|
data: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>> | Promise<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>)) | (() => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>)) | (((new (...args: any[]) => import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>> | Promise<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>)) | (() => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>))) | null)[], unknown, unknown, () => import("element-plus/es/utils/typescript.mjs").Mutable<{}>, boolean>;
|
|
6048
6044
|
name: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "file", boolean>;
|
|
6045
|
+
drag: BooleanConstructor;
|
|
6049
6046
|
withCredentials: BooleanConstructor;
|
|
6050
6047
|
fileList: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").UploadUserFile[]) | (() => import("element-plus").UploadUserFile[]) | (((new (...args: any[]) => import("element-plus").UploadUserFile[]) | (() => import("element-plus").UploadUserFile[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
6051
6048
|
autoUpload: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
@@ -6075,10 +6072,6 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
6075
6072
|
"update:modelValue": (value: string | null) => boolean;
|
|
6076
6073
|
"update:fileList": (value: import("element-plus").UploadUserFile[]) => boolean;
|
|
6077
6074
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
6078
|
-
drag: {
|
|
6079
|
-
type: BooleanConstructor;
|
|
6080
|
-
default: boolean;
|
|
6081
|
-
};
|
|
6082
6075
|
accept: {
|
|
6083
6076
|
type: StringConstructor;
|
|
6084
6077
|
default: () => string;
|
|
@@ -6207,6 +6200,7 @@ declare const _default: (import("./utils").TSXWithInstall<import("vue").DefineCo
|
|
|
6207
6200
|
method: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "post", boolean>;
|
|
6208
6201
|
data: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>> | Promise<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>)) | (() => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>)) | (((new (...args: any[]) => import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>> | Promise<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>)) | (() => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus/es/utils/typescript.mjs").Mutable<Record<string, any>>> | ((rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.mjs").Awaitable<import("element-plus").UploadData>))) | null)[], unknown, unknown, () => import("element-plus/es/utils/typescript.mjs").Mutable<{}>, boolean>;
|
|
6209
6202
|
name: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "file", boolean>;
|
|
6203
|
+
drag: BooleanConstructor;
|
|
6210
6204
|
withCredentials: BooleanConstructor;
|
|
6211
6205
|
fileList: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").UploadUserFile[]) | (() => import("element-plus").UploadUserFile[]) | (((new (...args: any[]) => import("element-plus").UploadUserFile[]) | (() => import("element-plus").UploadUserFile[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
6212
6206
|
autoUpload: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
@@ -3,7 +3,7 @@ import type { Component } from "vue";
|
|
|
3
3
|
export declare const faAvatarProps: {
|
|
4
4
|
/** @description set how the image fit its container for an image avatar. */
|
|
5
5
|
fit: {
|
|
6
|
-
type: import("vue").PropType<"
|
|
6
|
+
type: import("vue").PropType<"fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down">;
|
|
7
7
|
default: string;
|
|
8
8
|
};
|
|
9
9
|
/** @description representation type to icon, more info on icon component. */
|
|
@@ -51,7 +51,7 @@ export interface FaAvatarSlots extends Record<string, unknown> {
|
|
|
51
51
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
52
52
|
/** @description set how the image fit its container for an image avatar. */
|
|
53
53
|
fit: {
|
|
54
|
-
type: import("vue").PropType<"
|
|
54
|
+
type: import("vue").PropType<"fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down">;
|
|
55
55
|
default: string;
|
|
56
56
|
};
|
|
57
57
|
/** @description representation type to icon, more info on icon component. */
|
|
@@ -92,7 +92,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
92
92
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
93
93
|
/** @description set how the image fit its container for an image avatar. */
|
|
94
94
|
fit: {
|
|
95
|
-
type: import("vue").PropType<"
|
|
95
|
+
type: import("vue").PropType<"fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down">;
|
|
96
96
|
default: string;
|
|
97
97
|
};
|
|
98
98
|
/** @description representation type to icon, more info on icon component. */
|
|
@@ -129,7 +129,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
129
129
|
onError?: ((evt: Event) => any) | undefined;
|
|
130
130
|
}>, {
|
|
131
131
|
small: boolean;
|
|
132
|
-
fit: "
|
|
132
|
+
fit: "fill" | "cover" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "scale-down";
|
|
133
133
|
icon: string | Component;
|
|
134
134
|
base64: boolean;
|
|
135
135
|
original: boolean;
|
|
@@ -108,7 +108,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
108
108
|
/** @description 是否在两个字符之间插入空格 */
|
|
109
109
|
shouldAddSpace: import("vue").ComputedRef<boolean | undefined>;
|
|
110
110
|
/** @description 加载状态 */
|
|
111
|
-
loading: import("vue").
|
|
111
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
112
112
|
/** @description 按钮加载 */
|
|
113
113
|
doLoading: (loadingFunction: () => void | Promise<void>) => Promise<void>;
|
|
114
114
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -4,7 +4,7 @@ import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
|
4
4
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
5
5
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
6
6
|
import { useOverlay } from "../../../hooks/use-overlay/index.mjs";
|
|
7
|
-
import { computed, createVNode, defineComponent, mergeProps, reactive, shallowRef, watch, withModifiers } from "vue";
|
|
7
|
+
import { computed, createVNode, defineComponent, mergeProps, reactive, shallowRef, toRef, watch, withModifiers } from "vue";
|
|
8
8
|
import { Eleme } from "@element-plus/icons-vue";
|
|
9
9
|
import { ElButton, buttonEmits, buttonProps } from "element-plus";
|
|
10
10
|
//#region src/components/button/src/button.tsx
|
|
@@ -97,7 +97,7 @@ var button_default = defineComponent({
|
|
|
97
97
|
/** @description 是否在两个字符之间插入空格 */
|
|
98
98
|
shouldAddSpace: computed(() => buttonRef.value?.shouldAddSpace),
|
|
99
99
|
/** @description 加载状态 */
|
|
100
|
-
loading:
|
|
100
|
+
loading: toRef(state, "loading"),
|
|
101
101
|
/** @description 按钮加载 */
|
|
102
102
|
doLoading: handleLoading
|
|
103
103
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","names":[],"sources":["../../../../src/components/button/src/button.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, shallowRef, watch, withModifiers } from \"vue\";\nimport { Eleme } from \"@element-plus/icons-vue\";\nimport { ElButton, buttonEmits, buttonProps } from \"element-plus\";\nimport { useOverlay } from \"../../../hooks\";\nimport { callOptionalFunction, definePropType, makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { ButtonInstance } from \"element-plus\";\nimport type { Component } from \"vue\";\n\n/** FaButton 的运行时 Props 定义。 */\nexport const faButtonProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...buttonProps,\n\t/**\n\t * @description customize loading icon component\n\t * @default Eleme\n\t */\n\tloadingIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: () => Eleme,\n\t},\n\t/** @description 禁用加载 */\n\tdisabledLoading: Boolean,\n};\n\n/** FaButton 的运行时 Emits 定义。 */\nexport const faButtonEmits = {\n\t...buttonEmits,\n\t/**\n\t * @description 点击事件\n\t * @param done 需要手动隐藏Loading\n\t */\n\tclick: (event: MouseEvent, done: () => void = () => undefined) => event instanceof MouseEvent && typeof done === \"function\",\n};\n\n/** FaButton 的插槽参数。 */\nexport interface FaButtonSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n\t/** @description 自定义加载中组件 */\n\tloading: never;\n\t/** @description 自定义图标组件 */\n\ticon: never;\n}\n\nexport default defineComponent({\n\tname: \"FaButton\",\n\tprops: faButtonProps,\n\temits: faButtonEmits,\n\tslots: makeSlots<FaButtonSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst buttonRef = shallowRef<ButtonInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t});\n\n\t\tconst showLoading = () => {\n\t\t\tstate.loading = true;\n\t\t\t// 这里默认透明\n\t\t\tuseOverlay.show(0);\n\t\t};\n\n\t\tconst hideLoading = () => {\n\t\t\tstate.loading = false;\n\t\t\tuseOverlay.hide();\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>) => {\n\t\t\tshowLoading();\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\thideLoading();\n\t\t\t}\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent) => {\n\t\t\tif (props.disabledLoading) {\n\t\t\t\t// 回调点击事件\n\t\t\t\temit(\"click\", event);\n\t\t\t} else {\n\t\t\t\tshowLoading();\n\t\t\t\t// 回调点击事件\n\t\t\t\temit(\"click\", event, hideLoading);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * 监听外部 loading 的值\n\t\t */\n\t\twatch(\n\t\t\t() => props.loading,\n\t\t\t(newValue) => {\n\t\t\t\tif (props.disabledLoading) return;\n\t\t\t\tif (newValue) {\n\t\t\t\t\tshowLoading();\n\t\t\t\t} else {\n\t\t\t\t\thideLoading();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elButtonProps = useProps(props, buttonProps, [\"loading\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElButton\n\t\t\t\t{...elButtonProps.value}\n\t\t\t\tref={buttonRef}\n\t\t\t\tclass=\"fa-button\"\n\t\t\t\tloading={state.loading}\n\t\t\t\tonClick={withModifiers((event: Event) => handleClick(event as MouseEvent), [\"prevent\"])}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () => slots.default?.(),\n\t\t\t\t\t...(slots.loading && { loading: () => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.icon && { icon: () => slots.icon?.() ?? [] }),\n\t\t\t\t}}\n\t\t\t</ElButton>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 按钮 html 元素 */\n\t\t\tref: computed(() => buttonRef.value?.ref),\n\t\t\t/** @description 按钮尺寸 */\n\t\t\tsize: computed(() => buttonRef.value?.size),\n\t\t\t/** @description 按钮类型 */\n\t\t\ttype: computed(() => buttonRef.value?.type),\n\t\t\t/** @description 按钮已禁用 */\n\t\t\tdisabled: computed(() => buttonRef.value?.disabled),\n\t\t\t/** @description 是否在两个字符之间插入空格 */\n\t\t\tshouldAddSpace: computed(() => buttonRef.value?.shouldAddSpace),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading:
|
|
1
|
+
{"version":3,"file":"button.mjs","names":[],"sources":["../../../../src/components/button/src/button.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, shallowRef, toRef, watch, withModifiers } from \"vue\";\nimport { Eleme } from \"@element-plus/icons-vue\";\nimport { ElButton, buttonEmits, buttonProps } from \"element-plus\";\nimport { useOverlay } from \"../../../hooks\";\nimport { callOptionalFunction, definePropType, makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { ButtonInstance } from \"element-plus\";\nimport type { Component } from \"vue\";\n\n/** FaButton 的运行时 Props 定义。 */\nexport const faButtonProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...buttonProps,\n\t/**\n\t * @description customize loading icon component\n\t * @default Eleme\n\t */\n\tloadingIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: () => Eleme,\n\t},\n\t/** @description 禁用加载 */\n\tdisabledLoading: Boolean,\n};\n\n/** FaButton 的运行时 Emits 定义。 */\nexport const faButtonEmits = {\n\t...buttonEmits,\n\t/**\n\t * @description 点击事件\n\t * @param done 需要手动隐藏Loading\n\t */\n\tclick: (event: MouseEvent, done: () => void = () => undefined) => event instanceof MouseEvent && typeof done === \"function\",\n};\n\n/** FaButton 的插槽参数。 */\nexport interface FaButtonSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n\t/** @description 自定义加载中组件 */\n\tloading: never;\n\t/** @description 自定义图标组件 */\n\ticon: never;\n}\n\nexport default defineComponent({\n\tname: \"FaButton\",\n\tprops: faButtonProps,\n\temits: faButtonEmits,\n\tslots: makeSlots<FaButtonSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst buttonRef = shallowRef<ButtonInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t});\n\n\t\tconst showLoading = () => {\n\t\t\tstate.loading = true;\n\t\t\t// 这里默认透明\n\t\t\tuseOverlay.show(0);\n\t\t};\n\n\t\tconst hideLoading = () => {\n\t\t\tstate.loading = false;\n\t\t\tuseOverlay.hide();\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>) => {\n\t\t\tshowLoading();\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\thideLoading();\n\t\t\t}\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent) => {\n\t\t\tif (props.disabledLoading) {\n\t\t\t\t// 回调点击事件\n\t\t\t\temit(\"click\", event);\n\t\t\t} else {\n\t\t\t\tshowLoading();\n\t\t\t\t// 回调点击事件\n\t\t\t\temit(\"click\", event, hideLoading);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * 监听外部 loading 的值\n\t\t */\n\t\twatch(\n\t\t\t() => props.loading,\n\t\t\t(newValue) => {\n\t\t\t\tif (props.disabledLoading) return;\n\t\t\t\tif (newValue) {\n\t\t\t\t\tshowLoading();\n\t\t\t\t} else {\n\t\t\t\t\thideLoading();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elButtonProps = useProps(props, buttonProps, [\"loading\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElButton\n\t\t\t\t{...elButtonProps.value}\n\t\t\t\tref={buttonRef}\n\t\t\t\tclass=\"fa-button\"\n\t\t\t\tloading={state.loading}\n\t\t\t\tonClick={withModifiers((event: Event) => handleClick(event as MouseEvent), [\"prevent\"])}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () => slots.default?.(),\n\t\t\t\t\t...(slots.loading && { loading: () => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.icon && { icon: () => slots.icon?.() ?? [] }),\n\t\t\t\t}}\n\t\t\t</ElButton>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 按钮 html 元素 */\n\t\t\tref: computed(() => buttonRef.value?.ref),\n\t\t\t/** @description 按钮尺寸 */\n\t\t\tsize: computed(() => buttonRef.value?.size),\n\t\t\t/** @description 按钮类型 */\n\t\t\ttype: computed(() => buttonRef.value?.type),\n\t\t\t/** @description 按钮已禁用 */\n\t\t\tdisabled: computed(() => buttonRef.value?.disabled),\n\t\t\t/** @description 是否在两个字符之间插入空格 */\n\t\t\tshouldAddSpace: computed(() => buttonRef.value?.shouldAddSpace),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** @description 按钮加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;AASA,MAAa,gBAAgB;CAE5B,GAAG;;;;;CAKH,aAAa;EACZ,MAAM,eAAmC;GAAC;GAAQ;GAAQ;EAAQ,CAAC;EACnE,eAAe;CAChB;;CAEA,iBAAiB;AAClB;;AAGA,MAAa,gBAAgB;CAC5B,GAAG;;;;;CAKH,QAAQ,OAAmB,aAAyB,KAAA,MAAc,iBAAiB,cAAc,OAAO,SAAS;AAClH;AAYA,IAAA,iBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAyB;CAChC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;E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S;;GAE/B,WAAW;EACZ,CAAC;CACF;AACD,CAAC"}
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7
7
|
};
|
|
8
8
|
}>, {
|
|
9
9
|
/** @description 是否显示 */
|
|
10
|
-
visible: import("vue").
|
|
10
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
11
11
|
/** @description 打开菜单 */
|
|
12
12
|
open: (axis?: {
|
|
13
13
|
x: number;
|
|
@@ -2,7 +2,7 @@ import { useExpose } from "../../../utils/vue/expose.mjs";
|
|
|
2
2
|
import { definePropType } from "../../../utils/vue/props.mjs";
|
|
3
3
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
4
4
|
import { FaIcon } from "../../icon/index.mjs";
|
|
5
|
-
import { Transition,
|
|
5
|
+
import { Transition, createVNode, defineComponent, onBeforeUnmount, onMounted, reactive, toRef, vShow, withDirectives } from "vue";
|
|
6
6
|
import { useGlobalSize } from "element-plus";
|
|
7
7
|
//#region src/components/contextMenu/src/contextMenu.tsx
|
|
8
8
|
var contextMenu_default = defineComponent({
|
|
@@ -66,7 +66,7 @@ click: (event, data) => event instanceof MouseEvent && typeof data === "object"
|
|
|
66
66
|
}, [item.icon ? createVNode(FaIcon, { "name": item.icon }, null) : null, createVNode("span", null, [item.label])]))])]), [[vShow, state.visible]])] }));
|
|
67
67
|
return useExpose(expose, {
|
|
68
68
|
/** @description 是否显示 */
|
|
69
|
-
visible:
|
|
69
|
+
visible: toRef(state, "visible"),
|
|
70
70
|
/** @description 打开菜单 */
|
|
71
71
|
open,
|
|
72
72
|
/** @description 关闭菜单 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextMenu.mjs","names":[],"sources":["../../../../src/components/contextMenu/src/contextMenu.tsx"],"sourcesContent":["import { Transition,
|
|
1
|
+
{"version":3,"file":"contextMenu.mjs","names":[],"sources":["../../../../src/components/contextMenu/src/contextMenu.tsx"],"sourcesContent":["import { Transition, defineComponent, onBeforeUnmount, onMounted, reactive, toRef } from \"vue\";\nimport { useGlobalSize } from \"element-plus\";\nimport { definePropType, useExpose, useRender } from \"../../../utils\";\nimport { FaIcon } from \"../../icon\";\nimport type { FaContextMenuData } from \"./contextMenu.type\";\n\nexport default defineComponent({\n\tname: \"FaContextMenu\",\n\tprops: {\n\t\t/** @description 数据 */\n\t\tdata: {\n\t\t\ttype: definePropType<FaContextMenuData[]>(Array),\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 点击事件 */\n\t\tclick: (event: MouseEvent, data: FaContextMenuData | null) => event instanceof MouseEvent && typeof data === \"object\" && data !== null,\n\t},\n\tsetup(props, { emit, expose }) {\n\t\tconst globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvisible: false,\n\t\t\taxis: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t},\n\t\t});\n\n\t\tconst handleClick = (event: MouseEvent, data: FaContextMenuData | null) => {\n\t\t\tif (data?.disabled) return;\n\t\t\tdata?.click?.(event, data);\n\t\t\temit(\"click\", event, data);\n\t\t};\n\n\t\tconst open = (axis: { x: number; y: number } = { x: 0, y: 0 }) => {\n\t\t\tstate.axis = axis;\n\t\t\tstate.visible = true;\n\t\t};\n\n\t\tconst close = () => {\n\t\t\tstate.visible = false;\n\t\t};\n\n\t\tonMounted(() => {\n\t\t\tdocument.addEventListener(\"click\", close);\n\t\t});\n\n\t\tonBeforeUnmount(() => {\n\t\t\tdocument.removeEventListener(\"click\", close);\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<Transition name=\"el-zoom-in-top\">\n\t\t\t\t<div\n\t\t\t\t\tclass={[\"fa-context-menu\", `fa-context-menu-${globalSize.value}`, \"el-popper el-dropdown__popper\"]}\n\t\t\t\t\tstyle={{ top: `${state.axis.y + 5}px`, left: `${state.axis.x + 14}px` }}\n\t\t\t\t\tvShow={state.visible}\n\t\t\t\t\tkey={Math.random()}\n\t\t\t\t>\n\t\t\t\t\t<ul class=\"el-dropdown-menu\">\n\t\t\t\t\t\t{props.data\n\t\t\t\t\t\t\t.filter((f) => !f.hide)\n\t\t\t\t\t\t\t.map((item) => (\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\tclass={[\"el-dropdown-menu__item\", item.disabled === true ? \"is-disabled\" : \"\"]}\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t\tonClick={(event: MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\thandleClick(event, item);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{item.icon ? <FaIcon name={item.icon} /> : null}\n\t\t\t\t\t\t\t\t\t<span>{item.label}</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</Transition>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 是否显示 */\n\t\t\tvisible: toRef(state, \"visible\"),\n\t\t\t/** @description 打开菜单 */\n\t\t\topen,\n\t\t\t/** @description 关闭菜单 */\n\t\t\tclose,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;AAMA,IAAA,sBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;AAEN,MAAM;EACL,MAAM,eAAoC,KAAK;EAC/C,eAAe,CAAA;CAChB,EACD;CACA,OAAO;;AAEN,QAAQ,OAAmB,SAAmC,iBAAiB,cAAc,OAAO,SAAS,YAAY,SAAS,KACnI;CACA,MAAM,OAAO,EAAE,MAAM,UAAU;EAC9B,MAAM,aAAa,cAAc;EAEjC,MAAM,QAAQ,SAAS;GACtB,SAAS;GACT,MAAM;IACL,GAAG;IACH,GAAG;GACJ;EACD,CAAC;EAED,MAAM,eAAe,OAAmB,SAAmC;GAC1E,IAAI,MAAM,UAAU;GACpB,MAAM,QAAQ,OAAO,IAAI;GACzB,KAAK,SAA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284
284
|
/** @description 重置位置 */
|
|
285
285
|
resetPosition: import("vue").ComputedRef<(() => void) | undefined>;
|
|
286
286
|
/** @description 加载状态 */
|
|
287
|
-
loading: import("vue").
|
|
287
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
288
288
|
/** @description 是否显示 */
|
|
289
|
-
visible: import("vue").
|
|
289
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
290
290
|
/** @description 打开弹窗 */
|
|
291
291
|
open: (openFunction?: () => void | Promise<void>) => Promise<void>;
|
|
292
292
|
/** @description 关闭弹窗 */
|
|
@@ -5,7 +5,7 @@ import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
|
5
5
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
6
6
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
7
7
|
import { FullScreen, FullScreenExit } from "@fast-element-plus/icons-vue";
|
|
8
|
-
import { Fragment, computed, createVNode, defineComponent, mergeProps, nextTick, reactive, resolveDirective, shallowRef, watch, withDirectives } from "vue";
|
|
8
|
+
import { Fragment, computed, createVNode, defineComponent, mergeProps, nextTick, reactive, resolveDirective, shallowRef, toRef, watch, withDirectives } from "vue";
|
|
9
9
|
import { Close, Eleme, Refresh } from "@element-plus/icons-vue";
|
|
10
10
|
import { ElButton, ElDialog, ElIcon, ElMessage, ElMessageBox, ElScrollbar, dialogEmits, dialogProps, useGlobalSize } from "element-plus";
|
|
11
11
|
//#region src/components/dialog/src/dialog.tsx
|
|
@@ -272,9 +272,9 @@ var dialog_default = defineComponent({
|
|
|
272
272
|
/** @description 重置位置 */
|
|
273
273
|
resetPosition: computed(() => dialogRef.value?.resetPosition),
|
|
274
274
|
/** @description 加载状态 */
|
|
275
|
-
loading:
|
|
275
|
+
loading: toRef(state, "loading"),
|
|
276
276
|
/** @description 是否显示 */
|
|
277
|
-
visible:
|
|
277
|
+
visible: toRef(state, "visible"),
|
|
278
278
|
/** @description 打开弹窗 */
|
|
279
279
|
open: handleOpen,
|
|
280
280
|
/** @description 关闭弹窗 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","names":["update:modelValue"],"sources":["../../../../src/components/dialog/src/dialog.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, nextTick, reactive, shallowRef, watch } from \"vue\";\nimport { Close, Eleme, Refresh } from \"@element-plus/icons-vue\";\nimport { ElButton, ElDialog, ElIcon, ElMessage, ElMessageBox, ElScrollbar, dialogEmits, dialogProps, useGlobalSize } from \"element-plus\";\nimport { FullScreen, FullScreenExit } from \"@fast-element-plus/icons-vue\";\nimport { callOptionalFunction, definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { DialogInstance } from \"element-plus\";\n\n/** FaDialog 的运行时 Props 定义。 */\nexport const faDialogProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...dialogProps,\n\t/** @description whether to align the dialog both horizontally and vertically*/\n\talignCenter: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */\n\tappendToBody: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description enable dragging feature for Dialog */\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description destroy elements in Dialog when closed */\n\tdestroyOnClose: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description draggable Dialog can overflow the viewport */\n\toverflow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description value for `margin-top` of Dialog CSS, default is 15vh */\n\ttop: {\n\t\ttype: String,\n\t\tdefault: \"5vh\",\n\t},\n\t/** @description width of Dialog, default is 50% */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"90%\",\n\t},\n\t/** @description 显示刷新按钮 */\n\tshowRefresh: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示全屏图标 */\n\tshowFullscreen: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示关闭按钮 */\n\tshowCloseButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示确认按钮 */\n\tshowConfirmButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 禁用确认按钮 */\n\tdisabledConfirmButton: Boolean,\n\t/** @description 关闭按钮文字,默认取消 */\n\tcloseButtonText: {\n\t\ttype: String,\n\t\tdefault: \"取消\",\n\t},\n\t/** @description 确认按钮文字,默认确认 */\n\tconfirmButtonText: {\n\t\ttype: String,\n\t\tdefault: \"确认\",\n\t},\n\t/** @description 隐藏底部操作 */\n\thideFooter: Boolean,\n\t/** @description 撑满高度 */\n\tfullHeight: Boolean,\n\t/** @description 显示关闭回调 */\n\tshowBeforeClose: Boolean,\n\t/** @description 打开之后 */\n\tafterOpen: {\n\t\ttype: definePropType<() => void | Promise<void>>(Function),\n\t},\n};\n\n/** FaDialog 的运行时 Emits 定义。 */\nexport const faDialogEmits = {\n\t...dialogEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: boolean) => typeof value === \"boolean\",\n\t/** @description 确认按钮点击事件 */\n\tconfirmClick: () => true,\n};\n\n/** FaDialog 的插槽参数。 */\nexport interface FaDialogSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { loading: boolean };\n\t/** @description 头部插槽 */\n\theader: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 标题插槽 */\n\ttitle: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 底部插槽 */\n\tfooter: { loading: boolean; close: () => void };\n}\n\nexport default defineComponent({\n\tname: \"FaDialog\",\n\tprops: faDialogProps,\n\temits: faDialogEmits,\n\tslots: makeSlots<FaDialogSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst dialogRef = shallowRef<DialogInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t\tvisible: false,\n\t\t\tfullscreen: false,\n\t\t\trefreshing: false,\n\t\t});\n\n\t\tlet cacheOpenFunction: (() => void | Promise<void>) | undefined;\n\n\t\tconst handleOpen = async (openFunction?: () => void | Promise<void>) => {\n\t\t\tstate.visible = true;\n\t\t\tcacheOpenFunction = openFunction;\n\t\t\tawait nextTick();\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(props.afterOpen ?? openFunction);\n\t\t\t\temit(\"open\");\n\t\t\t} catch (error) {\n\t\t\t\tstate.visible = false;\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleClose = async (closeFunction?: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(closeFunction);\n\t\t\t\temit(\"close\");\n\t\t\t\tstate.visible = false;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleRefresh = async () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.refreshing = true;\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\t\tsetTimeout(resolve, 500);\n\t\t\t\t});\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tawait handleOpen(cacheOpenFunction);\n\t\t\t\tElMessage.success(\"刷新成功\");\n\t\t\t} finally {\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeClose = (done: () => void) => {\n\t\t\tif (state.loading) return;\n\t\t\t// 解决 image 预览摁下 ese 会关闭弹窗的问题\n\t\t\tif (document.querySelector(\".el-image-viewer__wrapper\")) return;\n\n\t\t\tconst newDone = () => {\n\t\t\t\t// 组件对外约定为无参数完成钩子,不采用 Element Plus 的 done 回调签名。\n\t\t\t\treturn callOptionalFunction(props.beforeClose, done).then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tdone();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (props.showBeforeClose) {\n\t\t\t\t// 用户取消关闭属于正常分支,无需继续执行 beforeClose。\n\t\t\t\tElMessageBox.confirm(\"确定关闭?\", { type: \"warning\" }).then(() => newDone());\n\t\t\t} else {\n\t\t\t\tnewDone();\n\t\t\t}\n\t\t};\n\n\t\tconst handleFullscreen = () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.fullscreen = !state.fullscreen;\n\t\t};\n\n\t\tconst handleConfirmClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\temit(\"confirmClick\");\n\t\t};\n\n\t\tconst handleCloseClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\thandleClose();\n\t\t};\n\n\t\twatch(\n\t\t\t() => state.visible,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"update:modelValue\", newValue);\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elDialogProps = useProps(props, dialogProps, [\"modelValue\", \"fullscreen\", \"showClose\", \"beforeClose\"]);\n\t\t// open、close 是 Fast 异步业务流程完成事件,不直接透传 Element Plus 的同名生命周期事件。\n\t\tconst elDialogEmits = useEmits(dialogEmits, emit, [\"open\", \"close\", \"update:modelValue\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElDialog\n\t\t\t\t{...elDialogProps.value}\n\t\t\t\t{...elDialogEmits.value}\n\t\t\t\tref={dialogRef}\n\t\t\t\tclass={[\n\t\t\t\t\t\"fa-dialog\",\n\t\t\t\t\t`fa-dialog-${globalSize.value}`,\n\t\t\t\t\t{ \"fa-dialog__full-height\": props.fullHeight, \"fa-dialog__fullscreen\": state.fullscreen },\n\t\t\t\t]}\n\t\t\t\tvModel={state.visible}\n\t\t\t\tfullscreen={state.fullscreen}\n\t\t\t\tshowClose={false}\n\t\t\t\tbeforeClose={handleBeforeClose}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\theader: ({ titleId, titleClass }: { close: () => void; titleId: string; titleClass: string }) => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div id={titleId} class={[\"fa-dialog__header-title\", titleClass]}>\n\t\t\t\t\t\t\t\t{slots.title?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass }) ?? props.title}\n\t\t\t\t\t\t\t\t{slots.header?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass })}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{props.showRefresh && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"刷新\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleRefresh}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Refresh />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showFullscreen && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={state.fullscreen ? \"关闭全屏显示\" : \"全屏显示\"}\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleFullscreen}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>{state.fullscreen ? <FullScreenExit /> : <FullScreen />}</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showClose && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"关闭\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleCloseClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<ElScrollbar vLoading={state.loading} element-loading-text=\"加载中...\">\n\t\t\t\t\t\t\t{!state.refreshing && slots.default?.(state)}\n\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t),\n\t\t\t\t\t...(!props.hideFooter && {\n\t\t\t\t\t\tfooter: () => [\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{slots.footer?.({ loading: state.loading, close: handleCloseClick })}\n\t\t\t\t\t\t\t\t{props.showCloseButton && (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.loading} onClick={handleCloseClick}>\n\t\t\t\t\t\t\t\t\t\t{props.closeButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.showConfirmButton && (\n\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\tloadingIcon={Eleme}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabledConfirmButton}\n\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{state.loading ? \"加载中...\" : props.confirmButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElDialog>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 调用原生关闭流程,并执行 beforeClose。 */\n\t\t\thandleClose: computed(() => dialogRef.value?.handleClose),\n\t\t\t/** @description 弹窗内容引用 */\n\t\t\tdialogContentRef: computed<{ resetPosition: () => void; updatePosition: () => void } | undefined>(\n\t\t\t\t() => dialogRef.value?.dialogContentRef as { resetPosition: () => void; updatePosition: () => void } | undefined\n\t\t\t),\n\t\t\t/** @description 重置位置 */\n\t\t\tresetPosition: computed(() => dialogRef.value?.resetPosition),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 是否显示 */\n\t\t\tvisible: computed(() => state.visible),\n\t\t\t/** @description 打开弹窗 */\n\t\t\topen: handleOpen,\n\t\t\t/** @description 关闭弹窗 */\n\t\t\tclose: handleClose,\n\t\t\t/** @description 刷新弹窗 */\n\t\t\trefresh: handleRefresh,\n\t\t\t/** @description 弹窗加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});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AC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"dialog.mjs","names":["update:modelValue"],"sources":["../../../../src/components/dialog/src/dialog.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, nextTick, reactive, shallowRef, toRef, watch } from \"vue\";\nimport { Close, Eleme, Refresh } from \"@element-plus/icons-vue\";\nimport { ElButton, ElDialog, ElIcon, ElMessage, ElMessageBox, ElScrollbar, dialogEmits, dialogProps, useGlobalSize } from \"element-plus\";\nimport { FullScreen, FullScreenExit } from \"@fast-element-plus/icons-vue\";\nimport { callOptionalFunction, definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { DialogInstance } from \"element-plus\";\n\n/** FaDialog 的运行时 Props 定义。 */\nexport const faDialogProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...dialogProps,\n\t/** @description whether to align the dialog both horizontally and vertically*/\n\talignCenter: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */\n\tappendToBody: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description enable dragging feature for Dialog */\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description destroy elements in Dialog when closed */\n\tdestroyOnClose: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description draggable Dialog can overflow the viewport */\n\toverflow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description value for `margin-top` of Dialog CSS, default is 15vh */\n\ttop: {\n\t\ttype: String,\n\t\tdefault: \"5vh\",\n\t},\n\t/** @description width of Dialog, default is 50% */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"90%\",\n\t},\n\t/** @description 显示刷新按钮 */\n\tshowRefresh: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示全屏图标 */\n\tshowFullscreen: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示关闭按钮 */\n\tshowCloseButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示确认按钮 */\n\tshowConfirmButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 禁用确认按钮 */\n\tdisabledConfirmButton: Boolean,\n\t/** @description 关闭按钮文字,默认取消 */\n\tcloseButtonText: {\n\t\ttype: String,\n\t\tdefault: \"取消\",\n\t},\n\t/** @description 确认按钮文字,默认确认 */\n\tconfirmButtonText: {\n\t\ttype: String,\n\t\tdefault: \"确认\",\n\t},\n\t/** @description 隐藏底部操作 */\n\thideFooter: Boolean,\n\t/** @description 撑满高度 */\n\tfullHeight: Boolean,\n\t/** @description 显示关闭回调 */\n\tshowBeforeClose: Boolean,\n\t/** @description 打开之后 */\n\tafterOpen: {\n\t\ttype: definePropType<() => void | Promise<void>>(Function),\n\t},\n};\n\n/** FaDialog 的运行时 Emits 定义。 */\nexport const faDialogEmits = {\n\t...dialogEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: boolean) => typeof value === \"boolean\",\n\t/** @description 确认按钮点击事件 */\n\tconfirmClick: () => true,\n};\n\n/** FaDialog 的插槽参数。 */\nexport interface FaDialogSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { loading: boolean };\n\t/** @description 头部插槽 */\n\theader: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 标题插槽 */\n\ttitle: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 底部插槽 */\n\tfooter: { loading: boolean; close: () => void };\n}\n\nexport default defineComponent({\n\tname: \"FaDialog\",\n\tprops: faDialogProps,\n\temits: faDialogEmits,\n\tslots: makeSlots<FaDialogSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst dialogRef = shallowRef<DialogInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t\tvisible: false,\n\t\t\tfullscreen: false,\n\t\t\trefreshing: false,\n\t\t});\n\n\t\tlet cacheOpenFunction: (() => void | Promise<void>) | undefined;\n\n\t\tconst handleOpen = async (openFunction?: () => void | Promise<void>) => {\n\t\t\tstate.visible = true;\n\t\t\tcacheOpenFunction = openFunction;\n\t\t\tawait nextTick();\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(props.afterOpen ?? openFunction);\n\t\t\t\temit(\"open\");\n\t\t\t} catch (error) {\n\t\t\t\tstate.visible = false;\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleClose = async (closeFunction?: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(closeFunction);\n\t\t\t\temit(\"close\");\n\t\t\t\tstate.visible = false;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleRefresh = async () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.refreshing = true;\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\t\tsetTimeout(resolve, 500);\n\t\t\t\t});\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tawait handleOpen(cacheOpenFunction);\n\t\t\t\tElMessage.success(\"刷新成功\");\n\t\t\t} finally {\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeClose = (done: () => void) => {\n\t\t\tif (state.loading) return;\n\t\t\t// 解决 image 预览摁下 ese 会关闭弹窗的问题\n\t\t\tif (document.querySelector(\".el-image-viewer__wrapper\")) return;\n\n\t\t\tconst newDone = () => {\n\t\t\t\t// 组件对外约定为无参数完成钩子,不采用 Element Plus 的 done 回调签名。\n\t\t\t\treturn callOptionalFunction(props.beforeClose, done).then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tdone();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (props.showBeforeClose) {\n\t\t\t\t// 用户取消关闭属于正常分支,无需继续执行 beforeClose。\n\t\t\t\tElMessageBox.confirm(\"确定关闭?\", { type: \"warning\" }).then(() => newDone());\n\t\t\t} else {\n\t\t\t\tnewDone();\n\t\t\t}\n\t\t};\n\n\t\tconst handleFullscreen = () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.fullscreen = !state.fullscreen;\n\t\t};\n\n\t\tconst handleConfirmClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\temit(\"confirmClick\");\n\t\t};\n\n\t\tconst handleCloseClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\thandleClose();\n\t\t};\n\n\t\twatch(\n\t\t\t() => state.visible,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"update:modelValue\", newValue);\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elDialogProps = useProps(props, dialogProps, [\"modelValue\", \"fullscreen\", \"showClose\", \"beforeClose\"]);\n\t\t// open、close 是 Fast 异步业务流程完成事件,不直接透传 Element Plus 的同名生命周期事件。\n\t\tconst elDialogEmits = useEmits(dialogEmits, emit, [\"open\", \"close\", \"update:modelValue\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElDialog\n\t\t\t\t{...elDialogProps.value}\n\t\t\t\t{...elDialogEmits.value}\n\t\t\t\tref={dialogRef}\n\t\t\t\tclass={[\n\t\t\t\t\t\"fa-dialog\",\n\t\t\t\t\t`fa-dialog-${globalSize.value}`,\n\t\t\t\t\t{ \"fa-dialog__full-height\": props.fullHeight, \"fa-dialog__fullscreen\": state.fullscreen },\n\t\t\t\t]}\n\t\t\t\tvModel={state.visible}\n\t\t\t\tfullscreen={state.fullscreen}\n\t\t\t\tshowClose={false}\n\t\t\t\tbeforeClose={handleBeforeClose}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\theader: ({ titleId, titleClass }: { close: () => void; titleId: string; titleClass: string }) => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div id={titleId} class={[\"fa-dialog__header-title\", titleClass]}>\n\t\t\t\t\t\t\t\t{slots.title?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass }) ?? props.title}\n\t\t\t\t\t\t\t\t{slots.header?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass })}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{props.showRefresh && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"刷新\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleRefresh}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Refresh />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showFullscreen && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={state.fullscreen ? \"关闭全屏显示\" : \"全屏显示\"}\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleFullscreen}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>{state.fullscreen ? <FullScreenExit /> : <FullScreen />}</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showClose && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"关闭\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleCloseClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<ElScrollbar vLoading={state.loading} element-loading-text=\"加载中...\">\n\t\t\t\t\t\t\t{!state.refreshing && slots.default?.(state)}\n\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t),\n\t\t\t\t\t...(!props.hideFooter && {\n\t\t\t\t\t\tfooter: () => [\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{slots.footer?.({ loading: state.loading, close: handleCloseClick })}\n\t\t\t\t\t\t\t\t{props.showCloseButton && (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.loading} onClick={handleCloseClick}>\n\t\t\t\t\t\t\t\t\t\t{props.closeButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.showConfirmButton && (\n\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\tloadingIcon={Eleme}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabledConfirmButton}\n\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{state.loading ? \"加载中...\" : props.confirmButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElDialog>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 调用原生关闭流程,并执行 beforeClose。 */\n\t\t\thandleClose: computed(() => dialogRef.value?.handleClose),\n\t\t\t/** @description 弹窗内容引用 */\n\t\t\tdialogContentRef: computed<{ resetPosition: () => void; updatePosition: () => void } | undefined>(\n\t\t\t\t() => dialogRef.value?.dialogContentRef as { resetPosition: () => void; updatePosition: () => void } | undefined\n\t\t\t),\n\t\t\t/** @description 重置位置 */\n\t\t\tresetPosition: computed(() => dialogRef.value?.resetPosition),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** @description 是否显示 */\n\t\t\tvisible: toRef(state, \"visible\"),\n\t\t\t/** @description 打开弹窗 */\n\t\t\topen: handleOpen,\n\t\t\t/** @description 关闭弹窗 */\n\t\t\tclose: handleClose,\n\t\t\t/** @description 刷新弹窗 */\n\t\t\trefresh: handleRefresh,\n\t\t\t/** @description 弹窗加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],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,CAAC"}
|
|
@@ -274,9 +274,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
274
274
|
/** @description 用于关闭 Drawer, 该方法会调用传入的 before-close 方法 */
|
|
275
275
|
handleClose: import("vue").ComputedRef<(() => void) | undefined>;
|
|
276
276
|
/** @description 加载状态 */
|
|
277
|
-
loading: import("vue").
|
|
277
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
278
278
|
/** @description 是否显示 */
|
|
279
|
-
visible: import("vue").
|
|
279
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
280
280
|
/** @description 打开弹窗 */
|
|
281
281
|
open: (openFunction?: () => void | Promise<void>) => Promise<void>;
|
|
282
282
|
/** @description 关闭弹窗 */
|