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,730 @@
|
|
|
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
|
+
/***/ 390:
|
|
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 _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); }
|
|
19
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
20
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(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_1465__(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_1465__);
|
|
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_1465__.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_1465__.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_1465__.d = function (exports, definition) {
|
|
101
|
+
/******/for (var key in definition) {
|
|
102
|
+
/******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.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_1465__.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_1465__.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_1465__.r(__webpack_exports__);
|
|
150
|
+
/* harmony export */
|
|
151
|
+
__nested_webpack_require_1465__.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_1465__(787);
|
|
159
|
+
/* harmony import */
|
|
160
|
+
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
161
|
+
var _excluded = ["wrapperClassName", "controlClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "value", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onChangeCallback", "onChange", "onBlur", "onFocus"];
|
|
162
|
+
function _extends() {
|
|
163
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
164
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
165
|
+
var source = arguments[i];
|
|
166
|
+
for (var key in source) {
|
|
167
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
168
|
+
target[key] = source[key];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return target;
|
|
173
|
+
};
|
|
174
|
+
return _extends.apply(this, arguments);
|
|
175
|
+
}
|
|
176
|
+
function _slicedToArray(arr, i) {
|
|
177
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
178
|
+
}
|
|
179
|
+
function _nonIterableRest() {
|
|
180
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
181
|
+
}
|
|
182
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
183
|
+
if (!o) return;
|
|
184
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
185
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
186
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
187
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
188
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
189
|
+
}
|
|
190
|
+
function _arrayLikeToArray(arr, len) {
|
|
191
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
192
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
193
|
+
return arr2;
|
|
194
|
+
}
|
|
195
|
+
function _iterableToArrayLimit(arr, i) {
|
|
196
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
197
|
+
if (null != _i) {
|
|
198
|
+
var _s,
|
|
199
|
+
_e,
|
|
200
|
+
_x,
|
|
201
|
+
_r,
|
|
202
|
+
_arr = [],
|
|
203
|
+
_n = !0,
|
|
204
|
+
_d = !1;
|
|
205
|
+
try {
|
|
206
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
207
|
+
if (Object(_i) !== _i) return;
|
|
208
|
+
_n = !1;
|
|
209
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
210
|
+
} catch (err) {
|
|
211
|
+
_d = !0, _e = err;
|
|
212
|
+
} finally {
|
|
213
|
+
try {
|
|
214
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
215
|
+
} finally {
|
|
216
|
+
if (_d) throw _e;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return _arr;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function _arrayWithHoles(arr) {
|
|
223
|
+
if (Array.isArray(arr)) return arr;
|
|
224
|
+
}
|
|
225
|
+
function _objectWithoutProperties(source, excluded) {
|
|
226
|
+
if (source == null) return {};
|
|
227
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
228
|
+
var key, i;
|
|
229
|
+
if (Object.getOwnPropertySymbols) {
|
|
230
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
231
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
232
|
+
key = sourceSymbolKeys[i];
|
|
233
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
234
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
235
|
+
target[key] = source[key];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return target;
|
|
239
|
+
}
|
|
240
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
241
|
+
if (source == null) return {};
|
|
242
|
+
var target = {};
|
|
243
|
+
var sourceKeys = Object.keys(source);
|
|
244
|
+
var key, i;
|
|
245
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
246
|
+
key = sourceKeys[i];
|
|
247
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
248
|
+
target[key] = source[key];
|
|
249
|
+
}
|
|
250
|
+
return target;
|
|
251
|
+
}
|
|
252
|
+
var Input = /*#__PURE__*/(0, react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, _ref) {
|
|
253
|
+
var wrapperClassName = props.wrapperClassName,
|
|
254
|
+
controlClassName = props.controlClassName,
|
|
255
|
+
type = props.type,
|
|
256
|
+
disabled = props.disabled,
|
|
257
|
+
required = props.required,
|
|
258
|
+
placeholder = props.placeholder,
|
|
259
|
+
pattern = props.pattern,
|
|
260
|
+
readOnly = props.readOnly,
|
|
261
|
+
value = props.value,
|
|
262
|
+
label = props.label,
|
|
263
|
+
units = props.units,
|
|
264
|
+
name = props.name,
|
|
265
|
+
step = props.step,
|
|
266
|
+
min = props.min,
|
|
267
|
+
max = props.max,
|
|
268
|
+
src = props.src,
|
|
269
|
+
size = props.size,
|
|
270
|
+
minLength = props.minLength,
|
|
271
|
+
maxLength = props.maxLength,
|
|
272
|
+
alt = props.alt,
|
|
273
|
+
id = props.id,
|
|
274
|
+
iconLeft = props.iconLeft,
|
|
275
|
+
iconRight = props.iconRight,
|
|
276
|
+
autoComplete = props.autoComplete,
|
|
277
|
+
style = props.style,
|
|
278
|
+
tabIndex = props.tabIndex,
|
|
279
|
+
onChangeCallback = props.onChangeCallback,
|
|
280
|
+
onChange = props.onChange,
|
|
281
|
+
onBlur = props.onBlur,
|
|
282
|
+
onFocus = props.onFocus,
|
|
283
|
+
attributes = _objectWithoutProperties(props, _excluded);
|
|
284
|
+
var uniqueID = (0, react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
285
|
+
var idRes = id || uniqueID;
|
|
286
|
+
var rootRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
287
|
+
var valRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
288
|
+
var typeRes = typeof type === 'undefined' ? 'text' : type;
|
|
289
|
+
var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
290
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
291
|
+
onComposition = _useState2[0],
|
|
292
|
+
setOnComposition = _useState2[1];
|
|
293
|
+
var _useState3 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(value || ''),
|
|
294
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
295
|
+
changedVal = _useState4[0],
|
|
296
|
+
setChangedVal = _useState4[1];
|
|
297
|
+
function handleComposition(event) {
|
|
298
|
+
if (event.type === 'compositionstart') {
|
|
299
|
+
setOnComposition(true);
|
|
300
|
+
}
|
|
301
|
+
if (event.type === 'compositionend') {
|
|
302
|
+
setOnComposition(false);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function handleFocus(event) {
|
|
306
|
+
rootRef.current.classList.add('focus');
|
|
307
|
+
|
|
308
|
+
//
|
|
309
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition);
|
|
310
|
+
}
|
|
311
|
+
function handleChange(event) {
|
|
312
|
+
var val = event.target.value;
|
|
313
|
+
setChangedVal(val);
|
|
314
|
+
|
|
315
|
+
//----
|
|
316
|
+
//remove focus style
|
|
317
|
+
if (val === '') {
|
|
318
|
+
rootRef.current.classList.remove('focus');
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
//
|
|
322
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition);
|
|
323
|
+
if (typeof onChangeCallback === 'function') {
|
|
324
|
+
var newData = onChangeCallback(event);
|
|
325
|
+
setChangedVal(newData);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function handleBlur(event) {
|
|
329
|
+
var el = event.target;
|
|
330
|
+
var val = event.target.value;
|
|
331
|
+
|
|
332
|
+
//----
|
|
333
|
+
//remove focus style
|
|
334
|
+
if (val === '') {
|
|
335
|
+
rootRef.current.classList.remove('focus');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
//
|
|
339
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, onComposition);
|
|
340
|
+
}
|
|
341
|
+
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
342
|
+
// update default value
|
|
343
|
+
//--------------
|
|
344
|
+
setChangedVal(value || '');
|
|
345
|
+
|
|
346
|
+
// If you use the dynamic form assignment (such as document.getElementById(xxx).value),
|
|
347
|
+
// you need to judge the value of the input obtained by using the macrotask "setInterval()"
|
|
348
|
+
var timer = null;
|
|
349
|
+
var initTimes = 0;
|
|
350
|
+
var hasValue = false;
|
|
351
|
+
timer = setInterval(function () {
|
|
352
|
+
if (initTimes > 5 || hasValue) {
|
|
353
|
+
clearInterval(timer);
|
|
354
|
+
} else {
|
|
355
|
+
if (valRef.current !== null && valRef.current.value !== '' && (typeof value === 'undefined' || value === '')) {
|
|
356
|
+
setChangedVal(valRef.current.value);
|
|
357
|
+
hasValue = true;
|
|
358
|
+
}
|
|
359
|
+
initTimes++;
|
|
360
|
+
}
|
|
361
|
+
}, 500);
|
|
362
|
+
return function () {
|
|
363
|
+
clearInterval(timer);
|
|
364
|
+
};
|
|
365
|
+
}, [value]);
|
|
366
|
+
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", {
|
|
367
|
+
className: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
|
|
368
|
+
ref: rootRef
|
|
369
|
+
}, 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", {
|
|
370
|
+
htmlFor: idRes,
|
|
371
|
+
className: "form-label"
|
|
372
|
+
}, label)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
373
|
+
className: "input-group"
|
|
374
|
+
}, iconLeft ? /*#__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", {
|
|
375
|
+
className: "input-group-text"
|
|
376
|
+
}, iconLeft)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
|
|
377
|
+
ref: function ref(node) {
|
|
378
|
+
valRef.current = node;
|
|
379
|
+
if (typeof _ref === 'function') {
|
|
380
|
+
_ref(node);
|
|
381
|
+
} else if (_ref) {
|
|
382
|
+
_ref.current = node;
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
tabIndex: tabIndex || 0,
|
|
386
|
+
type: typeRes,
|
|
387
|
+
className: controlClassName || controlClassName === '' ? controlClassName : "form-control",
|
|
388
|
+
id: idRes,
|
|
389
|
+
name: name,
|
|
390
|
+
step: step || null,
|
|
391
|
+
min: min || null,
|
|
392
|
+
max: max || null,
|
|
393
|
+
src: src || null,
|
|
394
|
+
size: size || null,
|
|
395
|
+
alt: alt || null,
|
|
396
|
+
pattern: pattern || null,
|
|
397
|
+
placeholder: placeholder || '',
|
|
398
|
+
value: changedVal,
|
|
399
|
+
minLength: minLength || null,
|
|
400
|
+
maxLength: maxLength || null,
|
|
401
|
+
autoComplete: autoComplete ? 'on' : 'off',
|
|
402
|
+
onFocus: handleFocus,
|
|
403
|
+
onBlur: handleBlur,
|
|
404
|
+
onChange: handleChange,
|
|
405
|
+
onCompositionStart: handleComposition,
|
|
406
|
+
onCompositionUpdate: handleComposition,
|
|
407
|
+
onCompositionEnd: handleComposition,
|
|
408
|
+
disabled: disabled || null,
|
|
409
|
+
required: required || null,
|
|
410
|
+
readOnly: readOnly || null,
|
|
411
|
+
style: style
|
|
412
|
+
}, attributes)), units ? /*#__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", {
|
|
413
|
+
className: "input-group-text"
|
|
414
|
+
}, units)) : null, iconRight ? /*#__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", {
|
|
415
|
+
className: "input-group-text"
|
|
416
|
+
}, iconRight)) : null), 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", {
|
|
417
|
+
className: "position-absolute end-0 top-0 my-2 mx-2"
|
|
418
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
419
|
+
className: "text-danger"
|
|
420
|
+
}, "*"))) : ''));
|
|
421
|
+
});
|
|
422
|
+
/* harmony default export */
|
|
423
|
+
var __WEBPACK_DEFAULT_EXPORT__ = Input;
|
|
424
|
+
})();
|
|
425
|
+
|
|
426
|
+
/******/
|
|
427
|
+
return __webpack_exports__;
|
|
428
|
+
/******/
|
|
429
|
+
}()
|
|
430
|
+
);
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
/***/ }),
|
|
434
|
+
|
|
435
|
+
/***/ 787:
|
|
436
|
+
/***/ ((module) => {
|
|
437
|
+
|
|
438
|
+
"use strict";
|
|
439
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
440
|
+
|
|
441
|
+
/***/ })
|
|
442
|
+
|
|
443
|
+
/******/ });
|
|
444
|
+
/************************************************************************/
|
|
445
|
+
/******/ // The module cache
|
|
446
|
+
/******/ var __webpack_module_cache__ = {};
|
|
447
|
+
/******/
|
|
448
|
+
/******/ // The require function
|
|
449
|
+
/******/ function __webpack_require__(moduleId) {
|
|
450
|
+
/******/ // Check if module is in cache
|
|
451
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
452
|
+
/******/ if (cachedModule !== undefined) {
|
|
453
|
+
/******/ return cachedModule.exports;
|
|
454
|
+
/******/ }
|
|
455
|
+
/******/ // Create a new module (and put it into the cache)
|
|
456
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
457
|
+
/******/ id: moduleId,
|
|
458
|
+
/******/ loaded: false,
|
|
459
|
+
/******/ exports: {}
|
|
460
|
+
/******/ };
|
|
461
|
+
/******/
|
|
462
|
+
/******/ // Execute the module function
|
|
463
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
464
|
+
/******/
|
|
465
|
+
/******/ // Flag the module as loaded
|
|
466
|
+
/******/ module.loaded = true;
|
|
467
|
+
/******/
|
|
468
|
+
/******/ // Return the exports of the module
|
|
469
|
+
/******/ return module.exports;
|
|
470
|
+
/******/ }
|
|
471
|
+
/******/
|
|
472
|
+
/************************************************************************/
|
|
473
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
474
|
+
/******/ (() => {
|
|
475
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
476
|
+
/******/ __webpack_require__.n = (module) => {
|
|
477
|
+
/******/ var getter = module && module.__esModule ?
|
|
478
|
+
/******/ () => (module['default']) :
|
|
479
|
+
/******/ () => (module);
|
|
480
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
481
|
+
/******/ return getter;
|
|
482
|
+
/******/ };
|
|
483
|
+
/******/ })();
|
|
484
|
+
/******/
|
|
485
|
+
/******/ /* webpack/runtime/define property getters */
|
|
486
|
+
/******/ (() => {
|
|
487
|
+
/******/ // define getter functions for harmony exports
|
|
488
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
489
|
+
/******/ for(var key in definition) {
|
|
490
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
491
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
492
|
+
/******/ }
|
|
493
|
+
/******/ }
|
|
494
|
+
/******/ };
|
|
495
|
+
/******/ })();
|
|
496
|
+
/******/
|
|
497
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
498
|
+
/******/ (() => {
|
|
499
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
500
|
+
/******/ })();
|
|
501
|
+
/******/
|
|
502
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
503
|
+
/******/ (() => {
|
|
504
|
+
/******/ // define __esModule on exports
|
|
505
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
506
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
507
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
508
|
+
/******/ }
|
|
509
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
510
|
+
/******/ };
|
|
511
|
+
/******/ })();
|
|
512
|
+
/******/
|
|
513
|
+
/******/ /* webpack/runtime/node module decorator */
|
|
514
|
+
/******/ (() => {
|
|
515
|
+
/******/ __webpack_require__.nmd = (module) => {
|
|
516
|
+
/******/ module.paths = [];
|
|
517
|
+
/******/ if (!module.children) module.children = [];
|
|
518
|
+
/******/ return module;
|
|
519
|
+
/******/ };
|
|
520
|
+
/******/ })();
|
|
521
|
+
/******/
|
|
522
|
+
/************************************************************************/
|
|
523
|
+
var __webpack_exports__ = {};
|
|
524
|
+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
525
|
+
(() => {
|
|
526
|
+
"use strict";
|
|
527
|
+
__webpack_require__.r(__webpack_exports__);
|
|
528
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
529
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
530
|
+
/* harmony export */ });
|
|
531
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
|
|
532
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
533
|
+
/* harmony import */ var rpb_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(390);
|
|
534
|
+
/* harmony import */ var rpb_input__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rpb_input__WEBPACK_IMPORTED_MODULE_1__);
|
|
535
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
536
|
+
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."); }
|
|
537
|
+
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); }
|
|
538
|
+
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; }
|
|
539
|
+
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; } }
|
|
540
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
var RangeSlider = function RangeSlider(props) {
|
|
544
|
+
var wrapperClassName = props.wrapperClassName,
|
|
545
|
+
controlClassName = props.controlClassName,
|
|
546
|
+
disabled = props.disabled,
|
|
547
|
+
required = props.required,
|
|
548
|
+
value = props.value,
|
|
549
|
+
label = props.label,
|
|
550
|
+
minName = props.minName,
|
|
551
|
+
maxName = props.maxName,
|
|
552
|
+
onlyOne = props.onlyOne,
|
|
553
|
+
step = props.step,
|
|
554
|
+
min = props.min,
|
|
555
|
+
max = props.max,
|
|
556
|
+
id = props.id,
|
|
557
|
+
tabIndex = props.tabIndex,
|
|
558
|
+
onChange = props.onChange;
|
|
559
|
+
var uniqueID = (0,react__WEBPACK_IMPORTED_MODULE_0__.useId)();
|
|
560
|
+
var idRes = id || uniqueID;
|
|
561
|
+
var rootRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
562
|
+
var valMinRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
563
|
+
var valMaxRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
564
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value ? value.min : min),
|
|
565
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
566
|
+
minValue = _useState2[0],
|
|
567
|
+
setMinValue = _useState2[1];
|
|
568
|
+
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value ? value.max : max),
|
|
569
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
570
|
+
maxValue = _useState4[0],
|
|
571
|
+
setMaxValue = _useState4[1];
|
|
572
|
+
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
573
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
574
|
+
minActive = _useState6[0],
|
|
575
|
+
setMinActive = _useState6[1];
|
|
576
|
+
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
577
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
578
|
+
maxActive = _useState8[0],
|
|
579
|
+
setMaxActive = _useState8[1];
|
|
580
|
+
var minPos = (minValue - min) / (max - min) * 100;
|
|
581
|
+
var maxPos = (maxValue - min) / (max - min) * 100;
|
|
582
|
+
function initDefaultValue(defaultValue) {
|
|
583
|
+
// change the value to trigger component rendering
|
|
584
|
+
if (typeof defaultValue === 'undefined' || defaultValue === '') {
|
|
585
|
+
setMinValue(min);
|
|
586
|
+
setMaxValue(max);
|
|
587
|
+
} else {
|
|
588
|
+
setMinValue(defaultValue.min);
|
|
589
|
+
setMaxValue(defaultValue.max);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function handleMinEnter(e) {
|
|
593
|
+
setMinActive(true);
|
|
594
|
+
}
|
|
595
|
+
function handleMinLeave(e) {
|
|
596
|
+
setMinActive(false);
|
|
597
|
+
}
|
|
598
|
+
function handleMaxEnter(e) {
|
|
599
|
+
setMaxActive(true);
|
|
600
|
+
}
|
|
601
|
+
function handleMaxLeave(e) {
|
|
602
|
+
setMaxActive(false);
|
|
603
|
+
}
|
|
604
|
+
function handleMinChange(e) {
|
|
605
|
+
e.preventDefault();
|
|
606
|
+
var newMinVal = Math.min(+e.target.value, onlyOne ? maxValue : maxValue - step);
|
|
607
|
+
setMinValue(newMinVal);
|
|
608
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e, {
|
|
609
|
+
min: newMinVal,
|
|
610
|
+
max: maxValue
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function handleMaxChange(e) {
|
|
614
|
+
e.preventDefault();
|
|
615
|
+
var newMaxVal = Math.max(+e.target.value, minValue + step);
|
|
616
|
+
setMaxValue(newMaxVal);
|
|
617
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e, {
|
|
618
|
+
min: minValue,
|
|
619
|
+
max: newMaxVal
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
623
|
+
// update default value
|
|
624
|
+
//--------------
|
|
625
|
+
initDefaultValue(value);
|
|
626
|
+
|
|
627
|
+
// If you use the dynamic form assignment (such as document.getElementById(xxx).value),
|
|
628
|
+
// you need to judge the value of the input obtained by using the macrotask "setInterval()"
|
|
629
|
+
var timer = null;
|
|
630
|
+
var initTimes = 0;
|
|
631
|
+
var hasValue = false;
|
|
632
|
+
timer = setInterval(function () {
|
|
633
|
+
if (initTimes > 5 || hasValue) {
|
|
634
|
+
clearInterval(timer);
|
|
635
|
+
} else {
|
|
636
|
+
if (typeof value === 'undefined' || value === '') {
|
|
637
|
+
if (valMinRef.current !== null && valMaxRef.current !== null && valMinRef.current.value !== '' && valMaxRef.current.value !== '') initDefaultValue({
|
|
638
|
+
min: valMinRef.current.value,
|
|
639
|
+
max: valMaxRef.current.value
|
|
640
|
+
});
|
|
641
|
+
hasValue = true;
|
|
642
|
+
}
|
|
643
|
+
initTimes++;
|
|
644
|
+
}
|
|
645
|
+
}, 500);
|
|
646
|
+
return function () {
|
|
647
|
+
clearInterval(timer);
|
|
648
|
+
};
|
|
649
|
+
}, [value]);
|
|
650
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, 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("div", {
|
|
651
|
+
className: "range-slider__label"
|
|
652
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
|
653
|
+
htmlFor: "label-".concat(idRes),
|
|
654
|
+
className: "form-label"
|
|
655
|
+
}, label))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
656
|
+
className: wrapperClassName || wrapperClassName === '' ? "range-slider__wrapper ".concat(onlyOne ? 'only-one' : '', " ").concat(wrapperClassName) : "range-slider__wrapper ".concat(onlyOne ? 'only-one' : '', " mb-3 position-relative"),
|
|
657
|
+
ref: rootRef
|
|
658
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((rpb_input__WEBPACK_IMPORTED_MODULE_1___default()), {
|
|
659
|
+
ref: valMinRef,
|
|
660
|
+
wrapperClassName: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
|
|
661
|
+
controlClassName: controlClassName || controlClassName === '' ? controlClassName : "form-control",
|
|
662
|
+
required: required || null,
|
|
663
|
+
type: "text",
|
|
664
|
+
id: idRes + '-min',
|
|
665
|
+
name: minName,
|
|
666
|
+
value: minValue.toString() // Convert to a string to ensure that 0 can also be filled
|
|
667
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((rpb_input__WEBPACK_IMPORTED_MODULE_1___default()), {
|
|
668
|
+
ref: valMaxRef,
|
|
669
|
+
wrapperClassName: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
|
|
670
|
+
controlClassName: controlClassName || controlClassName === '' ? controlClassName : "form-control",
|
|
671
|
+
required: required || null,
|
|
672
|
+
type: "text",
|
|
673
|
+
id: idRes + '-max',
|
|
674
|
+
name: maxName,
|
|
675
|
+
value: maxValue.toString() // Convert to a string to ensure that 0 can also be filled
|
|
676
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
677
|
+
className: "range-slider__control-wrapper ".concat(disabled ? 'disabled' : '')
|
|
678
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
679
|
+
className: "range-slider__input"
|
|
680
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
|
|
681
|
+
type: "range",
|
|
682
|
+
value: minValue,
|
|
683
|
+
min: min,
|
|
684
|
+
max: max,
|
|
685
|
+
step: step,
|
|
686
|
+
tabIndex: tabIndex || 0,
|
|
687
|
+
disabled: disabled || null,
|
|
688
|
+
onMouseEnter: handleMinEnter,
|
|
689
|
+
onMouseLeave: handleMinLeave,
|
|
690
|
+
onChange: handleMinChange
|
|
691
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
|
|
692
|
+
type: "range",
|
|
693
|
+
value: maxValue,
|
|
694
|
+
min: min,
|
|
695
|
+
max: max,
|
|
696
|
+
step: step,
|
|
697
|
+
tabIndex: tabIndex || 0,
|
|
698
|
+
disabled: onlyOne ? true : disabled || null,
|
|
699
|
+
onMouseEnter: handleMaxEnter,
|
|
700
|
+
onMouseLeave: handleMaxLeave,
|
|
701
|
+
onChange: handleMaxChange
|
|
702
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
703
|
+
className: "range-slider__placeholder"
|
|
704
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
705
|
+
className: "range-slider__placeholder-grab ".concat(minActive ? 'active' : ''),
|
|
706
|
+
style: {
|
|
707
|
+
left: "".concat(minPos, "%")
|
|
708
|
+
}
|
|
709
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
710
|
+
className: "range-slider__placeholder-rail"
|
|
711
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
712
|
+
className: "range-slider__placeholder-inner-rail",
|
|
713
|
+
style: {
|
|
714
|
+
left: "".concat(minPos, "%"),
|
|
715
|
+
right: "".concat(100 - maxPos, "%")
|
|
716
|
+
}
|
|
717
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
718
|
+
className: "range-slider__placeholder-grab ".concat(maxActive ? 'active' : '', " ").concat(onlyOne ? 'inactive' : ''),
|
|
719
|
+
style: {
|
|
720
|
+
left: "".concat(maxPos, "%")
|
|
721
|
+
}
|
|
722
|
+
})))));
|
|
723
|
+
};
|
|
724
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RangeSlider);
|
|
725
|
+
})();
|
|
726
|
+
|
|
727
|
+
/******/ return __webpack_exports__;
|
|
728
|
+
/******/ })()
|
|
729
|
+
;
|
|
730
|
+
});
|