@dt-frames/ui 2.0.17 → 2.0.18
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/drawer/index.d.ts +3 -4
- package/es/components/drawer/index.js +11 -15
- package/es/components/drawer/index.less +6 -0
- package/es/components/drawer/src/index.d.ts +5 -7
- package/es/components/drawer/src/types/index.type.d.ts +3 -1
- package/es/components/form/index.js +8 -4
- package/es/components/form/src/components/FormButtons.d.ts +3056 -4
- package/es/components/form/src/components/FormItem.d.ts +2 -2
- package/es/components/form/src/components/formIcon.d.ts +0 -1209
- package/es/components/form/src/components/formInputUseDialog.d.ts +0 -894
- package/es/components/form/src/props.d.ts +3 -3
- package/es/components/form/src/types/items.type.d.ts +8 -0
- package/es/components/modal/index.js +19 -7
- package/es/components/modal/index.less +1 -9
- package/es/components/source/index.js +15 -7
- package/es/components/table/index.js +156 -74
- package/es/components/table/index.less +5 -1
- package/es/components/tree/index.js +47 -55
- package/es/components/tree/src/type/tree.d.ts +0 -4
- package/es/components/tree/src/utils/tree.d.ts +3 -1
- package/es/components/upload/index.js +103 -41
- package/es/components/upload/src/basicProps.d.ts +5 -1
- package/es/components/upload/src/hooks/useFile.d.ts +7 -6
- package/es/components/upload/src/index.d.ts +16 -0
- package/es/components/upload/src/type/file.d.ts +9 -2
- package/es/components/upload/src/utils/fileSize.d.ts +1 -0
- package/es/theme/index.js +149 -97
- package/es/theme/index.less +14 -0
- package/es/theme/src/components/sider/index.d.ts +1 -1
- package/es/theme/src/components/sider/mix-sider.d.ts +1 -1
- package/es/theme/src/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -67,6 +67,7 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
|
|
|
67
67
|
};
|
|
68
68
|
props: any;
|
|
69
69
|
propsRef: import("vue").Ref<{
|
|
70
|
+
t?: string;
|
|
70
71
|
loading?: boolean;
|
|
71
72
|
loadingText?: string;
|
|
72
73
|
visible?: boolean;
|
|
@@ -1600,7 +1601,7 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
|
|
|
1600
1601
|
"text-anchor"?: import("csstype").TextAnchorProperty;
|
|
1601
1602
|
"vector-effect"?: import("csstype").VectorEffectProperty;
|
|
1602
1603
|
};
|
|
1603
|
-
title?: string;
|
|
1604
|
+
title?: string | ((data: import("@dt-frames/core").Recordable<any>) => string);
|
|
1604
1605
|
wrapClassName?: string;
|
|
1605
1606
|
class?: string;
|
|
1606
1607
|
wrapStyle?: {
|
|
@@ -7711,7 +7712,7 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
|
|
|
7711
7712
|
t?: string;
|
|
7712
7713
|
label: string;
|
|
7713
7714
|
color?: "" | "error" | "warning" | "success";
|
|
7714
|
-
type?: "default" | "dashed" | "text" | "primary" | "ghost"
|
|
7715
|
+
type?: "link" | "default" | "dashed" | "text" | "primary" | "ghost";
|
|
7715
7716
|
class?: string;
|
|
7716
7717
|
disabled?: boolean;
|
|
7717
7718
|
show?: boolean;
|
|
@@ -7732,13 +7733,11 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
|
|
|
7732
7733
|
getMergeProps: import("vue").ComputedRef<any>;
|
|
7733
7734
|
getshowFooter: import("vue").ComputedRef<boolean>;
|
|
7734
7735
|
getProps: import("vue").ComputedRef<import("./src/types/index.type").DrawerProps>;
|
|
7735
|
-
getScrollContentStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
7736
7736
|
handleSave: () => void;
|
|
7737
7737
|
handleCancel: (e?: Event) => Promise<void>;
|
|
7738
7738
|
setDrawerProps: (props: Partial<import("./src/types/index.type").DrawerProps>) => void;
|
|
7739
7739
|
drawerMethods: import("./src/types/index.type").DrawerMethods;
|
|
7740
7740
|
instance: import("vue").ComponentInternalInstance;
|
|
7741
|
-
readonly DtScrollContainer: import('../../utils/withInstall').SFCWithInstall<import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
7742
7741
|
DrawerHeader: import("vue").DefineComponent<{
|
|
7743
7742
|
title: {
|
|
7744
7743
|
type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Drawer
|
|
1
|
+
import { Drawer } from "ant-design-vue/es";
|
|
2
2
|
import "ant-design-vue/es/drawer/style";
|
|
3
3
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, computed, createVNode, unref, useAttrs, ref, toRaw, getCurrentInstance, watch, createBlock, mergeProps, createSlots, withCtx, renderList, normalizeProps, guardReactiveProps, reactive, watchEffect, nextTick, onUnmounted } from "vue";
|
|
4
4
|
import { useI18n, DtCache, CacheKey, deepMerge, isUnDef, isFunction, useApp, isObject, error } from "@dt-frames/core";
|
|
@@ -23,14 +23,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
const _export_sfc = (sfc, props) => {
|
|
27
|
-
const target = sfc.__vccOpts || sfc;
|
|
28
|
-
for (const [key, val] of props) {
|
|
29
|
-
target[key] = val;
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
const DrawerHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/components/DrawerHeader.vue"]]);
|
|
34
26
|
const _hoisted_1 = {
|
|
35
27
|
class: "flex items-center",
|
|
36
28
|
style: { gap: "10px" }
|
|
@@ -86,7 +78,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
86
78
|
};
|
|
87
79
|
}
|
|
88
80
|
});
|
|
89
|
-
const DrawerFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/components/DrawerFooter.vue"]]);
|
|
90
81
|
const basicProps = {
|
|
91
82
|
t: {
|
|
92
83
|
type: String
|
|
@@ -213,7 +204,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
213
204
|
{ immediate: false }
|
|
214
205
|
);
|
|
215
206
|
return (_ctx, _cache) => {
|
|
216
|
-
const _component_ADrawer = Drawer
|
|
207
|
+
const _component_ADrawer = Drawer;
|
|
217
208
|
return openBlock(), createBlock(_component_ADrawer, mergeProps({
|
|
218
209
|
class: "dt-drawer",
|
|
219
210
|
onClose: handleCancel
|
|
@@ -230,7 +221,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
230
221
|
!_ctx.$slots.title ? {
|
|
231
222
|
name: "title",
|
|
232
223
|
fn: withCtx(() => [
|
|
233
|
-
createVNode(
|
|
224
|
+
createVNode(_sfc_main$2, {
|
|
234
225
|
title: unref(getProps).title
|
|
235
226
|
}, {
|
|
236
227
|
titleToolbar: withCtx(() => [
|
|
@@ -250,7 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
250
241
|
unref(getshowFooter) ? {
|
|
251
242
|
name: "footer",
|
|
252
243
|
fn: withCtx(() => [
|
|
253
|
-
createVNode(
|
|
244
|
+
createVNode(_sfc_main$1, {
|
|
254
245
|
buttons: propsRef.value?.footer,
|
|
255
246
|
showSave: unref(getProps).showOkBtn,
|
|
256
247
|
showCancel: unref(getProps).showCancelBtn,
|
|
@@ -275,7 +266,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
275
266
|
};
|
|
276
267
|
}
|
|
277
268
|
});
|
|
278
|
-
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/index.vue"]]);
|
|
279
269
|
const orgDialogProp = reactive({});
|
|
280
270
|
const cbTransfer = reactive({});
|
|
281
271
|
const dataTransfer = reactive({});
|
|
@@ -370,6 +360,12 @@ function useDrawer(props, setModalData) {
|
|
|
370
360
|
return;
|
|
371
361
|
}
|
|
372
362
|
setModalData(data ?? {});
|
|
363
|
+
if (!data)
|
|
364
|
+
return;
|
|
365
|
+
if (props?.title && isFunction(props?.title)) {
|
|
366
|
+
let title = props.title(data);
|
|
367
|
+
methods.setDrawerProps({ title });
|
|
368
|
+
}
|
|
373
369
|
});
|
|
374
370
|
});
|
|
375
371
|
const methods = {
|
|
@@ -393,7 +389,7 @@ const withInstall = (comp) => {
|
|
|
393
389
|
};
|
|
394
390
|
return comp;
|
|
395
391
|
};
|
|
396
|
-
const DtDrawer = withInstall(
|
|
392
|
+
const DtDrawer = withInstall(_sfc_main);
|
|
397
393
|
export {
|
|
398
394
|
DtDrawer,
|
|
399
395
|
useDrawer,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DrawerMethods, DrawerProps } from './types/index.type';
|
|
2
|
-
import { CSSProperties } from 'vue';
|
|
3
2
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
3
|
t: {
|
|
5
4
|
type: StringConstructor;
|
|
@@ -29,7 +28,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
29
28
|
type: BooleanConstructor;
|
|
30
29
|
default: boolean;
|
|
31
30
|
};
|
|
32
|
-
maskStyle: import("vue").PropType<CSSProperties>;
|
|
31
|
+
maskStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
33
32
|
closeFunc: {
|
|
34
33
|
type: import("vue").PropType<any>;
|
|
35
34
|
default: any;
|
|
@@ -68,6 +67,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
68
67
|
};
|
|
69
68
|
props: any;
|
|
70
69
|
propsRef: import("vue").Ref<{
|
|
70
|
+
t?: string;
|
|
71
71
|
loading?: boolean;
|
|
72
72
|
loadingText?: string;
|
|
73
73
|
visible?: boolean;
|
|
@@ -1601,7 +1601,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1601
1601
|
"text-anchor"?: import("csstype").TextAnchorProperty;
|
|
1602
1602
|
"vector-effect"?: import("csstype").VectorEffectProperty;
|
|
1603
1603
|
};
|
|
1604
|
-
title?: string;
|
|
1604
|
+
title?: string | ((data: import("@dt-frames/core").Recordable<any>) => string);
|
|
1605
1605
|
wrapClassName?: string;
|
|
1606
1606
|
class?: string;
|
|
1607
1607
|
wrapStyle?: {
|
|
@@ -7712,7 +7712,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
7712
7712
|
t?: string;
|
|
7713
7713
|
label: string;
|
|
7714
7714
|
color?: "" | "error" | "warning" | "success";
|
|
7715
|
-
type?: "default" | "dashed" | "text" | "primary" | "ghost"
|
|
7715
|
+
type?: "link" | "default" | "dashed" | "text" | "primary" | "ghost";
|
|
7716
7716
|
class?: string;
|
|
7717
7717
|
disabled?: boolean;
|
|
7718
7718
|
show?: boolean;
|
|
@@ -7733,13 +7733,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
7733
7733
|
getMergeProps: import("vue").ComputedRef<any>;
|
|
7734
7734
|
getshowFooter: import("vue").ComputedRef<boolean>;
|
|
7735
7735
|
getProps: import("vue").ComputedRef<DrawerProps>;
|
|
7736
|
-
getScrollContentStyle: import("vue").ComputedRef<CSSProperties>;
|
|
7737
7736
|
handleSave: () => void;
|
|
7738
7737
|
handleCancel: (e?: Event) => Promise<void>;
|
|
7739
7738
|
setDrawerProps: (props: Partial<DrawerProps>) => void;
|
|
7740
7739
|
drawerMethods: DrawerMethods;
|
|
7741
7740
|
instance: import("vue").ComponentInternalInstance;
|
|
7742
|
-
readonly DtScrollContainer: import("../../../utils/withInstall").SFCWithInstall<import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
7743
7741
|
DrawerHeader: import("vue").DefineComponent<{
|
|
7744
7742
|
title: {
|
|
7745
7743
|
type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
|
|
@@ -7831,7 +7829,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
7831
7829
|
type: BooleanConstructor;
|
|
7832
7830
|
default: boolean;
|
|
7833
7831
|
};
|
|
7834
|
-
maskStyle: import("vue").PropType<CSSProperties>;
|
|
7832
|
+
maskStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
7835
7833
|
closeFunc: {
|
|
7836
7834
|
type: import("vue").PropType<any>;
|
|
7837
7835
|
default: any;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ButtonProps } from '../../../form';
|
|
2
|
+
import { Recordable } from "@dt-frames/core";
|
|
2
3
|
import { CSSProperties, ComputedRef } from "vue";
|
|
3
4
|
export declare type DrawerProps = {
|
|
5
|
+
t?: string;
|
|
4
6
|
loading?: boolean;
|
|
5
7
|
loadingText?: string;
|
|
6
8
|
visible?: boolean;
|
|
@@ -11,7 +13,7 @@ export declare type DrawerProps = {
|
|
|
11
13
|
maskClosable?: boolean;
|
|
12
14
|
keyboard?: boolean;
|
|
13
15
|
maskStyle?: CSSProperties;
|
|
14
|
-
title?: ComputedRef<string> | string;
|
|
16
|
+
title?: ComputedRef<string> | string | ((data: Recordable) => string);
|
|
15
17
|
wrapClassName?: string;
|
|
16
18
|
class?: string;
|
|
17
19
|
wrapStyle?: CSSProperties;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RadioButton, RadioGroup, Input, Button, FormItem as FormItem$1, Col as Col$1, Row, Form as Form$1 } from "ant-design-vue/es";
|
|
2
2
|
import "ant-design-vue/es/form/style";
|
|
3
3
|
import "ant-design-vue/es/row/style";
|
|
4
|
-
import { computed, unref, getCurrentInstance, reactive, readonly, watchEffect, nextTick, toRaw, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode, createVNode, normalizeProps, guardReactiveProps, createCommentVNode, toRefs, isVNode,
|
|
4
|
+
import { computed, unref, getCurrentInstance, reactive, readonly, watchEffect, nextTick, toRaw, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode, createVNode, normalizeProps, guardReactiveProps, createCommentVNode, ref, toRefs, isVNode, watch, resolveDirective, normalizeStyle, withDirectives, normalizeClass, onMounted, withKeys, createSlots, renderSlot } from "vue";
|
|
5
5
|
import { useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isUnDef, isBoolean, isNull, dispatchResize, isObject, deepMerge, isNullAndUnDef, useTimeoutFn } from "@dt-frames/core";
|
|
6
6
|
import { merge, isEqual, omit, cloneDeep, upperFirst, uniqBy, set } from "lodash-es";
|
|
7
7
|
import { Input as Input$1, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Tooltip, Form, FormItem } from "ant-design-vue";
|
|
@@ -297,6 +297,7 @@ const _sfc_main$2 = {
|
|
|
297
297
|
const {
|
|
298
298
|
appConf
|
|
299
299
|
} = useAppStore();
|
|
300
|
+
const uploadFiles = ref([]);
|
|
300
301
|
const {
|
|
301
302
|
schema,
|
|
302
303
|
formProps
|
|
@@ -443,6 +444,9 @@ const _sfc_main$2 = {
|
|
|
443
444
|
const [e] = args;
|
|
444
445
|
const target = e ? e.target : null;
|
|
445
446
|
const value = target ? isCheck ? target.checked : target.value : e;
|
|
447
|
+
if (component === "Upload") {
|
|
448
|
+
uploadFiles.value = unref(args[1]);
|
|
449
|
+
}
|
|
446
450
|
if (isString(name)) {
|
|
447
451
|
props.setFormModel(name, value);
|
|
448
452
|
} else if (isArray(name)) {
|
|
@@ -505,6 +509,7 @@ const _sfc_main$2 = {
|
|
|
505
509
|
}
|
|
506
510
|
if (component === "Upload" && !itemProps.defaultFiles && extraName?.length) {
|
|
507
511
|
itemProps.defaultFiles = unref(getValues).values?.[extraName[0]];
|
|
512
|
+
itemProps.emitSnippet = true;
|
|
508
513
|
}
|
|
509
514
|
itemProps.formValues = unref(getValues);
|
|
510
515
|
if (["Select", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker"].includes(component)) {
|
|
@@ -548,6 +553,8 @@ const _sfc_main$2 = {
|
|
|
548
553
|
let rules = cloneDeep(defaultRules);
|
|
549
554
|
const getRequired = isFunction(required) ? required(unref(getValues).model) : required;
|
|
550
555
|
function validator(rule, value) {
|
|
556
|
+
if (component === "Upload" && unref(uploadFiles).map((file) => file.fileId).includes(void 0))
|
|
557
|
+
return Promise.resolve();
|
|
551
558
|
const msg = rule.message || defaultMsg;
|
|
552
559
|
if (value === void 0 || isNull(value) || Array.isArray(value) && value.length === 0 || typeof value === "string" && value.trim() === "" || typeof value === "object" && Reflect.has(value, "checked") && Reflect.has(value, "halfChecked") && Array.isArray(value.checked) && Array.isArray(value.halfChecked) && value.checked.length === 0 && value.halfChecked.length === 0) {
|
|
553
560
|
return Promise.reject(msg);
|
|
@@ -988,7 +995,6 @@ function useFormEvents({
|
|
|
988
995
|
return;
|
|
989
996
|
}
|
|
990
997
|
const names = unref(getSchema).map((item) => item.name).filter(Boolean);
|
|
991
|
-
const validKeys = [];
|
|
992
998
|
Object.keys(values).forEach((key) => {
|
|
993
999
|
const schema = unref(getSchema).find((item) => item.name === key);
|
|
994
1000
|
let value = values[key];
|
|
@@ -1013,12 +1019,10 @@ function useFormEvents({
|
|
|
1013
1019
|
} else {
|
|
1014
1020
|
formModel[key] = value;
|
|
1015
1021
|
}
|
|
1016
|
-
validKeys.push(key);
|
|
1017
1022
|
} else {
|
|
1018
1023
|
formModel[key] = value;
|
|
1019
1024
|
}
|
|
1020
1025
|
});
|
|
1021
|
-
return validateFields(validKeys);
|
|
1022
1026
|
}
|
|
1023
1027
|
async function validate(nameList) {
|
|
1024
1028
|
return await unref(formElRef)?.validate(nameList);
|