funda-ui 4.7.161 → 4.7.171
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/Select/index.css +32 -4
- package/Select/index.d.ts +6 -12
- package/Select/index.js +199 -308
- package/lib/cjs/Select/index.d.ts +6 -12
- package/lib/cjs/Select/index.js +199 -308
- package/lib/css/Select/index.css +32 -4
- package/lib/esm/Select/index.scss +41 -4
- package/lib/esm/Select/index.tsx +192 -142
- package/package.json +1 -1
package/lib/cjs/Select/index.js
CHANGED
|
@@ -953,181 +953,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
953
953
|
|
|
954
954
|
/***/ }),
|
|
955
955
|
|
|
956
|
-
/***/ 135:
|
|
957
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
958
|
-
|
|
959
|
-
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
960
|
-
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); }
|
|
961
|
-
(function webpackUniversalModuleDefinition(root, factory) {
|
|
962
|
-
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
963
|
-
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
964
|
-
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
965
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
966
|
-
})(this, function () {
|
|
967
|
-
return (/******/function () {
|
|
968
|
-
// webpackBootstrap
|
|
969
|
-
/******/
|
|
970
|
-
"use strict";
|
|
971
|
-
|
|
972
|
-
/******/ // The require scope
|
|
973
|
-
/******/
|
|
974
|
-
var __nested_webpack_require_987__ = {};
|
|
975
|
-
/******/
|
|
976
|
-
/************************************************************************/
|
|
977
|
-
/******/ /* webpack/runtime/define property getters */
|
|
978
|
-
/******/
|
|
979
|
-
(function () {
|
|
980
|
-
/******/ // define getter functions for harmony exports
|
|
981
|
-
/******/__nested_webpack_require_987__.d = function (exports, definition) {
|
|
982
|
-
/******/for (var key in definition) {
|
|
983
|
-
/******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
|
|
984
|
-
/******/Object.defineProperty(exports, key, {
|
|
985
|
-
enumerable: true,
|
|
986
|
-
get: definition[key]
|
|
987
|
-
});
|
|
988
|
-
/******/
|
|
989
|
-
}
|
|
990
|
-
/******/
|
|
991
|
-
}
|
|
992
|
-
/******/
|
|
993
|
-
};
|
|
994
|
-
/******/
|
|
995
|
-
})();
|
|
996
|
-
/******/
|
|
997
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
998
|
-
/******/
|
|
999
|
-
(function () {
|
|
1000
|
-
/******/__nested_webpack_require_987__.o = function (obj, prop) {
|
|
1001
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1002
|
-
};
|
|
1003
|
-
/******/
|
|
1004
|
-
})();
|
|
1005
|
-
/******/
|
|
1006
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
1007
|
-
/******/
|
|
1008
|
-
(function () {
|
|
1009
|
-
/******/ // define __esModule on exports
|
|
1010
|
-
/******/__nested_webpack_require_987__.r = function (exports) {
|
|
1011
|
-
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1012
|
-
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
1013
|
-
value: 'Module'
|
|
1014
|
-
});
|
|
1015
|
-
/******/
|
|
1016
|
-
}
|
|
1017
|
-
/******/
|
|
1018
|
-
Object.defineProperty(exports, '__esModule', {
|
|
1019
|
-
value: true
|
|
1020
|
-
});
|
|
1021
|
-
/******/
|
|
1022
|
-
};
|
|
1023
|
-
/******/
|
|
1024
|
-
})();
|
|
1025
|
-
/******/
|
|
1026
|
-
/************************************************************************/
|
|
1027
|
-
var __webpack_exports__ = {};
|
|
1028
|
-
__nested_webpack_require_987__.r(__webpack_exports__);
|
|
1029
|
-
/* harmony export */
|
|
1030
|
-
__nested_webpack_require_987__.d(__webpack_exports__, {
|
|
1031
|
-
/* harmony export */"extractContentsOfBraces": function extractContentsOfBraces() {
|
|
1032
|
-
return (/* binding */_extractContentsOfBraces
|
|
1033
|
-
);
|
|
1034
|
-
},
|
|
1035
|
-
/* harmony export */"extractContentsOfBrackets": function extractContentsOfBrackets() {
|
|
1036
|
-
return (/* binding */_extractContentsOfBrackets
|
|
1037
|
-
);
|
|
1038
|
-
},
|
|
1039
|
-
/* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
|
|
1040
|
-
return (/* binding */_extractContentsOfParentheses
|
|
1041
|
-
);
|
|
1042
|
-
},
|
|
1043
|
-
/* harmony export */"extractorExist": function extractorExist() {
|
|
1044
|
-
return (/* binding */_extractorExist
|
|
1045
|
-
);
|
|
1046
|
-
}
|
|
1047
|
-
/* harmony export */
|
|
1048
|
-
});
|
|
1049
|
-
/**
|
|
1050
|
-
* Determine whether an extractor is included
|
|
1051
|
-
* @param {String} str => input string. such as 'a[1], b[2]', '{a[1]}'
|
|
1052
|
-
* @returns {Boolean}
|
|
1053
|
-
*/
|
|
1054
|
-
function _extractorExist(str) {
|
|
1055
|
-
if (typeof str === 'undefined' || str === null || str === '') {
|
|
1056
|
-
return false;
|
|
1057
|
-
}
|
|
1058
|
-
var res = false;
|
|
1059
|
-
if (str !== null && str !== void 0 && str.match(/(\[.*?\])/gi)) {
|
|
1060
|
-
res = true;
|
|
1061
|
-
}
|
|
1062
|
-
return res;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* Extract the contents of square brackets
|
|
1067
|
-
* @param {String} str => input string. such as '[1,2] [f][c]'
|
|
1068
|
-
* @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
|
|
1069
|
-
* @returns {Array<string>|string} such as: ['1,2','f','c']
|
|
1070
|
-
*/
|
|
1071
|
-
function _extractContentsOfBrackets(str) {
|
|
1072
|
-
var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1073
|
-
if (typeof str === 'undefined' || str === null || str === '') {
|
|
1074
|
-
return !commaSeparated ? [] : '';
|
|
1075
|
-
}
|
|
1076
|
-
var res = str.match(/[^\[]+(?=(\[ \])|\])/g);
|
|
1077
|
-
if (commaSeparated) {
|
|
1078
|
-
return res === null ? '' : res.join(',').replace(/\,+$/, '');
|
|
1079
|
-
} else {
|
|
1080
|
-
return res === null ? '' : res;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* Extract the contents of curly braces
|
|
1086
|
-
* @param {String} str => input string. such as '{1,2} {f}{c}'
|
|
1087
|
-
* @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
|
|
1088
|
-
* @returns {Array<string>|string} such as: ['1,2','f','c']
|
|
1089
|
-
*/
|
|
1090
|
-
function _extractContentsOfBraces(str) {
|
|
1091
|
-
var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1092
|
-
if (typeof str === 'undefined' || str === null || str === '') {
|
|
1093
|
-
return !commaSeparated ? [] : '';
|
|
1094
|
-
}
|
|
1095
|
-
var res = str.match(/[^\{]+(?=(\{ \})|\})/g);
|
|
1096
|
-
if (commaSeparated) {
|
|
1097
|
-
return res === null ? '' : res.join(',').replace(/\,+$/, '');
|
|
1098
|
-
} else {
|
|
1099
|
-
return res === null ? '' : res;
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Extract the contents of parentheses
|
|
1105
|
-
* @param {String} str => input string. such as '(1,2) (f)(c)'
|
|
1106
|
-
* @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
|
|
1107
|
-
* @returns {Array<string>|string} such as: ['1,2','f','c']
|
|
1108
|
-
*/
|
|
1109
|
-
function _extractContentsOfParentheses(str) {
|
|
1110
|
-
var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1111
|
-
if (typeof str === 'undefined' || str === null || str === '') {
|
|
1112
|
-
return !commaSeparated ? [] : '';
|
|
1113
|
-
}
|
|
1114
|
-
var res = str.match(/[^\(]+(?=(\( \))|\))/g);
|
|
1115
|
-
if (commaSeparated) {
|
|
1116
|
-
return res === null ? '' : res.join(',').replace(/\,+$/, '');
|
|
1117
|
-
} else {
|
|
1118
|
-
return res === null ? '' : res;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
/******/
|
|
1123
|
-
return __webpack_exports__;
|
|
1124
|
-
/******/
|
|
1125
|
-
}()
|
|
1126
|
-
);
|
|
1127
|
-
});
|
|
1128
|
-
|
|
1129
|
-
/***/ }),
|
|
1130
|
-
|
|
1131
956
|
/***/ 933:
|
|
1132
957
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1133
958
|
|
|
@@ -3685,8 +3510,6 @@ var useClickOutside_default = /*#__PURE__*/__webpack_require__.n(useClickOutside
|
|
|
3685
3510
|
// EXTERNAL MODULE: ../Utils/dist/cjs/useWindowScroll.js
|
|
3686
3511
|
var useWindowScroll = __webpack_require__(499);
|
|
3687
3512
|
var useWindowScroll_default = /*#__PURE__*/__webpack_require__.n(useWindowScroll);
|
|
3688
|
-
// EXTERNAL MODULE: ../Utils/dist/cjs/extract.js
|
|
3689
|
-
var extract = __webpack_require__(135);
|
|
3690
3513
|
// EXTERNAL MODULE: ../Utils/dist/cjs/convert.js
|
|
3691
3514
|
var convert = __webpack_require__(79);
|
|
3692
3515
|
// EXTERNAL MODULE: ../Utils/dist/cjs/getElementProperty.js
|
|
@@ -3704,7 +3527,7 @@ var format_string = __webpack_require__(933);
|
|
|
3704
3527
|
// EXTERNAL MODULE: ../Utils/dist/cjs/cls.js
|
|
3705
3528
|
var cls = __webpack_require__(188);
|
|
3706
3529
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
3707
|
-
var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "exceededSidePosOffset", "multiSelect", "multiSelectEntireAreaTrigger", "multiSelectSelectedItemOnlyStatus", "renderSelectedValue", "disabled", "required", "defaultValue", "value", "label", "name", "readOnly", "placeholder", "id", "autoComplete", "autoCapitalize", "spellCheck", "options", "
|
|
3530
|
+
var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "exceededSidePosOffset", "clearIcon", "multiSelect", "multiSelectEntireAreaTrigger", "multiSelectSelectedItemOnlyStatus", "renderSelectedValue", "disabled", "required", "defaultValue", "value", "label", "name", "readOnly", "placeholder", "id", "autoComplete", "autoCapitalize", "spellCheck", "options", "clearTrigger", "loader", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "firstRequestAutoExec", "fetchTrigger", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus", "onKeyPressed"];
|
|
3708
3531
|
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; }
|
|
3709
3532
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3710
3533
|
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."); }
|
|
@@ -3741,7 +3564,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
3741
3564
|
|
|
3742
3565
|
|
|
3743
3566
|
|
|
3744
|
-
|
|
3745
3567
|
// Destroys body scroll locking
|
|
3746
3568
|
|
|
3747
3569
|
|
|
@@ -3754,6 +3576,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3754
3576
|
controlExClassName = props.controlExClassName,
|
|
3755
3577
|
optionsExClassName = props.optionsExClassName,
|
|
3756
3578
|
exceededSidePosOffset = props.exceededSidePosOffset,
|
|
3579
|
+
clearIcon = props.clearIcon,
|
|
3757
3580
|
multiSelect = props.multiSelect,
|
|
3758
3581
|
multiSelectEntireAreaTrigger = props.multiSelectEntireAreaTrigger,
|
|
3759
3582
|
multiSelectSelectedItemOnlyStatus = props.multiSelectSelectedItemOnlyStatus,
|
|
@@ -3771,7 +3594,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3771
3594
|
autoCapitalize = props.autoCapitalize,
|
|
3772
3595
|
spellCheck = props.spellCheck,
|
|
3773
3596
|
options = props.options,
|
|
3774
|
-
|
|
3597
|
+
clearTrigger = props.clearTrigger,
|
|
3775
3598
|
loader = props.loader,
|
|
3776
3599
|
lockBodyScroll = props.lockBodyScroll,
|
|
3777
3600
|
hierarchical = props.hierarchical,
|
|
@@ -3784,7 +3607,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3784
3607
|
tabIndex = props.tabIndex,
|
|
3785
3608
|
firstRequestAutoExec = props.firstRequestAutoExec,
|
|
3786
3609
|
fetchTrigger = props.fetchTrigger,
|
|
3787
|
-
fetchTriggerForDefaultData = props.fetchTriggerForDefaultData,
|
|
3788
3610
|
_props$fetchNoneInfo = props.fetchNoneInfo,
|
|
3789
3611
|
fetchNoneInfo = _props$fetchNoneInfo === void 0 ? 'No match yet' : _props$fetchNoneInfo,
|
|
3790
3612
|
fetchUpdate = props.fetchUpdate,
|
|
@@ -3807,6 +3629,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3807
3629
|
var MANUAL_REQ = typeof fetchTrigger !== 'undefined' && fetchTrigger === true ? true : false; // Manual requests
|
|
3808
3630
|
var LIVE_SEARCH_DISABLED = !MANUAL_REQ && typeof window !== 'undefined' && typeof window['funda-ui__Select-disable-livesearch'] !== 'undefined' ? true : false; // Globally disable real-time search functionality (only valid for non-dynamic requests)
|
|
3809
3631
|
|
|
3632
|
+
var CLEAR_ICON = typeof clearIcon === 'undefined' ? true : clearIcon;
|
|
3810
3633
|
var FIRST_REQUEST_AUTO = typeof firstRequestAutoExec === 'undefined' ? true : firstRequestAutoExec;
|
|
3811
3634
|
var INPUT_READONLY = LIVE_SEARCH_DISABLED ? true : typeof readOnly === 'undefined' ? null : readOnly;
|
|
3812
3635
|
var VALUE_BY_BRACKETS = typeof extractValueByBrackets === 'undefined' ? true : extractValueByBrackets;
|
|
@@ -3913,6 +3736,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3913
3736
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
3914
3737
|
controlArr = _useState26[0],
|
|
3915
3738
|
setControlArr = _useState26[1];
|
|
3739
|
+
function chkValueExist(v) {
|
|
3740
|
+
return typeof v !== 'undefined' && v !== '';
|
|
3741
|
+
}
|
|
3916
3742
|
var listContainerHeightLimit = function listContainerHeightLimit(num) {
|
|
3917
3743
|
var res = num;
|
|
3918
3744
|
if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
|
|
@@ -3928,9 +3754,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3928
3754
|
}).includes(val.toString());
|
|
3929
3755
|
};
|
|
3930
3756
|
|
|
3931
|
-
//
|
|
3932
|
-
var
|
|
3933
|
-
var
|
|
3757
|
+
// clear trigger
|
|
3758
|
+
var CLEAR_TRIGGER_VALID = typeof clearTrigger === 'undefined' ? false : clearTrigger ? clearTrigger.valid : false;
|
|
3759
|
+
var CLEAR_TRIGGER_LABEL = clearTrigger ? clearTrigger.clearValueLabel : 'Clear';
|
|
3934
3760
|
var optionsFormatGroupOpt = function optionsFormatGroupOpt(allData) {
|
|
3935
3761
|
allData.forEach(function (item) {
|
|
3936
3762
|
if (typeof item.optgroup !== 'undefined') {
|
|
@@ -3967,7 +3793,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3967
3793
|
if (MULTI_SEL_VALID) {
|
|
3968
3794
|
updateOptionCheckboxes('remove');
|
|
3969
3795
|
} else {
|
|
3970
|
-
|
|
3796
|
+
handleClearValue();
|
|
3971
3797
|
}
|
|
3972
3798
|
selectInputRef.current.blur();
|
|
3973
3799
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
@@ -4110,12 +3936,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4110
3936
|
filterResQueryValue,
|
|
4111
3937
|
filterResQueryLabel,
|
|
4112
3938
|
_currentData,
|
|
4113
|
-
|
|
4114
|
-
|
|
3939
|
+
_defaultValues,
|
|
3940
|
+
_defaultLabels,
|
|
3941
|
+
_filterRes2,
|
|
4115
3942
|
_filterResQueryValue,
|
|
4116
3943
|
_filterResQueryLabel,
|
|
4117
3944
|
_currentData2,
|
|
4118
|
-
|
|
3945
|
+
_defaultValues2,
|
|
3946
|
+
_defaultLabels2,
|
|
4119
3947
|
_args = arguments;
|
|
4120
3948
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4121
3949
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -4124,7 +3952,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4124
3952
|
// Determine whether the default value is user query input or default input
|
|
4125
3953
|
defaultValue = init ? valueToInputDefault : '';
|
|
4126
3954
|
if (!(_typeof(fetchFuncAsync) === 'object')) {
|
|
4127
|
-
_context.next =
|
|
3955
|
+
_context.next = 27;
|
|
4128
3956
|
break;
|
|
4129
3957
|
}
|
|
4130
3958
|
_context.next = 5;
|
|
@@ -4156,38 +3984,26 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4156
3984
|
|
|
4157
3985
|
// STEP 3: ===========
|
|
4158
3986
|
// value & label must be initialized
|
|
4159
|
-
filterRes = [];
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
}
|
|
4169
|
-
} else {
|
|
4170
|
-
// If the default value is label, match value
|
|
4171
|
-
filterResQueryValue = _ORGIN_DATA.filter(function (item) {
|
|
4172
|
-
return item.value == defaultValue;
|
|
4173
|
-
});
|
|
4174
|
-
filterResQueryLabel = _ORGIN_DATA.filter(function (item) {
|
|
4175
|
-
return item.label == defaultValue;
|
|
4176
|
-
});
|
|
4177
|
-
filterRes = filterResQueryValue;
|
|
4178
|
-
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
3987
|
+
filterRes = []; // If the default value is label, match value
|
|
3988
|
+
filterResQueryValue = _ORGIN_DATA.filter(function (item) {
|
|
3989
|
+
return item.value == defaultValue;
|
|
3990
|
+
});
|
|
3991
|
+
filterResQueryLabel = _ORGIN_DATA.filter(function (item) {
|
|
3992
|
+
return item.label == defaultValue;
|
|
3993
|
+
});
|
|
3994
|
+
filterRes = filterResQueryValue;
|
|
3995
|
+
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
4179
3996
|
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
}
|
|
3997
|
+
// if the default value is Object
|
|
3998
|
+
if (isObject(inputDefault) && filterRes.length === 0) {
|
|
3999
|
+
filterRes = [inputDefault];
|
|
4184
4000
|
}
|
|
4185
4001
|
|
|
4186
4002
|
// STEP 4: ===========
|
|
4187
4003
|
// ++++++++++++++++++++
|
|
4188
4004
|
// Single selection
|
|
4189
4005
|
// ++++++++++++++++++++
|
|
4190
|
-
if (
|
|
4006
|
+
if (!chkValueExist(defaultValue)) {
|
|
4191
4007
|
// Do not use `init`, otherwise the query will revert to the default value if there is no value
|
|
4192
4008
|
setControlValue('');
|
|
4193
4009
|
setControlLabel('');
|
|
@@ -4202,41 +4018,24 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4202
4018
|
// Multiple selection
|
|
4203
4019
|
// ++++++++++++++++++++
|
|
4204
4020
|
if (MULTI_SEL_VALID) {
|
|
4205
|
-
if ((
|
|
4021
|
+
if (!chkValueExist(defaultValue) && init) {
|
|
4206
4022
|
setControlArr({
|
|
4207
4023
|
labels: [],
|
|
4208
4024
|
values: []
|
|
4209
4025
|
});
|
|
4210
4026
|
}
|
|
4211
|
-
if (
|
|
4027
|
+
if (chkValueExist(defaultValue) && Array.isArray(defaultValue)) {
|
|
4212
4028
|
// initialize default values of Multiple selection
|
|
4213
|
-
_currentData =
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
values: _currentData.values
|
|
4029
|
+
_currentData = defaultValue;
|
|
4030
|
+
_defaultValues = _currentData.map(function (v) {
|
|
4031
|
+
return v.value;
|
|
4217
4032
|
});
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
_filterRes2 = [{
|
|
4225
|
-
value: _currentData.values[_index],
|
|
4226
|
-
label: _currentData.labels[_index],
|
|
4227
|
-
queryString: _currentData.queryStrings[_index]
|
|
4228
|
-
}];
|
|
4229
|
-
setControlArr(function (prevState) {
|
|
4230
|
-
return {
|
|
4231
|
-
labels: unique([].concat(_toConsumableArray(prevState.labels), [typeof _filterRes2[0] !== 'undefined' ? _filterRes2[0].label : '']).filter(function (v) {
|
|
4232
|
-
return v !== '';
|
|
4233
|
-
})),
|
|
4234
|
-
values: unique([].concat(_toConsumableArray(prevState.values), [typeof _filterRes2[0] !== 'undefined' ? _filterRes2[0].value : '']).filter(function (v) {
|
|
4235
|
-
return v !== '';
|
|
4236
|
-
}))
|
|
4237
|
-
};
|
|
4238
|
-
});
|
|
4239
|
-
}
|
|
4033
|
+
_defaultLabels = _currentData.map(function (v) {
|
|
4034
|
+
return v.label;
|
|
4035
|
+
});
|
|
4036
|
+
setControlArr({
|
|
4037
|
+
labels: _defaultLabels,
|
|
4038
|
+
values: _defaultValues
|
|
4240
4039
|
});
|
|
4241
4040
|
}
|
|
4242
4041
|
|
|
@@ -4267,7 +4066,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4267
4066
|
|
|
4268
4067
|
//
|
|
4269
4068
|
return _context.abrupt("return", _ORGIN_DATA);
|
|
4270
|
-
case
|
|
4069
|
+
case 27:
|
|
4271
4070
|
// STEP 1: ===========
|
|
4272
4071
|
// Set hierarchical categories ( with sub-categories )
|
|
4273
4072
|
if (hierarchical) {
|
|
@@ -4280,36 +4079,34 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4280
4079
|
staticOptionsData = optionsCustomSelectFlat(staticOptionsData);
|
|
4281
4080
|
|
|
4282
4081
|
// STEP 3: ===========
|
|
4283
|
-
// value & label must be initialized
|
|
4284
|
-
|
|
4285
4082
|
// If the default value is label, match value
|
|
4286
|
-
|
|
4083
|
+
_filterRes2 = [];
|
|
4287
4084
|
_filterResQueryValue = staticOptionsData.filter(function (item) {
|
|
4288
4085
|
return item.value == defaultValue;
|
|
4289
4086
|
});
|
|
4290
4087
|
_filterResQueryLabel = staticOptionsData.filter(function (item) {
|
|
4291
4088
|
return item.label == defaultValue;
|
|
4292
4089
|
});
|
|
4293
|
-
|
|
4294
|
-
if (_filterResQueryValue.length === 0)
|
|
4090
|
+
_filterRes2 = _filterResQueryValue;
|
|
4091
|
+
if (_filterResQueryValue.length === 0) _filterRes2 = _filterResQueryLabel;
|
|
4295
4092
|
|
|
4296
4093
|
// if the default value is Object
|
|
4297
|
-
if (isObject(inputDefault) &&
|
|
4298
|
-
|
|
4094
|
+
if (isObject(inputDefault) && _filterRes2.length === 0) {
|
|
4095
|
+
_filterRes2 = [inputDefault];
|
|
4299
4096
|
}
|
|
4300
4097
|
|
|
4301
4098
|
// STEP 4: ===========
|
|
4302
4099
|
// ++++++++++++++++++++
|
|
4303
4100
|
// Single selection
|
|
4304
4101
|
// ++++++++++++++++++++
|
|
4305
|
-
if (
|
|
4102
|
+
if (!chkValueExist(defaultValue)) {
|
|
4306
4103
|
// Do not use `init`, otherwise the query will revert to the default value if there is no value
|
|
4307
4104
|
setControlValue('');
|
|
4308
4105
|
setControlLabel('');
|
|
4309
4106
|
} else {
|
|
4310
|
-
if (
|
|
4311
|
-
setControlValue(
|
|
4312
|
-
setControlLabel(formatIndentVal(
|
|
4107
|
+
if (_filterRes2.length > 0) {
|
|
4108
|
+
setControlValue(_filterRes2[0].value);
|
|
4109
|
+
setControlLabel(formatIndentVal(_filterRes2[0].label, INDENT_LAST_PLACEHOLDER));
|
|
4313
4110
|
}
|
|
4314
4111
|
}
|
|
4315
4112
|
|
|
@@ -4317,41 +4114,24 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4317
4114
|
// Multiple selection
|
|
4318
4115
|
// ++++++++++++++++++++
|
|
4319
4116
|
if (MULTI_SEL_VALID) {
|
|
4320
|
-
if ((
|
|
4117
|
+
if (!chkValueExist(defaultValue) && init) {
|
|
4321
4118
|
setControlArr({
|
|
4322
4119
|
labels: [],
|
|
4323
4120
|
values: []
|
|
4324
4121
|
});
|
|
4325
4122
|
}
|
|
4326
|
-
if (
|
|
4123
|
+
if (chkValueExist(defaultValue) && Array.isArray(defaultValue)) {
|
|
4327
4124
|
// initialize default values of Multiple selection
|
|
4328
|
-
_currentData2 =
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
values: _currentData2.values
|
|
4125
|
+
_currentData2 = defaultValue;
|
|
4126
|
+
_defaultValues2 = _currentData2.map(function (v) {
|
|
4127
|
+
return v.value;
|
|
4332
4128
|
});
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
_filterRes4 = [{
|
|
4340
|
-
value: _currentData2.values[_index],
|
|
4341
|
-
label: _currentData2.labels[_index],
|
|
4342
|
-
queryString: _currentData2.queryStrings[_index]
|
|
4343
|
-
}];
|
|
4344
|
-
setControlArr(function (prevState) {
|
|
4345
|
-
return {
|
|
4346
|
-
labels: unique([].concat(_toConsumableArray(prevState.labels), [typeof _filterRes4[0] !== 'undefined' ? _filterRes4[0].label : '']).filter(function (v) {
|
|
4347
|
-
return v !== '';
|
|
4348
|
-
})),
|
|
4349
|
-
values: unique([].concat(_toConsumableArray(prevState.values), [typeof _filterRes4[0] !== 'undefined' ? _filterRes4[0].value : '']).filter(function (v) {
|
|
4350
|
-
return v !== '';
|
|
4351
|
-
}))
|
|
4352
|
-
};
|
|
4353
|
-
});
|
|
4354
|
-
}
|
|
4129
|
+
_defaultLabels2 = _currentData2.map(function (v) {
|
|
4130
|
+
return v.label;
|
|
4131
|
+
});
|
|
4132
|
+
setControlArr({
|
|
4133
|
+
labels: _defaultLabels2,
|
|
4134
|
+
values: _defaultValues2
|
|
4355
4135
|
});
|
|
4356
4136
|
}
|
|
4357
4137
|
|
|
@@ -4382,7 +4162,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4382
4162
|
|
|
4383
4163
|
//
|
|
4384
4164
|
return _context.abrupt("return", staticOptionsData);
|
|
4385
|
-
case
|
|
4165
|
+
case 43:
|
|
4386
4166
|
case "end":
|
|
4387
4167
|
return _context.stop();
|
|
4388
4168
|
}
|
|
@@ -4411,9 +4191,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4411
4191
|
if (el === null) return;
|
|
4412
4192
|
var activedItem = el.querySelectorAll(".list-group-item.".concat(!MULTI_SEL_VALID ? 'active' : 'item-selected'))[0];
|
|
4413
4193
|
if (typeof activedItem !== 'undefined') {
|
|
4414
|
-
var
|
|
4415
|
-
var
|
|
4416
|
-
var _latestScrollTop = activedItem.offsetTop -
|
|
4194
|
+
var clearItem = el.querySelector(".list-group-item.".concat(!MULTI_SEL_VALID ? 'custom-select-multi__control-option-item--clear' : 'custom-select-multi__control-option-item--select-all'));
|
|
4195
|
+
var clearItemHeight = clearItem === null ? 0 : clearItem.clientHeight;
|
|
4196
|
+
var _latestScrollTop = activedItem.offsetTop - clearItemHeight;
|
|
4417
4197
|
el.scrollTop = _latestScrollTop;
|
|
4418
4198
|
}
|
|
4419
4199
|
}
|
|
@@ -4678,7 +4458,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4678
4458
|
setIsOpen(false);
|
|
4679
4459
|
if (!MULTI_SEL_VALID) popwinPosHide();
|
|
4680
4460
|
if (MANUAL_REQ) {
|
|
4681
|
-
//
|
|
4461
|
+
// clear data
|
|
4682
4462
|
setOptionsData([]);
|
|
4683
4463
|
} else {
|
|
4684
4464
|
// restore data
|
|
@@ -4734,7 +4514,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4734
4514
|
}, 500);
|
|
4735
4515
|
}
|
|
4736
4516
|
if (MANUAL_REQ) {
|
|
4737
|
-
//
|
|
4517
|
+
// clear data
|
|
4738
4518
|
setOptionsData([]);
|
|
4739
4519
|
} else {
|
|
4740
4520
|
// restore data
|
|
@@ -5134,7 +4914,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5134
4914
|
// Fixed an out-of-focus issue
|
|
5135
4915
|
fixFocusStatus();
|
|
5136
4916
|
}
|
|
5137
|
-
function
|
|
4917
|
+
function handleClearValue(event) {
|
|
5138
4918
|
if (typeof event !== 'undefined') {
|
|
5139
4919
|
event.preventDefault();
|
|
5140
4920
|
event.stopPropagation(); /* REQUIRED */
|
|
@@ -5248,25 +5028,18 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5248
5028
|
while (1) switch (_context4.prev = _context4.next) {
|
|
5249
5029
|
case 0:
|
|
5250
5030
|
inputVal = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;
|
|
5251
|
-
if (!MANUAL_REQ) {
|
|
5252
|
-
_context4.next = 3;
|
|
5253
|
-
break;
|
|
5254
|
-
}
|
|
5255
|
-
return _context4.abrupt("return", []);
|
|
5256
|
-
case 3:
|
|
5257
|
-
//
|
|
5258
5031
|
_oparams = fetchFuncMethodParams || [];
|
|
5259
5032
|
_params = _oparams.map(function (item) {
|
|
5260
5033
|
return item !== '$QUERY_STRING' ? item : MANUAL_REQ ? QUERY_STRING_PLACEHOLDER : '';
|
|
5261
5034
|
});
|
|
5262
|
-
_context4.next =
|
|
5035
|
+
_context4.next = 5;
|
|
5263
5036
|
return fetchData(_params.join(','), finalRes(inputVal), inputVal);
|
|
5264
|
-
case
|
|
5037
|
+
case 5:
|
|
5265
5038
|
res = _context4.sent;
|
|
5266
5039
|
// Set an identifier indicating that the first request has been completed
|
|
5267
5040
|
if (!handleFirstFetchCompleted) setHandleFirstFetchCompleted(true);
|
|
5268
5041
|
return _context4.abrupt("return", res);
|
|
5269
|
-
case
|
|
5042
|
+
case 8:
|
|
5270
5043
|
case "end":
|
|
5271
5044
|
return _context4.stop();
|
|
5272
5045
|
}
|
|
@@ -5342,7 +5115,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5342
5115
|
if (listRef.current === null || !rootRef.current.classList.contains('active')) return;
|
|
5343
5116
|
|
|
5344
5117
|
// Avoid selecting options that are disabled
|
|
5345
|
-
var options = [].slice.call(listRef.current.querySelectorAll('.list-group-item:not(.hide):not(.custom-select-multi__control-option-item--select-all):not(.custom-select-multi__control-option-item--
|
|
5118
|
+
var options = [].slice.call(listRef.current.querySelectorAll('.list-group-item:not(.hide):not(.custom-select-multi__control-option-item--select-all):not(.custom-select-multi__control-option-item--clear)'));
|
|
5346
5119
|
var currentIndex = options.findIndex(function (e) {
|
|
5347
5120
|
return e === listRef.current.querySelector('.list-group-item.active');
|
|
5348
5121
|
});
|
|
@@ -5491,13 +5264,56 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5491
5264
|
//--------------
|
|
5492
5265
|
if (FIRST_REQUEST_AUTO) {
|
|
5493
5266
|
handleFirstFetch(value);
|
|
5267
|
+
} else {
|
|
5268
|
+
if (MULTI_SEL_VALID) {
|
|
5269
|
+
// Appropriate multi-item container height
|
|
5270
|
+
setTimeout(function () {
|
|
5271
|
+
adjustMultiControlContainerHeight();
|
|
5272
|
+
}, 0);
|
|
5273
|
+
}
|
|
5494
5274
|
}
|
|
5495
5275
|
|
|
5496
5276
|
// Forced assignment does not depend on "fetch" or "firstRequestAutoExe"
|
|
5497
5277
|
// Don't use "value.value && value.label" directly, if it is empty, it will be treated as FALSE
|
|
5498
|
-
if (
|
|
5499
|
-
|
|
5500
|
-
|
|
5278
|
+
if (chkValueExist(value)) {
|
|
5279
|
+
// ++++++++++++++++++++
|
|
5280
|
+
// Single selection
|
|
5281
|
+
// ++++++++++++++++++++
|
|
5282
|
+
if (_typeof(value) === 'object' && !Array.isArray(value)) {
|
|
5283
|
+
if (typeof value.value !== 'undefined' && value.value !== null) setControlValue(value.value);
|
|
5284
|
+
if (typeof value.label !== 'undefined' && value.label !== null) setControlLabel(formatIndentVal(value.label, INDENT_LAST_PLACEHOLDER));
|
|
5285
|
+
}
|
|
5286
|
+
|
|
5287
|
+
// ++++++++++++++++++++
|
|
5288
|
+
// Multiple selection
|
|
5289
|
+
// ++++++++++++++++++++
|
|
5290
|
+
if (MULTI_SEL_VALID) {
|
|
5291
|
+
if (chkValueExist(value) && Array.isArray(value)) {
|
|
5292
|
+
var _currentData = value;
|
|
5293
|
+
var _defaultValues = _currentData.map(function (v) {
|
|
5294
|
+
return v.value;
|
|
5295
|
+
});
|
|
5296
|
+
var _defaultLabels = _currentData.map(function (v) {
|
|
5297
|
+
return v.label;
|
|
5298
|
+
});
|
|
5299
|
+
setControlArr({
|
|
5300
|
+
labels: _defaultLabels,
|
|
5301
|
+
values: _defaultValues
|
|
5302
|
+
});
|
|
5303
|
+
}
|
|
5304
|
+
}
|
|
5305
|
+
} else {
|
|
5306
|
+
// ++++++++++++++++++++
|
|
5307
|
+
// Single selection & Multiple selection
|
|
5308
|
+
// ++++++++++++++++++++
|
|
5309
|
+
if (!FIRST_REQUEST_AUTO) {
|
|
5310
|
+
setControlValue('');
|
|
5311
|
+
setControlLabel('');
|
|
5312
|
+
setControlArr({
|
|
5313
|
+
labels: [],
|
|
5314
|
+
values: []
|
|
5315
|
+
});
|
|
5316
|
+
}
|
|
5501
5317
|
}
|
|
5502
5318
|
|
|
5503
5319
|
//
|
|
@@ -5520,6 +5336,56 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5520
5336
|
//--------------
|
|
5521
5337
|
if (FIRST_REQUEST_AUTO) {
|
|
5522
5338
|
handleFirstFetch(defaultValue);
|
|
5339
|
+
} else {
|
|
5340
|
+
if (MULTI_SEL_VALID) {
|
|
5341
|
+
// Appropriate multi-item container height
|
|
5342
|
+
setTimeout(function () {
|
|
5343
|
+
adjustMultiControlContainerHeight();
|
|
5344
|
+
}, 0);
|
|
5345
|
+
}
|
|
5346
|
+
}
|
|
5347
|
+
|
|
5348
|
+
// Forced assignment does not depend on "fetch" or "firstRequestAutoExe"
|
|
5349
|
+
// Don't use "value.value && value.label" directly, if it is empty, it will be treated as FALSE
|
|
5350
|
+
if (chkValueExist(defaultValue)) {
|
|
5351
|
+
// ++++++++++++++++++++
|
|
5352
|
+
// Single selection
|
|
5353
|
+
// ++++++++++++++++++++
|
|
5354
|
+
if (_typeof(defaultValue) === 'object' && !Array.isArray(defaultValue)) {
|
|
5355
|
+
if (typeof defaultValue.value !== 'undefined' && defaultValue.value !== null) setControlValue(defaultValue.value);
|
|
5356
|
+
if (typeof defaultValue.label !== 'undefined' && defaultValue.label !== null) setControlLabel(formatIndentVal(defaultValue.label, INDENT_LAST_PLACEHOLDER));
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
// ++++++++++++++++++++
|
|
5360
|
+
// Multiple selection
|
|
5361
|
+
// ++++++++++++++++++++
|
|
5362
|
+
if (MULTI_SEL_VALID) {
|
|
5363
|
+
if (chkValueExist(defaultValue) && Array.isArray(defaultValue)) {
|
|
5364
|
+
var _currentData = defaultValue;
|
|
5365
|
+
var _defaultValues = _currentData.map(function (v) {
|
|
5366
|
+
return v.value;
|
|
5367
|
+
});
|
|
5368
|
+
var _defaultLabels = _currentData.map(function (v) {
|
|
5369
|
+
return v.label;
|
|
5370
|
+
});
|
|
5371
|
+
setControlArr({
|
|
5372
|
+
labels: _defaultLabels,
|
|
5373
|
+
values: _defaultValues
|
|
5374
|
+
});
|
|
5375
|
+
}
|
|
5376
|
+
}
|
|
5377
|
+
} else {
|
|
5378
|
+
// ++++++++++++++++++++
|
|
5379
|
+
// Single selection & Multiple selection
|
|
5380
|
+
// ++++++++++++++++++++
|
|
5381
|
+
if (!FIRST_REQUEST_AUTO) {
|
|
5382
|
+
setControlValue('');
|
|
5383
|
+
setControlLabel('');
|
|
5384
|
+
setControlArr({
|
|
5385
|
+
labels: [],
|
|
5386
|
+
values: []
|
|
5387
|
+
});
|
|
5388
|
+
}
|
|
5523
5389
|
}
|
|
5524
5390
|
}
|
|
5525
5391
|
}, []);
|
|
@@ -5558,7 +5424,32 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5558
5424
|
'active focus': isOpen
|
|
5559
5425
|
}),
|
|
5560
5426
|
onKeyDown: handleKeyPressed
|
|
5561
|
-
},
|
|
5427
|
+
}, CLEAR_ICON && (!MULTI_SEL_VALID && controlValue ||
|
|
5428
|
+
// Single selection Control
|
|
5429
|
+
MULTI_SEL_VALID && controlArr.values.length > 0 // Multiple selection Control
|
|
5430
|
+
) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5431
|
+
className: "custom-select-clear-icon ".concat(MANUAL_REQ ? 'pos-offset' : '')
|
|
5432
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
5433
|
+
tabIndex: -1,
|
|
5434
|
+
type: "button",
|
|
5435
|
+
onClick: function onClick(e) {
|
|
5436
|
+
e.preventDefault();
|
|
5437
|
+
e.stopPropagation();
|
|
5438
|
+
if (MULTI_SEL_VALID) {
|
|
5439
|
+
updateOptionCheckboxes('remove');
|
|
5440
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectInputRef.current, valueInputRef.current, multipleSelectionCallback([], []));
|
|
5441
|
+
} else {
|
|
5442
|
+
handleClearValue();
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
5446
|
+
width: "12px",
|
|
5447
|
+
height: "12px",
|
|
5448
|
+
viewBox: "0 0 1024 1024"
|
|
5449
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5450
|
+
fill: "#000",
|
|
5451
|
+
d: "M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z"
|
|
5452
|
+
})))) : null, !MULTI_SEL_VALID ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
5562
5453
|
className: "position-relative"
|
|
5563
5454
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
|
|
5564
5455
|
ref: function ref(node) {
|
|
@@ -5853,17 +5744,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5853
5744
|
__html: controlArr.values.length === optionsData.length ? "".concat(MULTI_DESEL_LABEL) : "".concat(MULTI_SEL_LABEL)
|
|
5854
5745
|
},
|
|
5855
5746
|
onClick: handleSelectAll
|
|
5856
|
-
}))) : null, !MULTI_SEL_VALID ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null,
|
|
5747
|
+
}))) : null, !MULTI_SEL_VALID ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, CLEAR_TRIGGER_VALID ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5857
5748
|
tabIndex: -1,
|
|
5858
|
-
className: "list-group-item list-group-item-action border-start-0 border-end-0 text-secondary bg-light custom-select-multi__control-option-item--
|
|
5749
|
+
className: "list-group-item list-group-item-action border-start-0 border-end-0 text-secondary bg-light custom-select-multi__control-option-item--clear position-sticky top-0 z-3",
|
|
5859
5750
|
role: "tab"
|
|
5860
5751
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5861
5752
|
tabIndex: -1,
|
|
5862
5753
|
className: "btn btn-secondary",
|
|
5863
5754
|
dangerouslySetInnerHTML: {
|
|
5864
|
-
__html: "".concat(
|
|
5755
|
+
__html: "".concat(CLEAR_TRIGGER_LABEL)
|
|
5865
5756
|
},
|
|
5866
|
-
onClick:
|
|
5757
|
+
onClick: handleClearValue
|
|
5867
5758
|
}))) : null) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
5868
5759
|
tabIndex: -1,
|
|
5869
5760
|
type: "button",
|