@noah-libjs/components 0.0.7 → 0.0.9

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.
Files changed (56) hide show
  1. package/dist/ArrayInput/components.d.ts +165 -5
  2. package/dist/ArrayInput/types.d.ts +2 -1
  3. package/dist/ArraySingle/DispalyInner.d.ts +4 -0
  4. package/dist/ArraySingle/Inner.d.ts +4 -0
  5. package/dist/ArraySingle/index.d.ts +4 -0
  6. package/dist/ArraySingle/types.d.ts +16 -0
  7. package/dist/LazyAntd/ColorPicker/index.d.ts +1 -1
  8. package/dist/LazyAntd/DatePicker/Base/DatePicker.d.ts +3 -1
  9. package/dist/LazyAntd/DatePicker/Base/index.d.ts +6 -2
  10. package/dist/LazyAntd/DatePicker/RangePicker.d.ts +3 -1
  11. package/dist/LazyAntd/Tree/Inner.d.ts +2 -1
  12. package/dist/LazyAntd/Tree/index.d.ts +3 -2
  13. package/dist/MyAutoComplete/types.d.ts +4 -1
  14. package/dist/MyButton/index.d.ts +10 -0
  15. package/dist/MyCheckbox/components.d.ts +184 -24
  16. package/dist/MyCheckbox/types.d.ts +6 -3
  17. package/dist/MyDatePicker/Display.d.ts +1 -1
  18. package/dist/MyIconSelect/MyIcon.d.ts +2 -0
  19. package/dist/MyIconSelect/MyIconSelect.d.ts +5 -0
  20. package/dist/MyIconSelect/index.d.ts +6 -0
  21. package/dist/MyIconSelect/types.d.ts +16 -0
  22. package/dist/MyIconSelect/utils.d.ts +7 -0
  23. package/dist/MyInput/index.d.ts +3 -3
  24. package/dist/MyRangeDate/Inner.d.ts +4 -5
  25. package/dist/MyRangeDate/index.d.ts +6 -7
  26. package/dist/MyRangeDate/utils.d.ts +18 -381
  27. package/dist/MySelect/components.d.ts +165 -5
  28. package/dist/MySelect/types.d.ts +3 -1
  29. package/dist/MySwitch/types.d.ts +5 -2
  30. package/dist/a_chunks/index.js +509 -116
  31. package/dist/a_chunks/index.module.js +1 -24
  32. package/dist/a_chunks/root.17.js +12 -6
  33. package/dist/a_chunks/root.18.js +5 -6
  34. package/dist/a_chunks/root.19.js +2 -2
  35. package/dist/a_chunks/root.20.js +2 -2
  36. package/dist/a_chunks/root.21.js +2 -2
  37. package/dist/a_chunks/root.22.js +141 -183
  38. package/dist/a_chunks/root.23.js +15 -109
  39. package/dist/a_chunks/root.24.js +66 -5
  40. package/dist/a_chunks/root.25.js +8 -4
  41. package/dist/a_chunks/root.26.js +68 -0
  42. package/dist/a_chunks/root.27.js +212 -0
  43. package/dist/a_chunks/root.28.js +117 -0
  44. package/dist/a_chunks/root.29.js +5 -0
  45. package/dist/a_chunks/root.30.js +4 -0
  46. package/dist/a_chunks/root.8.js +7 -5
  47. package/dist/a_chunks/utils.js +59 -0
  48. package/dist/index.js +2 -2
  49. package/dist/packs.d.ts +168 -1
  50. package/dist/util-types/fd/InputType.d.ts +1 -1
  51. package/dist/util-types/fd/index.d.ts +41 -11
  52. package/dist/utils/getInputStyle.d.ts +3 -2
  53. package/dist/utils/msmc.d.ts +13 -4
  54. package/dist/utils/new.d.ts +12 -0
  55. package/dist/utils/use_array_marshal.d.ts +5 -0
  56. package/package.json +4 -4
@@ -4,34 +4,45 @@ import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
5
5
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
6
6
  import _createClass from "@babel/runtime/helpers/createClass";
7
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
7
8
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
8
9
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
9
10
  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"];
11
+ var _excluded = ["placeholder"],
12
+ _excluded2 = ["placeholder"],
13
+ _excluded3 = ["value", "onChange", "placeholder", "warning", "disabled"],
14
+ _excluded4 = ["width", "style", "placeholder", "name", "warning", "form", "value", "onChange", "type"],
15
+ _excluded5 = ["btn_text", "defaultIcon", "onClick", "form", "children", "icon", "loading", "primary", "hidden", "on_btn_click", "title"],
16
+ _excluded6 = ["storeKey", "cb"],
17
+ _excluded7 = ["storeKey", "cb"];
14
18
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
19
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
16
21
  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
22
  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
23
  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';
24
+ import React__default, { lazy, forwardRef, useRef, useState, useEffect, Suspense, Component } from 'react';
25
+ import { getMomentRange, isString, get, isEmpty, isNumber, isBoolean, isNull, numberLikeCompare, getPresetOptions, getDictionariesEnumerations, isFunction, isArray, identity, getDualModeOptions, safe_json_parse_arr, safe_json_parse, isNil, isPrimitive, formatDateTimeNoSecond, formatDate, getMomentObj, EMPTY_PLACEHOLDER, safe_json_stringify, safe_async_call, sleep } from '@noah-libjs/utils';
26
+ import { Space, Button as Button$1, InputNumber, Checkbox, Input, Divider, Skeleton, Modal } from 'antd';
23
27
  import dayjs from 'dayjs';
24
28
  import { Option } from 'rc-select';
25
- import { TreeNode } from 'rc-tree';
29
+ import RCTree, { TreeNode } from 'rc-tree';
30
+ import { safe_fetch_options } from '@noah-libjs/request';
26
31
  var ArrayInput = /*#__PURE__*/lazy(function () {
27
32
  return import('./root.20.js');
28
33
  });
29
34
  ArrayInput.DisplayFC = /*#__PURE__*/lazy(function () {
30
35
  return import('./root.21.js');
31
36
  });
32
- var MyAutoComplete = /*#__PURE__*/lazy(function () {
37
+ var ArraySingle = /*#__PURE__*/lazy(function () {
33
38
  return import('./root.22.js');
34
39
  });
40
+ ArraySingle.DisplayFC = /*#__PURE__*/lazy(function () {
41
+ return import('./root.23.js');
42
+ });
43
+ var MyAutoComplete = /*#__PURE__*/lazy(function () {
44
+ return import('./root.27.js');
45
+ });
35
46
  MyAutoComplete.DisplayFC = function (props) {
36
47
  return /*#__PURE__*/React__default.createElement("span", null, props.value);
37
48
  };
@@ -43,35 +54,35 @@ var MyCheckbox_Display = /*#__PURE__*/lazy(function () {
43
54
  });
44
55
  MyCheckbox.DisplayFC = MyCheckbox_Display;
45
56
  var DatePickerInner = /*#__PURE__*/lazy(function () {
46
- return import('./root.24.js').then(function (r) {
57
+ return import('./root.29.js').then(function (r) {
47
58
  return {
48
59
  "default": r.DatePicker
49
60
  };
50
61
  });
51
62
  });
52
63
  var RangePickerInner = /*#__PURE__*/lazy(function () {
53
- return import('./root.24.js').then(function (r) {
64
+ return import('./root.29.js').then(function (r) {
54
65
  return {
55
66
  "default": r.DatePicker.RangePicker
56
67
  };
57
68
  });
58
69
  });
59
70
  var MonthPickerInner = /*#__PURE__*/lazy(function () {
60
- return import('./root.24.js').then(function (r) {
71
+ return import('./root.29.js').then(function (r) {
61
72
  return {
62
73
  "default": r.DatePicker.MonthPicker
63
74
  };
64
75
  });
65
76
  });
66
77
  var TimePickerInner = /*#__PURE__*/lazy(function () {
67
- return import('./root.24.js').then(function (r) {
78
+ return import('./root.29.js').then(function (r) {
68
79
  return {
69
80
  "default": r.DatePicker.TimePicker
70
81
  };
71
82
  });
72
83
  });
73
84
  var CalendarInner = /*#__PURE__*/lazy(function () {
74
- return import('./root.25.js');
85
+ return import('./root.30.js');
75
86
  });
76
87
  var DatePicker_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
77
88
  return /*#__PURE__*/React.createElement(DatePickerInner, _objectSpread(_objectSpread({}, props), {}, {
@@ -90,7 +101,7 @@ var MonthPicker_L = /*#__PURE__*/React.forwardRef(function (props, ref) {
90
101
  ref: ref
91
102
  }));
92
103
  });
93
- MonthPicker_L.displayName = 'TimePicker';
104
+ MonthPicker_L.displayName = 'MonthPicker';
94
105
  var RangePicker_L = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
95
106
  return /*#__PURE__*/React__default.createElement(RangePickerInner, _objectSpread(_objectSpread({
96
107
  ranges: getMomentRange()
@@ -171,19 +182,20 @@ var Inner$5 = /*#__PURE__*/React__default.lazy(function () {
171
182
  var DirectoryTreeInner = /*#__PURE__*/React__default.lazy(function () {
172
183
  return import('./root.9.js');
173
184
  });
174
- function Tree_(props) {
175
- return /*#__PURE__*/React__default.createElement(Inner$5, _objectSpread({}, props));
176
- }
185
+ var Tree_ = /*#__PURE__*/forwardRef(function Tree_(props, ref) {
186
+ return /*#__PURE__*/React__default.createElement(Inner$5, _objectSpread(_objectSpread({}, props), {}, {
187
+ ref: ref
188
+ }));
189
+ });
177
190
  function DirectoryTree(props) {
178
191
  return /*#__PURE__*/React__default.createElement(DirectoryTreeInner, _objectSpread({}, props));
179
192
  }
193
+ //@ts-ignore
180
194
  var Tree_L = Object.assign(Tree_, {
181
195
  TreeNode: TreeNode,
182
- DirectoryTree: DirectoryTree
196
+ DirectoryTree: DirectoryTree,
197
+ RCTree: RCTree
183
198
  });
184
- function aa() {
185
- return /*#__PURE__*/React__default.createElement(Tree_L, null);
186
- }
187
199
  var Inner$4 = /*#__PURE__*/React__default.lazy(function () {
188
200
  return import('./root.10.js');
189
201
  });
@@ -220,6 +232,13 @@ var QRCode_L = /*#__PURE__*/lazy(function () {
220
232
  var Switch_L = /*#__PURE__*/lazy(function () {
221
233
  return import('antd/es/switch');
222
234
  });
235
+ var MyIcon = /*#__PURE__*/lazy(function () {
236
+ return import('./root.25.js');
237
+ });
238
+ var MyIconSelect = /*#__PURE__*/lazy(function () {
239
+ return import('./root.26.js');
240
+ });
241
+ MyIconSelect.DisplayFC = MyIcon;
223
242
  var MyColor = function MyColor(props) {
224
243
  var value = props.value,
225
244
  _onChange = props.onChange,
@@ -234,7 +253,9 @@ var MyColor = function MyColor(props) {
234
253
  }
235
254
  }), allowClear ? /*#__PURE__*/React__default.createElement(Button$1, {
236
255
  size: size,
237
- icon: /*#__PURE__*/React__default.createElement(CloseOutlined, null),
256
+ icon: /*#__PURE__*/React__default.createElement(MyIcon, {
257
+ value: 'CloseOutlined'
258
+ }),
238
259
  onClick: function onClick() {
239
260
  return _onChange === null || _onChange === void 0 ? void 0 : _onChange(null);
240
261
  }
@@ -250,23 +271,58 @@ MyColor.DisplayFC = function (props) {
250
271
  }
251
272
  });
252
273
  };
274
+ function styleInject(css, ref) {
275
+ if (ref === void 0) ref = {};
276
+ var insertAt = ref.insertAt;
277
+ if (!css || typeof document === 'undefined') {
278
+ return;
279
+ }
280
+ var head = document.head || document.getElementsByTagName('head')[0];
281
+ var style = document.createElement('style');
282
+ style.type = 'text/css';
283
+ if (insertAt === 'top') {
284
+ if (head.firstChild) {
285
+ head.insertBefore(style, head.firstChild);
286
+ } else {
287
+ head.appendChild(style);
288
+ }
289
+ } else {
290
+ head.appendChild(style);
291
+ }
292
+ if (style.styleSheet) {
293
+ style.styleSheet.cssText = css;
294
+ } else {
295
+ style.appendChild(document.createTextNode(css));
296
+ }
297
+ }
298
+ var css_248z = ".theme_warning__83Ww2 {\n color: orange !important;\n}\n.theme_warning__83Ww2 input {\n color: orange !important;\n}\n.theme_error__i4RPC {\n color: red !important;\n}\n.theme_error__i4RPC input {\n color: red !important;\n}\n";
299
+ var theme = {
300
+ "warning": "theme_warning__83Ww2",
301
+ "error": "theme_error__i4RPC"
302
+ };
303
+ styleInject(css_248z);
304
+ function get_status_cls(status) {
305
+ if (status === 'error') return theme['error'];
306
+ if (status === 'warning') return theme['warning'];
307
+ }
253
308
  function getInputStyle() {
254
309
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
255
310
  var _props$style = props.style,
256
311
  style = _props$style === void 0 ? {} : _props$style,
257
312
  width = props.width,
258
313
  inputWidth = props.inputWidth,
259
- warning = props.warning,
260
- warn = props.warn;
314
+ status = props.status;
261
315
  if (width) {
262
316
  style.width = style.width || width;
263
317
  }
264
318
  if (inputWidth) {
265
319
  style.minWidth = style.minWidth || inputWidth;
266
320
  }
267
- if (warning || warn) {
268
- style.border = '1px solid red';
269
- style.color = 'red';
321
+ if (status === 'error') {
322
+ style.color = 'red !important';
323
+ }
324
+ if (status === 'warning') {
325
+ style.color = 'yellow !important';
270
326
  }
271
327
  // if (isInt(popupMatchSelectWidth))
272
328
  // style.width = style.width || (popupMatchSelectWidth / 2)
@@ -344,31 +400,96 @@ function handle_form_error(error, form) {
344
400
  }
345
401
  return null;
346
402
  }
403
+ function form_validate(form) {
404
+ return new Promise(function (res, rej) {
405
+ if (!form) {
406
+ rej({
407
+ text: 'form 不存在'
408
+ });
409
+ return;
410
+ }
411
+ form.validateFields().then(function () {
412
+ var formData = form.getFieldsValue();
413
+ res(formData);
414
+ })["catch"](function (error) {
415
+ var first_err = handle_form_error(error, form);
416
+ rej(first_err);
417
+ });
418
+ });
419
+ }
420
+ function fuck_focus(props) {
421
+ var onBlur = props.onBlur;
422
+ var forcusInfo = useRef({});
423
+ function child_focus() {
424
+ var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
425
+ forcusInfo.current = {
426
+ index: index,
427
+ type: 'child'
428
+ };
429
+ }
430
+ function child_blur() {
431
+ var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
432
+ forcusInfo.current = {
433
+ index: undefined,
434
+ type: undefined
435
+ };
436
+ }
437
+ function parent_blur(e) {
438
+ var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
439
+ setTimeout(function () {
440
+ if (forcusInfo.current.index === index && forcusInfo.current.type === 'child') return;
441
+ forcusInfo.current = {
442
+ index: undefined,
443
+ type: undefined
444
+ };
445
+ onBlur === null || onBlur === void 0 || onBlur(e);
446
+ }, 10);
447
+ }
448
+ function parent_focus() {
449
+ var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
450
+ } // setTimeout(() => {
451
+ // forcusInfo.current = { index, type: 'parent' }
452
+ // }, 10);
453
+ return {
454
+ child_blur: child_blur,
455
+ child_focus: child_focus,
456
+ parent_blur: parent_blur,
457
+ parent_focus: parent_focus
458
+ };
459
+ }
347
460
  function get_check_invert_values(configs) {
348
461
  if (!Array.isArray(configs)) return {};
349
462
  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);
463
+ return ['MC', 'MA', 'MS', 'MSW'].includes(_ === null || _ === void 0 ? void 0 : _.inputType) || Array.isArray(_ === null || _ === void 0 ? void 0 : _.children);
351
464
  });
352
465
  var check_invert_values = children.filter(function (_) {
353
466
  return !(_ !== null && _ !== void 0 && _.disabled_check);
354
467
  }).reduce(function (a, item, idx) {
355
- var _ref, _item$name, _item$inputProps;
356
468
  // 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
469
  var cArr = item === null || item === void 0 ? void 0 : item.children;
364
- var cObj = {};
365
470
  if (Array.isArray(cArr)) {
471
+ var cObj = {};
366
472
  cObj = get_check_invert_values(cArr);
367
473
  return _objectSpread(_objectSpread({}, a), cObj);
368
474
  } else {
475
+ var _item$inputProps, _ref, _item$name;
476
+ var props = _objectSpread(_objectSpread({}, (_item$inputProps = item === null || item === void 0 ? void 0 : item.inputProps) !== null && _item$inputProps !== void 0 ? _item$inputProps : {}), {}, {
477
+ config: item
478
+ });
479
+ 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;
480
+ var inputType = item === null || item === void 0 ? void 0 : item.inputType;
481
+ var opts = parse_MC_option(props);
482
+ if (inputType === 'MSW') {
483
+ var _props$checked_value, _props$unchecked_valu;
484
+ return _objectSpread(_objectSpread({}, a), {}, _defineProperty({}, "".concat(name), [(_props$checked_value = props.checked_value) !== null && _props$checked_value !== void 0 ? _props$checked_value : true, (_props$unchecked_valu = props.unchecked_value) !== null && _props$unchecked_valu !== void 0 ? _props$unchecked_valu : false]));
485
+ }
486
+ if (inputType === 'MA' && isEmpty(opts)) {
487
+ return a;
488
+ }
489
+ var firstOption = opts[0];
369
490
  return _objectSpread(_objectSpread({}, a), {}, _defineProperty({}, "".concat(name), [parse_MC_value(props, [firstOption]), null, {
370
491
  props: props,
371
- options: options
492
+ options: opts
372
493
  }]));
373
494
  }
374
495
  }, {});
@@ -389,14 +510,24 @@ function getMarshal(props) {
389
510
  }
390
511
  function parse_MC_value(props, changedValue) {
391
512
  var _props$config, _changedValue$, _changedValue$2;
513
+ var _props$linker = props.linker,
514
+ linker = _props$linker === void 0 ? ',' : _props$linker;
392
515
  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
516
  var marshal = getMarshal(props);
394
517
  var type = get_mode(props);
395
518
  if (!changedValue.length) return null;
396
- if (marshal) return marshal === 2 ? changedValue : JSON.stringify(changedValue);
519
+ if (marshal) {
520
+ if (marshal === 3) {
521
+ return changedValue.map(function (_) {
522
+ return _.value;
523
+ });
524
+ }
525
+ var frugal_value = process_frugal_local(props, changedValue);
526
+ return marshal === 2 ? frugal_value : JSON.stringify(frugal_value);
527
+ }
397
528
  if (type === 'multiple' || type === 'tags') return changedValue.map(function (_) {
398
529
  return _.value;
399
- }).join(',');
530
+ }).join(linker);
400
531
  return (_changedValue$2 = changedValue[0]) === null || _changedValue$2 === void 0 ? void 0 : _changedValue$2.value;
401
532
  }
402
533
  function check_multiple(props) {
@@ -412,7 +543,13 @@ function use_options(props) {
412
543
  var fetch_options = props.fetch_options,
413
544
  optionKey = props.optionKey,
414
545
  _options = props.options,
415
- uniqueKey = props.uniqueKey;
546
+ uniqueKey = props.uniqueKey,
547
+ form = props.form,
548
+ _props$linker2 = props.linker,
549
+ linker = _props$linker2 === void 0 ? ',' : _props$linker2,
550
+ frugal = props.frugal,
551
+ display_linker = props.display_linker,
552
+ fetch_options_on_open = props.fetch_options_on_open;
416
553
  var _useState = useState([]),
417
554
  _useState2 = _slicedToArray(_useState, 2),
418
555
  options = _useState2[0],
@@ -429,24 +566,30 @@ function use_options(props) {
429
566
  var marshal = getMarshal(props);
430
567
  var type = get_mode(props);
431
568
  useEffect(function () {
432
- var safeData = getData(value, options, marshal, type);
569
+ var safeData = getData(value, options, marshal, type, linker, frugal);
433
570
  setData(safeData);
434
571
  }, [value, options]);
572
+ // useEffect(() => {
573
+ // process_options()
574
+ // }, []);
435
575
  useEffect(function () {
576
+ process_options();
577
+ }, [optionKey, _options, uniqueKey]);
578
+ function process_options() {
436
579
  if (fetch_options) {
437
580
  setLoading(true);
438
- safe_fetch_options(fetch_options).then(set_options)["finally"](function () {
581
+ safe_fetch_options(fetch_options, form).then(set_options)["finally"](function () {
439
582
  return setLoading(false);
440
583
  });
441
584
  } else {
442
585
  set_options(parse_MC_option(props));
443
586
  }
444
- }, [fetch_options, optionKey, _options, uniqueKey]);
587
+ }
445
588
  var is_multiple = check_multiple(props);
446
589
  // mchcLogger.log('MySelect', { data, options, props })
447
590
  var label = is_multiple ? data.map(function (_) {
448
591
  return _.label;
449
- }).join(',') : (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.label;
592
+ }).join(display_linker !== null && display_linker !== void 0 ? display_linker : linker) : (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.label;
450
593
  var safe_node = label !== null && label !== void 0 ? label : '';
451
594
  var display_node = /*#__PURE__*/React__default.createElement("span", {
452
595
  title: safe_node
@@ -456,29 +599,54 @@ function use_options(props) {
456
599
  options: options,
457
600
  data: data,
458
601
  setData: setData,
459
- display_node: display_node
602
+ display_node: display_node,
603
+ process_options: process_options
460
604
  };
461
605
  }
606
+ function process_frugal_local(props, changedValue) {
607
+ var frugal = props.frugal;
608
+ if (!frugal) return changedValue;
609
+ console.log('frugal_value local', changedValue[0]);
610
+ return changedValue[0];
611
+ }
612
+ function process_frugal_remote(value, frugal) {
613
+ if (!frugal) return safe_json_parse_arr(value, value);
614
+ var frugal_value = safe_json_parse(value);
615
+ console.log('frugal_value remote', frugal_value);
616
+ if (isNil(frugal_value === null || frugal_value === void 0 ? void 0 : frugal_value.value)) return [];
617
+ return [frugal_value];
618
+ }
619
+ function process_primary_array_value(value, options) {
620
+ if (isArray(value) && value.every(isPrimitive)) {
621
+ return value.map(function (v) {
622
+ var _options$find;
623
+ return (_options$find = options.find(function (opt) {
624
+ return numberLikeCompare(v, opt.value);
625
+ })) !== null && _options$find !== void 0 ? _options$find : {
626
+ value: v,
627
+ label: v
628
+ };
629
+ });
630
+ }
631
+ return [];
632
+ }
462
633
  function getData(value, options, marshal, type) {
463
- var unMarshalData = safe_json_parse_arr(value, value);
634
+ var l = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ',';
635
+ var frugal = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
636
+ if (marshal === 3) {
637
+ return process_primary_array_value(value, options);
638
+ }
639
+ var unMarshalData = process_frugal_remote(value, frugal);
464
640
  var splitValue = function splitValue() {
465
- return isString(value) ? value.split(',').filter(function (_) {
641
+ return isString(value) ? value.split(l).filter(function (_) {
466
642
  return _;
467
643
  }) : [];
468
644
  };
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)
645
+ var v = [1, 2].includes(marshal) ? unMarshalData : (type === 'multiple' || type === 'tags') && isString(value) ? process_primary_array_value(splitValue(), options) : value;
646
+ var safeData = Array.isArray(v) ? v : isNumber(v) || isString(v) || isBoolean(v) || isNull(v)
479
647
  // ? options.filter(_ => _.value === v)
480
- ? options.filter(function (_) {
481
- return numberLikeCompare(_.value, v);
648
+ ? options.filter(function (opt) {
649
+ return numberLikeCompare(opt.value, v);
482
650
  }) : [];
483
651
  // mchcLogger.log('MySelect', { numberLikeCompare, v, options })
484
652
  return safeData;
@@ -491,9 +659,8 @@ function parse_MC_option(props) {
491
659
  var optionKey = props.optionKey;
492
660
  var preOptions = optionKey ? getPresetOptions(optionKey, marshal === 0) : null;
493
661
  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;
662
+ var opts = (_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;
663
+ return opts;
497
664
  }
498
665
  function parse_MC_dict_options(props) {
499
666
  if (!(props !== null && props !== void 0 && props.uniqueKey)) return;
@@ -519,36 +686,40 @@ function parse_MC_string_options(props) {
519
686
  var _config$inputType;
520
687
  if (!props) return [];
521
688
  var useString = props.useString,
689
+ _props$useDefault = props.useDefault,
690
+ useDefault = _props$useDefault === void 0 ? true : _props$useDefault,
522
691
  type = props.type,
523
692
  config = props.config,
524
693
  startIndex = props.startIndex,
525
694
  sp = props.sp;
526
- var _options = isFunction(props.options) ? props.options() : props.options;
527
- if (!isString(_options)) return isArray(_options) ? _options.map(function (_) {
695
+ var _opt = isFunction(props.options) ? props.options() : props.options;
696
+ if (!isString(_opt)) return isArray(_opt) ? _opt.map(function (_) {
528
697
  return isString(_) ? {
529
698
  value: _,
530
699
  label: _
531
700
  } : _;
532
- }) : [];
701
+ }).filter(identity) : [];
533
702
  var input_type = (_config$inputType = config === null || config === void 0 ? void 0 : config.inputType) !== null && _config$inputType !== void 0 ? _config$inputType : 'MC';
534
703
  var multiple = type === 'multiple';
535
704
  var marshal = getMarshal(props);
536
- var options = getDualModeOptions(_options, {
705
+ var opts = getDualModeOptions(_opt, {
537
706
  sp: sp,
538
707
  useString: multiple && !marshal || useString,
539
- start: startIndex
708
+ start: startIndex,
709
+ useDefault: useDefault
540
710
  });
541
- return input_type === 'MA' ? options[1] : options[0];
711
+ return input_type === 'MA' ? opts[1] : opts[0];
542
712
  }
543
- function displayValue(_options, value, isMul) {
544
- var _value = _options.filter(function (o) {
713
+ function displayValue(_opt, value) {
714
+ var l = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
715
+ var _value = _opt.filter(function (o) {
545
716
  return value.find(function (v) {
546
717
  return v.value == o.value;
547
718
  });
548
719
  });
549
720
  return _value.map(function (_) {
550
721
  return _.label;
551
- }).join(',');
722
+ }).join(l);
552
723
  }
553
724
  function get_unknown_conf(props) {
554
725
  var showUnknown = props.showUnknown,
@@ -556,31 +727,31 @@ function get_unknown_conf(props) {
556
727
  return showUnknown || unknown;
557
728
  }
558
729
  var defaultOptions = [];
559
- var defaultGetPopupContainer = function defaultGetPopupContainer() {
730
+ var defaultGetPopupContainer$1 = function defaultGetPopupContainer$1() {
560
731
  return document.body;
561
732
  };
562
733
  var UNKNOWN_TIME_SYMBOL = '1970-01-01 00:00:00';
563
734
  function formatDatePickerProps(props) {
564
735
  var _data$getPopupContain;
565
736
  var data = _objectSpread({}, props);
566
- if (!data.format) {
737
+ if (data.format === undefined) {
567
738
  if (props.time_only) {
568
739
  data.format = 'HH:mm';
569
740
  } else {
570
741
  data.format = data.showTime ? formatDateTimeNoSecond.format : formatDate.format;
571
742
  }
572
743
  }
573
- data.getPopupContainer = (_data$getPopupContain = data.getPopupContainer) !== null && _data$getPopupContain !== void 0 ? _data$getPopupContain : defaultGetPopupContainer;
744
+ data.getPopupContainer = (_data$getPopupContain = data.getPopupContainer) !== null && _data$getPopupContain !== void 0 ? _data$getPopupContain : defaultGetPopupContainer$1;
574
745
  return data;
575
746
  }
576
747
  function getIsUnknown(props) {
577
748
  var value = props.value;
578
- var symbolValue = handleChangeValue(props, UNKNOWN_TIME_SYMBOL);
579
- var _value = handleChangeValue(props, value);
749
+ var symbolValue = handleChangeValue$1(props, UNKNOWN_TIME_SYMBOL);
750
+ var _value = handleChangeValue$1(props, value);
580
751
  var isUnknown = _value === symbolValue && get_unknown_conf(props);
581
752
  return isUnknown;
582
753
  }
583
- var handleChangeValue = function handleChangeValue(_ref4, date) {
754
+ var handleChangeValue$1 = function handleChangeValue$1(_ref4, date) {
584
755
  var valueType = _ref4.valueType,
585
756
  format = _ref4.format;
586
757
  var result = date;
@@ -592,18 +763,118 @@ var handleChangeValue = function handleChangeValue(_ref4, date) {
592
763
  }
593
764
  return result;
594
765
  };
595
- var DisplayFC$2 = function DisplayFC$2(_props) {
766
+ var DisplayFC$3 = function DisplayFC$3(_props) {
596
767
  var props = formatDatePickerProps(_props);
597
768
  var value = props.value,
598
769
  format = props.format;
770
+ if (!value) return null;
599
771
  var isUnknown = getIsUnknown(props);
600
772
  var m = getMomentObj(value);
601
773
  return /*#__PURE__*/React__default.createElement("span", null, isUnknown ? '不详' : m.isValid() ? m.format(format) : EMPTY_PLACEHOLDER);
602
774
  };
603
775
  var MyDatePicker = /*#__PURE__*/lazy(function () {
604
- return import('./root.23.js');
776
+ return import('./root.28.js');
777
+ });
778
+ MyDatePicker.DisplayFC = DisplayFC$3;
779
+ var defaultGetPopupContainer = function defaultGetPopupContainer() {
780
+ return document.body;
781
+ };
782
+ // & Omit<RangePickerProps, 'value' | 'disabled'>
783
+ function process_value_remote(value, marshal, linker) {
784
+ var _value = value;
785
+ var safeValue = [];
786
+ if (isArray(_value)) return _value;
787
+ switch (marshal) {
788
+ case 0:
789
+ if (isString(_value)) safeValue = _value.split(linker);
790
+ break;
791
+ case 1:
792
+ if (isString(_value)) safeValue = safe_json_parse_arr(_value);
793
+ break;
794
+ default:
795
+ if (isArray(_value)) safeValue = _value;
796
+ break;
797
+ }
798
+ return Array.isArray(safeValue) ? safeValue : [];
799
+ }
800
+ function format_range_props(props) {
801
+ var _data$format, _data$marshal, _data$linker, _data$getPopupContain2;
802
+ var data = _objectSpread({}, props);
803
+ data.format = (_data$format = data.format) !== null && _data$format !== void 0 ? _data$format : 'YYYY-MM-DD';
804
+ data.marshal = (_data$marshal = data.marshal) !== null && _data$marshal !== void 0 ? _data$marshal : 1;
805
+ data.linker = (_data$linker = data.linker) !== null && _data$linker !== void 0 ? _data$linker : ',';
806
+ var _value = props.value;
807
+ var safeValue = process_value_remote(_value, data.marshal, data.linker);
808
+ data.value = safeValue.map(function (_) {
809
+ return dayjs(_, data.format);
810
+ });
811
+ data.display_value = safeValue;
812
+ data.getPopupContainer = (_data$getPopupContain2 = data.getPopupContainer) !== null && _data$getPopupContain2 !== void 0 ? _data$getPopupContain2 : defaultGetPopupContainer;
813
+ return data;
814
+ }
815
+ var handleChangeValue = function handleChangeValue(_ref5, date) {
816
+ var format = _ref5.format,
817
+ marshal = _ref5.marshal,
818
+ linker = _ref5.linker;
819
+ if (!date) return null;
820
+ var format_date = date.map(function (_) {
821
+ var _$format;
822
+ return (_$format = _ === null || _ === void 0 ? void 0 : _.format(format)) !== null && _$format !== void 0 ? _$format : null;
823
+ });
824
+ console.log('format change', {
825
+ marshal: marshal,
826
+ format_date: format_date
827
+ });
828
+ switch (marshal) {
829
+ case 0:
830
+ return format_date.join(linker);
831
+ case 1:
832
+ return safe_json_stringify(format_date);
833
+ default:
834
+ return format_date;
835
+ }
836
+ };
837
+ var DisplayFC$2 = function DisplayFC$2(_props) {
838
+ var props = format_range_props(_props);
839
+ var linker = props.linker;
840
+ var disPlay_value = props.display_value;
841
+ return disPlay_value.join(linker);
842
+ };
843
+ var MyRangePicker = /*#__PURE__*/lazy(function () {
844
+ return import('./root.24.js');
605
845
  });
606
- MyDatePicker.DisplayFC = DisplayFC$2;
846
+ var MyRangeDate = function MyRangeDate(props) {
847
+ var placeholder = props.placeholder,
848
+ rest = _objectWithoutProperties(props, _excluded);
849
+ return /*#__PURE__*/React__default.createElement(MyRangePicker
850
+ // ranges={getMomentRange(dayjs) as any}
851
+ , _objectSpread({
852
+ // ranges={getMomentRange(dayjs) as any}
853
+ format: "YYYY-MM-DD",
854
+ style: {
855
+ width: 230
856
+ }
857
+ }, rest));
858
+ };
859
+ var MyRangeDateTime = function MyRangeDateTime(props) {
860
+ var placeholder = props.placeholder,
861
+ rest = _objectWithoutProperties(props, _excluded2);
862
+ return /*#__PURE__*/React__default.createElement(MyRangePicker
863
+ // ranges={getMomentRange(dayjs) as any}
864
+ , _objectSpread({
865
+ // ranges={getMomentRange(dayjs) as any}
866
+ showTime: {
867
+ defaultValue: [dayjs('00:00', 'HH:mm'), dayjs('23:59', 'HH:mm')]
868
+ },
869
+ format: "YYYY-MM-DD HH:mm",
870
+ style: {
871
+ width: 320
872
+ }
873
+ }, rest));
874
+ };
875
+ MyRangeDate.DisplayFC = DisplayFC$2;
876
+ MyRangeDateTime.DisplayFC = DisplayFC$2;
877
+ MyRangePicker.DisplayFC = DisplayFC$2;
607
878
 
608
879
  // .ant-input-affix-wrapper-borderless
609
880
  var UNKNOWN_NUMBER_SYMBOL = 2147483647;
@@ -613,7 +884,7 @@ var MyInputNumber = function MyInputNumber_(props) {
613
884
  placeholder = props.placeholder,
614
885
  warning = props.warning,
615
886
  disabled = props.disabled,
616
- others = _objectWithoutProperties(props, _excluded);
887
+ others = _objectWithoutProperties(props, _excluded3);
617
888
  var _style = getInputStyle(props);
618
889
  var unkown_conf = get_unknown_conf(props);
619
890
  var isUnkown = unkown_conf && value === UNKNOWN_NUMBER_SYMBOL;
@@ -621,7 +892,10 @@ var MyInputNumber = function MyInputNumber_(props) {
621
892
  _style.flex = 1;
622
893
  }
623
894
  // 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), {}, {
895
+ var node = /*#__PURE__*/React__default.createElement(InputNumber, _objectSpread(_objectSpread({
896
+ className: get_status_cls(props.status),
897
+ controls: false
898
+ }, others), {}, {
625
899
  disabled: disabled,
626
900
  placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '请输入',
627
901
  style: _objectSpread({
@@ -678,8 +952,8 @@ var MyInput = /*#__PURE__*/forwardRef(function (props, myRef) {
678
952
  value = props.value,
679
953
  _onChange3 = props.onChange,
680
954
  type = props.type,
681
- others = _objectWithoutProperties(props, _excluded2);
682
- if (type === 'number') return /*#__PURE__*/React__default.createElement(MyInputNumber, _objectSpread({}, props));
955
+ others = _objectWithoutProperties(props, _excluded4);
956
+ if (type === "number") return /*#__PURE__*/React__default.createElement(MyInputNumber, _objectSpread({}, props));
683
957
  var _useState7 = useState(value),
684
958
  _useState8 = _slicedToArray(_useState7, 2),
685
959
  _value = _useState8[0],
@@ -689,18 +963,20 @@ var MyInput = /*#__PURE__*/forwardRef(function (props, myRef) {
689
963
  }, [value]);
690
964
  var _style = getInputStyle(props);
691
965
  return /*#__PURE__*/React__default.createElement(Input, _objectSpread(_objectSpread({
692
- title: JSON.stringify(_style),
693
966
  ref: myRef,
694
967
  value: _value,
968
+ title: value,
695
969
  onChange: function onChange(e) {
696
970
  var v = e.target.value;
697
971
  set_value(v);
698
972
  _onChange3 === null || _onChange3 === void 0 || _onChange3(v);
699
973
  },
974
+ classNames: {
975
+ input: get_status_cls(props.status)
976
+ },
700
977
  style: _style
701
978
  }, others), {}, {
702
- // placeholder={placeholder ?? '请输入'}
703
- placeholder: '请输入'
979
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "请输入"
704
980
  }));
705
981
  });
706
982
  MyInput.DisplayFC = function (props) {
@@ -720,19 +996,122 @@ var MySelect = Object.assign(Inner, {
720
996
  DisplayFC: DisplayFC
721
997
  });
722
998
  var MySwitch = function MySwitch(props) {
723
- return /*#__PURE__*/React__default.createElement(Switch_L, _objectSpread({}, props));
999
+ var _props$checked_value2 = props.checked_value,
1000
+ checked_value = _props$checked_value2 === void 0 ? true : _props$checked_value2,
1001
+ _props$unchecked_valu2 = props.unchecked_value,
1002
+ unchecked_value = _props$unchecked_valu2 === void 0 ? false : _props$unchecked_valu2,
1003
+ _onChange4 = props.onChange,
1004
+ value = props.value;
1005
+ if (props.switch_type === 'checkbox') return /*#__PURE__*/React__default.createElement(MyCheckbox, _objectSpread(_objectSpread({}, props), {}, {
1006
+ options: [{
1007
+ value: checked_value
1008
+ }],
1009
+ marshal: 0,
1010
+ value: value === checked_value ? checked_value : null,
1011
+ onChange: function onChange(v) {
1012
+ console.log('switch', v);
1013
+ _onChange4 === null || _onChange4 === void 0 || _onChange4(v === null ? unchecked_value : checked_value);
1014
+ }
1015
+ }));
1016
+ return /*#__PURE__*/React__default.createElement(Switch_L, _objectSpread(_objectSpread({}, props), {}, {
1017
+ value: value === checked_value,
1018
+ onChange: function onChange(v) {
1019
+ _onChange4 === null || _onChange4 === void 0 || _onChange4(v !== true ? unchecked_value : checked_value);
1020
+ }
1021
+ }));
724
1022
  };
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;
1023
+ MySwitch.DisplayFC = function (_ref6) {
1024
+ var _ref7, _ref8;
1025
+ var value = _ref6.value,
1026
+ checkedChildren = _ref6.checkedChildren,
1027
+ checked_text = _ref6.checked_text,
1028
+ unCheckedChildren = _ref6.unCheckedChildren,
1029
+ unchecked_text = _ref6.unchecked_text;
732
1030
  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);
1031
+ return value ? (_ref7 = checkedChildren !== null && checkedChildren !== void 0 ? checkedChildren : checked_text) !== null && _ref7 !== void 0 ? _ref7 : /*#__PURE__*/React__default.createElement(MyIcon, {
1032
+ value: 'CheckOutlined'
1033
+ }) : (_ref8 = unCheckedChildren !== null && unCheckedChildren !== void 0 ? unCheckedChildren : unchecked_text) !== null && _ref8 !== void 0 ? _ref8 : /*#__PURE__*/React__default.createElement(MyIcon, {
1034
+ value: 'CloseOutlined'
1035
+ });
734
1036
  };
1037
+ function MyButton(props) {
1038
+ var btn_text = props.btn_text,
1039
+ defaultIcon = props.defaultIcon,
1040
+ onClick = props.onClick,
1041
+ form = props.form,
1042
+ children = props.children,
1043
+ icon = props.icon,
1044
+ loading = props.loading,
1045
+ primary = props.primary,
1046
+ hidden = props.hidden,
1047
+ on_btn_click = props.on_btn_click,
1048
+ title = props.title,
1049
+ others = _objectWithoutProperties(props, _excluded5);
1050
+ if (hidden) return null;
1051
+ var type = props.type;
1052
+ var _useState9 = useState(false),
1053
+ _useState10 = _slicedToArray(_useState9, 2),
1054
+ visible = _useState10[0],
1055
+ setVisible = _useState10[1];
1056
+ var _icon = visible ? defaultIcon !== null && defaultIcon !== void 0 ? defaultIcon : /*#__PURE__*/React__default.createElement(MyIcon, {
1057
+ value: 'LoadingOutlined'
1058
+ }) : icon;
1059
+ if (primary) {
1060
+ type = 'primary';
1061
+ }
1062
+ useEffect(function () {
1063
+ if (loading) setVisible(false);
1064
+ }, [loading]);
1065
+ function on_click_call(_x) {
1066
+ return _on_click_call.apply(this, arguments);
1067
+ }
1068
+ function _on_click_call() {
1069
+ _on_click_call = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
1070
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1071
+ while (1) switch (_context2.prev = _context2.next) {
1072
+ case 0:
1073
+ _context2.next = 2;
1074
+ return safe_async_call(onClick, e);
1075
+ case 2:
1076
+ _context2.next = 4;
1077
+ return safe_async_call(on_btn_click, e, form);
1078
+ case 4:
1079
+ case "end":
1080
+ return _context2.stop();
1081
+ }
1082
+ }, _callee2);
1083
+ }));
1084
+ return _on_click_call.apply(this, arguments);
1085
+ }
1086
+ function on_click(e) {
1087
+ if (visible) return;
1088
+ setVisible(true);
1089
+ safe_async_call(on_click_call, e)["finally"](/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
1090
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1091
+ while (1) switch (_context.prev = _context.next) {
1092
+ case 0:
1093
+ _context.next = 2;
1094
+ return sleep(200);
1095
+ case 2:
1096
+ setVisible(false);
1097
+ case 3:
1098
+ case "end":
1099
+ return _context.stop();
1100
+ }
1101
+ }, _callee);
1102
+ })));
1103
+ }
1104
+ // const node = (visible) ? tip : (text ?? children)
1105
+ return /*#__PURE__*/React__default.createElement(Button$1, _objectSpread(_objectSpread({}, others), {}, {
1106
+ title: title || btn_text,
1107
+ icon: _icon,
1108
+ type: type,
1109
+ onClick: on_click
1110
+ }), btn_text !== null && btn_text !== void 0 ? btn_text : children);
1111
+ }
735
1112
  var packs = {
1113
+ Divider: Divider,
1114
+ MyIconSelect: MyIconSelect,
736
1115
  MI: MyInput,
737
1116
  input: MyInput,
738
1117
  Input: MyInput,
@@ -746,12 +1125,25 @@ var packs = {
746
1125
  single_date_picker: MyDatePicker,
747
1126
  CusDatePicker: MyDatePicker,
748
1127
  date: MyDatePicker,
1128
+ MyRangePicker: MyRangePicker,
1129
+ RangePicker: MyRangePicker,
1130
+ rangePicker: MyRangePicker,
1131
+ range_picker: MyRangePicker,
1132
+ MyRangeDate: MyRangeDate,
1133
+ RangeDate: MyRangeDate,
1134
+ rangeDate: MyRangeDate,
1135
+ range_date: MyRangeDate,
1136
+ MyRangeDateTime: MyRangeDateTime,
1137
+ RangeDateTime: MyRangeDateTime,
1138
+ rangeDateTime: MyRangeDateTime,
1139
+ range_date_time: MyRangeDateTime,
749
1140
  MyColor: MyColor,
750
1141
  MySwitch: MySwitch,
751
1142
  "switch": MySwitch,
752
1143
  Switch: MySwitch,
1144
+ MSW: MySwitch,
753
1145
  ArrayInput: ArrayInput,
754
- MArr: ArrayInput,
1146
+ ArraySingle: ArraySingle,
755
1147
  MySelect: MySelect,
756
1148
  MS: MySelect,
757
1149
  Select: MySelect,
@@ -761,6 +1153,7 @@ var packs = {
761
1153
  MC: MyCheckbox,
762
1154
  checkbox: MyCheckbox,
763
1155
  // CheckboxWithInput: MyCheckbox,
1156
+ MyButton: MyButton,
764
1157
  MyAutoComplete: MyAutoComplete,
765
1158
  MA: MyAutoComplete,
766
1159
  AutoComplete: MyAutoComplete,
@@ -800,10 +1193,10 @@ var GlobalModal_ = /*#__PURE__*/function () {
800
1193
  }
801
1194
  return _createClass(GlobalModal_, [{
802
1195
  key: "confirmOnce",
803
- value: function confirmOnce(_ref8) {
804
- var storeKey = _ref8.storeKey,
805
- cb = _ref8.cb,
806
- others = _objectWithoutProperties(_ref8, _excluded3);
1196
+ value: function confirmOnce(_ref10) {
1197
+ var storeKey = _ref10.storeKey,
1198
+ cb = _ref10.cb,
1199
+ others = _objectWithoutProperties(_ref10, _excluded6);
807
1200
  var isAllow = localStorage.get(storeKey);
808
1201
  if (isNil(isAllow)) {
809
1202
  Modal.confirm(_objectSpread(_objectSpread({}, others), {}, {
@@ -901,10 +1294,10 @@ var GlobalModal = /*#__PURE__*/function () {
901
1294
  }
902
1295
  }, {
903
1296
  key: "confirmOnce",
904
- value: function confirmOnce(_ref9) {
905
- var storeKey = _ref9.storeKey,
906
- cb = _ref9.cb,
907
- others = _objectWithoutProperties(_ref9, _excluded4);
1297
+ value: function confirmOnce(_ref11) {
1298
+ var storeKey = _ref11.storeKey,
1299
+ cb = _ref11.cb,
1300
+ others = _objectWithoutProperties(_ref11, _excluded7);
908
1301
  var isAllow = localStorage.get(storeKey);
909
1302
  if (isNil(isAllow)) {
910
1303
  Modal.confirm(_objectSpread(_objectSpread({}, others), {}, {
@@ -926,10 +1319,10 @@ function MountGlobalModal(props) {
926
1319
  var meta = props.meta,
927
1320
  globalModal = props.globalModal;
928
1321
  // useNotification()
929
- var _useState9 = useState([]),
930
- _useState10 = _slicedToArray(_useState9, 2),
931
- modalQueue = _useState10[0],
932
- setModalQueue = _useState10[1];
1322
+ var _useState11 = useState([]),
1323
+ _useState12 = _slicedToArray(_useState11, 2),
1324
+ modalQueue = _useState12[0],
1325
+ setModalQueue = _useState12[1];
933
1326
  useEffect(function () {
934
1327
  globalModal.init(modalQueue, setModalQueue);
935
1328
  }, [modalQueue]);
@@ -938,10 +1331,10 @@ function MountGlobalModal(props) {
938
1331
  }
939
1332
  return /*#__PURE__*/React__default.createElement(Suspense, {
940
1333
  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;
1334
+ }, modalQueue.map(function (_ref12) {
1335
+ var name = _ref12.name,
1336
+ data = _ref12.data,
1337
+ id = _ref12.id;
945
1338
  var C = meta[name] || function () {
946
1339
  return null;
947
1340
  };
@@ -1007,4 +1400,4 @@ var ContainerDimensions = /*#__PURE__*/function (_Component) {
1007
1400
  }
1008
1401
  }]);
1009
1402
  }(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 };
1403
+ export { displayValue as $, ArrayInput as A, MyColor as B, Checkbox_L as C, Dropdown_L as D, MyIconSelect as E, MyAutoComplete as F, MyButton as G, MySwitch as H, MountGlobalModal as I, GlobalModal_ as J, GlobalModal as K, MyMonaco as L, MyIcon as M, MyLazyComponent as N, isUrl as O, getArray as P, getFormat as Q, RangePicker_L as R, Select_L as S, TimePicker_L as T, UNKNOWN_TIME_SYMBOL as U, getParamByName as V, handle_form_error as W, form_validate as X, fuck_focus as Y, get_check_invert_values as Z, parse_MC_dict_options as _, getMarshal as a, Calendar_L as a0, AutoComplete_L as a1, ColorPicker_L as a2, Form_L as a3, Table_L as a4, Tree_L as a5, Modal_L as a6, Pagination_L as a7, SelectOption_L as a8, TreeSelect_L as a9, QRCode_L as aa, Switch_L as ab, ContainerDimensions as ac, get_mode as b, check_multiple as c, parse_MC_value as d, MyInput as e, format_range_props as f, getInputStyle as g, handleChangeValue as h, parse_MC_option as i, get_status_cls as j, MonthPicker_L as k, formatDatePickerProps as l, getIsUnknown as m, DatePicker_L as n, get_unknown_conf as o, packs as p, handleChangeValue$1 as q, MySelect as r, styleInject as s, MyCheckbox_Display as t, use_options as u, MyCheckbox as v, ArraySingle as w, MyRangePicker as x, MyRangeDate as y, MyRangeDateTime as z };