funda-ui 3.8.815 → 3.8.821

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 (55) hide show
  1. package/CascadingSelect/index.js +4 -2
  2. package/CascadingSelectE2E/index.js +4 -2
  3. package/Checkbox/index.js +6 -3
  4. package/ColorPicker/index.js +6 -3
  5. package/Date/index.js +12 -6
  6. package/DynamicFields/index.js +4 -2
  7. package/File/index.js +2 -1
  8. package/Input/index.js +6 -3
  9. package/LiveSearch/index.js +6 -3
  10. package/MultiFuncSelect/index.js +6 -3
  11. package/Radio/index.js +50 -9
  12. package/RangeSlider/index.js +6 -3
  13. package/SearchBar/index.js +6 -3
  14. package/Select/index.js +6 -3
  15. package/Switch/index.js +6 -3
  16. package/Table/index.js +10 -5
  17. package/TagInput/index.js +6 -3
  18. package/Textarea/index.js +6 -3
  19. package/Tree/index.js +6 -3
  20. package/lib/cjs/CascadingSelect/index.js +4 -2
  21. package/lib/cjs/CascadingSelectE2E/index.js +4 -2
  22. package/lib/cjs/Checkbox/index.js +6 -3
  23. package/lib/cjs/ColorPicker/index.js +6 -3
  24. package/lib/cjs/Date/index.js +12 -6
  25. package/lib/cjs/DynamicFields/index.js +4 -2
  26. package/lib/cjs/File/index.js +2 -1
  27. package/lib/cjs/Input/index.js +6 -3
  28. package/lib/cjs/LiveSearch/index.js +6 -3
  29. package/lib/cjs/MultiFuncSelect/index.js +6 -3
  30. package/lib/cjs/Radio/index.js +50 -9
  31. package/lib/cjs/RangeSlider/index.js +6 -3
  32. package/lib/cjs/SearchBar/index.js +6 -3
  33. package/lib/cjs/Select/index.js +6 -3
  34. package/lib/cjs/Switch/index.js +6 -3
  35. package/lib/cjs/Table/index.js +10 -5
  36. package/lib/cjs/TagInput/index.js +6 -3
  37. package/lib/cjs/Textarea/index.js +6 -3
  38. package/lib/cjs/Tree/index.js +6 -3
  39. package/lib/esm/CascadingSelect/index.tsx +2 -2
  40. package/lib/esm/CascadingSelectE2E/index.tsx +2 -2
  41. package/lib/esm/Checkbox/index.tsx +3 -3
  42. package/lib/esm/ColorPicker/index.tsx +3 -3
  43. package/lib/esm/Date/index.tsx +3 -3
  44. package/lib/esm/DynamicFields/index.tsx +2 -2
  45. package/lib/esm/File/index.tsx +1 -1
  46. package/lib/esm/Input/index.tsx +3 -3
  47. package/lib/esm/MultiFuncSelect/index.tsx +3 -3
  48. package/lib/esm/Radio/index.tsx +47 -4
  49. package/lib/esm/SearchBar/index.tsx +3 -3
  50. package/lib/esm/Select/index.tsx +3 -3
  51. package/lib/esm/Switch/index.tsx +3 -3
  52. package/lib/esm/Table/index.tsx +2 -2
  53. package/lib/esm/TagInput/index.tsx +3 -3
  54. package/lib/esm/Textarea/index.tsx +3 -3
  55. package/package.json +1 -1
@@ -1053,7 +1053,8 @@ var CascadingSelect = function CascadingSelect(props) {
1053
1053
  return fetchData(_params.join(','));
1054
1054
  }
1055
1055
  function handleFocus(event) {
1056
- rootRef.current.classList.add('focus');
1056
+ var _rootRef$current;
1057
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
1057
1058
 
1058
1059
  //
1059
1060
  handleDisplayOptions(null);
@@ -1062,9 +1063,10 @@ var CascadingSelect = function CascadingSelect(props) {
1062
1063
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
1063
1064
  }
1064
1065
  function handleBlur(event) {
1066
+ var _rootRef$current2;
1065
1067
  //----
1066
1068
  //remove focus style
1067
- rootRef.current.classList.remove('focus');
1069
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1068
1070
 
1069
1071
  //
1070
1072
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
@@ -1319,7 +1319,8 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
1319
1319
  return fetchData(fetchArray[dataDepth], _params.join(','), dataDepth, parentId);
1320
1320
  }
1321
1321
  function handleFocus(event) {
1322
- rootRef.current.classList.add('focus');
1322
+ var _rootRef$current;
1323
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
1323
1324
 
1324
1325
  //
1325
1326
  handleDisplayOptions(null);
@@ -1328,9 +1329,10 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
1328
1329
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
1329
1330
  }
1330
1331
  function handleBlur(event) {
1332
+ var _rootRef$current2;
1331
1333
  //----
1332
1334
  //remove focus style
1333
- rootRef.current.classList.remove('focus');
1335
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1334
1336
 
1335
1337
  //
1336
1338
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
package/Checkbox/index.js CHANGED
@@ -140,18 +140,20 @@ var Checkbox = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
140
140
  setVal = _useState2[1]; // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
141
141
 
142
142
  function handleFocus(event) {
143
- rootRef.current.classList.add('focus');
143
+ var _rootRef$current;
144
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
144
145
 
145
146
  //
146
147
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
147
148
  }
148
149
  function handleChange(event) {
150
+ var _rootRef$current2;
149
151
  var _val = event.target.checked;
150
152
  setVal(_val);
151
153
 
152
154
  //----
153
155
  //remove focus style
154
- rootRef.current.classList.remove('focus');
156
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
155
157
 
156
158
  //
157
159
  if (typeof onChange === 'function') {
@@ -159,9 +161,10 @@ var Checkbox = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
159
161
  }
160
162
  }
161
163
  function handleBlur(event) {
164
+ var _rootRef$current3;
162
165
  //----
163
166
  //remove focus style
164
- rootRef.current.classList.remove('focus');
167
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
165
168
 
166
169
  //
167
170
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
@@ -148,7 +148,8 @@ var ColorPicker = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
148
148
  }
149
149
  }
150
150
  function handleFocus(event) {
151
- rootRef.current.classList.add('focus');
151
+ var _rootRef$current;
152
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
152
153
 
153
154
  //
154
155
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
@@ -160,7 +161,8 @@ var ColorPicker = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
160
161
  //----
161
162
  //remove focus style
162
163
  if (val === '') {
163
- rootRef.current.classList.remove('focus');
164
+ var _rootRef$current2;
165
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
164
166
  }
165
167
 
166
168
  //
@@ -173,7 +175,8 @@ var ColorPicker = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
173
175
  //----
174
176
  //remove focus style
175
177
  if (val === '') {
176
- rootRef.current.classList.remove('focus');
178
+ var _rootRef$current3;
179
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
177
180
  }
178
181
 
179
182
  //
package/Date/index.js CHANGED
@@ -991,7 +991,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
991
991
  }
992
992
  }
993
993
  function handleFocus(event) {
994
- rootRef.current.classList.add('focus');
994
+ var _rootRef$current;
995
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
995
996
 
996
997
  //
997
998
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
@@ -1003,7 +1004,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1003
1004
  //----
1004
1005
  //remove focus style
1005
1006
  if (val === '') {
1006
- rootRef.current.classList.remove('focus');
1007
+ var _rootRef$current2;
1008
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1007
1009
  }
1008
1010
 
1009
1011
  //
@@ -1023,7 +1025,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1023
1025
  //----
1024
1026
  //remove focus style
1025
1027
  if (val === '') {
1026
- rootRef.current.classList.remove('focus');
1028
+ var _rootRef$current3;
1029
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
1027
1030
  }
1028
1031
 
1029
1032
  //
@@ -2429,10 +2432,11 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2429
2432
  }
2430
2433
  function handleClickOutside(event) {
2431
2434
  if (event.target.closest(".date2d__wrapper") === null && event.target.closest(".date2d-cal__wrapper") === null) {
2435
+ var _rootRef$current;
2432
2436
  popwinPosHide();
2433
2437
 
2434
2438
  //remove focus style
2435
- rootRef.current.classList.remove('focus');
2439
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.remove('focus');
2436
2440
  }
2437
2441
  }
2438
2442
  function handleShow() {
@@ -2443,7 +2447,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2443
2447
  }, 0);
2444
2448
  }
2445
2449
  function handleFocus(event) {
2446
- rootRef.current.classList.add('focus');
2450
+ var _rootRef$current2;
2451
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.add('focus');
2447
2452
 
2448
2453
  //
2449
2454
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
@@ -2455,8 +2460,9 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2455
2460
  _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, val, (0,utils_date.isValidDate)(val));
2456
2461
  }
2457
2462
  function handleBlur(event) {
2463
+ var _rootRef$current3;
2458
2464
  //remove focus style
2459
- rootRef.current.classList.remove('focus');
2465
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
2460
2466
 
2461
2467
  //
2462
2468
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current);
@@ -187,9 +187,11 @@ var DynamicFields = function DynamicFields(props) {
187
187
  function emptyContentEnabled(type) {
188
188
  if (innerAppendEmptyContent === '' || typeof innerAppendEmptyContent === 'undefined') return false;
189
189
  if (type === 'add') {
190
- emptyRef.current.classList.add(ITEM_HIDE_CLASSNAME);
190
+ var _emptyRef$current;
191
+ (_emptyRef$current = emptyRef.current) === null || _emptyRef$current === void 0 ? void 0 : _emptyRef$current.classList.add(ITEM_HIDE_CLASSNAME);
191
192
  } else {
192
- emptyRef.current.classList.remove(ITEM_HIDE_CLASSNAME);
193
+ var _emptyRef$current2;
194
+ (_emptyRef$current2 = emptyRef.current) === null || _emptyRef$current2 === void 0 ? void 0 : _emptyRef$current2.classList.remove(ITEM_HIDE_CLASSNAME);
193
195
  }
194
196
  return true;
195
197
  }
package/File/index.js CHANGED
@@ -367,7 +367,8 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
367
367
  //----
368
368
  //remove focus style
369
369
  if (val === '') {
370
- rootRef.current.classList.remove('focus');
370
+ var _rootRef$current;
371
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.remove('focus');
371
372
  }
372
373
 
373
374
  //
package/Input/index.js CHANGED
@@ -186,7 +186,8 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
186
186
  }
187
187
  }
188
188
  function handleFocus(event) {
189
- rootRef.current.classList.add('focus');
189
+ var _rootRef$current;
190
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
190
191
 
191
192
  //
192
193
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
@@ -198,7 +199,8 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
198
199
  //----
199
200
  //remove focus style
200
201
  if (val === '') {
201
- rootRef.current.classList.remove('focus');
202
+ var _rootRef$current2;
203
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
202
204
  }
203
205
 
204
206
  //
@@ -218,7 +220,8 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
218
220
  //----
219
221
  //remove focus style
220
222
  if (val === '') {
221
- rootRef.current.classList.remove('focus');
223
+ var _rootRef$current3;
224
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
222
225
  }
223
226
 
224
227
  //
@@ -700,7 +700,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
700
700
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(event);
701
701
  }
702
702
  function handleFocus(event) {
703
- rootRef.current.classList.add('focus');
703
+ var _rootRef$current;
704
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
704
705
 
705
706
  //
706
707
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition);
@@ -712,7 +713,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
712
713
  //----
713
714
  //remove focus style
714
715
  if (val === '') {
715
- rootRef.current.classList.remove('focus');
716
+ var _rootRef$current2;
717
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
716
718
  }
717
719
 
718
720
  //
@@ -725,7 +727,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
725
727
  //----
726
728
  //remove focus style
727
729
  if (val === '') {
728
- rootRef.current.classList.remove('focus');
730
+ var _rootRef$current3;
731
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
729
732
  }
730
733
 
731
734
  //
@@ -2021,11 +2021,12 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
2021
2021
  if (LOCK_BODY_SCROLL) disableBodyScroll(document.querySelector('body'));
2022
2022
  }
2023
2023
  function rootWrapperSwitch() {
2024
+ var _rootRef$current;
2024
2025
  // remove active styles from the root container and activate current wrapper
2025
2026
  [].slice.call(document.querySelectorAll('.mf-select__wrapper')).forEach(function (node) {
2026
2027
  node.classList.remove('active', 'focus');
2027
2028
  });
2028
- rootRef.current.classList.add('active', 'focus');
2029
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('active', 'focus');
2029
2030
  }
2030
2031
  function handleSelect(_x4) {
2031
2032
  return _handleSelect.apply(this, arguments);
@@ -2037,6 +2038,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
2037
2038
  labelArr,
2038
2039
  curItem,
2039
2040
  incominggetOptionsData,
2041
+ _rootRef$current3,
2040
2042
  options,
2041
2043
  curBtn,
2042
2044
  _data,
@@ -2076,7 +2078,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
2076
2078
 
2077
2079
  //remove focus style
2078
2080
  if (!MULTI_SEL_VALID) {
2079
- rootRef.current.classList.remove('focus');
2081
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
2080
2082
  }
2081
2083
 
2082
2084
  // get options
@@ -2492,7 +2494,8 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
2492
2494
 
2493
2495
  //
2494
2496
  function handleFocus(event) {
2495
- rootRef.current.classList.add('focus');
2497
+ var _rootRef$current2;
2498
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.add('focus');
2496
2499
 
2497
2500
  // update temporary value
2498
2501
  setControlTempValue('');
package/Radio/index.js CHANGED
@@ -106,6 +106,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
106
106
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
107
107
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
108
108
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
109
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e2) { function e(_x3) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e3) { function e(_x4) { return _e3.apply(this, arguments); } e.toString = function () { return _e3.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
109
110
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
110
111
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
111
112
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -162,26 +163,63 @@ var Radio = function Radio(props) {
162
163
  _useState6 = _slicedToArray(_useState5, 2),
163
164
  controlValue = _useState6[0],
164
165
  setControlValue = _useState6[1];
166
+ function stringlineToHump(str) {
167
+ if (typeof str === 'string' && str.length > 0) {
168
+ var re = /-(\w)/g;
169
+ str = str.replace(re, function ($0, $1) {
170
+ return $1.toUpperCase();
171
+ });
172
+ return str;
173
+ } else {
174
+ return str;
175
+ }
176
+ }
177
+ function getDataAttributes(node) {
178
+ if (node === null) return [];
179
+ var res = {};
180
+ var _iterator = _createForOfIteratorHelper(node.attributes),
181
+ _step;
182
+ try {
183
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
184
+ var attr = _step.value;
185
+ if (/^data-/.test(attr.name)) {
186
+ res[stringlineToHump(attr.name)] = attr.value;
187
+ }
188
+ }
189
+ } catch (err) {
190
+ _iterator.e(err);
191
+ } finally {
192
+ _iterator.f();
193
+ }
194
+ return res;
195
+ }
165
196
  function fetchData(_x2) {
166
197
  return _fetchData.apply(this, arguments);
167
198
  } // Determine whether it is in JSON format
168
199
  function _fetchData() {
169
200
  _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
170
- var response, _ORGIN_DATA, _realValue, filterRes, filterResQueryValue, filterResQueryLabel, _realValue2, _filterRes, _filterResQueryValue, _filterResQueryLabel;
201
+ var allControlsData, response, _ORGIN_DATA, _realValue, filterRes, filterResQueryValue, filterResQueryLabel, _realValue2, _filterRes, _filterResQueryValue, _filterResQueryLabel;
171
202
  return _regeneratorRuntime().wrap(function _callee$(_context) {
172
203
  while (1) switch (_context.prev = _context.next) {
173
204
  case 0:
174
205
  // set default value
175
206
  if (typeof value !== 'undefined' && value !== '') rootRef.current.dataset.value = value;
207
+ if (rootRef.current) {
208
+ allControlsData = [];
209
+ [].slice.call(rootRef.current.querySelectorAll("[type=\"radio\"]")).forEach(function (el, i) {
210
+ allControlsData.push(getDataAttributes(el));
211
+ });
212
+ rootRef.current.setAttribute('data-controls-cus-attrs', JSON.stringify(allControlsData));
213
+ }
176
214
 
177
215
  //
178
216
  if (!(_typeof(fetchFuncAsync) === 'object')) {
179
- _context.next = 20;
217
+ _context.next = 21;
180
218
  break;
181
219
  }
182
- _context.next = 4;
220
+ _context.next = 5;
183
221
  return fetchFuncAsync["".concat(fetchFuncMethod)].apply(fetchFuncAsync, _toConsumableArray(params.split(',')));
184
- case 4:
222
+ case 5:
185
223
  response = _context.sent;
186
224
  _ORGIN_DATA = response.data; // reset data structure
187
225
  if (typeof fetchCallback === 'function') {
@@ -222,7 +260,7 @@ var Radio = function Radio(props) {
222
260
  //
223
261
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(_ORGIN_DATA, _realValue, rootRef.current);
224
262
  return _context.abrupt("return", _ORGIN_DATA);
225
- case 20:
263
+ case 21:
226
264
  // If the default value is label, match value
227
265
  _realValue2 = value;
228
266
  _filterRes = [];
@@ -250,7 +288,7 @@ var Radio = function Radio(props) {
250
288
  //
251
289
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(optionsDataInit, _realValue2, rootRef.current);
252
290
  return _context.abrupt("return", optionsDataInit);
253
- case 30:
291
+ case 31:
254
292
  case "end":
255
293
  return _context.stop();
256
294
  }
@@ -280,12 +318,14 @@ var Radio = function Radio(props) {
280
318
 
281
319
  //
282
320
  function handleFocus(event) {
283
- rootRef.current.classList.add('focus');
321
+ var _rootRef$current;
322
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
284
323
 
285
324
  //
286
325
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
287
326
  }
288
327
  function handleChange(event) {
328
+ var _rootRef$current2;
289
329
  var val = event.target.value;
290
330
  var curData;
291
331
  var currentIndex = event.target.dataset.index;
@@ -307,7 +347,7 @@ var Radio = function Radio(props) {
307
347
 
308
348
  //----
309
349
  //remove focus style
310
- rootRef.current.classList.remove('focus');
350
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
311
351
 
312
352
  //
313
353
  if (typeof onChange === 'function') {
@@ -318,9 +358,10 @@ var Radio = function Radio(props) {
318
358
  }
319
359
  }
320
360
  function handleBlur(event) {
361
+ var _rootRef$current3;
321
362
  //----
322
363
  //remove focus style
323
- rootRef.current.classList.remove('focus');
364
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
324
365
 
325
366
  //
326
367
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
@@ -328,7 +328,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
328
328
  }
329
329
  }
330
330
  function handleFocus(event) {
331
- rootRef.current.classList.add('focus');
331
+ var _rootRef$current;
332
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
332
333
 
333
334
  //
334
335
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
@@ -340,7 +341,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
340
341
  //----
341
342
  //remove focus style
342
343
  if (val === '') {
343
- rootRef.current.classList.remove('focus');
344
+ var _rootRef$current2;
345
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
344
346
  }
345
347
 
346
348
  //
@@ -360,7 +362,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
360
362
  //----
361
363
  //remove focus style
362
364
  if (val === '') {
363
- rootRef.current.classList.remove('focus');
365
+ var _rootRef$current3;
366
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
364
367
  }
365
368
 
366
369
  //
@@ -169,7 +169,8 @@ var SearchBar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(f
169
169
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(event);
170
170
  }
171
171
  function handleFocus(event) {
172
- rootRef.current.classList.add('focus');
172
+ var _rootRef$current;
173
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
173
174
 
174
175
  //
175
176
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition);
@@ -181,7 +182,8 @@ var SearchBar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(f
181
182
  //----
182
183
  //remove focus style
183
184
  if (val === '') {
184
- rootRef.current.classList.remove('focus');
185
+ var _rootRef$current2;
186
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
185
187
  }
186
188
 
187
189
  //
@@ -194,7 +196,8 @@ var SearchBar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(f
194
196
  //----
195
197
  //remove focus style
196
198
  if (val === '') {
197
- rootRef.current.classList.remove('focus');
199
+ var _rootRef$current3;
200
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
198
201
  }
199
202
 
200
203
  //
package/Select/index.js CHANGED
@@ -419,12 +419,14 @@ var Select = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(func
419
419
 
420
420
  //
421
421
  function handleFocus(event) {
422
- rootRef.current.classList.add('focus');
422
+ var _rootRef$current;
423
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
423
424
 
424
425
  //
425
426
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
426
427
  }
427
428
  function handleChange(event) {
429
+ var _rootRef$current2;
428
430
  var val = event.target.value;
429
431
 
430
432
  //----
@@ -433,7 +435,7 @@ var Select = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(func
433
435
 
434
436
  //----
435
437
  //remove focus style
436
- rootRef.current.classList.remove('focus');
438
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
437
439
 
438
440
  //
439
441
  if (typeof onChange === 'function') {
@@ -442,9 +444,10 @@ var Select = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(func
442
444
  }
443
445
  }
444
446
  function handleBlur(event) {
447
+ var _rootRef$current3;
445
448
  //----
446
449
  //remove focus style
447
- rootRef.current.classList.remove('focus');
450
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
448
451
 
449
452
  //
450
453
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
package/Switch/index.js CHANGED
@@ -137,18 +137,20 @@ var Switch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(func
137
137
  setVal = _useState2[1]; // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
138
138
 
139
139
  function handleFocus(event) {
140
- rootRef.current.classList.add('focus');
140
+ var _rootRef$current;
141
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
141
142
 
142
143
  //
143
144
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
144
145
  }
145
146
  function handleChange(event) {
147
+ var _rootRef$current2;
146
148
  var _val = event.target.checked;
147
149
  setVal(_val);
148
150
 
149
151
  //----
150
152
  //remove focus style
151
- rootRef.current.classList.remove('focus');
153
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
152
154
 
153
155
  //
154
156
  if (typeof onChange === 'function') {
@@ -156,9 +158,10 @@ var Switch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(func
156
158
  }
157
159
  }
158
160
  function handleBlur(event) {
161
+ var _rootRef$current3;
159
162
  //----
160
163
  //remove focus style
161
- rootRef.current.classList.remove('focus');
164
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
162
165
 
163
166
  //
164
167
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
package/Table/index.js CHANGED
@@ -334,18 +334,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
334
334
  setVal = _useState2[1]; // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
335
335
 
336
336
  function handleFocus(event) {
337
- rootRef.current.classList.add('focus');
337
+ var _rootRef$current;
338
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
338
339
 
339
340
  //
340
341
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
341
342
  }
342
343
  function handleChange(event) {
344
+ var _rootRef$current2;
343
345
  var _val = event.target.checked;
344
346
  setVal(_val);
345
347
 
346
348
  //----
347
349
  //remove focus style
348
- rootRef.current.classList.remove('focus');
350
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
349
351
 
350
352
  //
351
353
  if (typeof onChange === 'function') {
@@ -353,9 +355,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
353
355
  }
354
356
  }
355
357
  function handleBlur(event) {
358
+ var _rootRef$current3;
356
359
  //----
357
360
  //remove focus style
358
- rootRef.current.classList.remove('focus');
361
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
359
362
 
360
363
  //
361
364
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
@@ -1818,7 +1821,8 @@ var Table = function Table(props) {
1818
1821
  });
1819
1822
  };
1820
1823
  function handleTbodyLeave(e) {
1821
- tbodyRef.current.classList.remove('drag-trigger-mousedown');
1824
+ var _tbodyRef$current;
1825
+ (_tbodyRef$current = tbodyRef.current) === null || _tbodyRef$current === void 0 ? void 0 : _tbodyRef$current.classList.remove('drag-trigger-mousedown');
1822
1826
  }
1823
1827
 
1824
1828
  // events fired on the drop targets
@@ -1852,10 +1856,11 @@ var Table = function Table(props) {
1852
1856
  onDrag === null || onDrag === void 0 ? void 0 : onDrag(dragStart, null);
1853
1857
  }, [handledragOver]);
1854
1858
  var handleDragEnd = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (e) {
1859
+ var _tbodyRef$current2;
1855
1860
  draggedObj.style.display = 'table-row';
1856
1861
  removePlaceholder();
1857
1862
  draggedObj.classList.remove('dragging');
1858
- tbodyRef.current.classList.remove('drag-trigger-mousedown');
1863
+ (_tbodyRef$current2 = tbodyRef.current) === null || _tbodyRef$current2 === void 0 ? void 0 : _tbodyRef$current2.classList.remove('drag-trigger-mousedown');
1859
1864
  if (overObj === null) return;
1860
1865
 
1861
1866
  // update state
package/TagInput/index.js CHANGED
@@ -370,7 +370,8 @@ var TagInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
370
370
  //----
371
371
  //remove focus style
372
372
  if (val === '') {
373
- rootRef.current.classList.remove('focus');
373
+ var _rootRef$current;
374
+ (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.remove('focus');
374
375
  }
375
376
 
376
377
  //
@@ -389,7 +390,8 @@ var TagInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
389
390
  setUserInput(val);
390
391
  }
391
392
  function handleFocus(event) {
392
- rootRef.current.classList.add('focus');
393
+ var _rootRef$current2;
394
+ (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.add('focus');
393
395
 
394
396
  //
395
397
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
@@ -401,7 +403,8 @@ var TagInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
401
403
  //----
402
404
  //remove focus style
403
405
  if (val === '') {
404
- rootRef.current.classList.remove('focus');
406
+ var _rootRef$current3;
407
+ (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
405
408
  }
406
409
 
407
410
  //