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.
- package/BackToTop/index.css +34 -0
- package/BackToTop/index.d.ts +11 -0
- package/BackToTop/index.js +458 -0
- package/CascadingSelect/index.css +159 -0
- package/CascadingSelect/index.d.ts +56 -0
- package/CascadingSelect/index.js +958 -0
- package/CascadingSelectE2E/index.css +159 -0
- package/CascadingSelectE2E/index.d.ts +60 -0
- package/CascadingSelectE2E/index.js +1126 -0
- package/Checkbox/index.d.ts +30 -0
- package/Checkbox/index.js +226 -0
- package/ColorPicker/index.css +38 -0
- package/ColorPicker/index.d.ts +27 -0
- package/ColorPicker/index.js +246 -0
- package/DigitalClock/index.d.ts +7 -0
- package/DigitalClock/index.js +208 -0
- package/DropdownMenu/index.css +127 -0
- package/DropdownMenu/index.d.ts +37 -0
- package/DropdownMenu/index.js +237 -0
- package/DynamicFields/index.d.ts +26 -0
- package/DynamicFields/index.js +412 -0
- package/File/index.d.ts +36 -0
- package/File/index.js +473 -0
- package/Input/index.d.ts +42 -0
- package/Input/index.js +286 -0
- package/LiveSearch/index.d.ts +37 -0
- package/LiveSearch/index.js +1195 -0
- package/ModalDialog/index.d.ts +60 -0
- package/ModalDialog/index.js +725 -0
- package/ModeSwitch/index.d.ts +17 -0
- package/ModeSwitch/index.js +202 -0
- package/MultiFuncSelect/index.css +178 -0
- package/MultiFuncSelect/index.d.ts +67 -0
- package/MultiFuncSelect/index.js +1826 -0
- package/MultilevelDropdownMenu/index.css +35 -0
- package/MultilevelDropdownMenu/index.d.ts +25 -0
- package/MultilevelDropdownMenu/index.js +464 -0
- package/Pagination/index.d.ts +49 -0
- package/Pagination/index.js +341 -0
- package/README.md +108 -0
- package/Radio/index.d.ts +31 -0
- package/Radio/index.js +246 -0
- package/RangeSlider/index.css +149 -0
- package/RangeSlider/index.d.ts +21 -0
- package/RangeSlider/index.js +730 -0
- package/ScrollReveal/index.css +23 -0
- package/ScrollReveal/index.d.ts +21 -0
- package/ScrollReveal/index.js +216 -0
- package/Scrollbar/index.css +168 -0
- package/Scrollbar/index.d.ts +15 -0
- package/Scrollbar/index.js +605 -0
- package/SearchBar/index.d.ts +32 -0
- package/SearchBar/index.js +246 -0
- package/Select/index.d.ts +34 -0
- package/Select/index.js +331 -0
- package/ShowMoreLess/index.css +23 -0
- package/ShowMoreLess/index.d.ts +30 -0
- package/ShowMoreLess/index.js +202 -0
- package/Switch/index.d.ts +29 -0
- package/Switch/index.js +211 -0
- package/Table/index.css +533 -0
- package/Table/index.d.ts +25 -0
- package/Table/index.js +2113 -0
- package/Tabs/index.d.ts +3 -0
- package/Tabs/index.js +323 -0
- package/TagInput/index.css +90 -0
- package/TagInput/index.d.ts +28 -0
- package/TagInput/index.js +370 -0
- package/Textarea/index.d.ts +30 -0
- package/Textarea/index.js +242 -0
- package/Toast/index.css +95 -0
- package/Toast/index.d.ts +35 -0
- package/Toast/index.js +340 -0
- package/Tooltip/index.css +240 -0
- package/Tooltip/index.d.ts +19 -0
- package/Tooltip/index.js +200 -0
- package/Tree/index.css +225 -0
- package/Tree/index.d.ts +37 -0
- package/Tree/index.js +1406 -0
- package/all.d.ts +33 -0
- package/all.js +35 -0
- package/lib/cjs/BackToTop/index.d.ts +11 -0
- package/lib/cjs/BackToTop/index.js +458 -0
- package/lib/cjs/CascadingSelect/index.d.ts +56 -0
- package/lib/cjs/CascadingSelect/index.js +958 -0
- package/lib/cjs/CascadingSelectE2E/index.d.ts +60 -0
- package/lib/cjs/CascadingSelectE2E/index.js +1126 -0
- package/lib/cjs/Checkbox/index.d.ts +30 -0
- package/lib/cjs/Checkbox/index.js +226 -0
- package/lib/cjs/ColorPicker/index.d.ts +27 -0
- package/lib/cjs/ColorPicker/index.js +246 -0
- package/lib/cjs/DigitalClock/index.d.ts +7 -0
- package/lib/cjs/DigitalClock/index.js +208 -0
- package/lib/cjs/DropdownMenu/index.d.ts +37 -0
- package/lib/cjs/DropdownMenu/index.js +237 -0
- package/lib/cjs/DynamicFields/index.d.ts +26 -0
- package/lib/cjs/DynamicFields/index.js +412 -0
- package/lib/cjs/File/index.d.ts +36 -0
- package/lib/cjs/File/index.js +473 -0
- package/lib/cjs/Input/index.d.ts +42 -0
- package/lib/cjs/Input/index.js +286 -0
- package/lib/cjs/LiveSearch/index.d.ts +37 -0
- package/lib/cjs/LiveSearch/index.js +1195 -0
- package/lib/cjs/ModalDialog/index.d.ts +60 -0
- package/lib/cjs/ModalDialog/index.js +725 -0
- package/lib/cjs/ModeSwitch/index.d.ts +17 -0
- package/lib/cjs/ModeSwitch/index.js +202 -0
- package/lib/cjs/MultiFuncSelect/index.d.ts +67 -0
- package/lib/cjs/MultiFuncSelect/index.js +1826 -0
- package/lib/cjs/MultilevelDropdownMenu/index.d.ts +25 -0
- package/lib/cjs/MultilevelDropdownMenu/index.js +464 -0
- package/lib/cjs/Pagination/index.d.ts +49 -0
- package/lib/cjs/Pagination/index.js +341 -0
- package/lib/cjs/Radio/index.d.ts +31 -0
- package/lib/cjs/Radio/index.js +246 -0
- package/lib/cjs/RangeSlider/index.d.ts +21 -0
- package/lib/cjs/RangeSlider/index.js +730 -0
- package/lib/cjs/ScrollReveal/index.d.ts +21 -0
- package/lib/cjs/ScrollReveal/index.js +216 -0
- package/lib/cjs/Scrollbar/index.d.ts +15 -0
- package/lib/cjs/Scrollbar/index.js +605 -0
- package/lib/cjs/SearchBar/index.d.ts +32 -0
- package/lib/cjs/SearchBar/index.js +246 -0
- package/lib/cjs/Select/index.d.ts +34 -0
- package/lib/cjs/Select/index.js +331 -0
- package/lib/cjs/ShowMoreLess/index.d.ts +30 -0
- package/lib/cjs/ShowMoreLess/index.js +202 -0
- package/lib/cjs/Switch/index.d.ts +29 -0
- package/lib/cjs/Switch/index.js +211 -0
- package/lib/cjs/Table/index.d.ts +25 -0
- package/lib/cjs/Table/index.js +2113 -0
- package/lib/cjs/Tabs/index.d.ts +3 -0
- package/lib/cjs/Tabs/index.js +323 -0
- package/lib/cjs/TagInput/index.d.ts +28 -0
- package/lib/cjs/TagInput/index.js +370 -0
- package/lib/cjs/Textarea/index.d.ts +30 -0
- package/lib/cjs/Textarea/index.js +242 -0
- package/lib/cjs/Toast/index.d.ts +35 -0
- package/lib/cjs/Toast/index.js +340 -0
- package/lib/cjs/Tooltip/index.d.ts +19 -0
- package/lib/cjs/Tooltip/index.js +200 -0
- package/lib/cjs/Tree/index.d.ts +37 -0
- package/lib/cjs/Tree/index.js +1406 -0
- package/lib/cjs/index.d.ts +33 -0
- package/lib/cjs/index.js +35 -0
- package/lib/css/BackToTop/index.css +34 -0
- package/lib/css/CascadingSelect/index.css +159 -0
- package/lib/css/CascadingSelectE2E/index.css +159 -0
- package/lib/css/ColorPicker/index.css +38 -0
- package/lib/css/DropdownMenu/index.css +127 -0
- package/lib/css/MultiFuncSelect/index.css +178 -0
- package/lib/css/MultilevelDropdownMenu/index.css +35 -0
- package/lib/css/RangeSlider/index.css +149 -0
- package/lib/css/ScrollReveal/index.css +23 -0
- package/lib/css/Scrollbar/index.css +168 -0
- package/lib/css/ShowMoreLess/index.css +23 -0
- package/lib/css/Table/index.css +533 -0
- package/lib/css/TagInput/index.css +90 -0
- package/lib/css/Toast/index.css +95 -0
- package/lib/css/Tooltip/index.css +240 -0
- package/lib/css/Tree/index.css +225 -0
- package/lib/esm/BackToTop/index.scss +47 -0
- package/lib/esm/BackToTop/index.tsx +182 -0
- package/lib/esm/BackToTop/utils/easing.js +200 -0
- package/lib/esm/BackToTop/utils/performance.js +52 -0
- package/lib/esm/CascadingSelect/Group.tsx +39 -0
- package/lib/esm/CascadingSelect/index.scss +214 -0
- package/lib/esm/CascadingSelect/index.tsx +922 -0
- package/lib/esm/CascadingSelect/utils/performance.js +52 -0
- package/lib/esm/CascadingSelectE2E/Group.tsx +39 -0
- package/lib/esm/CascadingSelectE2E/index.scss +214 -0
- package/lib/esm/CascadingSelectE2E/index.tsx +1091 -0
- package/lib/esm/CascadingSelectE2E/utils/performance.js +52 -0
- package/lib/esm/Checkbox/index.tsx +160 -0
- package/lib/esm/ColorPicker/index.scss +48 -0
- package/lib/esm/ColorPicker/index.tsx +187 -0
- package/lib/esm/DigitalClock/index.tsx +72 -0
- package/lib/esm/DigitalClock/utils/useInterval.js +43 -0
- package/lib/esm/DropdownMenu/Option.tsx +27 -0
- package/lib/esm/DropdownMenu/index.scss +180 -0
- package/lib/esm/DropdownMenu/index.tsx +148 -0
- package/lib/esm/DynamicFields/index.tsx +386 -0
- package/lib/esm/File/index.tsx +302 -0
- package/lib/esm/Input/index.tsx +233 -0
- package/lib/esm/LiveSearch/index.tsx +582 -0
- package/lib/esm/LiveSearch/utils/performance.js +52 -0
- package/lib/esm/LiveSearch/utils/useThrottle.js +36 -0
- package/lib/esm/ModalDialog/index.tsx +479 -0
- package/lib/esm/ModalDialog/plugins/BSL/bodyScrollLock.es6.js +262 -0
- package/lib/esm/ModalDialog/plugins/BSL/index.ts +2 -0
- package/lib/esm/ModeSwitch/index.tsx +82 -0
- package/lib/esm/MultiFuncSelect/index.scss +269 -0
- package/lib/esm/MultiFuncSelect/index.tsx +1597 -0
- package/lib/esm/MultiFuncSelect/utils/performance.js +52 -0
- package/lib/esm/MultiFuncSelect/utils/tree.js +103 -0
- package/lib/esm/MultiFuncSelect/utils/useThrottle.js +36 -0
- package/lib/esm/MultilevelDropdownMenu/MenuList.tsx +230 -0
- package/lib/esm/MultilevelDropdownMenu/index.scss +75 -0
- package/lib/esm/MultilevelDropdownMenu/index.tsx +71 -0
- package/lib/esm/MultilevelDropdownMenu/utils/dom.js +81 -0
- package/lib/esm/Pagination/index.tsx +230 -0
- package/lib/esm/Pagination/pagination-navigators.tsx +60 -0
- package/lib/esm/Radio/index.tsx +201 -0
- package/lib/esm/RangeSlider/index.scss +184 -0
- package/lib/esm/RangeSlider/index.tsx +223 -0
- package/lib/esm/ScrollReveal/index.scss +27 -0
- package/lib/esm/ScrollReveal/index.tsx +146 -0
- package/lib/esm/Scrollbar/index.scss +217 -0
- package/lib/esm/Scrollbar/index.tsx +497 -0
- package/lib/esm/Scrollbar/utils/performance.js +52 -0
- package/lib/esm/SearchBar/index.tsx +181 -0
- package/lib/esm/Select/index.tsx +276 -0
- package/lib/esm/ShowMoreLess/index.scss +27 -0
- package/lib/esm/ShowMoreLess/index.tsx +144 -0
- package/lib/esm/Switch/index.tsx +143 -0
- package/lib/esm/Table/TableColgroup.tsx +29 -0
- package/lib/esm/Table/TableField.tsx +40 -0
- package/lib/esm/Table/TableFieldRow.tsx +212 -0
- package/lib/esm/Table/TableHeaders.tsx +146 -0
- package/lib/esm/Table/TableRow.tsx +127 -0
- package/lib/esm/Table/TableSummaries.tsx +36 -0
- package/lib/esm/Table/index.scss +364 -0
- package/lib/esm/Table/index.tsx +576 -0
- package/lib/esm/Table/table-utils.ts +65 -0
- package/lib/esm/Table/utils/dom.js +81 -0
- package/lib/esm/Table/utils/performance.js +52 -0
- package/lib/esm/Tabs/TabList.tsx +42 -0
- package/lib/esm/Tabs/TabPanel.tsx +34 -0
- package/lib/esm/Tabs/Tabs.tsx +232 -0
- package/lib/esm/Tabs/index.tsx +3 -0
- package/lib/esm/TagInput/index.scss +125 -0
- package/lib/esm/TagInput/index.tsx +314 -0
- package/lib/esm/Textarea/index.tsx +178 -0
- package/lib/esm/Toast/Item.tsx +75 -0
- package/lib/esm/Toast/index.scss +120 -0
- package/lib/esm/Toast/index.tsx +249 -0
- package/lib/esm/Tooltip/index.scss +327 -0
- package/lib/esm/Tooltip/index.tsx +142 -0
- package/lib/esm/Tree/TreeList.tsx +503 -0
- package/lib/esm/Tree/index.scss +375 -0
- package/lib/esm/Tree/index.tsx +301 -0
- package/lib/esm/Tree/init-height.tsx +27 -0
- package/lib/esm/Tree/utils/convert-tree.js +29 -0
- package/lib/esm/Tree/utils/dom.js +81 -0
- package/lib/esm/index.js +31 -0
- package/package.json +40 -0
|
@@ -0,0 +1,473 @@
|
|
|
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
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ 787:
|
|
16
|
+
/***/ ((module) => {
|
|
17
|
+
|
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
19
|
+
|
|
20
|
+
/***/ })
|
|
21
|
+
|
|
22
|
+
/******/ });
|
|
23
|
+
/************************************************************************/
|
|
24
|
+
/******/ // The module cache
|
|
25
|
+
/******/ var __webpack_module_cache__ = {};
|
|
26
|
+
/******/
|
|
27
|
+
/******/ // The require function
|
|
28
|
+
/******/ function __webpack_require__(moduleId) {
|
|
29
|
+
/******/ // Check if module is in cache
|
|
30
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
31
|
+
/******/ if (cachedModule !== undefined) {
|
|
32
|
+
/******/ return cachedModule.exports;
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ // Create a new module (and put it into the cache)
|
|
35
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
36
|
+
/******/ // no module.id needed
|
|
37
|
+
/******/ // no module.loaded needed
|
|
38
|
+
/******/ exports: {}
|
|
39
|
+
/******/ };
|
|
40
|
+
/******/
|
|
41
|
+
/******/ // Execute the module function
|
|
42
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // Return the exports of the module
|
|
45
|
+
/******/ return module.exports;
|
|
46
|
+
/******/ }
|
|
47
|
+
/******/
|
|
48
|
+
/************************************************************************/
|
|
49
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
50
|
+
/******/ (() => {
|
|
51
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
52
|
+
/******/ __webpack_require__.n = (module) => {
|
|
53
|
+
/******/ var getter = module && module.__esModule ?
|
|
54
|
+
/******/ () => (module['default']) :
|
|
55
|
+
/******/ () => (module);
|
|
56
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
57
|
+
/******/ return getter;
|
|
58
|
+
/******/ };
|
|
59
|
+
/******/ })();
|
|
60
|
+
/******/
|
|
61
|
+
/******/ /* webpack/runtime/define property getters */
|
|
62
|
+
/******/ (() => {
|
|
63
|
+
/******/ // define getter functions for harmony exports
|
|
64
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
65
|
+
/******/ for(var key in definition) {
|
|
66
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
67
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
68
|
+
/******/ }
|
|
69
|
+
/******/ }
|
|
70
|
+
/******/ };
|
|
71
|
+
/******/ })();
|
|
72
|
+
/******/
|
|
73
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
74
|
+
/******/ (() => {
|
|
75
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
76
|
+
/******/ })();
|
|
77
|
+
/******/
|
|
78
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
79
|
+
/******/ (() => {
|
|
80
|
+
/******/ // define __esModule on exports
|
|
81
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
82
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
83
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
84
|
+
/******/ }
|
|
85
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
86
|
+
/******/ };
|
|
87
|
+
/******/ })();
|
|
88
|
+
/******/
|
|
89
|
+
/************************************************************************/
|
|
90
|
+
var __webpack_exports__ = {};
|
|
91
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
92
|
+
(() => {
|
|
93
|
+
__webpack_require__.r(__webpack_exports__);
|
|
94
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
95
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
96
|
+
/* harmony export */ });
|
|
97
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
|
|
98
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
99
|
+
var _excluded = ["wrapperClassName", "controlClassName", "labelClassName", "labelHoverClassName", "fetchUrl", "fetchMethod", "multiple", "submitLabel", "submitClassName", "disabled", "required", "value", "label", "name", "id", "data", "tabIndex", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "onChange", "onComplete", "onProgress"];
|
|
100
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
101
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
102
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
103
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
104
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
105
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
106
|
+
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."); }
|
|
107
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
108
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
109
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
110
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
111
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e2) { function e(_x6) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e3) { function e(_x7) { return _e3.apply(this, arguments); } e.toString = function () { return _e3.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
112
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
113
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
114
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
115
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
116
|
+
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."); }
|
|
117
|
+
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); }
|
|
118
|
+
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; }
|
|
119
|
+
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; } }
|
|
120
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
121
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
122
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
123
|
+
|
|
124
|
+
var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, _ref3) {
|
|
125
|
+
var wrapperClassName = props.wrapperClassName,
|
|
126
|
+
controlClassName = props.controlClassName,
|
|
127
|
+
labelClassName = props.labelClassName,
|
|
128
|
+
labelHoverClassName = props.labelHoverClassName,
|
|
129
|
+
fetchUrl = props.fetchUrl,
|
|
130
|
+
fetchMethod = props.fetchMethod,
|
|
131
|
+
multiple = props.multiple,
|
|
132
|
+
submitLabel = props.submitLabel,
|
|
133
|
+
submitClassName = props.submitClassName,
|
|
134
|
+
disabled = props.disabled,
|
|
135
|
+
required = props.required,
|
|
136
|
+
value = props.value,
|
|
137
|
+
label = props.label,
|
|
138
|
+
name = props.name,
|
|
139
|
+
id = props.id,
|
|
140
|
+
data = props.data,
|
|
141
|
+
tabIndex = props.tabIndex,
|
|
142
|
+
fetchFuncAsync = props.fetchFuncAsync,
|
|
143
|
+
fetchFuncMethod = props.fetchFuncMethod,
|
|
144
|
+
fetchFuncMethodParams = props.fetchFuncMethodParams,
|
|
145
|
+
onChange = props.onChange,
|
|
146
|
+
onComplete = props.onComplete,
|
|
147
|
+
onProgress = props.onProgress,
|
|
148
|
+
attributes = _objectWithoutProperties(props, _excluded);
|
|
149
|
+
var uniqueID = (0,react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
150
|
+
var idRes = id || uniqueID;
|
|
151
|
+
var rootRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
152
|
+
var fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
153
|
+
var labelRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
154
|
+
var submitRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
155
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
156
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
157
|
+
forceUpdate = _useState2[0],
|
|
158
|
+
setForceUpdate = _useState2[1];
|
|
159
|
+
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
|
160
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
161
|
+
defaultValue = _useState4[0],
|
|
162
|
+
setDefaultValue = _useState4[1];
|
|
163
|
+
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
|
164
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
165
|
+
incomingData = _useState6[0],
|
|
166
|
+
setIncomingData = _useState6[1];
|
|
167
|
+
function handleFileInput(event) {
|
|
168
|
+
if (fileInputRef.current.nextSibling.contains(document.activeElement)) {
|
|
169
|
+
// Bind space to trigger clicking of the button when focused
|
|
170
|
+
if (event.keyCode === 32) {
|
|
171
|
+
fileInputRef.current.click();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function fetchData(_x2, _x3) {
|
|
176
|
+
return _fetchData.apply(this, arguments);
|
|
177
|
+
}
|
|
178
|
+
function _fetchData() {
|
|
179
|
+
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params, data) {
|
|
180
|
+
var response;
|
|
181
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
182
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
if (!(_typeof(fetchFuncAsync) === 'object')) {
|
|
185
|
+
_context3.next = 7;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
_context3.next = 3;
|
|
189
|
+
return fetchFuncAsync["".concat(fetchFuncMethod)].apply(fetchFuncAsync, _toConsumableArray(params.split(',')).concat([data]));
|
|
190
|
+
case 3:
|
|
191
|
+
response = _context3.sent;
|
|
192
|
+
return _context3.abrupt("return", response.data);
|
|
193
|
+
case 7:
|
|
194
|
+
return _context3.abrupt("return", null);
|
|
195
|
+
case 8:
|
|
196
|
+
case "end":
|
|
197
|
+
return _context3.stop();
|
|
198
|
+
}
|
|
199
|
+
}, _callee3);
|
|
200
|
+
}));
|
|
201
|
+
return _fetchData.apply(this, arguments);
|
|
202
|
+
}
|
|
203
|
+
function fetchDataDefault(_x4) {
|
|
204
|
+
return _fetchDataDefault.apply(this, arguments);
|
|
205
|
+
}
|
|
206
|
+
function _fetchDataDefault() {
|
|
207
|
+
_fetchDataDefault = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(url) {
|
|
208
|
+
var data,
|
|
209
|
+
methord,
|
|
210
|
+
res,
|
|
211
|
+
_len,
|
|
212
|
+
rest,
|
|
213
|
+
_key,
|
|
214
|
+
response,
|
|
215
|
+
_args4 = arguments;
|
|
216
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
217
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
218
|
+
case 0:
|
|
219
|
+
data = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
220
|
+
methord = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : 'GET';
|
|
221
|
+
res = {};
|
|
222
|
+
if (!(typeof window === 'undefined')) {
|
|
223
|
+
_context4.next = 5;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
return _context4.abrupt("return", res);
|
|
227
|
+
case 5:
|
|
228
|
+
_context4.prev = 5;
|
|
229
|
+
for (_len = _args4.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
230
|
+
rest[_key - 3] = _args4[_key];
|
|
231
|
+
}
|
|
232
|
+
_context4.next = 9;
|
|
233
|
+
return fetch(url, _objectSpread({
|
|
234
|
+
method: methord,
|
|
235
|
+
body: data
|
|
236
|
+
}, rest));
|
|
237
|
+
case 9:
|
|
238
|
+
response = _context4.sent;
|
|
239
|
+
_context4.next = 12;
|
|
240
|
+
return response.json();
|
|
241
|
+
case 12:
|
|
242
|
+
res = _context4.sent;
|
|
243
|
+
_context4.next = 18;
|
|
244
|
+
break;
|
|
245
|
+
case 15:
|
|
246
|
+
_context4.prev = 15;
|
|
247
|
+
_context4.t0 = _context4["catch"](5);
|
|
248
|
+
res = {
|
|
249
|
+
'error': _context4.t0
|
|
250
|
+
};
|
|
251
|
+
case 18:
|
|
252
|
+
return _context4.abrupt("return", res);
|
|
253
|
+
case 19:
|
|
254
|
+
case "end":
|
|
255
|
+
return _context4.stop();
|
|
256
|
+
}
|
|
257
|
+
}, _callee4, null, [[5, 15]]);
|
|
258
|
+
}));
|
|
259
|
+
return _fetchDataDefault.apply(this, arguments);
|
|
260
|
+
}
|
|
261
|
+
function handleLabelEnter(event) {
|
|
262
|
+
event.currentTarget.getElementsByTagName('button')[0].className = labelHoverClassName ? labelHoverClassName : 'btn btn-primary';
|
|
263
|
+
}
|
|
264
|
+
function handleLabelLeave(event) {
|
|
265
|
+
event.currentTarget.getElementsByTagName('button')[0].className = labelClassName ? labelClassName : 'btn btn-outline-secondary';
|
|
266
|
+
}
|
|
267
|
+
function handleSubmit(event) {
|
|
268
|
+
event.preventDefault();
|
|
269
|
+
var curFiles = fileInputRef.current.files;
|
|
270
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress(curFiles, submitRef.current);
|
|
271
|
+
if (fetchUrl) {
|
|
272
|
+
var formData = new FormData();
|
|
273
|
+
formData.append('action', 'upload_plug_action');
|
|
274
|
+
for (var i = 0; i < curFiles.length; i++) {
|
|
275
|
+
formData.append("clientFiles", curFiles[i]);
|
|
276
|
+
}
|
|
277
|
+
fetchDataDefault(fetchUrl, formData, fetchMethod ? fetchMethod : 'POST', {
|
|
278
|
+
headers: {
|
|
279
|
+
'Content-Type': 'multipart/form-data'
|
|
280
|
+
}
|
|
281
|
+
}).then(function (response) {
|
|
282
|
+
var jsonData = response.data;
|
|
283
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete(event, submitRef.current, jsonData, incomingData);
|
|
284
|
+
|
|
285
|
+
// update default value
|
|
286
|
+
setDefaultValue(undefined);
|
|
287
|
+
fileInputRef.current.value = '';
|
|
288
|
+
});
|
|
289
|
+
} else {
|
|
290
|
+
var streamToText = /*#__PURE__*/function () {
|
|
291
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(blob) {
|
|
292
|
+
var readableStream, chunk;
|
|
293
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
294
|
+
while (1) switch (_context.prev = _context.next) {
|
|
295
|
+
case 0:
|
|
296
|
+
_context.next = 2;
|
|
297
|
+
return blob.getReader();
|
|
298
|
+
case 2:
|
|
299
|
+
readableStream = _context.sent;
|
|
300
|
+
_context.next = 5;
|
|
301
|
+
return readableStream.read();
|
|
302
|
+
case 5:
|
|
303
|
+
chunk = _context.sent;
|
|
304
|
+
return _context.abrupt("return", new TextDecoder('utf-8').decode(chunk.value));
|
|
305
|
+
case 7:
|
|
306
|
+
case "end":
|
|
307
|
+
return _context.stop();
|
|
308
|
+
}
|
|
309
|
+
}, _callee);
|
|
310
|
+
}));
|
|
311
|
+
return function streamToText(_x5) {
|
|
312
|
+
return _ref.apply(this, arguments);
|
|
313
|
+
};
|
|
314
|
+
}();
|
|
315
|
+
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
316
|
+
var allFiles, _i2, file, fileSliceBlob, fileSliceBlobStream;
|
|
317
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
318
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
319
|
+
case 0:
|
|
320
|
+
allFiles = [];
|
|
321
|
+
_i2 = 0;
|
|
322
|
+
case 2:
|
|
323
|
+
if (!(_i2 < curFiles.length)) {
|
|
324
|
+
_context2.next = 16;
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
file = curFiles[_i2];
|
|
328
|
+
fileSliceBlob = file.slice(0, file.length);
|
|
329
|
+
_context2.next = 7;
|
|
330
|
+
return fileSliceBlob.stream();
|
|
331
|
+
case 7:
|
|
332
|
+
fileSliceBlobStream = _context2.sent;
|
|
333
|
+
_context2.t0 = allFiles;
|
|
334
|
+
_context2.next = 11;
|
|
335
|
+
return streamToText(fileSliceBlobStream);
|
|
336
|
+
case 11:
|
|
337
|
+
_context2.t1 = _context2.sent;
|
|
338
|
+
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
339
|
+
case 13:
|
|
340
|
+
_i2++;
|
|
341
|
+
_context2.next = 2;
|
|
342
|
+
break;
|
|
343
|
+
case 16:
|
|
344
|
+
//send
|
|
345
|
+
Promise.all(allFiles).then(function (values) {
|
|
346
|
+
var _params = fetchFuncMethodParams || [];
|
|
347
|
+
fetchData(_params.join(','), values);
|
|
348
|
+
});
|
|
349
|
+
case 17:
|
|
350
|
+
case "end":
|
|
351
|
+
return _context2.stop();
|
|
352
|
+
}
|
|
353
|
+
}, _callee2);
|
|
354
|
+
}))();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function handleChange(event) {
|
|
358
|
+
var val = event.target.value;
|
|
359
|
+
setForceUpdate(!forceUpdate);
|
|
360
|
+
|
|
361
|
+
// update default value
|
|
362
|
+
setDefaultValue(null);
|
|
363
|
+
|
|
364
|
+
//----
|
|
365
|
+
//remove focus style
|
|
366
|
+
if (val === '') {
|
|
367
|
+
rootRef.current.classList.remove('focus');
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
//
|
|
371
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event, submitRef.current, fileInputRef.current.files);
|
|
372
|
+
}
|
|
373
|
+
function fileNames() {
|
|
374
|
+
var current = fileInputRef.current;
|
|
375
|
+
if (current && current.files.length > 0) {
|
|
376
|
+
var messages = [];
|
|
377
|
+
var _iterator = _createForOfIteratorHelper(current.files),
|
|
378
|
+
_step;
|
|
379
|
+
try {
|
|
380
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
381
|
+
var file = _step.value;
|
|
382
|
+
messages = messages.concat(file.name);
|
|
383
|
+
}
|
|
384
|
+
} catch (err) {
|
|
385
|
+
_iterator.e(err);
|
|
386
|
+
} finally {
|
|
387
|
+
_iterator.f();
|
|
388
|
+
}
|
|
389
|
+
return messages.join(',');
|
|
390
|
+
}
|
|
391
|
+
return null;
|
|
392
|
+
}
|
|
393
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
394
|
+
// update incoming data
|
|
395
|
+
//------------------------------------------
|
|
396
|
+
setIncomingData(data);
|
|
397
|
+
|
|
398
|
+
// update default value
|
|
399
|
+
//--------------
|
|
400
|
+
setDefaultValue(value);
|
|
401
|
+
}, [data]);
|
|
402
|
+
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", {
|
|
403
|
+
className: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative upload-control",
|
|
404
|
+
ref: rootRef
|
|
405
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
|
406
|
+
ref: labelRef,
|
|
407
|
+
onMouseEnter: handleLabelEnter,
|
|
408
|
+
onMouseLeave: handleLabelLeave,
|
|
409
|
+
style: {
|
|
410
|
+
cursor: 'pointer',
|
|
411
|
+
pointerEvents: disabled ? 'none' : 'auto',
|
|
412
|
+
opacity: disabled ? 0.5 : 1
|
|
413
|
+
},
|
|
414
|
+
htmlFor: idRes,
|
|
415
|
+
className: "form-label d-inline"
|
|
416
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
|
417
|
+
className: labelClassName ? labelClassName : 'btn btn-outline-secondary',
|
|
418
|
+
type: "button",
|
|
419
|
+
style: {
|
|
420
|
+
pointerEvents: 'none'
|
|
421
|
+
}
|
|
422
|
+
}, label ? label : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
|
|
423
|
+
width: "25px",
|
|
424
|
+
height: "25px",
|
|
425
|
+
viewBox: "0 0 1024 1024"
|
|
426
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
|
|
427
|
+
d: "M512 256l144.8 144.8-36.2 36.2-83-83v311.6h-51.2V354l-83 83-36.2-36.2L512 256zM307.2 716.8V768h409.6v-51.2H307.2z",
|
|
428
|
+
fill: "#000000",
|
|
429
|
+
fillRule: "evenodd"
|
|
430
|
+
})), " ", required ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
431
|
+
className: "text-danger"
|
|
432
|
+
}, "*")) : '')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
433
|
+
className: "input-group"
|
|
434
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
|
|
435
|
+
ref: function ref(node) {
|
|
436
|
+
fileInputRef.current = node;
|
|
437
|
+
if (typeof _ref3 === 'function') {
|
|
438
|
+
_ref3(node);
|
|
439
|
+
} else if (_ref3) {
|
|
440
|
+
_ref3.current = node;
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
tabIndex: tabIndex || 0,
|
|
444
|
+
className: controlClassName || controlClassName === '' ? controlClassName : "form-control",
|
|
445
|
+
id: idRes,
|
|
446
|
+
type: "file"
|
|
447
|
+
// The onChange should trigger updates whenever
|
|
448
|
+
// the value changes?
|
|
449
|
+
// Try to select a file, then try selecting another one.
|
|
450
|
+
,
|
|
451
|
+
multiple: multiple || false,
|
|
452
|
+
name: name,
|
|
453
|
+
onKeyUp: handleFileInput,
|
|
454
|
+
onChange: handleChange,
|
|
455
|
+
disabled: disabled || null,
|
|
456
|
+
required: required || null,
|
|
457
|
+
style: {
|
|
458
|
+
display: 'none'
|
|
459
|
+
}
|
|
460
|
+
}, attributes)), typeof defaultValue !== 'undefined' ? fileNames() : null, defaultValue), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
|
461
|
+
ref: submitRef,
|
|
462
|
+
className: submitClassName ? submitClassName + " ".concat(disabled ? 'disabled' : '') : 'btn btn-primary mt-2' + " ".concat(disabled ? 'disabled' : ''),
|
|
463
|
+
type: "button",
|
|
464
|
+
onClick: handleSubmit
|
|
465
|
+
}, submitLabel ? submitLabel : null)));
|
|
466
|
+
});
|
|
467
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (File);
|
|
468
|
+
})();
|
|
469
|
+
|
|
470
|
+
/******/ return __webpack_exports__;
|
|
471
|
+
/******/ })()
|
|
472
|
+
;
|
|
473
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare module 'react' {
|
|
3
|
+
interface ReactI18NextChildren<T> {
|
|
4
|
+
children?: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
declare type InputProps = {
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
controlClassName?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
label?: React.ReactNode | string;
|
|
13
|
+
units?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
step?: any;
|
|
16
|
+
min?: any;
|
|
17
|
+
max?: any;
|
|
18
|
+
src?: any;
|
|
19
|
+
size?: any;
|
|
20
|
+
minLength?: any;
|
|
21
|
+
maxLength?: any;
|
|
22
|
+
alt?: any;
|
|
23
|
+
disabled?: any;
|
|
24
|
+
required?: any;
|
|
25
|
+
readOnly?: any;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
pattern?: any;
|
|
28
|
+
iconLeft?: React.ReactNode | string;
|
|
29
|
+
iconRight?: React.ReactNode | string;
|
|
30
|
+
/** -- */
|
|
31
|
+
id?: string;
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
autoComplete?: string;
|
|
34
|
+
tabIndex?: number;
|
|
35
|
+
[key: `data-${string}`]: string | undefined;
|
|
36
|
+
onChangeCallback?: (e: any) => void;
|
|
37
|
+
onChange?: (e: any, param: any) => void;
|
|
38
|
+
onBlur?: (e: any, param: any) => void;
|
|
39
|
+
onFocus?: (e: any, param: any) => void;
|
|
40
|
+
};
|
|
41
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<unknown>>;
|
|
42
|
+
export default Input;
|