@unicom-cloud/ui 0.8.70 → 0.8.72
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/Affix.js +1 -1
- package/Alert.js +2 -2
- package/AutoComplete.js +1 -1
- package/BackTop.js +2 -2
- package/Badge.js +2 -2
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +1 -1
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +1 -1
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Copy.js +1 -1
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +2 -2
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +1 -1
- package/Mentions.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +2 -2
- package/Modal.js +1 -1
- package/Notice.js +2 -2
- package/Notification.js +2 -2
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/SpeechSynthesis.js +3 -3
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +2 -2
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +1 -1
- package/Tree.js +1 -1
- package/Trigger.js +3 -3
- package/affix/index.js +1 -1
- package/alert/index.js +2 -2
- package/anchor/Anchor.js +1 -1
- package/anchor/Link.js +1 -1
- package/auto-complete/index.js +1 -1
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +2 -2
- package/badge/Count.js +1 -1
- package/badge/index.js +2 -2
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +2 -2
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +2 -2
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/index.js +1 -1
- package/chunk/{B80D01PB.js → 6nKl68Er.js} +2 -2
- package/chunk/{Bh8AO6R8.js → BDHuWwhT.js} +1 -1
- package/chunk/{CCv-5KFt.js → BHL-PzAD.js} +149 -152
- package/chunk/{tIRvN_q7.js → BnWo0OJ0.js} +3 -3
- package/chunk/{Cm9BS47C.js → CAVVFFyZ.js} +3 -3
- package/chunk/{bgmEVbGy.js → CP7Ac47f.js} +2 -2
- package/chunk/{-C2QiGwq.js → CdAuhef7.js} +1 -1
- package/chunk/Cf4qn5jY.js +170 -0
- package/chunk/Cgbja_v_.js +723 -0
- package/chunk/{C48SmsN-.js → ClaNycDy.js} +27 -18
- package/chunk/{DonYzv30.js → DV7ywe_q.js} +1 -1
- package/chunk/{YUHbzjGj.js → DVfOiRp-.js} +3 -3
- package/chunk/{CSk3yQDO.js → DxxOUMSa.js} +3 -3
- package/chunk/{iOWILwNv.js → IUjEMHU1.js} +3 -3
- package/chunk/{DzVH9IBy.js → fFjj2KuF.js} +1 -1
- package/chunk/{DFf75sXd.js → rp1MtSd0.js} +2 -2
- package/chunk/y9unmTx_.js +1820 -0
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +3 -3
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +1 -1
- package/config-provider/context.js +1 -1
- package/config-provider/index.js +2 -2
- package/copy/index.js +1 -1
- package/date-picker/Picker.js +1 -1
- package/date-picker/PickerRange.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +3 -3
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +2 -2
- package/empty/index.js +1 -1
- package/form/Form.js +1 -1
- package/form/FormItem.js +2 -2
- package/form/util.js +11 -11
- package/grid/Col.js +1 -1
- package/grid/Row.js +1 -1
- package/grid/grid-item.js +1 -1
- package/grid/grid.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/image/Image.js +2 -2
- package/image/ImagePreview.js +4 -4
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +16 -16
- package/input/Group.js +1 -1
- package/input/Input.js +1 -1
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +2 -2
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +1 -1
- package/locale/en-US.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/mentions/index.js +1 -1
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +2 -2
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +4 -4
- package/modal/index.js +1 -1
- package/notice/index.js +2 -2
- package/notification/index.js +2 -2
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +1 -1
- package/pagination/Pagination.js +1 -1
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/index.js +1 -1
- package/radio/Group.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +1 -1
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/index.js +1 -1
- package/select/Option.js +1 -1
- package/select/Select.js +2 -2
- package/select-view/Core.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +1 -1
- package/slider/index.js +1 -1
- package/space/index.js +1 -1
- package/speech-synthesis/index.js +39 -39
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/statistic/Countdown.js +1 -1
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/switch/index.js +2 -2
- package/table/Table.js +2 -2
- package/table/index.js +3 -3
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +1 -1
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +1 -1
- package/tree/Animation.js +3 -3
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/Select.js +1 -1
- package/trigger/index.js +3 -3
- package/types/locale/en-US.d.ts +12 -12
- package/types/locale/tr-TR.d.ts +12 -12
- package/types/table/interface.d.ts +3 -1
- package/types/utils/react19Adapter.d.ts +1 -0
- package/typography/Base.js +1 -1
- package/typography/Ellipsis.js +11 -11
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/index.js +11 -11
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +2 -2
- package/upload/Uploader.js +2 -2
- package/utils/CSSTransition.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/index.js +4 -4
- package/utils/react19Adapter.js +3 -0
- package/utils/reactDOM.js +1 -1
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/chunk/CASwN1hB.js +0 -710
- package/chunk/DC-pxreh.js +0 -1817
- package/chunk/DcYqcuGl.js +0 -166
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { H as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { H as c, z as x, G as w } from "./URXCKjXr.js";
|
|
2
|
+
import b from "lodash/isObject.js";
|
|
3
|
+
import p from "lodash/isArray.js";
|
|
4
|
+
import M from "lodash/isString.js";
|
|
5
|
+
import _ from "lodash/isNumber.js";
|
|
6
6
|
import E from "lodash/isEqual.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
required: "#{field}
|
|
7
|
+
import O from "lodash/isBoolean.js";
|
|
8
|
+
import z from "lodash/isFunction.js";
|
|
9
|
+
const S = {
|
|
10
|
+
required: "#{field} 是必填项",
|
|
11
11
|
type: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
string: "#{field} 不是合法的文本类型",
|
|
13
|
+
number: "#{field} 不是合法的数字类型",
|
|
14
|
+
boolean: "#{field} 不是合法的布尔类型",
|
|
15
|
+
array: "#{field} 不是合法的数组类型",
|
|
16
|
+
object: "#{field} 不是合法的对象类型",
|
|
17
|
+
url: "#{field} 不是合法的 url 地址",
|
|
18
|
+
email: "#{field} 不是合法的邮箱地址",
|
|
19
|
+
ip: "#{field} 不是合法的 IP 地址"
|
|
20
20
|
},
|
|
21
21
|
number: {
|
|
22
|
-
min: "`#{value}`
|
|
23
|
-
max: "`#{value}`
|
|
24
|
-
equal: "`#{value}`
|
|
25
|
-
range: "`#{value}`
|
|
26
|
-
positive: "`#{value}`
|
|
27
|
-
negative: "`#{value}`
|
|
28
|
-
},
|
|
29
|
-
string: {
|
|
30
|
-
maxLength: "#{field} cannot be longer than #{maxLength} characters",
|
|
31
|
-
minLength: "#{field} must be at least #{minLength} characters",
|
|
32
|
-
length: "#{field} must be exactly #{length} characters",
|
|
33
|
-
match: "`#{value}` does not match pattern #{pattern}",
|
|
34
|
-
uppercase: "`#{value}` must be all uppercase",
|
|
35
|
-
lowercase: "`#{value}` must be all lowercased"
|
|
22
|
+
min: "`#{value}` 小于最小值 `#{min}`",
|
|
23
|
+
max: "`#{value}` 大于最大值 `#{max}`",
|
|
24
|
+
equal: "`#{value}` 不等于 `#{equal}`",
|
|
25
|
+
range: "`#{value}` 不在 `#{min} ~ #{max}` 范围内",
|
|
26
|
+
positive: "`#{value}` 不是正数",
|
|
27
|
+
negative: "`#{value}` 不是负数"
|
|
36
28
|
},
|
|
37
29
|
array: {
|
|
38
|
-
length: "#{field}
|
|
39
|
-
minLength: "#{field}
|
|
40
|
-
maxLength: "#{field}
|
|
41
|
-
includes: "#{field}
|
|
42
|
-
deepEqual: "#{field}
|
|
43
|
-
empty: "#{field}
|
|
30
|
+
length: "#{field} 个数不等于 #{length}",
|
|
31
|
+
minLength: "#{field} 个数最少为 #{minLength}",
|
|
32
|
+
maxLength: "#{field} 个数最多为 #{maxLength}",
|
|
33
|
+
includes: "#{field} 不包含 #{includes}",
|
|
34
|
+
deepEqual: "#{field} 不等于 #{deepEqual}",
|
|
35
|
+
empty: "#{field} 不是空数组"
|
|
36
|
+
},
|
|
37
|
+
string: {
|
|
38
|
+
minLength: "字符数最少为 #{minLength}",
|
|
39
|
+
maxLength: "字符数最多为 #{maxLength}",
|
|
40
|
+
length: "字符数必须是 #{length}",
|
|
41
|
+
match: "`#{value}` 不符合模式 #{pattern}",
|
|
42
|
+
uppercase: "`#{value}` 必须全大写",
|
|
43
|
+
lowercase: "`#{value}` 必须全小写"
|
|
44
44
|
},
|
|
45
45
|
object: {
|
|
46
|
-
deepEqual: "#{field}
|
|
47
|
-
hasKeys: "#{field}
|
|
48
|
-
empty: "#{field}
|
|
46
|
+
deepEqual: "#{field} 不等于期望值",
|
|
47
|
+
hasKeys: "#{field} 不包含必须字段",
|
|
48
|
+
empty: "#{field} 不是对象"
|
|
49
49
|
},
|
|
50
50
|
boolean: {
|
|
51
|
-
true: "
|
|
52
|
-
false: "
|
|
51
|
+
true: "期望是 `true`",
|
|
52
|
+
false: "期望是 `false`"
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, V = (r, t) => {
|
|
55
55
|
const e = { ...r };
|
|
56
|
-
return Object.keys(t || {}).forEach((
|
|
57
|
-
const
|
|
58
|
-
e[
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
} :
|
|
56
|
+
return Object.keys(t || {}).forEach((i) => {
|
|
57
|
+
const s = e[i], n = t == null ? void 0 : t[i];
|
|
58
|
+
e[i] = b(s) ? {
|
|
59
|
+
...s,
|
|
60
|
+
...n
|
|
61
|
+
} : n || s;
|
|
62
62
|
}), e;
|
|
63
63
|
}, k = (r, t) => {
|
|
64
64
|
const e = t.split(".");
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
if (
|
|
68
|
-
return
|
|
69
|
-
return
|
|
65
|
+
let i = r;
|
|
66
|
+
for (let s = 0; s < e.length; s++)
|
|
67
|
+
if (i = i && i[e[s]], i === void 0)
|
|
68
|
+
return i;
|
|
69
|
+
return i;
|
|
70
70
|
};
|
|
71
|
-
var
|
|
72
|
-
class
|
|
71
|
+
var C = Object.defineProperty, N = (r, t, e) => t in r ? C(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, l = (r, t, e) => N(r, typeof t != "symbol" ? t + "" : t, e);
|
|
72
|
+
class m {
|
|
73
73
|
constructor(t, e) {
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
...
|
|
74
|
+
l(this, "obj"), l(this, "message"), l(this, "type"), l(this, "error"), l(this, "_not"), l(this, "validateMessages"), l(this, "field"), l(this, "getValidateMsg", (i, s = {}) => {
|
|
75
|
+
const n = {
|
|
76
|
+
...s,
|
|
77
77
|
value: this.obj,
|
|
78
78
|
field: this.field,
|
|
79
79
|
type: this.type
|
|
80
|
-
}, a = k(this.validateMessages,
|
|
81
|
-
return
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
if (
|
|
80
|
+
}, a = k(this.validateMessages, i);
|
|
81
|
+
return z(a) ? a(n) : M(a) ? a.replace(/#\{.+?\}/g, (g) => {
|
|
82
|
+
const d = g.slice(2, -1);
|
|
83
|
+
if (d in n) {
|
|
84
|
+
if (b(n[d]) || p(n[d]))
|
|
85
85
|
try {
|
|
86
|
-
return JSON.stringify(
|
|
86
|
+
return JSON.stringify(n[d]);
|
|
87
87
|
} catch {
|
|
88
|
-
return
|
|
88
|
+
return n[d];
|
|
89
89
|
}
|
|
90
|
-
return String(
|
|
90
|
+
return String(n[d]);
|
|
91
91
|
}
|
|
92
92
|
return g;
|
|
93
93
|
}) : a;
|
|
94
|
-
}),
|
|
95
|
-
|
|
94
|
+
}), b(e) && M(t) && e.trim ? this.obj = t.trim() : b(e) && e.ignoreEmptyString && t === "" ? this.obj = void 0 : this.obj = t, this.message = e.message, this.type = e.type, this.error = null, this.field = e.field || e.type, this.validateMessages = V(
|
|
95
|
+
S,
|
|
96
96
|
e.validateMessages
|
|
97
97
|
);
|
|
98
98
|
}
|
|
@@ -100,13 +100,13 @@ class p {
|
|
|
100
100
|
return this._not = !this._not, this;
|
|
101
101
|
}
|
|
102
102
|
get isRequired() {
|
|
103
|
-
if (
|
|
103
|
+
if (c(this.obj) || x(this.obj)) {
|
|
104
104
|
const t = this.getValidateMsg("required");
|
|
105
105
|
this.error = {
|
|
106
106
|
value: this.obj,
|
|
107
107
|
type: this.type,
|
|
108
108
|
requiredError: !0,
|
|
109
|
-
message: this.message || (
|
|
109
|
+
message: this.message || (b(t) ? t : `${this._not ? "[NOT MODE]:" : ""}${t}`)
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
return this;
|
|
@@ -118,7 +118,7 @@ class p {
|
|
|
118
118
|
!this.error && t && (this.error = {
|
|
119
119
|
value: this.obj,
|
|
120
120
|
type: this.type,
|
|
121
|
-
message: this.message || (
|
|
121
|
+
message: this.message || (b(t) ? t : `${this._not ? "[NOT MODE]:" : ""}${t}`)
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
validate(t, e) {
|
|
@@ -128,13 +128,13 @@ class p {
|
|
|
128
128
|
t == null || t(this.error);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
class
|
|
131
|
+
class R extends m {
|
|
132
132
|
constructor(t, e) {
|
|
133
133
|
super(t, {
|
|
134
134
|
...e,
|
|
135
135
|
type: "array"
|
|
136
136
|
}), this.validate(
|
|
137
|
-
e && e.strict ?
|
|
137
|
+
e && e.strict ? p(this.obj) : !0,
|
|
138
138
|
this.getValidateMsg("type.array", { value: this.obj, type: this.type })
|
|
139
139
|
);
|
|
140
140
|
}
|
|
@@ -182,18 +182,18 @@ class N extends p {
|
|
|
182
182
|
}
|
|
183
183
|
get empty() {
|
|
184
184
|
return this.validate(
|
|
185
|
-
|
|
185
|
+
x(this.obj),
|
|
186
186
|
this.getValidateMsg("array.empty", { value: this.obj })
|
|
187
187
|
);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
class
|
|
190
|
+
class K extends m {
|
|
191
191
|
constructor(t, e) {
|
|
192
192
|
super(t, {
|
|
193
193
|
...e,
|
|
194
194
|
type: "boolean"
|
|
195
195
|
}), this.validate(
|
|
196
|
-
e && e.strict ?
|
|
196
|
+
e != null && e.strict ? O(this.obj) : !0,
|
|
197
197
|
this.getValidateMsg("type.boolean")
|
|
198
198
|
);
|
|
199
199
|
}
|
|
@@ -210,78 +210,74 @@ class R extends p {
|
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
class
|
|
213
|
+
class P extends m {
|
|
214
214
|
constructor(t, e) {
|
|
215
215
|
super(t, {
|
|
216
216
|
...e,
|
|
217
217
|
type: "custom"
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
console.error(l);
|
|
232
|
-
}
|
|
233
|
-
), [i, t]) : (s == null || s(t.error), t.error);
|
|
234
|
-
};
|
|
220
|
+
validate_(t, e) {
|
|
221
|
+
let i;
|
|
222
|
+
if (t)
|
|
223
|
+
return i = t(this.obj, this.addError.bind(this)), i && i.then ? (e && i.then(
|
|
224
|
+
() => {
|
|
225
|
+
e == null || e(this.error);
|
|
226
|
+
},
|
|
227
|
+
(s) => {
|
|
228
|
+
console.error(s);
|
|
229
|
+
}
|
|
230
|
+
), [i, this]) : (e == null || e(this.error), this.error);
|
|
235
231
|
}
|
|
236
232
|
}
|
|
237
|
-
class
|
|
233
|
+
class D extends m {
|
|
238
234
|
constructor(t, e) {
|
|
239
235
|
super(t, {
|
|
240
236
|
...e,
|
|
241
237
|
type: "number"
|
|
242
238
|
}), this.validate(
|
|
243
|
-
e && e.strict ?
|
|
239
|
+
e && e.strict ? _(this.obj) : !0,
|
|
244
240
|
this.getValidateMsg("type.number")
|
|
245
241
|
);
|
|
246
242
|
}
|
|
247
243
|
min(t) {
|
|
248
|
-
return
|
|
244
|
+
return c(this.obj) ? this : this.validate(
|
|
249
245
|
this.obj >= t,
|
|
250
246
|
this.getValidateMsg("number.min", { min: t })
|
|
251
247
|
);
|
|
252
248
|
}
|
|
253
249
|
max(t) {
|
|
254
|
-
return
|
|
250
|
+
return c(this.obj) ? this : this.validate(
|
|
255
251
|
this.obj <= t,
|
|
256
252
|
this.getValidateMsg("number.max", { max: t })
|
|
257
253
|
);
|
|
258
254
|
}
|
|
259
255
|
equal(t) {
|
|
260
|
-
return
|
|
256
|
+
return c(this.obj) ? this : this.validate(
|
|
261
257
|
this.obj === t,
|
|
262
258
|
this.getValidateMsg("number.equal", { equal: t })
|
|
263
259
|
);
|
|
264
260
|
}
|
|
265
261
|
range(t, e) {
|
|
266
|
-
return
|
|
262
|
+
return c(this.obj) ? this : this.validate(
|
|
267
263
|
this.obj >= t && this.obj <= e,
|
|
268
264
|
this.getValidateMsg("number.range", { min: t, max: e })
|
|
269
265
|
);
|
|
270
266
|
}
|
|
271
267
|
get positive() {
|
|
272
|
-
return
|
|
268
|
+
return c(this.obj) ? this : this.validate(this.obj > 0, this.getValidateMsg("number.positive"));
|
|
273
269
|
}
|
|
274
270
|
get negative() {
|
|
275
|
-
return
|
|
271
|
+
return c(this.obj) ? this : this.validate(this.obj < 0, this.getValidateMsg("number.negative"));
|
|
276
272
|
}
|
|
277
273
|
}
|
|
278
|
-
class
|
|
274
|
+
class H extends m {
|
|
279
275
|
constructor(t, e) {
|
|
280
276
|
super(t, {
|
|
281
277
|
...e,
|
|
282
278
|
type: "object"
|
|
283
279
|
}), this.validate(
|
|
284
|
-
e && e.strict ?
|
|
280
|
+
e && e.strict ? b(this.obj) : !0,
|
|
285
281
|
this.getValidateMsg("type.object")
|
|
286
282
|
);
|
|
287
283
|
}
|
|
@@ -304,13 +300,13 @@ class D extends p {
|
|
|
304
300
|
);
|
|
305
301
|
}
|
|
306
302
|
}
|
|
307
|
-
class
|
|
303
|
+
class I extends m {
|
|
308
304
|
constructor(t, e) {
|
|
309
305
|
super(t, {
|
|
310
306
|
...e,
|
|
311
307
|
type: "string"
|
|
312
308
|
}), this.validate(
|
|
313
|
-
e && e.strict ?
|
|
309
|
+
e && e.strict ? M(this.obj) : !0,
|
|
314
310
|
this.getValidateMsg("type.string")
|
|
315
311
|
);
|
|
316
312
|
}
|
|
@@ -352,11 +348,11 @@ class T extends p {
|
|
|
352
348
|
) : this;
|
|
353
349
|
}
|
|
354
350
|
}
|
|
355
|
-
const
|
|
351
|
+
const T = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Z = new RegExp(
|
|
356
352
|
"^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
|
|
357
353
|
"i"
|
|
358
|
-
),
|
|
359
|
-
class
|
|
354
|
+
), $ = /^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/;
|
|
355
|
+
class A extends m {
|
|
360
356
|
constructor(t, e) {
|
|
361
357
|
super(t, {
|
|
362
358
|
...e,
|
|
@@ -365,104 +361,105 @@ class P extends p {
|
|
|
365
361
|
}
|
|
366
362
|
get email() {
|
|
367
363
|
return this.type = "email", this.validate(
|
|
368
|
-
this.obj === void 0 ||
|
|
364
|
+
this.obj === void 0 || T.test(this.obj),
|
|
369
365
|
this.getValidateMsg("type.email")
|
|
370
366
|
);
|
|
371
367
|
}
|
|
372
368
|
get url() {
|
|
373
369
|
return this.type = "url", this.validate(
|
|
374
|
-
this.obj === void 0 ||
|
|
370
|
+
this.obj === void 0 || Z.test(this.obj),
|
|
375
371
|
this.getValidateMsg("type.url")
|
|
376
372
|
);
|
|
377
373
|
}
|
|
378
374
|
get ip() {
|
|
379
375
|
return this.type = "ip", this.validate(
|
|
380
|
-
this.obj === void 0 ||
|
|
376
|
+
this.obj === void 0 || $.test(this.obj),
|
|
381
377
|
this.getValidateMsg("type.ip")
|
|
382
378
|
);
|
|
383
379
|
}
|
|
384
380
|
}
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
381
|
+
const f = (r, t) => new q(r, { field: "value", ...t });
|
|
382
|
+
f.globalConfig = {};
|
|
383
|
+
f.setGlobalConfig = (r) => {
|
|
384
|
+
f.globalConfig = r || {};
|
|
389
385
|
};
|
|
390
386
|
class q {
|
|
391
387
|
constructor(t, e) {
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
...
|
|
388
|
+
l(this, "number"), l(this, "string"), l(this, "array"), l(this, "object"), l(this, "boolean"), l(this, "type"), l(this, "custom");
|
|
389
|
+
const i = f.globalConfig, s = {
|
|
390
|
+
...i,
|
|
395
391
|
...e,
|
|
396
|
-
validateMessages:
|
|
397
|
-
|
|
392
|
+
validateMessages: V(
|
|
393
|
+
i.validateMessages,
|
|
398
394
|
e.validateMessages
|
|
399
395
|
)
|
|
400
396
|
};
|
|
401
|
-
this.string = new
|
|
397
|
+
this.string = new I(t, s), this.number = new D(t, s), this.array = new R(t, s), this.object = new H(t, s), this.boolean = new K(t, s), this.type = new A(t, s), this.custom = new P(t, s);
|
|
402
398
|
}
|
|
403
399
|
}
|
|
404
400
|
class X {
|
|
405
401
|
constructor(t, e = {}) {
|
|
406
|
-
|
|
402
|
+
l(this, "schema"), l(this, "options"), this.schema = t, this.options = e;
|
|
407
403
|
}
|
|
408
404
|
// 更新校验信息
|
|
409
405
|
messages(t) {
|
|
410
406
|
this.options = {
|
|
411
407
|
...this.options,
|
|
412
|
-
validateMessages:
|
|
408
|
+
validateMessages: V(
|
|
413
409
|
this.options.validateMessages,
|
|
414
410
|
t
|
|
415
411
|
)
|
|
416
412
|
};
|
|
417
413
|
}
|
|
418
414
|
validate(t, e) {
|
|
419
|
-
if (!
|
|
415
|
+
if (!b(t))
|
|
420
416
|
return;
|
|
421
|
-
const
|
|
422
|
-
let
|
|
423
|
-
function
|
|
424
|
-
|
|
417
|
+
const i = [];
|
|
418
|
+
let s = null;
|
|
419
|
+
function n(a, g) {
|
|
420
|
+
s || (s = {}), s && (!s[a] || g.requiredError) && (s[a] = g);
|
|
425
421
|
}
|
|
426
422
|
this.schema && Object.keys(this.schema).forEach((a) => {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
423
|
+
var g;
|
|
424
|
+
if (p(this.schema[a]))
|
|
425
|
+
for (let d = 0; d < this.schema[a].length; d++) {
|
|
426
|
+
const o = this.schema[a][d], v = o.type, L = o.message;
|
|
427
|
+
if (!v && !o.validator)
|
|
431
428
|
throw `You must specify a type to field ${a}!`;
|
|
432
|
-
const
|
|
429
|
+
const j = {
|
|
433
430
|
...this.options,
|
|
434
431
|
message: L,
|
|
435
432
|
field: a
|
|
436
433
|
};
|
|
437
|
-
"ignoreEmptyString" in
|
|
438
|
-
const
|
|
439
|
-
let h =
|
|
434
|
+
"ignoreEmptyString" in o && (j.ignoreEmptyString = o.ignoreEmptyString), "strict" in o && (j.strict = o.strict);
|
|
435
|
+
const y = new q(t[a], j);
|
|
436
|
+
let h = y.type[v] || null;
|
|
440
437
|
if (!h)
|
|
441
|
-
if (
|
|
442
|
-
h =
|
|
438
|
+
if (o.validator) {
|
|
439
|
+
h = y.custom.validate_(o.validator), p(h) && (g = h[0]) != null && g.then ? i.push({
|
|
443
440
|
function: h[0],
|
|
444
441
|
_this: h[1],
|
|
445
442
|
key: a
|
|
446
|
-
}) : h &&
|
|
443
|
+
}) : h && n(a, h);
|
|
447
444
|
continue;
|
|
448
445
|
} else
|
|
449
|
-
h =
|
|
450
|
-
if (Object.keys(
|
|
451
|
-
|
|
446
|
+
h = y[v];
|
|
447
|
+
if (Object.keys(o).forEach((u) => {
|
|
448
|
+
o.required && (h = h.isRequired), u !== "message" && h != null && h[u] && o[u] && typeof h[u] == "object" && (h = h[u]), h != null && h[u] && o[u] !== void 0 && typeof h[u] == "function" && (h = h[u](o[u]));
|
|
452
449
|
}), h.collect((u) => {
|
|
453
|
-
u &&
|
|
454
|
-
}),
|
|
450
|
+
u && n(a, u);
|
|
451
|
+
}), s)
|
|
455
452
|
break;
|
|
456
453
|
}
|
|
457
|
-
}),
|
|
458
|
-
|
|
459
|
-
a._this.error &&
|
|
460
|
-
}), e == null || e(
|
|
461
|
-
}) : e == null || e(
|
|
454
|
+
}), i.length > 0 ? Promise.all(i.map((a) => a.function)).then(() => {
|
|
455
|
+
i.forEach((a) => {
|
|
456
|
+
a._this.error && n(a.key, a._this.error);
|
|
457
|
+
}), e == null || e(s);
|
|
458
|
+
}) : e == null || e(s);
|
|
462
459
|
}
|
|
463
460
|
}
|
|
464
461
|
export {
|
|
465
|
-
X as
|
|
466
|
-
|
|
467
|
-
|
|
462
|
+
X as H,
|
|
463
|
+
S as e,
|
|
464
|
+
f as m
|
|
468
465
|
};
|
|
@@ -15,7 +15,7 @@ import Pt from "@unicom-cloud/icons/IconUiZoomIn";
|
|
|
15
15
|
import Lt from "@unicom-cloud/icons/IconUiZoomOut";
|
|
16
16
|
import zt from "lodash/isUndefined";
|
|
17
17
|
import { useState as g, forwardRef as Nt, useContext as ke, useRef as x, useMemo as Ce, useImperativeHandle as Mt, useCallback as Tt, useEffect as v } from "react";
|
|
18
|
-
import { a as At, b as Ot } from "./
|
|
18
|
+
import { a as At, b as Ot } from "./Cgbja_v_.js";
|
|
19
19
|
import "lodash/isEqualWith";
|
|
20
20
|
import { u as Et } from "./CdaT1b_F.js";
|
|
21
21
|
import "./D-TPB2Do.js";
|
|
@@ -26,12 +26,12 @@ import { isServerRendering as Dt, on as J, off as Q } from "../utils/dom.js";
|
|
|
26
26
|
import "./Biupwn8l.js";
|
|
27
27
|
import { u as Vt } from "./BFTV6myl.js";
|
|
28
28
|
import { u as Bt } from "./CbLaCJmG.js";
|
|
29
|
-
import { f as Ft } from "./
|
|
29
|
+
import { f as Ft } from "./ClaNycDy.js";
|
|
30
30
|
import "./Ce1j9KTi.js";
|
|
31
31
|
import { u as Wt } from "./a3hR6zLw.js";
|
|
32
32
|
import "lodash/debounce";
|
|
33
33
|
import Zt from "../portal/index.js";
|
|
34
|
-
import { P as Ie } from "./
|
|
34
|
+
import { P as Ie } from "./fFjj2KuF.js";
|
|
35
35
|
import { m as Se } from "./JPPo5nY_.js";
|
|
36
36
|
import { s as jt } from "./Ey4YJCkX.js";
|
|
37
37
|
import { r as Ht } from "./CIRG541s.js";
|
|
@@ -5,12 +5,12 @@ import Z from "@unicom-cloud/icons/IconUiFile";
|
|
|
5
5
|
import ee from "@unicom-cloud/icons/IconUiLoading";
|
|
6
6
|
import p from "lodash/isFunction";
|
|
7
7
|
import ne, { useContext as _, useRef as j, useEffect as U, useMemo as Y, forwardRef as te, useState as ie, useCallback as S } from "react";
|
|
8
|
-
import { C as ae } from "./
|
|
9
|
-
import { a as B, I as re } from "./
|
|
8
|
+
import { C as ae } from "./BDHuWwhT.js";
|
|
9
|
+
import { a as B, I as re } from "./Cgbja_v_.js";
|
|
10
10
|
import { m as O } from "./JPPo5nY_.js";
|
|
11
11
|
import oe from "../utils/throttleByRaf.js";
|
|
12
12
|
import se from "lodash/isNumber";
|
|
13
|
-
import { P as le } from "./
|
|
13
|
+
import { P as le } from "./fFjj2KuF.js";
|
|
14
14
|
import ce from "../virtual-list/VirtualList.js";
|
|
15
15
|
import { TreeContext as V } from "../tree/Context.js";
|
|
16
16
|
function de(e) {
|
|
@@ -2,7 +2,7 @@ import { jsx as u, jsxs as ee } from "react/jsx-runtime";
|
|
|
2
2
|
import fe from "lodash/isFunction";
|
|
3
3
|
import ke from "lodash/isPlainObject";
|
|
4
4
|
import te, { useContext as ie, useRef as V, useState as we, useEffect as L, useMemo as ae, useCallback as at, useImperativeHandle as ct } from "react";
|
|
5
|
-
import { a as Oe, I as me } from "./
|
|
5
|
+
import { a as Oe, I as me } from "./Cgbja_v_.js";
|
|
6
6
|
import { u as st } from "./B4YRLi8r.js";
|
|
7
7
|
import { u as lt } from "./BFTV6myl.js";
|
|
8
8
|
import { u as dt } from "./CdaT1b_F.js";
|
|
@@ -19,7 +19,7 @@ import { setTransformStyle as pt } from "../utils/style.js";
|
|
|
19
19
|
import Ye from "@unicom-cloud/icons/IconUiDown";
|
|
20
20
|
import je from "lodash/isNull";
|
|
21
21
|
import bt from "../dropdown/index.js";
|
|
22
|
-
import { M as Ae } from "./
|
|
22
|
+
import { M as Ae } from "./rp1MtSd0.js";
|
|
23
23
|
import gt from "lodash/isEqualWith";
|
|
24
24
|
import vt from "../utils/throttleByRaf.js";
|
|
25
25
|
import Me from "@unicom-cloud/icons/IconUiLeft";
|
|
@@ -6,7 +6,7 @@ import G from "lodash/isArray";
|
|
|
6
6
|
import Ge from "lodash/isPlainObject";
|
|
7
7
|
import Fn from "lodash/isUndefined";
|
|
8
8
|
import _n, { useContext as ce, useMemo as un, forwardRef as Wn, useRef as Ve, useImperativeHandle as Bn, useState as ie, useEffect as Ke } from "react";
|
|
9
|
-
import { a as Re } from "./
|
|
9
|
+
import { a as Re } from "./Cgbja_v_.js";
|
|
10
10
|
import { u as zn } from "./BFTV6myl.js";
|
|
11
11
|
import { u as Xt } from "./VSe_Wq1g.js";
|
|
12
12
|
import { u as Zt } from "./a3hR6zLw.js";
|