@done-coding/admin-core 0.1.1-alpha.6 → 0.1.1-alpha.8
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/components/form/FormItem.vue.mjs +2 -2
- package/es/components/form/FormItem.vue2.mjs +10 -7
- package/es/components/form/FormMain.vue.mjs +32 -32
- package/es/components/form/FormRadioGroup.vue.mjs +57 -20
- package/es/components/form/index.mjs +22 -28
- package/es/components/form/utils.mjs +83 -76
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +88 -90
- package/es/components/modal/DetailModal.vue.mjs +33 -32
- package/es/index.mjs +93 -96
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/form/FormRadioGroup.vue.d.ts +31 -19
- package/types/components/form/index.d.ts +1 -3
- package/types/components/form/types.d.ts +13 -4
- package/types/components/form/utils.d.ts +15 -3
- package/types/components/list-page/ListPage.vue.d.ts +0 -2
- package/types/components/list-page/types.d.ts +0 -4
- package/types/components/modal/types.d.ts +2 -0
- package/es/components/form/FormDatePicker.vue.mjs +0 -7
- package/es/components/form/FormDatePicker.vue2.mjs +0 -50
- package/es/components/form/FormRadio.vue.mjs +0 -69
- package/es/components/form/FormRadio.vue2.mjs +0 -4
- package/types/components/form/FormDatePicker.vue.d.ts +0 -18
- package/types/components/form/FormRadio.vue.d.ts +0 -35
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import { OptionItem } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
|
+
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
5
|
+
notNull: {
|
|
6
|
+
type: globalThis.PropType<boolean>;
|
|
7
|
+
default: boolean;
|
|
8
|
+
};
|
|
9
|
+
mode: {
|
|
10
|
+
type: globalThis.PropType<"radio" | "buttonGroup">;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
2
13
|
options: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
type: globalThis.PropType<OptionItem[]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
18
|
+
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
19
|
+
notNull: {
|
|
20
|
+
type: globalThis.PropType<boolean>;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
mode: {
|
|
24
|
+
type: globalThis.PropType<"radio" | "buttonGroup">;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
8
27
|
options: {
|
|
9
|
-
|
|
10
|
-
value: string | number;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}[];
|
|
13
|
-
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
-
export default _default;
|
|
15
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
-
} : {
|
|
20
|
-
type: import('vue').PropType<T[K]>;
|
|
28
|
+
type: globalThis.PropType<OptionItem[]>;
|
|
21
29
|
required: true;
|
|
22
30
|
};
|
|
23
|
-
}
|
|
31
|
+
}>> & Readonly<{}>, {
|
|
32
|
+
notNull: boolean;
|
|
33
|
+
mode: "radio" | "buttonGroup";
|
|
34
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
35
|
+
export default _default;
|
|
@@ -2,14 +2,12 @@ import { Plugin } from 'vue';
|
|
|
2
2
|
import { default as FormMain } from './FormMain.vue';
|
|
3
3
|
import { default as FormSelect } from './FormSelect.vue';
|
|
4
4
|
import { default as FormRadioGroup } from './FormRadioGroup.vue';
|
|
5
|
-
import { default as FormRadio } from './FormRadio.vue';
|
|
6
5
|
import { default as FormTree } from './FormTree.vue';
|
|
7
6
|
import { default as FormSearch } from './FormSearch.vue';
|
|
8
7
|
import { default as FormVerifyImage } from './FormVerifyImage.vue';
|
|
9
8
|
import { default as FormVerifyCode } from './FormVerifyCode.vue';
|
|
10
|
-
import { default as FormDatePicker } from './FormDatePicker.vue';
|
|
11
9
|
|
|
12
10
|
export * from './types';
|
|
13
11
|
export * from './utils';
|
|
14
|
-
export { FormMain, FormSelect, FormSearch, FormRadioGroup,
|
|
12
|
+
export { FormMain, FormSelect, FormSearch, FormRadioGroup, FormTree, FormVerifyImage, FormVerifyCode, };
|
|
15
13
|
export declare const formInstall: Plugin;
|
|
@@ -50,6 +50,11 @@ SV extends PK extends keyof SO ? SO[PK] : PV = PK extends keyof SO ? SO[PK] : PV
|
|
|
50
50
|
key: PK;
|
|
51
51
|
/** 表单项label */
|
|
52
52
|
label: string;
|
|
53
|
+
/**
|
|
54
|
+
* 隐藏 label 且不占位(label-wrap 整体 display:none,表单元素顶满整行)。
|
|
55
|
+
* 仅当 label 有值时生效——无 label 时 element-plus 会给 content 加 margin-left 留白,需改用 labelWidth:0。
|
|
56
|
+
*/
|
|
57
|
+
labelHide?: boolean;
|
|
53
58
|
/** 提示信息 */
|
|
54
59
|
tip?: string | (() => VNode);
|
|
55
60
|
/** 表单布局 优先级高于FormMain同名属性 */
|
|
@@ -188,10 +193,14 @@ export interface FormTreeItem {
|
|
|
188
193
|
export type FormItemSubmitType = "blur" | "change" | "enter";
|
|
189
194
|
/** 表单搜索搜索类型 */
|
|
190
195
|
export type FormSearchSearchType = "search" | "reset" | FormItemSubmitType;
|
|
191
|
-
/**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
/**
|
|
197
|
+
* ElDatePicker 原生 `shortcuts` 项(时间段快捷)。
|
|
198
|
+
* 直接传给 `<ElDatePicker :shortcuts="...">`,由 ElDatePicker 自身的
|
|
199
|
+
* pick 管线按其 value-format 归一化输出,无需额外格式化依赖。
|
|
200
|
+
*/
|
|
201
|
+
export interface DatePickerShortcut {
|
|
202
|
+
text: string;
|
|
203
|
+
value: () => [Date, Date];
|
|
195
204
|
}
|
|
196
205
|
export type FormItemConfigSwiftOptionsCommon<PO extends Record<string, any>,
|
|
197
206
|
/** 需要格式化的模型 */
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatePickerShortcut, FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
2
|
+
import { ColProps } from 'element-plus';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 将 layout 解析为各屏幕尺寸的显式值:
|
|
6
|
+
* - 配置 span: xxx 时,xs/sm/md/lg/xl 默认全部视为 xxx
|
|
7
|
+
* - 单独设置某个尺寸则该尺寸覆盖 span 推导值
|
|
8
|
+
*/
|
|
9
|
+
export declare const resolveFormLayout: (layout?: Partial<ColProps>) => Partial<ColProps>;
|
|
10
|
+
/**
|
|
11
|
+
* 生成 ElDatePicker 原生 `shortcuts` 的默认时间段快捷值:今日、昨日、近7日。
|
|
12
|
+
* 直接用于 `<ElDatePicker :shortcuts="getDatePickerShortcuts()">`——
|
|
13
|
+
* 由 ElDatePicker 自身 pick 管线按其 value-format 归一化输出,
|
|
14
|
+
* 与手动选日期完全同源,无需任何额外格式化依赖。
|
|
15
|
+
*/
|
|
16
|
+
export declare const getDatePickerShortcuts: () => DatePickerShortcut[];
|
|
5
17
|
/**
|
|
6
18
|
* 生成表单数据
|
|
7
19
|
*/
|
|
@@ -15,8 +15,6 @@ declare const _default: <T extends Record<string, any>, PO extends Record<string
|
|
|
15
15
|
} & Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainRequiredKey> & Partial<Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey>> & {
|
|
16
16
|
tableMainProps?: Partial<Omit<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey | import('./types').TableMainRewriteKey>> | undefined;
|
|
17
17
|
} & {
|
|
18
|
-
showOperation?: boolean;
|
|
19
|
-
showHeader?: boolean;
|
|
20
18
|
list?: FormItemConfigList<PO, SO> | undefined;
|
|
21
19
|
api: (params: import('../table').TableApiParams<import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ>) => Promise<import('../table').TableApiResult<T>>;
|
|
22
20
|
query?: SQ | undefined;
|
|
@@ -24,10 +24,6 @@ F extends Record<string, any>> = Partial<Pick<FormSearchProps<PO, SO, {}>, FormS
|
|
|
24
24
|
} & Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainRequiredKey> & Partial<Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey>> & {
|
|
25
25
|
tableMainProps?: Partial<Omit<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey | TableMainOptionsKey | TableMainRewriteKey>>;
|
|
26
26
|
} & {
|
|
27
|
-
/** 是否展示操作区 */
|
|
28
|
-
showOperation?: boolean;
|
|
29
|
-
/** 是否展示头部区 */
|
|
30
|
-
showHeader?: boolean;
|
|
31
27
|
list?: FormItemConfigList<PO, SO>;
|
|
32
28
|
/** api */
|
|
33
29
|
api: (params: TableApiParams<ExtractFormStringifyFromObject<PO, SO> & SQ>) => Promise<TableApiResult<T>>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ElDatePicker as d, ElButton as u } from "element-plus/es";
|
|
2
|
-
import "element-plus/es/components/base/style/css";
|
|
3
|
-
import "element-plus/es/components/button/style/css";
|
|
4
|
-
import "element-plus/es/components/date-picker/style/css";
|
|
5
|
-
import { defineComponent as p, useModel as f, useAttrs as k, openBlock as o, createElementBlock as a, createVNode as _, mergeProps as V, unref as y, createElementVNode as g, Fragment as w, renderList as D, createBlock as E, withCtx as P, createTextVNode as B, toDisplayString as C, mergeModels as h } from "vue";
|
|
6
|
-
import { getDatePickerSwiftOptions as v } from "./utils.mjs";
|
|
7
|
-
const x = { class: "form-date-picker" }, F = { class: "form-date-picker-swift" }, U = /* @__PURE__ */ p({
|
|
8
|
-
name: "FormDatePicker",
|
|
9
|
-
inheritAttrs: !1,
|
|
10
|
-
__name: "FormDatePicker",
|
|
11
|
-
props: /* @__PURE__ */ h({
|
|
12
|
-
swiftOptions: { default: () => v() }
|
|
13
|
-
}, {
|
|
14
|
-
modelValue: { default: null },
|
|
15
|
-
modelModifiers: {}
|
|
16
|
-
}),
|
|
17
|
-
emits: ["update:modelValue"],
|
|
18
|
-
setup(r) {
|
|
19
|
-
const t = f(r, "modelValue"), i = k(), s = (l) => {
|
|
20
|
-
t.value = l.set();
|
|
21
|
-
};
|
|
22
|
-
return (l, n) => {
|
|
23
|
-
const m = d, c = u;
|
|
24
|
-
return o(), a("span", x, [
|
|
25
|
-
_(m, V({
|
|
26
|
-
modelValue: t.value,
|
|
27
|
-
"onUpdate:modelValue": n[0] || (n[0] = (e) => t.value = e),
|
|
28
|
-
type: "datetimerange",
|
|
29
|
-
class: "form-date-picker-input"
|
|
30
|
-
}, y(i)), null, 16, ["modelValue"]),
|
|
31
|
-
g("span", F, [
|
|
32
|
-
(o(!0), a(w, null, D(r.swiftOptions, (e) => (o(), E(c, {
|
|
33
|
-
key: e.key,
|
|
34
|
-
type: "primary",
|
|
35
|
-
link: "",
|
|
36
|
-
onClick: (M) => s(e)
|
|
37
|
-
}, {
|
|
38
|
-
default: P(() => [
|
|
39
|
-
B(C(e.key), 1)
|
|
40
|
-
]),
|
|
41
|
-
_: 2
|
|
42
|
-
}, 1032, ["onClick"]))), 128))
|
|
43
|
-
])
|
|
44
|
-
]);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export {
|
|
49
|
-
U as default
|
|
50
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ElRadioGroup as h, ElRadioButton as y, ElRadio as B } from "element-plus/es";
|
|
2
|
-
import "element-plus/es/components/base/style/css";
|
|
3
|
-
import "element-plus/es/components/radio-group/style/css";
|
|
4
|
-
import "element-plus/es/components/radio/style/css";
|
|
5
|
-
import "element-plus/es/components/radio-button/style/css";
|
|
6
|
-
import { defineComponent as V, useModel as _, computed as b, watch as g, openBlock as a, createBlock as r, unref as x, withCtx as d, createElementBlock as m, Fragment as c, renderList as s, createTextVNode as v, toDisplayString as p, createCommentVNode as M, mergeModels as N } from "vue";
|
|
7
|
-
const D = /* @__PURE__ */ V({
|
|
8
|
-
name: "FormRadio",
|
|
9
|
-
inheritAttrs: !0,
|
|
10
|
-
__name: "FormRadio",
|
|
11
|
-
props: /* @__PURE__ */ N({
|
|
12
|
-
list: {},
|
|
13
|
-
mode: { default: "radio" },
|
|
14
|
-
notNull: { type: Boolean, default: !0 }
|
|
15
|
-
}, {
|
|
16
|
-
modelValue: {},
|
|
17
|
-
modelModifiers: {}
|
|
18
|
-
}),
|
|
19
|
-
emits: ["update:modelValue"],
|
|
20
|
-
setup(o) {
|
|
21
|
-
const u = o, l = _(o, "modelValue"), n = b(() => {
|
|
22
|
-
if (u.notNull && u.list.length > 0) {
|
|
23
|
-
const e = u.list.some((i) => i.value === l.value);
|
|
24
|
-
if (l.value === void 0 || !e)
|
|
25
|
-
return u.list[0].value;
|
|
26
|
-
}
|
|
27
|
-
return l.value;
|
|
28
|
-
}), f = (e) => {
|
|
29
|
-
l.value = e;
|
|
30
|
-
};
|
|
31
|
-
return g(
|
|
32
|
-
n,
|
|
33
|
-
(e) => {
|
|
34
|
-
e !== void 0 && e !== l.value && (l.value = e);
|
|
35
|
-
},
|
|
36
|
-
{ immediate: !0 }
|
|
37
|
-
), (e, i) => {
|
|
38
|
-
const R = y, k = B, E = h;
|
|
39
|
-
return a(), r(E, {
|
|
40
|
-
"model-value": x(n),
|
|
41
|
-
"onUpdate:modelValue": f
|
|
42
|
-
}, {
|
|
43
|
-
default: d(() => [
|
|
44
|
-
o.mode === "buttonGroup" ? (a(!0), m(c, { key: 0 }, s(o.list, (t) => (a(), r(R, {
|
|
45
|
-
key: t.value,
|
|
46
|
-
value: t.value
|
|
47
|
-
}, {
|
|
48
|
-
default: d(() => [
|
|
49
|
-
v(p(t.label), 1)
|
|
50
|
-
]),
|
|
51
|
-
_: 2
|
|
52
|
-
}, 1032, ["value"]))), 128)) : o.mode === "radio" ? (a(!0), m(c, { key: 1 }, s(o.list, (t) => (a(), r(k, {
|
|
53
|
-
key: t.value,
|
|
54
|
-
value: t.value
|
|
55
|
-
}, {
|
|
56
|
-
default: d(() => [
|
|
57
|
-
v(p(t.label), 1)
|
|
58
|
-
]),
|
|
59
|
-
_: 2
|
|
60
|
-
}, 1032, ["value"]))), 128)) : M("", !0)
|
|
61
|
-
]),
|
|
62
|
-
_: 1
|
|
63
|
-
}, 8, ["model-value"]);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
export {
|
|
68
|
-
D as default
|
|
69
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DateTimeRangeSwiftOption } from './types';
|
|
2
|
-
|
|
3
|
-
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
|
-
modelValue: import('vue').PropType<[Date, Date] | null>;
|
|
5
|
-
swiftOptions: {
|
|
6
|
-
type: globalThis.PropType<DateTimeRangeSwiftOption[]>;
|
|
7
|
-
default: () => DateTimeRangeSwiftOption[];
|
|
8
|
-
};
|
|
9
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
10
|
-
modelValue: import('vue').PropType<[Date, Date] | null>;
|
|
11
|
-
swiftOptions: {
|
|
12
|
-
type: globalThis.PropType<DateTimeRangeSwiftOption[]>;
|
|
13
|
-
default: () => DateTimeRangeSwiftOption[];
|
|
14
|
-
};
|
|
15
|
-
}>> & Readonly<{}>, {
|
|
16
|
-
swiftOptions: DateTimeRangeSwiftOption[];
|
|
17
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
18
|
-
export default _default;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { OptionItem } from './types';
|
|
2
|
-
|
|
3
|
-
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
|
-
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
5
|
-
list: {
|
|
6
|
-
type: globalThis.PropType<OptionItem[]>;
|
|
7
|
-
required: true;
|
|
8
|
-
};
|
|
9
|
-
notNull: {
|
|
10
|
-
type: globalThis.PropType<boolean>;
|
|
11
|
-
default: boolean;
|
|
12
|
-
};
|
|
13
|
-
mode: {
|
|
14
|
-
type: globalThis.PropType<"radio" | "buttonGroup">;
|
|
15
|
-
default: string;
|
|
16
|
-
};
|
|
17
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
18
|
-
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
19
|
-
list: {
|
|
20
|
-
type: globalThis.PropType<OptionItem[]>;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
notNull: {
|
|
24
|
-
type: globalThis.PropType<boolean>;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
|
-
mode: {
|
|
28
|
-
type: globalThis.PropType<"radio" | "buttonGroup">;
|
|
29
|
-
default: string;
|
|
30
|
-
};
|
|
31
|
-
}>> & Readonly<{}>, {
|
|
32
|
-
notNull: boolean;
|
|
33
|
-
mode: "radio" | "buttonGroup";
|
|
34
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
35
|
-
export default _default;
|