funda-ui 4.7.335 → 4.7.345
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 +86 -86
- package/CascadingSelect/index.d.ts +21 -4
- package/CascadingSelect/index.js +209 -53
- package/CascadingSelectE2E/index.css +86 -86
- package/CascadingSelectE2E/index.d.ts +22 -5
- package/CascadingSelectE2E/index.js +233 -69
- package/MultipleCheckboxes/index.js +71 -0
- package/MultipleSelect/index.js +71 -0
- package/TagInput/index.js +71 -0
- package/Utils/extract.d.ts +39 -1
- package/Utils/extract.js +65 -0
- package/Utils/useDragDropPosition.d.ts +0 -3
- package/Utils/useDragDropPosition.js +0 -3
- package/lib/cjs/CascadingSelect/index.d.ts +21 -4
- package/lib/cjs/CascadingSelect/index.js +209 -53
- package/lib/cjs/CascadingSelectE2E/index.d.ts +22 -5
- package/lib/cjs/CascadingSelectE2E/index.js +233 -69
- package/lib/cjs/MultipleCheckboxes/index.js +71 -0
- package/lib/cjs/MultipleSelect/index.js +71 -0
- package/lib/cjs/TagInput/index.js +71 -0
- package/lib/cjs/Utils/extract.d.ts +39 -1
- package/lib/cjs/Utils/extract.js +65 -0
- package/lib/cjs/Utils/useDragDropPosition.d.ts +0 -3
- package/lib/cjs/Utils/useDragDropPosition.js +0 -3
- package/lib/css/CascadingSelect/index.css +86 -86
- package/lib/css/CascadingSelectE2E/index.css +86 -86
- package/lib/esm/CascadingSelect/Group.tsx +4 -3
- package/lib/esm/CascadingSelect/index.scss +67 -65
- package/lib/esm/CascadingSelect/index.tsx +201 -60
- package/lib/esm/CascadingSelectE2E/Group.tsx +3 -3
- package/lib/esm/CascadingSelectE2E/index.scss +67 -65
- package/lib/esm/CascadingSelectE2E/index.tsx +235 -79
- package/lib/esm/Utils/hooks/useDragDropPosition.tsx +0 -3
- package/lib/esm/Utils/libs/extract.ts +77 -3
- package/package.json +1 -1
|
@@ -664,6 +664,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
664
664
|
return (/* binding */_extractContentsOfBrackets
|
|
665
665
|
);
|
|
666
666
|
},
|
|
667
|
+
/* harmony export */"extractContentsOfMixedCharactersWithBraces": function extractContentsOfMixedCharactersWithBraces() {
|
|
668
|
+
return (/* binding */_extractContentsOfMixedCharactersWithBraces
|
|
669
|
+
);
|
|
670
|
+
},
|
|
671
|
+
/* harmony export */"extractContentsOfMixedCharactersWithComma": function extractContentsOfMixedCharactersWithComma() {
|
|
672
|
+
return (/* binding */_extractContentsOfMixedCharactersWithComma
|
|
673
|
+
);
|
|
674
|
+
},
|
|
667
675
|
/* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
|
|
668
676
|
return (/* binding */_extractContentsOfParentheses
|
|
669
677
|
);
|
|
@@ -747,6 +755,69 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
747
755
|
}
|
|
748
756
|
}
|
|
749
757
|
|
|
758
|
+
/**
|
|
759
|
+
* Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
|
|
760
|
+
*
|
|
761
|
+
* Example:
|
|
762
|
+
* Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
|
|
763
|
+
* Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
|
|
764
|
+
*
|
|
765
|
+
* Output: [
|
|
766
|
+
* { label: "Poor", value: "c" },
|
|
767
|
+
* { label: "Sub-option 4", value: "c-2" },
|
|
768
|
+
* { label: "Empty", value: "" }
|
|
769
|
+
* ]
|
|
770
|
+
*
|
|
771
|
+
* @param {string} str - The input string containing one or more `{label[value]}` segments.
|
|
772
|
+
* @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
|
|
773
|
+
*/
|
|
774
|
+
function _extractContentsOfMixedCharactersWithBraces(str) {
|
|
775
|
+
// Fix the extra '{' at the beginning
|
|
776
|
+
var cleaned = str.replace(/^{{/, '{');
|
|
777
|
+
|
|
778
|
+
// Remove empty {} or {[]} tail
|
|
779
|
+
var trimmed = cleaned.replace(/\{\[\]\}$/, '');
|
|
780
|
+
|
|
781
|
+
// The match is like {label[value]}
|
|
782
|
+
var pattern = /\{(.*?)\[(.*?)\]\}/g;
|
|
783
|
+
var matches = Array.from(trimmed.matchAll(pattern));
|
|
784
|
+
return matches.map(function (match) {
|
|
785
|
+
return {
|
|
786
|
+
label: match[1],
|
|
787
|
+
value: match[2]
|
|
788
|
+
};
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Parses a comma-separated string of `label[value]` pairs into an array of objects.
|
|
794
|
+
*
|
|
795
|
+
* Example:
|
|
796
|
+
* Input: "Poor[c],Sub-option 4[c-2],Empty[]"
|
|
797
|
+
* Output: [
|
|
798
|
+
* { label: "Poor", value: "c" },
|
|
799
|
+
* { label: "Sub-option 4", value: "c-2" },
|
|
800
|
+
* { label: "Empty", value: "" }
|
|
801
|
+
* ]
|
|
802
|
+
*
|
|
803
|
+
* @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
|
|
804
|
+
* @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
|
|
805
|
+
*/
|
|
806
|
+
function _extractContentsOfMixedCharactersWithComma(str) {
|
|
807
|
+
return str.split(",").map(function (item) {
|
|
808
|
+
return item.trim();
|
|
809
|
+
}).map(function (item) {
|
|
810
|
+
var match = item.match(/^(.*?)\[(.*?)\]$/);
|
|
811
|
+
if (match) {
|
|
812
|
+
return {
|
|
813
|
+
label: match[1],
|
|
814
|
+
value: match[2]
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
return null;
|
|
818
|
+
}).filter(Boolean);
|
|
819
|
+
}
|
|
820
|
+
|
|
750
821
|
/******/
|
|
751
822
|
return __webpack_exports__;
|
|
752
823
|
/******/
|
|
@@ -2469,7 +2540,7 @@ function Group(props) {
|
|
|
2469
2540
|
"data-value": JSON.stringify(item),
|
|
2470
2541
|
"data-level": level,
|
|
2471
2542
|
"data-query": item.queryId,
|
|
2472
|
-
className: (0,cls.combinedCls)('
|
|
2543
|
+
className: (0,cls.combinedCls)('casc-select-e2e__opt', {
|
|
2473
2544
|
'active': item.current
|
|
2474
2545
|
}),
|
|
2475
2546
|
dangerouslySetInnerHTML: {
|
|
@@ -2483,13 +2554,13 @@ function Group(props) {
|
|
|
2483
2554
|
} else {
|
|
2484
2555
|
return columnTitle[level] === '' || perColumnHeadersShow === false ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h3", {
|
|
2485
2556
|
key: index,
|
|
2486
|
-
className: "
|
|
2557
|
+
className: "casc-select-e2e__opt-header"
|
|
2487
2558
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2488
2559
|
dangerouslySetInnerHTML: {
|
|
2489
2560
|
__html: columnTitle[level]
|
|
2490
2561
|
}
|
|
2491
2562
|
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
2492
|
-
className: "
|
|
2563
|
+
className: "casc-select-e2e__opt-header__clean"
|
|
2493
2564
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
|
|
2494
2565
|
tabIndex: -1,
|
|
2495
2566
|
href: "#",
|
|
@@ -2517,7 +2588,7 @@ function Group(props) {
|
|
|
2517
2588
|
}));
|
|
2518
2589
|
}
|
|
2519
2590
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
2520
|
-
var _excluded = ["popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "searchable", "searchPlaceholder", "perColumnHeadersShow", "exceededSidePosOffset", "disabled", "required", "value", "label", "placeholder", "name", "id", "extractValueByBraces", "destroyParentIdMatch", "columnTitle", "depth", "loader", "
|
|
2591
|
+
var _excluded = ["popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "searchable", "searchPlaceholder", "perColumnHeadersShow", "exceededSidePosOffset", "readOnly", "disabled", "required", "requiredLabel", "units", "iconLeft", "iconRight", "minLength", "maxLength", "value", "label", "placeholder", "name", "id", "extractValueByBraces", "destroyParentIdMatch", "columnTitle", "depth", "loader", "inputable", "displayResultArrow", "controlArrow", "valueType", "showCloseBtn", "style", "tabIndex", "triggerClassName", "triggerContent", "cleanNodeBtnClassName", "cleanNodeBtnContent", "fetchArray", "onFetch", "onChange", "onBlur", "onFocus", "formatInputResult"];
|
|
2521
2592
|
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; }
|
|
2522
2593
|
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); }
|
|
2523
2594
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -2547,11 +2618,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
2547
2618
|
|
|
2548
2619
|
|
|
2549
2620
|
|
|
2550
|
-
var CascadingSelectE2E = function
|
|
2621
|
+
var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, externalRef) {
|
|
2551
2622
|
var popupRef = props.popupRef,
|
|
2552
2623
|
wrapperClassName = props.wrapperClassName,
|
|
2553
2624
|
controlClassName = props.controlClassName,
|
|
2554
2625
|
controlExClassName = props.controlExClassName,
|
|
2626
|
+
controlGroupWrapperClassName = props.controlGroupWrapperClassName,
|
|
2627
|
+
controlGroupTextClassName = props.controlGroupTextClassName,
|
|
2555
2628
|
_props$searchable = props.searchable,
|
|
2556
2629
|
searchable = _props$searchable === void 0 ? false : _props$searchable,
|
|
2557
2630
|
_props$searchPlacehol = props.searchPlaceholder,
|
|
@@ -2559,8 +2632,15 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2559
2632
|
_props$perColumnHeade = props.perColumnHeadersShow,
|
|
2560
2633
|
perColumnHeadersShow = _props$perColumnHeade === void 0 ? true : _props$perColumnHeade,
|
|
2561
2634
|
exceededSidePosOffset = props.exceededSidePosOffset,
|
|
2635
|
+
readOnly = props.readOnly,
|
|
2562
2636
|
disabled = props.disabled,
|
|
2563
2637
|
required = props.required,
|
|
2638
|
+
requiredLabel = props.requiredLabel,
|
|
2639
|
+
units = props.units,
|
|
2640
|
+
iconLeft = props.iconLeft,
|
|
2641
|
+
iconRight = props.iconRight,
|
|
2642
|
+
minLength = props.minLength,
|
|
2643
|
+
maxLength = props.maxLength,
|
|
2564
2644
|
value = props.value,
|
|
2565
2645
|
label = props.label,
|
|
2566
2646
|
placeholder = props.placeholder,
|
|
@@ -2571,7 +2651,8 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2571
2651
|
columnTitle = props.columnTitle,
|
|
2572
2652
|
depth = props.depth,
|
|
2573
2653
|
loader = props.loader,
|
|
2574
|
-
|
|
2654
|
+
_props$inputable = props.inputable,
|
|
2655
|
+
inputable = _props$inputable === void 0 ? false : _props$inputable,
|
|
2575
2656
|
displayResultArrow = props.displayResultArrow,
|
|
2576
2657
|
controlArrow = props.controlArrow,
|
|
2577
2658
|
valueType = props.valueType,
|
|
@@ -2587,6 +2668,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2587
2668
|
onChange = props.onChange,
|
|
2588
2669
|
onBlur = props.onBlur,
|
|
2589
2670
|
onFocus = props.onFocus,
|
|
2671
|
+
formatInputResult = props.formatInputResult,
|
|
2590
2672
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
2591
2673
|
var DEPTH = depth || 1055; // the default value same as bootstrap
|
|
2592
2674
|
var POS_OFFSET = 0;
|
|
@@ -2595,7 +2677,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2595
2677
|
var uniqueID = useComId_default()();
|
|
2596
2678
|
var idRes = id || uniqueID;
|
|
2597
2679
|
var rootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
2598
|
-
var
|
|
2680
|
+
var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
2599
2681
|
var listRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
2600
2682
|
|
|
2601
2683
|
// searchable
|
|
@@ -2603,6 +2685,22 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2603
2685
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2604
2686
|
columnSearchKeywords = _useState2[0],
|
|
2605
2687
|
setColumnSearchKeywords = _useState2[1];
|
|
2688
|
+
var propExist = function propExist(p) {
|
|
2689
|
+
return typeof p !== 'undefined' && p !== null && p !== '';
|
|
2690
|
+
};
|
|
2691
|
+
var resultInput = function resultInput(curData, curQueryIdsData) {
|
|
2692
|
+
return VALUE_BY_BRACES ? (0,convert.convertArrToValByBraces)(curData.map(function (item, i) {
|
|
2693
|
+
return "".concat(item, "[").concat(curQueryIdsData[i], "]");
|
|
2694
|
+
})) : curData.map(function (item, i) {
|
|
2695
|
+
return "".concat(item, "[").concat(curQueryIdsData[i], "]");
|
|
2696
|
+
}).join(',');
|
|
2697
|
+
};
|
|
2698
|
+
var resultInputPureText = function resultInputPureText(inputStr) {
|
|
2699
|
+
return VALUE_BY_BRACES ? "{".concat(inputStr, "[]}") : "".concat(inputStr, "[]");
|
|
2700
|
+
|
|
2701
|
+
// value1: {{curLabel[curValue]}[]}
|
|
2702
|
+
// value2: curLabel[curValue][]
|
|
2703
|
+
};
|
|
2606
2704
|
|
|
2607
2705
|
// exposes the following methods
|
|
2608
2706
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(popupRef, function () {
|
|
@@ -2661,7 +2759,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2661
2759
|
queryIds: []
|
|
2662
2760
|
});
|
|
2663
2761
|
|
|
2664
|
-
// destroy `
|
|
2762
|
+
// destroy `queryId` match
|
|
2665
2763
|
var selectedDataByClick = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
2666
2764
|
labels: [],
|
|
2667
2765
|
values: [],
|
|
@@ -2697,17 +2795,16 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2697
2795
|
windowScrollUpdate = _useWindowScroll2[1];
|
|
2698
2796
|
function popwinPosInit() {
|
|
2699
2797
|
var showAct = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
2700
|
-
if (rootRef.current === null ||
|
|
2798
|
+
if (rootRef.current === null || inputRef.current === null) return;
|
|
2701
2799
|
|
|
2702
2800
|
// update modal position
|
|
2703
|
-
var _modalRef = document.querySelector("#
|
|
2704
|
-
var _triggerRef =
|
|
2705
|
-
var _triggerXaxisRef = rootRef.current;
|
|
2801
|
+
var _modalRef = document.querySelector("#casc-select-e2e__items-wrapper-".concat(idRes));
|
|
2802
|
+
var _triggerRef = inputRef.current;
|
|
2706
2803
|
|
|
2707
2804
|
// console.log(getAbsolutePositionOfStage(_triggerRef));
|
|
2708
2805
|
|
|
2709
2806
|
if (_modalRef === null) return;
|
|
2710
|
-
var _getAbsolutePositionO = (0,getElementProperty.getAbsolutePositionOfStage)(
|
|
2807
|
+
var _getAbsolutePositionO = (0,getElementProperty.getAbsolutePositionOfStage)(_triggerRef),
|
|
2711
2808
|
x = _getAbsolutePositionO.x;
|
|
2712
2809
|
var _getAbsolutePositionO2 = (0,getElementProperty.getAbsolutePositionOfStage)(_triggerRef),
|
|
2713
2810
|
y = _getAbsolutePositionO2.y,
|
|
@@ -2773,7 +2870,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2773
2870
|
}
|
|
2774
2871
|
|
|
2775
2872
|
function popwinPosHide() {
|
|
2776
|
-
var _modalRef = document.querySelector("#
|
|
2873
|
+
var _modalRef = document.querySelector("#casc-select-e2e__items-wrapper-".concat(idRes));
|
|
2777
2874
|
if (_modalRef !== null) {
|
|
2778
2875
|
// remove classnames and styles
|
|
2779
2876
|
_modalRef.classList.remove('active');
|
|
@@ -2784,9 +2881,9 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2784
2881
|
var level = arguments.length > 2 ? arguments[2] : undefined;
|
|
2785
2882
|
if (listRef.current === null) return;
|
|
2786
2883
|
var latestDisplayColIndex = 0;
|
|
2787
|
-
var currentItemsInner = listRef.current.querySelector('.
|
|
2884
|
+
var currentItemsInner = listRef.current.querySelector('.casc-select-e2e__items-inner');
|
|
2788
2885
|
if (currentItemsInner !== null) {
|
|
2789
|
-
var colItemsWrapper = [].slice.call(currentItemsInner.querySelectorAll('.
|
|
2886
|
+
var colItemsWrapper = [].slice.call(currentItemsInner.querySelectorAll('.casc-select-e2e__items-col'));
|
|
2790
2887
|
colItemsWrapper.forEach(function (perCol) {
|
|
2791
2888
|
perCol.classList.remove('hide-col');
|
|
2792
2889
|
});
|
|
@@ -2826,6 +2923,9 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
2826
2923
|
// show list
|
|
2827
2924
|
setIsShow(true);
|
|
2828
2925
|
|
|
2926
|
+
// update data depth
|
|
2927
|
+
setCurrentDataDepth(0);
|
|
2928
|
+
|
|
2829
2929
|
// Execute the fetch task
|
|
2830
2930
|
if (!firstDataFeched) {
|
|
2831
2931
|
setLoading(true);
|
|
@@ -3020,13 +3120,13 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3020
3120
|
}
|
|
3021
3121
|
function handleDisplayOptions(event) {
|
|
3022
3122
|
if (event) event.preventDefault();
|
|
3023
|
-
|
|
3024
|
-
//
|
|
3123
|
+
if (isShow) return;
|
|
3025
3124
|
activate();
|
|
3026
3125
|
}
|
|
3027
3126
|
function handleClickItem(e, resValue, index, level, curData) {
|
|
3028
3127
|
e.preventDefault();
|
|
3029
|
-
var
|
|
3128
|
+
var maxDepth = fetchArray.length - 1;
|
|
3129
|
+
var dataDepthMax = resValue.itemDepth === maxDepth;
|
|
3030
3130
|
var parentId = e.currentTarget.dataset.query;
|
|
3031
3131
|
var emptyAction = resValue.id.toString().indexOf('$EMPTY_ID_') < 0 ? false : true;
|
|
3032
3132
|
|
|
@@ -3049,7 +3149,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3049
3149
|
cancel();
|
|
3050
3150
|
}
|
|
3051
3151
|
});
|
|
3052
|
-
return _currentDataDepth;
|
|
3152
|
+
return _currentDataDepth > maxDepth ? maxDepth : _currentDataDepth;
|
|
3053
3153
|
});
|
|
3054
3154
|
|
|
3055
3155
|
//update selected data by clicked item
|
|
@@ -3063,7 +3163,9 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3063
3163
|
// callback
|
|
3064
3164
|
//////////////////////////////////////////
|
|
3065
3165
|
if (typeof onChange === 'function') {
|
|
3066
|
-
|
|
3166
|
+
var curValString = valueType === 'value' ? inputVal[0] : inputVal[1];
|
|
3167
|
+
var curValCallback = typeof formatInputResult === 'function' ? formatInputResult(VALUE_BY_BRACES ? (0,extract.extractContentsOfMixedCharactersWithBraces)(curValString) : (0,extract.extractContentsOfMixedCharactersWithComma)(curValString)) : curValString;
|
|
3168
|
+
onChange(inputRef.current, resValue, index, level, curValCallback, cancel);
|
|
3067
3169
|
}
|
|
3068
3170
|
|
|
3069
3171
|
// update data
|
|
@@ -3080,6 +3182,11 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3080
3182
|
// All the elements from start(array.length - start) to the end of the array will be deleted.
|
|
3081
3183
|
newData.splice(level + 1);
|
|
3082
3184
|
|
|
3185
|
+
// When requesting a return asynchronously, a new column is added only under the currently clicked column,
|
|
3186
|
+
// and the previous column cannot be affected.
|
|
3187
|
+
// Make sure that subsequent asynchronous requests will only insert new columns towards the level+1 position.
|
|
3188
|
+
listData.current = _toConsumableArray(newData);
|
|
3189
|
+
|
|
3083
3190
|
// active status
|
|
3084
3191
|
if (resValue.children) {
|
|
3085
3192
|
var childList = resValue.children;
|
|
@@ -3093,17 +3200,14 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3093
3200
|
if (dataDepthMax && resValue.id.toString().indexOf('$EMPTY_ID_') < 0) {
|
|
3094
3201
|
//
|
|
3095
3202
|
cancel();
|
|
3096
|
-
|
|
3097
|
-
// update data depth
|
|
3098
|
-
setCurrentDataDepth(0);
|
|
3099
3203
|
}
|
|
3100
3204
|
|
|
3101
3205
|
// active current option with DOM
|
|
3102
3206
|
//////////////////////////////////////////
|
|
3103
|
-
var currentItemsInner = e.currentTarget.closest('.
|
|
3207
|
+
var currentItemsInner = e.currentTarget.closest('.casc-select-e2e__items-inner');
|
|
3104
3208
|
if (currentItemsInner !== null) {
|
|
3105
3209
|
curData.forEach(function (v, col) {
|
|
3106
|
-
var colItemsWrapper = currentItemsInner.querySelectorAll('.
|
|
3210
|
+
var colItemsWrapper = currentItemsInner.querySelectorAll('.casc-select-e2e__items-col');
|
|
3107
3211
|
colItemsWrapper.forEach(function (perCol) {
|
|
3108
3212
|
var _col = Number(perCol.dataset.col);
|
|
3109
3213
|
if (_col >= level) {
|
|
@@ -3156,7 +3260,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3156
3260
|
}
|
|
3157
3261
|
function updateValue(arr, targetVal) {
|
|
3158
3262
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
3159
|
-
var inputEl =
|
|
3263
|
+
var inputEl = inputRef.current;
|
|
3160
3264
|
var _valueData, _labelData, _queryIdsData;
|
|
3161
3265
|
if (targetVal.toString().indexOf('$EMPTY_ID_') >= 0) {
|
|
3162
3266
|
// If clearing the current column
|
|
@@ -3210,16 +3314,8 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3210
3314
|
_labelData = selectedDataByClick.current.labels;
|
|
3211
3315
|
_queryIdsData = selectedDataByClick.current.queryIds;
|
|
3212
3316
|
}
|
|
3213
|
-
var inputVal_0 =
|
|
3214
|
-
|
|
3215
|
-
})) : _valueData.map(function (item, i) {
|
|
3216
|
-
return "".concat(item, "[").concat(_queryIdsData[i], "]");
|
|
3217
|
-
}).join(',');
|
|
3218
|
-
var inputVal_1 = VALUE_BY_BRACES ? (0,convert.convertArrToValByBraces)(_labelData.map(function (item, i) {
|
|
3219
|
-
return "".concat(item, "[").concat(_queryIdsData[i], "]");
|
|
3220
|
-
})) : _labelData.map(function (item, i) {
|
|
3221
|
-
return "".concat(item, "[").concat(_queryIdsData[i], "]");
|
|
3222
|
-
}).join(',');
|
|
3317
|
+
var inputVal_0 = resultInput(_valueData, _queryIdsData);
|
|
3318
|
+
var inputVal_1 = resultInput(_labelData, _queryIdsData);
|
|
3223
3319
|
if (valueType === 'value') {
|
|
3224
3320
|
if (inputEl !== null) setChangedVal(inputVal_0);
|
|
3225
3321
|
} else {
|
|
@@ -3640,10 +3736,16 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3640
3736
|
}));
|
|
3641
3737
|
}
|
|
3642
3738
|
}, [listData.current.length]);
|
|
3739
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
3740
|
+
return function () {
|
|
3741
|
+
// update data depth
|
|
3742
|
+
setCurrentDataDepth(0);
|
|
3743
|
+
};
|
|
3744
|
+
}, []);
|
|
3643
3745
|
return /*#__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", {
|
|
3644
|
-
className: (0,cls.clsWrite)(wrapperClassName, '
|
|
3746
|
+
className: (0,cls.clsWrite)(wrapperClassName, 'casc-select-e2e__wrapper mb-3 position-relative', "casc-select-e2e__wrapper ".concat(wrapperClassName)),
|
|
3645
3747
|
ref: rootRef,
|
|
3646
|
-
"data-overlay-id": "
|
|
3748
|
+
"data-overlay-id": "casc-select-e2e__items-wrapper-".concat(idRes)
|
|
3647
3749
|
}, label ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
|
|
3648
3750
|
htmlFor: idRes,
|
|
3649
3751
|
className: "form-label",
|
|
@@ -3654,23 +3756,23 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3654
3756
|
htmlFor: idRes,
|
|
3655
3757
|
className: "form-label"
|
|
3656
3758
|
}, label)) : null, triggerContent ? /*#__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", {
|
|
3657
|
-
className: (0,cls.clsWrite)(triggerClassName, '
|
|
3759
|
+
className: (0,cls.clsWrite)(triggerClassName, 'casc-select-e2e__trigger d-inline w-auto', "casc-select-e2e__trigger ".concat(triggerClassName)),
|
|
3658
3760
|
onClick: handleDisplayOptions
|
|
3659
3761
|
}, triggerContent)) : null, !hasErr ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
|
|
3660
3762
|
show: true,
|
|
3661
3763
|
containerClassName: "CascadingSelectE2E"
|
|
3662
3764
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3663
3765
|
ref: listRef,
|
|
3664
|
-
id: "
|
|
3665
|
-
className: "
|
|
3766
|
+
id: "casc-select-e2e__items-wrapper-".concat(idRes),
|
|
3767
|
+
className: "casc-select-e2e__items-wrapper position-absolute border shadow small",
|
|
3666
3768
|
style: {
|
|
3667
3769
|
zIndex: DEPTH,
|
|
3668
3770
|
display: 'none'
|
|
3669
3771
|
}
|
|
3670
3772
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
|
|
3671
|
-
className: "
|
|
3773
|
+
className: "casc-select-e2e__items-inner"
|
|
3672
3774
|
}, loading ? /*#__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", {
|
|
3673
|
-
className: "
|
|
3775
|
+
className: "casc-select-e2e__items-loader"
|
|
3674
3776
|
}, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
3675
3777
|
height: "12px",
|
|
3676
3778
|
width: "12px",
|
|
@@ -3706,7 +3808,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3706
3808
|
e.preventDefault();
|
|
3707
3809
|
cancel();
|
|
3708
3810
|
},
|
|
3709
|
-
className: "
|
|
3811
|
+
className: "casc-select-e2e__close position-absolute top-0 end-0 mt-0 mx-1"
|
|
3710
3812
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
3711
3813
|
width: "10px",
|
|
3712
3814
|
height: "10px",
|
|
@@ -3727,9 +3829,9 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3727
3829
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
3728
3830
|
key: level,
|
|
3729
3831
|
"data-col": level,
|
|
3730
|
-
className: "
|
|
3832
|
+
className: "casc-select-e2e__items-col"
|
|
3731
3833
|
}, searchable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3732
|
-
className: "
|
|
3834
|
+
className: "casc-select-e2e__items-col-searchbox"
|
|
3733
3835
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", {
|
|
3734
3836
|
type: "text",
|
|
3735
3837
|
placeholder: searchPlaceholder,
|
|
@@ -3755,38 +3857,100 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3755
3857
|
return null;
|
|
3756
3858
|
}
|
|
3757
3859
|
})))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3758
|
-
className:
|
|
3860
|
+
className: (0,cls.combinedCls)('casc-select-e2e__val', {
|
|
3861
|
+
'inputable': inputable
|
|
3862
|
+
}),
|
|
3759
3863
|
onClick: handleDisplayOptions
|
|
3760
|
-
},
|
|
3761
|
-
className:
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3864
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3865
|
+
className: (0,cls.combinedCls)('position-relative', (0,cls.clsWrite)(controlGroupWrapperClassName, 'input-group'), {
|
|
3866
|
+
'has-left-content': propExist(iconLeft),
|
|
3867
|
+
'has-right-content': propExist(iconRight) || propExist(units)
|
|
3868
|
+
})
|
|
3869
|
+
}, propExist(iconLeft) ? /*#__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", {
|
|
3870
|
+
className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
3871
|
+
}, iconLeft)) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3872
|
+
className: "input-group-control-container flex-fill position-relative"
|
|
3873
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
|
|
3874
|
+
ref: function ref(node) {
|
|
3875
|
+
inputRef.current = node;
|
|
3876
|
+
if (typeof externalRef === 'function') {
|
|
3877
|
+
externalRef(node);
|
|
3878
|
+
} else if (externalRef) {
|
|
3879
|
+
externalRef.current = node;
|
|
3880
|
+
}
|
|
3881
|
+
},
|
|
3766
3882
|
id: idRes,
|
|
3767
|
-
"data-overlay-id": "
|
|
3883
|
+
"data-overlay-id": "casc-select-e2e__items-wrapper-".concat(idRes),
|
|
3768
3884
|
name: name,
|
|
3769
|
-
className: (0,cls.combinedCls)((0,cls.clsWrite)(controlClassName, 'form-control'), controlExClassName
|
|
3885
|
+
className: (0,cls.combinedCls)((0,cls.clsWrite)(controlClassName, 'form-control'), controlExClassName, {
|
|
3886
|
+
'rounded': !propExist(iconLeft) && !propExist(iconRight) && !propExist(units),
|
|
3887
|
+
'rounded-start-0': propExist(iconLeft),
|
|
3888
|
+
'rounded-end-0': propExist(iconRight) || propExist(units)
|
|
3889
|
+
}),
|
|
3770
3890
|
placeholder: placeholder,
|
|
3771
|
-
value:
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3891
|
+
value: function () {
|
|
3892
|
+
var curValForamt = resultInputPureText(changedVal);
|
|
3893
|
+
var curValCallback = '';
|
|
3894
|
+
|
|
3895
|
+
// STEP 1
|
|
3896
|
+
//============
|
|
3897
|
+
|
|
3898
|
+
if (inputable) {
|
|
3899
|
+
curValCallback = curValForamt;
|
|
3900
|
+
} else {
|
|
3901
|
+
curValCallback = destroyParentIdMatch ? valueType === 'value' ? resultInput(selectedDataByClick.current.values, selectedDataByClick.current.queryIds) : resultInput(selectedDataByClick.current.labels, selectedDataByClick.current.queryIds) : curValForamt;
|
|
3902
|
+
}
|
|
3903
|
+
|
|
3904
|
+
// STEP 2
|
|
3905
|
+
//============
|
|
3906
|
+
if (typeof formatInputResult === 'function') {
|
|
3907
|
+
return formatInputResult(VALUE_BY_BRACES ? (0,extract.extractContentsOfMixedCharactersWithBraces)(curValCallback) : (0,extract.extractContentsOfMixedCharactersWithComma)(curValCallback));
|
|
3908
|
+
} else {
|
|
3909
|
+
return changedVal;
|
|
3910
|
+
}
|
|
3911
|
+
}()
|
|
3912
|
+
// placeholder will not change if defaultValue is used
|
|
3780
3913
|
,
|
|
3781
3914
|
onFocus: handleFocus,
|
|
3782
3915
|
onBlur: handleBlur,
|
|
3916
|
+
autoComplete: "off",
|
|
3783
3917
|
disabled: disabled || null,
|
|
3918
|
+
readOnly: readOnly || null,
|
|
3784
3919
|
required: required || null,
|
|
3920
|
+
minLength: minLength || null,
|
|
3921
|
+
maxLength: maxLength || null,
|
|
3785
3922
|
style: style,
|
|
3786
3923
|
tabIndex: tabIndex || 0,
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3924
|
+
onChange: inputable ? function (e) {
|
|
3925
|
+
setChangedVal(e.target.value);
|
|
3926
|
+
if (typeof onChange === 'function') {
|
|
3927
|
+
onChange(e,
|
|
3928
|
+
// input dom event
|
|
3929
|
+
null,
|
|
3930
|
+
// currentData
|
|
3931
|
+
null,
|
|
3932
|
+
// index
|
|
3933
|
+
null,
|
|
3934
|
+
// depth
|
|
3935
|
+
e.target.value,
|
|
3936
|
+
// value
|
|
3937
|
+
cancel);
|
|
3938
|
+
}
|
|
3939
|
+
} : undefined
|
|
3940
|
+
}, attributes)), destroyParentIdMatch ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !inputable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3941
|
+
className: "casc-select-e2e__result"
|
|
3942
|
+
}, displayInfo(true)) : null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !inputable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3943
|
+
className: "casc-select-e2e__result"
|
|
3944
|
+
}, displayInfo(false)) : null), required ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, requiredLabel || requiredLabel === '' ? requiredLabel : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
3945
|
+
className: "position-absolute end-0 top-0 my-2 mx-2 pe-3"
|
|
3946
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
3947
|
+
className: "text-danger"
|
|
3948
|
+
}, "*"))) : ''), propExist(units) ? /*#__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", {
|
|
3949
|
+
className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
3950
|
+
}, units)) : null, propExist(iconRight) ? /*#__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", {
|
|
3951
|
+
className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
3952
|
+
}, iconRight)) : null), isShow ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
3953
|
+
className: "casc-select-e2e__closemask",
|
|
3790
3954
|
onClick: function onClick(e) {
|
|
3791
3955
|
e.preventDefault();
|
|
3792
3956
|
cancel();
|
|
@@ -3813,7 +3977,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
|
|
|
3813
3977
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3814
3978
|
d: "M144,6525.39 L142.594,6524 L133.987,6532.261 L133.069,6531.38 L133.074,6531.385 L125.427,6524.045 L124,6525.414 C126.113,6527.443 132.014,6533.107 133.987,6535 C135.453,6533.594 134.024,6534.965 144,6525.39"
|
|
3815
3979
|
})))))))));
|
|
3816
|
-
};
|
|
3980
|
+
});
|
|
3817
3981
|
/* harmony default export */ const src = (CascadingSelectE2E);
|
|
3818
3982
|
})();
|
|
3819
3983
|
|