@tachybase/components 0.23.18 → 0.23.22
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
package/lib/array-items/index.js
CHANGED
|
@@ -32,7 +32,7 @@ __export(array_items_exports, {
|
|
|
32
32
|
default: () => array_items_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(array_items_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_schema = require("@tachybase/schema");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_builtins = require("../__builtins__");
|
|
@@ -42,14 +42,14 @@ const SortableItem = (0, import_builtins.SortableElement)((props) => {
|
|
|
42
42
|
const prefixCls = (0, import_builtins.usePrefixCls)("formily-array-items");
|
|
43
43
|
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
44
44
|
return wrapSSR(
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, className: (0, import_classnames.default)(`${prefixCls}-item`, hashId, props.className), children: props.children })
|
|
46
46
|
);
|
|
47
47
|
});
|
|
48
48
|
const SortableList = (0, import_builtins.SortableContainer)((props) => {
|
|
49
49
|
const prefixCls = (0, import_builtins.usePrefixCls)("formily-array-items");
|
|
50
50
|
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
51
51
|
return wrapSSR(
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, className: (0, import_classnames.default)(`${prefixCls}-list`, hashId, props.className), children: props.children })
|
|
53
53
|
);
|
|
54
54
|
});
|
|
55
55
|
const isAdditionComponent = /* @__PURE__ */ __name((schema) => {
|
|
@@ -60,7 +60,7 @@ const useAddition = /* @__PURE__ */ __name(() => {
|
|
|
60
60
|
const schema = (0, import_schema.useFieldSchema)();
|
|
61
61
|
return schema.reduceProperties((addition, schema2, key) => {
|
|
62
62
|
if (isAdditionComponent(schema2)) {
|
|
63
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { schema: schema2, name: key });
|
|
64
64
|
}
|
|
65
65
|
return addition;
|
|
66
66
|
}, null);
|
|
@@ -74,40 +74,43 @@ const InternalArrayItems = (0, import_schema.observer)((props) => {
|
|
|
74
74
|
const dataSource = Array.isArray(field.value) ? field.value : [];
|
|
75
75
|
if (!schema) throw new Error("can not found schema object");
|
|
76
76
|
return wrapSSR(
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
}, className: (0, import_classnames.default)(prefixCls, hashId, props.className)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_array_base.ArrayBase, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...props, onChange: () => {
|
|
78
|
+
}, className: (0, import_classnames.default)(prefixCls, hashId, props.className), children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
SortableList,
|
|
81
|
+
{
|
|
82
|
+
list: dataSource.slice(),
|
|
83
|
+
className: `${prefixCls}-sort-helper`,
|
|
84
|
+
onSortEnd: (event) => {
|
|
85
|
+
const { oldIndex, newIndex } = event;
|
|
86
|
+
field.move(oldIndex, newIndex);
|
|
87
|
+
},
|
|
88
|
+
children: dataSource == null ? void 0 : dataSource.map((item, index) => {
|
|
89
|
+
const items = Array.isArray(schema.items) ? schema.items[index] || schema.items[0] : schema.items;
|
|
90
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_array_base.ArrayBase.Item, { index, record: () => {
|
|
91
|
+
var _a;
|
|
92
|
+
return (_a = field.value) == null ? void 0 : _a[index];
|
|
93
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SortableItem, { lockAxis: "y", index, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-item-inner`, children: items ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { schema: items, name: index }) : null }) }, `item-${index}`) }, index);
|
|
94
|
+
})
|
|
86
95
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return /* @__PURE__ */ import_react.default.createElement(import_array_base.ArrayBase.Item, { key: index, index, record: () => {
|
|
91
|
-
var _a;
|
|
92
|
-
return (_a = field.value) == null ? void 0 : _a[index];
|
|
93
|
-
} }, /* @__PURE__ */ import_react.default.createElement(SortableItem, { key: `item-${index}`, lockAxis: "y", index }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-inner` }, items ? /* @__PURE__ */ import_react.default.createElement(import_schema.RecursionField, { schema: items, name: index }) : null)));
|
|
94
|
-
})
|
|
95
|
-
), addition))
|
|
96
|
+
),
|
|
97
|
+
addition
|
|
98
|
+
] }) })
|
|
96
99
|
);
|
|
97
100
|
});
|
|
98
101
|
const Item = /* @__PURE__ */ __name((props) => {
|
|
99
102
|
const prefixCls = (0, import_builtins.usePrefixCls)("formily-array-items");
|
|
100
103
|
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
101
104
|
return wrapSSR(
|
|
102
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
106
|
"div",
|
|
104
107
|
{
|
|
105
108
|
...props,
|
|
106
109
|
onChange: () => {
|
|
107
110
|
},
|
|
108
|
-
className: (0, import_classnames.default)(`${prefixCls}-${props.type || "card"}`, hashId, props.className)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
className: (0, import_classnames.default)(`${prefixCls}-${props.type || "card"}`, hashId, props.className),
|
|
112
|
+
children: props.children
|
|
113
|
+
}
|
|
111
114
|
)
|
|
112
115
|
);
|
|
113
116
|
}, "Item");
|
package/lib/array-table/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(array_table_exports, {
|
|
|
32
32
|
default: () => array_table_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(array_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");
|
|
@@ -39,8 +40,8 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
39
40
|
var import_builtins = require("../__builtins__");
|
|
40
41
|
var import_array_base = require("../array-base");
|
|
41
42
|
var import_style = __toESM(require("./style"));
|
|
42
|
-
const SortableRow = (0, import_builtins.SortableElement)((props) => /* @__PURE__ */
|
|
43
|
-
const SortableBody = (0, import_builtins.SortableContainer)((props) => /* @__PURE__ */
|
|
43
|
+
const SortableRow = (0, import_builtins.SortableElement)((props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { ...props }));
|
|
44
|
+
const SortableBody = (0, import_builtins.SortableContainer)((props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { ...props }));
|
|
44
45
|
const isColumnComponent = /* @__PURE__ */ __name((schema) => {
|
|
45
46
|
var _a;
|
|
46
47
|
return ((_a = schema["x-component"]) == null ? void 0 : _a.indexOf("Column")) > -1;
|
|
@@ -105,10 +106,10 @@ const useArrayTableColumns = /* @__PURE__ */ __name((dataSource, field, sources)
|
|
|
105
106
|
dataIndex: name,
|
|
106
107
|
render: /* @__PURE__ */ __name((value, record) => {
|
|
107
108
|
const index = dataSource.indexOf(record);
|
|
108
|
-
const children = /* @__PURE__ */
|
|
109
|
+
const children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_array_base.ArrayBase.Item, { index, record: () => {
|
|
109
110
|
var _a;
|
|
110
111
|
return (_a = field == null ? void 0 : field.value) == null ? void 0 : _a[index];
|
|
111
|
-
}
|
|
112
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { schema, name: index, onlyRenderProperties: true }) });
|
|
112
113
|
return children;
|
|
113
114
|
}, "render")
|
|
114
115
|
});
|
|
@@ -118,7 +119,7 @@ const useAddition = /* @__PURE__ */ __name(() => {
|
|
|
118
119
|
const schema = (0, import_schema.useFieldSchema)();
|
|
119
120
|
return schema.reduceProperties((addition, schema2, key) => {
|
|
120
121
|
if (isAdditionComponent(schema2)) {
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { schema: schema2, name: key });
|
|
122
123
|
}
|
|
123
124
|
return addition;
|
|
124
125
|
}, null);
|
|
@@ -147,13 +148,13 @@ const StatusSelect = (0, import_schema.observer)(
|
|
|
147
148
|
return currentIndex >= startIndex && currentIndex <= endIndex;
|
|
148
149
|
});
|
|
149
150
|
return {
|
|
150
|
-
label: hasError ? /* @__PURE__ */
|
|
151
|
+
label: hasError ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Badge, { dot: true, children: label }) : label,
|
|
151
152
|
value
|
|
152
153
|
};
|
|
153
154
|
});
|
|
154
155
|
const width = String(options == null ? void 0 : options.length).length * 15;
|
|
155
156
|
return wrapSSR(
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
158
|
import_antd.Select,
|
|
158
159
|
{
|
|
159
160
|
value: props.value,
|
|
@@ -212,38 +213,41 @@ const ArrayTablePagination = /* @__PURE__ */ __name((props) => {
|
|
|
212
213
|
}, [totalPage, current]);
|
|
213
214
|
const renderPagination = /* @__PURE__ */ __name(() => {
|
|
214
215
|
if (totalPage <= 1) return;
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(`${prefixCls}-pagination`, hashId), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
218
|
+
StatusSelect,
|
|
219
|
+
{
|
|
220
|
+
value: current,
|
|
221
|
+
pageSize,
|
|
222
|
+
onChange: handleChange,
|
|
223
|
+
options: pages,
|
|
224
|
+
notFoundContent: false
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
import_antd.Pagination,
|
|
229
|
+
{
|
|
230
|
+
...props,
|
|
231
|
+
pageSize,
|
|
232
|
+
current,
|
|
233
|
+
total: dataSource.length,
|
|
234
|
+
size,
|
|
235
|
+
showSizeChanger: false,
|
|
236
|
+
onChange: handleChange
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] }) });
|
|
236
240
|
}, "renderPagination");
|
|
237
241
|
return wrapSSR(
|
|
238
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PaginationContext.Provider, { value: { totalPage, pageSize, changePage: handleChange }, children: (_a = props.children) == null ? void 0 : _a.call(props, dataSource == null ? void 0 : dataSource.slice(startIndex, endIndex + 1), renderPagination(), {
|
|
239
243
|
startIndex
|
|
240
|
-
})))
|
|
244
|
+
}) }) })
|
|
241
245
|
);
|
|
242
246
|
}, "ArrayTablePagination");
|
|
243
247
|
const RowComp = /* @__PURE__ */ __name((props) => {
|
|
244
248
|
const prefixCls = (0, import_builtins.usePrefixCls)("formily-array-table");
|
|
245
249
|
const index = props["data-row-key"] || 0;
|
|
246
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
247
251
|
SortableRow,
|
|
248
252
|
{
|
|
249
253
|
lockAxis: "y",
|
|
@@ -285,7 +289,7 @@ const InternalArrayTable = (0, import_schema.observer)((props) => {
|
|
|
285
289
|
}, "addTdStyles");
|
|
286
290
|
const genWrapperComp = (0, import_react.useCallback)(
|
|
287
291
|
(list, start) => (props2) => {
|
|
288
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
289
293
|
SortableBody,
|
|
290
294
|
{
|
|
291
295
|
...props2,
|
|
@@ -303,53 +307,58 @@ const InternalArrayTable = (0, import_schema.observer)((props) => {
|
|
|
303
307
|
field.move(oldIndex, newIndex);
|
|
304
308
|
});
|
|
305
309
|
},
|
|
306
|
-
className: (0, import_classnames.default)(`${prefixCls}-sort-helper`, props2.className)
|
|
307
|
-
|
|
308
|
-
|
|
310
|
+
className: (0, import_classnames.default)(`${prefixCls}-sort-helper`, props2.className),
|
|
311
|
+
children: props2.children
|
|
312
|
+
}
|
|
309
313
|
);
|
|
310
314
|
},
|
|
311
315
|
[field]
|
|
312
316
|
);
|
|
313
317
|
return wrapSSR(
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
return /* @__PURE__ */
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrayTablePagination, { ...pagination, dataSource, children: (dataSource2, pager, { startIndex }) => {
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: (0, import_classnames.default)(prefixCls, hashId), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_array_base.ArrayBase, { children: [
|
|
320
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
321
|
+
import_antd.Table,
|
|
322
|
+
{
|
|
323
|
+
size: "small",
|
|
324
|
+
bordered: true,
|
|
325
|
+
rowKey: defaultRowKey,
|
|
326
|
+
...props,
|
|
327
|
+
onChange: () => {
|
|
328
|
+
},
|
|
329
|
+
pagination: false,
|
|
330
|
+
columns,
|
|
331
|
+
dataSource: dataSource2,
|
|
332
|
+
components: {
|
|
333
|
+
body: {
|
|
334
|
+
wrapper: genWrapperComp(dataSource2, startIndex),
|
|
335
|
+
row: RowComp
|
|
336
|
+
}
|
|
331
337
|
}
|
|
332
338
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { marginTop: 5, marginBottom: 5 }, children: pager }),
|
|
341
|
+
sources.map((column, key) => {
|
|
342
|
+
if (!isColumnComponent(column.schema)) return;
|
|
343
|
+
return import_react.default.createElement(import_schema.RecursionField, {
|
|
344
|
+
name: column.name,
|
|
345
|
+
schema: column.schema,
|
|
346
|
+
onlyRenderSelf: true,
|
|
347
|
+
key
|
|
348
|
+
});
|
|
349
|
+
}),
|
|
350
|
+
addition
|
|
351
|
+
] }) });
|
|
352
|
+
} })
|
|
344
353
|
);
|
|
345
354
|
});
|
|
346
355
|
const Column = /* @__PURE__ */ __name(() => {
|
|
347
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, {});
|
|
348
357
|
}, "Column");
|
|
349
358
|
const Addition = /* @__PURE__ */ __name((props) => {
|
|
350
359
|
const array = import_array_base.ArrayBase.useArray();
|
|
351
360
|
const { totalPage = 0, pageSize = 10, changePage } = usePagination();
|
|
352
|
-
return /* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
353
362
|
import_array_base.ArrayBase.Addition,
|
|
354
363
|
{
|
|
355
364
|
...props,
|
package/lib/array-tabs/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 array_tabs_exports = {};
|
|
30
20
|
__export(array_tabs_exports, {
|
|
@@ -32,7 +22,8 @@ __export(array_tabs_exports, {
|
|
|
32
22
|
default: () => array_tabs_default
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(array_tabs_exports);
|
|
35
|
-
var
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
36
27
|
var import_schema = require("@tachybase/schema");
|
|
37
28
|
var import_antd = require("antd");
|
|
38
29
|
const FeedbackBadge = (0, import_schema.observer)((props) => {
|
|
@@ -43,9 +34,9 @@ const FeedbackBadge = (0, import_schema.observer)((props) => {
|
|
|
43
34
|
return (_a = error.address) == null ? void 0 : _a.includes(`${field.address}.${props.index}`);
|
|
44
35
|
});
|
|
45
36
|
if (errors.length) {
|
|
46
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Badge, { size: "small", className: "errors-badge", count: errors.length, children: tab });
|
|
47
38
|
}
|
|
48
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: tab });
|
|
49
40
|
});
|
|
50
41
|
const ArrayTabs = (0, import_schema.observer)((props) => {
|
|
51
42
|
const field = (0, import_schema.useField)();
|
|
@@ -71,7 +62,7 @@ const ArrayTabs = (0, import_schema.observer)((props) => {
|
|
|
71
62
|
field.remove(index);
|
|
72
63
|
}
|
|
73
64
|
}, "onEdit");
|
|
74
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
66
|
import_antd.Tabs,
|
|
76
67
|
{
|
|
77
68
|
...props,
|
|
@@ -86,10 +77,10 @@ const ArrayTabs = (0, import_schema.observer)((props) => {
|
|
|
86
77
|
const key = `tab-${index}`;
|
|
87
78
|
return {
|
|
88
79
|
key,
|
|
89
|
-
label: /* @__PURE__ */
|
|
80
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FeedbackBadge, { index }),
|
|
90
81
|
forceRender: true,
|
|
91
82
|
closable: index !== 0,
|
|
92
|
-
children: items ? /* @__PURE__ */
|
|
83
|
+
children: items ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { schema: items, name: index }) : null
|
|
93
84
|
};
|
|
94
85
|
})
|
|
95
86
|
}
|
package/lib/cascader/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 cascader_exports = {};
|
|
29
19
|
__export(cascader_exports, {
|
|
@@ -31,7 +21,7 @@ __export(cascader_exports, {
|
|
|
31
21
|
default: () => cascader_default
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(cascader_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 Cascader = (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/code-mirror/index.js
CHANGED
|
@@ -31,7 +31,8 @@ __export(code_mirror_exports, {
|
|
|
31
31
|
CodeMirror: () => CodeMirror
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(code_mirror_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = require("react");
|
|
35
36
|
var import_schema = require("@tachybase/schema");
|
|
36
37
|
var import_react2 = __toESM(require("@monaco-editor/react"));
|
|
37
38
|
import_react2.loader.config({ paths: { vs: "https://assets.tachybase.com/monaco-editor@0.52.0/min/vs" } });
|
|
@@ -45,7 +46,7 @@ const CodeMirror = (0, import_schema.connect)(
|
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
}, [monaco]);
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
50
|
import_react2.default,
|
|
50
51
|
{
|
|
51
52
|
options: { readOnly: !!otherProps.disabled },
|
|
@@ -70,7 +71,7 @@ const CodeMirror = (0, import_schema.connect)(
|
|
|
70
71
|
if (value == null) {
|
|
71
72
|
return;
|
|
72
73
|
}
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
75
|
import_react2.default,
|
|
75
76
|
{
|
|
76
77
|
options: { readOnly: true },
|
package/lib/editable/index.js
CHANGED
|
@@ -32,7 +32,8 @@ __export(editable_exports, {
|
|
|
32
32
|
default: () => editable_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(editable_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_icons = require("@ant-design/icons");
|
|
38
39
|
var import_antd = require("antd");
|
|
@@ -94,11 +95,14 @@ const InternalEditable = (0, import_schema.observer)((props) => {
|
|
|
94
95
|
}, "recover");
|
|
95
96
|
const renderEditHelper = /* @__PURE__ */ __name(() => {
|
|
96
97
|
if (editable) return;
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form_item.BaseItem, { ...props, ...itemProps, children: [
|
|
99
|
+
pattern === "editable" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditOutlined, { className: `${prefixCls}-edit-btn` }),
|
|
100
|
+
pattern !== "editable" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MessageOutlined, { className: `${prefixCls}-edit-btn` })
|
|
101
|
+
] });
|
|
98
102
|
}, "renderEditHelper");
|
|
99
103
|
const renderCloseHelper = /* @__PURE__ */ __name(() => {
|
|
100
104
|
if (!editable) return;
|
|
101
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_item.BaseItem, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseOutlined, { className: `${prefixCls}-close-btn` }) });
|
|
102
106
|
}, "renderCloseHelper");
|
|
103
107
|
(0, import_builtins.useClickAway)((e) => {
|
|
104
108
|
const target = e.target;
|
|
@@ -125,7 +129,11 @@ const InternalEditable = (0, import_schema.observer)((props) => {
|
|
|
125
129
|
}, "onClick");
|
|
126
130
|
ref.current = editable;
|
|
127
131
|
return wrapSSR(
|
|
128
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(prefixCls, hashId), ref: innerRef, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-content`, children: [
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_item.BaseItem, { ...props, ...itemProps, children: props.children }),
|
|
134
|
+
renderEditHelper(),
|
|
135
|
+
renderCloseHelper()
|
|
136
|
+
] }) })
|
|
129
137
|
);
|
|
130
138
|
});
|
|
131
139
|
const Popover = (0, import_schema.observer)((props) => {
|
|
@@ -151,7 +159,7 @@ const Popover = (0, import_schema.observer)((props) => {
|
|
|
151
159
|
setOpen(true);
|
|
152
160
|
}, "openPopover");
|
|
153
161
|
return wrapSSR(
|
|
154
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
155
163
|
import_antd.Popover,
|
|
156
164
|
{
|
|
157
165
|
...props,
|
|
@@ -167,9 +175,13 @@ const Popover = (0, import_schema.observer)((props) => {
|
|
|
167
175
|
} else {
|
|
168
176
|
closePopover();
|
|
169
177
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
},
|
|
179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_item.BaseItem, { className: `${prefixCls}-trigger`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-content`, children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-preview`, children: props.title || field.title }),
|
|
181
|
+
pattern === "editable" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditOutlined, { className: `${prefixCls}-edit-btn` }),
|
|
182
|
+
pattern !== "editable" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MessageOutlined, { className: `${prefixCls}-edit-btn` })
|
|
183
|
+
] }) }) })
|
|
184
|
+
}
|
|
173
185
|
)
|
|
174
186
|
);
|
|
175
187
|
});
|
package/lib/form/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(form_exports, {
|
|
|
32
32
|
default: () => form_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(form_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_form_layout = require("../form-layout");
|
|
@@ -45,7 +46,7 @@ const Form = /* @__PURE__ */ __name(({
|
|
|
45
46
|
...props
|
|
46
47
|
}) => {
|
|
47
48
|
const top = (0, import_schema.useParentForm)();
|
|
48
|
-
const renderContent = /* @__PURE__ */ __name((form2) => /* @__PURE__ */
|
|
49
|
+
const renderContent = /* @__PURE__ */ __name((form2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecordScope, { getRecord: () => (0, import_schema.isForm)(form2) ? form2.values : form2.value, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preview_text.PreviewText.Placeholder, { value: previewTextPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_layout.FormLayout, { ...props, children: import_react.default.createElement(
|
|
49
50
|
component,
|
|
50
51
|
{
|
|
51
52
|
onSubmit(e) {
|
|
@@ -56,8 +57,8 @@ const Form = /* @__PURE__ */ __name(({
|
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
59
|
props.children
|
|
59
|
-
)))), "renderContent");
|
|
60
|
-
if (form) return /* @__PURE__ */
|
|
60
|
+
) }) }) }), "renderContent");
|
|
61
|
+
if (form) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.FormProvider, { form, children: renderContent(form) });
|
|
61
62
|
if (!top) throw new Error("must pass form instance by createForm");
|
|
62
63
|
return renderContent(top);
|
|
63
64
|
}, "Form");
|
|
@@ -14,14 +14,14 @@ export declare const FormButtonGroup: {
|
|
|
14
14
|
({ align, gutter, ...props }: Omit<SpaceProps, "size" | "align"> & {
|
|
15
15
|
gutter?: any;
|
|
16
16
|
align?: any;
|
|
17
|
-
}):
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
defaultProps: {
|
|
19
19
|
align: string;
|
|
20
20
|
};
|
|
21
21
|
FormItem({ gutter, ...props }: {
|
|
22
22
|
[x: string]: any;
|
|
23
23
|
gutter: any;
|
|
24
|
-
}):
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
Sticky: ({ align, ...props }: React.PropsWithChildren<IStickyProps & React.HTMLProps<HTMLDivElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
26
26
|
};
|
|
27
27
|
export default FormButtonGroup;
|