@tachybase/components 0.23.8
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/.turbo/turbo-build.log +9 -0
- package/LICENSE +201 -0
- package/lib/__builtins__/dayjs.d.ts +4 -0
- package/lib/__builtins__/dayjs.js +95 -0
- package/lib/__builtins__/hooks/index.d.ts +4 -0
- package/lib/__builtins__/hooks/index.js +27 -0
- package/lib/__builtins__/hooks/useClickAway.d.ts +5 -0
- package/lib/__builtins__/hooks/useClickAway.js +64 -0
- package/lib/__builtins__/hooks/useConfig.d.ts +1 -0
- package/lib/__builtins__/hooks/useConfig.js +31 -0
- package/lib/__builtins__/hooks/usePrefixCls.d.ts +3 -0
- package/lib/__builtins__/hooks/usePrefixCls.js +38 -0
- package/lib/__builtins__/hooks/useToken.d.ts +6 -0
- package/lib/__builtins__/hooks/useToken.js +28 -0
- package/lib/__builtins__/index.d.ts +7 -0
- package/lib/__builtins__/index.js +33 -0
- package/lib/__builtins__/loading.d.ts +1 -0
- package/lib/__builtins__/loading.js +40 -0
- package/lib/__builtins__/pickDataProps.d.ts +1 -0
- package/lib/__builtins__/pickDataProps.js +36 -0
- package/lib/__builtins__/portal.d.ts +10 -0
- package/lib/__builtins__/portal.js +89 -0
- package/lib/__builtins__/render.d.ts +9 -0
- package/lib/__builtins__/render.js +99 -0
- package/lib/__builtins__/sort.d.ts +73 -0
- package/lib/__builtins__/sort.js +126 -0
- package/lib/__builtins__/style.d.ts +23 -0
- package/lib/__builtins__/style.js +88 -0
- package/lib/array-base/index.d.ts +64 -0
- package/lib/array-base/index.js +345 -0
- package/lib/array-base/style.d.ts +2 -0
- package/lib/array-base/style.js +68 -0
- package/lib/array-cards/index.d.ts +5 -0
- package/lib/array-cards/index.js +166 -0
- package/lib/array-cards/style.d.ts +2 -0
- package/lib/array-cards/style.js +37 -0
- package/lib/array-collapse/index.d.ts +10 -0
- package/lib/array-collapse/index.js +199 -0
- package/lib/array-collapse/style.d.ts +2 -0
- package/lib/array-collapse/style.js +33 -0
- package/lib/array-items/index.d.ts +8 -0
- package/lib/array-items/index.js +122 -0
- package/lib/array-items/style.d.ts +2 -0
- package/lib/array-items/style.js +82 -0
- package/lib/array-table/index.d.ts +9 -0
- package/lib/array-table/index.js +376 -0
- package/lib/array-table/style.d.ts +2 -0
- package/lib/array-table/style.js +71 -0
- package/lib/array-tabs/index.d.ts +4 -0
- package/lib/array-tabs/index.js +102 -0
- package/lib/cascader/index.d.ts +12 -0
- package/lib/cascader/index.js +58 -0
- package/lib/checkbox/index.d.ts +5 -0
- package/lib/checkbox/index.js +51 -0
- package/lib/code-mirror/index.d.ts +3 -0
- package/lib/code-mirror/index.js +91 -0
- package/lib/date-picker/index.d.ts +2 -0
- package/lib/date-picker/index.js +70 -0
- package/lib/date-picker/style.d.ts +1 -0
- package/lib/date-picker/style.js +1 -0
- package/lib/editable/index.d.ts +8 -0
- package/lib/editable/index.js +181 -0
- package/lib/editable/style.d.ts +2 -0
- package/lib/editable/style.js +69 -0
- package/lib/form/index.d.ts +12 -0
- package/lib/form/index.js +71 -0
- package/lib/form-button-group/index.d.ts +27 -0
- package/lib/form-button-group/index.js +148 -0
- package/lib/form-button-group/style.d.ts +2 -0
- package/lib/form-button-group/style.js +41 -0
- package/lib/form-collapse/index.d.ts +28 -0
- package/lib/form-collapse/index.js +150 -0
- package/lib/form-dialog/index.d.ts +26 -0
- package/lib/form-dialog/index.js +194 -0
- package/lib/form-drawer/index.d.ts +25 -0
- package/lib/form-drawer/index.js +187 -0
- package/lib/form-grid/index.d.ts +34 -0
- package/lib/form-grid/index.js +108 -0
- package/lib/form-grid/style.d.ts +2 -0
- package/lib/form-grid/style.js +31 -0
- package/lib/form-item/hooks/index.d.ts +2 -0
- package/lib/form-item/hooks/index.js +23 -0
- package/lib/form-item/hooks/useFormItemLayout.d.ts +37 -0
- package/lib/form-item/hooks/useFormItemLayout.js +66 -0
- package/lib/form-item/hooks/useOverflow.d.ts +5 -0
- package/lib/form-item/hooks/useOverflow.js +55 -0
- package/lib/form-item/index.d.ts +11 -0
- package/lib/form-item/index.js +303 -0
- package/lib/form-item/style/animation.d.ts +2 -0
- package/lib/form-item/style/animation.js +57 -0
- package/lib/form-item/style/grid.d.ts +2 -0
- package/lib/form-item/style/grid.js +50 -0
- package/lib/form-item/style/index.d.ts +2 -0
- package/lib/form-item/style/index.js +387 -0
- package/lib/form-item/style/other.d.ts +2 -0
- package/lib/form-item/style/other.js +490 -0
- package/lib/form-item/types.d.ts +35 -0
- package/lib/form-item/types.js +15 -0
- package/lib/form-layout/index.d.ts +74 -0
- package/lib/form-layout/index.js +96 -0
- package/lib/form-layout/useResponsiveFormLayout.d.ts +17 -0
- package/lib/form-layout/useResponsiveFormLayout.js +89 -0
- package/lib/form-step/index.d.ts +27 -0
- package/lib/form-step/index.js +154 -0
- package/lib/form-tab/index.d.ts +19 -0
- package/lib/form-tab/index.js +150 -0
- package/lib/index.d.ts +38 -0
- package/lib/index.js +95 -0
- package/lib/input/index.d.ts +7 -0
- package/lib/input/index.js +57 -0
- package/lib/lightbox/constant.d.ts +21 -0
- package/lib/lightbox/constant.js +79 -0
- package/lib/lightbox/index.d.ts +2 -0
- package/lib/lightbox/index.js +37 -0
- package/lib/lightbox/interface.d.ts +43 -0
- package/lib/lightbox/interface.js +15 -0
- package/lib/lightbox/react-image-lightbox.d.ts +197 -0
- package/lib/lightbox/react-image-lightbox.js +1431 -0
- package/lib/lightbox/style.css +305 -0
- package/lib/lightbox/util.d.ts +7 -0
- package/lib/lightbox/util.js +71 -0
- package/lib/number-picker/index.d.ts +4 -0
- package/lib/number-picker/index.js +32 -0
- package/lib/password/PasswordStrength.d.ts +9 -0
- package/lib/password/PasswordStrength.js +188 -0
- package/lib/password/index.d.ts +7 -0
- package/lib/password/index.js +85 -0
- package/lib/preview-text/index.d.ts +12 -0
- package/lib/preview-text/index.js +263 -0
- package/lib/preview-text/style.d.ts +2 -0
- package/lib/preview-text/style.js +37 -0
- package/lib/radio/index.d.ts +8 -0
- package/lib/radio/index.js +51 -0
- package/lib/reset/index.d.ts +10 -0
- package/lib/reset/index.js +67 -0
- package/lib/select/index.d.ts +4 -0
- package/lib/select/index.js +59 -0
- package/lib/select-table/hooks/index.d.ts +5 -0
- package/lib/select-table/hooks/index.js +29 -0
- package/lib/select-table/hooks/useCheckSlackly.d.ts +16 -0
- package/lib/select-table/hooks/useCheckSlackly.js +57 -0
- package/lib/select-table/hooks/useFilterOptions.d.ts +3 -0
- package/lib/select-table/hooks/useFilterOptions.js +97 -0
- package/lib/select-table/hooks/useFlatOptions.d.ts +3 -0
- package/lib/select-table/hooks/useFlatOptions.js +46 -0
- package/lib/select-table/hooks/useSize.d.ts +9 -0
- package/lib/select-table/hooks/useSize.js +48 -0
- package/lib/select-table/hooks/useTitleAddon.d.ts +7 -0
- package/lib/select-table/hooks/useTitleAddon.js +90 -0
- package/lib/select-table/index.d.ts +27 -0
- package/lib/select-table/index.js +339 -0
- package/lib/select-table/style.d.ts +2 -0
- package/lib/select-table/style.js +33 -0
- package/lib/select-table/utils.d.ts +78 -0
- package/lib/select-table/utils.js +166 -0
- package/lib/space/index.d.ts +4 -0
- package/lib/space/index.js +49 -0
- package/lib/submit/index.d.ts +11 -0
- package/lib/submit/index.js +67 -0
- package/lib/switch/index.d.ts +2 -0
- package/lib/switch/index.js +44 -0
- package/lib/time-picker/index.d.ts +2 -0
- package/lib/time-picker/index.js +60 -0
- package/lib/time-picker/style.d.ts +1 -0
- package/lib/time-picker/style.js +1 -0
- package/lib/transfer/index.d.ts +2 -0
- package/lib/transfer/index.js +56 -0
- package/lib/tree-select/index.d.ts +2 -0
- package/lib/tree-select/index.js +58 -0
- package/lib/upload/index.d.ts +18 -0
- package/lib/upload/index.js +159 -0
- package/lib/upload/placeholder.d.ts +4 -0
- package/lib/upload/placeholder.js +88 -0
- package/package.json +31 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var select_table_exports = {};
|
|
30
|
+
__export(select_table_exports, {
|
|
31
|
+
SelectTable: () => SelectTable,
|
|
32
|
+
default: () => select_table_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(select_table_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_schema = require("@tachybase/schema");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_builtins = require("../__builtins__");
|
|
40
|
+
var import_hooks = require("./hooks");
|
|
41
|
+
var import_style = __toESM(require("./style"));
|
|
42
|
+
var import_utils = require("./utils");
|
|
43
|
+
const { Search } = import_antd.Input;
|
|
44
|
+
const isColumnComponent = /* @__PURE__ */ __name((schema) => {
|
|
45
|
+
var _a;
|
|
46
|
+
return ((_a = schema["x-component"]) == null ? void 0 : _a.indexOf("Column")) > -1;
|
|
47
|
+
}, "isColumnComponent");
|
|
48
|
+
const useSources = /* @__PURE__ */ __name(() => {
|
|
49
|
+
const arrayField = (0, import_schema.useField)();
|
|
50
|
+
const schema = (0, import_schema.useFieldSchema)();
|
|
51
|
+
const parseSources = /* @__PURE__ */ __name((schema2) => {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
if (isColumnComponent(schema2)) {
|
|
54
|
+
if (!((_a = schema2["x-component-props"]) == null ? void 0 : _a["dataIndex"]) && !schema2["name"]) return [];
|
|
55
|
+
const name = ((_b = schema2["x-component-props"]) == null ? void 0 : _b["dataIndex"]) || schema2["name"];
|
|
56
|
+
const field = arrayField.query(arrayField.address.concat(name)).take();
|
|
57
|
+
const columnProps = ((_c = field == null ? void 0 : field.component) == null ? void 0 : _c[1]) || schema2["x-component-props"] || {};
|
|
58
|
+
const display = (field == null ? void 0 : field.display) || schema2["x-display"];
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
name,
|
|
62
|
+
display,
|
|
63
|
+
field,
|
|
64
|
+
schema: schema2,
|
|
65
|
+
columnProps: {
|
|
66
|
+
title: (field == null ? void 0 : field.title) || columnProps.title,
|
|
67
|
+
...columnProps
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
} else if (schema2.properties) {
|
|
72
|
+
return schema2.reduceProperties((buf, schema3) => {
|
|
73
|
+
return buf.concat(parseSources(schema3));
|
|
74
|
+
}, []);
|
|
75
|
+
}
|
|
76
|
+
return [];
|
|
77
|
+
}, "parseSources");
|
|
78
|
+
const parseArrayItems = /* @__PURE__ */ __name((schema2) => {
|
|
79
|
+
if (!schema2) return [];
|
|
80
|
+
const sources = [];
|
|
81
|
+
const items = (0, import_schema.isArr)(schema2) ? schema2 : [schema2];
|
|
82
|
+
return items.reduce((columns, schema3) => {
|
|
83
|
+
const item = parseSources(schema3);
|
|
84
|
+
if (item) {
|
|
85
|
+
return columns.concat(item);
|
|
86
|
+
}
|
|
87
|
+
return columns;
|
|
88
|
+
}, sources);
|
|
89
|
+
}, "parseArrayItems");
|
|
90
|
+
const validSchema = (schema == null ? void 0 : schema.type) === "array" && (schema == null ? void 0 : schema.items) ? schema.items : schema;
|
|
91
|
+
return parseArrayItems(validSchema);
|
|
92
|
+
}, "useSources");
|
|
93
|
+
const useColumns = /* @__PURE__ */ __name((sources) => {
|
|
94
|
+
return sources.reduce((buf, { name, columnProps, schema, display }, key) => {
|
|
95
|
+
if (display !== "visible") return buf;
|
|
96
|
+
if (!isColumnComponent(schema)) return buf;
|
|
97
|
+
return buf.concat({
|
|
98
|
+
...columnProps,
|
|
99
|
+
key,
|
|
100
|
+
dataIndex: name
|
|
101
|
+
});
|
|
102
|
+
}, []);
|
|
103
|
+
}, "useColumns");
|
|
104
|
+
const addPrimaryKey = /* @__PURE__ */ __name((dataSource, rowKey, primaryKey) => dataSource.map((item) => {
|
|
105
|
+
const children = (0, import_schema.isArr)(item.children) ? addPrimaryKey(item.children, rowKey, primaryKey) : {};
|
|
106
|
+
return {
|
|
107
|
+
...item,
|
|
108
|
+
...children,
|
|
109
|
+
[primaryKey]: rowKey(item)
|
|
110
|
+
};
|
|
111
|
+
}), "addPrimaryKey");
|
|
112
|
+
const InternalSelectTable = (0, import_schema.observer)((props) => {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
const {
|
|
115
|
+
mode,
|
|
116
|
+
dataSource: propsDataSource,
|
|
117
|
+
optionAsValue,
|
|
118
|
+
valueType,
|
|
119
|
+
showSearch,
|
|
120
|
+
filterOption,
|
|
121
|
+
filterSort,
|
|
122
|
+
onSearch,
|
|
123
|
+
searchProps,
|
|
124
|
+
className,
|
|
125
|
+
value,
|
|
126
|
+
onChange,
|
|
127
|
+
rowSelection,
|
|
128
|
+
primaryKey: rowKey,
|
|
129
|
+
...otherTableProps
|
|
130
|
+
} = props;
|
|
131
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("formily-select-table", props);
|
|
132
|
+
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
133
|
+
const [searchValue, setSearchValue] = (0, import_react.useState)();
|
|
134
|
+
const field = (0, import_schema.useField)();
|
|
135
|
+
const loading = (0, import_schema.isBool)(props.loading) ? props.loading : field.loading;
|
|
136
|
+
const disabled = field.disabled;
|
|
137
|
+
const readOnly = field.readOnly;
|
|
138
|
+
const readPretty = field.readPretty;
|
|
139
|
+
const { searchSize, tableSize } = (0, import_hooks.useSize)((_a = field.decoratorProps) == null ? void 0 : _a.size, searchProps == null ? void 0 : searchProps.size, props == null ? void 0 : props.size);
|
|
140
|
+
const primaryKey = (0, import_schema.isFn)(rowKey) ? "__formily_key__" : rowKey;
|
|
141
|
+
const sources = useSources();
|
|
142
|
+
const columns = useColumns(sources);
|
|
143
|
+
let dataSource = (0, import_schema.isArr)(propsDataSource) ? propsDataSource : field.dataSource;
|
|
144
|
+
dataSource = (0, import_schema.isFn)(rowKey) ? addPrimaryKey(dataSource, rowKey, primaryKey) : dataSource;
|
|
145
|
+
const filteredDataSource = (0, import_hooks.useFilterOptions)(dataSource, searchValue, filterOption, rowSelection == null ? void 0 : rowSelection.checkStrictly);
|
|
146
|
+
const orderedFilteredDataSource = (0, import_react.useMemo)(() => {
|
|
147
|
+
if (!filterSort) {
|
|
148
|
+
return filteredDataSource;
|
|
149
|
+
}
|
|
150
|
+
return [...filteredDataSource].sort((a, b) => filterSort(a, b));
|
|
151
|
+
}, [filteredDataSource, filterSort]);
|
|
152
|
+
const flatDataSource = (0, import_hooks.useFlatOptions)(dataSource);
|
|
153
|
+
const flatFilteredDataSource = (0, import_hooks.useFlatOptions)(filteredDataSource);
|
|
154
|
+
const getWholeDataSource = /* @__PURE__ */ __name(() => {
|
|
155
|
+
if (optionAsValue && mode === "multiple" && (value == null ? void 0 : value.length)) {
|
|
156
|
+
const map = /* @__PURE__ */ new Map();
|
|
157
|
+
const arr = [...flatDataSource, ...value];
|
|
158
|
+
arr.forEach((item) => {
|
|
159
|
+
if (!primaryKey) return;
|
|
160
|
+
if (!map.has(item[primaryKey])) {
|
|
161
|
+
map.set(item[primaryKey], item);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return [...map.values()];
|
|
165
|
+
}
|
|
166
|
+
return flatDataSource;
|
|
167
|
+
}, "getWholeDataSource");
|
|
168
|
+
const selected = (0, import_utils.getUISelected)(
|
|
169
|
+
value,
|
|
170
|
+
flatDataSource,
|
|
171
|
+
primaryKey,
|
|
172
|
+
valueType,
|
|
173
|
+
optionAsValue,
|
|
174
|
+
mode,
|
|
175
|
+
rowSelection == null ? void 0 : rowSelection.checkStrictly,
|
|
176
|
+
rowKey
|
|
177
|
+
);
|
|
178
|
+
const readPrettyDataSource = (0, import_hooks.useFilterOptions)(
|
|
179
|
+
orderedFilteredDataSource,
|
|
180
|
+
selected,
|
|
181
|
+
(value2, item) => primaryKey && value2.includes(item[primaryKey])
|
|
182
|
+
);
|
|
183
|
+
const onInnerSearch = /* @__PURE__ */ __name((searchText) => {
|
|
184
|
+
const formatted = (searchText || "").trim();
|
|
185
|
+
setSearchValue(searchText);
|
|
186
|
+
onSearch == null ? void 0 : onSearch(formatted);
|
|
187
|
+
}, "onInnerSearch");
|
|
188
|
+
const onInnerChange = /* @__PURE__ */ __name((selectedRowKeys) => {
|
|
189
|
+
if (readOnly) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const wholeRecords = getWholeDataSource().filter(
|
|
193
|
+
(item) => primaryKey && selectedRowKeys.includes(item == null ? void 0 : item[primaryKey])
|
|
194
|
+
);
|
|
195
|
+
const { outputValue, outputOptions } = (0, import_utils.getOutputData)(
|
|
196
|
+
selectedRowKeys,
|
|
197
|
+
wholeRecords,
|
|
198
|
+
dataSource,
|
|
199
|
+
primaryKey,
|
|
200
|
+
valueType,
|
|
201
|
+
optionAsValue,
|
|
202
|
+
mode,
|
|
203
|
+
rowSelection == null ? void 0 : rowSelection.checkStrictly
|
|
204
|
+
);
|
|
205
|
+
onChange == null ? void 0 : onChange(outputValue, outputOptions);
|
|
206
|
+
}, "onInnerChange");
|
|
207
|
+
const onRowClick = /* @__PURE__ */ __name((record) => {
|
|
208
|
+
if (readPretty || disabled || readOnly || (record == null ? void 0 : record.disabled)) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const selectedRowKey = primaryKey ? record == null ? void 0 : record[primaryKey] : null;
|
|
212
|
+
const isSelected = selectedRowKey ? selected == null ? void 0 : selected.includes(selectedRowKey) : false;
|
|
213
|
+
let selectedRowKeys = [];
|
|
214
|
+
if (mode === "single" && selectedRowKey) {
|
|
215
|
+
selectedRowKeys = [selectedRowKey];
|
|
216
|
+
} else {
|
|
217
|
+
if (isSelected) {
|
|
218
|
+
selectedRowKeys = selected.filter((item) => item !== selectedRowKey);
|
|
219
|
+
} else {
|
|
220
|
+
selectedRowKeys = [...selected, selectedRowKey];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if ((rowSelection == null ? void 0 : rowSelection.checkStrictly) !== false) {
|
|
224
|
+
onInnerChange(selectedRowKeys);
|
|
225
|
+
} else {
|
|
226
|
+
onSlacklyChange(selectedRowKeys);
|
|
227
|
+
}
|
|
228
|
+
}, "onRowClick");
|
|
229
|
+
const onSlacklyChange = /* @__PURE__ */ __name((currentSelected) => {
|
|
230
|
+
const { selectedRowKeys } = (0, import_hooks.useCheckSlackly)(
|
|
231
|
+
currentSelected,
|
|
232
|
+
selected,
|
|
233
|
+
flatDataSource,
|
|
234
|
+
flatFilteredDataSource,
|
|
235
|
+
primaryKey,
|
|
236
|
+
rowSelection == null ? void 0 : rowSelection.checkStrictly
|
|
237
|
+
);
|
|
238
|
+
onInnerChange(selectedRowKeys);
|
|
239
|
+
}, "onSlacklyChange");
|
|
240
|
+
const titleAddon = (0, import_hooks.useTitleAddon)(
|
|
241
|
+
selected,
|
|
242
|
+
flatDataSource,
|
|
243
|
+
flatFilteredDataSource,
|
|
244
|
+
primaryKey,
|
|
245
|
+
mode,
|
|
246
|
+
disabled,
|
|
247
|
+
readOnly,
|
|
248
|
+
rowSelection == null ? void 0 : rowSelection.checkStrictly,
|
|
249
|
+
onInnerChange
|
|
250
|
+
);
|
|
251
|
+
const modeAsType = (_b = { multiple: "checkbox", single: "radio" }) == null ? void 0 : _b[mode || ""];
|
|
252
|
+
return wrapSSR(
|
|
253
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, hashId) }, showSearch ? /* @__PURE__ */ import_react.default.createElement(
|
|
254
|
+
Search,
|
|
255
|
+
{
|
|
256
|
+
...searchProps,
|
|
257
|
+
className: (0, import_classnames.default)(`${prefixCls}-search`, searchProps == null ? void 0 : searchProps.className),
|
|
258
|
+
style: { width: "100%", ...searchProps == null ? void 0 : searchProps.style },
|
|
259
|
+
onSearch: onInnerSearch,
|
|
260
|
+
onChange: (e) => onInnerSearch(e.target.value),
|
|
261
|
+
disabled,
|
|
262
|
+
readOnly,
|
|
263
|
+
size: searchSize,
|
|
264
|
+
loading
|
|
265
|
+
}
|
|
266
|
+
) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
267
|
+
import_antd.Table,
|
|
268
|
+
{
|
|
269
|
+
...otherTableProps,
|
|
270
|
+
className: (0, import_classnames.default)(`${prefixCls}-table`, className),
|
|
271
|
+
dataSource: readPretty ? readPrettyDataSource : orderedFilteredDataSource,
|
|
272
|
+
rowSelection: readPretty ? void 0 : {
|
|
273
|
+
...rowSelection,
|
|
274
|
+
...titleAddon,
|
|
275
|
+
getCheckboxProps: /* @__PURE__ */ __name((record) => {
|
|
276
|
+
var _a2;
|
|
277
|
+
return {
|
|
278
|
+
...(_a2 = rowSelection == null ? void 0 : rowSelection.getCheckboxProps) == null ? void 0 : _a2.call(rowSelection, record),
|
|
279
|
+
disabled: disabled || (record == null ? void 0 : record.disabled)
|
|
280
|
+
};
|
|
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
|
+
},
|
|
290
|
+
selectedRowKeys: selected,
|
|
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
|
+
};
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
""
|
|
314
|
+
), sources.map((column, key) => {
|
|
315
|
+
if (!isColumnComponent(column.schema)) return;
|
|
316
|
+
return import_react.default.createElement(import_schema.RecursionField, {
|
|
317
|
+
name: column.name,
|
|
318
|
+
schema: column.schema,
|
|
319
|
+
onlyRenderSelf: true,
|
|
320
|
+
key
|
|
321
|
+
});
|
|
322
|
+
}))
|
|
323
|
+
);
|
|
324
|
+
});
|
|
325
|
+
const TableColumn = /* @__PURE__ */ __name(() => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null), "TableColumn");
|
|
326
|
+
const SelectTable = Object.assign(InternalSelectTable, {
|
|
327
|
+
Column: TableColumn
|
|
328
|
+
});
|
|
329
|
+
SelectTable.defaultProps = {
|
|
330
|
+
showSearch: false,
|
|
331
|
+
valueType: "all",
|
|
332
|
+
primaryKey: "key",
|
|
333
|
+
mode: "multiple"
|
|
334
|
+
};
|
|
335
|
+
var select_table_default = SelectTable;
|
|
336
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
337
|
+
0 && (module.exports = {
|
|
338
|
+
SelectTable
|
|
339
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var style_exports = {};
|
|
19
|
+
__export(style_exports, {
|
|
20
|
+
default: () => style_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(style_exports);
|
|
23
|
+
var import_builtins = require("./../__builtins__");
|
|
24
|
+
var style_default = (0, import_builtins.genStyleHook)("select-table", (token) => {
|
|
25
|
+
const { componentCls } = token;
|
|
26
|
+
return {
|
|
27
|
+
[componentCls]: {
|
|
28
|
+
[`${componentCls}-search`]: {
|
|
29
|
+
marginBottom: 8
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取树列表某个键值的集合
|
|
3
|
+
* @param tree 树列表
|
|
4
|
+
* @param primaryKey 键名称
|
|
5
|
+
* @returns 键值数组集合
|
|
6
|
+
*/
|
|
7
|
+
declare const getTreeKeys: (tree: any[], primaryKey?: string) => any;
|
|
8
|
+
/**
|
|
9
|
+
* 判断树列表中是否有任一 key 被选中
|
|
10
|
+
* @param tree 树列表
|
|
11
|
+
* @param selected 已选中的 keys
|
|
12
|
+
* @param primaryKey 键名
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
declare const hasSelectedKey: (tree: any[], selected: any[], primaryKey: string) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 判断列表项是否全部被选中
|
|
18
|
+
* @param list 一阶列表
|
|
19
|
+
* @param selected 当前选中的字段值集合
|
|
20
|
+
* @param primaryKey 键名称
|
|
21
|
+
* @returns 是否全部被选中
|
|
22
|
+
*/
|
|
23
|
+
declare const isAllSelected: (list: any[], selected: any[], primaryKey?: string) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 完善TableUI Keys(添加选中所有子元素的父元素,或移除未选中所有子元素的父元素)
|
|
26
|
+
* @param flatDataSource 完整数据平铺列表
|
|
27
|
+
* @param selected 当前选中的字段值集合
|
|
28
|
+
* @param primaryKey 键名称
|
|
29
|
+
* @returns 完整的字段值集合
|
|
30
|
+
*/
|
|
31
|
+
declare const completedKeys: (flatDataSource: any[], selected: any[], primaryKey?: string) => any[];
|
|
32
|
+
/**
|
|
33
|
+
* 删除树列表的某个 key/value 键值对
|
|
34
|
+
* @param tree
|
|
35
|
+
* @param key
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
declare const deleteTreeItem: (tree: any[], key: string) => any[];
|
|
39
|
+
/**
|
|
40
|
+
* 根据 valueType 获取最终输出值
|
|
41
|
+
* @param keys 当前选中的 key 集合(all完整类型)
|
|
42
|
+
* @param records 当前选中的 option 集合
|
|
43
|
+
* @param dataSource 数据源集合
|
|
44
|
+
* @param primaryKey 键名
|
|
45
|
+
* @param originalValueType 值输出类型
|
|
46
|
+
* @param originalOptionAsValue
|
|
47
|
+
* @param mode
|
|
48
|
+
* @param checkStrictly
|
|
49
|
+
* @returns 最终输出的 keys 和 options
|
|
50
|
+
*/
|
|
51
|
+
declare const getOutputData: (keys: any[], options: any[], dataSource: any[] | undefined, primaryKey: string, originalValueType: string, originalOptionAsValue: boolean, mode: string, checkStrictly: boolean | undefined) => {
|
|
52
|
+
outputValue: any[];
|
|
53
|
+
outputOptions: any[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 根据 valueType 获取 TableUI 显示值
|
|
57
|
+
* @param keys 回填的数据(输出的)keys 集合
|
|
58
|
+
* @param flatDataSource 平铺的数据源集合
|
|
59
|
+
* @param primaryKey 键名称
|
|
60
|
+
* @param originalValueType 值输出类型
|
|
61
|
+
* @param originalOptionAsValue
|
|
62
|
+
* @param mode
|
|
63
|
+
* @param checkStrictly
|
|
64
|
+
* @param rowKey
|
|
65
|
+
* @returns [] TableUI keys 集合
|
|
66
|
+
*/
|
|
67
|
+
declare const getUISelected: (value: any, flatDataSource: any[] | undefined, primaryKey: string | undefined, originalValueType: string | undefined, originalOptionAsValue: boolean | undefined, mode: string | undefined, checkStrictly: boolean | undefined, rowKey: string | ((record: any) => string) | undefined) => string[];
|
|
68
|
+
/**
|
|
69
|
+
* 获取兼容筛选模式下是否全部选中子元素
|
|
70
|
+
* @param selected 已选中项
|
|
71
|
+
* @param dataSource 当前数据结构
|
|
72
|
+
* @param usableKeys 当前数据结构的可执行项
|
|
73
|
+
* @param checkStrictly
|
|
74
|
+
* @param primaryKey
|
|
75
|
+
* @returns 是否全部选中
|
|
76
|
+
*/
|
|
77
|
+
declare const getCompatibleAllSelected: (selected: any[], dataSource: any[] | undefined, usableKeys: string | any[], checkStrictly: boolean | undefined, primaryKey: string) => boolean;
|
|
78
|
+
export { hasSelectedKey, getTreeKeys, deleteTreeItem, isAllSelected, getUISelected, getOutputData, completedKeys, getCompatibleAllSelected, };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
completedKeys: () => completedKeys,
|
|
22
|
+
deleteTreeItem: () => deleteTreeItem,
|
|
23
|
+
getCompatibleAllSelected: () => getCompatibleAllSelected,
|
|
24
|
+
getOutputData: () => getOutputData,
|
|
25
|
+
getTreeKeys: () => getTreeKeys,
|
|
26
|
+
getUISelected: () => getUISelected,
|
|
27
|
+
hasSelectedKey: () => hasSelectedKey,
|
|
28
|
+
isAllSelected: () => isAllSelected
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(utils_exports);
|
|
31
|
+
var import_schema = require("@tachybase/schema");
|
|
32
|
+
var import_useFlatOptions = require("./hooks/useFlatOptions");
|
|
33
|
+
const getTreeKeys = /* @__PURE__ */ __name((tree, primaryKey = "") => (0, import_schema.isArr)(tree) ? tree.reduce((prev, current) => {
|
|
34
|
+
if (current == null ? void 0 : current.disabled) {
|
|
35
|
+
return prev;
|
|
36
|
+
}
|
|
37
|
+
return [...prev, current[primaryKey], ...getTreeKeys(current == null ? void 0 : current.children, primaryKey)];
|
|
38
|
+
}, []) : [], "getTreeKeys");
|
|
39
|
+
const hasSelectedKey = /* @__PURE__ */ __name((tree, selected, primaryKey) => {
|
|
40
|
+
const keys = getTreeKeys(tree, primaryKey);
|
|
41
|
+
const mergedKeys = [...keys, ...selected];
|
|
42
|
+
const validKeys = [...new Set(mergedKeys)];
|
|
43
|
+
return validKeys.length !== mergedKeys.length;
|
|
44
|
+
}, "hasSelectedKey");
|
|
45
|
+
const isAllSelected = /* @__PURE__ */ __name((list, selected, primaryKey = "") => {
|
|
46
|
+
const validList = list.filter((item) => !(item == null ? void 0 : item.disabled));
|
|
47
|
+
const selectedList = validList.filter((item) => selected == null ? void 0 : selected.includes(item[primaryKey]));
|
|
48
|
+
return selectedList.length === validList.length;
|
|
49
|
+
}, "isAllSelected");
|
|
50
|
+
const completedKeys = /* @__PURE__ */ __name((flatDataSource = [], selected, primaryKey = "") => {
|
|
51
|
+
let allSelectedKeys = [...selected];
|
|
52
|
+
flatDataSource.forEach((item) => {
|
|
53
|
+
var _a;
|
|
54
|
+
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
55
|
+
allSelectedKeys = completedKeys(item.children, allSelectedKeys, primaryKey);
|
|
56
|
+
if (isAllSelected(item.children, allSelectedKeys, primaryKey)) {
|
|
57
|
+
if (!(item == null ? void 0 : item.disabled)) {
|
|
58
|
+
allSelectedKeys = [.../* @__PURE__ */ new Set([...allSelectedKeys, item[primaryKey]])];
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
allSelectedKeys = allSelectedKeys.filter((key) => key !== item[primaryKey]);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return allSelectedKeys;
|
|
66
|
+
}, "completedKeys");
|
|
67
|
+
const getSelectedPath = /* @__PURE__ */ __name((tree = [], selected, primaryKey) => {
|
|
68
|
+
const pathData = [];
|
|
69
|
+
tree.forEach((item) => {
|
|
70
|
+
const validChildren = getSelectedPath(item.children, selected, primaryKey);
|
|
71
|
+
if (validChildren.length || (selected == null ? void 0 : selected.includes(item[primaryKey]))) {
|
|
72
|
+
pathData.push({
|
|
73
|
+
...item,
|
|
74
|
+
...validChildren.length ? { children: validChildren } : {}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return pathData;
|
|
79
|
+
}, "getSelectedPath");
|
|
80
|
+
const deleteTreeItem = /* @__PURE__ */ __name((tree, key) => tree.map((item) => {
|
|
81
|
+
var _a;
|
|
82
|
+
const validItem = { ...item };
|
|
83
|
+
delete validItem[key];
|
|
84
|
+
if ((_a = validItem.children) == null ? void 0 : _a.length) {
|
|
85
|
+
validItem.children = deleteTreeItem(validItem.children, key);
|
|
86
|
+
}
|
|
87
|
+
return validItem;
|
|
88
|
+
}), "deleteTreeItem");
|
|
89
|
+
const getOutputData = /* @__PURE__ */ __name((keys, options, dataSource, primaryKey = "", originalValueType = "", originalOptionAsValue = false, mode = "", checkStrictly) => {
|
|
90
|
+
const valueType = checkStrictly !== false ? "all" : originalValueType;
|
|
91
|
+
const optionAsValue = valueType === "path" ? false : originalOptionAsValue;
|
|
92
|
+
let outputValue = [];
|
|
93
|
+
let outputOptions = [];
|
|
94
|
+
if (valueType === "parent") {
|
|
95
|
+
let childrenKeys = [];
|
|
96
|
+
options.forEach((option) => {
|
|
97
|
+
childrenKeys = [...childrenKeys, ...getTreeKeys(option.children, primaryKey)];
|
|
98
|
+
});
|
|
99
|
+
outputValue = keys.filter((key) => !childrenKeys.includes(key));
|
|
100
|
+
outputOptions = options.filter((options2) => outputValue.includes(options2[primaryKey]));
|
|
101
|
+
} else if (valueType === "child") {
|
|
102
|
+
outputValue = [...keys];
|
|
103
|
+
outputOptions = [...options];
|
|
104
|
+
outputOptions.forEach((option) => {
|
|
105
|
+
if (hasSelectedKey(option.children, keys, primaryKey)) {
|
|
106
|
+
outputValue = outputValue.filter((key) => key !== option[primaryKey]);
|
|
107
|
+
outputOptions = outputOptions.filter((options2) => options2[primaryKey] !== option[primaryKey]);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
} else if (valueType === "path") {
|
|
111
|
+
outputValue = getSelectedPath(dataSource, keys, primaryKey);
|
|
112
|
+
outputOptions = [...options];
|
|
113
|
+
} else {
|
|
114
|
+
outputValue = [...keys];
|
|
115
|
+
outputOptions = [...options];
|
|
116
|
+
}
|
|
117
|
+
outputOptions = deleteTreeItem(outputOptions, "__formily_key__");
|
|
118
|
+
outputValue = optionAsValue && valueType !== "path" ? outputOptions : outputValue;
|
|
119
|
+
if (mode === "single") {
|
|
120
|
+
outputValue = outputValue[0];
|
|
121
|
+
outputOptions = outputOptions[0];
|
|
122
|
+
}
|
|
123
|
+
return { outputValue, outputOptions };
|
|
124
|
+
}, "getOutputData");
|
|
125
|
+
const getUISelected = /* @__PURE__ */ __name((value, flatDataSource, primaryKey, originalValueType, originalOptionAsValue, mode, checkStrictly, rowKey) => {
|
|
126
|
+
const valueType = checkStrictly !== false ? "all" : originalValueType;
|
|
127
|
+
const optionAsValue = valueType === "path" ? false : originalOptionAsValue;
|
|
128
|
+
let keys = mode === "single" ? [value] : (0, import_schema.isArr)(value) ? value : [];
|
|
129
|
+
keys = optionAsValue && valueType !== "path" ? keys.map((record) => (0, import_schema.isFn)(rowKey) ? rowKey(record) : record == null ? void 0 : record[primaryKey || ""]) : keys;
|
|
130
|
+
let newKeys = [];
|
|
131
|
+
if (valueType === "parent") {
|
|
132
|
+
const options = flatDataSource == null ? void 0 : flatDataSource.filter((item) => keys.includes(item[primaryKey || ""]));
|
|
133
|
+
let childrenKeys = [];
|
|
134
|
+
options == null ? void 0 : options.forEach((option) => {
|
|
135
|
+
childrenKeys = [...childrenKeys, ...getTreeKeys(option.children, primaryKey)];
|
|
136
|
+
});
|
|
137
|
+
newKeys = [.../* @__PURE__ */ new Set([...keys, ...childrenKeys])];
|
|
138
|
+
} else if (valueType === "child") {
|
|
139
|
+
newKeys = completedKeys(flatDataSource, keys, primaryKey);
|
|
140
|
+
} else if (valueType === "path") {
|
|
141
|
+
const pathKeys = (0, import_useFlatOptions.getFlatOptions)(keys).map((item) => item[primaryKey || ""]);
|
|
142
|
+
newKeys = completedKeys(flatDataSource, pathKeys, primaryKey);
|
|
143
|
+
} else {
|
|
144
|
+
newKeys = [...keys];
|
|
145
|
+
}
|
|
146
|
+
return newKeys;
|
|
147
|
+
}, "getUISelected");
|
|
148
|
+
const getCompatibleAllSelected = /* @__PURE__ */ __name((selected, dataSource, usableKeys, checkStrictly, primaryKey) => {
|
|
149
|
+
if (!usableKeys.length) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
const currentSelected = selected.filter((item) => usableKeys.includes(item));
|
|
153
|
+
const validSelected = checkStrictly !== false ? currentSelected : completedKeys(dataSource, currentSelected, primaryKey);
|
|
154
|
+
return validSelected.length === usableKeys.length;
|
|
155
|
+
}, "getCompatibleAllSelected");
|
|
156
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
157
|
+
0 && (module.exports = {
|
|
158
|
+
completedKeys,
|
|
159
|
+
deleteTreeItem,
|
|
160
|
+
getCompatibleAllSelected,
|
|
161
|
+
getOutputData,
|
|
162
|
+
getTreeKeys,
|
|
163
|
+
getUISelected,
|
|
164
|
+
hasSelectedKey,
|
|
165
|
+
isAllSelected
|
|
166
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var space_exports = {};
|
|
30
|
+
__export(space_exports, {
|
|
31
|
+
Space: () => Space,
|
|
32
|
+
default: () => space_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(space_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_form_layout = require("../form-layout");
|
|
38
|
+
const Space = /* @__PURE__ */ __name((props) => {
|
|
39
|
+
const layout = (0, import_form_layout.useFormLayout)();
|
|
40
|
+
return import_react.default.createElement(import_antd.Space, {
|
|
41
|
+
size: props.size ?? (layout == null ? void 0 : layout.spaceGap),
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}, "Space");
|
|
45
|
+
var space_default = Space;
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
Space
|
|
49
|
+
});
|