funda-ui 1.0.272

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 (246) hide show
  1. package/BackToTop/index.css +34 -0
  2. package/BackToTop/index.d.ts +11 -0
  3. package/BackToTop/index.js +458 -0
  4. package/CascadingSelect/index.css +159 -0
  5. package/CascadingSelect/index.d.ts +56 -0
  6. package/CascadingSelect/index.js +958 -0
  7. package/CascadingSelectE2E/index.css +159 -0
  8. package/CascadingSelectE2E/index.d.ts +60 -0
  9. package/CascadingSelectE2E/index.js +1126 -0
  10. package/Checkbox/index.d.ts +30 -0
  11. package/Checkbox/index.js +226 -0
  12. package/ColorPicker/index.css +38 -0
  13. package/ColorPicker/index.d.ts +27 -0
  14. package/ColorPicker/index.js +246 -0
  15. package/DigitalClock/index.d.ts +7 -0
  16. package/DigitalClock/index.js +208 -0
  17. package/DropdownMenu/index.css +127 -0
  18. package/DropdownMenu/index.d.ts +37 -0
  19. package/DropdownMenu/index.js +237 -0
  20. package/DynamicFields/index.d.ts +26 -0
  21. package/DynamicFields/index.js +412 -0
  22. package/File/index.d.ts +36 -0
  23. package/File/index.js +473 -0
  24. package/Input/index.d.ts +42 -0
  25. package/Input/index.js +286 -0
  26. package/LiveSearch/index.d.ts +37 -0
  27. package/LiveSearch/index.js +1195 -0
  28. package/ModalDialog/index.d.ts +60 -0
  29. package/ModalDialog/index.js +725 -0
  30. package/ModeSwitch/index.d.ts +17 -0
  31. package/ModeSwitch/index.js +202 -0
  32. package/MultiFuncSelect/index.css +178 -0
  33. package/MultiFuncSelect/index.d.ts +67 -0
  34. package/MultiFuncSelect/index.js +1826 -0
  35. package/MultilevelDropdownMenu/index.css +35 -0
  36. package/MultilevelDropdownMenu/index.d.ts +25 -0
  37. package/MultilevelDropdownMenu/index.js +464 -0
  38. package/Pagination/index.d.ts +49 -0
  39. package/Pagination/index.js +341 -0
  40. package/README.md +108 -0
  41. package/Radio/index.d.ts +31 -0
  42. package/Radio/index.js +246 -0
  43. package/RangeSlider/index.css +149 -0
  44. package/RangeSlider/index.d.ts +21 -0
  45. package/RangeSlider/index.js +730 -0
  46. package/ScrollReveal/index.css +23 -0
  47. package/ScrollReveal/index.d.ts +21 -0
  48. package/ScrollReveal/index.js +216 -0
  49. package/Scrollbar/index.css +168 -0
  50. package/Scrollbar/index.d.ts +15 -0
  51. package/Scrollbar/index.js +605 -0
  52. package/SearchBar/index.d.ts +32 -0
  53. package/SearchBar/index.js +246 -0
  54. package/Select/index.d.ts +34 -0
  55. package/Select/index.js +331 -0
  56. package/ShowMoreLess/index.css +23 -0
  57. package/ShowMoreLess/index.d.ts +30 -0
  58. package/ShowMoreLess/index.js +202 -0
  59. package/Switch/index.d.ts +29 -0
  60. package/Switch/index.js +211 -0
  61. package/Table/index.css +533 -0
  62. package/Table/index.d.ts +25 -0
  63. package/Table/index.js +2113 -0
  64. package/Tabs/index.d.ts +3 -0
  65. package/Tabs/index.js +323 -0
  66. package/TagInput/index.css +90 -0
  67. package/TagInput/index.d.ts +28 -0
  68. package/TagInput/index.js +370 -0
  69. package/Textarea/index.d.ts +30 -0
  70. package/Textarea/index.js +242 -0
  71. package/Toast/index.css +95 -0
  72. package/Toast/index.d.ts +35 -0
  73. package/Toast/index.js +340 -0
  74. package/Tooltip/index.css +240 -0
  75. package/Tooltip/index.d.ts +19 -0
  76. package/Tooltip/index.js +200 -0
  77. package/Tree/index.css +225 -0
  78. package/Tree/index.d.ts +37 -0
  79. package/Tree/index.js +1406 -0
  80. package/all.d.ts +33 -0
  81. package/all.js +35 -0
  82. package/lib/cjs/BackToTop/index.d.ts +11 -0
  83. package/lib/cjs/BackToTop/index.js +458 -0
  84. package/lib/cjs/CascadingSelect/index.d.ts +56 -0
  85. package/lib/cjs/CascadingSelect/index.js +958 -0
  86. package/lib/cjs/CascadingSelectE2E/index.d.ts +60 -0
  87. package/lib/cjs/CascadingSelectE2E/index.js +1126 -0
  88. package/lib/cjs/Checkbox/index.d.ts +30 -0
  89. package/lib/cjs/Checkbox/index.js +226 -0
  90. package/lib/cjs/ColorPicker/index.d.ts +27 -0
  91. package/lib/cjs/ColorPicker/index.js +246 -0
  92. package/lib/cjs/DigitalClock/index.d.ts +7 -0
  93. package/lib/cjs/DigitalClock/index.js +208 -0
  94. package/lib/cjs/DropdownMenu/index.d.ts +37 -0
  95. package/lib/cjs/DropdownMenu/index.js +237 -0
  96. package/lib/cjs/DynamicFields/index.d.ts +26 -0
  97. package/lib/cjs/DynamicFields/index.js +412 -0
  98. package/lib/cjs/File/index.d.ts +36 -0
  99. package/lib/cjs/File/index.js +473 -0
  100. package/lib/cjs/Input/index.d.ts +42 -0
  101. package/lib/cjs/Input/index.js +286 -0
  102. package/lib/cjs/LiveSearch/index.d.ts +37 -0
  103. package/lib/cjs/LiveSearch/index.js +1195 -0
  104. package/lib/cjs/ModalDialog/index.d.ts +60 -0
  105. package/lib/cjs/ModalDialog/index.js +725 -0
  106. package/lib/cjs/ModeSwitch/index.d.ts +17 -0
  107. package/lib/cjs/ModeSwitch/index.js +202 -0
  108. package/lib/cjs/MultiFuncSelect/index.d.ts +67 -0
  109. package/lib/cjs/MultiFuncSelect/index.js +1826 -0
  110. package/lib/cjs/MultilevelDropdownMenu/index.d.ts +25 -0
  111. package/lib/cjs/MultilevelDropdownMenu/index.js +464 -0
  112. package/lib/cjs/Pagination/index.d.ts +49 -0
  113. package/lib/cjs/Pagination/index.js +341 -0
  114. package/lib/cjs/Radio/index.d.ts +31 -0
  115. package/lib/cjs/Radio/index.js +246 -0
  116. package/lib/cjs/RangeSlider/index.d.ts +21 -0
  117. package/lib/cjs/RangeSlider/index.js +730 -0
  118. package/lib/cjs/ScrollReveal/index.d.ts +21 -0
  119. package/lib/cjs/ScrollReveal/index.js +216 -0
  120. package/lib/cjs/Scrollbar/index.d.ts +15 -0
  121. package/lib/cjs/Scrollbar/index.js +605 -0
  122. package/lib/cjs/SearchBar/index.d.ts +32 -0
  123. package/lib/cjs/SearchBar/index.js +246 -0
  124. package/lib/cjs/Select/index.d.ts +34 -0
  125. package/lib/cjs/Select/index.js +331 -0
  126. package/lib/cjs/ShowMoreLess/index.d.ts +30 -0
  127. package/lib/cjs/ShowMoreLess/index.js +202 -0
  128. package/lib/cjs/Switch/index.d.ts +29 -0
  129. package/lib/cjs/Switch/index.js +211 -0
  130. package/lib/cjs/Table/index.d.ts +25 -0
  131. package/lib/cjs/Table/index.js +2113 -0
  132. package/lib/cjs/Tabs/index.d.ts +3 -0
  133. package/lib/cjs/Tabs/index.js +323 -0
  134. package/lib/cjs/TagInput/index.d.ts +28 -0
  135. package/lib/cjs/TagInput/index.js +370 -0
  136. package/lib/cjs/Textarea/index.d.ts +30 -0
  137. package/lib/cjs/Textarea/index.js +242 -0
  138. package/lib/cjs/Toast/index.d.ts +35 -0
  139. package/lib/cjs/Toast/index.js +340 -0
  140. package/lib/cjs/Tooltip/index.d.ts +19 -0
  141. package/lib/cjs/Tooltip/index.js +200 -0
  142. package/lib/cjs/Tree/index.d.ts +37 -0
  143. package/lib/cjs/Tree/index.js +1406 -0
  144. package/lib/cjs/index.d.ts +33 -0
  145. package/lib/cjs/index.js +35 -0
  146. package/lib/css/BackToTop/index.css +34 -0
  147. package/lib/css/CascadingSelect/index.css +159 -0
  148. package/lib/css/CascadingSelectE2E/index.css +159 -0
  149. package/lib/css/ColorPicker/index.css +38 -0
  150. package/lib/css/DropdownMenu/index.css +127 -0
  151. package/lib/css/MultiFuncSelect/index.css +178 -0
  152. package/lib/css/MultilevelDropdownMenu/index.css +35 -0
  153. package/lib/css/RangeSlider/index.css +149 -0
  154. package/lib/css/ScrollReveal/index.css +23 -0
  155. package/lib/css/Scrollbar/index.css +168 -0
  156. package/lib/css/ShowMoreLess/index.css +23 -0
  157. package/lib/css/Table/index.css +533 -0
  158. package/lib/css/TagInput/index.css +90 -0
  159. package/lib/css/Toast/index.css +95 -0
  160. package/lib/css/Tooltip/index.css +240 -0
  161. package/lib/css/Tree/index.css +225 -0
  162. package/lib/esm/BackToTop/index.scss +47 -0
  163. package/lib/esm/BackToTop/index.tsx +182 -0
  164. package/lib/esm/BackToTop/utils/easing.js +200 -0
  165. package/lib/esm/BackToTop/utils/performance.js +52 -0
  166. package/lib/esm/CascadingSelect/Group.tsx +39 -0
  167. package/lib/esm/CascadingSelect/index.scss +214 -0
  168. package/lib/esm/CascadingSelect/index.tsx +922 -0
  169. package/lib/esm/CascadingSelect/utils/performance.js +52 -0
  170. package/lib/esm/CascadingSelectE2E/Group.tsx +39 -0
  171. package/lib/esm/CascadingSelectE2E/index.scss +214 -0
  172. package/lib/esm/CascadingSelectE2E/index.tsx +1091 -0
  173. package/lib/esm/CascadingSelectE2E/utils/performance.js +52 -0
  174. package/lib/esm/Checkbox/index.tsx +160 -0
  175. package/lib/esm/ColorPicker/index.scss +48 -0
  176. package/lib/esm/ColorPicker/index.tsx +187 -0
  177. package/lib/esm/DigitalClock/index.tsx +72 -0
  178. package/lib/esm/DigitalClock/utils/useInterval.js +43 -0
  179. package/lib/esm/DropdownMenu/Option.tsx +27 -0
  180. package/lib/esm/DropdownMenu/index.scss +180 -0
  181. package/lib/esm/DropdownMenu/index.tsx +148 -0
  182. package/lib/esm/DynamicFields/index.tsx +386 -0
  183. package/lib/esm/File/index.tsx +302 -0
  184. package/lib/esm/Input/index.tsx +233 -0
  185. package/lib/esm/LiveSearch/index.tsx +582 -0
  186. package/lib/esm/LiveSearch/utils/performance.js +52 -0
  187. package/lib/esm/LiveSearch/utils/useThrottle.js +36 -0
  188. package/lib/esm/ModalDialog/index.tsx +479 -0
  189. package/lib/esm/ModalDialog/plugins/BSL/bodyScrollLock.es6.js +262 -0
  190. package/lib/esm/ModalDialog/plugins/BSL/index.ts +2 -0
  191. package/lib/esm/ModeSwitch/index.tsx +82 -0
  192. package/lib/esm/MultiFuncSelect/index.scss +269 -0
  193. package/lib/esm/MultiFuncSelect/index.tsx +1597 -0
  194. package/lib/esm/MultiFuncSelect/utils/performance.js +52 -0
  195. package/lib/esm/MultiFuncSelect/utils/tree.js +103 -0
  196. package/lib/esm/MultiFuncSelect/utils/useThrottle.js +36 -0
  197. package/lib/esm/MultilevelDropdownMenu/MenuList.tsx +230 -0
  198. package/lib/esm/MultilevelDropdownMenu/index.scss +75 -0
  199. package/lib/esm/MultilevelDropdownMenu/index.tsx +71 -0
  200. package/lib/esm/MultilevelDropdownMenu/utils/dom.js +81 -0
  201. package/lib/esm/Pagination/index.tsx +230 -0
  202. package/lib/esm/Pagination/pagination-navigators.tsx +60 -0
  203. package/lib/esm/Radio/index.tsx +201 -0
  204. package/lib/esm/RangeSlider/index.scss +184 -0
  205. package/lib/esm/RangeSlider/index.tsx +223 -0
  206. package/lib/esm/ScrollReveal/index.scss +27 -0
  207. package/lib/esm/ScrollReveal/index.tsx +146 -0
  208. package/lib/esm/Scrollbar/index.scss +217 -0
  209. package/lib/esm/Scrollbar/index.tsx +497 -0
  210. package/lib/esm/Scrollbar/utils/performance.js +52 -0
  211. package/lib/esm/SearchBar/index.tsx +181 -0
  212. package/lib/esm/Select/index.tsx +276 -0
  213. package/lib/esm/ShowMoreLess/index.scss +27 -0
  214. package/lib/esm/ShowMoreLess/index.tsx +144 -0
  215. package/lib/esm/Switch/index.tsx +143 -0
  216. package/lib/esm/Table/TableColgroup.tsx +29 -0
  217. package/lib/esm/Table/TableField.tsx +40 -0
  218. package/lib/esm/Table/TableFieldRow.tsx +212 -0
  219. package/lib/esm/Table/TableHeaders.tsx +146 -0
  220. package/lib/esm/Table/TableRow.tsx +127 -0
  221. package/lib/esm/Table/TableSummaries.tsx +36 -0
  222. package/lib/esm/Table/index.scss +364 -0
  223. package/lib/esm/Table/index.tsx +576 -0
  224. package/lib/esm/Table/table-utils.ts +65 -0
  225. package/lib/esm/Table/utils/dom.js +81 -0
  226. package/lib/esm/Table/utils/performance.js +52 -0
  227. package/lib/esm/Tabs/TabList.tsx +42 -0
  228. package/lib/esm/Tabs/TabPanel.tsx +34 -0
  229. package/lib/esm/Tabs/Tabs.tsx +232 -0
  230. package/lib/esm/Tabs/index.tsx +3 -0
  231. package/lib/esm/TagInput/index.scss +125 -0
  232. package/lib/esm/TagInput/index.tsx +314 -0
  233. package/lib/esm/Textarea/index.tsx +178 -0
  234. package/lib/esm/Toast/Item.tsx +75 -0
  235. package/lib/esm/Toast/index.scss +120 -0
  236. package/lib/esm/Toast/index.tsx +249 -0
  237. package/lib/esm/Tooltip/index.scss +327 -0
  238. package/lib/esm/Tooltip/index.tsx +142 -0
  239. package/lib/esm/Tree/TreeList.tsx +503 -0
  240. package/lib/esm/Tree/index.scss +375 -0
  241. package/lib/esm/Tree/index.tsx +301 -0
  242. package/lib/esm/Tree/init-height.tsx +27 -0
  243. package/lib/esm/Tree/utils/convert-tree.js +29 -0
  244. package/lib/esm/Tree/utils/dom.js +81 -0
  245. package/lib/esm/index.js +31 -0
  246. package/package.json +40 -0
package/Table/index.js ADDED
@@ -0,0 +1,2113 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["react"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RPB"] = factory(require("react"));
8
+ else
9
+ root["RPB"] = factory(root["React"]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 109:
15
+ /***/ (function(module, exports, __webpack_require__) {
16
+
17
+ /* module decorator */ module = __webpack_require__.nmd(module);
18
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "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; }, _typeof2(obj); }
19
+ (function webpackUniversalModuleDefinition(root, factory) {
20
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
21
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
22
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
23
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
24
+ })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
25
+ return (/******/function () {
26
+ // webpackBootstrap
27
+ /******/
28
+ "use strict";
29
+
30
+ /******/
31
+ var __webpack_modules__ = {
32
+ /***/787: /***/function _(module) {
33
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
34
+
35
+ /***/
36
+ }
37
+
38
+ /******/
39
+ };
40
+ /************************************************************************/
41
+ /******/ // The module cache
42
+ /******/
43
+ var __webpack_module_cache__ = {};
44
+ /******/
45
+ /******/ // The require function
46
+ /******/
47
+ function __nested_webpack_require_1471__(moduleId) {
48
+ /******/ // Check if module is in cache
49
+ /******/var cachedModule = __webpack_module_cache__[moduleId];
50
+ /******/
51
+ if (cachedModule !== undefined) {
52
+ /******/return cachedModule.exports;
53
+ /******/
54
+ }
55
+ /******/ // Create a new module (and put it into the cache)
56
+ /******/
57
+ var module = __webpack_module_cache__[moduleId] = {
58
+ /******/ // no module.id needed
59
+ /******/ // no module.loaded needed
60
+ /******/exports: {}
61
+ /******/
62
+ };
63
+ /******/
64
+ /******/ // Execute the module function
65
+ /******/
66
+ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1471__);
67
+ /******/
68
+ /******/ // Return the exports of the module
69
+ /******/
70
+ return module.exports;
71
+ /******/
72
+ }
73
+ /******/
74
+ /************************************************************************/
75
+ /******/ /* webpack/runtime/compat get default export */
76
+ /******/
77
+ (function () {
78
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
79
+ /******/__nested_webpack_require_1471__.n = function (module) {
80
+ /******/var getter = module && module.__esModule ? /******/function () {
81
+ return module['default'];
82
+ } : /******/function () {
83
+ return module;
84
+ };
85
+ /******/
86
+ __nested_webpack_require_1471__.d(getter, {
87
+ a: getter
88
+ });
89
+ /******/
90
+ return getter;
91
+ /******/
92
+ };
93
+ /******/
94
+ })();
95
+ /******/
96
+ /******/ /* webpack/runtime/define property getters */
97
+ /******/
98
+ (function () {
99
+ /******/ // define getter functions for harmony exports
100
+ /******/__nested_webpack_require_1471__.d = function (exports, definition) {
101
+ /******/for (var key in definition) {
102
+ /******/if (__nested_webpack_require_1471__.o(definition, key) && !__nested_webpack_require_1471__.o(exports, key)) {
103
+ /******/Object.defineProperty(exports, key, {
104
+ enumerable: true,
105
+ get: definition[key]
106
+ });
107
+ /******/
108
+ }
109
+ /******/
110
+ }
111
+ /******/
112
+ };
113
+ /******/
114
+ })();
115
+ /******/
116
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
117
+ /******/
118
+ (function () {
119
+ /******/__nested_webpack_require_1471__.o = function (obj, prop) {
120
+ return Object.prototype.hasOwnProperty.call(obj, prop);
121
+ };
122
+ /******/
123
+ })();
124
+ /******/
125
+ /******/ /* webpack/runtime/make namespace object */
126
+ /******/
127
+ (function () {
128
+ /******/ // define __esModule on exports
129
+ /******/__nested_webpack_require_1471__.r = function (exports) {
130
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
131
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
132
+ value: 'Module'
133
+ });
134
+ /******/
135
+ }
136
+ /******/
137
+ Object.defineProperty(exports, '__esModule', {
138
+ value: true
139
+ });
140
+ /******/
141
+ };
142
+ /******/
143
+ })();
144
+ /******/
145
+ /************************************************************************/
146
+ var __webpack_exports__ = {};
147
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
148
+ (function () {
149
+ __nested_webpack_require_1471__.r(__webpack_exports__);
150
+ /* harmony export */
151
+ __nested_webpack_require_1471__.d(__webpack_exports__, {
152
+ /* harmony export */"default": function _default() {
153
+ return __WEBPACK_DEFAULT_EXPORT__;
154
+ }
155
+ /* harmony export */
156
+ });
157
+ /* harmony import */
158
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1471__(787);
159
+ /* harmony import */
160
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1471__.n(react__WEBPACK_IMPORTED_MODULE_0__);
161
+ function _typeof(obj) {
162
+ "@babel/helpers - typeof";
163
+
164
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
165
+ return typeof obj;
166
+ } : function (obj) {
167
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
168
+ }, _typeof(obj);
169
+ }
170
+ var _excluded = ["wrapperClassName", "disabled", "required", "value", "label", "name", "id", "checked", "indeterminate", "style", "tabIndex", "onChange", "onBlur", "onFocus"];
171
+ function _extends() {
172
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
173
+ for (var i = 1; i < arguments.length; i++) {
174
+ var source = arguments[i];
175
+ for (var key in source) {
176
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
177
+ target[key] = source[key];
178
+ }
179
+ }
180
+ }
181
+ return target;
182
+ };
183
+ return _extends.apply(this, arguments);
184
+ }
185
+ function ownKeys(object, enumerableOnly) {
186
+ var keys = Object.keys(object);
187
+ if (Object.getOwnPropertySymbols) {
188
+ var symbols = Object.getOwnPropertySymbols(object);
189
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
190
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
191
+ })), keys.push.apply(keys, symbols);
192
+ }
193
+ return keys;
194
+ }
195
+ function _objectSpread(target) {
196
+ for (var i = 1; i < arguments.length; i++) {
197
+ var source = null != arguments[i] ? arguments[i] : {};
198
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
199
+ _defineProperty(target, key, source[key]);
200
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
201
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
202
+ });
203
+ }
204
+ return target;
205
+ }
206
+ function _defineProperty(obj, key, value) {
207
+ key = _toPropertyKey(key);
208
+ if (key in obj) {
209
+ Object.defineProperty(obj, key, {
210
+ value: value,
211
+ enumerable: true,
212
+ configurable: true,
213
+ writable: true
214
+ });
215
+ } else {
216
+ obj[key] = value;
217
+ }
218
+ return obj;
219
+ }
220
+ function _toPropertyKey(arg) {
221
+ var key = _toPrimitive(arg, "string");
222
+ return _typeof(key) === "symbol" ? key : String(key);
223
+ }
224
+ function _toPrimitive(input, hint) {
225
+ if (_typeof(input) !== "object" || input === null) return input;
226
+ var prim = input[Symbol.toPrimitive];
227
+ if (prim !== undefined) {
228
+ var res = prim.call(input, hint || "default");
229
+ if (_typeof(res) !== "object") return res;
230
+ throw new TypeError("@@toPrimitive must return a primitive value.");
231
+ }
232
+ return (hint === "string" ? String : Number)(input);
233
+ }
234
+ function _slicedToArray(arr, i) {
235
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
236
+ }
237
+ function _nonIterableRest() {
238
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
239
+ }
240
+ function _unsupportedIterableToArray(o, minLen) {
241
+ if (!o) return;
242
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
243
+ var n = Object.prototype.toString.call(o).slice(8, -1);
244
+ if (n === "Object" && o.constructor) n = o.constructor.name;
245
+ if (n === "Map" || n === "Set") return Array.from(o);
246
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
247
+ }
248
+ function _arrayLikeToArray(arr, len) {
249
+ if (len == null || len > arr.length) len = arr.length;
250
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
251
+ return arr2;
252
+ }
253
+ function _iterableToArrayLimit(arr, i) {
254
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
255
+ if (null != _i) {
256
+ var _s,
257
+ _e,
258
+ _x,
259
+ _r,
260
+ _arr = [],
261
+ _n = !0,
262
+ _d = !1;
263
+ try {
264
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
265
+ if (Object(_i) !== _i) return;
266
+ _n = !1;
267
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
268
+ } catch (err) {
269
+ _d = !0, _e = err;
270
+ } finally {
271
+ try {
272
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
273
+ } finally {
274
+ if (_d) throw _e;
275
+ }
276
+ }
277
+ return _arr;
278
+ }
279
+ }
280
+ function _arrayWithHoles(arr) {
281
+ if (Array.isArray(arr)) return arr;
282
+ }
283
+ function _objectWithoutProperties(source, excluded) {
284
+ if (source == null) return {};
285
+ var target = _objectWithoutPropertiesLoose(source, excluded);
286
+ var key, i;
287
+ if (Object.getOwnPropertySymbols) {
288
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
289
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
290
+ key = sourceSymbolKeys[i];
291
+ if (excluded.indexOf(key) >= 0) continue;
292
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
293
+ target[key] = source[key];
294
+ }
295
+ }
296
+ return target;
297
+ }
298
+ function _objectWithoutPropertiesLoose(source, excluded) {
299
+ if (source == null) return {};
300
+ var target = {};
301
+ var sourceKeys = Object.keys(source);
302
+ var key, i;
303
+ for (i = 0; i < sourceKeys.length; i++) {
304
+ key = sourceKeys[i];
305
+ if (excluded.indexOf(key) >= 0) continue;
306
+ target[key] = source[key];
307
+ }
308
+ return target;
309
+ }
310
+ var Checkbox = /*#__PURE__*/(0, react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, _ref) {
311
+ var wrapperClassName = props.wrapperClassName,
312
+ disabled = props.disabled,
313
+ required = props.required,
314
+ value = props.value,
315
+ label = props.label,
316
+ name = props.name,
317
+ id = props.id,
318
+ checked = props.checked,
319
+ indeterminate = props.indeterminate,
320
+ style = props.style,
321
+ tabIndex = props.tabIndex,
322
+ onChange = props.onChange,
323
+ onBlur = props.onBlur,
324
+ onFocus = props.onFocus,
325
+ attributes = _objectWithoutProperties(props, _excluded);
326
+ var uniqueID = (0, react__WEBPACK_IMPORTED_MODULE_0__.useId)();
327
+ var idRes = id || uniqueID;
328
+ var rootRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
329
+ var valRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
330
+ var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
331
+ _useState2 = _slicedToArray(_useState, 2),
332
+ val = _useState2[0],
333
+ setVal = _useState2[1];
334
+ function handleFocus(event) {
335
+ rootRef.current.classList.add('focus');
336
+
337
+ //
338
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
339
+ }
340
+ function handleChange(event) {
341
+ var _val = event.target.checked;
342
+ setVal(_val);
343
+
344
+ //----
345
+ //remove focus style
346
+ rootRef.current.classList.remove('focus');
347
+
348
+ //
349
+ if (typeof onChange === 'function') {
350
+ onChange(event, _val);
351
+ }
352
+ }
353
+ function handleBlur(event) {
354
+ //----
355
+ //remove focus style
356
+ rootRef.current.classList.remove('focus');
357
+
358
+ //
359
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
360
+ }
361
+ (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
362
+ // default value
363
+ setVal(checked);
364
+
365
+ // Set a checkbox to indeterminate state
366
+ if (typeof indeterminate !== 'undefined') {
367
+ valRef.current.indeterminate = indeterminate;
368
+ }
369
+ }, [checked, indeterminate]);
370
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
371
+ className: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
372
+ ref: rootRef
373
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
374
+ className: "form-check"
375
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
376
+ ref: function ref(node) {
377
+ valRef.current = node;
378
+ if (typeof _ref === 'function') {
379
+ _ref(node);
380
+ } else if (_ref) {
381
+ _ref.current = node;
382
+ }
383
+ },
384
+ tabIndex: tabIndex || 0,
385
+ type: "checkbox",
386
+ className: "form-check-input",
387
+ id: "label-".concat(idRes)
388
+
389
+ // Don't use "name", it's just a container to display the label
390
+ ,
391
+
392
+ "data-name": name !== null && name !== void 0 && name.match(/(\[.*?\])/gi) ? "".concat(name.split('[')[0], "-label[]") : "".concat(name, "-label"),
393
+ "data-checkbox": true,
394
+ disabled: disabled || null,
395
+ required: required || null,
396
+ onChange: handleChange,
397
+ onFocus: handleFocus,
398
+ onBlur: handleBlur,
399
+ defaultValue: value || '',
400
+ checked: val // component status will not change if defaultChecked is used
401
+ ,
402
+
403
+ style: _objectSpread({
404
+ cursor: 'pointer'
405
+ }, style)
406
+ }, attributes)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
407
+ type: "hidden",
408
+ id: idRes,
409
+ name: name,
410
+ value: val ? value || '' : '' // do not use `defaultValue`
411
+ }), label ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
412
+ htmlFor: "label-".concat(idRes),
413
+ className: "form-check-label"
414
+ }, label)) : null)));
415
+ });
416
+ /* harmony default export */
417
+ var __WEBPACK_DEFAULT_EXPORT__ = Checkbox;
418
+ })();
419
+
420
+ /******/
421
+ return __webpack_exports__;
422
+ /******/
423
+ }()
424
+ );
425
+ });
426
+
427
+ /***/ }),
428
+
429
+ /***/ 135:
430
+ /***/ (function(module, exports, __webpack_require__) {
431
+
432
+ /* module decorator */ module = __webpack_require__.nmd(module);
433
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "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; }, _typeof2(obj); }
434
+ (function webpackUniversalModuleDefinition(root, factory) {
435
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
436
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
437
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
438
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
439
+ })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
440
+ return (/******/function () {
441
+ // webpackBootstrap
442
+ /******/
443
+ "use strict";
444
+
445
+ /******/
446
+ var __webpack_modules__ = {
447
+ /***/787: /***/function _(module) {
448
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
449
+
450
+ /***/
451
+ }
452
+
453
+ /******/
454
+ };
455
+ /************************************************************************/
456
+ /******/ // The module cache
457
+ /******/
458
+ var __webpack_module_cache__ = {};
459
+ /******/
460
+ /******/ // The require function
461
+ /******/
462
+ function __nested_webpack_require_1471__(moduleId) {
463
+ /******/ // Check if module is in cache
464
+ /******/var cachedModule = __webpack_module_cache__[moduleId];
465
+ /******/
466
+ if (cachedModule !== undefined) {
467
+ /******/return cachedModule.exports;
468
+ /******/
469
+ }
470
+ /******/ // Create a new module (and put it into the cache)
471
+ /******/
472
+ var module = __webpack_module_cache__[moduleId] = {
473
+ /******/ // no module.id needed
474
+ /******/ // no module.loaded needed
475
+ /******/exports: {}
476
+ /******/
477
+ };
478
+ /******/
479
+ /******/ // Execute the module function
480
+ /******/
481
+ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1471__);
482
+ /******/
483
+ /******/ // Return the exports of the module
484
+ /******/
485
+ return module.exports;
486
+ /******/
487
+ }
488
+ /******/
489
+ /************************************************************************/
490
+ /******/ /* webpack/runtime/compat get default export */
491
+ /******/
492
+ (function () {
493
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
494
+ /******/__nested_webpack_require_1471__.n = function (module) {
495
+ /******/var getter = module && module.__esModule ? /******/function () {
496
+ return module['default'];
497
+ } : /******/function () {
498
+ return module;
499
+ };
500
+ /******/
501
+ __nested_webpack_require_1471__.d(getter, {
502
+ a: getter
503
+ });
504
+ /******/
505
+ return getter;
506
+ /******/
507
+ };
508
+ /******/
509
+ })();
510
+ /******/
511
+ /******/ /* webpack/runtime/define property getters */
512
+ /******/
513
+ (function () {
514
+ /******/ // define getter functions for harmony exports
515
+ /******/__nested_webpack_require_1471__.d = function (exports, definition) {
516
+ /******/for (var key in definition) {
517
+ /******/if (__nested_webpack_require_1471__.o(definition, key) && !__nested_webpack_require_1471__.o(exports, key)) {
518
+ /******/Object.defineProperty(exports, key, {
519
+ enumerable: true,
520
+ get: definition[key]
521
+ });
522
+ /******/
523
+ }
524
+ /******/
525
+ }
526
+ /******/
527
+ };
528
+ /******/
529
+ })();
530
+ /******/
531
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
532
+ /******/
533
+ (function () {
534
+ /******/__nested_webpack_require_1471__.o = function (obj, prop) {
535
+ return Object.prototype.hasOwnProperty.call(obj, prop);
536
+ };
537
+ /******/
538
+ })();
539
+ /******/
540
+ /******/ /* webpack/runtime/make namespace object */
541
+ /******/
542
+ (function () {
543
+ /******/ // define __esModule on exports
544
+ /******/__nested_webpack_require_1471__.r = function (exports) {
545
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
546
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
547
+ value: 'Module'
548
+ });
549
+ /******/
550
+ }
551
+ /******/
552
+ Object.defineProperty(exports, '__esModule', {
553
+ value: true
554
+ });
555
+ /******/
556
+ };
557
+ /******/
558
+ })();
559
+ /******/
560
+ /************************************************************************/
561
+ var __webpack_exports__ = {};
562
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
563
+ (function () {
564
+ __nested_webpack_require_1471__.r(__webpack_exports__);
565
+ /* harmony export */
566
+ __nested_webpack_require_1471__.d(__webpack_exports__, {
567
+ /* harmony export */"default": function _default() {
568
+ return __WEBPACK_DEFAULT_EXPORT__;
569
+ }
570
+ /* harmony export */
571
+ });
572
+ /* harmony import */
573
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1471__(787);
574
+ /* harmony import */
575
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1471__.n(react__WEBPACK_IMPORTED_MODULE_0__);
576
+ var _excluded = ["wrapperClassName", "disabled", "required", "value", "label", "name", "id", "options", "inline", "style", "tabIndex", "onClick", "onChange", "onBlur", "onFocus"];
577
+ function _extends() {
578
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
579
+ for (var i = 1; i < arguments.length; i++) {
580
+ var source = arguments[i];
581
+ for (var key in source) {
582
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
583
+ target[key] = source[key];
584
+ }
585
+ }
586
+ }
587
+ return target;
588
+ };
589
+ return _extends.apply(this, arguments);
590
+ }
591
+ function _typeof(obj) {
592
+ "@babel/helpers - typeof";
593
+
594
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
595
+ return typeof obj;
596
+ } : function (obj) {
597
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
598
+ }, _typeof(obj);
599
+ }
600
+ function _slicedToArray(arr, i) {
601
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
602
+ }
603
+ function _nonIterableRest() {
604
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
605
+ }
606
+ function _unsupportedIterableToArray(o, minLen) {
607
+ if (!o) return;
608
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
609
+ var n = Object.prototype.toString.call(o).slice(8, -1);
610
+ if (n === "Object" && o.constructor) n = o.constructor.name;
611
+ if (n === "Map" || n === "Set") return Array.from(o);
612
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
613
+ }
614
+ function _arrayLikeToArray(arr, len) {
615
+ if (len == null || len > arr.length) len = arr.length;
616
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
617
+ return arr2;
618
+ }
619
+ function _iterableToArrayLimit(arr, i) {
620
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
621
+ if (null != _i) {
622
+ var _s,
623
+ _e,
624
+ _x,
625
+ _r,
626
+ _arr = [],
627
+ _n = !0,
628
+ _d = !1;
629
+ try {
630
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
631
+ if (Object(_i) !== _i) return;
632
+ _n = !1;
633
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
634
+ } catch (err) {
635
+ _d = !0, _e = err;
636
+ } finally {
637
+ try {
638
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
639
+ } finally {
640
+ if (_d) throw _e;
641
+ }
642
+ }
643
+ return _arr;
644
+ }
645
+ }
646
+ function _arrayWithHoles(arr) {
647
+ if (Array.isArray(arr)) return arr;
648
+ }
649
+ function _objectWithoutProperties(source, excluded) {
650
+ if (source == null) return {};
651
+ var target = _objectWithoutPropertiesLoose(source, excluded);
652
+ var key, i;
653
+ if (Object.getOwnPropertySymbols) {
654
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
655
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
656
+ key = sourceSymbolKeys[i];
657
+ if (excluded.indexOf(key) >= 0) continue;
658
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
659
+ target[key] = source[key];
660
+ }
661
+ }
662
+ return target;
663
+ }
664
+ function _objectWithoutPropertiesLoose(source, excluded) {
665
+ if (source == null) return {};
666
+ var target = {};
667
+ var sourceKeys = Object.keys(source);
668
+ var key, i;
669
+ for (i = 0; i < sourceKeys.length; i++) {
670
+ key = sourceKeys[i];
671
+ if (excluded.indexOf(key) >= 0) continue;
672
+ target[key] = source[key];
673
+ }
674
+ return target;
675
+ }
676
+ var Radio = function Radio(props) {
677
+ var wrapperClassName = props.wrapperClassName,
678
+ disabled = props.disabled,
679
+ required = props.required,
680
+ value = props.value,
681
+ label = props.label,
682
+ name = props.name,
683
+ id = props.id,
684
+ options = props.options,
685
+ inline = props.inline,
686
+ style = props.style,
687
+ tabIndex = props.tabIndex,
688
+ onClick = props.onClick,
689
+ onChange = props.onChange,
690
+ onBlur = props.onBlur,
691
+ onFocus = props.onFocus,
692
+ attributes = _objectWithoutProperties(props, _excluded);
693
+ var uniqueID = (0, react__WEBPACK_IMPORTED_MODULE_0__.useId)();
694
+ var idRes = id || uniqueID;
695
+ var rootRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
696
+ var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
697
+ _useState2 = _slicedToArray(_useState, 2),
698
+ val = _useState2[0],
699
+ setVal = _useState2[1];
700
+
701
+ // Determine whether it is in JSON format
702
+ function isJSON(str) {
703
+ if (typeof str === 'string' && str.length > 0) {
704
+ if (str.replace(/\"\"/g, '').replace(/\,/g, '') == '[{}]') {
705
+ return false;
706
+ } else {
707
+ if (/^[\],:{}\s]*$/.test(str.replace(/\\["\\\/bfnrtu]/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
708
+ return true;
709
+ } else {
710
+ return false;
711
+ }
712
+ }
713
+ } else {
714
+ if (_typeof(str) === 'object' && Object.prototype.toString.call(str) === '[object Object]' && !str.length) {
715
+ return true;
716
+ } else {
717
+ return false;
718
+ }
719
+ }
720
+ }
721
+ function handleFocus(event) {
722
+ event.target.parentElement.classList.add('focus');
723
+
724
+ //
725
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
726
+ }
727
+ function handleChange(event) {
728
+ var _val = event.target.value;
729
+ setVal(_val);
730
+
731
+ //----
732
+ //remove focus style
733
+ [].slice.call(rootRef.current.querySelectorAll('.form-check-input')).forEach(function (el) {
734
+ var _el$parentElement;
735
+ (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 ? void 0 : _el$parentElement.classList.remove('focus');
736
+ });
737
+
738
+ //
739
+ if (typeof onChange === 'function') {
740
+ onChange(event, _val);
741
+ }
742
+ if (typeof onClick === 'function') {
743
+ onClick(event, _val);
744
+ }
745
+ }
746
+ function handleBlur(event) {
747
+ //----
748
+ //remove focus style
749
+ event.target.parentElement.classList.remove('focus');
750
+
751
+ //
752
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
753
+ }
754
+
755
+ // Get all options from option prop
756
+ var selectOptions = isJSON(options) ? JSON.parse(options) : null;
757
+ var optionKeys = selectOptions === null ? [] : Object.keys(selectOptions);
758
+ var optionValues = selectOptions === null ? [] : Object.values(selectOptions).map(function (item) {
759
+ return item.toString();
760
+ });
761
+ var radioOptionsList = optionKeys.map(function (radioOption, index) {
762
+ var requiredVal = index === 0 ? required || null : null;
763
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
764
+ key: index,
765
+ className: inline ? "form-check form-check-inline" : "form-check"
766
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
767
+ tabIndex: tabIndex || 0,
768
+ type: "radio",
769
+ className: "form-check-input",
770
+ id: "field-".concat(uniqueID, "-").concat(index),
771
+ name: name,
772
+ value: optionValues[index],
773
+ required: requiredVal,
774
+ disabled: disabled || null,
775
+ onChange: handleChange,
776
+ onClick: typeof onClick === 'function' ? handleChange : function () {
777
+ return void 0;
778
+ },
779
+ onFocus: handleFocus,
780
+ onBlur: handleBlur,
781
+ checked: val == optionValues[index] // component status will not change if defaultChecked is used
782
+ ,
783
+
784
+ style: style
785
+ }, attributes)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
786
+ className: "form-check-label",
787
+ htmlFor: "field-".concat(uniqueID, "-").concat(index),
788
+ dangerouslySetInnerHTML: {
789
+ __html: radioOption
790
+ }
791
+ }));
792
+ });
793
+ (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
794
+ setVal(value);
795
+ }, [value, options]);
796
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
797
+ className: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
798
+ ref: rootRef
799
+ }, label ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
800
+ htmlFor: idRes,
801
+ className: "form-label"
802
+ }, label)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
803
+ id: idRes
804
+ }, radioOptionsList)));
805
+ };
806
+ /* harmony default export */
807
+ var __WEBPACK_DEFAULT_EXPORT__ = Radio;
808
+ })();
809
+
810
+ /******/
811
+ return __webpack_exports__;
812
+ /******/
813
+ }()
814
+ );
815
+ });
816
+
817
+ /***/ }),
818
+
819
+ /***/ 426:
820
+ /***/ ((module) => {
821
+
822
+ 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 e(_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 e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
823
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
824
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
825
+ 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); }
826
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
827
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
828
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
829
+ /**
830
+ * Dom Utilities
831
+ * @param {HTMLElement} el - Element
832
+ * @param {?String} filter - A filter string
833
+ * @returns HtmlElementCollection
834
+ */
835
+ function matches(el, filter) {
836
+ if (el && el.nodeType === 1) {
837
+ if (filter) {
838
+ return el.matches(filter);
839
+ }
840
+ return true;
841
+ }
842
+ return false;
843
+ }
844
+
845
+ // the next siblings
846
+ function getNextSiblings(el) {
847
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
848
+ var sibs = [];
849
+ while (el = el.nextSibling) {
850
+ if (matches(el, filter)) {
851
+ sibs.push(el);
852
+ }
853
+ }
854
+ return sibs;
855
+ }
856
+
857
+ // previous siblings
858
+ function getPreviousSiblings(el) {
859
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
860
+ var sibs = [];
861
+ while (el = el.previousSibling) {
862
+ if (matches(el, filter)) {
863
+ sibs.push(el);
864
+ }
865
+ }
866
+ return sibs;
867
+ }
868
+
869
+ // parent and get all the siblings
870
+ function getAllSiblings(el) {
871
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
872
+ var sibs = [];
873
+ el = el.parentNode.firstChild;
874
+ while (el = el.nextSibling) {
875
+ if (matches(el, filter)) {
876
+ sibs.push(el);
877
+ }
878
+ }
879
+ return sibs;
880
+ }
881
+
882
+ // all parent nodes
883
+ function getParents(el) {
884
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
885
+ var parents = [];
886
+ while (el = el.parentNode) {
887
+ if (matches(el, filter)) {
888
+ parents.push(el);
889
+ }
890
+ }
891
+ return parents;
892
+ }
893
+
894
+ // all child nodes
895
+ function getChildren(el) {
896
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
897
+ var all = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
898
+ all.push.apply(all, _toConsumableArray(el.childNodes));
899
+ var _iterator = _createForOfIteratorHelper(el.childNodes),
900
+ _step;
901
+ try {
902
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
903
+ var child = _step.value;
904
+ getChildren(child, filter, all);
905
+ }
906
+ } catch (err) {
907
+ _iterator.e(err);
908
+ } finally {
909
+ _iterator.f();
910
+ }
911
+ var res = all.filter(function (item) {
912
+ return matches(item, filter);
913
+ });
914
+ return res;
915
+ }
916
+ module.exports = {
917
+ getNextSiblings: getNextSiblings,
918
+ getPreviousSiblings: getPreviousSiblings,
919
+ getAllSiblings: getAllSiblings,
920
+ getParents: getParents,
921
+ getChildren: getChildren
922
+ };
923
+
924
+ /***/ }),
925
+
926
+ /***/ 342:
927
+ /***/ ((module) => {
928
+
929
+ /*
930
+ * Debounce
931
+ *
932
+ * @param {Function} fn - A function to be executed within the time limit.
933
+ * @param {Number} limit - Waiting time.
934
+ * @return {Function} - Returns a new function.
935
+ */
936
+ function debounce(fn) {
937
+ var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
938
+ var timer;
939
+ return function () {
940
+ //Every time this returned function is called, the timer is cleared to ensure that fn is not executed
941
+ clearTimeout(timer);
942
+
943
+ // When the returned function is called for the last time (that is the user stops a continuous operation)
944
+ // Execute fn after another delay milliseconds
945
+ timer = setTimeout(function () {
946
+ fn.apply(this, arguments);
947
+ }, limit);
948
+ };
949
+ }
950
+
951
+ /*
952
+ * Throttle
953
+ *
954
+ * @param {Function} fn - A function to be executed within the time limit.
955
+ * @param {Number} limit - Waiting time.
956
+ * @return {Function} - Returns a new function.
957
+ */
958
+ function throttle(fn) {
959
+ var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
960
+ var waiting = false;
961
+ return function () {
962
+ if (!waiting) {
963
+ fn.apply(this, arguments);
964
+ waiting = true;
965
+ setTimeout(function () {
966
+ waiting = false;
967
+ }, limit);
968
+ }
969
+ };
970
+ }
971
+ module.exports = {
972
+ debounce: debounce,
973
+ throttle: throttle
974
+ };
975
+
976
+ /***/ }),
977
+
978
+ /***/ 787:
979
+ /***/ ((module) => {
980
+
981
+ "use strict";
982
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
983
+
984
+ /***/ })
985
+
986
+ /******/ });
987
+ /************************************************************************/
988
+ /******/ // The module cache
989
+ /******/ var __webpack_module_cache__ = {};
990
+ /******/
991
+ /******/ // The require function
992
+ /******/ function __webpack_require__(moduleId) {
993
+ /******/ // Check if module is in cache
994
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
995
+ /******/ if (cachedModule !== undefined) {
996
+ /******/ return cachedModule.exports;
997
+ /******/ }
998
+ /******/ // Create a new module (and put it into the cache)
999
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1000
+ /******/ id: moduleId,
1001
+ /******/ loaded: false,
1002
+ /******/ exports: {}
1003
+ /******/ };
1004
+ /******/
1005
+ /******/ // Execute the module function
1006
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1007
+ /******/
1008
+ /******/ // Flag the module as loaded
1009
+ /******/ module.loaded = true;
1010
+ /******/
1011
+ /******/ // Return the exports of the module
1012
+ /******/ return module.exports;
1013
+ /******/ }
1014
+ /******/
1015
+ /************************************************************************/
1016
+ /******/ /* webpack/runtime/compat get default export */
1017
+ /******/ (() => {
1018
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1019
+ /******/ __webpack_require__.n = (module) => {
1020
+ /******/ var getter = module && module.__esModule ?
1021
+ /******/ () => (module['default']) :
1022
+ /******/ () => (module);
1023
+ /******/ __webpack_require__.d(getter, { a: getter });
1024
+ /******/ return getter;
1025
+ /******/ };
1026
+ /******/ })();
1027
+ /******/
1028
+ /******/ /* webpack/runtime/define property getters */
1029
+ /******/ (() => {
1030
+ /******/ // define getter functions for harmony exports
1031
+ /******/ __webpack_require__.d = (exports, definition) => {
1032
+ /******/ for(var key in definition) {
1033
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1034
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1035
+ /******/ }
1036
+ /******/ }
1037
+ /******/ };
1038
+ /******/ })();
1039
+ /******/
1040
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1041
+ /******/ (() => {
1042
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1043
+ /******/ })();
1044
+ /******/
1045
+ /******/ /* webpack/runtime/make namespace object */
1046
+ /******/ (() => {
1047
+ /******/ // define __esModule on exports
1048
+ /******/ __webpack_require__.r = (exports) => {
1049
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1050
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1051
+ /******/ }
1052
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
1053
+ /******/ };
1054
+ /******/ })();
1055
+ /******/
1056
+ /******/ /* webpack/runtime/node module decorator */
1057
+ /******/ (() => {
1058
+ /******/ __webpack_require__.nmd = (module) => {
1059
+ /******/ module.paths = [];
1060
+ /******/ if (!module.children) module.children = [];
1061
+ /******/ return module;
1062
+ /******/ };
1063
+ /******/ })();
1064
+ /******/
1065
+ /************************************************************************/
1066
+ var __webpack_exports__ = {};
1067
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1068
+ (() => {
1069
+ "use strict";
1070
+ // ESM COMPAT FLAG
1071
+ __webpack_require__.r(__webpack_exports__);
1072
+
1073
+ // EXPORTS
1074
+ __webpack_require__.d(__webpack_exports__, {
1075
+ "default": () => (/* binding */ src)
1076
+ });
1077
+
1078
+ // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
1079
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
1080
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
1081
+ // EXTERNAL MODULE: ./src/utils/performance.js
1082
+ var performance = __webpack_require__(342);
1083
+ // EXTERNAL MODULE: ../Radio/dist/cjs/index.js
1084
+ var cjs = __webpack_require__(135);
1085
+ var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
1086
+ ;// CONCATENATED MODULE: ./src/TableField.tsx
1087
+
1088
+
1089
+ /* Table Field
1090
+ -------------------------------------------------*/
1091
+
1092
+ var TableField = function TableField(props) {
1093
+ var cols = props.cols,
1094
+ width = props.width,
1095
+ className = props.className,
1096
+ style = props.style,
1097
+ columnHeader = props.columnHeader,
1098
+ index = props.index,
1099
+ content = props.content;
1100
+ function handleTbodyLeave(e) {
1101
+ e.target.closest('table').querySelector('tbody').classList.remove('drag-trigger-mousedown');
1102
+ }
1103
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("td", {
1104
+ colSpan: cols,
1105
+ "data-table-text": columnHeader,
1106
+ "data-table-col": index,
1107
+ onMouseEnter: handleTbodyLeave,
1108
+ style: style ? style : width ? typeof window !== 'undefined' && window.innerWidth > 768 ? {
1109
+ width: width
1110
+ } : {} : {},
1111
+ className: className || ''
1112
+ }, content));
1113
+ };
1114
+ /* harmony default export */ const src_TableField = (TableField);
1115
+ // EXTERNAL MODULE: ../Checkbox/dist/cjs/index.js
1116
+ var dist_cjs = __webpack_require__(109);
1117
+ var dist_cjs_default = /*#__PURE__*/__webpack_require__.n(dist_cjs);
1118
+ // EXTERNAL MODULE: ./src/utils/dom.js
1119
+ var dom = __webpack_require__(426);
1120
+ ;// CONCATENATED MODULE: ./src/table-utils.ts
1121
+ var removeItemOnce = function removeItemOnce(arr, key) {
1122
+ return arr.filter(function (item) {
1123
+ return item.key !== key;
1124
+ });
1125
+ };
1126
+ var formatCheckboxControlVal = function formatCheckboxControlVal(el) {
1127
+ var _el$closest, _el$dataset$name;
1128
+ var _curContent = [].slice.call((_el$closest = el.closest('th')) === null || _el$closest === void 0 ? void 0 : _el$closest.children).at(-1).innerHTML;
1129
+ var $row = el.closest('tr[data-key]');
1130
+ var _restContent = [].slice.call($row.children).map(function (node, i) {
1131
+ if (i > 0) return node.innerHTML;
1132
+ }).filter(function (item) {
1133
+ return item !== undefined;
1134
+ });
1135
+ _restContent.unshift(_curContent);
1136
+ return {
1137
+ index: Number(el.dataset.index),
1138
+ key: el.dataset.key,
1139
+ name: (_el$dataset$name = el.dataset.name) === null || _el$dataset$name === void 0 ? void 0 : _el$dataset$name.replace(/-label$/, ''),
1140
+ content: _restContent
1141
+ };
1142
+ };
1143
+ var formatRowControlVal = function formatRowControlVal(el, checkboxNamePrefix) {
1144
+ var _el$querySelector;
1145
+ var _curContent = [].slice.call((_el$querySelector = el.querySelector('th')) === null || _el$querySelector === void 0 ? void 0 : _el$querySelector.children).at(-1).innerHTML;
1146
+ var $row = el.closest('tr[data-key]');
1147
+ var _restContent = [].slice.call($row.children).map(function (node, i) {
1148
+ if (i > 0) return node.innerHTML;
1149
+ }).filter(function (item) {
1150
+ return item !== undefined;
1151
+ });
1152
+ _restContent.unshift(_curContent);
1153
+ return {
1154
+ index: Number(el.dataset.id),
1155
+ key: el.dataset.key,
1156
+ name: "checkbox-".concat(checkboxNamePrefix, "-").concat(el.dataset.key),
1157
+ content: _restContent
1158
+ };
1159
+ };
1160
+ var formatPerlineControlVal = function formatPerlineControlVal(el) {
1161
+ var $row = el;
1162
+ var _restContent = [].slice.call($row.children).map(function (node, i) {
1163
+ return node.innerHTML;
1164
+ }).filter(function (item) {
1165
+ return item !== undefined;
1166
+ });
1167
+ return {
1168
+ index: Number(el.dataset.id),
1169
+ key: el.dataset.key,
1170
+ content: _restContent
1171
+ };
1172
+ };
1173
+ var setCheckboxCheckedData = function setCheckboxCheckedData(arr, key, val) {
1174
+ arr.forEach(function (item, index) {
1175
+ if (item.key === key) arr[index].checked = val;
1176
+ });
1177
+ };
1178
+ ;// CONCATENATED MODULE: ./src/TableFieldRow.tsx
1179
+
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+ /* Table Field Row
1186
+ -------------------------------------------------*/
1187
+
1188
+ var TableFieldRow = function TableFieldRow(props) {
1189
+ var _filter$;
1190
+ var draggable = props.draggable,
1191
+ useRadio = props.useRadio,
1192
+ cols = props.cols,
1193
+ width = props.width,
1194
+ className = props.className,
1195
+ style = props.style,
1196
+ columnHeader = props.columnHeader,
1197
+ index = props.index,
1198
+ content = props.content,
1199
+ checkboxNamePrefix = props.checkboxNamePrefix,
1200
+ rowKey = props.rowKey,
1201
+ getCheckedPrint = props.getCheckedPrint,
1202
+ updateCheckedPrint = props.updateCheckedPrint,
1203
+ getCheckedData = props.getCheckedData,
1204
+ updategetCheckedData = props.updategetCheckedData,
1205
+ getCheckedRootData = props.getCheckedRootData,
1206
+ updategetCheckedRootData = props.updategetCheckedRootData,
1207
+ onCheck = props.onCheck;
1208
+ var contentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
1209
+ var checkboxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
1210
+ var rowIndex = rowKey === null || rowKey === void 0 ? void 0 : rowKey.replace('row-', '');
1211
+ function handleTbodyEnter(e) {
1212
+ e.target.closest('table').querySelector('tbody').classList.add('drag-trigger-mousedown');
1213
+ }
1214
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("th", {
1215
+ scope: "row",
1216
+ colSpan: cols,
1217
+ "data-table-text": columnHeader,
1218
+ "data-table-col": index,
1219
+ style: style ? style : width ? typeof window !== 'undefined' && window.innerWidth > 768 ? {
1220
+ width: width
1221
+ } : {} : {},
1222
+ className: className || ''
1223
+ }, draggable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
1224
+ className: "drag-trigger",
1225
+ "data-id": rowIndex,
1226
+ onMouseEnter: handleTbodyEnter
1227
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
1228
+ width: "1em",
1229
+ height: "1em",
1230
+ viewBox: "0 0 24 24",
1231
+ fill: "none"
1232
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1233
+ d: "M18 14C17.4477 14 17 14.4477 17 15C17 15.5523 17.4477 16 18 16C18.5523 16 19 15.5523 19 15C19 14.4477 18.5523 14 18 14Z",
1234
+ stroke: "#000000",
1235
+ strokeWidth: "2",
1236
+ strokeLinecap: "round",
1237
+ strokeLinejoin: "round"
1238
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1239
+ d: "M12 14C11.4477 14 11 14.4477 11 15C11 15.5523 11.4477 16 12 16C12.5523 16 13 15.5523 13 15C13 14.4477 12.5523 14 12 14Z",
1240
+ stroke: "#000000",
1241
+ strokeWidth: "2",
1242
+ strokeLinecap: "round",
1243
+ strokeLinejoin: "round"
1244
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1245
+ d: "M6 14C5.44772 14 5 14.4477 5 15C5 15.5523 5.44772 16 6 16C6.55228 16 7 15.5523 7 15C7 14.4477 6.55228 14 6 14Z",
1246
+ stroke: "#000000",
1247
+ strokeWidth: "2",
1248
+ strokeLinecap: "round",
1249
+ strokeLinejoin: "round"
1250
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1251
+ d: "M18 8C17.4477 8 17 8.44772 17 9C17 9.55228 17.4477 10 18 10C18.5523 10 19 9.55228 19 9C19 8.44772 18.5523 8 18 8Z",
1252
+ stroke: "#000000",
1253
+ strokeWidth: "2",
1254
+ strokeLinecap: "round",
1255
+ strokeLinejoin: "round"
1256
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1257
+ d: "M12 8C11.4477 8 11 8.44772 11 9C11 9.55228 11.4477 10 12 10C12.5523 10 13 9.55228 13 9C13 8.44772 12.5523 8 12 8Z",
1258
+ stroke: "#000000",
1259
+ strokeWidth: "2",
1260
+ strokeLinecap: "round",
1261
+ strokeLinejoin: "round"
1262
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1263
+ d: "M6 8C5.44772 8 5 8.44772 5 9C5 9.55228 5.44772 10 6 10C6.55228 10 7 9.55228 7 9C7 8.44772 6.55228 8 6 8Z",
1264
+ stroke: "#000000",
1265
+ strokeWidth: "2",
1266
+ strokeLinecap: "round",
1267
+ strokeLinejoin: "round"
1268
+ })))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
1269
+ className: "checkbox-trigger"
1270
+ }, useRadio ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
1271
+ wrapperClassName: "",
1272
+ options: "{\n \"\":\"".concat(rowKey, "\"}"),
1273
+ name: "checkbox-".concat(checkboxNamePrefix, "-0"),
1274
+ tabIndex: -1,
1275
+ "data-index": "".concat(rowIndex),
1276
+ "data-key": "".concat(rowKey),
1277
+ value: "".concat(rowKey),
1278
+ onClick: function onClick(e, val) {
1279
+ // callback
1280
+ //-----------
1281
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck(formatCheckboxControlVal(e.target));
1282
+ }
1283
+ })) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((dist_cjs_default()), {
1284
+ ref: checkboxRef,
1285
+ wrapperClassName: "",
1286
+ name: "checkbox-".concat(checkboxNamePrefix, "-").concat(rowIndex),
1287
+ tabIndex: -1,
1288
+ "data-index": "".concat(rowIndex),
1289
+ "data-key": "".concat(rowKey),
1290
+ value: "".concat(rowKey),
1291
+ checked: (_filter$ = getCheckedData.filter(function (cur) {
1292
+ return cur.key === rowKey;
1293
+ })[0]) === null || _filter$ === void 0 ? void 0 : _filter$.checked,
1294
+ onChange: function onChange(e, val) {
1295
+ var _curKey = e.target.value;
1296
+ var _checkedData = getCheckedData;
1297
+ var _res = getCheckedPrint;
1298
+
1299
+ // STEP 1:
1300
+ // Current checkbox
1301
+ //-----------
1302
+ if (val === true) {
1303
+ _res.push(formatCheckboxControlVal(e.target));
1304
+ setCheckboxCheckedData(_checkedData, _curKey, true);
1305
+ } else {
1306
+ setCheckboxCheckedData(_checkedData, _curKey, false);
1307
+ _res = removeItemOnce(_res, _curKey);
1308
+ }
1309
+
1310
+ // STEP 2:
1311
+ // Array deduplication
1312
+ //-----------
1313
+ _res = _res.filter(function (item, index, self) {
1314
+ return index === self.findIndex(function (t) {
1315
+ return t.key === item.key;
1316
+ });
1317
+ });
1318
+
1319
+ // STEP 3:
1320
+ // ALl parent checkboxes
1321
+ //-----------
1322
+ var _headRow = e.target.closest('table').querySelectorAll('thead th')[0];
1323
+ if (typeof _headRow !== 'undefined') {
1324
+ var _rootCheckbox = _headRow.querySelector('[type="checkbox"]');
1325
+ var _checkboxes = (0,dom.getChildren)(e.target.closest('table').querySelector('tbody'), '[type="checkbox"]');
1326
+ var _checkedLength = _checkboxes.filter(function (el) {
1327
+ return el.checked === true;
1328
+ }).length;
1329
+ if (_checkedLength === 0) {
1330
+ _rootCheckbox.indeterminate = false;
1331
+ updategetCheckedRootData([{
1332
+ key: "row-all",
1333
+ checked: false
1334
+ }]);
1335
+ } else {
1336
+ if (_checkedLength === _checkboxes.length) {
1337
+ _rootCheckbox.indeterminate = false;
1338
+ updategetCheckedRootData([{
1339
+ key: "row-all",
1340
+ checked: true
1341
+ }]);
1342
+ }
1343
+ if (_checkedLength < _checkboxes.length) {
1344
+ updategetCheckedRootData([{
1345
+ key: "row-all",
1346
+ checked: false
1347
+ }]);
1348
+ _rootCheckbox.indeterminate = true;
1349
+ }
1350
+ }
1351
+ }
1352
+
1353
+ // STEP 4:
1354
+ // Update checked data
1355
+ //-----------
1356
+ updategetCheckedData(_checkedData);
1357
+
1358
+ // STEP 5:
1359
+ // Update checked print
1360
+ //-----------
1361
+ updateCheckedPrint(_res);
1362
+
1363
+ // STEP 6:
1364
+ // callback
1365
+ //-----------
1366
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck(_res);
1367
+ }
1368
+ }))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
1369
+ ref: contentRef
1370
+ }, content)));
1371
+ };
1372
+ /* harmony default export */ const src_TableFieldRow = (TableFieldRow);
1373
+ ;// CONCATENATED MODULE: ./src/TableRow.tsx
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+ /* Table Row
1381
+ -------------------------------------------------*/
1382
+
1383
+ var TableRow = function TableRow(props) {
1384
+ var _filter$;
1385
+ var index = props.index,
1386
+ data = props.data,
1387
+ headerLabel = props.headerLabel,
1388
+ checkboxNamePrefix = props.checkboxNamePrefix,
1389
+ rowKey = props.rowKey,
1390
+ getCheckedPrint = props.getCheckedPrint,
1391
+ updateCheckedPrint = props.updateCheckedPrint,
1392
+ getCheckedData = props.getCheckedData,
1393
+ updategetCheckedData = props.updategetCheckedData,
1394
+ getCheckedRootData = props.getCheckedRootData,
1395
+ updategetCheckedRootData = props.updategetCheckedRootData,
1396
+ draggable = props.draggable,
1397
+ useRadio = props.useRadio,
1398
+ onClick = props.onClick,
1399
+ onCheck = props.onCheck,
1400
+ evDragEnd = props.evDragEnd,
1401
+ evDragStart = props.evDragStart;
1402
+ var nonExistentRowKey = "row-null";
1403
+ var rowChecked = (_filter$ = getCheckedData.filter(function (cur) {
1404
+ return cur.key === rowKey;
1405
+ })[0]) === null || _filter$ === void 0 ? void 0 : _filter$.checked;
1406
+ function handleClick(event) {
1407
+ var curVal = formatPerlineControlVal(event.currentTarget);
1408
+ onClick === null || onClick === void 0 ? void 0 : onClick(event, curVal);
1409
+ }
1410
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tr", {
1411
+ draggable: draggable,
1412
+ onDragEnd: evDragEnd,
1413
+ onDragStart: evDragStart,
1414
+ "data-id": index,
1415
+ "data-key": rowKey,
1416
+ className: "row-obj ".concat(rowChecked ? 'active' : '', " ").concat(typeof onClick === 'undefined' ? '' : 'clickable'),
1417
+ onClick: handleClick
1418
+ }, data ? data.map(function (el, i) {
1419
+ var headerItem = headerLabel[i];
1420
+ if (headerItem === undefined) headerItem = {
1421
+ type: false,
1422
+ content: ''
1423
+ };
1424
+ if (i === 0) {
1425
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_TableFieldRow, {
1426
+ key: 'th-row' + i,
1427
+ useRadio: useRadio,
1428
+ columnHeader: headerItem.content.replace(/(<([^>]+)>)/ig, ''),
1429
+ cols: el.cols,
1430
+ content: el.content,
1431
+ width: el.width,
1432
+ style: el.style,
1433
+ index: i,
1434
+ checkboxNamePrefix: checkboxNamePrefix,
1435
+ rowKey: rowKey,
1436
+ updateCheckedPrint: updateCheckedPrint,
1437
+ getCheckedPrint: getCheckedPrint,
1438
+ updategetCheckedData: updategetCheckedData,
1439
+ getCheckedData: getCheckedData,
1440
+ updategetCheckedRootData: updategetCheckedRootData,
1441
+ getCheckedRootData: getCheckedRootData,
1442
+ onCheck: onCheck,
1443
+ draggable: draggable
1444
+ });
1445
+ } else {
1446
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_TableField, {
1447
+ key: 'td-row' + i,
1448
+ columnHeader: headerItem.content.replace(/(<([^>]+)>)/ig, ''),
1449
+ cols: el.cols,
1450
+ content: el.content,
1451
+ width: el.width,
1452
+ style: el.style,
1453
+ index: i
1454
+ });
1455
+ }
1456
+ }) : null, useRadio ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("td", {
1457
+ style: {
1458
+ display: 'none'
1459
+ }
1460
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
1461
+ wrapperClassName: "",
1462
+ options: "{\n \"\":\"".concat(nonExistentRowKey, "\"}"),
1463
+ name: "checkbox-".concat(checkboxNamePrefix, "-0"),
1464
+ tabIndex: -1,
1465
+ "data-index": "".concat(nonExistentRowKey === null || nonExistentRowKey === void 0 ? void 0 : nonExistentRowKey.replace('row-', '')),
1466
+ "data-key": "".concat(nonExistentRowKey),
1467
+ value: "".concat(nonExistentRowKey)
1468
+ }))) : null));
1469
+ };
1470
+ /* harmony default export */ const src_TableRow = (TableRow);
1471
+ ;// CONCATENATED MODULE: ./src/TableHeaders.tsx
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+ /* Table Headers
1478
+ -------------------------------------------------*/
1479
+
1480
+ var TableHeaders = function TableHeaders(props) {
1481
+ var data = props.data,
1482
+ useRadio = props.useRadio,
1483
+ headClassName = props.headClassName,
1484
+ checkboxNamePrefix = props.checkboxNamePrefix,
1485
+ sortable = props.sortable,
1486
+ getCheckedPrint = props.getCheckedPrint,
1487
+ updateCheckedPrint = props.updateCheckedPrint,
1488
+ getCheckedData = props.getCheckedData,
1489
+ updategetCheckedData = props.updategetCheckedData,
1490
+ getCheckedRootData = props.getCheckedRootData,
1491
+ updategetCheckedRootData = props.updategetCheckedRootData,
1492
+ onCheck = props.onCheck,
1493
+ evSort = props.evSort;
1494
+ return data ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("thead", {
1495
+ className: headClassName ? headClassName : ''
1496
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tr", null, data.map(function (item, i) {
1497
+ var _filter$;
1498
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("th", {
1499
+ key: i,
1500
+ scope: "col",
1501
+ "data-sort-type": item.type,
1502
+ "data-table-text": item.content.replace(/(<([^>]+)>)/ig, ''),
1503
+ "data-table-col": i,
1504
+ style: item.style ? item.style : item.width ? typeof window !== 'undefined' && window.innerWidth > 768 ? {
1505
+ width: item.width
1506
+ } : {} : {},
1507
+ className: item.className || ''
1508
+ }, i === 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
1509
+ className: "checkbox-trigger",
1510
+ style: {
1511
+ visibility: useRadio ? 'hidden' : 'visible'
1512
+ }
1513
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((dist_cjs_default()), {
1514
+ wrapperClassName: "",
1515
+ name: "checkbox-".concat(checkboxNamePrefix, "-all"),
1516
+ tabIndex: -1,
1517
+ value: "row-all",
1518
+ checked: (_filter$ = getCheckedRootData.filter(function (cur) {
1519
+ return cur.key === 'row-all';
1520
+ })[0]) === null || _filter$ === void 0 ? void 0 : _filter$.checked,
1521
+ onChange: function onChange(e, val) {
1522
+ var _checkedData = getCheckedData;
1523
+ var _res = getCheckedPrint;
1524
+
1525
+ // STEP 1:
1526
+ // Current checkbox
1527
+ //-----------
1528
+ if (val === true) {
1529
+ updategetCheckedRootData([{
1530
+ key: "row-all",
1531
+ checked: true
1532
+ }]);
1533
+ } else {
1534
+ updategetCheckedRootData([{
1535
+ key: "row-all",
1536
+ checked: false
1537
+ }]);
1538
+ }
1539
+
1540
+ // STEP 2:
1541
+ // All child checkboxes
1542
+ //-----------
1543
+ var _checkboxes = (0,dom.getChildren)(e.target.closest('table').querySelector('tbody'), '[type="checkbox"]');
1544
+ [].slice.call(_checkboxes).forEach(function (node) {
1545
+ if (val === true) {
1546
+ setCheckboxCheckedData(_checkedData, node.dataset.key, true);
1547
+ _res.push(formatCheckboxControlVal(node));
1548
+ } else {
1549
+ setCheckboxCheckedData(_checkedData, node.dataset.key, false);
1550
+ _res = [];
1551
+ }
1552
+ });
1553
+
1554
+ // STEP 3:
1555
+ // Array deduplication
1556
+ //-----------
1557
+ _res = _res.filter(function (item, index, self) {
1558
+ return index === self.findIndex(function (t) {
1559
+ return t.key === item.key;
1560
+ });
1561
+ });
1562
+
1563
+ // STEP 4:
1564
+ // Update checked data
1565
+ //-----------
1566
+ updategetCheckedData(_checkedData);
1567
+
1568
+ // STEP 5:
1569
+ // Update checked print
1570
+ //-----------
1571
+ updateCheckedPrint(_res);
1572
+
1573
+ // STEP 6:
1574
+ // callback
1575
+ //-----------
1576
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck(_res);
1577
+ }
1578
+ })) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
1579
+ dangerouslySetInnerHTML: {
1580
+ __html: "".concat(item.content)
1581
+ }
1582
+ }), sortable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
1583
+ className: "sort-trigger",
1584
+ onClick: evSort
1585
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
1586
+ width: "1em",
1587
+ height: "1em",
1588
+ viewBox: "0 0 18 18"
1589
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", {
1590
+ stroke: "none",
1591
+ strokeWidth: "1",
1592
+ fill: "none",
1593
+ fillRule: "evenodd"
1594
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
1595
+ d: "M9.5,3 L13,8 L6,8 L9.5,3 L9.5,3 Z M6,11 L13,11 L9.5,16 L6,11 L6,11 Z",
1596
+ id: "path",
1597
+ fill: "#000000"
1598
+ })))) : null);
1599
+ }), useRadio ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("th", {
1600
+ style: {
1601
+ display: 'none'
1602
+ }
1603
+ })) : null))) : null;
1604
+ };
1605
+ /* harmony default export */ const src_TableHeaders = (TableHeaders);
1606
+ ;// CONCATENATED MODULE: ./src/TableSummaries.tsx
1607
+
1608
+
1609
+ /* Table Summaries
1610
+ -------------------------------------------------*/
1611
+
1612
+ var TableSummaries = function TableSummaries(props) {
1613
+ var data = props.data,
1614
+ footClassName = props.footClassName;
1615
+ return data ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tfoot", {
1616
+ className: footClassName ? footClassName : ''
1617
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tr", null, data.map(function (item, i) {
1618
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("th", {
1619
+ key: i
1620
+ }, item);
1621
+ })))) : null;
1622
+ };
1623
+ /* harmony default export */ const src_TableSummaries = (TableSummaries);
1624
+ ;// CONCATENATED MODULE: ./src/TableColgroup.tsx
1625
+
1626
+
1627
+ /* Table Colgroup
1628
+ -------------------------------------------------*/
1629
+
1630
+ var TableColgroup = function TableColgroup(props) {
1631
+ var data = props.data;
1632
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("colgroup", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("col", null), data ? data.map(function (el, i) {
1633
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("col", {
1634
+ key: i
1635
+ });
1636
+ }) : null));
1637
+ };
1638
+ /* harmony default export */ const src_TableColgroup = (TableColgroup);
1639
+ ;// CONCATENATED MODULE: ./src/index.tsx
1640
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1641
+ 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."); }
1642
+ 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); }
1643
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
1644
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
1645
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1646
+
1647
+
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+ var Table = function Table(props) {
1655
+ var wrapperClassName = props.wrapperClassName,
1656
+ tableClassName = props.tableClassName,
1657
+ bodyClassName = props.bodyClassName,
1658
+ headClassName = props.headClassName,
1659
+ footClassName = props.footClassName,
1660
+ checkable = props.checkable,
1661
+ useRadio = props.useRadio,
1662
+ draggable = props.draggable,
1663
+ sortable = props.sortable,
1664
+ data = props.data,
1665
+ bordered = props.bordered,
1666
+ colGroup = props.colGroup,
1667
+ responsive = props.responsive,
1668
+ enhancedResponsive = props.enhancedResponsive,
1669
+ enhancedResponsiveWithScrollBar = props.enhancedResponsiveWithScrollBar,
1670
+ id = props.id,
1671
+ onClick = props.onClick,
1672
+ onCheck = props.onCheck,
1673
+ onDrag = props.onDrag;
1674
+ var uniqueID = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useId)().replace(/\:/g, "-");
1675
+ var idRes = id || uniqueID;
1676
+ var rootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
1677
+ var tbodyRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
1678
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
1679
+ _useState2 = _slicedToArray(_useState, 2),
1680
+ checkedPrint = _useState2[0],
1681
+ setCheckedPrint = _useState2[1];
1682
+ var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
1683
+ _useState4 = _slicedToArray(_useState3, 2),
1684
+ checkedData = _useState4[0],
1685
+ setCheckedData = _useState4[1];
1686
+ var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
1687
+ _useState6 = _slicedToArray(_useState5, 2),
1688
+ checkedRootData = _useState6[0],
1689
+ setCheckedRootData = _useState6[1];
1690
+ var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
1691
+ _useState8 = _slicedToArray(_useState7, 2),
1692
+ sortData = _useState8[0],
1693
+ setSortData = _useState8[1];
1694
+ var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
1695
+ _useState10 = _slicedToArray(_useState9, 2),
1696
+ mainUpdate = _useState10[0],
1697
+ setMainUpdate = _useState10[1];
1698
+ var windowResizeUpdate = (0,performance.debounce)(handleWindowUpdate, 50);
1699
+ var _headers = data.hasOwnProperty('headers') ? data.headers : false;
1700
+ var _summaries = data.hasOwnProperty('summaries') ? data.summaries : false;
1701
+ var windowWidth = typeof window !== 'undefined' ? window.innerWidth : 0;
1702
+
1703
+ //Set the class names of different styles
1704
+ //
1705
+ var tableClasses = '';
1706
+ if (bordered) tableClasses += ' table-bordered';
1707
+ if (colGroup) tableClasses += ' table-colgroup';
1708
+
1709
+ //
1710
+ var responsiveClasses = '';
1711
+ if (responsive) tableClasses += ' table-responsive';
1712
+
1713
+ //
1714
+ var enhancedResponsiveClasses = '';
1715
+ if (enhancedResponsive && !enhancedResponsiveWithScrollBar) enhancedResponsiveClasses += ' table-enhanced-responsive';
1716
+ if (enhancedResponsiveWithScrollBar && !enhancedResponsive) enhancedResponsiveClasses += ' table-enhanced-responsive-scrolled';
1717
+
1718
+ //
1719
+ var checkableClasses = '';
1720
+ if (checkable) checkableClasses += ' has-checkbox';
1721
+
1722
+ //
1723
+ var radioClasses = '';
1724
+ if (useRadio) radioClasses += ' use-radio';
1725
+
1726
+ //
1727
+ var draggableClasses = '';
1728
+ if (draggable) draggableClasses += ' allow-dragdrop';
1729
+
1730
+ //
1731
+ var sortableClasses = '';
1732
+ if (sortable) sortableClasses += ' enable-sort';
1733
+
1734
+ // ================================================================
1735
+ // generic
1736
+ // ================================================================
1737
+ var insertAfter = function insertAfter(newNode, existingNode) {
1738
+ existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
1739
+ };
1740
+ var allRows = function allRows() {
1741
+ return [].slice.call(tbodyRef.current.children);
1742
+ };
1743
+ var printData = function printData(data) {
1744
+ var _res = [];
1745
+ data.forEach(function (v) {
1746
+ _res.push(formatRowControlVal(rootRef.current.querySelector('table').querySelector("tbody [data-key=\"row-".concat(v, "\"]")), idRes));
1747
+ });
1748
+ return _res;
1749
+ };
1750
+
1751
+ // ================================================================
1752
+ // responsive table initialization
1753
+ // ================================================================
1754
+ function handleWindowUpdate() {
1755
+ // Check window width has actually changed and it's not just iOS triggering a resize event on scroll
1756
+ if (window.innerWidth != windowWidth) {
1757
+ // Update the window width for next time
1758
+ windowWidth = window.innerWidth;
1759
+
1760
+ // Do stuff here
1761
+ tableDataScrolledInit(windowWidth);
1762
+ }
1763
+ }
1764
+ function maxDimension(elements) {
1765
+ var res = {
1766
+ 'height': 0,
1767
+ 'width': 0
1768
+ };
1769
+ var elementHeights = Array.prototype.map.call(elements, function (el) {
1770
+ return el.clientHeight;
1771
+ });
1772
+ var elementWidths = Array.prototype.map.call(elements, function (el) {
1773
+ return el.clientWidth;
1774
+ });
1775
+ var maxHeight = Math.max.apply(null, elementHeights);
1776
+ var maxWidth = Math.max.apply(null, elementWidths);
1777
+ res = {
1778
+ 'height': maxHeight,
1779
+ 'width': maxWidth
1780
+ };
1781
+ return res;
1782
+ }
1783
+ ;
1784
+ function tableDataScrolledInit(w) {
1785
+ if (w <= 768) {
1786
+ var _loop = function _loop() {
1787
+ var tbodyRows = rootRef.current.querySelectorAll("tbody tr [data-table-col=\"".concat(i, "\"]"));
1788
+ var maxHeight = maxDimension(tbodyRows).height;
1789
+ [].slice.call(tbodyRows).forEach(function (row) {
1790
+ row.style.height = maxHeight + 'px';
1791
+ });
1792
+
1793
+ //
1794
+ var theadRows = rootRef.current.querySelectorAll("thead tr [data-table-col=\"".concat(i, "\"]"));
1795
+ [].slice.call(theadRows).forEach(function (row) {
1796
+ row.style.height = maxHeight + 'px';
1797
+ });
1798
+ };
1799
+ //get maxHeight of per row
1800
+ for (var i = 0; i < tbodyRef.current.querySelector('tr').children.length; i++) {
1801
+ _loop();
1802
+ }
1803
+ } else {
1804
+ [].slice.call(rootRef.current.querySelectorAll('tbody td, tbody th, thead th')).forEach(function (node, i) {
1805
+ node.removeAttribute('style');
1806
+ });
1807
+ }
1808
+ }
1809
+
1810
+ // ================================================================
1811
+ // checkboxes data
1812
+ // ================================================================
1813
+ function initCheckboxesData() {
1814
+ var _checkboxes = (0,dom.getChildren)(rootRef.current.querySelector('table').querySelector('tbody'), '[type="checkbox"]');
1815
+ var _data = [];
1816
+ [].slice.call(_checkboxes).forEach(function (node, i) {
1817
+ _data.push({
1818
+ key: "row-".concat(i),
1819
+ checked: false
1820
+ });
1821
+ });
1822
+ setCheckedData(_data);
1823
+ setCheckedRootData([{
1824
+ key: "row-all",
1825
+ checked: false
1826
+ }]);
1827
+ }
1828
+
1829
+ // ================================================================
1830
+ // sort with headers
1831
+ // ================================================================
1832
+ var inverse = false;
1833
+ function handleSortList(e) {
1834
+ var el = e.currentTarget.parentNode;
1835
+ var filterType = el.dataset.sortType;
1836
+ var curIndex = el.dataset.tableCol;
1837
+ var targetComparator = [].slice.call(tbodyRef.current.querySelectorAll("[data-table-col=\"".concat(curIndex, "\"]")));
1838
+ if (filterType === false) return false;
1839
+
1840
+ //sort of HTML elements
1841
+ var sortBy = function sortBy(a, b) {
1842
+ var txt1 = a.innerHTML.replace(/(<([^>]+)>)/ig, '').toLowerCase(),
1843
+ txt2 = b.innerHTML.replace(/(<([^>]+)>)/ig, '').toLowerCase();
1844
+
1845
+ //type of number
1846
+ if (filterType == 'number') {
1847
+ txt1 = Number(txt1.replace(/[^0-9.-]+/g, ''));
1848
+ txt2 = Number(txt2.replace(/[^0-9.-]+/g, ''));
1849
+ }
1850
+
1851
+ //type of date
1852
+ if (filterType == 'date') {
1853
+ txt1 = new Date(txt1);
1854
+ txt2 = new Date(txt2);
1855
+ }
1856
+
1857
+ //add filter class
1858
+ allRows().forEach(function (node) {
1859
+ node.classList.add('newsort');
1860
+ });
1861
+ inverse = !inverse;
1862
+ return txt2 < txt1 ? -1 : txt2 > txt1 ? 1 : 0;
1863
+ };
1864
+ targetComparator.sort(sortBy);
1865
+
1866
+ //console.log( 'targetComparator:', targetComparator );
1867
+ //console.log( 'inverse:', self.inverse );
1868
+
1869
+ if (!inverse) targetComparator.reverse();
1870
+ allRows().forEach(function (node) {
1871
+ node.remove();
1872
+ });
1873
+ for (var i = 0; i < targetComparator.length; i++) {
1874
+ var curRow = targetComparator[i].parentNode;
1875
+ tbodyRef.current.appendChild(curRow);
1876
+ }
1877
+ }
1878
+
1879
+ // ================================================================
1880
+ //drag & drop
1881
+ // ================================================================
1882
+ var draggedObj = null;
1883
+ var overObj = null;
1884
+ var placeholderGenerator = function placeholderGenerator(trHeight) {
1885
+ // Insert a row at the "index" of the table
1886
+ var newRow = document.createElement('tr');
1887
+ newRow.className = 'row-placeholder';
1888
+ newRow.dataset.placeholder = 'true';
1889
+ newRow.style.height = trHeight + 'px';
1890
+
1891
+ // Insert a cell in the row at index
1892
+ var newCell = newRow.insertCell(0);
1893
+ newCell.colSpan = tbodyRef.current.querySelector('tr').children.length;
1894
+
1895
+ // Append a text node to the cell
1896
+ var newText = document.createTextNode(' ');
1897
+ newCell.appendChild(newText);
1898
+ return newRow;
1899
+ };
1900
+ var lastRowGenerator = function lastRowGenerator(trHeight) {
1901
+ // Insert a row at the "index" of the table
1902
+ var newRow = document.createElement('tr');
1903
+ newRow.className = 'row-obj row-obj-clonelast';
1904
+ newRow.dataset.id = allRows().length.toString();
1905
+ newRow.style.height = trHeight + 'px';
1906
+ newRow.style.display = 'none';
1907
+
1908
+ // Insert a cell in the row at index
1909
+ var newCell = newRow.insertCell(0);
1910
+ newCell.colSpan = tbodyRef.current.querySelector('tr').children.length;
1911
+
1912
+ // Append a text node to the cell
1913
+ var newText = document.createTextNode(' ');
1914
+ newCell.appendChild(newText);
1915
+ return newRow;
1916
+ };
1917
+ var removePlaceholder = function removePlaceholder() {
1918
+ // Delete row at the "index" of the table
1919
+ var placeholder = [].slice.call(tbodyRef.current.querySelectorAll("[data-placeholder]"));
1920
+ placeholder.forEach(function (node) {
1921
+ tbodyRef.current.removeChild(node);
1922
+ });
1923
+ };
1924
+ function handleTbodyLeave(e) {
1925
+ tbodyRef.current.classList.remove('drag-trigger-mousedown');
1926
+ }
1927
+
1928
+ // events fired on the drop targets
1929
+ var handledragOver = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (e) {
1930
+ e.preventDefault();
1931
+ draggedObj.style.display = 'none';
1932
+ if (e.target.classList.contains('row-placeholder')) return;
1933
+ var itemsWrapper = e.target.parentNode;
1934
+ if (itemsWrapper.classList.contains('row-obj')) {
1935
+ overObj = itemsWrapper;
1936
+ removePlaceholder();
1937
+ if (Number(overObj.dataset.id) === allRows().length - 1) {
1938
+ tbodyRef.current.insertBefore(placeholderGenerator(allRows().at(-2).clientHeight), overObj);
1939
+ } else {
1940
+ tbodyRef.current.insertBefore(placeholderGenerator(overObj.clientHeight), overObj);
1941
+ }
1942
+ }
1943
+ }, [sortData]);
1944
+ var handleDragStart = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (e) {
1945
+ draggedObj = e.currentTarget;
1946
+ e.dataTransfer.effectAllowed = 'move';
1947
+ e.dataTransfer.setData('text/html', draggedObj);
1948
+ draggedObj.classList.add('dragging');
1949
+ allRows().at(-1).style.setProperty('display', 'table-row', "important");
1950
+
1951
+ // callback
1952
+ var dragStart = function dragStart(callback) {
1953
+ callback.call(null, draggedObj, sortData, printData(sortData));
1954
+ };
1955
+ onDrag === null || onDrag === void 0 ? void 0 : onDrag(dragStart, null);
1956
+ }, [handledragOver]);
1957
+ var handleDragEnd = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (e) {
1958
+ draggedObj.style.display = 'table-row';
1959
+ removePlaceholder();
1960
+ draggedObj.classList.remove('dragging');
1961
+ allRows().at(-1).style.setProperty('display', 'none', "important");
1962
+ tbodyRef.current.classList.remove('drag-trigger-mousedown');
1963
+ if (overObj === null) return;
1964
+
1965
+ // update state
1966
+ var curData = [];
1967
+ curData = JSON.parse(JSON.stringify(sortData));
1968
+ var from = Number(draggedObj.dataset.id);
1969
+ var to = Number(overObj.dataset.id);
1970
+ if (from < to) to--;
1971
+
1972
+ //sort data
1973
+ var newData = [];
1974
+
1975
+ //console.log('--> data1:', curData);
1976
+
1977
+ curData.splice(to, 0, curData.splice(from, 1)[0]);
1978
+ for (var i = 0; i < curData.length; i++) {
1979
+ for (var j = 0; j < curData.length; j++) {
1980
+ if (curData[i] === curData[j]) {
1981
+ newData.push(curData[j]);
1982
+ }
1983
+ }
1984
+ }
1985
+
1986
+ //console.log("--> data2: ", newData);
1987
+ setSortData(newData);
1988
+
1989
+ // reset data-id in order to sort data
1990
+ newData.forEach(function (curId, order) {
1991
+ rootRef.current.querySelector('table').querySelector("tbody [data-key=\"row-".concat(curId, "\"]")).dataset.id = order;
1992
+ });
1993
+
1994
+ // sort elements
1995
+ var categoryItemsArray = allRows();
1996
+ var sorter = function sorter(a, b) {
1997
+ return a.dataset.id.localeCompare(b.dataset.id); // sorts based on alphabetical order
1998
+ };
1999
+
2000
+ var sorted = categoryItemsArray.sort(sorter);
2001
+ sorted.forEach(function (e) {
2002
+ return rootRef.current.querySelector('table').querySelector('tbody').appendChild(e);
2003
+ });
2004
+
2005
+ // callback
2006
+ var dragEnd = function dragEnd(callback) {
2007
+ callback.call(null, draggedObj, newData, printData(newData));
2008
+ };
2009
+ onDrag === null || onDrag === void 0 ? void 0 : onDrag(null, dragEnd);
2010
+ }, [sortData]);
2011
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
2012
+ // Update status of children components
2013
+ //--------------
2014
+ setMainUpdate(function (prevState) {
2015
+ return !prevState;
2016
+ });
2017
+
2018
+ // Initialize sort list data
2019
+ //--------------
2020
+ var listIndexes = allRows().map(function (node, i) {
2021
+ return i;
2022
+ });
2023
+ setSortData(listIndexes);
2024
+
2025
+ // Initialize checkboxes data
2026
+ //--------------
2027
+ initCheckboxesData();
2028
+
2029
+ // With scroll bars
2030
+ //--------------
2031
+ if (enhancedResponsiveWithScrollBar) {
2032
+ var _windowWidth = window.innerWidth;
2033
+ tableDataScrolledInit(_windowWidth);
2034
+ }
2035
+
2036
+ //drag & drop
2037
+ //--------------
2038
+ if (draggable) {
2039
+ insertAfter(lastRowGenerator(allRows().at(-1).clientHeight), allRows().at(-1));
2040
+ }
2041
+
2042
+ // Add function to the element that should be used as the scrollable area.
2043
+ //--------------
2044
+ window.removeEventListener('resize', windowResizeUpdate);
2045
+ window.addEventListener('resize', windowResizeUpdate);
2046
+
2047
+ // Remove the global list of events, especially as scroll and interval.
2048
+ //--------------
2049
+ return function () {
2050
+ window.removeEventListener('resize', windowResizeUpdate);
2051
+ };
2052
+ }, [data]);
2053
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2054
+ ref: rootRef,
2055
+ id: idRes,
2056
+ className: "table__wrapper ".concat(wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative", " ").concat(responsiveClasses, " ").concat(enhancedResponsiveClasses, " ").concat(checkableClasses, " ").concat(radioClasses, " ").concat(draggableClasses, " ").concat(sortableClasses)
2057
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("table", {
2058
+ className: "".concat(tableClassName || tableClassName === '' ? tableClassName : "table", " ").concat(tableClasses)
2059
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_TableHeaders, {
2060
+ data: _headers,
2061
+ useRadio: useRadio || false,
2062
+ headClassName: headClassName,
2063
+ checkboxNamePrefix: idRes,
2064
+ sortable: sortable,
2065
+ updateCheckedPrint: setCheckedPrint,
2066
+ getCheckedPrint: checkedPrint,
2067
+ updategetCheckedData: setCheckedData,
2068
+ getCheckedData: checkedData,
2069
+ updategetCheckedRootData: setCheckedRootData,
2070
+ getCheckedRootData: checkedRootData,
2071
+ onCheck: onCheck,
2072
+ evSort: handleSortList
2073
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_TableSummaries, {
2074
+ data: _summaries,
2075
+ footClassName: footClassName
2076
+ }), data.hasOwnProperty('fields') && colGroup ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_TableColgroup, {
2077
+ data: data.fields
2078
+ }) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tbody", {
2079
+ ref: tbodyRef,
2080
+ className: bodyClassName ? bodyClassName : '',
2081
+ onDragOver: handledragOver,
2082
+ onMouseLeave: handleTbodyLeave
2083
+ }, data.hasOwnProperty('fields') ? data.fields.map(function (item, i) {
2084
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_TableRow, {
2085
+ key: i + String(mainUpdate) // Trigger child component update when prop of parent changes
2086
+ ,
2087
+ index: i,
2088
+ rowKey: "row-".concat(i),
2089
+ headerLabel: _headers,
2090
+ data: item,
2091
+ checkboxNamePrefix: idRes,
2092
+ updateCheckedPrint: setCheckedPrint,
2093
+ getCheckedPrint: checkedPrint,
2094
+ updategetCheckedData: setCheckedData,
2095
+ getCheckedData: checkedData,
2096
+ updategetCheckedRootData: setCheckedRootData,
2097
+ getCheckedRootData: checkedRootData,
2098
+ onClick: onClick,
2099
+ onCheck: onCheck,
2100
+ draggable: draggable || false,
2101
+ useRadio: useRadio || false,
2102
+ evDragEnd: handleDragEnd,
2103
+ evDragStart: handleDragStart
2104
+ });
2105
+ }) : ""))));
2106
+ };
2107
+ /* harmony default export */ const src = (Table);
2108
+ })();
2109
+
2110
+ /******/ return __webpack_exports__;
2111
+ /******/ })()
2112
+ ;
2113
+ });