vft 0.0.185 → 0.0.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/app-components/super-form/types.d.ts +9 -0
- package/es/components/col/col.vue.d.ts +1 -11
- package/es/components/col/col.vue2.js +19 -20
- package/es/components/col/index.d.ts +0 -2
- package/es/components/col/types.d.ts +10 -0
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +2 -2
- package/es/components/exception/exception.vue2.js +1 -1
- package/es/components/link/index.d.ts +1 -0
- package/es/components/link/link.vue.d.ts +3 -13
- package/es/components/link/link.vue2.js +18 -21
- package/es/components/link/types.d.ts +11 -0
- package/es/components/link/types.js +1 -0
- package/es/components/modal/index.d.ts +24 -0
- package/es/components/modal/modal.vue.d.ts +2 -0
- package/es/components/modal/modal.vue2.js +24 -22
- package/es/components/modal/use/use-modal.d.ts +2 -1
- package/es/components/modal/use/use-modal.js +43 -40
- package/es/components/pagination/components/total.vue2.js +1 -1
- package/es/components/select/select.vue.js +2 -2
- package/es/components/super-form/super-form-item.vue2.js +24 -20
- package/es/components/super-form/types.d.ts +4 -1
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +2 -2
- package/es/components/upload/upload-list.vue2.js +1 -1
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/app-components/super-form/types.d.ts +9 -0
- package/lib/components/col/col.vue.d.ts +1 -11
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/col/index.d.ts +0 -2
- package/lib/components/col/types.d.ts +10 -0
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/exception/exception.vue2.cjs +1 -1
- package/lib/components/link/index.d.ts +1 -0
- package/lib/components/link/link.vue.d.ts +3 -13
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/link/types.cjs +1 -0
- package/lib/components/link/types.d.ts +11 -0
- package/lib/components/modal/index.d.ts +24 -0
- package/lib/components/modal/modal.vue.d.ts +2 -0
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/modal/use/use-modal.cjs +1 -1
- package/lib/components/modal/use/use-modal.d.ts +2 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/select/select.vue.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +4 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/web-types.json +1 -1
|
@@ -102,6 +102,15 @@ export interface SuperFormProps extends FormInnerProps {
|
|
|
102
102
|
/** 自定义 reset 事件 */
|
|
103
103
|
resetFunc?: () => Promise<void>;
|
|
104
104
|
}
|
|
105
|
+
export interface SuperFormItemProps {
|
|
106
|
+
schema: FormSchema;
|
|
107
|
+
formProps: SuperFormProps;
|
|
108
|
+
allDefaultValues?: Record<string, any>;
|
|
109
|
+
formModel: Record<string, any>;
|
|
110
|
+
setFormModel: (key: string, value: any, schema: FormSchema) => void;
|
|
111
|
+
updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
|
112
|
+
formActionType?: Partial<FormActionType>;
|
|
113
|
+
}
|
|
105
114
|
export interface FormSchema {
|
|
106
115
|
/** 字段 key */
|
|
107
116
|
field: string;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface ColProps extends ColSizeObject {
|
|
3
|
-
/** 自定义元素标签 */
|
|
4
|
-
tag?: string;
|
|
5
|
-
/** 以下为响应式栅格数或者栅格属性对象 pc 使用 */
|
|
6
|
-
xs?: ColSize;
|
|
7
|
-
sm?: ColSize;
|
|
8
|
-
md?: ColSize;
|
|
9
|
-
lg?: ColSize;
|
|
10
|
-
xl?: ColSize;
|
|
11
|
-
}
|
|
1
|
+
import type { ColProps } from './types';
|
|
12
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ColProps>, {
|
|
13
3
|
tag: string;
|
|
14
4
|
span: number;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { defineComponent as c, inject as
|
|
2
|
-
import { isNumber as u, isObject as _ } from "@vft/utils";
|
|
1
|
+
import { defineComponent as c, inject as h, computed as n, openBlock as $, createBlock as g, resolveDynamicComponent as b, normalizeClass as v, normalizeStyle as x, withCtx as y, renderSlot as _ } from "vue";
|
|
3
2
|
import "../row/index.js";
|
|
4
3
|
import "@vueuse/core";
|
|
4
|
+
import { isNumber as u, isObject as C } from "@vft/utils";
|
|
5
5
|
import "../../utils/ns-cover.js";
|
|
6
6
|
import "lodash";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as j } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "@popperjs/core";
|
|
9
9
|
import "../../hooks/use-z-index/index.js";
|
|
10
|
-
import { rowContextKey as
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
name: e.b()
|
|
16
|
-
}), A = /* @__PURE__ */ c({
|
|
17
|
-
...E,
|
|
10
|
+
import { rowContextKey as E } from "../row/constants.js";
|
|
11
|
+
const k = c({
|
|
12
|
+
name: "vft-col"
|
|
13
|
+
}), F = /* @__PURE__ */ c({
|
|
14
|
+
...k,
|
|
18
15
|
props: {
|
|
19
16
|
tag: { default: "div" },
|
|
20
17
|
xs: {},
|
|
@@ -27,8 +24,10 @@ const e = (
|
|
|
27
24
|
pull: { default: 0 },
|
|
28
25
|
push: { default: 0 }
|
|
29
26
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
27
|
+
setup(p) {
|
|
28
|
+
const e = j("col"), o = p, f = useAttrs();
|
|
29
|
+
console.log(f, "propspropsprops");
|
|
30
|
+
const { gutter: a } = h(E, { gutter: n(() => 0) }), i = n(() => {
|
|
32
31
|
const t = {};
|
|
33
32
|
return a.value && (t.paddingLeft = t.paddingRight = `${a.value / 2}px`), t;
|
|
34
33
|
}), m = n(() => {
|
|
@@ -37,7 +36,7 @@ const e = (
|
|
|
37
36
|
const l = o[s];
|
|
38
37
|
u(l) && (s === "span" ? t.push(e.b(`${o[s]}`)) : l > 0 && t.push(e.b(`${s}-${o[s]}`)));
|
|
39
38
|
}), ["xs", "sm", "md", "lg", "xl"].forEach((s) => {
|
|
40
|
-
u(o[s]) ? t.push(e.b(`${s}-${o[s]}`)) :
|
|
39
|
+
u(o[s]) ? t.push(e.b(`${s}-${o[s]}`)) : C(o[s]) && Object.entries(o[s]).forEach(
|
|
41
40
|
([l, r]) => {
|
|
42
41
|
t.push(
|
|
43
42
|
l !== "span" ? e.b(`${s}-${l}-${r}`) : e.b(`${s}-${r}`)
|
|
@@ -46,17 +45,17 @@ const e = (
|
|
|
46
45
|
);
|
|
47
46
|
}), a.value && t.push(e.is("guttered")), [e.b(), t];
|
|
48
47
|
});
|
|
49
|
-
return (t,
|
|
50
|
-
class:
|
|
51
|
-
style:
|
|
48
|
+
return (t, d) => ($(), g(b(t.tag), {
|
|
49
|
+
class: v(m.value),
|
|
50
|
+
style: x(i.value)
|
|
52
51
|
}, {
|
|
53
|
-
default:
|
|
54
|
-
|
|
52
|
+
default: y(() => [
|
|
53
|
+
_(t.$slots, "default")
|
|
55
54
|
]),
|
|
56
55
|
_: 3
|
|
57
56
|
}, 8, ["class", "style"]));
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
export {
|
|
61
|
-
|
|
60
|
+
F as default
|
|
62
61
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ColProps } from './col.vue';
|
|
2
1
|
export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
3
2
|
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<globalThis.ExtractPropTypes<{
|
|
4
3
|
push: {
|
|
@@ -179,5 +178,4 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
179
178
|
};
|
|
180
179
|
})> & Record<string, any>;
|
|
181
180
|
export * from './types';
|
|
182
|
-
export { type ColProps };
|
|
183
181
|
export default VftCol;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
export interface ColProps extends ColSizeObject {
|
|
2
|
+
/** 自定义元素标签 */
|
|
3
|
+
tag?: string;
|
|
4
|
+
/** 以下为响应式栅格数或者栅格属性对象 pc 使用 */
|
|
5
|
+
xs?: ColSize;
|
|
6
|
+
sm?: ColSize;
|
|
7
|
+
md?: ColSize;
|
|
8
|
+
lg?: ColSize;
|
|
9
|
+
xl?: ColSize;
|
|
10
|
+
}
|
|
1
11
|
export type ColSizeObject = {
|
|
2
12
|
/** 栅格占据的列数 */
|
|
3
13
|
span?: number;
|
|
@@ -376,7 +376,7 @@ const la = ["onClick"], ta = ["disabled"], na = ["disabled"], oa = ["disabled"],
|
|
|
376
376
|
onClick: se
|
|
377
377
|
}, {
|
|
378
378
|
default: ve(() => [
|
|
379
|
-
ce("清除")
|
|
379
|
+
ce(" 清除 ")
|
|
380
380
|
]),
|
|
381
381
|
_: 1
|
|
382
382
|
}, 8, ["class"])) : C("", !0),
|
|
@@ -388,7 +388,7 @@ const la = ["onClick"], ta = ["disabled"], na = ["disabled"], oa = ["disabled"],
|
|
|
388
388
|
onClick: a[10] || (a[10] = (t) => e(W)(!1))
|
|
389
389
|
}, {
|
|
390
390
|
default: ve(() => [
|
|
391
|
-
ce("确认")
|
|
391
|
+
ce(" 确认 ")
|
|
392
392
|
]),
|
|
393
393
|
_: 1
|
|
394
394
|
}, 8, ["class", "disabled"])
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { type RouteLocationRaw } from 'vue-router';
|
|
4
|
-
interface Props {
|
|
5
|
-
type?: 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'default';
|
|
6
|
-
underline?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
route?: WinOpenType | RouteLocationRaw;
|
|
9
|
-
isReplace?: boolean;
|
|
10
|
-
icon?: IconProps;
|
|
11
|
-
}
|
|
12
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1
|
+
import type { LinkProps } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<LinkProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
3
|
click: (...args: any[]) => void;
|
|
14
|
-
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<LinkProps>>> & {
|
|
15
5
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
16
6
|
}, {}, {}>, {
|
|
17
7
|
default?(_: {}): any;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { defineComponent as u, getCurrentInstance as b, computed as y, openBlock as r, createElementBlock as a, normalizeClass as s, unref as t, createBlock as C, normalizeProps as g, mergeProps as B, createCommentVNode as c, renderSlot as
|
|
2
|
-
import {
|
|
3
|
-
import { singleAttrToObj as $ } from "@vft/utils";
|
|
4
|
-
import { VftIcon as h } from "../icon/index.js";
|
|
1
|
+
import { defineComponent as u, getCurrentInstance as b, computed as y, openBlock as r, createElementBlock as a, normalizeClass as s, unref as t, createBlock as C, normalizeProps as g, mergeProps as B, createCommentVNode as c, renderSlot as v } from "vue";
|
|
2
|
+
import { VftIcon as P } from "../icon/index.js";
|
|
5
3
|
import "@vueuse/core";
|
|
4
|
+
import { singleAttrToObj as R } from "@vft/utils";
|
|
6
5
|
import "../../utils/ns-cover.js";
|
|
7
6
|
import "lodash";
|
|
8
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as $ } from "../../hooks/use-namespace/index.js";
|
|
9
8
|
import "@popperjs/core";
|
|
10
9
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
), z = u({
|
|
15
|
-
name: o.b()
|
|
10
|
+
import { useRouterHelper as h } from "@vft/router";
|
|
11
|
+
const z = u({
|
|
12
|
+
name: "vft-link"
|
|
16
13
|
}), D = /* @__PURE__ */ u({
|
|
17
14
|
...z,
|
|
18
15
|
props: {
|
|
@@ -24,29 +21,29 @@ const o = (
|
|
|
24
21
|
icon: {}
|
|
25
22
|
},
|
|
26
23
|
emits: ["click"],
|
|
27
|
-
setup(
|
|
28
|
-
const d = m, p = b().appContext.config.globalProperties.$router, { go: f } =
|
|
24
|
+
setup(o, { emit: m }) {
|
|
25
|
+
const n = $("link"), d = m, p = b().appContext.config.globalProperties.$router, { go: f } = h(p);
|
|
29
26
|
function k(e) {
|
|
30
|
-
|
|
27
|
+
o.route && f(o.route, o.isReplace), o.disabled || d("click", e);
|
|
31
28
|
}
|
|
32
|
-
const i = y(() =>
|
|
29
|
+
const i = y(() => R(o.icon, "icon"));
|
|
33
30
|
return (e, N) => {
|
|
34
31
|
var l;
|
|
35
32
|
return r(), a("span", {
|
|
36
33
|
class: s([
|
|
37
|
-
t(
|
|
38
|
-
t(
|
|
39
|
-
t(
|
|
40
|
-
t(
|
|
34
|
+
t(n).b(),
|
|
35
|
+
t(n).m(e.type),
|
|
36
|
+
t(n).is("disabled", e.disabled),
|
|
37
|
+
t(n).is("underline", e.underline && !e.disabled)
|
|
41
38
|
]),
|
|
42
39
|
onClick: k
|
|
43
40
|
}, [
|
|
44
|
-
(l = i.value) != null && l.icon ? (r(), C(t(
|
|
41
|
+
(l = i.value) != null && l.icon ? (r(), C(t(P), g(B({ key: 0 }, i.value)), null, 16)) : c("", !0),
|
|
45
42
|
e.$slots.default ? (r(), a("span", {
|
|
46
43
|
key: 1,
|
|
47
|
-
class: s(t(
|
|
44
|
+
class: s(t(n).e("inner"))
|
|
48
45
|
}, [
|
|
49
|
-
|
|
46
|
+
v(e.$slots, "default")
|
|
50
47
|
], 2)) : c("", !0)
|
|
51
48
|
], 2);
|
|
52
49
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WinOpenType } from '@vft/router';
|
|
2
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
3
|
+
import type { IconProps } from '../icon';
|
|
4
|
+
export interface LinkProps {
|
|
5
|
+
type?: 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'default';
|
|
6
|
+
underline?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
route?: WinOpenType | RouteLocationRaw;
|
|
9
|
+
isReplace?: boolean;
|
|
10
|
+
icon?: IconProps;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -30,6 +30,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
30
30
|
type: globalThis.PropType<boolean>;
|
|
31
31
|
default: boolean;
|
|
32
32
|
};
|
|
33
|
+
loading: {
|
|
34
|
+
type: globalThis.PropType<boolean>;
|
|
35
|
+
};
|
|
33
36
|
trapFocus: {
|
|
34
37
|
type: globalThis.PropType<boolean>;
|
|
35
38
|
default: boolean;
|
|
@@ -111,6 +114,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
111
114
|
closeFunc: {
|
|
112
115
|
type: globalThis.PropType<() => Promise<any>>;
|
|
113
116
|
};
|
|
117
|
+
confirmLoading: {
|
|
118
|
+
type: globalThis.PropType<boolean>;
|
|
119
|
+
};
|
|
114
120
|
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
115
121
|
[x: string]: (...args: any[]) => void;
|
|
116
122
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<globalThis.ExtractPropTypes<{
|
|
@@ -143,6 +149,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
143
149
|
type: globalThis.PropType<boolean>;
|
|
144
150
|
default: boolean;
|
|
145
151
|
};
|
|
152
|
+
loading: {
|
|
153
|
+
type: globalThis.PropType<boolean>;
|
|
154
|
+
};
|
|
146
155
|
trapFocus: {
|
|
147
156
|
type: globalThis.PropType<boolean>;
|
|
148
157
|
default: boolean;
|
|
@@ -224,6 +233,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
224
233
|
closeFunc: {
|
|
225
234
|
type: globalThis.PropType<() => Promise<any>>;
|
|
226
235
|
};
|
|
236
|
+
confirmLoading: {
|
|
237
|
+
type: globalThis.PropType<boolean>;
|
|
238
|
+
};
|
|
227
239
|
}>>, {
|
|
228
240
|
title: string;
|
|
229
241
|
center: boolean;
|
|
@@ -282,6 +294,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
282
294
|
type: globalThis.PropType<boolean>;
|
|
283
295
|
default: boolean;
|
|
284
296
|
};
|
|
297
|
+
loading: {
|
|
298
|
+
type: globalThis.PropType<boolean>;
|
|
299
|
+
};
|
|
285
300
|
trapFocus: {
|
|
286
301
|
type: globalThis.PropType<boolean>;
|
|
287
302
|
default: boolean;
|
|
@@ -363,6 +378,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
363
378
|
closeFunc: {
|
|
364
379
|
type: globalThis.PropType<() => Promise<any>>;
|
|
365
380
|
};
|
|
381
|
+
confirmLoading: {
|
|
382
|
+
type: globalThis.PropType<boolean>;
|
|
383
|
+
};
|
|
366
384
|
}>>, {}, {}, {}, {}, {
|
|
367
385
|
title: string;
|
|
368
386
|
center: boolean;
|
|
@@ -418,6 +436,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
418
436
|
type: globalThis.PropType<boolean>;
|
|
419
437
|
default: boolean;
|
|
420
438
|
};
|
|
439
|
+
loading: {
|
|
440
|
+
type: globalThis.PropType<boolean>;
|
|
441
|
+
};
|
|
421
442
|
trapFocus: {
|
|
422
443
|
type: globalThis.PropType<boolean>;
|
|
423
444
|
default: boolean;
|
|
@@ -499,6 +520,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
499
520
|
closeFunc: {
|
|
500
521
|
type: globalThis.PropType<() => Promise<any>>;
|
|
501
522
|
};
|
|
523
|
+
confirmLoading: {
|
|
524
|
+
type: globalThis.PropType<boolean>;
|
|
525
|
+
};
|
|
502
526
|
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
503
527
|
[x: string]: (...args: any[]) => void;
|
|
504
528
|
}, string, {
|
|
@@ -3,6 +3,8 @@ import type { ModalActionProps } from './types';
|
|
|
3
3
|
export interface ModalProps extends DialogProps {
|
|
4
4
|
closeFunc?: () => Promise<any>;
|
|
5
5
|
showActionButtonGroup?: boolean;
|
|
6
|
+
confirmLoading?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps & ModalActionProps>, {
|
|
8
10
|
center: boolean;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent as O, useAttrs as M, ref as c, getCurrentInstance as F, computed as u, unref as
|
|
1
|
+
import { defineComponent as O, useAttrs as M, ref as c, getCurrentInstance as F, computed as u, unref as o, watchEffect as P, watch as R, nextTick as r, openBlock as m, createBlock as B, mergeProps as S, createSlots as _, withCtx as b, renderSlot as A, createCommentVNode as T } from "vue";
|
|
2
2
|
import { isFunction as D, deepMerge as G } from "@vft/utils";
|
|
3
3
|
import { VftDialog as I } from "../dialog/index.js";
|
|
4
4
|
import $ from "./modal-footer-action.vue2.js";
|
|
5
|
-
const
|
|
5
|
+
const N = /* @__PURE__ */ O({
|
|
6
6
|
__name: "modal",
|
|
7
7
|
props: {
|
|
8
8
|
closeFunc: {},
|
|
9
9
|
showActionButtonGroup: { type: Boolean, default: !1 },
|
|
10
|
+
confirmLoading: { type: Boolean },
|
|
11
|
+
loading: { type: Boolean },
|
|
10
12
|
appendToBody: { type: Boolean, default: !1 },
|
|
11
13
|
beforeClose: {},
|
|
12
14
|
destroyOnClose: { type: Boolean, default: !1 },
|
|
@@ -44,34 +46,34 @@ const W = /* @__PURE__ */ O({
|
|
|
44
46
|
"update:modelValue": [],
|
|
45
47
|
submit: []
|
|
46
48
|
},
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
+
setup(y, { emit: h }) {
|
|
50
|
+
const t = y, n = h, g = M(), i = c(null), l = c(!1), a = c(null), f = {
|
|
49
51
|
setModalProps: V,
|
|
50
52
|
emitVisible: void 0,
|
|
51
53
|
redoModalHeight: () => {
|
|
52
54
|
r(() => {
|
|
53
|
-
|
|
55
|
+
o(a) && o(a).setModalHeight();
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
}, s = F();
|
|
57
59
|
s && n("register", f, s.uid);
|
|
58
|
-
const
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
})),
|
|
62
|
-
...
|
|
63
|
-
...
|
|
64
|
-
modelValue:
|
|
60
|
+
const w = u(() => ({
|
|
61
|
+
...t,
|
|
62
|
+
...o(i)
|
|
63
|
+
})), C = u(() => ({
|
|
64
|
+
...g,
|
|
65
|
+
...o(w),
|
|
66
|
+
modelValue: o(l)
|
|
65
67
|
}));
|
|
66
68
|
P(() => {
|
|
67
|
-
l.value = !!
|
|
69
|
+
l.value = !!t.modelValue;
|
|
68
70
|
}), R(
|
|
69
|
-
() =>
|
|
71
|
+
() => o(l),
|
|
70
72
|
(e) => {
|
|
71
73
|
n("visible-change", e), n("update:modelValue", e), s && r(() => {
|
|
72
74
|
f.emitVisible(e, s.uid);
|
|
73
75
|
}), r(() => {
|
|
74
|
-
|
|
76
|
+
t.scrollTop && e && o(a) && o(a).scrollTop();
|
|
75
77
|
});
|
|
76
78
|
},
|
|
77
79
|
{
|
|
@@ -79,24 +81,24 @@ const W = /* @__PURE__ */ O({
|
|
|
79
81
|
}
|
|
80
82
|
);
|
|
81
83
|
async function d(e) {
|
|
82
|
-
if (e == null || e.stopPropagation(),
|
|
83
|
-
const p = await
|
|
84
|
+
if (e == null || e.stopPropagation(), t.closeFunc && D(t.closeFunc)) {
|
|
85
|
+
const p = await t.closeFunc();
|
|
84
86
|
l.value = !p;
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
89
|
l.value = !1, n("close", e);
|
|
88
90
|
}
|
|
89
91
|
function V(e) {
|
|
90
|
-
i.value = G(
|
|
92
|
+
i.value = G(o(i) || {}, e), Reflect.has(e, "modelValue") && (l.value = !!e.modelValue);
|
|
91
93
|
}
|
|
92
94
|
const k = u(() => ({
|
|
93
95
|
onClick: (e) => d(e),
|
|
94
|
-
...
|
|
96
|
+
...t.cancelButtonOptions
|
|
95
97
|
})), v = u(() => ({
|
|
96
98
|
onClick: () => n("submit"),
|
|
97
|
-
...
|
|
99
|
+
...t.submitButtonOptions
|
|
98
100
|
}));
|
|
99
|
-
return (e, p) => (m(), B(
|
|
101
|
+
return (e, p) => (m(), B(o(I), S(C.value, { onClose: d }), _({
|
|
100
102
|
default: b(() => [
|
|
101
103
|
A(e.$slots, "default")
|
|
102
104
|
]),
|
|
@@ -119,5 +121,5 @@ const W = /* @__PURE__ */ O({
|
|
|
119
121
|
}
|
|
120
122
|
});
|
|
121
123
|
export {
|
|
122
|
-
|
|
124
|
+
N as default
|
|
123
125
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { Fn } from '../../types';
|
|
1
2
|
import type { UseModalInnerReturnType, UseModalReturnType } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* @description: Applicable to independent modal and call outside
|
|
4
5
|
*/
|
|
5
6
|
export declare function useModal(): UseModalReturnType;
|
|
6
|
-
export declare const useModalInner: (callbackFn?:
|
|
7
|
+
export declare const useModalInner: (callbackFn?: Fn) => UseModalInnerReturnType;
|
|
@@ -1,91 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const i = v({}), p = v({});
|
|
1
|
+
import { isFunction as w } from "@vft/utils";
|
|
2
|
+
import { isEqual as H } from "lodash";
|
|
3
|
+
import { reactive as m, ref as d, computed as v, unref as t, toRaw as c, getCurrentInstance as P, watchEffect as I, nextTick as R, onBeforeUnmount as h, onDeactivated as V } from "vue";
|
|
4
|
+
const a = m({}), g = m({});
|
|
6
5
|
function x() {
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
if (!
|
|
6
|
+
const s = d(null), r = d(!1), l = d("");
|
|
7
|
+
function i(e, o) {
|
|
8
|
+
if (!P())
|
|
10
9
|
throw new Error(
|
|
11
10
|
"useModal() can only be used inside setup() or functional components!"
|
|
12
11
|
);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}),
|
|
16
|
-
|
|
12
|
+
l.value = o, h(() => {
|
|
13
|
+
s.value = null, r.value = !1, a[t(l)] = null;
|
|
14
|
+
}), V(() => {
|
|
15
|
+
s.value = null, r.value = !1, a[t(l)] = null;
|
|
16
|
+
}), !(t(r) && e === t(s)) && (s.value = e, r.value = !0, e.emitVisible = (M, u) => {
|
|
17
|
+
g[u] = M;
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
-
const e =
|
|
20
|
+
const n = () => {
|
|
21
|
+
const e = t(s);
|
|
21
22
|
return e || console.error("useModal instance is undefined!"), e;
|
|
22
23
|
}, f = {
|
|
23
24
|
setModalProps: (e) => {
|
|
24
25
|
var o;
|
|
25
|
-
(o =
|
|
26
|
+
(o = n()) == null || o.setModalProps(e);
|
|
26
27
|
},
|
|
27
|
-
getVisible:
|
|
28
|
+
getVisible: v(() => g[~~t(l)]),
|
|
28
29
|
redoModalHeight: () => {
|
|
29
30
|
var e, o;
|
|
30
|
-
(o = (e =
|
|
31
|
+
(o = (e = n()) == null ? void 0 : e.redoModalHeight) == null || o.call(e);
|
|
31
32
|
},
|
|
32
33
|
openModal: (e = !0, o, M = !0) => {
|
|
33
|
-
var
|
|
34
|
-
if ((
|
|
34
|
+
var p;
|
|
35
|
+
if ((p = n()) == null || p.setModalProps({
|
|
35
36
|
modelValue: e
|
|
36
37
|
}), !o)
|
|
37
38
|
return;
|
|
38
|
-
const
|
|
39
|
+
const u = t(l);
|
|
39
40
|
if (M) {
|
|
40
|
-
|
|
41
|
+
a[u] = null, a[u] = c(o);
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
H(c(a[u]), c(o)) || (a[u] = c(o));
|
|
44
45
|
},
|
|
45
46
|
closeModal: () => {
|
|
46
47
|
var e;
|
|
47
|
-
(e =
|
|
48
|
+
(e = n()) == null || e.setModalProps({ modelValue: !1 });
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
return [
|
|
51
|
+
return [i, f];
|
|
51
52
|
}
|
|
52
|
-
const D = (
|
|
53
|
-
const
|
|
54
|
-
const e =
|
|
53
|
+
const D = (s) => {
|
|
54
|
+
const r = d(null), l = P(), i = d(""), n = () => {
|
|
55
|
+
const e = t(r);
|
|
55
56
|
return e || console.error("useModalInner instance is undefined!"), e;
|
|
56
57
|
}, f = (e, o) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
58
|
+
h(() => {
|
|
59
|
+
r.value = null;
|
|
60
|
+
}), V(() => {
|
|
61
|
+
r.value = null;
|
|
62
|
+
}), i.value = o, r.value = e, l == null || l.emit("register", e, o);
|
|
60
63
|
};
|
|
61
|
-
return
|
|
62
|
-
const e =
|
|
63
|
-
e && (!
|
|
64
|
-
|
|
64
|
+
return I(() => {
|
|
65
|
+
const e = a[t(i)];
|
|
66
|
+
e && (!s || !w(s) || R(() => {
|
|
67
|
+
s(e);
|
|
65
68
|
}));
|
|
66
69
|
}), [
|
|
67
70
|
f,
|
|
68
71
|
{
|
|
69
72
|
changeLoading: (e = !0) => {
|
|
70
73
|
var o;
|
|
71
|
-
(o =
|
|
74
|
+
(o = n()) == null || o.setModalProps({ loading: e });
|
|
72
75
|
},
|
|
73
|
-
getVisible:
|
|
76
|
+
getVisible: v(() => g[~~t(i)]),
|
|
74
77
|
changeOkLoading: (e = !0) => {
|
|
75
78
|
var o;
|
|
76
|
-
(o =
|
|
79
|
+
(o = n()) == null || o.setModalProps({ confirmLoading: e });
|
|
77
80
|
},
|
|
78
81
|
closeModal: () => {
|
|
79
82
|
var e;
|
|
80
|
-
(e =
|
|
83
|
+
(e = n()) == null || e.setModalProps({ modelValue: !1 });
|
|
81
84
|
},
|
|
82
85
|
setModalProps: (e) => {
|
|
83
86
|
var o;
|
|
84
|
-
(o =
|
|
87
|
+
(o = n()) == null || o.setModalProps(e);
|
|
85
88
|
},
|
|
86
89
|
redoModalHeight: () => {
|
|
87
90
|
var o;
|
|
88
|
-
const e = (o =
|
|
91
|
+
const e = (o = n()) == null ? void 0 : o.redoModalHeight;
|
|
89
92
|
e && e();
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -95,7 +95,7 @@ function L(e, o, O, H, P, A) {
|
|
|
95
95
|
style: m({
|
|
96
96
|
maxWidth: `${e.tagMaxWidth}px`
|
|
97
97
|
})
|
|
98
|
-
}, "+ " + d(e.modelValue.length - e.maxCollapseTags), 7)
|
|
98
|
+
}, " + " + d(e.modelValue.length - e.maxCollapseTags), 7)
|
|
99
99
|
]),
|
|
100
100
|
content: p(() => [
|
|
101
101
|
t("div", {
|
|
@@ -133,7 +133,7 @@ function L(e, o, O, H, P, A) {
|
|
|
133
133
|
style: m({
|
|
134
134
|
maxWidth: `${e.tagMaxWidth}px`
|
|
135
135
|
})
|
|
136
|
-
}, "+ " + d(e.modelValue.length - e.maxCollapseTags), 7))
|
|
136
|
+
}, " + " + d(e.modelValue.length - e.maxCollapseTags), 7))
|
|
137
137
|
]),
|
|
138
138
|
_: 1
|
|
139
139
|
}, 8, ["size"])) : u("", !0)
|