@dazhicheng/ui 1.6.33 → 1.6.34
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/dist/components/tt-form/src/config.js +33 -31
- package/dist/components/tt-form/src/form-render/dependencies.js +46 -39
- package/dist/components/tt-form/src/types.d.ts +2 -0
- package/dist/components/tt-input-textarea/index.d.ts +6 -0
- package/dist/components/tt-input-textarea/index.js +22 -0
- package/dist/components/tt-input-textarea/index.vue.d.ts +1606 -0
- package/dist/components/tt-input-textarea/index.vue.js +375 -0
- package/dist/components/tt-input-textarea/index.vue3.js +5 -0
- package/dist/components/tt-input-textarea/types.d.ts +142 -0
- package/dist/components/tt-modal-form/index.vue.js +13 -12
- package/dist/components/tt-nav-anchor/index.d.ts +3 -3
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.d.ts +1 -1
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/TableForm.vue.js +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +104 -101
- package/dist/packages/utils/src/is.js +37 -32
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,63 +1,65 @@
|
|
|
1
|
-
import { ElColorPicker as
|
|
2
|
-
import { TtSelect as
|
|
3
|
-
import { TtCheckbox as
|
|
1
|
+
import { ElColorPicker as f, ElCascader as d, ElUpload as u, ElTreeSelect as T, ElTimePicker as O, ElSwitch as M, ElSelectV2 as N, ElSelect as P, ElRadioGroup as b, ElRadio as C, ElMention as _, ElInputTag as k, ElInputNumber as S, ElDatePicker as h, ElCheckboxGroup as I, ElCheckboxButton as R, ElCheckbox as x } from "element-plus";
|
|
2
|
+
import { TtSelect as A } from "../../tt-select/index.js";
|
|
3
|
+
import { TtCheckbox as L } from "../../tt-checkbox/index.js";
|
|
4
4
|
import { TtRadioGroup as y } from "../../tt-radio-group/index.js";
|
|
5
5
|
import { TtPanelSelect as D } from "../../tt-panel-select/index.js";
|
|
6
6
|
import { TtUpload as F } from "../../tt-upload/index.js";
|
|
7
7
|
import { TtApiComponent as U } from "../../tt-api-component/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import j from "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { TtInputTextarea as G } from "../../tt-input-textarea/index.js";
|
|
9
|
+
import { globalShareState as V } from "./shared/global-state.js";
|
|
10
|
+
import { defineRule as j } from "vee-validate";
|
|
11
|
+
import g from "./components/FormElInput.vue.js";
|
|
12
|
+
const p = "modelValue", B = {}, v = {
|
|
13
|
+
TtSelect: A,
|
|
14
|
+
TtCheckbox: L,
|
|
14
15
|
TtRadioGroup: y,
|
|
15
16
|
TtUpload: F,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
TtInputTextarea: G,
|
|
18
|
+
ElCheckbox: x,
|
|
19
|
+
ElCheckboxButton: R,
|
|
20
|
+
ElCheckboxGroup: I,
|
|
19
21
|
ElDatePicker: h,
|
|
20
|
-
ElInput:
|
|
22
|
+
ElInput: g,
|
|
21
23
|
ElInputNumber: S,
|
|
22
24
|
ElInputTag: k,
|
|
23
25
|
ElMention: _,
|
|
24
26
|
ElRadio: C,
|
|
25
27
|
ElRadioGroup: b,
|
|
26
|
-
ElSelect:
|
|
27
|
-
ElSelectV2:
|
|
28
|
-
ElSwitch:
|
|
29
|
-
ElTimePicker:
|
|
30
|
-
ElTreeSelect:
|
|
28
|
+
ElSelect: P,
|
|
29
|
+
ElSelectV2: N,
|
|
30
|
+
ElSwitch: M,
|
|
31
|
+
ElTimePicker: O,
|
|
32
|
+
ElTreeSelect: T,
|
|
31
33
|
ElUpload: u,
|
|
32
|
-
ElCascader:
|
|
33
|
-
ElColorPicker:
|
|
34
|
+
ElCascader: d,
|
|
35
|
+
ElColorPicker: f,
|
|
34
36
|
TtApiComponent: U,
|
|
35
37
|
TtPanelSelect: D
|
|
36
38
|
}, i = {
|
|
37
39
|
ElUpload: "fileList"
|
|
38
40
|
};
|
|
39
|
-
function
|
|
40
|
-
const { config: e, defineRules:
|
|
41
|
+
function $(a) {
|
|
42
|
+
const { config: e, defineRules: r } = a, {
|
|
41
43
|
disabledOnChangeListener: c = !0,
|
|
42
44
|
disabledOnInputListener: s = !0,
|
|
43
45
|
emptyStateValue: E = void 0
|
|
44
46
|
} = e || {};
|
|
45
|
-
if (Object.assign(
|
|
47
|
+
if (Object.assign(B, {
|
|
46
48
|
disabledOnChangeListener: c,
|
|
47
49
|
disabledOnInputListener: s,
|
|
48
50
|
emptyStateValue: E
|
|
49
|
-
}),
|
|
50
|
-
for (const o of Object.keys(
|
|
51
|
-
|
|
52
|
-
const m = (e == null ? void 0 : e.baseModelPropName) ?? p,
|
|
51
|
+
}), r)
|
|
52
|
+
for (const o of Object.keys(r))
|
|
53
|
+
j(o, r[o]);
|
|
54
|
+
const m = (e == null ? void 0 : e.baseModelPropName) ?? p, l = e == null ? void 0 : e.modelPropNameMap, n = V.getComponents();
|
|
53
55
|
for (const o of Object.keys(n)) {
|
|
54
56
|
const t = o;
|
|
55
|
-
|
|
57
|
+
v[t] = n[o], m !== p && (i[t] = m), l && l[t] && (i[t] = l[t]);
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
export {
|
|
59
61
|
i as COMPONENT_BIND_EVENT_MAP,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
v as COMPONENT_MAP,
|
|
63
|
+
B as DEFAULT_FORM_COMMON_CONFIG,
|
|
64
|
+
$ as setupForm
|
|
63
65
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unref as V, ref as n, shallowRef as N, computed as O, watch as j, toRaw as k } from "vue";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
|
-
import { isFunction as o, isBoolean as
|
|
4
|
+
import { isFunction as o, isBoolean as I, isObject as A, isString as q } from "../../../../packages/utils/src/is.js";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
7
7
|
import "xe-utils";
|
|
@@ -16,76 +16,83 @@ import "lodash-es";
|
|
|
16
16
|
import { get as B } from "es-toolkit/compat";
|
|
17
17
|
import { useFormValues as C } from "vee-validate";
|
|
18
18
|
import { injectFormProps as K } from "../useFormContext.js";
|
|
19
|
-
const M = /* @__PURE__ */ new Set([
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const M = /* @__PURE__ */ new Set([
|
|
20
|
+
"ElInput",
|
|
21
|
+
"FormElInput",
|
|
22
|
+
"ElInputNumber",
|
|
23
|
+
"ElInputTag",
|
|
24
|
+
"ElMention",
|
|
25
|
+
"TtInputTextarea"
|
|
26
|
+
]);
|
|
27
|
+
function ae(e) {
|
|
28
|
+
const t = q(e) ? e : (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.__name);
|
|
22
29
|
return q(t) && M.has(t) ? "required" : "selectRequired";
|
|
23
30
|
}
|
|
24
|
-
function W(
|
|
31
|
+
function W(e, t) {
|
|
25
32
|
if (t.startsWith("[") && t.endsWith("]")) {
|
|
26
|
-
const
|
|
27
|
-
return
|
|
33
|
+
const w = t.slice(1, -1);
|
|
34
|
+
return e[w];
|
|
28
35
|
}
|
|
29
|
-
return B(
|
|
36
|
+
return B(e, t);
|
|
30
37
|
}
|
|
31
|
-
function
|
|
32
|
-
var
|
|
33
|
-
const t = C(), [
|
|
38
|
+
function oe(e) {
|
|
39
|
+
var E;
|
|
40
|
+
const t = C(), [w] = K(), s = V(w).formApi;
|
|
34
41
|
if (!t)
|
|
35
42
|
throw new Error("useDependencies should be used within <TtForm>");
|
|
36
43
|
const l = n(!0), f = n(!1), m = n(!0), g = n(!1), h = n({}), F = N(), S = O(() => {
|
|
37
44
|
var i;
|
|
38
|
-
return (((i =
|
|
45
|
+
return (((i = e()) == null ? void 0 : i.triggerFields) ?? []).map((d) => W(t.value, d));
|
|
39
46
|
});
|
|
40
|
-
let
|
|
47
|
+
let x = 0;
|
|
41
48
|
return j(
|
|
42
|
-
[S,
|
|
49
|
+
[S, e],
|
|
43
50
|
async ([_, i]) => {
|
|
44
51
|
var b;
|
|
45
52
|
if (!i || !((b = i == null ? void 0 : i.triggerFields) != null && b.length))
|
|
46
53
|
return;
|
|
47
|
-
const d = ++
|
|
54
|
+
const d = ++x, u = () => d !== x, { componentProps: T, disabled: v, if: c, required: R, rules: y, show: p, trigger: P } = i, a = t.value;
|
|
48
55
|
if (o(c)) {
|
|
49
|
-
const
|
|
50
|
-
if (u() || (l.value =
|
|
51
|
-
} else if (
|
|
56
|
+
const r = !!await c(a, s);
|
|
57
|
+
if (u() || (l.value = r, !l.value)) return;
|
|
58
|
+
} else if (I(c)) {
|
|
52
59
|
if (l.value = c, !l.value) return;
|
|
53
60
|
} else
|
|
54
61
|
l.value = !0;
|
|
55
|
-
if (o(
|
|
56
|
-
const
|
|
62
|
+
if (o(p)) {
|
|
63
|
+
const r = !!await p(a, s);
|
|
57
64
|
if (u()) return;
|
|
58
|
-
m.value =
|
|
59
|
-
} else
|
|
60
|
-
if (o(
|
|
61
|
-
const
|
|
65
|
+
m.value = r;
|
|
66
|
+
} else I(p) ? m.value = p : m.value = !0;
|
|
67
|
+
if (o(T)) {
|
|
68
|
+
const r = await T(a, s);
|
|
62
69
|
if (u()) return;
|
|
63
|
-
h.value =
|
|
70
|
+
h.value = r;
|
|
64
71
|
} else
|
|
65
72
|
h.value = {};
|
|
66
|
-
if (o(
|
|
67
|
-
const
|
|
73
|
+
if (o(y)) {
|
|
74
|
+
const r = await y(a, s);
|
|
68
75
|
if (u()) return;
|
|
69
|
-
F.value = A(
|
|
76
|
+
F.value = A(r) ? k(r) : r;
|
|
70
77
|
} else
|
|
71
78
|
F.value = void 0;
|
|
72
79
|
if (o(v)) {
|
|
73
|
-
const
|
|
80
|
+
const r = !!await v(a, s);
|
|
74
81
|
if (u()) return;
|
|
75
|
-
f.value =
|
|
76
|
-
} else
|
|
77
|
-
if (o(
|
|
78
|
-
const
|
|
82
|
+
f.value = r;
|
|
83
|
+
} else I(v) ? f.value = v : f.value = !1;
|
|
84
|
+
if (o(R)) {
|
|
85
|
+
const r = !!await R(a, s);
|
|
79
86
|
if (u()) return;
|
|
80
|
-
g.value =
|
|
87
|
+
g.value = r;
|
|
81
88
|
} else
|
|
82
89
|
g.value = !1;
|
|
83
|
-
if (o(
|
|
90
|
+
if (o(P)) {
|
|
84
91
|
if (u()) return;
|
|
85
|
-
await
|
|
92
|
+
await P(a, s);
|
|
86
93
|
}
|
|
87
94
|
},
|
|
88
|
-
{ deep: !0, immediate: ((
|
|
95
|
+
{ deep: !0, immediate: ((E = e()) == null ? void 0 : E.immediate) ?? !0 }
|
|
89
96
|
), {
|
|
90
97
|
dynamicComponentProps: h,
|
|
91
98
|
dynamicRules: F,
|
|
@@ -96,7 +103,7 @@ function or(r) {
|
|
|
96
103
|
};
|
|
97
104
|
}
|
|
98
105
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
oe as default,
|
|
107
|
+
ae as resolveRequiredRuleName,
|
|
101
108
|
W as resolveValueByFieldName
|
|
102
109
|
};
|
|
@@ -11,12 +11,14 @@ import { FieldEntry, FieldArrayContext } from './types/forms';
|
|
|
11
11
|
import { PanelContainerProps } from '../../tt-panel-select';
|
|
12
12
|
import { TtRadioGroupProp } from '../../tt-radio-group';
|
|
13
13
|
import { TtCheckboxProp } from '../../tt-checkbox';
|
|
14
|
+
import { TtInputTextareaProps } from '../../tt-input-textarea';
|
|
14
15
|
import { FormApi } from './formApi';
|
|
15
16
|
export type FormLayout = "horizontal" | "inline" | "vertical";
|
|
16
17
|
export interface BaseFormComponentMap {
|
|
17
18
|
TtSelect: TtSelectProp;
|
|
18
19
|
TtCheckbox: TtCheckboxProp;
|
|
19
20
|
TtRadioGroup: TtRadioGroupProp;
|
|
21
|
+
TtInputTextarea: TtInputTextareaProps;
|
|
20
22
|
ElCheckbox: CheckboxProps;
|
|
21
23
|
ElCheckboxButton: CheckboxProps;
|
|
22
24
|
ElCheckboxGroup: CheckboxGroupProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SFCWithInstall } from '../../../../utils/src';
|
|
2
|
+
import { default as TtInputTextareaConstructor } from './index.vue';
|
|
3
|
+
export declare const TtInputTextarea: SFCWithInstall<typeof TtInputTextareaConstructor>;
|
|
4
|
+
export default TtInputTextarea;
|
|
5
|
+
export type TtInputTextareaInstance = InstanceType<typeof TtInputTextarea>;
|
|
6
|
+
export type { TtInputTextareaProps, TtInputTextareaEmits, TtInputTextareaExpose } from './types';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "axios";
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import "dayjs";
|
|
4
|
+
import "vue";
|
|
5
|
+
import { withInstall as t } from "../../packages/utils/src/install.js";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
8
|
+
import "dayjs/plugin/utc";
|
|
9
|
+
import "dayjs/plugin/timezone";
|
|
10
|
+
import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
11
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
+
import "lodash-es";
|
|
16
|
+
import o from "./index.vue.js";
|
|
17
|
+
/* empty css */
|
|
18
|
+
const h = t(o);
|
|
19
|
+
export {
|
|
20
|
+
h as TtInputTextarea,
|
|
21
|
+
h as default
|
|
22
|
+
};
|