funda-ui 4.7.125 → 4.7.150
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/CascadingSelect/index.css +15 -4
- package/CascadingSelect/index.d.ts +2 -0
- package/CascadingSelect/index.js +294 -22
- package/CascadingSelectE2E/index.css +15 -4
- package/CascadingSelectE2E/index.d.ts +2 -0
- package/CascadingSelectE2E/index.js +300 -28
- package/Checkbox/index.js +4 -2
- package/LiveSearch/index.js +2 -1
- package/README.md +1 -2
- package/Refresher/index.d.ts +22 -0
- package/Refresher/index.js +564 -0
- package/Select/index.css +33 -0
- package/Select/index.d.ts +1 -0
- package/Select/index.js +350 -39
- package/SplitterPanel/index.js +67 -3
- package/Switch/index.js +4 -2
- package/Utils/format-string.d.ts +2 -1
- package/Utils/format-string.js +22 -12
- package/Utils/time.d.ts +3 -3
- package/Utils/useIsMobile.js +67 -3
- package/all.d.ts +1 -0
- package/all.js +1 -0
- package/lib/cjs/CascadingSelect/index.d.ts +2 -0
- package/lib/cjs/CascadingSelect/index.js +294 -22
- package/lib/cjs/CascadingSelectE2E/index.d.ts +2 -0
- package/lib/cjs/CascadingSelectE2E/index.js +300 -28
- package/lib/cjs/Checkbox/index.js +4 -2
- package/lib/cjs/LiveSearch/index.js +2 -1
- package/lib/cjs/Refresher/index.d.ts +22 -0
- package/lib/cjs/Refresher/index.js +564 -0
- package/lib/cjs/Select/index.d.ts +1 -0
- package/lib/cjs/Select/index.js +350 -39
- package/lib/cjs/SplitterPanel/index.js +67 -3
- package/lib/cjs/Switch/index.js +4 -2
- package/lib/cjs/Utils/format-string.d.ts +2 -1
- package/lib/cjs/Utils/format-string.js +22 -12
- package/lib/cjs/Utils/time.d.ts +3 -3
- package/lib/cjs/Utils/useIsMobile.js +67 -3
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/css/CascadingSelect/index.css +15 -4
- package/lib/css/CascadingSelectE2E/index.css +15 -4
- package/lib/css/Select/index.css +33 -0
- package/lib/esm/CascadingSelect/index.scss +22 -7
- package/lib/esm/CascadingSelect/index.tsx +49 -1
- package/lib/esm/CascadingSelectE2E/Group.tsx +1 -0
- package/lib/esm/CascadingSelectE2E/index.scss +23 -6
- package/lib/esm/CascadingSelectE2E/index.tsx +53 -1
- package/lib/esm/Checkbox/index.tsx +5 -3
- package/lib/esm/LiveSearch/index.tsx +2 -1
- package/lib/esm/Refresher/index.tsx +121 -0
- package/lib/esm/Select/index.scss +43 -2
- package/lib/esm/Select/index.tsx +81 -24
- package/lib/esm/Select/utils/func.ts +0 -10
- package/lib/esm/Switch/index.tsx +4 -2
- package/lib/esm/Utils/hooks/useIsMobile.tsx +88 -5
- package/lib/esm/Utils/libs/format-string.ts +22 -12
- package/lib/esm/Utils/libs/time.ts +6 -6
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
package/Select/index.js
CHANGED
|
@@ -1121,6 +1121,236 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1121
1121
|
|
|
1122
1122
|
/***/ }),
|
|
1123
1123
|
|
|
1124
|
+
/***/ 933:
|
|
1125
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1126
|
+
|
|
1127
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
1128
|
+
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); }
|
|
1129
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
1130
|
+
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),
|
|
1131
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
1132
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
1133
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
1134
|
+
})(this, function () {
|
|
1135
|
+
return (/******/function () {
|
|
1136
|
+
// webpackBootstrap
|
|
1137
|
+
/******/
|
|
1138
|
+
"use strict";
|
|
1139
|
+
|
|
1140
|
+
/******/ // The require scope
|
|
1141
|
+
/******/
|
|
1142
|
+
var __nested_webpack_require_987__ = {};
|
|
1143
|
+
/******/
|
|
1144
|
+
/************************************************************************/
|
|
1145
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1146
|
+
/******/
|
|
1147
|
+
(function () {
|
|
1148
|
+
/******/ // define getter functions for harmony exports
|
|
1149
|
+
/******/__nested_webpack_require_987__.d = function (exports, definition) {
|
|
1150
|
+
/******/for (var key in definition) {
|
|
1151
|
+
/******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
|
|
1152
|
+
/******/Object.defineProperty(exports, key, {
|
|
1153
|
+
enumerable: true,
|
|
1154
|
+
get: definition[key]
|
|
1155
|
+
});
|
|
1156
|
+
/******/
|
|
1157
|
+
}
|
|
1158
|
+
/******/
|
|
1159
|
+
}
|
|
1160
|
+
/******/
|
|
1161
|
+
};
|
|
1162
|
+
/******/
|
|
1163
|
+
})();
|
|
1164
|
+
/******/
|
|
1165
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1166
|
+
/******/
|
|
1167
|
+
(function () {
|
|
1168
|
+
/******/__nested_webpack_require_987__.o = function (obj, prop) {
|
|
1169
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1170
|
+
};
|
|
1171
|
+
/******/
|
|
1172
|
+
})();
|
|
1173
|
+
/******/
|
|
1174
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1175
|
+
/******/
|
|
1176
|
+
(function () {
|
|
1177
|
+
/******/ // define __esModule on exports
|
|
1178
|
+
/******/__nested_webpack_require_987__.r = function (exports) {
|
|
1179
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1180
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
1181
|
+
value: 'Module'
|
|
1182
|
+
});
|
|
1183
|
+
/******/
|
|
1184
|
+
}
|
|
1185
|
+
/******/
|
|
1186
|
+
Object.defineProperty(exports, '__esModule', {
|
|
1187
|
+
value: true
|
|
1188
|
+
});
|
|
1189
|
+
/******/
|
|
1190
|
+
};
|
|
1191
|
+
/******/
|
|
1192
|
+
})();
|
|
1193
|
+
/******/
|
|
1194
|
+
/************************************************************************/
|
|
1195
|
+
var __webpack_exports__ = {};
|
|
1196
|
+
__nested_webpack_require_987__.r(__webpack_exports__);
|
|
1197
|
+
/* harmony export */
|
|
1198
|
+
__nested_webpack_require_987__.d(__webpack_exports__, {
|
|
1199
|
+
/* harmony export */"htmlToPlain": function htmlToPlain() {
|
|
1200
|
+
return (/* binding */_htmlToPlain
|
|
1201
|
+
);
|
|
1202
|
+
},
|
|
1203
|
+
/* harmony export */"multiSpacesToSingle": function multiSpacesToSingle() {
|
|
1204
|
+
return (/* binding */_multiSpacesToSingle
|
|
1205
|
+
);
|
|
1206
|
+
},
|
|
1207
|
+
/* harmony export */"onlyNumAndLetter": function onlyNumAndLetter() {
|
|
1208
|
+
return (/* binding */_onlyNumAndLetter
|
|
1209
|
+
);
|
|
1210
|
+
},
|
|
1211
|
+
/* harmony export */"removeFirstLastSlash": function removeFirstLastSlash() {
|
|
1212
|
+
return (/* binding */_removeFirstLastSlash
|
|
1213
|
+
);
|
|
1214
|
+
},
|
|
1215
|
+
/* harmony export */"removeFirstSlash": function removeFirstSlash() {
|
|
1216
|
+
return (/* binding */_removeFirstSlash
|
|
1217
|
+
);
|
|
1218
|
+
},
|
|
1219
|
+
/* harmony export */"removeTrailingSlash": function removeTrailingSlash() {
|
|
1220
|
+
return (/* binding */_removeTrailingSlash
|
|
1221
|
+
);
|
|
1222
|
+
},
|
|
1223
|
+
/* harmony export */"rmAllSpace": function rmAllSpace() {
|
|
1224
|
+
return (/* binding */_rmAllSpace
|
|
1225
|
+
);
|
|
1226
|
+
},
|
|
1227
|
+
/* harmony export */"rmSpec": function rmSpec() {
|
|
1228
|
+
return (/* binding */_rmSpec
|
|
1229
|
+
);
|
|
1230
|
+
},
|
|
1231
|
+
/* harmony export */"stripTagsAndContent": function stripTagsAndContent() {
|
|
1232
|
+
return (/* binding */_stripTagsAndContent
|
|
1233
|
+
);
|
|
1234
|
+
},
|
|
1235
|
+
/* harmony export */"trimAll": function trimAll() {
|
|
1236
|
+
return (/* binding */_trimAll
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
/* harmony export */
|
|
1240
|
+
});
|
|
1241
|
+
/**
|
|
1242
|
+
* String formatting utility functions
|
|
1243
|
+
*/
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Remove all special characters except space from a string
|
|
1247
|
+
* @param {string} input - The input string to process
|
|
1248
|
+
* @returns {string} The processed string
|
|
1249
|
+
*/
|
|
1250
|
+
function _rmSpec(input) {
|
|
1251
|
+
return input === null || input === void 0 ? void 0 : input.replace(/[^a-zA-Z0-9 \u4E00-\u9FFF]/g, "");
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* Allow only numbers and letters in a string
|
|
1256
|
+
* @param {string} input - The input string to process
|
|
1257
|
+
* @returns {string} The processed string
|
|
1258
|
+
*/
|
|
1259
|
+
function _onlyNumAndLetter(input) {
|
|
1260
|
+
return input === null || input === void 0 ? void 0 : input.replace(/[^a-zA-Z0-9 ]/g, "");
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Remove all spaces including those in the middle
|
|
1265
|
+
* @param {string} input - The input string to process
|
|
1266
|
+
* @returns {string} The processed string
|
|
1267
|
+
*/
|
|
1268
|
+
function _rmAllSpace(input) {
|
|
1269
|
+
return input === null || input === void 0 ? void 0 : input.replace(/\s/g, "");
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Remove whitespace from both sides of a string
|
|
1274
|
+
* @param {string} input - The input string to process
|
|
1275
|
+
* @returns {string} The processed string
|
|
1276
|
+
*/
|
|
1277
|
+
function _trimAll(input) {
|
|
1278
|
+
return input === null || input === void 0 ? void 0 : input.replace(/(^\s+)|(\s+$)/g, "");
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* Replace multiple spaces with a single space
|
|
1283
|
+
* @param {string} input - The input string to process
|
|
1284
|
+
* @returns {string} The processed string
|
|
1285
|
+
*/
|
|
1286
|
+
function _multiSpacesToSingle(input) {
|
|
1287
|
+
return input === null || input === void 0 ? void 0 : input.replace(/\s+(\W)/g, ' ');
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Convert HTML text to plain text (Remove html tag content)
|
|
1292
|
+
* @param {string} input - The input string to process
|
|
1293
|
+
* @returns {string} The processed string
|
|
1294
|
+
*/
|
|
1295
|
+
/*
|
|
1296
|
+
Examples:
|
|
1297
|
+
console.log(htmlToPlain("<p>Hello <b>World</b></p>")); // Hello World
|
|
1298
|
+
*/
|
|
1299
|
+
function _htmlToPlain(input) {
|
|
1300
|
+
return input === null || input === void 0 ? void 0 : input.replace(/(<([^>]+)>)/ig, '');
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Strip HTML tags and their content
|
|
1305
|
+
* !!!Important: It will remove nested tags
|
|
1306
|
+
* @param {string} input - The input string to process
|
|
1307
|
+
* @returns {string} The processed string
|
|
1308
|
+
*/
|
|
1309
|
+
/*
|
|
1310
|
+
Examples:
|
|
1311
|
+
console.log(stripTagsAndContent("<p>Hello <b>World</b></p>")); // World
|
|
1312
|
+
console.log(stripTagsAndContent("Hello <b>World</b>")); // Hello
|
|
1313
|
+
*/
|
|
1314
|
+
function _stripTagsAndContent(input) {
|
|
1315
|
+
return input === null || input === void 0 ? void 0 : input.replace(/<\/?[^>]+(>|$)(.*?)<\/?[^>]+(>|$)/ig, '');
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Remove first and last slash from a URL
|
|
1320
|
+
* @param {string} input - The input URL to process
|
|
1321
|
+
* @returns {string} The processed URL
|
|
1322
|
+
*/
|
|
1323
|
+
function _removeFirstLastSlash(input) {
|
|
1324
|
+
return input === null || input === void 0 ? void 0 : input.replace(/^\/|\/$/g, '');
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* Remove trailing slash from a URL
|
|
1329
|
+
* @param {string} input - The input URL to process
|
|
1330
|
+
* @returns {string} The processed URL
|
|
1331
|
+
*/
|
|
1332
|
+
function _removeTrailingSlash(input) {
|
|
1333
|
+
return input === null || input === void 0 ? void 0 : input.replace(/\/+$/, '');
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* Remove first slash from a URL
|
|
1338
|
+
* @param {string} input - The input URL to process
|
|
1339
|
+
* @returns {string} The processed URL
|
|
1340
|
+
*/
|
|
1341
|
+
function _removeFirstSlash(input) {
|
|
1342
|
+
return input === null || input === void 0 ? void 0 : input.replace(/\//, '');
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
/******/
|
|
1346
|
+
return __webpack_exports__;
|
|
1347
|
+
/******/
|
|
1348
|
+
}()
|
|
1349
|
+
);
|
|
1350
|
+
});
|
|
1351
|
+
|
|
1352
|
+
/***/ }),
|
|
1353
|
+
|
|
1124
1354
|
/***/ 767:
|
|
1125
1355
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1126
1356
|
|
|
@@ -3372,15 +3602,6 @@ function unique(arr) {
|
|
|
3372
3602
|
return Array.from(new Set(arr));
|
|
3373
3603
|
}
|
|
3374
3604
|
|
|
3375
|
-
/**
|
|
3376
|
-
* Remove html tag content
|
|
3377
|
-
* @param {string | number} str
|
|
3378
|
-
* @returns {string}
|
|
3379
|
-
*/
|
|
3380
|
-
function stripHTML(str) {
|
|
3381
|
-
return String(str).replace(/<\/?[^>]+(>|$)(.*?)<\/?[^>]+(>|$)/ig, '');
|
|
3382
|
-
}
|
|
3383
|
-
|
|
3384
3605
|
/**
|
|
3385
3606
|
* Remove a specific item from an array
|
|
3386
3607
|
* @param {array} arr
|
|
@@ -3471,10 +3692,12 @@ var inputsCalculation = __webpack_require__(954);
|
|
|
3471
3692
|
var object = __webpack_require__(575);
|
|
3472
3693
|
// EXTERNAL MODULE: ../Utils/dist/cjs/bodyScrollLock.js
|
|
3473
3694
|
var bodyScrollLock = __webpack_require__(70);
|
|
3695
|
+
// EXTERNAL MODULE: ../Utils/dist/cjs/format-string.js
|
|
3696
|
+
var format_string = __webpack_require__(933);
|
|
3474
3697
|
// EXTERNAL MODULE: ../Utils/dist/cjs/cls.js
|
|
3475
3698
|
var cls = __webpack_require__(188);
|
|
3476
3699
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
3477
|
-
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", "cleanTrigger", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "firstRequestAutoExec", "fetchTrigger", "fetchTriggerForDefaultData", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus", "onKeyPressed"];
|
|
3700
|
+
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", "cleanTrigger", "loader", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "firstRequestAutoExec", "fetchTrigger", "fetchTriggerForDefaultData", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus", "onKeyPressed"];
|
|
3478
3701
|
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; }
|
|
3479
3702
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3480
3703
|
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."); }
|
|
@@ -3515,6 +3738,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
3515
3738
|
// Destroys body scroll locking
|
|
3516
3739
|
|
|
3517
3740
|
|
|
3741
|
+
|
|
3518
3742
|
var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, externalRef) {
|
|
3519
3743
|
var contentRef = props.contentRef,
|
|
3520
3744
|
popupRef = props.popupRef,
|
|
@@ -3541,6 +3765,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3541
3765
|
spellCheck = props.spellCheck,
|
|
3542
3766
|
options = props.options,
|
|
3543
3767
|
cleanTrigger = props.cleanTrigger,
|
|
3768
|
+
loader = props.loader,
|
|
3544
3769
|
lockBodyScroll = props.lockBodyScroll,
|
|
3545
3770
|
hierarchical = props.hierarchical,
|
|
3546
3771
|
indentation = props.indentation,
|
|
@@ -3569,6 +3794,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3569
3794
|
onFocus = props.onFocus,
|
|
3570
3795
|
onKeyPressed = props.onKeyPressed,
|
|
3571
3796
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
3797
|
+
var QUERY_STRING_PLACEHOLDER = '------'; // Invalid parameters for the first automatic request
|
|
3572
3798
|
var DEPTH = depth || 1055; // the default value same as bootstrap
|
|
3573
3799
|
var MANUAL_REQ = typeof fetchTrigger !== 'undefined' && fetchTrigger === true ? true : false; // Manual requests
|
|
3574
3800
|
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)
|
|
@@ -3591,7 +3817,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3591
3817
|
var listRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3592
3818
|
var listContentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3593
3819
|
var optionsRes = options ? (0,initDefaultOptions.isJSON)(options) ? JSON.parse(options) : options : [];
|
|
3594
|
-
var LIST_CONTAINER_MAX_HEIGHT =
|
|
3820
|
+
var LIST_CONTAINER_MAX_HEIGHT = 300;
|
|
3595
3821
|
var keyboardSelectedItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3596
3822
|
|
|
3597
3823
|
// return a array of options
|
|
@@ -3610,6 +3836,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3610
3836
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
3611
3837
|
hasErr = _useState6[0],
|
|
3612
3838
|
setHasErr = _useState6[1];
|
|
3839
|
+
|
|
3840
|
+
// Set the final result
|
|
3613
3841
|
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
|
|
3614
3842
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
3615
3843
|
controlLabel = _useState8[0],
|
|
@@ -3618,6 +3846,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3618
3846
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
3619
3847
|
controlValue = _useState10[0],
|
|
3620
3848
|
setControlValue = _useState10[1];
|
|
3849
|
+
|
|
3850
|
+
//
|
|
3621
3851
|
var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
|
|
3622
3852
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
3623
3853
|
controlTempValue = _useState12[0],
|
|
@@ -3634,13 +3864,23 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3634
3864
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
3635
3865
|
firstRequestExecuted = _useState18[0],
|
|
3636
3866
|
setFirstRequestExecuted = _useState18[1];
|
|
3867
|
+
var _useState19 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3868
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
3869
|
+
handleFirstFetchCompleted = _useState20[0],
|
|
3870
|
+
setHandleFirstFetchCompleted = _useState20[1];
|
|
3871
|
+
|
|
3872
|
+
// filter status
|
|
3873
|
+
var _useState21 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3874
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
3875
|
+
filterItemsHasNoMatchData = _useState22[0],
|
|
3876
|
+
setFilterItemsHasNoMatchData = _useState22[1];
|
|
3637
3877
|
|
|
3638
3878
|
// blinking cursor
|
|
3639
3879
|
var BLINKING_CURSOR_STR = '|';
|
|
3640
|
-
var
|
|
3641
|
-
|
|
3642
|
-
blinkingPosStart =
|
|
3643
|
-
setBlinkingPosStart =
|
|
3880
|
+
var _useState23 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
3881
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
3882
|
+
blinkingPosStart = _useState24[0],
|
|
3883
|
+
setBlinkingPosStart = _useState24[1];
|
|
3644
3884
|
var blinkingPosFauxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3645
3885
|
var blinkingCursorPosDivRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3646
3886
|
var selectedSign = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
@@ -3653,13 +3893,13 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3653
3893
|
allItemsLabel: 'All Content ({num})',
|
|
3654
3894
|
noneLabel: 'No items selected'
|
|
3655
3895
|
};
|
|
3656
|
-
var
|
|
3896
|
+
var _useState25 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
|
3657
3897
|
labels: [],
|
|
3658
3898
|
values: []
|
|
3659
3899
|
}),
|
|
3660
|
-
|
|
3661
|
-
controlArr =
|
|
3662
|
-
setControlArr =
|
|
3900
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
3901
|
+
controlArr = _useState26[0],
|
|
3902
|
+
setControlArr = _useState26[1];
|
|
3663
3903
|
var listContainerHeightLimit = function listContainerHeightLimit(num) {
|
|
3664
3904
|
var res = num;
|
|
3665
3905
|
if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
|
|
@@ -3819,6 +4059,10 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3819
4059
|
return filterRes();
|
|
3820
4060
|
};
|
|
3821
4061
|
if (fetchUpdate) {
|
|
4062
|
+
// update filter status
|
|
4063
|
+
setFilterItemsHasNoMatchData(false);
|
|
4064
|
+
|
|
4065
|
+
// Make a request
|
|
3822
4066
|
handleFetch(val).then(function (response) {
|
|
3823
4067
|
_orginalData = response;
|
|
3824
4068
|
var _filterRes = update(_orginalData);
|
|
@@ -4156,6 +4400,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4156
4400
|
}
|
|
4157
4401
|
function adjustMultiControlContainerHeight() {
|
|
4158
4402
|
var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
4403
|
+
if (rootMultiRef.current === null) return;
|
|
4159
4404
|
setTimeout(function () {
|
|
4160
4405
|
// Sometimes you may get 0, you need to judge
|
|
4161
4406
|
if (MULTI_SEL_VALID && rootMultiRef.current.clientHeight > 0) {
|
|
@@ -4219,7 +4464,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4219
4464
|
|
|
4220
4465
|
// You need to wait for the height of the pop-up container to be set
|
|
4221
4466
|
// Detect position、
|
|
4222
|
-
if (window.innerHeight - _triggerBox.top >
|
|
4467
|
+
if (window.innerHeight - _triggerBox.top > 100) {
|
|
4223
4468
|
targetPos = 'bottom';
|
|
4224
4469
|
} else {
|
|
4225
4470
|
targetPos = 'top';
|
|
@@ -4340,14 +4585,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4340
4585
|
});
|
|
4341
4586
|
|
|
4342
4587
|
// nomatch & button of select all
|
|
4343
|
-
var
|
|
4588
|
+
var _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
4344
4589
|
var _btnSelectAll = listContentRef.current.querySelector('.custom-select-multi__control-option-item--select-all');
|
|
4345
|
-
|
|
4590
|
+
_noDataDiv.classList.add('hide');
|
|
4346
4591
|
if (_btnSelectAll !== null) _btnSelectAll.classList.remove('hide');
|
|
4347
4592
|
}
|
|
4348
4593
|
}
|
|
4349
4594
|
function popwinFilterItems(val) {
|
|
4350
4595
|
if (listContentRef.current === null) return;
|
|
4596
|
+
var invisibleItems = 0;
|
|
4351
4597
|
[].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item')).forEach(function (node) {
|
|
4352
4598
|
// Avoid fatal errors causing page crashes
|
|
4353
4599
|
var _queryString = typeof node.dataset.querystring !== 'undefined' && node.dataset.querystring !== null ? node.dataset.querystring : '';
|
|
@@ -4363,20 +4609,28 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4363
4609
|
}
|
|
4364
4610
|
});
|
|
4365
4611
|
|
|
4612
|
+
// Determine if all options are hidden
|
|
4613
|
+
var allHidden = [].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item')).every(function (node) {
|
|
4614
|
+
return node.classList.contains('hide');
|
|
4615
|
+
});
|
|
4616
|
+
|
|
4366
4617
|
// no data label
|
|
4367
4618
|
popwinNoMatchInit();
|
|
4368
4619
|
|
|
4369
4620
|
// display all filtered items
|
|
4370
4621
|
var _btnSelectAll = listContentRef.current.querySelector('.custom-select-multi__control-option-item--select-all');
|
|
4371
|
-
var
|
|
4622
|
+
var _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
4372
4623
|
if ((val === null ? '' : val).replace(/\s/g, "") === '') {
|
|
4373
4624
|
[].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item')).forEach(function (node) {
|
|
4374
4625
|
node.classList.remove('hide');
|
|
4375
4626
|
});
|
|
4376
|
-
|
|
4627
|
+
_noDataDiv.classList.add('hide');
|
|
4377
4628
|
if (_btnSelectAll !== null) _btnSelectAll.classList.remove('hide');
|
|
4378
4629
|
}
|
|
4379
4630
|
|
|
4631
|
+
// filter status
|
|
4632
|
+
setFilterItemsHasNoMatchData(allHidden);
|
|
4633
|
+
|
|
4380
4634
|
// Appropriate list container height
|
|
4381
4635
|
popwinContainerHeightAdjust();
|
|
4382
4636
|
}
|
|
@@ -4398,7 +4652,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4398
4652
|
function popwinNoMatchInit() {
|
|
4399
4653
|
if (listContentRef.current === null) return;
|
|
4400
4654
|
var _btnSelectAll = listContentRef.current.querySelector('.custom-select-multi__control-option-item--select-all');
|
|
4401
|
-
var
|
|
4655
|
+
var _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
4402
4656
|
var emptyFieldsCheck = [].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item')).every(function (node) {
|
|
4403
4657
|
if (!node.classList.contains('hide')) {
|
|
4404
4658
|
return false;
|
|
@@ -4406,10 +4660,10 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4406
4660
|
return true;
|
|
4407
4661
|
});
|
|
4408
4662
|
if (emptyFieldsCheck) {
|
|
4409
|
-
|
|
4663
|
+
_noDataDiv.classList.remove('hide');
|
|
4410
4664
|
if (_btnSelectAll !== null) _btnSelectAll.classList.add('hide');
|
|
4411
4665
|
} else {
|
|
4412
|
-
|
|
4666
|
+
_noDataDiv.classList.add('hide');
|
|
4413
4667
|
if (_btnSelectAll !== null) _btnSelectAll.classList.remove('hide');
|
|
4414
4668
|
}
|
|
4415
4669
|
}
|
|
@@ -4438,6 +4692,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4438
4692
|
// update temporary value
|
|
4439
4693
|
setControlTempValue(null);
|
|
4440
4694
|
|
|
4695
|
+
// update filter status
|
|
4696
|
+
setFilterItemsHasNoMatchData(false);
|
|
4697
|
+
|
|
4441
4698
|
// Unlocks the page
|
|
4442
4699
|
if (LOCK_BODY_SCROLL) (0,bodyScrollLock.enableBodyScroll)(document.querySelector('body'));
|
|
4443
4700
|
}
|
|
@@ -4451,8 +4708,13 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4451
4708
|
handleFirstFetch(curValue).then(function (response) {
|
|
4452
4709
|
if (response.length > 0) {
|
|
4453
4710
|
// nomatch
|
|
4454
|
-
var
|
|
4455
|
-
|
|
4711
|
+
var _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
4712
|
+
_noDataDiv.classList.add('hide');
|
|
4713
|
+
|
|
4714
|
+
// After the data is loaded, reinitialize the pop-up window position and height
|
|
4715
|
+
setTimeout(function () {
|
|
4716
|
+
popwinPosInit();
|
|
4717
|
+
}, 0);
|
|
4456
4718
|
}
|
|
4457
4719
|
});
|
|
4458
4720
|
|
|
@@ -4898,6 +5160,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4898
5160
|
|
|
4899
5161
|
// update temporary value
|
|
4900
5162
|
setControlTempValue(null);
|
|
5163
|
+
|
|
5164
|
+
// update filter status
|
|
5165
|
+
setFilterItemsHasNoMatchData(false);
|
|
4901
5166
|
}
|
|
4902
5167
|
function handleMultiControlItemRemove(event) {
|
|
4903
5168
|
event.preventDefault();
|
|
@@ -4992,14 +5257,16 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4992
5257
|
inputVal = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;
|
|
4993
5258
|
_oparams = fetchFuncMethodParams || [];
|
|
4994
5259
|
_params = _oparams.map(function (item) {
|
|
4995
|
-
return item !== '$QUERY_STRING' ? item : MANUAL_REQ ?
|
|
5260
|
+
return item !== '$QUERY_STRING' ? item : MANUAL_REQ ? QUERY_STRING_PLACEHOLDER : '';
|
|
4996
5261
|
});
|
|
4997
5262
|
_context4.next = 5;
|
|
4998
5263
|
return fetchData(_params.join(','), finalRes(inputVal), inputVal);
|
|
4999
5264
|
case 5:
|
|
5000
5265
|
res = _context4.sent;
|
|
5266
|
+
// Set an identifier indicating that the first request has been completed
|
|
5267
|
+
if (!handleFirstFetchCompleted) setHandleFirstFetchCompleted(true);
|
|
5001
5268
|
return _context4.abrupt("return", res);
|
|
5002
|
-
case
|
|
5269
|
+
case 8:
|
|
5003
5270
|
case "end":
|
|
5004
5271
|
return _context4.stop();
|
|
5005
5272
|
}
|
|
@@ -5220,6 +5487,16 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5220
5487
|
if (FIRST_REQUEST_AUTO) {
|
|
5221
5488
|
handleFirstFetch(value);
|
|
5222
5489
|
}
|
|
5490
|
+
|
|
5491
|
+
// Forced assignment does not depend on "fetch" or "firstRequestAutoExe"
|
|
5492
|
+
// Don't use "value.value && value.label" directly, if it is empty, it will be treated as FALSE
|
|
5493
|
+
if (value && _typeof(value) === 'object') {
|
|
5494
|
+
if (typeof value.value !== 'undefined' && value.value !== null) setControlValue(value.value);
|
|
5495
|
+
if (typeof value.label !== 'undefined' && value.label !== null) setControlLabel(formatIndentVal(value.label, INDENT_LAST_PLACEHOLDER));
|
|
5496
|
+
}
|
|
5497
|
+
|
|
5498
|
+
//
|
|
5499
|
+
//--------------
|
|
5223
5500
|
return function () {
|
|
5224
5501
|
if (LOCK_BODY_SCROLL) (0,bodyScrollLock.clearAllBodyScrollLocks)();
|
|
5225
5502
|
};
|
|
@@ -5310,10 +5587,10 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5310
5587
|
required: required || null,
|
|
5311
5588
|
readOnly: INPUT_READONLY,
|
|
5312
5589
|
value: controlTempValue || controlTempValue === '' ? controlTempValue : MULTI_SEL_VALID ? VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(formatIndentVal(controlArr.labels, INDENT_LAST_PLACEHOLDER).map(function (v) {
|
|
5313
|
-
return
|
|
5590
|
+
return (0,format_string.stripTagsAndContent)(v);
|
|
5314
5591
|
})) : formatIndentVal(controlArr.labels, INDENT_LAST_PLACEHOLDER).map(function (v) {
|
|
5315
|
-
return
|
|
5316
|
-
}).join(',') :
|
|
5592
|
+
return (0,format_string.stripTagsAndContent)(v);
|
|
5593
|
+
}).join(',') : (0,format_string.stripTagsAndContent)(controlLabel) // do not use `defaultValue`
|
|
5317
5594
|
,
|
|
5318
5595
|
|
|
5319
5596
|
style: _objectSpread({
|
|
@@ -5358,9 +5635,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5358
5635
|
})
|
|
5359
5636
|
}, controlTempValue || controlTempValue === '' ? controlTempValue.length === 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5360
5637
|
className: "".concat(!hideBlinkingCursor() ? 'control-placeholder' : '')
|
|
5361
|
-
}, generateInputFocusStr()) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, controlTempValue) :
|
|
5638
|
+
}, generateInputFocusStr()) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, controlTempValue) : (0,format_string.stripTagsAndContent)(controlLabel).length === 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5362
5639
|
className: "".concat(!hideBlinkingCursor() ? 'control-placeholder' : '')
|
|
5363
|
-
}, generateInputFocusStr()) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null,
|
|
5640
|
+
}, generateInputFocusStr()) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, (0,format_string.stripTagsAndContent)(controlLabel)))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
5364
5641
|
className: (0,cls.combinedCls)('custom-select-arrow', {
|
|
5365
5642
|
'reverse': isOpen
|
|
5366
5643
|
}),
|
|
@@ -5430,8 +5707,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5430
5707
|
key: 'selected-item-' + index,
|
|
5431
5708
|
"data-value": controlArr.values[index],
|
|
5432
5709
|
"data-label-full": item,
|
|
5433
|
-
"data-label-text": formatIndentVal(
|
|
5434
|
-
}, formatIndentVal(
|
|
5710
|
+
"data-label-text": formatIndentVal((0,format_string.stripTagsAndContent)(item), INDENT_LAST_PLACEHOLDER)
|
|
5711
|
+
}, formatIndentVal((0,format_string.stripTagsAndContent)(item), INDENT_LAST_PLACEHOLDER), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
|
|
5435
5712
|
href: "#",
|
|
5436
5713
|
tabIndex: -1,
|
|
5437
5714
|
onClick: handleMultiControlItemRemove,
|
|
@@ -5583,7 +5860,41 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5583
5860
|
type: "button",
|
|
5584
5861
|
className: "list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch hide",
|
|
5585
5862
|
disabled: true
|
|
5586
|
-
},
|
|
5863
|
+
},
|
|
5864
|
+
// (1) Handling async data with the click event
|
|
5865
|
+
!FIRST_REQUEST_AUTO && !handleFirstFetchCompleted ||
|
|
5866
|
+
// (2) Every time the input changes or the search button is clicked, a data request will be triggered
|
|
5867
|
+
fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '' ? /*#__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", {
|
|
5868
|
+
className: "cus-select-loader"
|
|
5869
|
+
}, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
5870
|
+
height: "12px",
|
|
5871
|
+
width: "12px",
|
|
5872
|
+
viewBox: "0 0 512 512"
|
|
5873
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5874
|
+
fill: "inherit",
|
|
5875
|
+
d: "M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z"
|
|
5876
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5877
|
+
fill: "inherit",
|
|
5878
|
+
d: "M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z"
|
|
5879
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5880
|
+
fill: "inherit",
|
|
5881
|
+
d: "M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z"
|
|
5882
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5883
|
+
fill: "inherit",
|
|
5884
|
+
d: "M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z"
|
|
5885
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5886
|
+
fill: "inherit",
|
|
5887
|
+
d: "M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z"
|
|
5888
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5889
|
+
fill: "inherit",
|
|
5890
|
+
d: "M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z"
|
|
5891
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5892
|
+
fill: "inherit",
|
|
5893
|
+
d: "M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z"
|
|
5894
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5895
|
+
fill: "inherit",
|
|
5896
|
+
d: "M437.026,134.798c16.52-16.52,16.52-43.304,0-59.824c-16.519-16.511-43.304-16.52-59.823,0c-16.52,16.52-16.503,43.295,0,59.815C393.722,151.309,420.507,151.309,437.026,134.798z"
|
|
5897
|
+
}))))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, fetchNoneInfo || 'No match yet')), optionsData ? optionsData.map(function (item, index) {
|
|
5587
5898
|
var startItemBorder = index === 0 ? 'border-top-0' : '';
|
|
5588
5899
|
var endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
|
|
5589
5900
|
|