funda-ui 1.1.165 → 1.1.170
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/Accordion/index.js +5 -85
- package/HorizontalScrollContent/index.js +2 -83
- package/MultiFuncSelect/index.js +10 -1
- package/MultipleSelect/index.css +3 -0
- package/MultipleSelect/index.js +116 -71
- package/lib/cjs/Accordion/index.js +5 -85
- package/lib/cjs/HorizontalScrollContent/index.js +2 -83
- package/lib/cjs/MultiFuncSelect/index.js +10 -1
- package/lib/cjs/MultipleSelect/index.js +116 -71
- package/lib/css/MultipleSelect/index.css +3 -0
- package/lib/esm/Accordion/AccordionItem.tsx +0 -11
- package/lib/esm/HorizontalScrollContent/index.tsx +0 -12
- package/lib/esm/MultiFuncSelect/index.tsx +11 -1
- package/lib/esm/MultipleSelect/index.scss +10 -2
- package/lib/esm/MultipleSelect/index.tsx +135 -84
- package/package.json +1 -1
package/Accordion/index.js
CHANGED
|
@@ -355,58 +355,6 @@ module.exports = setDefaultOptions;
|
|
|
355
355
|
|
|
356
356
|
/***/ }),
|
|
357
357
|
|
|
358
|
-
/***/ 342:
|
|
359
|
-
/***/ ((module) => {
|
|
360
|
-
|
|
361
|
-
/*
|
|
362
|
-
* Debounce
|
|
363
|
-
*
|
|
364
|
-
* @param {Function} fn - A function to be executed within the time limit.
|
|
365
|
-
* @param {Number} limit - Waiting time.
|
|
366
|
-
* @return {Function} - Returns a new function.
|
|
367
|
-
*/
|
|
368
|
-
function debounce(fn) {
|
|
369
|
-
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
370
|
-
var timer;
|
|
371
|
-
return function () {
|
|
372
|
-
//Every time this returned function is called, the timer is cleared to ensure that fn is not executed
|
|
373
|
-
clearTimeout(timer);
|
|
374
|
-
|
|
375
|
-
// When the returned function is called for the last time (that is the user stops a continuous operation)
|
|
376
|
-
// Execute fn after another delay milliseconds
|
|
377
|
-
timer = setTimeout(function () {
|
|
378
|
-
fn.apply(this, arguments);
|
|
379
|
-
}, limit);
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
/*
|
|
384
|
-
* Throttle
|
|
385
|
-
*
|
|
386
|
-
* @param {Function} fn - A function to be executed within the time limit.
|
|
387
|
-
* @param {Number} limit - Waiting time.
|
|
388
|
-
* @return {Function} - Returns a new function.
|
|
389
|
-
*/
|
|
390
|
-
function throttle(fn) {
|
|
391
|
-
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
392
|
-
var waiting = false;
|
|
393
|
-
return function () {
|
|
394
|
-
if (!waiting) {
|
|
395
|
-
fn.apply(this, arguments);
|
|
396
|
-
waiting = true;
|
|
397
|
-
setTimeout(function () {
|
|
398
|
-
waiting = false;
|
|
399
|
-
}, limit);
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
module.exports = {
|
|
404
|
-
debounce: debounce,
|
|
405
|
-
throttle: throttle
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
/***/ }),
|
|
409
|
-
|
|
410
358
|
/***/ 787:
|
|
411
359
|
/***/ ((module) => {
|
|
412
360
|
|
|
@@ -499,36 +447,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
499
447
|
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
|
|
500
448
|
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
|
|
501
449
|
var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
|
|
502
|
-
// EXTERNAL MODULE: ./src/utils/performance.js
|
|
503
|
-
var performance = __webpack_require__(342);
|
|
504
450
|
;// CONCATENATED MODULE: ./src/AccordionItem.tsx
|
|
505
|
-
|
|
506
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
507
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
508
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
509
|
-
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); }
|
|
510
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
511
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
512
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
513
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
514
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
515
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
516
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
517
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
// Fix ERROR: ResizeObserver loop completed with undelivered notifications.
|
|
521
|
-
var _ResizeObserver = window.ResizeObserver;
|
|
522
|
-
window.ResizeObserver = /*#__PURE__*/function (_ResizeObserver2) {
|
|
523
|
-
_inherits(ResizeObserver, _ResizeObserver2);
|
|
524
|
-
var _super = _createSuper(ResizeObserver);
|
|
525
|
-
function ResizeObserver(callback) {
|
|
526
|
-
_classCallCheck(this, ResizeObserver);
|
|
527
|
-
callback = (0,performance.debounce)(callback, 16);
|
|
528
|
-
return _super.call(this, callback);
|
|
529
|
-
}
|
|
530
|
-
return _createClass(ResizeObserver);
|
|
531
|
-
}(_ResizeObserver);
|
|
451
|
+
|
|
532
452
|
var AccordionItem = function AccordionItem(props) {
|
|
533
453
|
var heightObserver = props.heightObserver,
|
|
534
454
|
index = props.index,
|
|
@@ -603,13 +523,13 @@ var AccordionItem = function AccordionItem(props) {
|
|
|
603
523
|
var anim = __webpack_require__(710);
|
|
604
524
|
var anim_default = /*#__PURE__*/__webpack_require__.n(anim);
|
|
605
525
|
;// CONCATENATED MODULE: ./src/Accordion.tsx
|
|
606
|
-
function
|
|
526
|
+
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); }
|
|
607
527
|
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); }
|
|
608
528
|
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; }
|
|
609
529
|
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; }
|
|
610
|
-
function _defineProperty(obj, key, value) { key =
|
|
611
|
-
function
|
|
612
|
-
function
|
|
530
|
+
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; }
|
|
531
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
532
|
+
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); }
|
|
613
533
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
614
534
|
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."); }
|
|
615
535
|
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); }
|
|
@@ -9,64 +9,12 @@
|
|
|
9
9
|
root["RPB"] = factory(root["React"]);
|
|
10
10
|
})(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
12
13
|
/******/ var __webpack_modules__ = ({
|
|
13
14
|
|
|
14
|
-
/***/ 342:
|
|
15
|
-
/***/ ((module) => {
|
|
16
|
-
|
|
17
|
-
/*
|
|
18
|
-
* Debounce
|
|
19
|
-
*
|
|
20
|
-
* @param {Function} fn - A function to be executed within the time limit.
|
|
21
|
-
* @param {Number} limit - Waiting time.
|
|
22
|
-
* @return {Function} - Returns a new function.
|
|
23
|
-
*/
|
|
24
|
-
function debounce(fn) {
|
|
25
|
-
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
26
|
-
var timer;
|
|
27
|
-
return function () {
|
|
28
|
-
//Every time this returned function is called, the timer is cleared to ensure that fn is not executed
|
|
29
|
-
clearTimeout(timer);
|
|
30
|
-
|
|
31
|
-
// When the returned function is called for the last time (that is the user stops a continuous operation)
|
|
32
|
-
// Execute fn after another delay milliseconds
|
|
33
|
-
timer = setTimeout(function () {
|
|
34
|
-
fn.apply(this, arguments);
|
|
35
|
-
}, limit);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
* Throttle
|
|
41
|
-
*
|
|
42
|
-
* @param {Function} fn - A function to be executed within the time limit.
|
|
43
|
-
* @param {Number} limit - Waiting time.
|
|
44
|
-
* @return {Function} - Returns a new function.
|
|
45
|
-
*/
|
|
46
|
-
function throttle(fn) {
|
|
47
|
-
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
48
|
-
var waiting = false;
|
|
49
|
-
return function () {
|
|
50
|
-
if (!waiting) {
|
|
51
|
-
fn.apply(this, arguments);
|
|
52
|
-
waiting = true;
|
|
53
|
-
setTimeout(function () {
|
|
54
|
-
waiting = false;
|
|
55
|
-
}, limit);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
module.exports = {
|
|
60
|
-
debounce: debounce,
|
|
61
|
-
throttle: throttle
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/***/ }),
|
|
65
|
-
|
|
66
15
|
/***/ 787:
|
|
67
16
|
/***/ ((module) => {
|
|
68
17
|
|
|
69
|
-
"use strict";
|
|
70
18
|
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
71
19
|
|
|
72
20
|
/***/ })
|
|
@@ -140,50 +88,21 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
|
140
88
|
/******/
|
|
141
89
|
/************************************************************************/
|
|
142
90
|
var __webpack_exports__ = {};
|
|
143
|
-
// This entry need to be wrapped in an IIFE because it need to be in
|
|
91
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
144
92
|
(() => {
|
|
145
|
-
"use strict";
|
|
146
93
|
__webpack_require__.r(__webpack_exports__);
|
|
147
94
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
148
95
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
149
96
|
/* harmony export */ });
|
|
150
97
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
|
|
151
98
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
152
|
-
/* harmony import */ var _utils_performance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(342);
|
|
153
|
-
/* harmony import */ var _utils_performance__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_utils_performance__WEBPACK_IMPORTED_MODULE_1__);
|
|
154
|
-
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); }
|
|
155
99
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
156
100
|
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."); }
|
|
157
101
|
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); }
|
|
158
102
|
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; }
|
|
159
103
|
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; } }
|
|
160
104
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
161
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
162
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
163
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
164
|
-
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); }
|
|
165
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
166
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
167
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
168
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
169
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
170
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
171
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
172
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
173
|
-
|
|
174
105
|
|
|
175
|
-
// Fix ERROR: ResizeObserver loop completed with undelivered notifications.
|
|
176
|
-
var _ResizeObserver = window.ResizeObserver;
|
|
177
|
-
window.ResizeObserver = /*#__PURE__*/function (_ResizeObserver2) {
|
|
178
|
-
_inherits(ResizeObserver, _ResizeObserver2);
|
|
179
|
-
var _super = _createSuper(ResizeObserver);
|
|
180
|
-
function ResizeObserver(callback) {
|
|
181
|
-
_classCallCheck(this, ResizeObserver);
|
|
182
|
-
callback = (0,_utils_performance__WEBPACK_IMPORTED_MODULE_1__.debounce)(callback, 16);
|
|
183
|
-
return _super.call(this, callback);
|
|
184
|
-
}
|
|
185
|
-
return _createClass(ResizeObserver);
|
|
186
|
-
}(_ResizeObserver);
|
|
187
106
|
var HorizontalScrollContent = function HorizontalScrollContent(props) {
|
|
188
107
|
var data = props.data,
|
|
189
108
|
slideOffset = props.slideOffset,
|
package/MultiFuncSelect/index.js
CHANGED
|
@@ -1719,8 +1719,17 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
1719
1719
|
// pop win initalization
|
|
1720
1720
|
setTimeout(function () {
|
|
1721
1721
|
popwinPosInit();
|
|
1722
|
-
popwinBtnEventsInit(
|
|
1722
|
+
popwinBtnEventsInit(orginalData);
|
|
1723
1723
|
}, 0);
|
|
1724
|
+
|
|
1725
|
+
// make sure the event handler is registered
|
|
1726
|
+
if (orginalData.length === 0) {
|
|
1727
|
+
setTimeout(function () {
|
|
1728
|
+
// no data label
|
|
1729
|
+
popwinNoMatchInit();
|
|
1730
|
+
popwinBtnEventsInit(orginalData);
|
|
1731
|
+
}, 500);
|
|
1732
|
+
}
|
|
1724
1733
|
if (LIVE_SEARCH_OK) {
|
|
1725
1734
|
// clean data
|
|
1726
1735
|
setOptionsData([]);
|
package/MultipleSelect/index.css
CHANGED
package/MultipleSelect/index.js
CHANGED
|
@@ -381,11 +381,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
381
381
|
/* harmony import */ var _utils_convert__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_utils_convert__WEBPACK_IMPORTED_MODULE_3__);
|
|
382
382
|
var _excluded = ["wrapperClassName", "availableHeaderTitle", "selectedHeaderTitle", "selectedHeaderNote", "removeAllBtnLabel", "addAllBtnLabel", "iconAdd", "iconRemove", "hierarchical", "indentation", "doubleIndent", "options", "disabled", "required", "value", "label", "name", "id", "extractValueByBrackets", "style", "data", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onFetch", "onChange"];
|
|
383
383
|
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; }
|
|
384
|
+
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); }
|
|
384
385
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
385
386
|
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."); }
|
|
386
387
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
387
388
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
388
|
-
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); }
|
|
389
389
|
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); }
|
|
390
390
|
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); } }
|
|
391
391
|
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); }); }; }
|
|
@@ -567,6 +567,93 @@ var MultipleSelect = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardR
|
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
+
function selectItem(el) {
|
|
571
|
+
if (el === null) return;
|
|
572
|
+
var _li = el;
|
|
573
|
+
var _val = _li.dataset.value;
|
|
574
|
+
var _label = _li.dataset.label;
|
|
575
|
+
|
|
576
|
+
// set selected items
|
|
577
|
+
setValSelected(function (prevState) {
|
|
578
|
+
var newData = JSON.parse(JSON.stringify(prevState));
|
|
579
|
+
var index = newData.findIndex(function (item) {
|
|
580
|
+
return item == _val;
|
|
581
|
+
});
|
|
582
|
+
if (index !== -1) newData.splice(index, 1);
|
|
583
|
+
var _res = _val ? Array.from(new Set([_val].concat(_toConsumableArray(newData)))) : newData;
|
|
584
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_li, _res, VALUE_BY_BRACKETS ? (0,_utils_convert__WEBPACK_IMPORTED_MODULE_3__.convertArrToValByBrackets)(_res) : _res.join(','));
|
|
585
|
+
|
|
586
|
+
// hide current item
|
|
587
|
+
_li.classList.add('hide');
|
|
588
|
+
return _res;
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
// update selected data
|
|
592
|
+
setValSelectedData(function (prevState) {
|
|
593
|
+
var newData = JSON.parse(JSON.stringify(prevState));
|
|
594
|
+
var index = newData.findIndex(function (item) {
|
|
595
|
+
return item.value == _val;
|
|
596
|
+
});
|
|
597
|
+
if (index !== -1) newData.splice(index, 1);
|
|
598
|
+
var _res = _val ? Array.from(new Set([{
|
|
599
|
+
label: _label,
|
|
600
|
+
value: _val
|
|
601
|
+
}].concat(_toConsumableArray(newData)))) : newData;
|
|
602
|
+
return _res;
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
function removeItem(el) {
|
|
606
|
+
if (el === null) return;
|
|
607
|
+
var _li = el;
|
|
608
|
+
var _val = _li.dataset.value;
|
|
609
|
+
|
|
610
|
+
// set selected items
|
|
611
|
+
setValSelected(function (prevState) {
|
|
612
|
+
var newData = JSON.parse(JSON.stringify(prevState));
|
|
613
|
+
var index = newData.findIndex(function (item) {
|
|
614
|
+
return item == _val;
|
|
615
|
+
});
|
|
616
|
+
if (index !== -1) newData.splice(index, 1);
|
|
617
|
+
var _res = newData;
|
|
618
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_li, _res, VALUE_BY_BRACKETS ? (0,_utils_convert__WEBPACK_IMPORTED_MODULE_3__.convertArrToValByBrackets)(_res) : _res.join(','));
|
|
619
|
+
|
|
620
|
+
// show current item
|
|
621
|
+
if (availableListRef.current) {
|
|
622
|
+
var removedItem = availableListRef.current.querySelector("li[data-value=\"".concat(_val, "\"]"));
|
|
623
|
+
if (removedItem !== null) removedItem.classList.remove('hide');
|
|
624
|
+
}
|
|
625
|
+
return _res;
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
// update selected data
|
|
629
|
+
setValSelectedData(function (prevState) {
|
|
630
|
+
var newData = JSON.parse(JSON.stringify(prevState));
|
|
631
|
+
var index = newData.findIndex(function (item) {
|
|
632
|
+
return item.value == _val;
|
|
633
|
+
});
|
|
634
|
+
if (index !== -1) newData.splice(index, 1);
|
|
635
|
+
var _res = newData;
|
|
636
|
+
return _res;
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
function handleSelectAll(event) {
|
|
640
|
+
event.preventDefault();
|
|
641
|
+
if (availableListRef.current === null) return;
|
|
642
|
+
var items = [].slice.call(availableListRef.current.querySelectorAll('li[data-value]'));
|
|
643
|
+
items.forEach(function (item) {
|
|
644
|
+
if (!item.classList.contains('disabled')) {
|
|
645
|
+
selectItem(item);
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function handleRemoveAll(event) {
|
|
650
|
+
event.preventDefault();
|
|
651
|
+
if (selectedListRef.current === null) return;
|
|
652
|
+
var items = [].slice.call(selectedListRef.current.querySelectorAll('li[data-value]'));
|
|
653
|
+
items.forEach(function (item) {
|
|
654
|
+
removeItem(item);
|
|
655
|
+
});
|
|
656
|
+
}
|
|
570
657
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
571
658
|
// data init
|
|
572
659
|
//--------------
|
|
@@ -588,7 +675,7 @@ var MultipleSelect = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardR
|
|
|
588
675
|
}
|
|
589
676
|
},
|
|
590
677
|
tabIndex: -1,
|
|
591
|
-
type: "
|
|
678
|
+
type: "hidden",
|
|
592
679
|
id: idRes,
|
|
593
680
|
name: name,
|
|
594
681
|
value: VALUE_BY_BRACKETS ? (0,_utils_convert__WEBPACK_IMPORTED_MODULE_3__.convertArrToValByBrackets)(valSelected) : valSelected.join(','),
|
|
@@ -609,53 +696,31 @@ var MultipleSelect = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardR
|
|
|
609
696
|
}
|
|
610
697
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
|
611
698
|
href: "#",
|
|
612
|
-
className: "m-select__btn--add-all"
|
|
699
|
+
className: "m-select__btn--add-all",
|
|
700
|
+
onClick: handleSelectAll
|
|
613
701
|
}, addAllBtnLabel || 'Add all')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
|
|
614
702
|
className: "m-select__available m-select__options-contentlist",
|
|
615
703
|
ref: availableListRef
|
|
616
704
|
}, dataInit ? dataInit.map(function (item, i) {
|
|
617
705
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
|
|
618
706
|
key: 'item' + i,
|
|
707
|
+
className: "".concat(item.disabled ? 'disabled' : '', " ").concat(valSelected.includes(item.value) ? 'hide' : ''),
|
|
619
708
|
"data-index": i,
|
|
620
|
-
"data-
|
|
621
|
-
"data-
|
|
709
|
+
"data-value": "".concat(item.value),
|
|
710
|
+
"data-label": "".concat(item.label),
|
|
622
711
|
"data-disabled": item.disabled || 'false',
|
|
623
|
-
|
|
624
|
-
|
|
712
|
+
"data-querystring": "".concat(typeof item.queryString === 'undefined' ? '' : item.queryString),
|
|
713
|
+
"data-itemdata": JSON.stringify(item)
|
|
714
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("strong", {
|
|
715
|
+
dangerouslySetInnerHTML: {
|
|
716
|
+
__html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
|
|
717
|
+
}
|
|
718
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
|
625
719
|
href: "#",
|
|
626
720
|
className: "m-select__item-action"
|
|
627
721
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
|
628
722
|
onClick: function onClick(e) {
|
|
629
|
-
|
|
630
|
-
var _val = _li.dataset.value;
|
|
631
|
-
var _label = _li.dataset.label;
|
|
632
|
-
setValSelected(function (prevState) {
|
|
633
|
-
var newData = JSON.parse(JSON.stringify(prevState));
|
|
634
|
-
var index = newData.findIndex(function (item) {
|
|
635
|
-
return item == _val;
|
|
636
|
-
});
|
|
637
|
-
if (index !== -1) newData.splice(index, 1);
|
|
638
|
-
var _res = _val ? Array.from(new Set([_val].concat(_toConsumableArray(newData)))) : newData;
|
|
639
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_li, _res, VALUE_BY_BRACKETS ? (0,_utils_convert__WEBPACK_IMPORTED_MODULE_3__.convertArrToValByBrackets)(_res) : _res.join(','));
|
|
640
|
-
|
|
641
|
-
// hide current item
|
|
642
|
-
_li.classList.add('hide');
|
|
643
|
-
return _res;
|
|
644
|
-
});
|
|
645
|
-
|
|
646
|
-
// update selected data
|
|
647
|
-
setValSelectedData(function (prevState) {
|
|
648
|
-
var newData = JSON.parse(JSON.stringify(prevState));
|
|
649
|
-
var index = newData.findIndex(function (item) {
|
|
650
|
-
return item.value == _val;
|
|
651
|
-
});
|
|
652
|
-
if (index !== -1) newData.splice(index, 1);
|
|
653
|
-
var _res = _val ? Array.from(new Set([{
|
|
654
|
-
label: _label,
|
|
655
|
-
value: _val
|
|
656
|
-
}].concat(_toConsumableArray(newData)))) : newData;
|
|
657
|
-
return _res;
|
|
658
|
-
});
|
|
723
|
+
selectItem(e.target.closest('li'));
|
|
659
724
|
}
|
|
660
725
|
}, iconAdd ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, iconAdd) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
|
|
661
726
|
width: "15px",
|
|
@@ -682,51 +747,31 @@ var MultipleSelect = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardR
|
|
|
682
747
|
}
|
|
683
748
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
|
684
749
|
href: "#",
|
|
685
|
-
className: "m-select__btn--remove-all"
|
|
750
|
+
className: "m-select__btn--remove-all",
|
|
751
|
+
onClick: handleRemoveAll
|
|
686
752
|
}, removeAllBtnLabel || 'Remove all')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
|
|
687
753
|
className: "m-select__selected m-select__options-contentlist--sortable m-select__options-contentlist",
|
|
688
754
|
ref: selectedListRef
|
|
689
755
|
}, valSelectedData ? valSelectedData.map(function (item, i) {
|
|
690
756
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
|
|
691
757
|
key: 'item-selected' + i,
|
|
758
|
+
className: "selected",
|
|
692
759
|
"data-index": i,
|
|
693
|
-
"data-
|
|
694
|
-
"data-
|
|
695
|
-
|
|
696
|
-
|
|
760
|
+
"data-value": "".concat(item.value),
|
|
761
|
+
"data-label": "".concat(item.label),
|
|
762
|
+
"data-disabled": item.disabled || 'false',
|
|
763
|
+
"data-querystring": "".concat(typeof item.queryString === 'undefined' ? '' : item.queryString),
|
|
764
|
+
"data-itemdata": JSON.stringify(item)
|
|
765
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("strong", {
|
|
766
|
+
dangerouslySetInnerHTML: {
|
|
767
|
+
__html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
|
|
768
|
+
}
|
|
769
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
|
697
770
|
href: "#",
|
|
698
771
|
className: "m-select__item-action"
|
|
699
772
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
|
700
773
|
onClick: function onClick(e) {
|
|
701
|
-
|
|
702
|
-
var _val = _li.dataset.value;
|
|
703
|
-
setValSelected(function (prevState) {
|
|
704
|
-
var newData = JSON.parse(JSON.stringify(prevState));
|
|
705
|
-
var index = newData.findIndex(function (item) {
|
|
706
|
-
return item == _val;
|
|
707
|
-
});
|
|
708
|
-
if (index !== -1) newData.splice(index, 1);
|
|
709
|
-
var _res = newData;
|
|
710
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_li, _res, VALUE_BY_BRACKETS ? (0,_utils_convert__WEBPACK_IMPORTED_MODULE_3__.convertArrToValByBrackets)(_res) : _res.join(','));
|
|
711
|
-
|
|
712
|
-
// show current item
|
|
713
|
-
if (availableListRef.current) {
|
|
714
|
-
var removedItem = availableListRef.current.querySelector("li[data-value=\"".concat(_val, "\"]"));
|
|
715
|
-
if (removedItem !== null) removedItem.classList.remove('hide');
|
|
716
|
-
}
|
|
717
|
-
return _res;
|
|
718
|
-
});
|
|
719
|
-
|
|
720
|
-
// update selected data
|
|
721
|
-
setValSelectedData(function (prevState) {
|
|
722
|
-
var newData = JSON.parse(JSON.stringify(prevState));
|
|
723
|
-
var index = newData.findIndex(function (item) {
|
|
724
|
-
return item.value == _val;
|
|
725
|
-
});
|
|
726
|
-
if (index !== -1) newData.splice(index, 1);
|
|
727
|
-
var _res = newData;
|
|
728
|
-
return _res;
|
|
729
|
-
});
|
|
774
|
+
removeItem(e.target.closest('li'));
|
|
730
775
|
}
|
|
731
776
|
}, iconRemove ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, iconRemove) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
|
|
732
777
|
width: "15px",
|