@dazhicheng/ui 1.5.242 → 1.5.244

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.
@@ -0,0 +1,202 @@
1
+ import "axios";
2
+ import "element-plus";
3
+ import { isFunction as R } from "../packages/utils/src/is.js";
4
+ import "vue";
5
+ import "xe-utils";
6
+ import "dayjs";
7
+ import "dayjs/plugin/utc";
8
+ import "dayjs/plugin/timezone";
9
+ import "../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
10
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
11
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
12
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
13
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
+ import { omit as N } from "lodash-es";
15
+ import { CODE_REGISTRY as H } from "./basicDataCodes.js";
16
+ import { useBasicDataOptions as J } from "./useBasicDataOptions.js";
17
+ const g = "all";
18
+ function h(t) {
19
+ return Array.isArray(t) ? t : t == null || t === "" ? [] : [t];
20
+ }
21
+ function Q(t, n = g) {
22
+ return t === n ? !0 : typeof t == "string" && typeof n == "string" && t.toLowerCase() === String(n).toLowerCase();
23
+ }
24
+ function X(t, n = g) {
25
+ return h(t).some((r) => Q(r, n));
26
+ }
27
+ function v(t) {
28
+ return t.replace(/[-_]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(/\s+/).filter(Boolean).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join("");
29
+ }
30
+ function W(t, n, r, s) {
31
+ return t ? R(t) ? t(n, r, s) : t : {};
32
+ }
33
+ function $(t, n, r, s) {
34
+ const l = new Set(r.map((c) => c.value)), e = t[n];
35
+ if (s) {
36
+ const c = h(e).filter((p) => l.has(p)), u = h(e);
37
+ (c.length !== u.length || c.some((p, S) => p !== u[S])) && (t[n] = c);
38
+ return;
39
+ }
40
+ e == null || e === "" || l.has(e) || (t[n] = void 0);
41
+ }
42
+ function z(t, n, r, s, l, e) {
43
+ const c = e ? l.filter((u) => h(r[n]).includes(u.value)) : l.find((u) => u.value === r[n]);
44
+ return {
45
+ values: r,
46
+ actions: s,
47
+ fieldName: n,
48
+ code: t,
49
+ options: l,
50
+ currentOption: c
51
+ };
52
+ }
53
+ function B(t, n, r) {
54
+ const s = h(t);
55
+ if (!s.length) return [];
56
+ if (X(t, r)) return n;
57
+ const l = new Set(s);
58
+ return n.filter((e) => l.has(e.value));
59
+ }
60
+ function K(t, n) {
61
+ const r = new Set(h(t));
62
+ return r.size ? n.filter((s) => !r.has(s.value)) : n;
63
+ }
64
+ function xe(t, n = {}) {
65
+ const r = [...new Set(t.map((e) => e.code))], { dataSource: s } = J({
66
+ codes: r,
67
+ dataSource: n.dataSource
68
+ }), l = {};
69
+ return t.forEach((e) => {
70
+ var D;
71
+ const c = H[e.code], u = e.key || e.code, p = e.fieldName || c.defaultFieldName, S = e.label || c.defaultLabel, L = e.multiple ?? c.defaultMultiple, U = e.showAll ?? c.defaultShowAll, O = e.showAllField ?? g, x = e.mutexWith, V = [
72
+ ...x ? [x] : [],
73
+ ...((D = e.dependencies) == null ? void 0 : D.triggerFields) || []
74
+ ], T = [...new Set(V)], j = N(e.dependencies || {}, ["triggerFields"]), q = T.length ? {
75
+ ...j,
76
+ triggerFields: T
77
+ } : e.dependencies, b = {
78
+ component: "TtPanelSelect",
79
+ fieldName: p,
80
+ label: S,
81
+ rules: e.rules,
82
+ dependencies: q,
83
+ componentProps: (o, w) => {
84
+ const A = s.value[e.code] || [];
85
+ let a = x ? K(o[x], A) : A;
86
+ R(e.customOptions) && (a = e.customOptions(o, a));
87
+ const P = W(e.componentProps, o, w, a), { onChange: k, ...E } = P;
88
+ return {
89
+ multiple: L,
90
+ showAll: U,
91
+ showAllField: O,
92
+ showNav: !1,
93
+ showOriginMode: !1,
94
+ showPinyinMode: !0,
95
+ ...E,
96
+ options: a,
97
+ onChange(d) {
98
+ var F;
99
+ if (x) {
100
+ const m = Array.isArray(o[x]), i = K(d, A);
101
+ $(o, x, i, m);
102
+ }
103
+ if (e.exclude) {
104
+ const m = e.exclude.fieldName, i = e.exclude.multiple ?? !0, y = B(d, A, O);
105
+ h(d).length ? $(o, m, y, i) : o[m] = i ? [] : void 0;
106
+ }
107
+ (F = e.onChange) == null || F.call(
108
+ e,
109
+ d,
110
+ z(e.code, p, o, w, a, L)
111
+ );
112
+ }
113
+ };
114
+ }
115
+ };
116
+ if (l[u] = {
117
+ ...b,
118
+ ...N(e, [
119
+ "code",
120
+ "key",
121
+ "fieldName",
122
+ "label",
123
+ "multiple",
124
+ "showAll",
125
+ "showAllField",
126
+ "componentProps",
127
+ "dependencies",
128
+ "onChange",
129
+ "rules",
130
+ "mutexWith",
131
+ "exclude",
132
+ "customOptions"
133
+ ]),
134
+ fieldName: p,
135
+ label: S,
136
+ rules: e.rules,
137
+ dependencies: b.dependencies,
138
+ componentProps: b.componentProps,
139
+ component: "TtPanelSelect"
140
+ }, e.exclude) {
141
+ const o = e.exclude, w = o.fieldName, A = o.key || `exclude${v(u)}`, a = o.label || c.defaultExcludeLabel, P = o.multiple ?? !0, k = o.showAll ?? !1, E = o.showAllField ?? g, d = o.dependencies || {}, F = {
142
+ ...d,
143
+ triggerFields: d.triggerFields ?? [p],
144
+ if: d.if ?? ((i) => h(i[p]).length > 0)
145
+ }, m = {
146
+ component: "TtPanelSelect",
147
+ fieldName: w,
148
+ label: a,
149
+ rules: o.rules,
150
+ dependencies: F,
151
+ componentProps: (i, y) => {
152
+ const G = s.value[e.code] || [], M = B(i[p], G, O), I = W(o.componentProps, i, y, M), { onChange: f, ...Y } = I;
153
+ return {
154
+ multiple: P,
155
+ showAll: k,
156
+ showAllField: E,
157
+ showNav: !1,
158
+ showOriginMode: !1,
159
+ showPinyinMode: !0,
160
+ ...Y,
161
+ options: M,
162
+ onChange(Z) {
163
+ var _;
164
+ (_ = o.onChange) == null || _.call(
165
+ o,
166
+ Z,
167
+ z(e.code, w, i, y, M, P)
168
+ );
169
+ }
170
+ };
171
+ }
172
+ };
173
+ l[A] = {
174
+ ...m,
175
+ ...N(o, [
176
+ "fieldName",
177
+ "label",
178
+ "key",
179
+ "showAll",
180
+ "showAllField",
181
+ "multiple",
182
+ "componentProps",
183
+ "dependencies",
184
+ "onChange",
185
+ "rules"
186
+ ]),
187
+ fieldName: w,
188
+ label: a,
189
+ rules: o.rules,
190
+ dependencies: m.dependencies,
191
+ componentProps: m.componentProps,
192
+ component: "TtPanelSelect"
193
+ };
194
+ }
195
+ }), {
196
+ ...l,
197
+ dataSource: s
198
+ };
199
+ }
200
+ export {
201
+ xe as usePanelSelectSchemas
202
+ };
package/dist/index.d.ts CHANGED
@@ -24,6 +24,9 @@ export * from './components/tt-panel-select';
24
24
  export * from './components/tt-radio-group';
25
25
  export { useFormSchemasLink } from './hooks/useFormSchemasLink';
26
26
  export { useDataPermissionOptions } from './hooks/useDataPermissionOptions';
27
+ export { useBasicDataOptions } from './hooks/useBasicDataOptions';
28
+ export { usePanelSelectSchemas, type PanelSelectFieldConfig, type PanelSelectExcludeConfig, } from './hooks/usePanelSelectSchemas';
29
+ export { CODES, type BasicDataCode } from './hooks/basicDataCodes';
27
30
  export { useFormat } from './hooks/useFormat';
28
31
  export { useLoading } from './hooks/useLoading';
29
32
  export { useScreenshotOss, type ScreenshotOssComponentOptions, type ScreenshotOssDataUrlResult, type ScreenshotOssOptions, type ScreenshotOssResult, } from './hooks/useScreenshotOss';
package/dist/index.js CHANGED
@@ -1,92 +1,95 @@
1
- import { TtButton as f } from "./components/tt-button/index.js";
2
- import { TtAddButton as fr } from "./components/tt-button/index.js";
3
- import { TtCheckbox as a } from "./components/tt-checkbox/index.js";
1
+ import { TtButton as a } from "./components/tt-button/index.js";
2
+ import { TtAddButton as ar } from "./components/tt-button/index.js";
3
+ import { TtCheckbox as f } from "./components/tt-checkbox/index.js";
4
4
  import { TtEmpty as p } from "./components/tt-empty/index.js";
5
- import { addComponent as d, setConfig as i } from "./components/tt-form/index.js";
6
- import { TtFormItemErrorTooltip as s } from "./components/tt-form-item-error-tooltip/index.js";
7
- import { TtIcon as T, TtAddIcon as x, TtSubIcon as u } from "./components/tt-icon/index.js";
5
+ import { addComponent as s, setConfig as i } from "./components/tt-form/index.js";
6
+ import { TtFormItemErrorTooltip as d } from "./components/tt-form-item-error-tooltip/index.js";
7
+ import { TtIcon as x, TtAddIcon as T, TtSubIcon as u } from "./components/tt-icon/index.js";
8
8
  import { TtImage as l } from "./components/tt-image/index.js";
9
9
  import { RenderDrawer as n } from "./components/tt-drawer/index.js";
10
10
  import { RenderModal as c } from "./components/tt-modal/index.js";
11
11
  import { TtModal as pr } from "./components/tt-modal/index.js";
12
12
  import { TtSelect as b } from "./components/tt-select/index.js";
13
13
  import { TtText as w } from "./components/tt-text/index.js";
14
- import { TtUpload as R } from "./components/tt-upload/index.js";
15
- import { TtNavAnchor as g } from "./components/tt-nav-anchor/index.js";
16
- import { TtApiComponent as h } from "./components/tt-api-component/index.js";
14
+ import { TtUpload as h } from "./components/tt-upload/index.js";
15
+ import { TtNavAnchor as R } from "./components/tt-nav-anchor/index.js";
16
+ import { TtApiComponent as g } from "./components/tt-api-component/index.js";
17
17
  import * as e from "./directives/index.js";
18
18
  import { setup as M } from "./hooks/useSetup.js";
19
- import { TtLog as A } from "./components/tt-log/index.js";
20
- import { TtPanelSelect as C } from "./components/tt-panel-select/index.js";
21
- import { TtRadioGroup as F } from "./components/tt-radio-group/index.js";
19
+ import { TtLog as S } from "./components/tt-log/index.js";
20
+ import { TtPanelSelect as A } from "./components/tt-panel-select/index.js";
21
+ import { TtRadioGroup as C } from "./components/tt-radio-group/index.js";
22
22
  import { setXHR as ir } from "./utils/xhr.js";
23
23
  /* empty css */
24
24
  /* empty css */
25
25
  /* empty css */
26
26
  /* empty css */
27
- import { default as Tr } from "./components/tt-area/TtArea.vue.js";
27
+ import { default as xr } from "./components/tt-area/TtArea.vue.js";
28
28
  import { useModalForm as ur } from "./components/tt-modal-form/useModalForm.js";
29
29
  import { TtLoading as nr } from "./components/tt-loading/index.js";
30
- import { TtTable as br, TtTableAction as wr, TtTableButton as Rr } from "./components/tt-table/index.js";
31
- import { useFormSchemasLink as hr } from "./hooks/useFormSchemasLink.js";
32
- import { useDataPermissionOptions as Ar } from "./hooks/useDataPermissionOptions.js";
33
- import { useFormat as Fr } from "./hooks/useFormat.js";
34
- import { useLoading as Lr } from "./hooks/useLoading.js";
35
- import { useScreenshotOss as Ir } from "./hooks/useScreenshotOss.js";
30
+ import { TtTable as br, TtTableAction as wr, TtTableButton as hr } from "./components/tt-table/index.js";
31
+ import { useFormSchemasLink as gr } from "./hooks/useFormSchemasLink.js";
32
+ import { useDataPermissionOptions as Sr } from "./hooks/useDataPermissionOptions.js";
33
+ import { useBasicDataOptions as Cr } from "./hooks/useBasicDataOptions.js";
34
+ import { usePanelSelectSchemas as Fr } from "./hooks/usePanelSelectSchemas.js";
35
+ import { CODES as Or } from "./hooks/basicDataCodes.js";
36
+ import { useFormat as Er } from "./hooks/useFormat.js";
37
+ import { useLoading as vr } from "./hooks/useLoading.js";
38
+ import { useScreenshotOss as Br } from "./hooks/useScreenshotOss.js";
36
39
  import { setupDrawer as D } from "./components/tt-drawer/src/index.js";
37
- import { useShowDrawer as Er } from "./components/tt-drawer/src/index.js";
38
- import { setupModal as L } from "./components/tt-modal/src/index.js";
39
- import { useShowModal as vr } from "./components/tt-modal/src/index.js";
40
- import { default as Nr } from "./directives/disabled-tip/index.js";
41
- import { default as kr } from "./directives/auto-tip/index.js";
42
- import { showTtDrawer as Ur, useDrawerRender as $r } from "./components/tt-drawer/src/hooks/useDrawerRender.js";
43
- import { useDrawerResizable as yr } from "./components/tt-drawer/src/hooks/useResizable.js";
44
- import { showTtModal as Vr, useModalRender as Xr } from "./components/tt-modal/src/hooks/useModalRender.js";
45
- import { default as _r } from "./directives/dialog-resize/index.js";
40
+ import { useShowDrawer as kr } from "./components/tt-drawer/src/index.js";
41
+ import { setupModal as F } from "./components/tt-modal/src/index.js";
42
+ import { useShowModal as Ur } from "./components/tt-modal/src/index.js";
43
+ import { default as jr } from "./directives/disabled-tip/index.js";
44
+ import { default as Hr } from "./directives/auto-tip/index.js";
45
+ import { showTtDrawer as Xr, useDrawerRender as Zr } from "./components/tt-drawer/src/hooks/useDrawerRender.js";
46
+ import { useDrawerResizable as qr } from "./components/tt-drawer/src/hooks/useResizable.js";
47
+ import { showTtModal as Kr, useModalRender as Qr } from "./components/tt-modal/src/hooks/useModalRender.js";
48
+ import { default as Yr } from "./directives/dialog-resize/index.js";
46
49
  import * as rr from "zod";
47
- import { useGroupForm as Jr } from "./components/tt-form/src/group-form/useGroupForm.js";
48
- import { COMPONENT_MAP as Qr } from "./components/tt-form/src/config.js";
49
- import { useForm as Yr } from "./components/tt-form/src/useForm.js";
50
- import { TtImageViewer as oo } from "./components/tt-image/src/components/ImageViewer.js";
51
- import { vTtLoading as to } from "./components/tt-loading/src/directive.js";
52
- import { Loading as fo } from "./components/tt-loading/src/service.js";
53
- import { useTableContext as po, useTableFormContext as io } from "./components/tt-table/src/hooks/useTableContext.js";
54
- import { useTableFormRender as To, useTableRender as xo } from "./components/tt-table/src/hooks/useTableRender.js";
55
- import { ttUploadProps as lo } from "./components/tt-upload/src/typing.js";
56
- const S = [
57
- f,
50
+ import { useGroupForm as oo } from "./components/tt-form/src/group-form/useGroupForm.js";
51
+ import { COMPONENT_MAP as to } from "./components/tt-form/src/config.js";
52
+ import { useForm as ao } from "./components/tt-form/src/useForm.js";
53
+ import { TtImageViewer as po } from "./components/tt-image/src/components/ImageViewer.js";
54
+ import { vTtLoading as io } from "./components/tt-loading/src/directive.js";
55
+ import { Loading as To } from "./components/tt-loading/src/service.js";
56
+ import { useTableContext as lo, useTableFormContext as no } from "./components/tt-table/src/hooks/useTableContext.js";
57
+ import { useTableFormRender as bo, useTableRender as wo } from "./components/tt-table/src/hooks/useTableRender.js";
58
+ import { ttUploadProps as Ro } from "./components/tt-upload/src/typing.js";
59
+ const L = [
60
+ a,
58
61
  n,
59
62
  c,
60
- T,
63
+ x,
61
64
  b,
62
65
  p,
63
66
  w,
64
- a,
65
- s,
67
+ f,
68
+ d,
66
69
  l,
70
+ h,
67
71
  R,
68
- g,
69
- x,
72
+ T,
70
73
  u,
71
- h,
74
+ g,
75
+ S,
72
76
  A,
73
- C,
74
- F
75
- ], I = (r) => {
76
- S.forEach((o) => r.use(o)), Object.keys(e).forEach((o) => {
77
+ C
78
+ ], O = (r) => {
79
+ L.forEach((o) => r.use(o)), Object.keys(e).forEach((o) => {
77
80
  const t = e[o], m = o.replace(/([A-Z])/g, "-$1").toLowerCase();
78
81
  r.directive(m, t);
79
- }), D(r), L(r);
82
+ }), D(r), F(r);
80
83
  };
81
84
  function or(r) {
82
- d(r == null ? void 0 : r.components), i(r == null ? void 0 : r.defineRules, r == null ? void 0 : r.modelPropNameMap);
85
+ s(r == null ? void 0 : r.components), i(r == null ? void 0 : r.defineRules, r == null ? void 0 : r.modelPropNameMap);
83
86
  }
84
87
  const er = {
85
88
  /**
86
89
  * 安装组件
87
90
  * @param app Vue 应用实例
88
91
  */
89
- install: I,
92
+ install: O,
90
93
  /**
91
94
  * 全局参数设置
92
95
  * @param options 全局参数
@@ -95,63 +98,66 @@ const er = {
95
98
  setup: M
96
99
  };
97
100
  export {
98
- Qr as COMPONENT_MAP,
99
- fo as Loading,
101
+ Or as CODES,
102
+ to as COMPONENT_MAP,
103
+ To as Loading,
100
104
  n as RenderDrawer,
101
105
  c as RenderModal,
102
- fr as TtAddButton,
103
- x as TtAddIcon,
104
- h as TtApiComponent,
105
- Tr as TtArea,
106
- f as TtButton,
107
- a as TtCheckbox,
106
+ ar as TtAddButton,
107
+ T as TtAddIcon,
108
+ g as TtApiComponent,
109
+ xr as TtArea,
110
+ a as TtButton,
111
+ f as TtCheckbox,
108
112
  p as TtEmpty,
109
- T as TtIcon,
113
+ x as TtIcon,
110
114
  l as TtImage,
111
- oo as TtImageViewer,
115
+ po as TtImageViewer,
112
116
  nr as TtLoading,
113
- A as TtLog,
117
+ S as TtLog,
114
118
  pr as TtModal,
115
- g as TtNavAnchor,
116
- C as TtPanelSelect,
117
- F as TtRadioGroup,
119
+ R as TtNavAnchor,
120
+ A as TtPanelSelect,
121
+ C as TtRadioGroup,
118
122
  b as TtSelect,
119
123
  u as TtSubIcon,
120
124
  br as TtTable,
121
125
  wr as TtTableAction,
122
- Rr as TtTableButton,
126
+ hr as TtTableButton,
123
127
  w as TtText,
124
- R as TtUpload,
125
- d as addComponent,
126
- kr as autoTip,
128
+ h as TtUpload,
129
+ s as addComponent,
130
+ Hr as autoTip,
127
131
  er as default,
128
- _r as dialogResize,
129
- Nr as disabledTip,
132
+ Yr as dialogResize,
133
+ jr as disabledTip,
130
134
  or as formAdapter,
131
135
  i as setConfig,
132
136
  ir as setXHR,
133
137
  D as setupDrawer,
134
- L as setupModal,
135
- Ur as showTtDrawer,
136
- Vr as showTtModal,
137
- lo as ttUploadProps,
138
- Ar as useDataPermissionOptions,
139
- $r as useDrawerRender,
140
- yr as useDrawerResizable,
141
- Yr as useForm,
142
- hr as useFormSchemasLink,
143
- Fr as useFormat,
144
- Jr as useGroupForm,
145
- Lr as useLoading,
138
+ F as setupModal,
139
+ Xr as showTtDrawer,
140
+ Kr as showTtModal,
141
+ Ro as ttUploadProps,
142
+ Cr as useBasicDataOptions,
143
+ Sr as useDataPermissionOptions,
144
+ Zr as useDrawerRender,
145
+ qr as useDrawerResizable,
146
+ ao as useForm,
147
+ gr as useFormSchemasLink,
148
+ Er as useFormat,
149
+ oo as useGroupForm,
150
+ vr as useLoading,
146
151
  ur as useModalForm,
147
- Xr as useModalRender,
148
- Ir as useScreenshotOss,
149
- Er as useShowDrawer,
150
- vr as useShowModal,
151
- po as useTableContext,
152
- io as useTableFormContext,
153
- To as useTableFormRender,
154
- xo as useTableRender,
155
- to as vTtLoading,
152
+ Qr as useModalRender,
153
+ Fr as usePanelSelectSchemas,
154
+ Br as useScreenshotOss,
155
+ kr as useShowDrawer,
156
+ Ur as useShowModal,
157
+ lo as useTableContext,
158
+ no as useTableFormContext,
159
+ bo as useTableFormRender,
160
+ wo as useTableRender,
161
+ io as vTtLoading,
156
162
  rr as z
157
163
  };