@tachybase/components 0.23.18 → 0.23.20
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/lib/__builtins__/portal.js +12 -18
- package/lib/__builtins__/sort.js +6 -15
- package/lib/array-base/index.js +31 -26
- package/lib/array-cards/index.js +48 -38
- package/lib/array-collapse/index.js +69 -60
- package/lib/array-items/index.js +29 -26
- package/lib/array-table/index.js +74 -65
- package/lib/array-tabs/index.js +7 -16
- package/lib/cascader/index.js +2 -12
- package/lib/code-mirror/index.js +4 -3
- package/lib/editable/index.js +20 -8
- package/lib/form/index.js +4 -3
- package/lib/form-button-group/index.d.ts +2 -2
- package/lib/form-button-group/index.js +24 -23
- package/lib/form-collapse/index.js +8 -7
- package/lib/form-dialog/index.js +8 -7
- package/lib/form-drawer/index.js +5 -4
- package/lib/form-grid/index.js +8 -7
- package/lib/form-item/hooks/useFormItemLayout.d.ts +1 -1
- package/lib/form-item/hooks/useFormItemLayout.js +2 -12
- package/lib/form-item/index.js +82 -61
- package/lib/form-layout/index.d.ts +1 -1
- package/lib/form-layout/index.js +4 -3
- package/lib/form-step/index.js +12 -8
- package/lib/form-tab/index.js +10 -9
- package/lib/input/index.js +2 -12
- package/lib/lightbox/react-image-lightbox.d.ts +2 -2
- package/lib/lightbox/react-image-lightbox.js +135 -125
- package/lib/password/PasswordStrength.js +3 -12
- package/lib/password/index.js +32 -37
- package/lib/preview-text/index.js +32 -19
- package/lib/reset/index.js +5 -15
- package/lib/select/index.js +2 -12
- package/lib/select-table/hooks/useTitleAddon.d.ts +1 -2
- package/lib/select-table/hooks/useTitleAddon.js +4 -14
- package/lib/select-table/index.js +71 -66
- package/lib/submit/index.js +5 -15
- package/lib/tree-select/index.js +2 -12
- package/lib/upload/index.js +10 -3
- package/package.json +2 -2
|
@@ -35,7 +35,8 @@ __export(preview_text_exports, {
|
|
|
35
35
|
usePlaceholder: () => usePlaceholder
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(preview_text_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_react = require("react");
|
|
39
40
|
var import_schema = require("@tachybase/schema");
|
|
40
41
|
var import_antd = require("antd");
|
|
41
42
|
var import_classnames = __toESM(require("classnames"));
|
|
@@ -51,19 +52,31 @@ const Input = (0, import_schema.observer)((props) => {
|
|
|
51
52
|
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
52
53
|
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
53
54
|
return wrapSSR(
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style, children: [
|
|
56
|
+
props.addonBefore,
|
|
57
|
+
props.prefix,
|
|
58
|
+
usePlaceholder(props.value),
|
|
59
|
+
props.suffix,
|
|
60
|
+
props.addonAfter
|
|
61
|
+
] })
|
|
55
62
|
);
|
|
56
63
|
});
|
|
57
64
|
const NumberPicker = (0, import_schema.observer)((props) => {
|
|
58
65
|
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
59
66
|
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
60
67
|
return wrapSSR(
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
props.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style, children: [
|
|
69
|
+
props.addonBefore,
|
|
70
|
+
props.prefix,
|
|
71
|
+
usePlaceholder(
|
|
72
|
+
props.formatter ? props.formatter(String(props.value), {
|
|
73
|
+
userTyping: false,
|
|
74
|
+
input: ""
|
|
75
|
+
}) : props.value
|
|
76
|
+
),
|
|
77
|
+
props["suffix"],
|
|
78
|
+
props.addonAfter
|
|
79
|
+
] })
|
|
67
80
|
);
|
|
68
81
|
});
|
|
69
82
|
const Select = (0, import_schema.observer)((props) => {
|
|
@@ -103,11 +116,11 @@ const Select = (0, import_schema.observer)((props) => {
|
|
|
103
116
|
if (!selected.length) return placeholder;
|
|
104
117
|
if (selected.length === 1) return getLabel(selected[0]);
|
|
105
118
|
return selected.map((item, key) => {
|
|
106
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tag, { children: getLabel(item) }, key);
|
|
107
120
|
});
|
|
108
121
|
}, "getLabels");
|
|
109
122
|
return wrapSSR(
|
|
110
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style, children: getLabels() })
|
|
111
124
|
);
|
|
112
125
|
});
|
|
113
126
|
const TreeSelect = (0, import_schema.observer)((props) => {
|
|
@@ -148,13 +161,13 @@ const TreeSelect = (0, import_schema.observer)((props) => {
|
|
|
148
161
|
}, "findLabel");
|
|
149
162
|
const getLabels = /* @__PURE__ */ __name(() => {
|
|
150
163
|
const selected = getSelected();
|
|
151
|
-
if (!(selected == null ? void 0 : selected.length)) return /* @__PURE__ */
|
|
164
|
+
if (!(selected == null ? void 0 : selected.length)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tag, { children: placeholder });
|
|
152
165
|
return selected.map(({ value, label }, key) => {
|
|
153
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tag, { children: findLabel(value, dataSource, props.treeNodeLabelProp) || label || placeholder }, key);
|
|
154
167
|
});
|
|
155
168
|
}, "getLabels");
|
|
156
169
|
return wrapSSR(
|
|
157
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style, children: getLabels() })
|
|
158
171
|
);
|
|
159
172
|
});
|
|
160
173
|
const Cascader = (0, import_schema.observer)((props) => {
|
|
@@ -195,7 +208,7 @@ const Cascader = (0, import_schema.observer)((props) => {
|
|
|
195
208
|
return labels || placeholder;
|
|
196
209
|
}, "getLabels");
|
|
197
210
|
return wrapSSR(
|
|
198
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style, children: getLabels() })
|
|
199
212
|
);
|
|
200
213
|
});
|
|
201
214
|
const DatePicker = /* @__PURE__ */ __name((props) => {
|
|
@@ -205,7 +218,7 @@ const DatePicker = /* @__PURE__ */ __name((props) => {
|
|
|
205
218
|
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
206
219
|
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
207
220
|
}, "getLabels");
|
|
208
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, props.className), children: getLabels() });
|
|
209
222
|
}, "DatePicker");
|
|
210
223
|
const DateRangePicker = /* @__PURE__ */ __name((props) => {
|
|
211
224
|
const placeholder = usePlaceholder();
|
|
@@ -214,7 +227,7 @@ const DateRangePicker = /* @__PURE__ */ __name((props) => {
|
|
|
214
227
|
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
215
228
|
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
216
229
|
}, "getLabels");
|
|
217
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style, children: getLabels() });
|
|
218
231
|
}, "DateRangePicker");
|
|
219
232
|
const TimePicker = /* @__PURE__ */ __name((props) => {
|
|
220
233
|
const placeholder = usePlaceholder();
|
|
@@ -223,7 +236,7 @@ const TimePicker = /* @__PURE__ */ __name((props) => {
|
|
|
223
236
|
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
224
237
|
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
225
238
|
}, "getLabels");
|
|
226
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style, children: getLabels() });
|
|
227
240
|
}, "TimePicker");
|
|
228
241
|
const TimeRangePicker = /* @__PURE__ */ __name((props) => {
|
|
229
242
|
const placeholder = usePlaceholder();
|
|
@@ -232,12 +245,12 @@ const TimeRangePicker = /* @__PURE__ */ __name((props) => {
|
|
|
232
245
|
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
233
246
|
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
234
247
|
}, "getLabels");
|
|
235
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style, children: getLabels() });
|
|
236
249
|
}, "TimeRangePicker");
|
|
237
250
|
const InternalPreviewText = (0, import_schema.observer)(
|
|
238
251
|
(props) => {
|
|
239
252
|
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
240
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style, children: usePlaceholder(props.value) });
|
|
241
254
|
}
|
|
242
255
|
);
|
|
243
256
|
const PreviewText = Object.assign(InternalPreviewText, {
|
package/lib/reset/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var reset_exports = {};
|
|
30
20
|
__export(reset_exports, {
|
|
@@ -32,7 +22,7 @@ __export(reset_exports, {
|
|
|
32
22
|
default: () => reset_default
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(reset_exports);
|
|
35
|
-
var
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
26
|
var import_schema = require("@tachybase/schema");
|
|
37
27
|
var import_antd = require("antd");
|
|
38
28
|
const Reset = /* @__PURE__ */ __name(({
|
|
@@ -43,7 +33,7 @@ const Reset = /* @__PURE__ */ __name(({
|
|
|
43
33
|
...props
|
|
44
34
|
}) => {
|
|
45
35
|
const form = (0, import_schema.useParentForm)();
|
|
46
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
37
|
import_antd.Button,
|
|
48
38
|
{
|
|
49
39
|
...props,
|
|
@@ -55,9 +45,9 @@ const Reset = /* @__PURE__ */ __name(({
|
|
|
55
45
|
forceClear,
|
|
56
46
|
validate
|
|
57
47
|
}).then(onResetValidateSuccess).catch(onResetValidateFailed);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
},
|
|
49
|
+
children: props.children
|
|
50
|
+
}
|
|
61
51
|
);
|
|
62
52
|
}, "Reset");
|
|
63
53
|
var reset_default = Reset;
|
package/lib/select/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var select_exports = {};
|
|
29
19
|
__export(select_exports, {
|
|
@@ -31,7 +21,7 @@ __export(select_exports, {
|
|
|
31
21
|
default: () => select_default
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(select_exports);
|
|
34
|
-
var
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_schema = require("@tachybase/schema");
|
|
36
26
|
var import_icons = require("@ant-design/icons");
|
|
37
27
|
var import_antd = require("antd");
|
|
@@ -46,7 +36,7 @@ const Select = (0, import_schema.connect)(
|
|
|
46
36
|
(props, field) => {
|
|
47
37
|
return {
|
|
48
38
|
...props,
|
|
49
|
-
suffixIcon: (field == null ? void 0 : field["loading"]) || (field == null ? void 0 : field["validating"]) ? /* @__PURE__ */
|
|
39
|
+
suffixIcon: (field == null ? void 0 : field["loading"]) || (field == null ? void 0 : field["validating"]) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}) : props.suffixIcon
|
|
50
40
|
};
|
|
51
41
|
}
|
|
52
42
|
),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const useTitleAddon: (selected: any[], flatDataSource: any[], flatFilteredDataSource: any[], primaryKey: string | undefined, mode: string | undefined, disabled: boolean, readOnly: boolean, checkStrictly: boolean | undefined, onChange: (selectedRowKeys: any[], record: any[]) => any) => {
|
|
3
2
|
columnTitle?: undefined;
|
|
4
3
|
} | {
|
|
5
|
-
columnTitle: () =>
|
|
4
|
+
columnTitle: () => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
};
|
|
7
6
|
export { useTitleAddon };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,21 +15,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var useTitleAddon_exports = {};
|
|
30
20
|
__export(useTitleAddon_exports, {
|
|
31
21
|
useTitleAddon: () => useTitleAddon
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(useTitleAddon_exports);
|
|
34
|
-
var
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_antd = require("antd");
|
|
36
26
|
var import_utils = require("../utils");
|
|
37
27
|
const newCheckbox = /* @__PURE__ */ __name((selected, flatDataSource, flatFilteredDataSource, primaryKey, disabled, readOnly, checkStrictly, onChange) => () => {
|
|
@@ -56,15 +46,15 @@ const newCheckbox = /* @__PURE__ */ __name((selected, flatDataSource, flatFilter
|
|
|
56
46
|
onChange == null ? void 0 : onChange(newSelected);
|
|
57
47
|
}
|
|
58
48
|
}, "onInnerChange");
|
|
59
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
50
|
import_antd.Checkbox,
|
|
61
51
|
{
|
|
62
|
-
key: "titleAddons",
|
|
63
52
|
disabled,
|
|
64
53
|
checked,
|
|
65
54
|
indeterminate,
|
|
66
55
|
onChange: onInnerChange
|
|
67
|
-
}
|
|
56
|
+
},
|
|
57
|
+
"titleAddons"
|
|
68
58
|
);
|
|
69
59
|
}, "newCheckbox");
|
|
70
60
|
const useTitleAddon = /* @__PURE__ */ __name((selected, flatDataSource, flatFilteredDataSource, primaryKey, mode, disabled, readOnly, checkStrictly, onChange) => {
|
|
@@ -32,6 +32,7 @@ __export(select_table_exports, {
|
|
|
32
32
|
default: () => select_table_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(select_table_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_antd = require("antd");
|
|
@@ -250,79 +251,83 @@ const InternalSelectTable = (0, import_schema.observer)((props) => {
|
|
|
250
251
|
);
|
|
251
252
|
const modeAsType = (_b = { multiple: "checkbox", single: "radio" }) == null ? void 0 : _b[mode || ""];
|
|
252
253
|
return wrapSSR(
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(prefixCls, hashId), children: [
|
|
255
|
+
showSearch ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
256
|
+
Search,
|
|
257
|
+
{
|
|
258
|
+
...searchProps,
|
|
259
|
+
className: (0, import_classnames.default)(`${prefixCls}-search`, searchProps == null ? void 0 : searchProps.className),
|
|
260
|
+
style: { width: "100%", ...searchProps == null ? void 0 : searchProps.style },
|
|
261
|
+
onSearch: onInnerSearch,
|
|
262
|
+
onChange: (e) => onInnerSearch(e.target.value),
|
|
263
|
+
disabled,
|
|
264
|
+
readOnly,
|
|
265
|
+
size: searchSize,
|
|
266
|
+
loading
|
|
267
|
+
}
|
|
268
|
+
) : null,
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
270
|
+
import_antd.Table,
|
|
271
|
+
{
|
|
272
|
+
...otherTableProps,
|
|
273
|
+
className: (0, import_classnames.default)(`${prefixCls}-table`, className),
|
|
274
|
+
dataSource: readPretty ? readPrettyDataSource : orderedFilteredDataSource,
|
|
275
|
+
rowSelection: readPretty ? void 0 : {
|
|
276
|
+
...rowSelection,
|
|
277
|
+
...titleAddon,
|
|
278
|
+
getCheckboxProps: /* @__PURE__ */ __name((record) => {
|
|
279
|
+
var _a2;
|
|
280
|
+
return {
|
|
281
|
+
...(_a2 = rowSelection == null ? void 0 : rowSelection.getCheckboxProps) == null ? void 0 : _a2.call(rowSelection, record),
|
|
282
|
+
disabled: disabled || (record == null ? void 0 : record.disabled)
|
|
283
|
+
};
|
|
284
|
+
}, "getCheckboxProps"),
|
|
285
|
+
// antd
|
|
286
|
+
...(rowSelection == null ? void 0 : rowSelection.checkStrictly) !== false ? {} : {
|
|
287
|
+
renderCell: /* @__PURE__ */ __name((checked, record, index, originNode) => {
|
|
288
|
+
return import_react.default.cloneElement(originNode, {
|
|
289
|
+
indeterminate: (0, import_hooks.getIndeterminate)(record, flatDataSource, selected, primaryKey)
|
|
290
|
+
});
|
|
291
|
+
}, "renderCell")
|
|
292
|
+
},
|
|
293
|
+
selectedRowKeys: selected,
|
|
294
|
+
onChange: (rowSelection == null ? void 0 : rowSelection.checkStrictly) !== false ? onInnerChange : onSlacklyChange,
|
|
295
|
+
type: modeAsType,
|
|
296
|
+
preserveSelectedRowKeys: true,
|
|
297
|
+
checkStrictly: true
|
|
298
|
+
},
|
|
299
|
+
columns: props.columns || columns,
|
|
300
|
+
rowKey: primaryKey,
|
|
301
|
+
loading,
|
|
302
|
+
size: tableSize,
|
|
303
|
+
onRow: (record) => {
|
|
276
304
|
var _a2;
|
|
305
|
+
const onRowResult = (_a2 = otherTableProps.onRow) == null ? void 0 : _a2.call(otherTableProps, record);
|
|
277
306
|
return {
|
|
278
|
-
...
|
|
279
|
-
|
|
307
|
+
...onRowResult,
|
|
308
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
309
|
+
var _a3;
|
|
310
|
+
(_a3 = onRowResult == null ? void 0 : onRowResult.onClick) == null ? void 0 : _a3.call(onRowResult, e);
|
|
311
|
+
onRowClick(record);
|
|
312
|
+
}, "onClick")
|
|
280
313
|
};
|
|
281
|
-
}, "getCheckboxProps"),
|
|
282
|
-
// antd
|
|
283
|
-
...(rowSelection == null ? void 0 : rowSelection.checkStrictly) !== false ? {} : {
|
|
284
|
-
renderCell: /* @__PURE__ */ __name((checked, record, index, originNode) => {
|
|
285
|
-
return import_react.default.cloneElement(originNode, {
|
|
286
|
-
indeterminate: (0, import_hooks.getIndeterminate)(record, flatDataSource, selected, primaryKey)
|
|
287
|
-
});
|
|
288
|
-
}, "renderCell")
|
|
289
314
|
},
|
|
290
|
-
|
|
291
|
-
onChange: (rowSelection == null ? void 0 : rowSelection.checkStrictly) !== false ? onInnerChange : onSlacklyChange,
|
|
292
|
-
type: modeAsType,
|
|
293
|
-
preserveSelectedRowKeys: true,
|
|
294
|
-
checkStrictly: true
|
|
295
|
-
},
|
|
296
|
-
columns: props.columns || columns,
|
|
297
|
-
rowKey: primaryKey,
|
|
298
|
-
loading,
|
|
299
|
-
size: tableSize,
|
|
300
|
-
onRow: (record) => {
|
|
301
|
-
var _a2;
|
|
302
|
-
const onRowResult = (_a2 = otherTableProps.onRow) == null ? void 0 : _a2.call(otherTableProps, record);
|
|
303
|
-
return {
|
|
304
|
-
...onRowResult,
|
|
305
|
-
onClick: /* @__PURE__ */ __name((e) => {
|
|
306
|
-
var _a3;
|
|
307
|
-
(_a3 = onRowResult == null ? void 0 : onRowResult.onClick) == null ? void 0 : _a3.call(onRowResult, e);
|
|
308
|
-
onRowClick(record);
|
|
309
|
-
}, "onClick")
|
|
310
|
-
};
|
|
315
|
+
children: ""
|
|
311
316
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
})
|
|
322
|
-
})
|
|
317
|
+
),
|
|
318
|
+
sources.map((column, key) => {
|
|
319
|
+
if (!isColumnComponent(column.schema)) return;
|
|
320
|
+
return import_react.default.createElement(import_schema.RecursionField, {
|
|
321
|
+
name: column.name,
|
|
322
|
+
schema: column.schema,
|
|
323
|
+
onlyRenderSelf: true,
|
|
324
|
+
key
|
|
325
|
+
});
|
|
326
|
+
})
|
|
327
|
+
] })
|
|
323
328
|
);
|
|
324
329
|
});
|
|
325
|
-
const TableColumn = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
|
330
|
+
const TableColumn = /* @__PURE__ */ __name(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {}), "TableColumn");
|
|
326
331
|
const SelectTable = Object.assign(InternalSelectTable, {
|
|
327
332
|
Column: TableColumn
|
|
328
333
|
});
|
package/lib/submit/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var submit_exports = {};
|
|
29
19
|
__export(submit_exports, {
|
|
@@ -31,13 +21,13 @@ __export(submit_exports, {
|
|
|
31
21
|
default: () => submit_default
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(submit_exports);
|
|
34
|
-
var
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_schema = require("@tachybase/schema");
|
|
36
26
|
var import_antd = require("antd");
|
|
37
27
|
const Submit = (0, import_schema.observer)(
|
|
38
28
|
({ onSubmit, onSubmitFailed, onSubmitSuccess, ...props }) => {
|
|
39
29
|
const form = (0, import_schema.useParentForm)();
|
|
40
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
31
|
import_antd.Button,
|
|
42
32
|
{
|
|
43
33
|
htmlType: onSubmit ? "button" : "submit",
|
|
@@ -51,9 +41,9 @@ const Submit = (0, import_schema.observer)(
|
|
|
51
41
|
if (onSubmit) {
|
|
52
42
|
form.submit(onSubmit).then(onSubmitSuccess).catch(onSubmitFailed);
|
|
53
43
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
},
|
|
45
|
+
children: props.children
|
|
46
|
+
}
|
|
57
47
|
);
|
|
58
48
|
},
|
|
59
49
|
{
|
package/lib/tree-select/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var tree_select_exports = {};
|
|
29
19
|
__export(tree_select_exports, {
|
|
@@ -31,7 +21,7 @@ __export(tree_select_exports, {
|
|
|
31
21
|
default: () => tree_select_default
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(tree_select_exports);
|
|
34
|
-
var
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_schema = require("@tachybase/schema");
|
|
36
26
|
var import_icons = require("@ant-design/icons");
|
|
37
27
|
var import_antd = require("antd");
|
|
@@ -45,7 +35,7 @@ const TreeSelect = (0, import_schema.connect)(
|
|
|
45
35
|
(props, field) => {
|
|
46
36
|
return {
|
|
47
37
|
...props,
|
|
48
|
-
suffixIcon: (field == null ? void 0 : field["loading"]) || (field == null ? void 0 : field["validating"]) ? /* @__PURE__ */
|
|
38
|
+
suffixIcon: (field == null ? void 0 : field["loading"]) || (field == null ? void 0 : field["validating"]) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}) : props.suffixIcon
|
|
49
39
|
};
|
|
50
40
|
}
|
|
51
41
|
),
|
package/lib/upload/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(upload_exports, {
|
|
|
32
32
|
default: () => upload_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(upload_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_icons = require("@ant-design/icons");
|
|
@@ -131,13 +132,16 @@ function useUploadProps({ serviceErrorMessage, ...props }) {
|
|
|
131
132
|
__name(useUploadProps, "useUploadProps");
|
|
132
133
|
const getPlaceholder = /* @__PURE__ */ __name((props) => {
|
|
133
134
|
if (props.listType !== "picture-card") {
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Button, { children: [
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UploadOutlined, {}),
|
|
137
|
+
props.textContent
|
|
138
|
+
] });
|
|
135
139
|
}
|
|
136
140
|
return null;
|
|
137
141
|
}, "getPlaceholder");
|
|
138
142
|
const Upload = (0, import_schema.connect)(
|
|
139
143
|
(props) => {
|
|
140
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Upload, { ...useUploadProps(props), children: props.children || getPlaceholder(props) });
|
|
141
145
|
},
|
|
142
146
|
(0, import_schema.mapProps)({
|
|
143
147
|
value: "fileList"
|
|
@@ -145,7 +149,10 @@ const Upload = (0, import_schema.connect)(
|
|
|
145
149
|
);
|
|
146
150
|
const Dragger = (0, import_schema.connect)(
|
|
147
151
|
(props) => {
|
|
148
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_builtins.usePrefixCls)("upload-dragger"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Upload.Dragger, { ...useUploadProps(props), children: props.children || /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.InboxOutlined, {}) }),
|
|
154
|
+
props.textContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "ant-upload-text", children: props.textContent })
|
|
155
|
+
] }) }) });
|
|
149
156
|
},
|
|
150
157
|
(0, import_schema.mapProps)({
|
|
151
158
|
value: "fileList"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/components",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.20",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prop-types": "^15.8.1",
|
|
18
18
|
"react-modal": "^3.16.3",
|
|
19
19
|
"react-sticky-box": "^1.0.2",
|
|
20
|
-
"@tachybase/schema": "0.23.
|
|
20
|
+
"@tachybase/schema": "0.23.20"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"rc-cascader": "3.31.0",
|