funda-ui 4.7.163 → 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 +147 -277
- package/lib/cjs/Select/index.d.ts +6 -12
- package/lib/cjs/Select/index.js +147 -277
- package/lib/css/Select/index.css +32 -4
- package/lib/esm/Select/index.scss +41 -4
- package/lib/esm/Select/index.tsx +145 -112
- 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;
|
|
@@ -3931,9 +3754,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3931
3754
|
}).includes(val.toString());
|
|
3932
3755
|
};
|
|
3933
3756
|
|
|
3934
|
-
//
|
|
3935
|
-
var
|
|
3936
|
-
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';
|
|
3937
3760
|
var optionsFormatGroupOpt = function optionsFormatGroupOpt(allData) {
|
|
3938
3761
|
allData.forEach(function (item) {
|
|
3939
3762
|
if (typeof item.optgroup !== 'undefined') {
|
|
@@ -3970,7 +3793,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3970
3793
|
if (MULTI_SEL_VALID) {
|
|
3971
3794
|
updateOptionCheckboxes('remove');
|
|
3972
3795
|
} else {
|
|
3973
|
-
|
|
3796
|
+
handleClearValue();
|
|
3974
3797
|
}
|
|
3975
3798
|
selectInputRef.current.blur();
|
|
3976
3799
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
@@ -4113,16 +3936,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4113
3936
|
filterResQueryValue,
|
|
4114
3937
|
filterResQueryLabel,
|
|
4115
3938
|
_currentData,
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
_values,
|
|
3939
|
+
_defaultValues,
|
|
3940
|
+
_defaultLabels,
|
|
4119
3941
|
_filterRes2,
|
|
4120
3942
|
_filterResQueryValue,
|
|
4121
3943
|
_filterResQueryLabel,
|
|
4122
3944
|
_currentData2,
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
_values3,
|
|
3945
|
+
_defaultValues2,
|
|
3946
|
+
_defaultLabels2,
|
|
4126
3947
|
_args = arguments;
|
|
4127
3948
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4128
3949
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -4131,7 +3952,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4131
3952
|
// Determine whether the default value is user query input or default input
|
|
4132
3953
|
defaultValue = init ? valueToInputDefault : '';
|
|
4133
3954
|
if (!(_typeof(fetchFuncAsync) === 'object')) {
|
|
4134
|
-
_context.next =
|
|
3955
|
+
_context.next = 27;
|
|
4135
3956
|
break;
|
|
4136
3957
|
}
|
|
4137
3958
|
_context.next = 5;
|
|
@@ -4163,31 +3984,19 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4163
3984
|
|
|
4164
3985
|
// STEP 3: ===========
|
|
4165
3986
|
// value & label must be initialized
|
|
4166
|
-
filterRes = [];
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
}
|
|
4176
|
-
} else {
|
|
4177
|
-
// If the default value is label, match value
|
|
4178
|
-
filterResQueryValue = _ORGIN_DATA.filter(function (item) {
|
|
4179
|
-
return item.value == defaultValue;
|
|
4180
|
-
});
|
|
4181
|
-
filterResQueryLabel = _ORGIN_DATA.filter(function (item) {
|
|
4182
|
-
return item.label == defaultValue;
|
|
4183
|
-
});
|
|
4184
|
-
filterRes = filterResQueryValue;
|
|
4185
|
-
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;
|
|
4186
3996
|
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
}
|
|
3997
|
+
// if the default value is Object
|
|
3998
|
+
if (isObject(inputDefault) && filterRes.length === 0) {
|
|
3999
|
+
filterRes = [inputDefault];
|
|
4191
4000
|
}
|
|
4192
4001
|
|
|
4193
4002
|
// STEP 4: ===========
|
|
@@ -4215,27 +4024,18 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4215
4024
|
values: []
|
|
4216
4025
|
});
|
|
4217
4026
|
}
|
|
4218
|
-
if (chkValueExist(defaultValue) && (
|
|
4027
|
+
if (chkValueExist(defaultValue) && Array.isArray(defaultValue)) {
|
|
4219
4028
|
// initialize default values of Multiple selection
|
|
4220
|
-
_currentData =
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
_tempLabels.push(_currentData.labels[_index]);
|
|
4227
|
-
_tempValues.push(_currentData.values[_index]);
|
|
4228
|
-
}
|
|
4029
|
+
_currentData = defaultValue;
|
|
4030
|
+
_defaultValues = _currentData.map(function (v) {
|
|
4031
|
+
return v.value;
|
|
4032
|
+
});
|
|
4033
|
+
_defaultLabels = _currentData.map(function (v) {
|
|
4034
|
+
return v.label;
|
|
4229
4035
|
});
|
|
4230
|
-
_tempLabels = unique(_tempLabels.filter(function (v) {
|
|
4231
|
-
return v !== '';
|
|
4232
|
-
}));
|
|
4233
|
-
_tempValues = unique(_tempValues.filter(function (v) {
|
|
4234
|
-
return v !== '';
|
|
4235
|
-
}));
|
|
4236
4036
|
setControlArr({
|
|
4237
|
-
labels:
|
|
4238
|
-
values:
|
|
4037
|
+
labels: _defaultLabels,
|
|
4038
|
+
values: _defaultValues
|
|
4239
4039
|
});
|
|
4240
4040
|
}
|
|
4241
4041
|
|
|
@@ -4266,7 +4066,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4266
4066
|
|
|
4267
4067
|
//
|
|
4268
4068
|
return _context.abrupt("return", _ORGIN_DATA);
|
|
4269
|
-
case
|
|
4069
|
+
case 27:
|
|
4270
4070
|
// STEP 1: ===========
|
|
4271
4071
|
// Set hierarchical categories ( with sub-categories )
|
|
4272
4072
|
if (hierarchical) {
|
|
@@ -4279,8 +4079,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4279
4079
|
staticOptionsData = optionsCustomSelectFlat(staticOptionsData);
|
|
4280
4080
|
|
|
4281
4081
|
// STEP 3: ===========
|
|
4282
|
-
// value & label must be initialized
|
|
4283
|
-
|
|
4284
4082
|
// If the default value is label, match value
|
|
4285
4083
|
_filterRes2 = [];
|
|
4286
4084
|
_filterResQueryValue = staticOptionsData.filter(function (item) {
|
|
@@ -4322,27 +4120,18 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4322
4120
|
values: []
|
|
4323
4121
|
});
|
|
4324
4122
|
}
|
|
4325
|
-
if (chkValueExist(defaultValue) && (
|
|
4123
|
+
if (chkValueExist(defaultValue) && Array.isArray(defaultValue)) {
|
|
4326
4124
|
// initialize default values of Multiple selection
|
|
4327
|
-
_currentData2 =
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
_tempLabels2.push(_currentData2.labels[_index]);
|
|
4334
|
-
_tempValues2.push(_currentData2.values[_index]);
|
|
4335
|
-
}
|
|
4125
|
+
_currentData2 = defaultValue;
|
|
4126
|
+
_defaultValues2 = _currentData2.map(function (v) {
|
|
4127
|
+
return v.value;
|
|
4128
|
+
});
|
|
4129
|
+
_defaultLabels2 = _currentData2.map(function (v) {
|
|
4130
|
+
return v.label;
|
|
4336
4131
|
});
|
|
4337
|
-
_tempLabels2 = unique(_tempLabels2.filter(function (v) {
|
|
4338
|
-
return v !== '';
|
|
4339
|
-
}));
|
|
4340
|
-
_tempValues2 = unique(_tempValues2.filter(function (v) {
|
|
4341
|
-
return v !== '';
|
|
4342
|
-
}));
|
|
4343
4132
|
setControlArr({
|
|
4344
|
-
labels:
|
|
4345
|
-
values:
|
|
4133
|
+
labels: _defaultLabels2,
|
|
4134
|
+
values: _defaultValues2
|
|
4346
4135
|
});
|
|
4347
4136
|
}
|
|
4348
4137
|
|
|
@@ -4373,7 +4162,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4373
4162
|
|
|
4374
4163
|
//
|
|
4375
4164
|
return _context.abrupt("return", staticOptionsData);
|
|
4376
|
-
case
|
|
4165
|
+
case 43:
|
|
4377
4166
|
case "end":
|
|
4378
4167
|
return _context.stop();
|
|
4379
4168
|
}
|
|
@@ -4402,9 +4191,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4402
4191
|
if (el === null) return;
|
|
4403
4192
|
var activedItem = el.querySelectorAll(".list-group-item.".concat(!MULTI_SEL_VALID ? 'active' : 'item-selected'))[0];
|
|
4404
4193
|
if (typeof activedItem !== 'undefined') {
|
|
4405
|
-
var
|
|
4406
|
-
var
|
|
4407
|
-
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;
|
|
4408
4197
|
el.scrollTop = _latestScrollTop;
|
|
4409
4198
|
}
|
|
4410
4199
|
}
|
|
@@ -4669,7 +4458,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4669
4458
|
setIsOpen(false);
|
|
4670
4459
|
if (!MULTI_SEL_VALID) popwinPosHide();
|
|
4671
4460
|
if (MANUAL_REQ) {
|
|
4672
|
-
//
|
|
4461
|
+
// clear data
|
|
4673
4462
|
setOptionsData([]);
|
|
4674
4463
|
} else {
|
|
4675
4464
|
// restore data
|
|
@@ -4725,7 +4514,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4725
4514
|
}, 500);
|
|
4726
4515
|
}
|
|
4727
4516
|
if (MANUAL_REQ) {
|
|
4728
|
-
//
|
|
4517
|
+
// clear data
|
|
4729
4518
|
setOptionsData([]);
|
|
4730
4519
|
} else {
|
|
4731
4520
|
// restore data
|
|
@@ -5125,7 +4914,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5125
4914
|
// Fixed an out-of-focus issue
|
|
5126
4915
|
fixFocusStatus();
|
|
5127
4916
|
}
|
|
5128
|
-
function
|
|
4917
|
+
function handleClearValue(event) {
|
|
5129
4918
|
if (typeof event !== 'undefined') {
|
|
5130
4919
|
event.preventDefault();
|
|
5131
4920
|
event.stopPropagation(); /* REQUIRED */
|
|
@@ -5326,7 +5115,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5326
5115
|
if (listRef.current === null || !rootRef.current.classList.contains('active')) return;
|
|
5327
5116
|
|
|
5328
5117
|
// Avoid selecting options that are disabled
|
|
5329
|
-
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)'));
|
|
5330
5119
|
var currentIndex = options.findIndex(function (e) {
|
|
5331
5120
|
return e === listRef.current.querySelector('.list-group-item.active');
|
|
5332
5121
|
});
|
|
@@ -5487,23 +5276,36 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5487
5276
|
// Forced assignment does not depend on "fetch" or "firstRequestAutoExe"
|
|
5488
5277
|
// Don't use "value.value && value.label" directly, if it is empty, it will be treated as FALSE
|
|
5489
5278
|
if (chkValueExist(value)) {
|
|
5490
|
-
|
|
5491
|
-
|
|
5279
|
+
// ++++++++++++++++++++
|
|
5280
|
+
// Single selection
|
|
5281
|
+
// ++++++++++++++++++++
|
|
5282
|
+
if (_typeof(value) === 'object' && !Array.isArray(value)) {
|
|
5492
5283
|
if (typeof value.value !== 'undefined' && value.value !== null) setControlValue(value.value);
|
|
5493
5284
|
if (typeof value.label !== 'undefined' && value.label !== null) setControlLabel(formatIndentVal(value.label, INDENT_LAST_PLACEHOLDER));
|
|
5494
5285
|
}
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
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
|
+
});
|
|
5500
5299
|
setControlArr({
|
|
5501
|
-
labels:
|
|
5502
|
-
values:
|
|
5300
|
+
labels: _defaultLabels,
|
|
5301
|
+
values: _defaultValues
|
|
5503
5302
|
});
|
|
5504
5303
|
}
|
|
5505
5304
|
}
|
|
5506
5305
|
} else {
|
|
5306
|
+
// ++++++++++++++++++++
|
|
5307
|
+
// Single selection & Multiple selection
|
|
5308
|
+
// ++++++++++++++++++++
|
|
5507
5309
|
if (!FIRST_REQUEST_AUTO) {
|
|
5508
5310
|
setControlValue('');
|
|
5509
5311
|
setControlLabel('');
|
|
@@ -5542,6 +5344,49 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5542
5344
|
}, 0);
|
|
5543
5345
|
}
|
|
5544
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
|
+
}
|
|
5389
|
+
}
|
|
5545
5390
|
}
|
|
5546
5391
|
}, []);
|
|
5547
5392
|
|
|
@@ -5579,7 +5424,32 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5579
5424
|
'active focus': isOpen
|
|
5580
5425
|
}),
|
|
5581
5426
|
onKeyDown: handleKeyPressed
|
|
5582
|
-
},
|
|
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", {
|
|
5583
5453
|
className: "position-relative"
|
|
5584
5454
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
|
|
5585
5455
|
ref: function ref(node) {
|
|
@@ -5874,17 +5744,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5874
5744
|
__html: controlArr.values.length === optionsData.length ? "".concat(MULTI_DESEL_LABEL) : "".concat(MULTI_SEL_LABEL)
|
|
5875
5745
|
},
|
|
5876
5746
|
onClick: handleSelectAll
|
|
5877
|
-
}))) : 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", {
|
|
5878
5748
|
tabIndex: -1,
|
|
5879
|
-
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",
|
|
5880
5750
|
role: "tab"
|
|
5881
5751
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5882
5752
|
tabIndex: -1,
|
|
5883
5753
|
className: "btn btn-secondary",
|
|
5884
5754
|
dangerouslySetInnerHTML: {
|
|
5885
|
-
__html: "".concat(
|
|
5755
|
+
__html: "".concat(CLEAR_TRIGGER_LABEL)
|
|
5886
5756
|
},
|
|
5887
|
-
onClick:
|
|
5757
|
+
onClick: handleClearValue
|
|
5888
5758
|
}))) : null) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
5889
5759
|
tabIndex: -1,
|
|
5890
5760
|
type: "button",
|