@noah-libjs/components 0.0.3 → 0.0.4
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/dist/ArrayInput/DispalyInner.d.ts +4 -0
- package/dist/ArrayInput/Inner.d.ts +4 -0
- package/dist/ArrayInput/components.d.ts +41 -0
- package/dist/ArrayInput/index.d.ts +4 -0
- package/dist/ArrayInput/types.d.ts +76 -0
- package/dist/ArrayInput/utils.d.ts +3 -0
- package/dist/LazyAntd/AutoComplete/index.d.ts +6 -1
- package/dist/LazyAntd/Checkbox/index.d.ts +1 -1
- package/dist/LazyAntd/ColorPicker/index.d.ts +1 -1
- package/dist/LazyAntd/DatePicker/DatePicker.d.ts +1 -1
- package/dist/LazyAntd/DatePicker/MonthPicker.d.ts +1 -1
- package/dist/LazyAntd/DatePicker/TimePicker.d.ts +1 -1
- package/dist/LazyAntd/Select/OptionInner.d.ts +1 -2
- package/dist/LazyAntd/Select/index.d.ts +4 -5
- package/dist/LazyAntd/Tree/index.d.ts +6 -5
- package/dist/MyAutoComplete/Inner.d.ts +3 -0
- package/dist/MyAutoComplete/index.d.ts +5 -0
- package/dist/MyAutoComplete/types.d.ts +22 -0
- package/dist/MyAutoComplete/useConfig.d.ts +11 -0
- package/dist/MyCheckbox/Display.d.ts +6 -0
- package/dist/MyCheckbox/Inner.d.ts +5 -0
- package/dist/MyCheckbox/components.d.ts +41 -0
- package/dist/MyCheckbox/index.d.ts +6 -0
- package/dist/MyCheckbox/types.d.ts +62 -0
- package/dist/MyCheckbox/utils.d.ts +3 -0
- package/dist/MyColor/index.d.ts +4 -6
- package/dist/MyColor/types.d.ts +6 -0
- package/dist/MyDatePicker/Display.d.ts +3 -0
- package/dist/MyDatePicker/Inner.d.ts +5 -0
- package/dist/MyDatePicker/index.d.ts +8 -0
- package/dist/MyDatePicker/utils.d.ts +26 -0
- package/dist/MyInput/index.d.ts +3 -3
- package/dist/MyInputNumber/index.d.ts +5 -0
- package/dist/MyInputNumber/types.d.ts +9 -0
- package/dist/MyRangeDate/Display.d.ts +2 -0
- package/dist/MyRangeDate/Inner.d.ts +7 -0
- package/dist/MyRangeDate/index.d.ts +8 -0
- package/dist/MyRangeDate/utils.d.ts +403 -0
- package/dist/MySelect/Display.d.ts +3 -0
- package/dist/MySelect/Inner.d.ts +4 -0
- package/dist/MySelect/components.d.ts +41 -0
- package/dist/MySelect/index.d.ts +8 -0
- package/dist/MySelect/types.d.ts +27 -0
- package/dist/MySelect/utils.d.ts +1 -0
- package/dist/MySwitch/index.d.ts +4 -0
- package/dist/MySwitch/types.d.ts +7 -0
- package/dist/a_chunks/components.js +7 -0
- package/dist/a_chunks/index.js +1010 -0
- package/dist/a_chunks/index.module.js +33 -0
- package/dist/a_chunks/{Monaco.Inner.js → root..js} +0 -1
- package/dist/a_chunks/root.17.js +166 -0
- package/dist/a_chunks/root.18.js +238 -0
- package/dist/a_chunks/root.19.js +18 -0
- package/dist/a_chunks/root.20.js +129 -0
- package/dist/a_chunks/root.21.js +78 -0
- package/dist/a_chunks/root.22.js +208 -0
- package/dist/a_chunks/root.23.js +109 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -572
- package/dist/packs.d.ts +48 -0
- package/dist/util-types/comp.d.ts +12 -0
- package/dist/util-types/fd/FormItemLayout.d.ts +5 -0
- package/dist/util-types/fd/InputType.d.ts +1 -0
- package/dist/util-types/fd/Rules.d.ts +4 -0
- package/dist/util-types/fd/SpecialConfig.d.ts +33 -0
- package/dist/util-types/fd/TranferRules.d.ts +9 -0
- package/dist/util-types/fd/index.d.ts +200 -0
- package/dist/util-types/index.d.ts +2 -0
- package/dist/utils/getInputStyle.d.ts +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/msmc.d.ts +41 -0
- package/dist/utils/new.d.ts +6 -0
- package/package.json +5 -3
- package/dist/a_chunks/AutoComplete.Inner.js +0 -9
- package/dist/a_chunks/Select.OptionInner.js +0 -9
- package/dist/pack_components.d.ts +0 -10
- /package/dist/a_chunks/{Modal.Inner.js → root.10.js} +0 -0
- /package/dist/a_chunks/{Pagination.Inner.js → root.11.js} +0 -0
- /package/dist/a_chunks/{Select.Inner.js → root.12.js} +0 -0
- /package/dist/a_chunks/{TreeSelect.Inner.js → root.13.js} +0 -0
- /package/dist/a_chunks/{Checkbox.Inner.js → root.14.js} +0 -0
- /package/dist/a_chunks/{Checkbox.GroupInner.js → root.15.js} +0 -0
- /package/dist/a_chunks/{QRCode.Inner.js → root.16.js} +0 -0
- /package/dist/a_chunks/{ColorPicker.Inner.js → root.2.js} +0 -0
- /package/dist/a_chunks/{Base.DatePicker.js → root.24.js} +0 -0
- /package/dist/a_chunks/{Base.Calendar.js → root.25.js} +0 -0
- /package/dist/a_chunks/{Form.Inner.js → root.3.js} +0 -0
- /package/dist/a_chunks/{Form.FormItemInner.js → root.4.js} +0 -0
- /package/dist/a_chunks/{Dropdown.Inner.js → root.5.js} +0 -0
- /package/dist/a_chunks/{Dropdown.Button.js → root.6.js} +0 -0
- /package/dist/a_chunks/{Table.Inner.js → root.7.js} +0 -0
- /package/dist/a_chunks/{Tree.Inner.js → root.8.js} +0 -0
- /package/dist/a_chunks/{Tree.DirectoryTreeInner.js → root.9.js} +0 -0
|
@@ -0,0 +1,1010 @@
|
|
|
1
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
2
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
7
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
8
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
9
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
+
var _excluded = ["value", "onChange", "placeholder", "warning", "disabled"],
|
|
11
|
+
_excluded2 = ["width", "style", "placeholder", "name", "warning", "form", "value", "onChange", "type"],
|
|
12
|
+
_excluded3 = ["storeKey", "cb"],
|
|
13
|
+
_excluded4 = ["storeKey", "cb"];
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import React__default, { lazy, useState, useEffect, forwardRef, Suspense, Component } from 'react';
|
|
20
|
+
import { CloseOutlined, CheckOutlined } from '@ant-design/icons';
|
|
21
|
+
import { getMomentRange, isString, get, isEmpty, safe_fetch_options, safe_json_parse_arr, numberLikeCompare, isNumber, isBoolean, getPresetOptions, getDictionariesEnumerations, isFunction, isArray, getDualModeOptions, formatDateTimeNoSecond, formatDate, getMomentObj, EMPTY_PLACEHOLDER, isNil } from '@noah-libjs/utils';
|
|
22
|
+
import { Space, Button as Button$1, InputNumber, Checkbox, Input, Skeleton, Modal } from 'antd';
|
|
23
|
+
import dayjs from 'dayjs';
|
|
24
|
+
import { Option } from 'rc-select';
|
|
25
|
+
import { TreeNode } from 'rc-tree';
|
|
26
|
+
var ArrayInput = /*#__PURE__*/lazy(function () {
|
|
27
|
+
return import('./root.20.js');
|
|
28
|
+
});
|
|
29
|
+
ArrayInput.DisplayFC = /*#__PURE__*/lazy(function () {
|
|
30
|
+
return import('./root.21.js');
|
|
31
|
+
});
|
|
32
|
+
var MyAutoComplete = /*#__PURE__*/lazy(function () {
|
|
33
|
+
return import('./root.22.js');
|
|
34
|
+
});
|
|
35
|
+
MyAutoComplete.DisplayFC = function (props) {
|
|
36
|
+
return /*#__PURE__*/React__default.createElement("span", null, props.value);
|
|
37
|
+
};
|
|
38
|
+
var MyCheckbox = /*#__PURE__*/lazy(function () {
|
|
39
|
+
return import('./root.18.js');
|
|
40
|
+
});
|
|
41
|
+
var MyCheckbox_Display = /*#__PURE__*/lazy(function () {
|
|
42
|
+
return import('./root.19.js');
|
|
43
|
+
});
|
|
44
|
+
MyCheckbox.DisplayFC = MyCheckbox_Display;
|
|
45
|
+
var DatePickerInner = /*#__PURE__*/lazy(function () {
|
|
46
|
+
return import('./root.24.js').then(function (r) {
|
|
47
|
+
return {
|
|
48
|
+
"default": r.DatePicker
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
var RangePickerInner = /*#__PURE__*/lazy(function () {
|
|
53
|
+
return import('./root.24.js').then(function (r) {
|
|
54
|
+
return {
|
|
55
|
+
"default": r.DatePicker.RangePicker
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var MonthPickerInner = /*#__PURE__*/lazy(function () {
|
|
60
|
+
return import('./root.24.js').then(function (r) {
|
|
61
|
+
return {
|
|
62
|
+
"default": r.DatePicker.MonthPicker
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
var TimePickerInner = /*#__PURE__*/lazy(function () {
|
|
67
|
+
return import('./root.24.js').then(function (r) {
|
|
68
|
+
return {
|
|
69
|
+
"default": r.DatePicker.TimePicker
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
var CalendarInner = /*#__PURE__*/lazy(function () {
|
|
74
|
+
return import('./root.25.js');
|
|
75
|
+
});
|
|
76
|
+
var DatePicker_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
77
|
+
return /*#__PURE__*/React.createElement(DatePickerInner, _objectSpread(_objectSpread({}, props), {}, {
|
|
78
|
+
ref: ref
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
DatePicker_L.displayName = 'TimePicker';
|
|
82
|
+
var TimePicker_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
83
|
+
return /*#__PURE__*/React.createElement(TimePickerInner, _objectSpread(_objectSpread({}, props), {}, {
|
|
84
|
+
ref: ref
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
TimePicker_L.displayName = 'TimePicker';
|
|
88
|
+
var MonthPicker_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
89
|
+
return /*#__PURE__*/React.createElement(MonthPickerInner, _objectSpread(_objectSpread({}, props), {}, {
|
|
90
|
+
ref: ref
|
|
91
|
+
}));
|
|
92
|
+
});
|
|
93
|
+
MonthPicker_L.displayName = 'TimePicker';
|
|
94
|
+
var RangePicker_L = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
95
|
+
return /*#__PURE__*/React__default.createElement(RangePickerInner, _objectSpread(_objectSpread({
|
|
96
|
+
ranges: getMomentRange()
|
|
97
|
+
}, props), {}, {
|
|
98
|
+
ref: ref
|
|
99
|
+
}));
|
|
100
|
+
});
|
|
101
|
+
RangePicker_L.displayName = 'RangePicker';
|
|
102
|
+
var Calendar_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
103
|
+
return /*#__PURE__*/React.createElement(CalendarInner, _objectSpread({}, props));
|
|
104
|
+
});
|
|
105
|
+
Calendar_L.displayName = 'TimePicker';
|
|
106
|
+
var SelectOption_L = Option;
|
|
107
|
+
var Inner$b = /*#__PURE__*/React__default.lazy(function () {
|
|
108
|
+
return import('./root.12.js');
|
|
109
|
+
});
|
|
110
|
+
function Select_(props) {
|
|
111
|
+
return /*#__PURE__*/React__default.createElement(Inner$b, _objectSpread({}, props));
|
|
112
|
+
}
|
|
113
|
+
var Select_L = Object.assign(Select_, {
|
|
114
|
+
Option: SelectOption_L
|
|
115
|
+
});
|
|
116
|
+
var Inner$a = /*#__PURE__*/React.lazy(function () {
|
|
117
|
+
return import('antd/es/auto-complete');
|
|
118
|
+
});
|
|
119
|
+
var AutoComplete_ = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
120
|
+
return /*#__PURE__*/React.createElement(Inner$a, _objectSpread(_objectSpread({}, props), {}, {
|
|
121
|
+
ref: ref
|
|
122
|
+
}));
|
|
123
|
+
});
|
|
124
|
+
AutoComplete_.displayName = 'AutoComplete';
|
|
125
|
+
var AutoComplete_L = Object.assign(AutoComplete_, {
|
|
126
|
+
Option: SelectOption_L
|
|
127
|
+
});
|
|
128
|
+
var Inner$9 = /*#__PURE__*/React.lazy(function () {
|
|
129
|
+
return import('./root.2.js');
|
|
130
|
+
});
|
|
131
|
+
var ColorPicker_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
132
|
+
return /*#__PURE__*/React.createElement(Inner$9, _objectSpread({}, props));
|
|
133
|
+
});
|
|
134
|
+
ColorPicker_L.displayName = 'ColorPicker';
|
|
135
|
+
var Inner$8 = /*#__PURE__*/React__default.lazy(function () {
|
|
136
|
+
return import('./root.3.js');
|
|
137
|
+
});
|
|
138
|
+
var FormItemInner = /*#__PURE__*/React__default.lazy(function () {
|
|
139
|
+
return import('./root.4.js');
|
|
140
|
+
});
|
|
141
|
+
function Form_(props) {
|
|
142
|
+
return /*#__PURE__*/React__default.createElement(Inner$8, _objectSpread({}, props));
|
|
143
|
+
}
|
|
144
|
+
var Form_L = Object.assign(Form_, {
|
|
145
|
+
Item: FormItemInner
|
|
146
|
+
});
|
|
147
|
+
var Inner$7 = /*#__PURE__*/React__default.lazy(function () {
|
|
148
|
+
return import('./root.5.js');
|
|
149
|
+
});
|
|
150
|
+
var ButtonInner = /*#__PURE__*/React__default.lazy(function () {
|
|
151
|
+
return import('./root.6.js');
|
|
152
|
+
});
|
|
153
|
+
var Dropdown_ = function Dropdown_(props) {
|
|
154
|
+
return /*#__PURE__*/React__default.createElement(Inner$7, _objectSpread({}, props));
|
|
155
|
+
};
|
|
156
|
+
function Button(props) {
|
|
157
|
+
return /*#__PURE__*/React__default.createElement(ButtonInner, _objectSpread({}, props));
|
|
158
|
+
}
|
|
159
|
+
var Dropdown_L = Object.assign(Dropdown_, {
|
|
160
|
+
Button: Button
|
|
161
|
+
});
|
|
162
|
+
var Inner$6 = /*#__PURE__*/React__default.lazy(function () {
|
|
163
|
+
return import('./root.7.js');
|
|
164
|
+
});
|
|
165
|
+
function Table_L(props) {
|
|
166
|
+
return /*#__PURE__*/React__default.createElement(Inner$6, _objectSpread({}, props));
|
|
167
|
+
}
|
|
168
|
+
var Inner$5 = /*#__PURE__*/React__default.lazy(function () {
|
|
169
|
+
return import('./root.8.js');
|
|
170
|
+
});
|
|
171
|
+
var DirectoryTreeInner = /*#__PURE__*/React__default.lazy(function () {
|
|
172
|
+
return import('./root.9.js');
|
|
173
|
+
});
|
|
174
|
+
function Tree_(props) {
|
|
175
|
+
return /*#__PURE__*/React__default.createElement(Inner$5, _objectSpread({}, props));
|
|
176
|
+
}
|
|
177
|
+
function DirectoryTree(props) {
|
|
178
|
+
return /*#__PURE__*/React__default.createElement(DirectoryTreeInner, _objectSpread({}, props));
|
|
179
|
+
}
|
|
180
|
+
var Tree_L = Object.assign(Tree_, {
|
|
181
|
+
TreeNode: TreeNode,
|
|
182
|
+
DirectoryTree: DirectoryTree
|
|
183
|
+
});
|
|
184
|
+
function aa() {
|
|
185
|
+
return /*#__PURE__*/React__default.createElement(Tree_L, null);
|
|
186
|
+
}
|
|
187
|
+
var Inner$4 = /*#__PURE__*/React__default.lazy(function () {
|
|
188
|
+
return import('./root.10.js');
|
|
189
|
+
});
|
|
190
|
+
function Modal_L(props) {
|
|
191
|
+
return /*#__PURE__*/React__default.createElement(Inner$4, _objectSpread({}, props));
|
|
192
|
+
}
|
|
193
|
+
var Inner$3 = /*#__PURE__*/React__default.lazy(function () {
|
|
194
|
+
return import('./root.11.js');
|
|
195
|
+
});
|
|
196
|
+
function Pagination_L(props) {
|
|
197
|
+
return /*#__PURE__*/React__default.createElement(Inner$3, _objectSpread({}, props));
|
|
198
|
+
}
|
|
199
|
+
var Inner$2 = /*#__PURE__*/React__default.lazy(function () {
|
|
200
|
+
return import('./root.13.js');
|
|
201
|
+
});
|
|
202
|
+
function TreeSelect_L(props) {
|
|
203
|
+
return /*#__PURE__*/React__default.createElement(Inner$2, _objectSpread({}, props));
|
|
204
|
+
}
|
|
205
|
+
var Inner$1 = /*#__PURE__*/React__default.lazy(function () {
|
|
206
|
+
return import('./root.14.js');
|
|
207
|
+
});
|
|
208
|
+
var GroupInner = /*#__PURE__*/React__default.lazy(function () {
|
|
209
|
+
return import('./root.15.js');
|
|
210
|
+
});
|
|
211
|
+
function Checkbox_(props) {
|
|
212
|
+
return /*#__PURE__*/React__default.createElement(Inner$1, _objectSpread({}, props));
|
|
213
|
+
}
|
|
214
|
+
var Checkbox_L = Object.assign(Checkbox_, {
|
|
215
|
+
Group: GroupInner
|
|
216
|
+
});
|
|
217
|
+
var QRCode_L = /*#__PURE__*/lazy(function () {
|
|
218
|
+
return import('./root.16.js');
|
|
219
|
+
});
|
|
220
|
+
var Switch_L = /*#__PURE__*/lazy(function () {
|
|
221
|
+
return import('antd/es/switch');
|
|
222
|
+
});
|
|
223
|
+
var MyColor = function MyColor(props) {
|
|
224
|
+
var value = props.value,
|
|
225
|
+
_onChange = props.onChange,
|
|
226
|
+
size = props.size,
|
|
227
|
+
_props$allowClear = props.allowClear,
|
|
228
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear;
|
|
229
|
+
return /*#__PURE__*/React__default.createElement(Space.Compact, null, /*#__PURE__*/React__default.createElement(ColorPicker_L, {
|
|
230
|
+
size: size,
|
|
231
|
+
value: isString(value) ? value : undefined,
|
|
232
|
+
onChange: function onChange(value, css) {
|
|
233
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(css);
|
|
234
|
+
}
|
|
235
|
+
}), allowClear ? /*#__PURE__*/React__default.createElement(Button$1, {
|
|
236
|
+
size: size,
|
|
237
|
+
icon: /*#__PURE__*/React__default.createElement(CloseOutlined, null),
|
|
238
|
+
onClick: function onClick() {
|
|
239
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(null);
|
|
240
|
+
}
|
|
241
|
+
}) : null);
|
|
242
|
+
};
|
|
243
|
+
MyColor.DisplayFC = function (props) {
|
|
244
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
245
|
+
style: {
|
|
246
|
+
display: 'inline-block',
|
|
247
|
+
width: 24,
|
|
248
|
+
height: 24,
|
|
249
|
+
background: props.value
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
function getInputStyle() {
|
|
254
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
255
|
+
var _props$style = props.style,
|
|
256
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
257
|
+
width = props.width,
|
|
258
|
+
inputWidth = props.inputWidth,
|
|
259
|
+
warning = props.warning,
|
|
260
|
+
warn = props.warn;
|
|
261
|
+
if (width) {
|
|
262
|
+
style.width = style.width || width;
|
|
263
|
+
}
|
|
264
|
+
if (inputWidth) {
|
|
265
|
+
style.minWidth = style.minWidth || inputWidth;
|
|
266
|
+
}
|
|
267
|
+
if (warning || warn) {
|
|
268
|
+
style.border = '1px solid red';
|
|
269
|
+
style.color = 'red';
|
|
270
|
+
}
|
|
271
|
+
// if (isInt(popupMatchSelectWidth))
|
|
272
|
+
// style.width = style.width || (popupMatchSelectWidth / 2)
|
|
273
|
+
// style.width = style.width ?? '100%'
|
|
274
|
+
return _objectSpread({}, style);
|
|
275
|
+
}
|
|
276
|
+
function isUrl(string) {
|
|
277
|
+
var protocolRE = /^(?:\w+:)?\/\/(\S+)$/;
|
|
278
|
+
// const domainRE = /^[^\s\.]+\.\S{2,}$/;
|
|
279
|
+
if (typeof string !== 'string') return false;
|
|
280
|
+
return protocolRE.test(string);
|
|
281
|
+
}
|
|
282
|
+
var getArray = function getArray(arr) {
|
|
283
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
284
|
+
if (Array.isArray(arr)) return arr;
|
|
285
|
+
return defaultValue;
|
|
286
|
+
};
|
|
287
|
+
function getFormat(format) {
|
|
288
|
+
var dateFormat;
|
|
289
|
+
switch (format) {
|
|
290
|
+
case 'date':
|
|
291
|
+
dateFormat = 'YYYY-MM-DD';
|
|
292
|
+
break;
|
|
293
|
+
case 'time':
|
|
294
|
+
dateFormat = 'HH:mm:ss';
|
|
295
|
+
break;
|
|
296
|
+
case 'dateTime':
|
|
297
|
+
dateFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
298
|
+
break;
|
|
299
|
+
case 'week':
|
|
300
|
+
dateFormat = 'YYYY-w';
|
|
301
|
+
break;
|
|
302
|
+
case 'year':
|
|
303
|
+
dateFormat = 'YYYY';
|
|
304
|
+
break;
|
|
305
|
+
case 'quarter':
|
|
306
|
+
dateFormat = 'YYYY-Q';
|
|
307
|
+
break;
|
|
308
|
+
case 'month':
|
|
309
|
+
dateFormat = 'YYYY-MM';
|
|
310
|
+
break;
|
|
311
|
+
default:
|
|
312
|
+
// dateTime
|
|
313
|
+
if (typeof format === 'string') {
|
|
314
|
+
dateFormat = format;
|
|
315
|
+
} else {
|
|
316
|
+
dateFormat = 'YYYY-MM-DD';
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return dateFormat;
|
|
320
|
+
}
|
|
321
|
+
function getParamByName(name) {
|
|
322
|
+
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.href;
|
|
323
|
+
name = name.replace(/[\[\]]/g, '\\$&');
|
|
324
|
+
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
|
|
325
|
+
results = regex.exec(url);
|
|
326
|
+
if (!results) return null;
|
|
327
|
+
if (!results[2]) return '';
|
|
328
|
+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
329
|
+
}
|
|
330
|
+
function handle_form_error(error, form) {
|
|
331
|
+
var err_filed = get(error, 'errorFields[0]');
|
|
332
|
+
if (err_filed) {
|
|
333
|
+
var name = err_filed.name,
|
|
334
|
+
errors = err_filed.errors;
|
|
335
|
+
if (name) {
|
|
336
|
+
form === null || form === void 0 || form.scrollToField(name, {
|
|
337
|
+
behavior: 'smooth',
|
|
338
|
+
block: 'center'
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return _objectSpread(_objectSpread({}, err_filed), {}, {
|
|
342
|
+
text: isEmpty(errors) ? null : errors.join(',')
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
function get_check_invert_values(configs) {
|
|
348
|
+
if (!Array.isArray(configs)) return {};
|
|
349
|
+
var children = configs.filter(function (_) {
|
|
350
|
+
return ['MC', 'MA', 'MS'].includes(_ === null || _ === void 0 ? void 0 : _.inputType) || Array.isArray(_ === null || _ === void 0 ? void 0 : _.children);
|
|
351
|
+
});
|
|
352
|
+
var check_invert_values = children.filter(function (_) {
|
|
353
|
+
return !(_ !== null && _ !== void 0 && _.disabled_check);
|
|
354
|
+
}).reduce(function (a, item, idx) {
|
|
355
|
+
var _ref, _item$name, _item$inputProps;
|
|
356
|
+
// const name = SMchc_FormDescriptions.get_form_item_name_raw(item)
|
|
357
|
+
var name = (_ref = (_item$name = item === null || item === void 0 ? void 0 : item.name) !== null && _item$name !== void 0 ? _item$name : item === null || item === void 0 ? void 0 : item.key) !== null && _ref !== void 0 ? _ref : item === null || item === void 0 ? void 0 : item.dataIndex;
|
|
358
|
+
var props = _objectSpread(_objectSpread({}, (_item$inputProps = item === null || item === void 0 ? void 0 : item.inputProps) !== null && _item$inputProps !== void 0 ? _item$inputProps : {}), {}, {
|
|
359
|
+
config: item
|
|
360
|
+
});
|
|
361
|
+
var options = parse_MC_option(props);
|
|
362
|
+
var firstOption = options[0];
|
|
363
|
+
var cArr = item === null || item === void 0 ? void 0 : item.children;
|
|
364
|
+
var cObj = {};
|
|
365
|
+
if (Array.isArray(cArr)) {
|
|
366
|
+
cObj = get_check_invert_values(cArr);
|
|
367
|
+
return _objectSpread(_objectSpread({}, a), cObj);
|
|
368
|
+
} else {
|
|
369
|
+
return _objectSpread(_objectSpread({}, a), {}, _defineProperty({}, "".concat(name), [parse_MC_value(props, [firstOption]), null, {
|
|
370
|
+
props: props,
|
|
371
|
+
options: options
|
|
372
|
+
}]));
|
|
373
|
+
}
|
|
374
|
+
}, {});
|
|
375
|
+
return check_invert_values;
|
|
376
|
+
}
|
|
377
|
+
function getMarshal(props) {
|
|
378
|
+
if (!props) return 1;
|
|
379
|
+
var marshal = props.marshal,
|
|
380
|
+
value = props.value,
|
|
381
|
+
uniqueKey = props.uniqueKey;
|
|
382
|
+
if (marshal === undefined && uniqueKey !== undefined) {
|
|
383
|
+
return 0;
|
|
384
|
+
}
|
|
385
|
+
var _marshal = marshal !== null && marshal !== void 0 ? marshal : 1;
|
|
386
|
+
if (typeof _marshal === 'number') return _marshal;
|
|
387
|
+
var m = typeof value !== 'number' && (_marshal !== null && _marshal !== void 0 ? _marshal : true);
|
|
388
|
+
return Number(m);
|
|
389
|
+
}
|
|
390
|
+
function parse_MC_value(props, changedValue) {
|
|
391
|
+
var _props$config, _changedValue$, _changedValue$2;
|
|
392
|
+
if (((_props$config = props.config) === null || _props$config === void 0 ? void 0 : _props$config.inputType) === 'MA') return changedValue === null || changedValue === void 0 || (_changedValue$ = changedValue[0]) === null || _changedValue$ === void 0 ? void 0 : _changedValue$.value;
|
|
393
|
+
var marshal = getMarshal(props);
|
|
394
|
+
var type = get_mode(props);
|
|
395
|
+
if (!changedValue.length) return null;
|
|
396
|
+
if (marshal) return marshal === 2 ? changedValue : JSON.stringify(changedValue);
|
|
397
|
+
if (type === 'multiple' || type === 'tags') return changedValue.map(function (_) {
|
|
398
|
+
return _.value;
|
|
399
|
+
}).join(',');
|
|
400
|
+
return (_changedValue$2 = changedValue[0]) === null || _changedValue$2 === void 0 ? void 0 : _changedValue$2.value;
|
|
401
|
+
}
|
|
402
|
+
function check_multiple(props) {
|
|
403
|
+
var type = get_mode(props);
|
|
404
|
+
return ['tags', 'multiple'].includes(type);
|
|
405
|
+
}
|
|
406
|
+
function get_mode(props) {
|
|
407
|
+
var _props$mode;
|
|
408
|
+
return (_props$mode = props === null || props === void 0 ? void 0 : props.mode) !== null && _props$mode !== void 0 ? _props$mode : props.type;
|
|
409
|
+
}
|
|
410
|
+
function use_options(props) {
|
|
411
|
+
var _data$;
|
|
412
|
+
var fetch_options = props.fetch_options,
|
|
413
|
+
optionKey = props.optionKey,
|
|
414
|
+
_options = props.options,
|
|
415
|
+
uniqueKey = props.uniqueKey;
|
|
416
|
+
var _useState = useState([]),
|
|
417
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
418
|
+
options = _useState2[0],
|
|
419
|
+
set_options = _useState2[1];
|
|
420
|
+
var _useState3 = useState(false),
|
|
421
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
422
|
+
loading = _useState4[0],
|
|
423
|
+
setLoading = _useState4[1];
|
|
424
|
+
var _useState5 = useState([]),
|
|
425
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
426
|
+
data = _useState6[0],
|
|
427
|
+
setData = _useState6[1];
|
|
428
|
+
var value = props.value;
|
|
429
|
+
var marshal = getMarshal(props);
|
|
430
|
+
var type = get_mode(props);
|
|
431
|
+
useEffect(function () {
|
|
432
|
+
var safeData = getData(value, options, marshal, type);
|
|
433
|
+
setData(safeData);
|
|
434
|
+
}, [value, options]);
|
|
435
|
+
useEffect(function () {
|
|
436
|
+
if (fetch_options) {
|
|
437
|
+
setLoading(true);
|
|
438
|
+
safe_fetch_options(fetch_options).then(set_options)["finally"](function () {
|
|
439
|
+
return setLoading(false);
|
|
440
|
+
});
|
|
441
|
+
} else {
|
|
442
|
+
set_options(parse_MC_option(props));
|
|
443
|
+
}
|
|
444
|
+
}, [fetch_options, optionKey, _options, uniqueKey]);
|
|
445
|
+
var is_multiple = check_multiple(props);
|
|
446
|
+
// mchcLogger.log('MySelect', { data, options, props })
|
|
447
|
+
var label = is_multiple ? data.map(function (_) {
|
|
448
|
+
return _.label;
|
|
449
|
+
}).join(',') : (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.label;
|
|
450
|
+
var safe_node = label !== null && label !== void 0 ? label : '';
|
|
451
|
+
var display_node = /*#__PURE__*/React__default.createElement("span", {
|
|
452
|
+
title: safe_node
|
|
453
|
+
}, loading ? '数据加载中...' : safe_node);
|
|
454
|
+
return {
|
|
455
|
+
loading: loading,
|
|
456
|
+
options: options,
|
|
457
|
+
data: data,
|
|
458
|
+
setData: setData,
|
|
459
|
+
display_node: display_node
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
function getData(value, options, marshal, type) {
|
|
463
|
+
var unMarshalData = safe_json_parse_arr(value, value);
|
|
464
|
+
var splitValue = function splitValue() {
|
|
465
|
+
return isString(value) ? value.split(',').filter(function (_) {
|
|
466
|
+
return _;
|
|
467
|
+
}) : [];
|
|
468
|
+
};
|
|
469
|
+
var v = [1, 2].includes(marshal) ? unMarshalData : (type === 'multiple' || type === 'tags') && isString(value) ? splitValue().map(function (value) {
|
|
470
|
+
var _options$find;
|
|
471
|
+
return (_options$find = options.find(function (_) {
|
|
472
|
+
return numberLikeCompare(value, _.value);
|
|
473
|
+
})) !== null && _options$find !== void 0 ? _options$find : {
|
|
474
|
+
value: value,
|
|
475
|
+
label: value
|
|
476
|
+
};
|
|
477
|
+
}) : value;
|
|
478
|
+
var safeData = Array.isArray(v) ? v : isNumber(v) || isString(v) || isBoolean(v)
|
|
479
|
+
// ? options.filter(_ => _.value === v)
|
|
480
|
+
? options.filter(function (_) {
|
|
481
|
+
return numberLikeCompare(_.value, v);
|
|
482
|
+
}) : [];
|
|
483
|
+
// mchcLogger.log('MySelect', { numberLikeCompare, v, options })
|
|
484
|
+
return safeData;
|
|
485
|
+
}
|
|
486
|
+
function parse_MC_option(props) {
|
|
487
|
+
var _props$marshal, _ref2, _ref3;
|
|
488
|
+
if (!props) return [];
|
|
489
|
+
props.type;
|
|
490
|
+
var marshal = (_props$marshal = props.marshal) !== null && _props$marshal !== void 0 ? _props$marshal : 1;
|
|
491
|
+
var optionKey = props.optionKey;
|
|
492
|
+
var preOptions = optionKey ? getPresetOptions(optionKey, marshal === 0) : null;
|
|
493
|
+
var dicOptions = parse_MC_dict_options(props);
|
|
494
|
+
var options = (_ref2 = (_ref3 = dicOptions !== null && dicOptions !== void 0 ? dicOptions : preOptions) !== null && _ref3 !== void 0 ? _ref3 : parse_MC_string_options(props)) !== null && _ref2 !== void 0 ? _ref2 : defaultOptions;
|
|
495
|
+
// const multiple_compatible_options = options.map(_ => ({ value:}))
|
|
496
|
+
return options;
|
|
497
|
+
}
|
|
498
|
+
function parse_MC_dict_options(props) {
|
|
499
|
+
if (!(props !== null && props !== void 0 && props.uniqueKey)) return;
|
|
500
|
+
var uniqueKey = props.uniqueKey,
|
|
501
|
+
useString = props.useString;
|
|
502
|
+
var fixed_uniqueKey = uniqueKey.includes('.') ? uniqueKey : "uniqueKey.".concat(uniqueKey);
|
|
503
|
+
var enums = getDictionariesEnumerations(fixed_uniqueKey);
|
|
504
|
+
if (!enums.length) return;
|
|
505
|
+
var options = enums.sort(function (a, b) {
|
|
506
|
+
return a.id - b.id;
|
|
507
|
+
}).map(function (e) {
|
|
508
|
+
var _e$value, _e$note;
|
|
509
|
+
var dict_value = (_e$value = e.value) !== null && _e$value !== void 0 ? _e$value : e.note;
|
|
510
|
+
var value = useString ? (_e$note = e.note) !== null && _e$note !== void 0 ? _e$note : e.label : dict_value;
|
|
511
|
+
return {
|
|
512
|
+
label: e.label,
|
|
513
|
+
value: value
|
|
514
|
+
};
|
|
515
|
+
});
|
|
516
|
+
return options;
|
|
517
|
+
}
|
|
518
|
+
function parse_MC_string_options(props) {
|
|
519
|
+
var _config$inputType;
|
|
520
|
+
if (!props) return [];
|
|
521
|
+
var useString = props.useString,
|
|
522
|
+
type = props.type,
|
|
523
|
+
config = props.config,
|
|
524
|
+
startIndex = props.startIndex,
|
|
525
|
+
sp = props.sp;
|
|
526
|
+
var _options = isFunction(props.options) ? props.options() : props.options;
|
|
527
|
+
if (!isString(_options)) return isArray(_options) ? _options.map(function (_) {
|
|
528
|
+
return isString(_) ? {
|
|
529
|
+
value: _,
|
|
530
|
+
label: _
|
|
531
|
+
} : _;
|
|
532
|
+
}) : [];
|
|
533
|
+
var input_type = (_config$inputType = config === null || config === void 0 ? void 0 : config.inputType) !== null && _config$inputType !== void 0 ? _config$inputType : 'MC';
|
|
534
|
+
var multiple = type === 'multiple';
|
|
535
|
+
var marshal = getMarshal(props);
|
|
536
|
+
var options = getDualModeOptions(_options, {
|
|
537
|
+
sp: sp,
|
|
538
|
+
useString: multiple && !marshal || useString,
|
|
539
|
+
start: startIndex
|
|
540
|
+
});
|
|
541
|
+
return input_type === 'MA' ? options[1] : options[0];
|
|
542
|
+
}
|
|
543
|
+
function displayValue(_options, value, isMul) {
|
|
544
|
+
var _value = _options.filter(function (o) {
|
|
545
|
+
return value.find(function (v) {
|
|
546
|
+
return v.value == o.value;
|
|
547
|
+
});
|
|
548
|
+
});
|
|
549
|
+
return _value.map(function (_) {
|
|
550
|
+
return _.label;
|
|
551
|
+
}).join(',');
|
|
552
|
+
}
|
|
553
|
+
function get_unknown_conf(props) {
|
|
554
|
+
var showUnknown = props.showUnknown,
|
|
555
|
+
unknown = props.unknown;
|
|
556
|
+
return showUnknown || unknown;
|
|
557
|
+
}
|
|
558
|
+
var defaultOptions = [];
|
|
559
|
+
var defaultGetPopupContainer = function defaultGetPopupContainer() {
|
|
560
|
+
return document.body;
|
|
561
|
+
};
|
|
562
|
+
var UNKNOWN_TIME_SYMBOL = '1970-01-01 00:00:00';
|
|
563
|
+
function formatDatePickerProps(props) {
|
|
564
|
+
var _data$getPopupContain;
|
|
565
|
+
var data = _objectSpread({}, props);
|
|
566
|
+
if (!data.format) {
|
|
567
|
+
if (props.time_only) {
|
|
568
|
+
data.format = 'HH:mm';
|
|
569
|
+
} else {
|
|
570
|
+
data.format = data.showTime ? formatDateTimeNoSecond.format : formatDate.format;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
data.getPopupContainer = (_data$getPopupContain = data.getPopupContainer) !== null && _data$getPopupContain !== void 0 ? _data$getPopupContain : defaultGetPopupContainer;
|
|
574
|
+
return data;
|
|
575
|
+
}
|
|
576
|
+
function getIsUnknown(props) {
|
|
577
|
+
var value = props.value;
|
|
578
|
+
var symbolValue = handleChangeValue(props, UNKNOWN_TIME_SYMBOL);
|
|
579
|
+
var _value = handleChangeValue(props, value);
|
|
580
|
+
var isUnknown = _value === symbolValue && get_unknown_conf(props);
|
|
581
|
+
return isUnknown;
|
|
582
|
+
}
|
|
583
|
+
var handleChangeValue = function handleChangeValue(_ref4, date) {
|
|
584
|
+
var valueType = _ref4.valueType,
|
|
585
|
+
format = _ref4.format;
|
|
586
|
+
var result = date;
|
|
587
|
+
if (valueType && date) {
|
|
588
|
+
result = dayjs(date).format(valueType);
|
|
589
|
+
}
|
|
590
|
+
if (format && date) {
|
|
591
|
+
result = dayjs(date).format(format);
|
|
592
|
+
}
|
|
593
|
+
return result;
|
|
594
|
+
};
|
|
595
|
+
var DisplayFC$2 = function DisplayFC$2(_props) {
|
|
596
|
+
var props = formatDatePickerProps(_props);
|
|
597
|
+
var value = props.value,
|
|
598
|
+
format = props.format;
|
|
599
|
+
var isUnknown = getIsUnknown(props);
|
|
600
|
+
var m = getMomentObj(value);
|
|
601
|
+
return /*#__PURE__*/React__default.createElement("span", null, isUnknown ? '不详' : m.isValid() ? m.format(format) : EMPTY_PLACEHOLDER);
|
|
602
|
+
};
|
|
603
|
+
var MyDatePicker = /*#__PURE__*/lazy(function () {
|
|
604
|
+
return import('./root.23.js');
|
|
605
|
+
});
|
|
606
|
+
MyDatePicker.DisplayFC = DisplayFC$2;
|
|
607
|
+
|
|
608
|
+
// .ant-input-affix-wrapper-borderless
|
|
609
|
+
var UNKNOWN_NUMBER_SYMBOL = 2147483647;
|
|
610
|
+
var MyInputNumber = function MyInputNumber_(props) {
|
|
611
|
+
var value = props.value,
|
|
612
|
+
_onChange2 = props.onChange,
|
|
613
|
+
placeholder = props.placeholder,
|
|
614
|
+
warning = props.warning,
|
|
615
|
+
disabled = props.disabled,
|
|
616
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
617
|
+
var _style = getInputStyle(props);
|
|
618
|
+
var unkown_conf = get_unknown_conf(props);
|
|
619
|
+
var isUnkown = unkown_conf && value === UNKNOWN_NUMBER_SYMBOL;
|
|
620
|
+
if (unkown_conf) {
|
|
621
|
+
_style.flex = 1;
|
|
622
|
+
}
|
|
623
|
+
// const node = <Input disabled={disabled} {...others} placeholder={placeholder ?? '请输入数值'} allowClear style={_style} type='number' value={isUnkown ? undefined : value!} onChange={e => onChange?.(e.target.value)} />
|
|
624
|
+
var node = /*#__PURE__*/React__default.createElement(InputNumber, _objectSpread(_objectSpread({}, others), {}, {
|
|
625
|
+
disabled: disabled,
|
|
626
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '请输入',
|
|
627
|
+
style: _objectSpread({
|
|
628
|
+
width: '100%'
|
|
629
|
+
}, _style),
|
|
630
|
+
value: isUnkown ? undefined : value,
|
|
631
|
+
onChange: _onChange2
|
|
632
|
+
}));
|
|
633
|
+
return unkown_conf ? /*#__PURE__*/React__default.createElement("span", {
|
|
634
|
+
style: {
|
|
635
|
+
display: 'flex',
|
|
636
|
+
alignItems: 'center'
|
|
637
|
+
}
|
|
638
|
+
}, node, /*#__PURE__*/React__default.createElement("span", {
|
|
639
|
+
style: {
|
|
640
|
+
marginLeft: 6
|
|
641
|
+
}
|
|
642
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
643
|
+
disabled: disabled,
|
|
644
|
+
checked: isUnkown,
|
|
645
|
+
skipGroup: true,
|
|
646
|
+
onChange: function onChange(e) {
|
|
647
|
+
var _value = e.target.checked ? UNKNOWN_NUMBER_SYMBOL : null;
|
|
648
|
+
_onChange2 === null || _onChange2 === void 0 || _onChange2(_value);
|
|
649
|
+
}
|
|
650
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
651
|
+
style: {
|
|
652
|
+
marginLeft: 6
|
|
653
|
+
}
|
|
654
|
+
}, "\u4E0D\u8BE6"))) : node;
|
|
655
|
+
};
|
|
656
|
+
function DisplayFC$1(props) {
|
|
657
|
+
var value = props.value;
|
|
658
|
+
var unkown_conf = get_unknown_conf(props);
|
|
659
|
+
var _style = getInputStyle(props);
|
|
660
|
+
var isUnkown = unkown_conf && value === UNKNOWN_NUMBER_SYMBOL;
|
|
661
|
+
if (isUnkown) {
|
|
662
|
+
return /*#__PURE__*/React__default.createElement("span", null, "\u4E0D\u8BE6");
|
|
663
|
+
}
|
|
664
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
665
|
+
title: 'DisplayFC',
|
|
666
|
+
style: _style
|
|
667
|
+
}, value);
|
|
668
|
+
}
|
|
669
|
+
MyInputNumber.DisplayFC = DisplayFC$1;
|
|
670
|
+
var MyInput = /*#__PURE__*/forwardRef(function (props, myRef) {
|
|
671
|
+
var width = props.width,
|
|
672
|
+
_props$style2 = props.style,
|
|
673
|
+
style = _props$style2 === void 0 ? {} : _props$style2,
|
|
674
|
+
placeholder = props.placeholder,
|
|
675
|
+
name = props.name,
|
|
676
|
+
warning = props.warning,
|
|
677
|
+
form = props.form,
|
|
678
|
+
value = props.value,
|
|
679
|
+
_onChange3 = props.onChange,
|
|
680
|
+
type = props.type,
|
|
681
|
+
others = _objectWithoutProperties(props, _excluded2);
|
|
682
|
+
if (type === 'number') return /*#__PURE__*/React__default.createElement(MyInputNumber, _objectSpread({}, props));
|
|
683
|
+
var _useState7 = useState(value),
|
|
684
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
685
|
+
_value = _useState8[0],
|
|
686
|
+
set_value = _useState8[1];
|
|
687
|
+
useEffect(function () {
|
|
688
|
+
set_value(value);
|
|
689
|
+
}, [value]);
|
|
690
|
+
var _style = getInputStyle(props);
|
|
691
|
+
return /*#__PURE__*/React__default.createElement(Input, _objectSpread(_objectSpread({
|
|
692
|
+
title: JSON.stringify(_style),
|
|
693
|
+
ref: myRef,
|
|
694
|
+
value: _value,
|
|
695
|
+
onChange: function onChange(e) {
|
|
696
|
+
var v = e.target.value;
|
|
697
|
+
set_value(v);
|
|
698
|
+
_onChange3 === null || _onChange3 === void 0 || _onChange3(v);
|
|
699
|
+
},
|
|
700
|
+
style: _style
|
|
701
|
+
}, others), {}, {
|
|
702
|
+
// placeholder={placeholder ?? '请输入'}
|
|
703
|
+
placeholder: '请输入'
|
|
704
|
+
}));
|
|
705
|
+
});
|
|
706
|
+
MyInput.DisplayFC = function (props) {
|
|
707
|
+
return props.value;
|
|
708
|
+
};
|
|
709
|
+
function DisplayFC(props) {
|
|
710
|
+
var _use_options = use_options(props),
|
|
711
|
+
loading = _use_options.loading,
|
|
712
|
+
data = _use_options.data,
|
|
713
|
+
display_node = _use_options.display_node;
|
|
714
|
+
return display_node;
|
|
715
|
+
}
|
|
716
|
+
var Inner = /*#__PURE__*/lazy(function () {
|
|
717
|
+
return import('./root.17.js');
|
|
718
|
+
});
|
|
719
|
+
var MySelect = Object.assign(Inner, {
|
|
720
|
+
DisplayFC: DisplayFC
|
|
721
|
+
});
|
|
722
|
+
var MySwitch = function MySwitch(props) {
|
|
723
|
+
return /*#__PURE__*/React__default.createElement(Switch_L, _objectSpread({}, props));
|
|
724
|
+
};
|
|
725
|
+
MySwitch.DisplayFC = function (_ref5) {
|
|
726
|
+
var _ref6, _ref7;
|
|
727
|
+
var value = _ref5.value,
|
|
728
|
+
checkedChildren = _ref5.checkedChildren,
|
|
729
|
+
checkedText = _ref5.checkedText,
|
|
730
|
+
unCheckedChildren = _ref5.unCheckedChildren,
|
|
731
|
+
uncheckedText = _ref5.uncheckedText;
|
|
732
|
+
if (isNil(value)) return '';
|
|
733
|
+
return value ? (_ref6 = checkedChildren !== null && checkedChildren !== void 0 ? checkedChildren : checkedText) !== null && _ref6 !== void 0 ? _ref6 : /*#__PURE__*/React__default.createElement(CheckOutlined, null) : (_ref7 = unCheckedChildren !== null && unCheckedChildren !== void 0 ? unCheckedChildren : uncheckedText) !== null && _ref7 !== void 0 ? _ref7 : /*#__PURE__*/React__default.createElement(CloseOutlined, null);
|
|
734
|
+
};
|
|
735
|
+
var packs = {
|
|
736
|
+
MI: MyInput,
|
|
737
|
+
input: MyInput,
|
|
738
|
+
Input: MyInput,
|
|
739
|
+
MyInput: MyInput,
|
|
740
|
+
MyInputNumber: MyInputNumber,
|
|
741
|
+
InputNumber: MyInputNumber,
|
|
742
|
+
input_number: MyInputNumber,
|
|
743
|
+
MyDatePicker: MyDatePicker,
|
|
744
|
+
DatePicker: MyDatePicker,
|
|
745
|
+
DP: MyDatePicker,
|
|
746
|
+
single_date_picker: MyDatePicker,
|
|
747
|
+
CusDatePicker: MyDatePicker,
|
|
748
|
+
date: MyDatePicker,
|
|
749
|
+
MyColor: MyColor,
|
|
750
|
+
MySwitch: MySwitch,
|
|
751
|
+
"switch": MySwitch,
|
|
752
|
+
Switch: MySwitch,
|
|
753
|
+
ArrayInput: ArrayInput,
|
|
754
|
+
MArr: ArrayInput,
|
|
755
|
+
MySelect: MySelect,
|
|
756
|
+
MS: MySelect,
|
|
757
|
+
Select: MySelect,
|
|
758
|
+
select: MySelect,
|
|
759
|
+
MyCheckbox: MyCheckbox,
|
|
760
|
+
Checkbox: MyCheckbox,
|
|
761
|
+
MC: MyCheckbox,
|
|
762
|
+
checkbox: MyCheckbox,
|
|
763
|
+
// CheckboxWithInput: MyCheckbox,
|
|
764
|
+
MyAutoComplete: MyAutoComplete,
|
|
765
|
+
MA: MyAutoComplete,
|
|
766
|
+
AutoComplete: MyAutoComplete,
|
|
767
|
+
autocomplete: MyAutoComplete
|
|
768
|
+
};
|
|
769
|
+
var MyLazyComponent = function MyLazyComponent(props) {
|
|
770
|
+
var children = props.children,
|
|
771
|
+
fallback = props.fallback,
|
|
772
|
+
_props$size = props.size,
|
|
773
|
+
size = _props$size === void 0 ? 'small' : _props$size;
|
|
774
|
+
var m = {
|
|
775
|
+
tiny: 2,
|
|
776
|
+
small: 4,
|
|
777
|
+
middle: 8,
|
|
778
|
+
large: 16
|
|
779
|
+
};
|
|
780
|
+
var rows = m[size];
|
|
781
|
+
return /*#__PURE__*/React__default.createElement(Suspense, {
|
|
782
|
+
fallback: fallback !== null && fallback !== void 0 ? fallback : /*#__PURE__*/React__default.createElement("div", {
|
|
783
|
+
style: {
|
|
784
|
+
padding: 24
|
|
785
|
+
}
|
|
786
|
+
}, /*#__PURE__*/React__default.createElement(Skeleton, {
|
|
787
|
+
paragraph: {
|
|
788
|
+
rows: rows
|
|
789
|
+
}
|
|
790
|
+
}))
|
|
791
|
+
}, children);
|
|
792
|
+
};
|
|
793
|
+
var GlobalModal_ = /*#__PURE__*/function () {
|
|
794
|
+
function GlobalModal_() {
|
|
795
|
+
_classCallCheck(this, GlobalModal_);
|
|
796
|
+
_defineProperty(this, "open", void 0);
|
|
797
|
+
_defineProperty(this, "openOne", void 0);
|
|
798
|
+
_defineProperty(this, "pop", void 0);
|
|
799
|
+
_defineProperty(this, "destroyAll", void 0);
|
|
800
|
+
}
|
|
801
|
+
return _createClass(GlobalModal_, [{
|
|
802
|
+
key: "confirmOnce",
|
|
803
|
+
value: function confirmOnce(_ref8) {
|
|
804
|
+
var storeKey = _ref8.storeKey,
|
|
805
|
+
cb = _ref8.cb,
|
|
806
|
+
others = _objectWithoutProperties(_ref8, _excluded3);
|
|
807
|
+
var isAllow = localStorage.get(storeKey);
|
|
808
|
+
if (isNil(isAllow)) {
|
|
809
|
+
Modal.confirm(_objectSpread(_objectSpread({}, others), {}, {
|
|
810
|
+
onOk: function onOk() {
|
|
811
|
+
localStorage.set(storeKey, true);
|
|
812
|
+
cb();
|
|
813
|
+
},
|
|
814
|
+
onCancel: function onCancel() {
|
|
815
|
+
localStorage.set(storeKey, false);
|
|
816
|
+
}
|
|
817
|
+
}));
|
|
818
|
+
} else if (isAllow) {
|
|
819
|
+
cb();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}]);
|
|
823
|
+
}();
|
|
824
|
+
var GlobalModal = /*#__PURE__*/function () {
|
|
825
|
+
function GlobalModal() {
|
|
826
|
+
_classCallCheck(this, GlobalModal);
|
|
827
|
+
_defineProperty(this, "stack", []);
|
|
828
|
+
_defineProperty(this, "setStack", void 0);
|
|
829
|
+
}
|
|
830
|
+
return _createClass(GlobalModal, [{
|
|
831
|
+
key: "init",
|
|
832
|
+
value: function init(stack, setStack) {
|
|
833
|
+
this.stack = stack;
|
|
834
|
+
this.setStack = setStack;
|
|
835
|
+
}
|
|
836
|
+
}, {
|
|
837
|
+
key: "open",
|
|
838
|
+
value: function open(name, data) {
|
|
839
|
+
var id = +new Date();
|
|
840
|
+
this.stack.push({
|
|
841
|
+
name: name,
|
|
842
|
+
data: data,
|
|
843
|
+
id: id
|
|
844
|
+
});
|
|
845
|
+
this.setStack(_toConsumableArray(this.stack));
|
|
846
|
+
return id;
|
|
847
|
+
}
|
|
848
|
+
}, {
|
|
849
|
+
key: "openOne",
|
|
850
|
+
value: function openOne(id, name, data) {
|
|
851
|
+
var _id = id > 0 ? id : +new Date();
|
|
852
|
+
var idx = this.stack.findIndex(function (_) {
|
|
853
|
+
return _.id === _id;
|
|
854
|
+
});
|
|
855
|
+
if (idx === -1) {
|
|
856
|
+
this.stack.push({
|
|
857
|
+
name: name,
|
|
858
|
+
data: data,
|
|
859
|
+
id: _id
|
|
860
|
+
});
|
|
861
|
+
} else {
|
|
862
|
+
this.stack.splice(idx, 1, _objectSpread(_objectSpread({}, this.stack[idx]), {}, {
|
|
863
|
+
name: name,
|
|
864
|
+
data: data
|
|
865
|
+
}));
|
|
866
|
+
}
|
|
867
|
+
this.setStack(_toConsumableArray(this.stack));
|
|
868
|
+
return _id;
|
|
869
|
+
}
|
|
870
|
+
}, {
|
|
871
|
+
key: "pop",
|
|
872
|
+
value: function pop(status, e) {
|
|
873
|
+
var last = this.stack.pop();
|
|
874
|
+
this.clear_one(last, status, e);
|
|
875
|
+
this.setStack(_toConsumableArray(this.stack));
|
|
876
|
+
}
|
|
877
|
+
}, {
|
|
878
|
+
key: "clear_one",
|
|
879
|
+
value: function clear_one(item, status, e) {
|
|
880
|
+
var config = item === null || item === void 0 ? void 0 : item.data;
|
|
881
|
+
if (config) {
|
|
882
|
+
var _config$onClose;
|
|
883
|
+
if (status) {
|
|
884
|
+
var _config$onOk;
|
|
885
|
+
(_config$onOk = config.onOk) === null || _config$onOk === void 0 || _config$onOk.call(config, e);
|
|
886
|
+
} else {
|
|
887
|
+
var _config$onCancel;
|
|
888
|
+
(_config$onCancel = config.onCancel) === null || _config$onCancel === void 0 || _config$onCancel.call(config, e);
|
|
889
|
+
}
|
|
890
|
+
(_config$onClose = config.onClose) === null || _config$onClose === void 0 || _config$onClose.call(config, status);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}, {
|
|
894
|
+
key: "destroyAll",
|
|
895
|
+
value: function destroyAll() {
|
|
896
|
+
var _this = this;
|
|
897
|
+
this.stack.forEach(function (_) {
|
|
898
|
+
return _this.clear_one(_, false, undefined);
|
|
899
|
+
});
|
|
900
|
+
this.setStack([]);
|
|
901
|
+
}
|
|
902
|
+
}, {
|
|
903
|
+
key: "confirmOnce",
|
|
904
|
+
value: function confirmOnce(_ref9) {
|
|
905
|
+
var storeKey = _ref9.storeKey,
|
|
906
|
+
cb = _ref9.cb,
|
|
907
|
+
others = _objectWithoutProperties(_ref9, _excluded4);
|
|
908
|
+
var isAllow = localStorage.get(storeKey);
|
|
909
|
+
if (isNil(isAllow)) {
|
|
910
|
+
Modal.confirm(_objectSpread(_objectSpread({}, others), {}, {
|
|
911
|
+
onOk: function onOk() {
|
|
912
|
+
localStorage.set(storeKey, true);
|
|
913
|
+
cb();
|
|
914
|
+
},
|
|
915
|
+
onCancel: function onCancel() {
|
|
916
|
+
localStorage.set(storeKey, false);
|
|
917
|
+
}
|
|
918
|
+
}));
|
|
919
|
+
} else if (isAllow) {
|
|
920
|
+
cb();
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}]);
|
|
924
|
+
}();
|
|
925
|
+
function MountGlobalModal(props) {
|
|
926
|
+
var meta = props.meta,
|
|
927
|
+
globalModal = props.globalModal;
|
|
928
|
+
// useNotification()
|
|
929
|
+
var _useState9 = useState([]),
|
|
930
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
931
|
+
modalQueue = _useState10[0],
|
|
932
|
+
setModalQueue = _useState10[1];
|
|
933
|
+
useEffect(function () {
|
|
934
|
+
globalModal.init(modalQueue, setModalQueue);
|
|
935
|
+
}, [modalQueue]);
|
|
936
|
+
function do_pop(status, e) {
|
|
937
|
+
globalModal.pop(status, e);
|
|
938
|
+
}
|
|
939
|
+
return /*#__PURE__*/React__default.createElement(Suspense, {
|
|
940
|
+
fallback: /*#__PURE__*/React__default.createElement("div", null, "loading MountGlobalModal ...")
|
|
941
|
+
}, modalQueue.map(function (_ref10) {
|
|
942
|
+
var name = _ref10.name,
|
|
943
|
+
data = _ref10.data,
|
|
944
|
+
id = _ref10.id;
|
|
945
|
+
var C = meta[name] || function () {
|
|
946
|
+
return null;
|
|
947
|
+
};
|
|
948
|
+
return /*#__PURE__*/React__default.createElement(MyLazyComponent, {
|
|
949
|
+
fallback: ''
|
|
950
|
+
}, /*#__PURE__*/React__default.createElement(C, _objectSpread(_objectSpread({
|
|
951
|
+
maskClosable: false,
|
|
952
|
+
key: id,
|
|
953
|
+
visible: true,
|
|
954
|
+
centered: true
|
|
955
|
+
}, data), {}, {
|
|
956
|
+
close: do_pop,
|
|
957
|
+
onOk: function onOk(e) {
|
|
958
|
+
do_pop(true, e);
|
|
959
|
+
},
|
|
960
|
+
onCancel: function onCancel(e) {
|
|
961
|
+
do_pop(false, e);
|
|
962
|
+
}
|
|
963
|
+
})));
|
|
964
|
+
}));
|
|
965
|
+
}
|
|
966
|
+
var MonacoInner = /*#__PURE__*/lazy(function () {
|
|
967
|
+
return import('./root..js');
|
|
968
|
+
});
|
|
969
|
+
var MyMonaco = Object.assign(MonacoInner, {
|
|
970
|
+
config: function config(vs) {
|
|
971
|
+
import('@monaco-editor/react/dist/index').then(function (mod) {
|
|
972
|
+
mod.loader.config({
|
|
973
|
+
paths: {
|
|
974
|
+
vs: vs
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
var ContainerDimensions = /*#__PURE__*/function (_Component) {
|
|
981
|
+
// const[Comp, setComp] = useState<FC<ContainerDimensionsProps>>()
|
|
982
|
+
function ContainerDimensions(props) {
|
|
983
|
+
var _this2;
|
|
984
|
+
_classCallCheck(this, ContainerDimensions);
|
|
985
|
+
_this2 = _callSuper(this, ContainerDimensions, [props]);
|
|
986
|
+
_this2.state = {
|
|
987
|
+
Comp: null
|
|
988
|
+
};
|
|
989
|
+
return _this2;
|
|
990
|
+
}
|
|
991
|
+
_inherits(ContainerDimensions, _Component);
|
|
992
|
+
return _createClass(ContainerDimensions, [{
|
|
993
|
+
key: "componentDidMount",
|
|
994
|
+
value: function componentDidMount() {
|
|
995
|
+
var _this3 = this;
|
|
996
|
+
import('react-container-dimensions').then(function (res) {
|
|
997
|
+
_this3.setState({
|
|
998
|
+
Comp: res["default"]
|
|
999
|
+
});
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
}, {
|
|
1003
|
+
key: "render",
|
|
1004
|
+
value: function render() {
|
|
1005
|
+
var Comp = this.state.Comp;
|
|
1006
|
+
return Comp ? /*#__PURE__*/React__default.createElement(Comp, _objectSpread({}, this.props)) : /*#__PURE__*/React__default.createElement("span", null, "loading ContainerDimensions ...");
|
|
1007
|
+
}
|
|
1008
|
+
}]);
|
|
1009
|
+
}(Component);
|
|
1010
|
+
export { ArrayInput as A, handle_form_error as B, Checkbox_L as C, DatePicker_L as D, get_check_invert_values as E, displayValue as F, GlobalModal_ as G, Calendar_L as H, AutoComplete_L as I, ColorPicker_L as J, Form_L as K, Dropdown_L as L, MonthPicker_L as M, Table_L as N, Tree_L as O, aa as P, Modal_L as Q, RangePicker_L as R, Select_L as S, TimePicker_L as T, UNKNOWN_TIME_SYMBOL as U, Pagination_L as V, SelectOption_L as W, TreeSelect_L as X, QRCode_L as Y, Switch_L as Z, ContainerDimensions as _, getMarshal as a, get_mode as b, check_multiple as c, parse_MC_value as d, parse_MC_dict_options as e, parse_MC_option as f, getInputStyle as g, formatDatePickerProps as h, getIsUnknown as i, get_unknown_conf as j, handleChangeValue as k, MyInput as l, MySelect as m, MyCheckbox_Display as n, MyCheckbox as o, packs as p, MyColor as q, MountGlobalModal as r, GlobalModal as s, MyMonaco as t, use_options as u, MyLazyComponent as v, isUrl as w, getArray as x, getFormat as y, getParamByName as z };
|