@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,85 @@
|
|
|
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 __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var password_exports = {};
|
|
29
|
+
__export(password_exports, {
|
|
30
|
+
Password: () => Password,
|
|
31
|
+
default: () => password_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(password_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_schema = require("@tachybase/schema");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_preview_text = require("../preview-text");
|
|
38
|
+
var import_PasswordStrength = require("./PasswordStrength");
|
|
39
|
+
const Password = (0, import_schema.connect)((props) => {
|
|
40
|
+
const { value, className, checkStrength, ...others } = props;
|
|
41
|
+
const blockStyle = {
|
|
42
|
+
position: "absolute",
|
|
43
|
+
zIndex: 1,
|
|
44
|
+
height: 8,
|
|
45
|
+
top: 0,
|
|
46
|
+
background: "#fff",
|
|
47
|
+
width: 1,
|
|
48
|
+
transform: "translate(-50%, 0)"
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ import_react.default.createElement("span", { className }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input.Password, { ...others, value }), checkStrength && /* @__PURE__ */ import_react.default.createElement(import_PasswordStrength.PasswordStrength, { value: String(value) }, (score) => {
|
|
51
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
style: {
|
|
55
|
+
background: "#e0e0e0",
|
|
56
|
+
marginBottom: 3,
|
|
57
|
+
position: "relative"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { ...blockStyle, left: "20%" } }),
|
|
61
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { ...blockStyle, left: "40%" } }),
|
|
62
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { ...blockStyle, left: "60%" } }),
|
|
63
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { ...blockStyle, left: "80%" } }),
|
|
64
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
style: {
|
|
68
|
+
position: "relative",
|
|
69
|
+
backgroundImage: "-webkit-linear-gradient(left, #ff5500, #ff9300)",
|
|
70
|
+
transition: "all 0.35s ease-in-out",
|
|
71
|
+
height: 8,
|
|
72
|
+
width: "100%",
|
|
73
|
+
marginTop: 5,
|
|
74
|
+
clipPath: `polygon(0 0,${score}% 0,${score}% 100%,0 100%)`
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
}));
|
|
80
|
+
}, (0, import_schema.mapReadPretty)(import_preview_text.PreviewText.Input));
|
|
81
|
+
var password_default = Password;
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
Password
|
|
85
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type { InputNumberProps } from 'rc-input-number';
|
|
3
|
+
export type { TreeSelectProps } from 'rc-tree-select';
|
|
4
|
+
export declare const PlaceholderContext: React.Context<React.ReactNode>;
|
|
5
|
+
export declare const Placeholder: React.Provider<React.ReactNode>;
|
|
6
|
+
export declare const usePlaceholder: (value?: any) => any;
|
|
7
|
+
export interface IPreviewTextProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
prefixCls?: string;
|
|
9
|
+
value?: any;
|
|
10
|
+
}
|
|
11
|
+
export declare const PreviewText: any;
|
|
12
|
+
export default PreviewText;
|
|
@@ -0,0 +1,263 @@
|
|
|
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 preview_text_exports = {};
|
|
30
|
+
__export(preview_text_exports, {
|
|
31
|
+
Placeholder: () => Placeholder,
|
|
32
|
+
PlaceholderContext: () => PlaceholderContext,
|
|
33
|
+
PreviewText: () => PreviewText,
|
|
34
|
+
default: () => preview_text_default,
|
|
35
|
+
usePlaceholder: () => usePlaceholder
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(preview_text_exports);
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_schema = require("@tachybase/schema");
|
|
40
|
+
var import_antd = require("antd");
|
|
41
|
+
var import_classnames = __toESM(require("classnames"));
|
|
42
|
+
var import_builtins = require("../__builtins__");
|
|
43
|
+
var import_style = __toESM(require("./style"));
|
|
44
|
+
const PlaceholderContext = (0, import_react.createContext)("N/A");
|
|
45
|
+
const Placeholder = PlaceholderContext.Provider;
|
|
46
|
+
const usePlaceholder = /* @__PURE__ */ __name((value) => {
|
|
47
|
+
const placeholder = (0, import_react.useContext)(PlaceholderContext) || "N/A";
|
|
48
|
+
return (0, import_schema.isValid)(value) && value !== "" ? value : placeholder;
|
|
49
|
+
}, "usePlaceholder");
|
|
50
|
+
const Input = (0, import_schema.observer)((props) => {
|
|
51
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
52
|
+
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
53
|
+
return wrapSSR(
|
|
54
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style }, props.addonBefore, props.prefix, usePlaceholder(props.value), props.suffix, props.addonAfter)
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
const NumberPicker = (0, import_schema.observer)((props) => {
|
|
58
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
59
|
+
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
60
|
+
return wrapSSR(
|
|
61
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style }, props.addonBefore, props.prefix, usePlaceholder(
|
|
62
|
+
props.formatter ? props.formatter(String(props.value), {
|
|
63
|
+
userTyping: false,
|
|
64
|
+
input: ""
|
|
65
|
+
}) : props.value
|
|
66
|
+
), props["suffix"], props.addonAfter)
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
const Select = (0, import_schema.observer)((props) => {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
const field = (0, import_schema.useField)();
|
|
72
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
73
|
+
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
74
|
+
const dataSource = ((_a = field == null ? void 0 : field.dataSource) == null ? void 0 : _a.length) ? field.dataSource : ((_b = props == null ? void 0 : props.options) == null ? void 0 : _b.length) ? props.options : [];
|
|
75
|
+
const placeholder = usePlaceholder();
|
|
76
|
+
const getSelected = /* @__PURE__ */ __name(() => {
|
|
77
|
+
const value = props.value;
|
|
78
|
+
if (props.mode === "multiple" || props.mode === "tags") {
|
|
79
|
+
if (props.labelInValue) {
|
|
80
|
+
return (0, import_schema.isArr)(value) ? value : [];
|
|
81
|
+
} else {
|
|
82
|
+
return (0, import_schema.isArr)(value) ? value.map((val) => ({ label: val, value: val })) : [];
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
if (props.labelInValue) {
|
|
86
|
+
return (0, import_schema.isValid)(value) ? [value] : [];
|
|
87
|
+
} else {
|
|
88
|
+
return (0, import_schema.isValid)(value) ? [{ label: value, value }] : [];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, "getSelected");
|
|
92
|
+
const getLabel = /* @__PURE__ */ __name((target) => {
|
|
93
|
+
var _a2, _b2;
|
|
94
|
+
const labelKey = ((_a2 = props.fieldNames) == null ? void 0 : _a2.label) || "label";
|
|
95
|
+
return ((_b2 = dataSource == null ? void 0 : dataSource.find((item) => {
|
|
96
|
+
var _a3;
|
|
97
|
+
const valueKey = ((_a3 = props.fieldNames) == null ? void 0 : _a3.value) || "value";
|
|
98
|
+
return item[valueKey] === (target == null ? void 0 : target.value);
|
|
99
|
+
})) == null ? void 0 : _b2[labelKey]) || target.label || placeholder;
|
|
100
|
+
}, "getLabel");
|
|
101
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
102
|
+
const selected = getSelected();
|
|
103
|
+
if (!selected.length) return placeholder;
|
|
104
|
+
if (selected.length === 1) return getLabel(selected[0]);
|
|
105
|
+
return selected.map((item, key) => {
|
|
106
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { key }, getLabel(item));
|
|
107
|
+
});
|
|
108
|
+
}, "getLabels");
|
|
109
|
+
return wrapSSR(
|
|
110
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style }, getLabels())
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
const TreeSelect = (0, import_schema.observer)((props) => {
|
|
114
|
+
var _a, _b;
|
|
115
|
+
const field = (0, import_schema.useField)();
|
|
116
|
+
const placeholder = usePlaceholder();
|
|
117
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
118
|
+
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
119
|
+
const dataSource = ((_a = field == null ? void 0 : field.dataSource) == null ? void 0 : _a.length) ? field.dataSource : ((_b = props == null ? void 0 : props.treeData) == null ? void 0 : _b.length) ? props.treeData : [];
|
|
120
|
+
const getSelected = /* @__PURE__ */ __name(() => {
|
|
121
|
+
const value = props.value;
|
|
122
|
+
if (props.multiple) {
|
|
123
|
+
if (props.labelInValue) {
|
|
124
|
+
return (0, import_schema.isArr)(value) ? value : [];
|
|
125
|
+
} else {
|
|
126
|
+
return (0, import_schema.isArr)(value) ? value.map((val) => ({ label: val, value: val })) : [];
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
if (props.labelInValue) {
|
|
130
|
+
return value ? [value] : [];
|
|
131
|
+
} else {
|
|
132
|
+
return value ? [{ label: value, value }] : [];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, "getSelected");
|
|
136
|
+
const findLabel = /* @__PURE__ */ __name((value, dataSource2, treeNodeLabelProp) => {
|
|
137
|
+
var _a2;
|
|
138
|
+
const valueKey = ((_a2 = props.fieldNames) == null ? void 0 : _a2.value) || "value";
|
|
139
|
+
for (let i = 0; i < (dataSource2 == null ? void 0 : dataSource2.length); i++) {
|
|
140
|
+
const item = dataSource2[i];
|
|
141
|
+
if ((item == null ? void 0 : item[valueKey]) === value) {
|
|
142
|
+
return (item == null ? void 0 : item.label) ?? item[treeNodeLabelProp];
|
|
143
|
+
} else {
|
|
144
|
+
const childLabel = findLabel(value, item == null ? void 0 : item.children, treeNodeLabelProp);
|
|
145
|
+
if (childLabel) return childLabel;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, "findLabel");
|
|
149
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
150
|
+
const selected = getSelected();
|
|
151
|
+
if (!(selected == null ? void 0 : selected.length)) return /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, null, placeholder);
|
|
152
|
+
return selected.map(({ value, label }, key) => {
|
|
153
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { key }, findLabel(value, dataSource, props.treeNodeLabelProp) || label || placeholder);
|
|
154
|
+
});
|
|
155
|
+
}, "getLabels");
|
|
156
|
+
return wrapSSR(
|
|
157
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style }, getLabels())
|
|
158
|
+
);
|
|
159
|
+
});
|
|
160
|
+
const Cascader = (0, import_schema.observer)((props) => {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const field = (0, import_schema.useField)();
|
|
163
|
+
const placeholder = usePlaceholder();
|
|
164
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
165
|
+
const [wrapSSR, hashId] = (0, import_style.default)(prefixCls);
|
|
166
|
+
const dataSource = ((_a = field == null ? void 0 : field.dataSource) == null ? void 0 : _a.length) ? field.dataSource : ((_b = props == null ? void 0 : props.options) == null ? void 0 : _b.length) ? props.options : [];
|
|
167
|
+
const findSelectedItem = /* @__PURE__ */ __name((items, val) => {
|
|
168
|
+
return items.find((item) => item.value === val);
|
|
169
|
+
}, "findSelectedItem");
|
|
170
|
+
const findSelectedItems = /* @__PURE__ */ __name((sources, selectedValues) => {
|
|
171
|
+
return selectedValues.map((value) => {
|
|
172
|
+
const result = [];
|
|
173
|
+
let items = sources;
|
|
174
|
+
value.forEach((val) => {
|
|
175
|
+
const selectedItem = findSelectedItem(items, val);
|
|
176
|
+
result.push({
|
|
177
|
+
label: (selectedItem == null ? void 0 : selectedItem.label) ?? "",
|
|
178
|
+
value: selectedItem == null ? void 0 : selectedItem.value
|
|
179
|
+
});
|
|
180
|
+
items = (selectedItem == null ? void 0 : selectedItem.children) ?? [];
|
|
181
|
+
});
|
|
182
|
+
return result;
|
|
183
|
+
});
|
|
184
|
+
}, "findSelectedItems");
|
|
185
|
+
const getSelected = /* @__PURE__ */ __name(() => {
|
|
186
|
+
const val = (0, import_schema.toArr)(props.value);
|
|
187
|
+
return props.multiple ? val : [val];
|
|
188
|
+
}, "getSelected");
|
|
189
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
190
|
+
const selected = getSelected();
|
|
191
|
+
const values = findSelectedItems(dataSource, selected);
|
|
192
|
+
const labels = values.map((val) => {
|
|
193
|
+
return val.map((item) => item.label).join("/");
|
|
194
|
+
}).join(" ");
|
|
195
|
+
return labels || placeholder;
|
|
196
|
+
}, "getLabels");
|
|
197
|
+
return wrapSSR(
|
|
198
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, hashId, props.className), style: props.style }, getLabels())
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
const DatePicker = /* @__PURE__ */ __name((props) => {
|
|
202
|
+
const placeholder = usePlaceholder();
|
|
203
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
204
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
205
|
+
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
206
|
+
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
207
|
+
}, "getLabels");
|
|
208
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, props.className) }, getLabels());
|
|
209
|
+
}, "DatePicker");
|
|
210
|
+
const DateRangePicker = /* @__PURE__ */ __name((props) => {
|
|
211
|
+
const placeholder = usePlaceholder();
|
|
212
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
213
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
214
|
+
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
215
|
+
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
216
|
+
}, "getLabels");
|
|
217
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style }, getLabels());
|
|
218
|
+
}, "DateRangePicker");
|
|
219
|
+
const TimePicker = /* @__PURE__ */ __name((props) => {
|
|
220
|
+
const placeholder = usePlaceholder();
|
|
221
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
222
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
223
|
+
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
224
|
+
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
225
|
+
}, "getLabels");
|
|
226
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style }, getLabels());
|
|
227
|
+
}, "TimePicker");
|
|
228
|
+
const TimeRangePicker = /* @__PURE__ */ __name((props) => {
|
|
229
|
+
const placeholder = usePlaceholder();
|
|
230
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
231
|
+
const getLabels = /* @__PURE__ */ __name(() => {
|
|
232
|
+
const labels = (0, import_builtins.formatDayjsValue)(props.value, props.format, placeholder);
|
|
233
|
+
return (0, import_schema.isArr)(labels) ? labels.join("~") : labels;
|
|
234
|
+
}, "getLabels");
|
|
235
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style }, getLabels());
|
|
236
|
+
}, "TimeRangePicker");
|
|
237
|
+
const InternalPreviewText = (0, import_schema.observer)(
|
|
238
|
+
(props) => {
|
|
239
|
+
const prefixCls = (0, import_builtins.usePrefixCls)("form-text", props);
|
|
240
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefixCls, props.className), style: props.style }, usePlaceholder(props.value));
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
const PreviewText = Object.assign(InternalPreviewText, {
|
|
244
|
+
Input,
|
|
245
|
+
Select,
|
|
246
|
+
TreeSelect,
|
|
247
|
+
Cascader,
|
|
248
|
+
DatePicker,
|
|
249
|
+
DateRangePicker,
|
|
250
|
+
TimePicker,
|
|
251
|
+
TimeRangePicker,
|
|
252
|
+
Placeholder,
|
|
253
|
+
usePlaceholder,
|
|
254
|
+
NumberPicker
|
|
255
|
+
});
|
|
256
|
+
var preview_text_default = PreviewText;
|
|
257
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
258
|
+
0 && (module.exports = {
|
|
259
|
+
Placeholder,
|
|
260
|
+
PlaceholderContext,
|
|
261
|
+
PreviewText,
|
|
262
|
+
usePlaceholder
|
|
263
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
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)("preview-text", (token) => {
|
|
25
|
+
const { componentCls, antCls, fontSize, fontWeightStrong } = token;
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
[componentCls]: {
|
|
29
|
+
fontSize,
|
|
30
|
+
fontWeight: fontWeightStrong,
|
|
31
|
+
[`${antCls}-tag:last-child`]: {
|
|
32
|
+
marginInlineEnd: 0
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const InternalRadio: import("react").ForwardRefExoticComponent<Omit<Partial<import("antd").RadioProps & import("react").RefAttributes<import("antd").CheckboxRef>>, "ref"> & import("react").RefAttributes<unknown>>;
|
|
2
|
+
export declare const Radio: import("react").ForwardRefExoticComponent<Omit<Partial<import("antd").RadioProps & import("react").RefAttributes<import("antd").CheckboxRef>>, "ref"> & import("react").RefAttributes<unknown>> & {
|
|
3
|
+
__ANT_RADIO: boolean;
|
|
4
|
+
Group: import("react").ForwardRefExoticComponent<Omit<Partial<Omit<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
5
|
+
ref?: import("react").Ref<HTMLDivElement>;
|
|
6
|
+
}>, "ref"> & import("react").RefAttributes<unknown>>;
|
|
7
|
+
};
|
|
8
|
+
export default Radio;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 radio_exports = {};
|
|
19
|
+
__export(radio_exports, {
|
|
20
|
+
InternalRadio: () => InternalRadio,
|
|
21
|
+
Radio: () => Radio,
|
|
22
|
+
default: () => radio_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(radio_exports);
|
|
25
|
+
var import_schema = require("@tachybase/schema");
|
|
26
|
+
var import_antd = require("antd");
|
|
27
|
+
var import_preview_text = require("../preview-text");
|
|
28
|
+
const InternalRadio = (0, import_schema.connect)(
|
|
29
|
+
import_antd.Radio,
|
|
30
|
+
(0, import_schema.mapProps)({
|
|
31
|
+
value: "checked",
|
|
32
|
+
onInput: "onChange"
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
const Group = (0, import_schema.connect)(
|
|
36
|
+
import_antd.Radio.Group,
|
|
37
|
+
(0, import_schema.mapProps)({
|
|
38
|
+
dataSource: "options"
|
|
39
|
+
}),
|
|
40
|
+
(0, import_schema.mapReadPretty)(import_preview_text.PreviewText.Select)
|
|
41
|
+
);
|
|
42
|
+
const Radio = Object.assign(InternalRadio, {
|
|
43
|
+
__ANT_RADIO: true,
|
|
44
|
+
Group
|
|
45
|
+
});
|
|
46
|
+
var radio_default = Radio;
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
InternalRadio,
|
|
50
|
+
Radio
|
|
51
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IFieldResetOptions, IFormFeedback } from '@tachybase/schema';
|
|
3
|
+
import { ButtonProps } from 'antd';
|
|
4
|
+
export interface IResetProps extends IFieldResetOptions, ButtonProps {
|
|
5
|
+
onClick?: (e: React.MouseEvent<Element, MouseEvent>) => any;
|
|
6
|
+
onResetValidateSuccess?: (payload: any) => void;
|
|
7
|
+
onResetValidateFailed?: (feedbacks: IFormFeedback[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Reset: React.FC<React.PropsWithChildren<IResetProps>>;
|
|
10
|
+
export default Reset;
|
|
@@ -0,0 +1,67 @@
|
|
|
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 reset_exports = {};
|
|
30
|
+
__export(reset_exports, {
|
|
31
|
+
Reset: () => Reset,
|
|
32
|
+
default: () => reset_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(reset_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_schema = require("@tachybase/schema");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
const Reset = /* @__PURE__ */ __name(({
|
|
39
|
+
forceClear,
|
|
40
|
+
validate,
|
|
41
|
+
onResetValidateSuccess,
|
|
42
|
+
onResetValidateFailed,
|
|
43
|
+
...props
|
|
44
|
+
}) => {
|
|
45
|
+
const form = (0, import_schema.useParentForm)();
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
47
|
+
import_antd.Button,
|
|
48
|
+
{
|
|
49
|
+
...props,
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
if ((0, import_schema.isFn)(props.onClick)) {
|
|
52
|
+
if (props.onClick(e) === false) return;
|
|
53
|
+
}
|
|
54
|
+
form.reset("*", {
|
|
55
|
+
forceClear,
|
|
56
|
+
validate
|
|
57
|
+
}).then(onResetValidateSuccess).catch(onResetValidateFailed);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
props.children
|
|
61
|
+
);
|
|
62
|
+
}, "Reset");
|
|
63
|
+
var reset_default = Reset;
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
Reset
|
|
67
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
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 __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var select_exports = {};
|
|
29
|
+
__export(select_exports, {
|
|
30
|
+
Select: () => Select,
|
|
31
|
+
default: () => select_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(select_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_schema = require("@tachybase/schema");
|
|
36
|
+
var import_icons = require("@ant-design/icons");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_preview_text = require("../preview-text");
|
|
39
|
+
const Select = (0, import_schema.connect)(
|
|
40
|
+
import_antd.Select,
|
|
41
|
+
(0, import_schema.mapProps)(
|
|
42
|
+
{
|
|
43
|
+
dataSource: "options",
|
|
44
|
+
loading: true
|
|
45
|
+
},
|
|
46
|
+
(props, field) => {
|
|
47
|
+
return {
|
|
48
|
+
...props,
|
|
49
|
+
suffixIcon: (field == null ? void 0 : field["loading"]) || (field == null ? void 0 : field["validating"]) ? /* @__PURE__ */ import_react.default.createElement(import_icons.LoadingOutlined, null) : props.suffixIcon
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
(0, import_schema.mapReadPretty)(import_preview_text.PreviewText.Select)
|
|
54
|
+
);
|
|
55
|
+
var select_default = Select;
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
Select
|
|
59
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var hooks_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
17
|
+
__reExport(hooks_exports, require("./useCheckSlackly"), module.exports);
|
|
18
|
+
__reExport(hooks_exports, require("./useFilterOptions"), module.exports);
|
|
19
|
+
__reExport(hooks_exports, require("./useFlatOptions"), module.exports);
|
|
20
|
+
__reExport(hooks_exports, require("./useSize"), module.exports);
|
|
21
|
+
__reExport(hooks_exports, require("./useTitleAddon"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("./useCheckSlackly"),
|
|
25
|
+
...require("./useFilterOptions"),
|
|
26
|
+
...require("./useFlatOptions"),
|
|
27
|
+
...require("./useSize"),
|
|
28
|
+
...require("./useTitleAddon")
|
|
29
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断该字段的 indeterminate 属性
|
|
3
|
+
* @param record 当前字段
|
|
4
|
+
* @param flatDataSource 完整平铺数据
|
|
5
|
+
* @param selected 已选中的字段值集合
|
|
6
|
+
* @param primaryKey 键名称
|
|
7
|
+
* @returns indeterminate 属性值
|
|
8
|
+
*/
|
|
9
|
+
declare const getIndeterminate: (record: any, flatDataSource: any, selected: any[], primaryKey?: string) => true;
|
|
10
|
+
interface ICheckSlackly {
|
|
11
|
+
(currentSelected: any[], selected: any[], flatDataSource: any[], flatFilteredDataSource: any[], primaryKey?: string, checkStrictly?: boolean): {
|
|
12
|
+
selectedRowKeys: any[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
declare const useCheckSlackly: ICheckSlackly;
|
|
16
|
+
export { useCheckSlackly, getIndeterminate };
|