@capillarytech/blaze-ui 1.0.3-alpha.15 → 1.0.3-alpha.19
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/dist/CapUnifiedSelect/CapUnifiedSelect.d.ts +53 -0
- package/dist/CapUnifiedSelect/CapUnifiedSelect.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/CustomDropdown.d.ts +46 -0
- package/dist/CapUnifiedSelect/CustomDropdown.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/DropdownHeader.d.ts +10 -0
- package/dist/CapUnifiedSelect/DropdownHeader.d.ts.map +1 -0
- package/{CapUnifiedSelect → dist/CapUnifiedSelect}/constants.d.ts +7 -7
- package/dist/CapUnifiedSelect/constants.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/enhanceOptions.d.ts +8 -0
- package/dist/CapUnifiedSelect/enhanceOptions.d.ts.map +1 -0
- package/{CapUnifiedSelect → dist/CapUnifiedSelect}/index.js +1558 -1208
- package/dist/CapUnifiedSelect/index.js.map +1 -0
- package/{CapUnifiedSelect → dist/CapUnifiedSelect}/types.d.ts +1 -0
- package/dist/CapUnifiedSelect/types.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/useCapUnifiedSelect.d.ts +48 -0
- package/dist/CapUnifiedSelect/useCapUnifiedSelect.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/useInfiniteScroll.d.ts +27 -0
- package/dist/CapUnifiedSelect/useInfiniteScroll.d.ts.map +1 -0
- package/{CapUnifiedSelect → dist/CapUnifiedSelect}/utils.d.ts +11 -0
- package/{CapUnifiedSelect → dist/CapUnifiedSelect}/utils.d.ts.map +1 -1
- package/{index.js → dist/index.js} +1722 -1371
- package/dist/index.js.map +1 -0
- package/{styled → dist/styled}/variables.d.ts +1 -0
- package/{styled → dist/styled}/variables.d.ts.map +1 -1
- package/{styled → dist/styled}/variables.scss +1 -0
- package/package.json +199 -101
- package/CapUnifiedSelect/CapUnifiedSelect.d.ts +0 -133
- package/CapUnifiedSelect/CapUnifiedSelect.d.ts.map +0 -1
- package/CapUnifiedSelect/constants.d.ts.map +0 -1
- package/CapUnifiedSelect/index.js.map +0 -1
- package/CapUnifiedSelect/types.d.ts.map +0 -1
- package/index.js.map +0 -1
- /package/{CapAlert → dist/CapAlert}/CapAlert.d.ts +0 -0
- /package/{CapAlert → dist/CapAlert}/CapAlert.d.ts.map +0 -0
- /package/{CapAlert → dist/CapAlert}/CapAlert.test.d.ts +0 -0
- /package/{CapAlert → dist/CapAlert}/CapAlert.test.d.ts.map +0 -0
- /package/{CapAlert → dist/CapAlert}/index.d.ts +0 -0
- /package/{CapAlert → dist/CapAlert}/index.d.ts.map +0 -0
- /package/{CapAlert → dist/CapAlert}/index.js +0 -0
- /package/{CapAlert → dist/CapAlert}/index.js.map +0 -0
- /package/{CapButton → dist/CapButton}/CapButton.d.ts +0 -0
- /package/{CapButton → dist/CapButton}/CapButton.d.ts.map +0 -0
- /package/{CapButton → dist/CapButton}/CapButton.test.d.ts +0 -0
- /package/{CapButton → dist/CapButton}/CapButton.test.d.ts.map +0 -0
- /package/{CapButton → dist/CapButton}/index.d.ts +0 -0
- /package/{CapButton → dist/CapButton}/index.d.ts.map +0 -0
- /package/{CapButton → dist/CapButton}/index.js +0 -0
- /package/{CapButton → dist/CapButton}/index.js.map +0 -0
- /package/{CapCard → dist/CapCard}/CapCard.d.ts +0 -0
- /package/{CapCard → dist/CapCard}/CapCard.d.ts.map +0 -0
- /package/{CapCard → dist/CapCard}/CapCard.test.d.ts +0 -0
- /package/{CapCard → dist/CapCard}/CapCard.test.d.ts.map +0 -0
- /package/{CapCard → dist/CapCard}/index.d.ts +0 -0
- /package/{CapCard → dist/CapCard}/index.d.ts.map +0 -0
- /package/{CapCard → dist/CapCard}/index.js +0 -0
- /package/{CapCard → dist/CapCard}/index.js.map +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/CapCheckbox.d.ts +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/CapCheckbox.d.ts.map +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/CapCheckbox.test.d.ts +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/CapCheckbox.test.d.ts.map +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/index.d.ts +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/index.d.ts.map +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/index.js +0 -0
- /package/{CapCheckbox → dist/CapCheckbox}/index.js.map +0 -0
- /package/{CapColumn → dist/CapColumn}/CapColumn.d.ts +0 -0
- /package/{CapColumn → dist/CapColumn}/CapColumn.d.ts.map +0 -0
- /package/{CapColumn → dist/CapColumn}/CapColumn.test.d.ts +0 -0
- /package/{CapColumn → dist/CapColumn}/CapColumn.test.d.ts.map +0 -0
- /package/{CapColumn → dist/CapColumn}/index.d.ts +0 -0
- /package/{CapColumn → dist/CapColumn}/index.d.ts.map +0 -0
- /package/{CapColumn → dist/CapColumn}/index.js +0 -0
- /package/{CapColumn → dist/CapColumn}/index.js.map +0 -0
- /package/{CapDivider → dist/CapDivider}/CapDivider.d.ts +0 -0
- /package/{CapDivider → dist/CapDivider}/CapDivider.d.ts.map +0 -0
- /package/{CapDivider → dist/CapDivider}/CapDivider.test.d.ts +0 -0
- /package/{CapDivider → dist/CapDivider}/CapDivider.test.d.ts.map +0 -0
- /package/{CapDivider → dist/CapDivider}/index.d.ts +0 -0
- /package/{CapDivider → dist/CapDivider}/index.d.ts.map +0 -0
- /package/{CapDivider → dist/CapDivider}/index.js +0 -0
- /package/{CapDivider → dist/CapDivider}/index.js.map +0 -0
- /package/{CapDropdown → dist/CapDropdown}/CapDropdown.d.ts +0 -0
- /package/{CapDropdown → dist/CapDropdown}/CapDropdown.d.ts.map +0 -0
- /package/{CapDropdown → dist/CapDropdown}/CapDropdown.test.d.ts +0 -0
- /package/{CapDropdown → dist/CapDropdown}/CapDropdown.test.d.ts.map +0 -0
- /package/{CapDropdown → dist/CapDropdown}/index.d.ts +0 -0
- /package/{CapDropdown → dist/CapDropdown}/index.d.ts.map +0 -0
- /package/{CapDropdown → dist/CapDropdown}/index.js +0 -0
- /package/{CapDropdown → dist/CapDropdown}/index.js.map +0 -0
- /package/{CapForm → dist/CapForm}/CapForm.d.ts +0 -0
- /package/{CapForm → dist/CapForm}/CapForm.d.ts.map +0 -0
- /package/{CapForm → dist/CapForm}/CapForm.test.d.ts +0 -0
- /package/{CapForm → dist/CapForm}/CapForm.test.d.ts.map +0 -0
- /package/{CapForm → dist/CapForm}/index.d.ts +0 -0
- /package/{CapForm → dist/CapForm}/index.d.ts.map +0 -0
- /package/{CapForm → dist/CapForm}/index.js +0 -0
- /package/{CapForm → dist/CapForm}/index.js.map +0 -0
- /package/{CapFormItem → dist/CapFormItem}/CapFormItem.d.ts +0 -0
- /package/{CapFormItem → dist/CapFormItem}/CapFormItem.d.ts.map +0 -0
- /package/{CapFormItem → dist/CapFormItem}/CapFormItem.test.d.ts +0 -0
- /package/{CapFormItem → dist/CapFormItem}/CapFormItem.test.d.ts.map +0 -0
- /package/{CapFormItem → dist/CapFormItem}/index.d.ts +0 -0
- /package/{CapFormItem → dist/CapFormItem}/index.d.ts.map +0 -0
- /package/{CapFormItem → dist/CapFormItem}/index.js +0 -0
- /package/{CapFormItem → dist/CapFormItem}/index.js.map +0 -0
- /package/{CapIcon → dist/CapIcon}/CapIcon.d.ts +0 -0
- /package/{CapIcon → dist/CapIcon}/CapIcon.d.ts.map +0 -0
- /package/{CapIcon → dist/CapIcon}/CapIcon.test.d.ts +0 -0
- /package/{CapIcon → dist/CapIcon}/CapIcon.test.d.ts.map +0 -0
- /package/{CapIcon → dist/CapIcon}/index.d.ts +0 -0
- /package/{CapIcon → dist/CapIcon}/index.d.ts.map +0 -0
- /package/{CapIcon → dist/CapIcon}/index.js +0 -0
- /package/{CapIcon → dist/CapIcon}/index.js.map +0 -0
- /package/{CapInput → dist/CapInput}/CapInput.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/CapInput.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/CapInput.test.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/CapInput.test.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/Number.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/Number.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/Number.test.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/Number.test.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/Search.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/Search.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/Search.test.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/Search.test.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/TextArea.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/TextArea.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/TextArea.test.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/TextArea.test.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/index.d.ts +0 -0
- /package/{CapInput → dist/CapInput}/index.d.ts.map +0 -0
- /package/{CapInput → dist/CapInput}/index.js +0 -0
- /package/{CapInput → dist/CapInput}/index.js.map +0 -0
- /package/{CapLabel → dist/CapLabel}/CapLabel.d.ts +0 -0
- /package/{CapLabel → dist/CapLabel}/CapLabel.d.ts.map +0 -0
- /package/{CapLabel → dist/CapLabel}/CapLabel.test.d.ts +0 -0
- /package/{CapLabel → dist/CapLabel}/CapLabel.test.d.ts.map +0 -0
- /package/{CapLabel → dist/CapLabel}/index.d.ts +0 -0
- /package/{CapLabel → dist/CapLabel}/index.d.ts.map +0 -0
- /package/{CapLabel → dist/CapLabel}/index.js +0 -0
- /package/{CapLabel → dist/CapLabel}/index.js.map +0 -0
- /package/{CapMenu → dist/CapMenu}/CapMenu.d.ts +0 -0
- /package/{CapMenu → dist/CapMenu}/CapMenu.d.ts.map +0 -0
- /package/{CapMenu → dist/CapMenu}/CapMenu.test.d.ts +0 -0
- /package/{CapMenu → dist/CapMenu}/CapMenu.test.d.ts.map +0 -0
- /package/{CapMenu → dist/CapMenu}/index.d.ts +0 -0
- /package/{CapMenu → dist/CapMenu}/index.d.ts.map +0 -0
- /package/{CapMenu → dist/CapMenu}/index.js +0 -0
- /package/{CapMenu → dist/CapMenu}/index.js.map +0 -0
- /package/{CapRadio → dist/CapRadio}/CapRadio.d.ts +0 -0
- /package/{CapRadio → dist/CapRadio}/CapRadio.d.ts.map +0 -0
- /package/{CapRadio → dist/CapRadio}/CapRadio.test.d.ts +0 -0
- /package/{CapRadio → dist/CapRadio}/CapRadio.test.d.ts.map +0 -0
- /package/{CapRadio → dist/CapRadio}/index.d.ts +0 -0
- /package/{CapRadio → dist/CapRadio}/index.d.ts.map +0 -0
- /package/{CapRadio → dist/CapRadio}/index.js +0 -0
- /package/{CapRadio → dist/CapRadio}/index.js.map +0 -0
- /package/{CapRow → dist/CapRow}/CapRow.d.ts +0 -0
- /package/{CapRow → dist/CapRow}/CapRow.d.ts.map +0 -0
- /package/{CapRow → dist/CapRow}/CapRow.test.d.ts +0 -0
- /package/{CapRow → dist/CapRow}/CapRow.test.d.ts.map +0 -0
- /package/{CapRow → dist/CapRow}/index.d.ts +0 -0
- /package/{CapRow → dist/CapRow}/index.d.ts.map +0 -0
- /package/{CapRow → dist/CapRow}/index.js +0 -0
- /package/{CapRow → dist/CapRow}/index.js.map +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/CapSkeleton.d.ts +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/CapSkeleton.d.ts.map +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/CapSkeleton.test.d.ts +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/CapSkeleton.test.d.ts.map +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/index.d.ts +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/index.d.ts.map +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/index.js +0 -0
- /package/{CapSkeleton → dist/CapSkeleton}/index.js.map +0 -0
- /package/{CapSpin → dist/CapSpin}/CapSpin.d.ts +0 -0
- /package/{CapSpin → dist/CapSpin}/CapSpin.d.ts.map +0 -0
- /package/{CapSpin → dist/CapSpin}/CapSpin.test.d.ts +0 -0
- /package/{CapSpin → dist/CapSpin}/CapSpin.test.d.ts.map +0 -0
- /package/{CapSpin → dist/CapSpin}/index.d.ts +0 -0
- /package/{CapSpin → dist/CapSpin}/index.d.ts.map +0 -0
- /package/{CapSpin → dist/CapSpin}/index.js +0 -0
- /package/{CapSpin → dist/CapSpin}/index.js.map +0 -0
- /package/{CapSwitch → dist/CapSwitch}/CapSwitch.d.ts +0 -0
- /package/{CapSwitch → dist/CapSwitch}/CapSwitch.d.ts.map +0 -0
- /package/{CapSwitch → dist/CapSwitch}/CapSwitch.test.d.ts +0 -0
- /package/{CapSwitch → dist/CapSwitch}/CapSwitch.test.d.ts.map +0 -0
- /package/{CapSwitch → dist/CapSwitch}/index.d.ts +0 -0
- /package/{CapSwitch → dist/CapSwitch}/index.d.ts.map +0 -0
- /package/{CapSwitch → dist/CapSwitch}/index.js +0 -0
- /package/{CapSwitch → dist/CapSwitch}/index.js.map +0 -0
- /package/{CapTab → dist/CapTab}/CapTab.d.ts +0 -0
- /package/{CapTab → dist/CapTab}/CapTab.d.ts.map +0 -0
- /package/{CapTab → dist/CapTab}/CapTab.test.d.ts +0 -0
- /package/{CapTab → dist/CapTab}/CapTab.test.d.ts.map +0 -0
- /package/{CapTab → dist/CapTab}/index.d.ts +0 -0
- /package/{CapTab → dist/CapTab}/index.d.ts.map +0 -0
- /package/{CapTab → dist/CapTab}/index.js +0 -0
- /package/{CapTab → dist/CapTab}/index.js.map +0 -0
- /package/{CapTable → dist/CapTable}/CapTable.d.ts +0 -0
- /package/{CapTable → dist/CapTable}/CapTable.d.ts.map +0 -0
- /package/{CapTable → dist/CapTable}/CapTable.test.d.ts +0 -0
- /package/{CapTable → dist/CapTable}/CapTable.test.d.ts.map +0 -0
- /package/{CapTable → dist/CapTable}/index.d.ts +0 -0
- /package/{CapTable → dist/CapTable}/index.d.ts.map +0 -0
- /package/{CapTable → dist/CapTable}/index.js +0 -0
- /package/{CapTable → dist/CapTable}/index.js.map +0 -0
- /package/{CapTable → dist/CapTable}/loadable.d.ts +0 -0
- /package/{CapTable → dist/CapTable}/loadable.d.ts.map +0 -0
- /package/{CapTable → dist/CapTable}/loadable.test.d.ts +0 -0
- /package/{CapTable → dist/CapTable}/loadable.test.d.ts.map +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/CapTestSelect.d.ts +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/CapTestSelect.d.ts.map +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/CapTestSelect.test.d.ts +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/CapTestSelect.test.d.ts.map +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/index.d.ts +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/index.d.ts.map +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/index.js +0 -0
- /package/{CapTestSelect → dist/CapTestSelect}/index.js.map +0 -0
- /package/{CapTooltip → dist/CapTooltip}/CapTooltip.d.ts +0 -0
- /package/{CapTooltip → dist/CapTooltip}/CapTooltip.d.ts.map +0 -0
- /package/{CapTooltip → dist/CapTooltip}/CapTooltip.test.d.ts +0 -0
- /package/{CapTooltip → dist/CapTooltip}/CapTooltip.test.d.ts.map +0 -0
- /package/{CapTooltip → dist/CapTooltip}/index.d.ts +0 -0
- /package/{CapTooltip → dist/CapTooltip}/index.d.ts.map +0 -0
- /package/{CapTooltip → dist/CapTooltip}/index.js +0 -0
- /package/{CapTooltip → dist/CapTooltip}/index.js.map +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/CapTooltipWithInfo.d.ts +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/CapTooltipWithInfo.d.ts.map +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/CapTooltipWithInfo.test.d.ts +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/CapTooltipWithInfo.test.d.ts.map +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/index.d.ts +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/index.d.ts.map +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/index.js +0 -0
- /package/{CapTooltipWithInfo → dist/CapTooltipWithInfo}/index.js.map +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/CapUnifiedSelect.test.d.ts +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/CapUnifiedSelect.test.d.ts.map +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/components.d.ts +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/components.d.ts.map +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/index.d.ts +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/index.d.ts.map +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/messages.d.ts +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/messages.d.ts.map +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/testData.d.ts +0 -0
- /package/{CapUnifiedSelect → dist/CapUnifiedSelect}/testData.d.ts.map +0 -0
- /package/{LocaleHoc → dist/LocaleHoc}/index.d.ts +0 -0
- /package/{LocaleHoc → dist/LocaleHoc}/index.d.ts.map +0 -0
- /package/{LocaleHoc → dist/LocaleHoc}/index.js +0 -0
- /package/{LocaleHoc → dist/LocaleHoc}/index.js.map +0 -0
- /package/{LocaleHoc → dist/LocaleHoc}/index.test.d.ts +0 -0
- /package/{LocaleHoc → dist/LocaleHoc}/index.test.d.ts.map +0 -0
- /package/{assets → dist/assets}/upload.svg +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.d.ts.map → dist/index.d.ts.map} +0 -0
- /package/{utils → dist/utils}/fonts.d.ts +0 -0
- /package/{utils → dist/utils}/fonts.d.ts.map +0 -0
- /package/{utils → dist/utils}/fonts.test.d.ts +0 -0
- /package/{utils → dist/utils}/fonts.test.d.ts.map +0 -0
- /package/{utils → dist/utils}/index.d.ts +0 -0
- /package/{utils → dist/utils}/index.d.ts.map +0 -0
- /package/{utils → dist/utils}/index.js +0 -0
- /package/{utils → dist/utils}/index.js.map +0 -0
- /package/{utils → dist/utils}/styles.d.ts +0 -0
- /package/{utils → dist/utils}/styles.d.ts.map +0 -0
|
@@ -97,147 +97,809 @@ exports.SelectAllCheckbox = SelectAllCheckbox;
|
|
|
97
97
|
|
|
98
98
|
/***/ }),
|
|
99
99
|
|
|
100
|
-
/***/
|
|
101
|
-
/***/ ((module) => {
|
|
102
|
-
|
|
103
|
-
"use strict";
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/* istanbul ignore next */
|
|
107
|
-
function insertStyleElement(options) {
|
|
108
|
-
var element = document.createElement("style");
|
|
109
|
-
options.setAttributes(element, options.attributes);
|
|
110
|
-
options.insert(element, options.options);
|
|
111
|
-
return element;
|
|
112
|
-
}
|
|
113
|
-
module.exports = insertStyleElement;
|
|
114
|
-
|
|
115
|
-
/***/ }),
|
|
116
|
-
|
|
117
|
-
/***/ 1020:
|
|
118
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
119
|
-
|
|
120
|
-
"use strict";
|
|
121
|
-
/**
|
|
122
|
-
* @license React
|
|
123
|
-
* react-jsx-runtime.production.min.js
|
|
124
|
-
*
|
|
125
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the MIT license found in the
|
|
128
|
-
* LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/
|
|
130
|
-
var f=__webpack_require__(9206),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
131
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/***/ }),
|
|
135
|
-
|
|
136
|
-
/***/ 1549:
|
|
100
|
+
/***/ 480:
|
|
137
101
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
138
102
|
|
|
139
103
|
"use strict";
|
|
140
104
|
|
|
141
105
|
|
|
142
106
|
exports.__esModule = true;
|
|
143
|
-
exports
|
|
144
|
-
var
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
107
|
+
exports.useCapUnifiedSelect = void 0;
|
|
108
|
+
var _react = __webpack_require__(9206);
|
|
109
|
+
var _constants = __webpack_require__(9788);
|
|
110
|
+
var _useInfiniteScroll = __webpack_require__(9103);
|
|
111
|
+
var _utils = __webpack_require__(8052);
|
|
112
|
+
const useCapUnifiedSelect = _ref => {
|
|
113
|
+
let {
|
|
114
|
+
type: _type,
|
|
115
|
+
options,
|
|
116
|
+
value,
|
|
117
|
+
onChange,
|
|
118
|
+
staticValue,
|
|
119
|
+
onSearch,
|
|
120
|
+
searchDebounce,
|
|
121
|
+
searchBasedOn,
|
|
122
|
+
onConfirm,
|
|
123
|
+
resetSearch,
|
|
124
|
+
resetData,
|
|
125
|
+
fetchMissingOptions,
|
|
126
|
+
onPopupScroll,
|
|
127
|
+
hasMore,
|
|
128
|
+
customPopupRender,
|
|
129
|
+
isMulti,
|
|
130
|
+
disabled = false
|
|
131
|
+
} = _ref;
|
|
132
|
+
const [searchText, setSearchText] = (0, _react.useState)('');
|
|
133
|
+
const [tempValue, setTempValue] = (0, _react.useState)(value);
|
|
134
|
+
const [dropdownOpen, setDropdownOpen] = (0, _react.useState)(false);
|
|
135
|
+
const [isSearching, setIsSearching] = (0, _react.useState)(false);
|
|
136
|
+
const [isResettingData, setIsResettingData] = (0, _react.useState)(false);
|
|
137
|
+
const [orderedOptions, setOrderedOptions] = (0, _react.useState)(null);
|
|
138
|
+
const searchTimeoutRef = (0, _react.useRef)(null);
|
|
139
|
+
const optionsRef = (0, _react.useRef)(options);
|
|
140
|
+
const selectedItemsCacheRef = (0, _react.useRef)(new Map());
|
|
141
|
+
const lastSearchQueryRef = (0, _react.useRef)('');
|
|
142
|
+
const searchClearedTimeRef = (0, _react.useRef)(null);
|
|
143
|
+
const prevOptionsRef = (0, _react.useRef)(options);
|
|
144
|
+
const prevOptionsBeforeResetRef = (0, _react.useRef)(options);
|
|
145
|
+
const initialSortDoneRef = (0, _react.useRef)(false);
|
|
146
|
+
const hasInteractedRef = (0, _react.useRef)(false);
|
|
147
|
+
const initialTempValueRef = (0, _react.useRef)(value);
|
|
148
|
+
const resetDataCalledRef = (0, _react.useRef)(false);
|
|
149
|
+
const resetDataCalledTimeRef = (0, _react.useRef)(null);
|
|
150
|
+
const fetchMissingOptionsCalledRef = (0, _react.useRef)(false);
|
|
151
|
+
const lastMissingValuesRef = (0, _react.useRef)('');
|
|
155
152
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
// Infinite scroll hook
|
|
154
|
+
const {
|
|
155
|
+
isLoadingOnScroll,
|
|
156
|
+
resetScrollState,
|
|
157
|
+
scrollTriggerOptionsCountRef
|
|
158
|
+
} = (0, _useInfiniteScroll.useInfiniteScroll)({
|
|
159
|
+
onPopupScroll,
|
|
160
|
+
hasMore,
|
|
161
|
+
options,
|
|
162
|
+
dropdownOpen,
|
|
163
|
+
optionsRef,
|
|
164
|
+
hasInteractedRef
|
|
165
|
+
});
|
|
166
|
+
(0, _react.useEffect)(() => {
|
|
167
|
+
if (!fetchMissingOptions) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (options.length === 0) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const hasActiveSearch = !staticValue && lastSearchQueryRef.current.trim().length > 0;
|
|
174
|
+
if (hasActiveSearch) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
178
|
+
if (selectedValues.length === 0) {
|
|
179
|
+
fetchMissingOptionsCalledRef.current = false;
|
|
180
|
+
lastMissingValuesRef.current = '';
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const missingValues = (0, _utils.findMissingValues)(selectedValues, options);
|
|
184
|
+
if (missingValues.length === 0) {
|
|
185
|
+
fetchMissingOptionsCalledRef.current = false;
|
|
186
|
+
lastMissingValuesRef.current = '';
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const missingValuesKey = [...missingValues].sort().join(',');
|
|
190
|
+
if (!fetchMissingOptionsCalledRef.current || lastMissingValuesRef.current !== missingValuesKey) {
|
|
191
|
+
fetchMissingOptionsCalledRef.current = true;
|
|
192
|
+
lastMissingValuesRef.current = missingValuesKey;
|
|
193
|
+
fetchMissingOptions([...missingValues]);
|
|
194
|
+
}
|
|
195
|
+
}, [value, options, fetchMissingOptions, staticValue]);
|
|
196
|
+
(0, _react.useEffect)(() => {
|
|
197
|
+
const isEqual = Array.isArray(value) && Array.isArray(tempValue) ? (value == null ? void 0 : value.length) === (tempValue == null ? void 0 : tempValue.length) && value.every(v => Array.isArray(tempValue) && tempValue.includes(v)) : value === tempValue;
|
|
198
|
+
if (!isEqual) {
|
|
199
|
+
setTempValue(value);
|
|
200
|
+
setOrderedOptions(null);
|
|
201
|
+
}
|
|
202
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
203
|
+
}, [value]);
|
|
204
|
+
(0, _react.useEffect)(() => {
|
|
205
|
+
const currentSelected = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
206
|
+
const findAndCacheOption = (opts, val) => {
|
|
207
|
+
for (const opt of opts) {
|
|
208
|
+
if (opt.value === val) {
|
|
209
|
+
selectedItemsCacheRef.current.set(val, opt);
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
if (opt.children && opt.children.length > 0) {
|
|
213
|
+
if (findAndCacheOption(opt.children, val)) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
};
|
|
220
|
+
currentSelected.forEach(val => {
|
|
221
|
+
if (!selectedItemsCacheRef.current.has(val)) {
|
|
222
|
+
findAndCacheOption(options, val);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
const selectedSet = new Set(currentSelected);
|
|
226
|
+
selectedItemsCacheRef.current.forEach((_, value) => {
|
|
227
|
+
if (!selectedSet.has(value)) {
|
|
228
|
+
selectedItemsCacheRef.current.delete(value);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}, [tempValue, options]);
|
|
232
|
+
(0, _react.useEffect)(() => {
|
|
233
|
+
if (orderedOptions) {
|
|
234
|
+
const currentSelected = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
235
|
+
const allSelectedStillExist = currentSelected.every(val => (0, _utils.findValueInOptions)(options, val));
|
|
236
|
+
if (!allSelectedStillExist) {
|
|
237
|
+
setOrderedOptions(null);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}, [options, orderedOptions, tempValue]);
|
|
241
|
+
const debounceTimeout = searchDebounce != null ? searchDebounce : _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE;
|
|
159
242
|
|
|
160
|
-
|
|
243
|
+
// Cleanup timeouts on unmount
|
|
244
|
+
(0, _react.useEffect)(() => {
|
|
245
|
+
return () => {
|
|
246
|
+
if (searchTimeoutRef.current) {
|
|
247
|
+
clearTimeout(searchTimeoutRef.current);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}, []);
|
|
251
|
+
(0, _react.useEffect)(() => {
|
|
252
|
+
const hasSearchQuery = lastSearchQueryRef.current !== null && lastSearchQueryRef.current !== undefined;
|
|
253
|
+
if (staticValue || !isSearching || !hasSearchQuery) {
|
|
254
|
+
prevOptionsRef.current = options;
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const optionsChanged = prevOptionsRef.current !== options || prevOptionsRef.current.length !== options.length;
|
|
258
|
+
const searchCleared = lastSearchQueryRef.current === '';
|
|
259
|
+
const timeSinceCleared = searchClearedTimeRef.current ? Date.now() - searchClearedTimeRef.current : Infinity;
|
|
260
|
+
const hasOptionsData = options.length > 0;
|
|
261
|
+
const clearedSearchReady = searchCleared && hasOptionsData && timeSinceCleared > _constants.TIMEOUTS.SEARCH_CLEARED_TIMEOUT;
|
|
262
|
+
if (optionsChanged || clearedSearchReady) {
|
|
263
|
+
const timeoutId = setTimeout(() => {
|
|
264
|
+
setIsSearching(false);
|
|
265
|
+
prevOptionsRef.current = options;
|
|
266
|
+
if (searchCleared) {
|
|
267
|
+
searchClearedTimeRef.current = null;
|
|
268
|
+
}
|
|
269
|
+
}, _constants.TIMEOUTS.SEARCH_STATE_UPDATE_DELAY);
|
|
270
|
+
return () => clearTimeout(timeoutId);
|
|
271
|
+
}
|
|
272
|
+
prevOptionsRef.current = options;
|
|
273
|
+
}, [options, staticValue, isSearching]);
|
|
274
|
+
(0, _react.useEffect)(() => {
|
|
275
|
+
const hasSearchQuery = lastSearchQueryRef.current !== null && lastSearchQueryRef.current !== undefined;
|
|
276
|
+
if (!isSearching || staticValue || !hasSearchQuery) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const searchCleared = lastSearchQueryRef.current === '';
|
|
280
|
+
const timeoutDuration = searchCleared ? debounceTimeout + _constants.TIMEOUTS.SEARCH_CLEARED_BUFFER : debounceTimeout + _constants.TIMEOUTS.SEARCH_REGULAR_BUFFER;
|
|
281
|
+
const fallbackTimeout = setTimeout(() => {
|
|
282
|
+
setIsSearching(false);
|
|
283
|
+
searchClearedTimeRef.current = null;
|
|
284
|
+
}, timeoutDuration);
|
|
285
|
+
return () => clearTimeout(fallbackTimeout);
|
|
286
|
+
}, [isSearching, staticValue, debounceTimeout, options.length]);
|
|
287
|
+
(0, _react.useEffect)(() => {
|
|
288
|
+
if (!isResettingData) {
|
|
289
|
+
prevOptionsBeforeResetRef.current = options;
|
|
290
|
+
resetDataCalledTimeRef.current = null;
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const prevOptions = prevOptionsBeforeResetRef.current;
|
|
294
|
+
const currentOptions = options;
|
|
295
|
+
const optionsChanged = prevOptions !== currentOptions || prevOptions.length !== currentOptions.length || prevOptions.length === currentOptions.length && prevOptions.length > 0 && prevOptions.some((prevOpt, idx) => {
|
|
296
|
+
const currentOpt = currentOptions[idx];
|
|
297
|
+
return !currentOpt || prevOpt.value !== currentOpt.value || prevOpt.label !== currentOpt.label;
|
|
298
|
+
});
|
|
299
|
+
const timeSinceReset = resetDataCalledTimeRef.current ? Date.now() - resetDataCalledTimeRef.current : Infinity;
|
|
300
|
+
const hasDataAfterTimeout = currentOptions.length > 0 && timeSinceReset > _constants.TIMEOUTS.RESET_DATA_MIN_TIME && timeSinceReset < _constants.TIMEOUTS.RESET_DATA_MAX_TIME;
|
|
301
|
+
if (optionsChanged || hasDataAfterTimeout) {
|
|
302
|
+
setIsResettingData(false);
|
|
303
|
+
prevOptionsBeforeResetRef.current = currentOptions;
|
|
304
|
+
resetDataCalledTimeRef.current = null;
|
|
305
|
+
}
|
|
306
|
+
}, [options, isResettingData]);
|
|
307
|
+
(0, _react.useEffect)(() => {
|
|
308
|
+
if (!isResettingData) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const fallbackTimeout = setTimeout(() => {
|
|
312
|
+
setIsResettingData(false);
|
|
313
|
+
prevOptionsBeforeResetRef.current = options;
|
|
314
|
+
resetDataCalledTimeRef.current = null;
|
|
315
|
+
}, _constants.TIMEOUTS.RESET_DATA_TIMEOUT);
|
|
316
|
+
return () => clearTimeout(fallbackTimeout);
|
|
317
|
+
}, [isResettingData, options]);
|
|
161
318
|
|
|
162
|
-
|
|
163
|
-
|
|
319
|
+
/**
|
|
320
|
+
* Unified helper function to call resetData with proper state management.
|
|
321
|
+
* This centralizes all resetData logic to avoid duplication and ensure consistency.
|
|
322
|
+
*
|
|
323
|
+
* @param shouldReset - Whether to actually call resetData (based on conditions)
|
|
324
|
+
*/
|
|
325
|
+
const callResetData = (0, _react.useCallback)(function (shouldReset) {
|
|
326
|
+
if (shouldReset === void 0) {
|
|
327
|
+
shouldReset = true;
|
|
328
|
+
}
|
|
329
|
+
if (!resetData || !shouldReset || options.length === 0) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
prevOptionsBeforeResetRef.current = options;
|
|
333
|
+
setIsResettingData(true);
|
|
334
|
+
resetDataCalledRef.current = true;
|
|
335
|
+
resetDataCalledTimeRef.current = Date.now();
|
|
336
|
+
resetData();
|
|
337
|
+
}, [resetData, options]);
|
|
338
|
+
const handleSearch = (0, _react.useCallback)(query => {
|
|
339
|
+
if (searchTimeoutRef.current) {
|
|
340
|
+
clearTimeout(searchTimeoutRef.current);
|
|
341
|
+
}
|
|
342
|
+
const trimmedQuery = query.trim();
|
|
343
|
+
const wasSearching = lastSearchQueryRef.current !== '';
|
|
344
|
+
const isNowCleared = trimmedQuery === '';
|
|
345
|
+
if (wasSearching && isNowCleared) {
|
|
346
|
+
searchClearedTimeRef.current = Date.now();
|
|
347
|
+
} else if (!isNowCleared) {
|
|
348
|
+
searchClearedTimeRef.current = null;
|
|
349
|
+
}
|
|
350
|
+
lastSearchQueryRef.current = trimmedQuery;
|
|
351
|
+
if (trimmedQuery.length > 0 || lastSearchQueryRef.current.length > 0) {
|
|
352
|
+
hasInteractedRef.current = true;
|
|
353
|
+
}
|
|
164
354
|
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
355
|
+
// Reset data when search is cleared (search term length < 1)
|
|
356
|
+
// This handles requirement: "when search term is length less than 1 that is no search needed"
|
|
357
|
+
// and "when click on X in searched term then we are resetting the data to the initial page"
|
|
358
|
+
if (isNowCleared && wasSearching && !staticValue) {
|
|
359
|
+
callResetData();
|
|
360
|
+
}
|
|
361
|
+
if (!staticValue && onSearch) {
|
|
362
|
+
setIsSearching(true);
|
|
363
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
364
|
+
onSearch(trimmedQuery);
|
|
365
|
+
}, debounceTimeout);
|
|
366
|
+
} else if (!trimmedQuery) {
|
|
367
|
+
setIsSearching(false);
|
|
368
|
+
} else {
|
|
369
|
+
setIsSearching(true);
|
|
370
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
371
|
+
setIsSearching(false);
|
|
372
|
+
}, _constants.TIMEOUTS.STATIC_SEARCH_DELAY);
|
|
373
|
+
}
|
|
374
|
+
}, [onSearch, staticValue, debounceTimeout, callResetData]);
|
|
375
|
+
const prevOptionsCountBeforeFetchMissingRef = (0, _react.useRef)(options.length);
|
|
376
|
+
const prevOptionsBeforeFetchMissingRef = (0, _react.useRef)(options);
|
|
377
|
+
(0, _react.useEffect)(() => {
|
|
378
|
+
if (!orderedOptions || !onPopupScroll) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const currentOptions = options;
|
|
382
|
+
const optionsCountIncreased = currentOptions.length > scrollTriggerOptionsCountRef.current;
|
|
383
|
+
if (optionsCountIncreased && scrollTriggerOptionsCountRef.current > 0) {
|
|
384
|
+
const selectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
385
|
+
if (selectedValues.length > 0) {
|
|
386
|
+
const reordered = (0, _utils.reorderOptionsBySelection)(currentOptions, selectedValues);
|
|
387
|
+
setOrderedOptions(reordered);
|
|
388
|
+
scrollTriggerOptionsCountRef.current = currentOptions.length;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
392
|
+
}, [options, orderedOptions, onPopupScroll, tempValue]);
|
|
393
|
+
(0, _react.useEffect)(() => {
|
|
394
|
+
if (!fetchMissingOptions) {
|
|
395
|
+
prevOptionsCountBeforeFetchMissingRef.current = options.length;
|
|
396
|
+
prevOptionsBeforeFetchMissingRef.current = options;
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const hasActiveSearch = !staticValue && lastSearchQueryRef.current.trim().length > 0;
|
|
400
|
+
if (hasActiveSearch) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const currentOptions = options;
|
|
404
|
+
const currentSelectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
405
|
+
const tempSelectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
406
|
+
const selectedValues = tempSelectedValues.length > 0 ? tempSelectedValues : currentSelectedValues;
|
|
407
|
+
if (selectedValues.length === 0) {
|
|
408
|
+
prevOptionsCountBeforeFetchMissingRef.current = currentOptions.length;
|
|
409
|
+
prevOptionsBeforeFetchMissingRef.current = currentOptions;
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const prevOptions = prevOptionsBeforeFetchMissingRef.current;
|
|
413
|
+
const optionsCountIncreased = currentOptions.length > prevOptionsCountBeforeFetchMissingRef.current;
|
|
414
|
+
const optionsChanged = prevOptions !== currentOptions || optionsCountIncreased;
|
|
415
|
+
const hasNewlyFetchedSelectedItems = (() => {
|
|
416
|
+
if (selectedValues.length === 0 || !optionsChanged) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
const previouslyMissingValues = selectedValues.filter(val => !(0, _utils.findValueInOptions)(prevOptions, val));
|
|
420
|
+
if (previouslyMissingValues.length === 0) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
const nowPresentValues = previouslyMissingValues.filter(val => (0, _utils.findValueInOptions)(currentOptions, val));
|
|
424
|
+
return nowPresentValues.length > 0;
|
|
425
|
+
})();
|
|
426
|
+
if (optionsChanged && hasNewlyFetchedSelectedItems) {
|
|
427
|
+
const reordered = (0, _utils.reorderOptionsBySelection)(currentOptions, selectedValues);
|
|
428
|
+
setOrderedOptions(reordered);
|
|
429
|
+
}
|
|
430
|
+
prevOptionsCountBeforeFetchMissingRef.current = currentOptions.length;
|
|
431
|
+
prevOptionsBeforeFetchMissingRef.current = currentOptions;
|
|
432
|
+
}, [options, value, tempValue, fetchMissingOptions, staticValue]);
|
|
433
|
+
(0, _react.useEffect)(() => {
|
|
434
|
+
if (initialSortDoneRef.current || !(options != null && options.length)) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
438
|
+
if (selectedValues.length === 0) {
|
|
439
|
+
initialSortDoneRef.current = true;
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const hasSelectedInOptions = selectedValues.some(val => (0, _utils.findValueInOptions)(options, val));
|
|
443
|
+
if (hasSelectedInOptions) {
|
|
444
|
+
const reordered = (0, _utils.reorderOptionsBySelection)(options, selectedValues);
|
|
445
|
+
setOrderedOptions(reordered);
|
|
446
|
+
}
|
|
447
|
+
initialSortDoneRef.current = true;
|
|
448
|
+
}, [options, value]);
|
|
203
449
|
|
|
450
|
+
// Data source computation (raw, without React component enhancement)
|
|
451
|
+
const dataSource = (0, _react.useMemo)(() => {
|
|
452
|
+
return (0, _utils.prepareDataSource)(options, orderedOptions, searchText, value, staticValue, selectedItemsCacheRef.current);
|
|
453
|
+
}, [options, orderedOptions, searchText, value, staticValue]);
|
|
204
454
|
|
|
205
|
-
|
|
455
|
+
// Filtered tree
|
|
456
|
+
const filteredTree = (0, _react.useMemo)(() => {
|
|
457
|
+
const selectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
458
|
+
return (0, _utils.filterTreeData)(dataSource, searchText.trim(), searchBasedOn, selectedValues.length > 0 ? selectedValues : undefined);
|
|
459
|
+
}, [dataSource, searchText, searchBasedOn, tempValue]);
|
|
206
460
|
|
|
207
|
-
|
|
208
|
-
|
|
461
|
+
// Tree maps and selected count
|
|
462
|
+
const treeMaps = (0, _react.useMemo)(() => (0, _utils.buildTreeMaps)(options), [options]);
|
|
463
|
+
const selectedLeafCount = (0, _react.useMemo)(() => (0, _utils.countSelectedLeaves)(treeMaps, Array.isArray(tempValue) ? tempValue : undefined), [treeMaps, tempValue]);
|
|
464
|
+
const displayValue = dropdownOpen ? tempValue : value;
|
|
465
|
+
const handleConfirm = (0, _react.useCallback)(() => {
|
|
466
|
+
hasInteractedRef.current = true;
|
|
467
|
+
const optionsToReorder = options;
|
|
468
|
+
if (isMulti && Array.isArray(tempValue) && tempValue.length > 0) {
|
|
469
|
+
const reordered = (0, _utils.reorderOptionsBySelection)(optionsToReorder, tempValue);
|
|
470
|
+
setOrderedOptions(reordered);
|
|
471
|
+
} else if (!isMulti && tempValue && !Array.isArray(tempValue)) {
|
|
472
|
+
const reordered = (0, _utils.reorderOptionsBySelection)(optionsToReorder, [tempValue]);
|
|
473
|
+
setOrderedOptions(reordered);
|
|
474
|
+
} else {
|
|
475
|
+
setOrderedOptions(null);
|
|
476
|
+
}
|
|
477
|
+
onChange == null || onChange(tempValue);
|
|
478
|
+
setDropdownOpen(false);
|
|
479
|
+
setIsSearching(false);
|
|
209
480
|
|
|
210
|
-
|
|
481
|
+
// Check if there was an active search before clearing it
|
|
482
|
+
const hadActiveSearch = !staticValue && lastSearchQueryRef.current.trim().length > 0;
|
|
211
483
|
|
|
484
|
+
// Clear search-related state and timeouts (same as X button behavior)
|
|
485
|
+
if (resetSearch) {
|
|
486
|
+
setSearchText('');
|
|
487
|
+
if (hadActiveSearch) {
|
|
488
|
+
searchClearedTimeRef.current = Date.now();
|
|
489
|
+
} else {
|
|
490
|
+
searchClearedTimeRef.current = null;
|
|
491
|
+
}
|
|
492
|
+
lastSearchQueryRef.current = '';
|
|
493
|
+
}
|
|
212
494
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
495
|
+
// Clear any pending search timeouts
|
|
496
|
+
if (searchTimeoutRef.current) {
|
|
497
|
+
clearTimeout(searchTimeoutRef.current);
|
|
498
|
+
searchTimeoutRef.current = null;
|
|
499
|
+
}
|
|
218
500
|
|
|
219
|
-
|
|
501
|
+
// If there was an active search, trigger onSearch('') to reset data (same as X button)
|
|
502
|
+
// This ensures the parent component resets the options back to initial state
|
|
503
|
+
if (hadActiveSearch && !staticValue && onSearch) {
|
|
504
|
+
onSearch('');
|
|
505
|
+
}
|
|
220
506
|
|
|
221
|
-
|
|
222
|
-
|
|
507
|
+
// Call resetData if there was an active search that we're resetting
|
|
508
|
+
// This handles requirement: "when user click confirm & clear button"
|
|
509
|
+
// Reset data back to initial state after a search + confirm
|
|
510
|
+
callResetData(hadActiveSearch || options.length > 0);
|
|
511
|
+
onConfirm == null || onConfirm(tempValue);
|
|
512
|
+
}, [onChange, onConfirm, tempValue, resetSearch, isMulti, options, callResetData, staticValue, onSearch]);
|
|
513
|
+
const handleClearAll = (0, _react.useCallback)(() => {
|
|
514
|
+
const cleared = isMulti ? [] : undefined;
|
|
515
|
+
setSearchText('');
|
|
516
|
+
setIsSearching(false);
|
|
517
|
+
lastSearchQueryRef.current = '';
|
|
518
|
+
searchClearedTimeRef.current = null;
|
|
519
|
+
if (searchTimeoutRef.current) {
|
|
520
|
+
clearTimeout(searchTimeoutRef.current);
|
|
521
|
+
searchTimeoutRef.current = null;
|
|
522
|
+
}
|
|
523
|
+
resetScrollState();
|
|
524
|
+
setOrderedOptions(null);
|
|
525
|
+
initialSortDoneRef.current = false;
|
|
526
|
+
hasInteractedRef.current = false;
|
|
527
|
+
resetDataCalledRef.current = false;
|
|
528
|
+
fetchMissingOptionsCalledRef.current = false;
|
|
529
|
+
lastMissingValuesRef.current = '';
|
|
530
|
+
setTempValue(cleared);
|
|
531
|
+
onChange == null || onChange(cleared);
|
|
532
|
+
setDropdownOpen(false);
|
|
223
533
|
|
|
224
|
-
|
|
534
|
+
// Call resetData when user clicks clear button
|
|
535
|
+
// This handles requirement: "when user click confirm & clear button"
|
|
536
|
+
callResetData();
|
|
537
|
+
}, [isMulti, onChange, callResetData, resetScrollState]);
|
|
538
|
+
const handleDropdownVisibilityChange = (0, _react.useCallback)(open => {
|
|
539
|
+
if (open) {
|
|
540
|
+
initialTempValueRef.current = value;
|
|
541
|
+
hasInteractedRef.current = false;
|
|
542
|
+
resetDataCalledRef.current = false;
|
|
543
|
+
fetchMissingOptionsCalledRef.current = false;
|
|
544
|
+
lastMissingValuesRef.current = '';
|
|
545
|
+
if (searchTimeoutRef.current) {
|
|
546
|
+
clearTimeout(searchTimeoutRef.current);
|
|
547
|
+
searchTimeoutRef.current = null;
|
|
548
|
+
}
|
|
549
|
+
setIsSearching(false);
|
|
550
|
+
searchClearedTimeRef.current = null;
|
|
551
|
+
resetScrollState();
|
|
552
|
+
if (isResettingData) {
|
|
553
|
+
setIsResettingData(false);
|
|
554
|
+
prevOptionsBeforeResetRef.current = options;
|
|
555
|
+
resetDataCalledTimeRef.current = null;
|
|
556
|
+
}
|
|
557
|
+
} else {
|
|
558
|
+
if (!customPopupRender) {
|
|
559
|
+
onChange == null || onChange(tempValue);
|
|
560
|
+
} else {
|
|
561
|
+
setTempValue(value);
|
|
562
|
+
}
|
|
563
|
+
if (resetSearch) {
|
|
564
|
+
setSearchText('');
|
|
565
|
+
setIsSearching(false);
|
|
566
|
+
lastSearchQueryRef.current = '';
|
|
567
|
+
searchClearedTimeRef.current = null;
|
|
568
|
+
}
|
|
569
|
+
resetScrollState();
|
|
225
570
|
|
|
571
|
+
// Call resetData when dropdown closes if user interacted and resetData wasn't called yet
|
|
572
|
+
if (hasInteractedRef.current && !resetDataCalledRef.current) {
|
|
573
|
+
callResetData();
|
|
574
|
+
} else if (!hasInteractedRef.current) {
|
|
575
|
+
if (searchTimeoutRef.current) {
|
|
576
|
+
clearTimeout(searchTimeoutRef.current);
|
|
577
|
+
searchTimeoutRef.current = null;
|
|
578
|
+
}
|
|
579
|
+
setIsSearching(false);
|
|
580
|
+
setIsResettingData(false);
|
|
581
|
+
lastSearchQueryRef.current = '';
|
|
582
|
+
}
|
|
583
|
+
hasInteractedRef.current = false;
|
|
584
|
+
}
|
|
585
|
+
setDropdownOpen(open);
|
|
586
|
+
}, [customPopupRender, value, onChange, tempValue, resetSearch, callResetData, options, isResettingData, resetScrollState]);
|
|
587
|
+
const handleSearchChange = (0, _react.useCallback)(e => {
|
|
588
|
+
const query = e.target.value;
|
|
589
|
+
setSearchText(query);
|
|
590
|
+
handleSearch(query);
|
|
591
|
+
}, [handleSearch]);
|
|
592
|
+
const handleSearchKeyDown = (0, _react.useCallback)(e => {
|
|
593
|
+
if (e.key === 'Backspace' || e.key === 'Delete') {
|
|
594
|
+
e.stopPropagation();
|
|
595
|
+
}
|
|
596
|
+
if (e.key === 'Escape' && searchText.length > 0) {
|
|
597
|
+
e.stopPropagation();
|
|
598
|
+
}
|
|
599
|
+
}, [searchText]);
|
|
226
600
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
601
|
+
/**
|
|
602
|
+
* Helper function to handle resetData call when value is cleared.
|
|
603
|
+
* Only resets data if there was an active search, as resetting on every unselect
|
|
604
|
+
* would be too aggressive and could reset data unnecessarily when user simply unselects.
|
|
605
|
+
*
|
|
606
|
+
* This addresses the question: "If user unselects or clears current selection then do we need to call resetData?"
|
|
607
|
+
* Answer: Only if there was an active search query, to avoid unnecessary resets.
|
|
608
|
+
*/
|
|
609
|
+
const handleResetDataOnClear = (0, _react.useCallback)(() => {
|
|
610
|
+
// Only reset data if there was an active search query
|
|
611
|
+
// This prevents unnecessary resets when user simply unselects without searching
|
|
612
|
+
const hadActiveSearch = !staticValue && lastSearchQueryRef.current.trim().length > 0;
|
|
613
|
+
callResetData(hadActiveSearch);
|
|
614
|
+
}, [staticValue, callResetData]);
|
|
615
|
+
const handleSingleSelectChange = (0, _react.useCallback)(newValue => {
|
|
616
|
+
if (disabled) {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
if (newValue === undefined || newValue === null) {
|
|
620
|
+
handleResetDataOnClear();
|
|
621
|
+
}
|
|
622
|
+
onChange == null || onChange(newValue);
|
|
623
|
+
}, [onChange, disabled, handleResetDataOnClear]);
|
|
624
|
+
const handleMultiSelectChange = (0, _react.useCallback)(newValue => {
|
|
625
|
+
if (disabled) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
const initialValue = initialTempValueRef.current;
|
|
629
|
+
const hasChanged = Array.isArray(newValue) && Array.isArray(initialValue) ? newValue.length !== initialValue.length || !newValue.every(v => initialValue.includes(v)) || !initialValue.every(v => newValue.includes(v)) : newValue !== initialValue;
|
|
630
|
+
if (hasChanged) {
|
|
631
|
+
hasInteractedRef.current = true;
|
|
632
|
+
}
|
|
633
|
+
if (newValue === undefined || newValue === null || Array.isArray(newValue) && newValue.length === 0) {
|
|
634
|
+
handleResetDataOnClear();
|
|
635
|
+
}
|
|
636
|
+
setTempValue(newValue);
|
|
637
|
+
}, [disabled, handleResetDataOnClear]);
|
|
638
|
+
return {
|
|
639
|
+
searchText,
|
|
640
|
+
setSearchText,
|
|
641
|
+
tempValue,
|
|
642
|
+
setTempValue,
|
|
643
|
+
dropdownOpen,
|
|
644
|
+
isSearching,
|
|
645
|
+
isLoadingOnScroll,
|
|
646
|
+
isResettingData,
|
|
647
|
+
orderedOptions,
|
|
648
|
+
filteredTree,
|
|
649
|
+
treeMaps,
|
|
650
|
+
selectedLeafCount,
|
|
651
|
+
displayValue,
|
|
652
|
+
handleSearch,
|
|
653
|
+
handleSearchChange,
|
|
654
|
+
handleSearchKeyDown,
|
|
655
|
+
handleConfirm,
|
|
656
|
+
handleClearAll,
|
|
657
|
+
handleDropdownVisibilityChange,
|
|
658
|
+
handleSingleSelectChange,
|
|
659
|
+
handleMultiSelectChange,
|
|
660
|
+
selectedItemsCacheRef
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
exports.useCapUnifiedSelect = useCapUnifiedSelect;
|
|
664
|
+
|
|
665
|
+
/***/ }),
|
|
666
|
+
|
|
667
|
+
/***/ 540:
|
|
668
|
+
/***/ ((module) => {
|
|
669
|
+
|
|
670
|
+
"use strict";
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
/* istanbul ignore next */
|
|
674
|
+
function insertStyleElement(options) {
|
|
675
|
+
var element = document.createElement("style");
|
|
676
|
+
options.setAttributes(element, options.attributes);
|
|
677
|
+
options.insert(element, options.options);
|
|
678
|
+
return element;
|
|
679
|
+
}
|
|
680
|
+
module.exports = insertStyleElement;
|
|
681
|
+
|
|
682
|
+
/***/ }),
|
|
683
|
+
|
|
684
|
+
/***/ 1020:
|
|
685
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
686
|
+
|
|
687
|
+
"use strict";
|
|
688
|
+
/**
|
|
689
|
+
* @license React
|
|
690
|
+
* react-jsx-runtime.production.min.js
|
|
691
|
+
*
|
|
692
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
693
|
+
*
|
|
694
|
+
* This source code is licensed under the MIT license found in the
|
|
695
|
+
* LICENSE file in the root directory of this source tree.
|
|
696
|
+
*/
|
|
697
|
+
var f=__webpack_require__(9206),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
698
|
+
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
/***/ }),
|
|
702
|
+
|
|
703
|
+
/***/ 1549:
|
|
704
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
705
|
+
|
|
706
|
+
"use strict";
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
exports.__esModule = true;
|
|
710
|
+
exports["default"] = void 0;
|
|
711
|
+
var _CapSpin = _interopRequireDefault(__webpack_require__(7579));
|
|
712
|
+
exports["default"] = _CapSpin.default;
|
|
713
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
714
|
+
|
|
715
|
+
/***/ }),
|
|
716
|
+
|
|
717
|
+
/***/ 1601:
|
|
718
|
+
/***/ ((module) => {
|
|
719
|
+
|
|
720
|
+
"use strict";
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
module.exports = function (i) {
|
|
724
|
+
return i[1];
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
/***/ }),
|
|
728
|
+
|
|
729
|
+
/***/ 1858:
|
|
730
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
731
|
+
|
|
732
|
+
// Imports
|
|
733
|
+
var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(1601);
|
|
734
|
+
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
|
|
735
|
+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
|
|
736
|
+
// Module
|
|
737
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-row-v2.blaze-ui-with-custom-width{width:auto}.blaze-ui-cap-row-v2.blaze-ui-with-custom-height{height:auto}.blaze-ui-cap-row-v2.blaze-ui-fill-space{flex:1}.blaze-ui-cap-row-v2.blaze-ui-full-width{width:100%}.blaze-ui-cap-row-v2.blaze-ui-full-height{height:100%}.blaze-ui-cap-row-v2.blaze-ui-ant-row-no-wrap{flex-wrap:nowrap}.blaze-ui-cap-row-v2.blaze-ui-with-gap{display:grid;grid-template-columns:repeat(auto-fit, minmax(0, 1fr))}`, ""]);
|
|
738
|
+
// Exports
|
|
739
|
+
___CSS_LOADER_EXPORT___.locals = {
|
|
740
|
+
"cap-row-v2": `blaze-ui-cap-row-v2`,
|
|
741
|
+
"with-custom-width": `blaze-ui-with-custom-width`,
|
|
742
|
+
"with-custom-height": `blaze-ui-with-custom-height`,
|
|
743
|
+
"fill-space": `blaze-ui-fill-space`,
|
|
744
|
+
"full-width": `blaze-ui-full-width`,
|
|
745
|
+
"full-height": `blaze-ui-full-height`,
|
|
746
|
+
"ant-row-no-wrap": `blaze-ui-ant-row-no-wrap`,
|
|
747
|
+
"with-gap": `blaze-ui-with-gap`
|
|
748
|
+
};
|
|
749
|
+
module.exports = ___CSS_LOADER_EXPORT___;
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
/***/ }),
|
|
753
|
+
|
|
754
|
+
/***/ 1879:
|
|
755
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
756
|
+
|
|
757
|
+
"use strict";
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
exports.__esModule = true;
|
|
761
|
+
exports.enhanceOptionsWithComponents = void 0;
|
|
762
|
+
var _classnames = _interopRequireDefault(__webpack_require__(6942));
|
|
763
|
+
var _react = _interopRequireDefault(__webpack_require__(9206));
|
|
764
|
+
var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
|
|
765
|
+
var _CapRow = _interopRequireDefault(__webpack_require__(7375));
|
|
766
|
+
var _CapTooltipWithInfo = _interopRequireDefault(__webpack_require__(2608));
|
|
767
|
+
var _constants = __webpack_require__(9788);
|
|
768
|
+
var _styles = _interopRequireDefault(__webpack_require__(8263));
|
|
769
|
+
var _jsxRuntime = __webpack_require__(4848);
|
|
770
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
771
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
772
|
+
/**
|
|
773
|
+
* Enhances options with React components for rendering
|
|
774
|
+
* Adds decorated titles with suffixes and tooltips
|
|
775
|
+
*/
|
|
776
|
+
const enhanceOptionsWithComponents = (options, type) => {
|
|
777
|
+
if (!(options != null && options.length)) return [];
|
|
778
|
+
const isTree = type === _constants.SELECT_TYPES.TREE_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT;
|
|
779
|
+
const enhanceOptions = opts => opts.map(opt => {
|
|
780
|
+
const displayText = (opt == null ? void 0 : opt.hoverText) || (opt == null ? void 0 : opt.label);
|
|
781
|
+
const tooltipTitle = (opt == null ? void 0 : opt.hoverText) || undefined;
|
|
782
|
+
const decoratedTitle = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
783
|
+
className: _styles.default['cap-unified-select-option-with-suffix'],
|
|
784
|
+
justify: "space-between",
|
|
785
|
+
align: "middle",
|
|
786
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
787
|
+
className: (0, _classnames.default)(_styles.default['cap-unified-select-option-label'], _styles.default['truncate-text']),
|
|
788
|
+
title: tooltipTitle,
|
|
789
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
790
|
+
type: "label14",
|
|
791
|
+
children: displayText
|
|
792
|
+
})
|
|
793
|
+
}), ((opt == null ? void 0 : opt.optionSuffix) || (opt == null ? void 0 : opt.optionTooltipInfo)) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
794
|
+
className: _styles.default['cap-unified-select-option-end'],
|
|
795
|
+
children: [(opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
796
|
+
className: _styles.default['cap-unified-select-option-suffix'],
|
|
797
|
+
children: [opt == null ? void 0 : opt.optionSuffix, (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
798
|
+
title: opt == null ? void 0 : opt.optionSuffixInfo
|
|
799
|
+
})]
|
|
800
|
+
}), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
801
|
+
title: opt == null ? void 0 : opt.optionTooltipInfo
|
|
802
|
+
})]
|
|
803
|
+
})]
|
|
804
|
+
});
|
|
805
|
+
return _extends({}, opt, {
|
|
806
|
+
title: decoratedTitle,
|
|
807
|
+
label: opt == null ? void 0 : opt.label,
|
|
808
|
+
children: opt != null && opt.children ? enhanceOptions(opt.children) : []
|
|
809
|
+
});
|
|
810
|
+
});
|
|
811
|
+
if (isTree) {
|
|
812
|
+
return enhanceOptions(options);
|
|
813
|
+
}
|
|
814
|
+
return options.map(opt => {
|
|
815
|
+
const displayText = (opt == null ? void 0 : opt.hoverText) || (opt == null ? void 0 : opt.label);
|
|
816
|
+
const tooltipTitle = (opt == null ? void 0 : opt.hoverText) || undefined;
|
|
817
|
+
return _extends({}, opt, {
|
|
818
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
819
|
+
className: _styles.default['cap-unified-select-option-with-suffix'],
|
|
820
|
+
justify: "space-between",
|
|
821
|
+
align: "middle",
|
|
822
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
823
|
+
className: (0, _classnames.default)(_styles.default['cap-unified-select-option-label'], _styles.default['truncate-text']),
|
|
824
|
+
title: tooltipTitle,
|
|
825
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
826
|
+
type: "label14",
|
|
827
|
+
children: displayText
|
|
828
|
+
})
|
|
829
|
+
}), ((opt == null ? void 0 : opt.optionSuffix) || (opt == null ? void 0 : opt.optionTooltipInfo)) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
830
|
+
className: _styles.default['cap-unified-select-option-end'],
|
|
831
|
+
children: [(opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
832
|
+
className: _styles.default['cap-unified-select-option-suffix'],
|
|
833
|
+
children: [opt == null ? void 0 : opt.optionSuffix, (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
834
|
+
title: opt == null ? void 0 : opt.optionSuffixInfo
|
|
835
|
+
})]
|
|
836
|
+
}), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
837
|
+
title: opt == null ? void 0 : opt.optionTooltipInfo
|
|
838
|
+
})]
|
|
839
|
+
})]
|
|
840
|
+
}),
|
|
841
|
+
label: opt == null ? void 0 : opt.label
|
|
842
|
+
});
|
|
843
|
+
});
|
|
844
|
+
};
|
|
845
|
+
exports.enhanceOptionsWithComponents = enhanceOptionsWithComponents;
|
|
846
|
+
|
|
847
|
+
/***/ }),
|
|
848
|
+
|
|
849
|
+
/***/ 2119:
|
|
850
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
851
|
+
|
|
852
|
+
// Imports
|
|
853
|
+
var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(1601);
|
|
854
|
+
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
|
|
855
|
+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
|
|
856
|
+
// Module
|
|
857
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-tooltip-overlay-v2 .ant-tooltip-inner{background-color:#091e42;color:#fff;padding:.571rem .857rem;font-size:1rem;line-height:1.429rem;border-radius:.286rem;max-width:21.429rem;word-wrap:break-word}.blaze-ui-cap-tooltip-overlay-v2 .ant-tooltip-arrow::before{background-color:#091e42}.blaze-ui-button-disabled-tooltip-wrapper{display:inline-block;cursor:not-allowed}.blaze-ui-button-disabled-tooltip-wrapper .ant-btn[disabled]{pointer-events:none}.blaze-ui-cap-tooltip-wrapper{display:inline-block}`, ""]);
|
|
858
|
+
// Exports
|
|
859
|
+
___CSS_LOADER_EXPORT___.locals = {
|
|
860
|
+
"cap-tooltip-overlay-v2": `blaze-ui-cap-tooltip-overlay-v2`,
|
|
861
|
+
"button-disabled-tooltip-wrapper": `blaze-ui-button-disabled-tooltip-wrapper`,
|
|
862
|
+
"cap-tooltip-wrapper": `blaze-ui-cap-tooltip-wrapper`
|
|
863
|
+
};
|
|
864
|
+
module.exports = ___CSS_LOADER_EXPORT___;
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
/***/ }),
|
|
868
|
+
|
|
869
|
+
/***/ 2608:
|
|
870
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
871
|
+
|
|
872
|
+
"use strict";
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
exports.__esModule = true;
|
|
876
|
+
exports["default"] = void 0;
|
|
877
|
+
var _CapTooltipWithInfo = _interopRequireDefault(__webpack_require__(4299));
|
|
878
|
+
exports["default"] = _CapTooltipWithInfo.default;
|
|
879
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
880
|
+
|
|
881
|
+
/***/ }),
|
|
882
|
+
|
|
883
|
+
/***/ 2657:
|
|
884
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
885
|
+
|
|
886
|
+
"use strict";
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
exports.__esModule = true;
|
|
890
|
+
exports["default"] = void 0;
|
|
891
|
+
var _classnames = _interopRequireDefault(__webpack_require__(6942));
|
|
892
|
+
var _react = _interopRequireDefault(__webpack_require__(9206));
|
|
893
|
+
var _styles = _interopRequireDefault(__webpack_require__(4939));
|
|
894
|
+
var _jsxRuntime = __webpack_require__(4848);
|
|
895
|
+
const _excluded = ["children", "type", "className", "style", "fontWeight", "lineHeight"],
|
|
896
|
+
_excluded2 = ["children", "type", "className", "style", "fontWeight", "lineHeight"];
|
|
897
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
898
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
899
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
900
|
+
const CapLabel = _ref => {
|
|
901
|
+
let {
|
|
902
|
+
children,
|
|
241
903
|
type = 'label1',
|
|
242
904
|
className = '',
|
|
243
905
|
style = {},
|
|
@@ -826,1080 +1488,245 @@ ___CSS_LOADER_EXPORT___.locals = {
|
|
|
826
1488
|
"label13": `blaze-ui-label13`,
|
|
827
1489
|
"label14": `blaze-ui-label14`,
|
|
828
1490
|
"label15": `blaze-ui-label15`,
|
|
829
|
-
"label16": `blaze-ui-label16`,
|
|
830
|
-
"label17": `blaze-ui-label17`,
|
|
831
|
-
"label18": `blaze-ui-label18`,
|
|
832
|
-
"label19": `blaze-ui-label19`,
|
|
833
|
-
"label20": `blaze-ui-label20`,
|
|
834
|
-
"label21": `blaze-ui-label21`,
|
|
835
|
-
"label22": `blaze-ui-label22`,
|
|
836
|
-
"label23": `blaze-ui-label23`,
|
|
837
|
-
"label24": `blaze-ui-label24`,
|
|
838
|
-
"label25": `blaze-ui-label25`,
|
|
839
|
-
"label26": `blaze-ui-label26`,
|
|
840
|
-
"label27": `blaze-ui-label27`,
|
|
841
|
-
"label28": `blaze-ui-label28`,
|
|
842
|
-
"label29": `blaze-ui-label29`,
|
|
843
|
-
"label30": `blaze-ui-label30`,
|
|
844
|
-
"label31": `blaze-ui-label31`,
|
|
845
|
-
"label32": `blaze-ui-label32`,
|
|
846
|
-
"label33": `blaze-ui-label33`,
|
|
847
|
-
"cap-label-div": `blaze-ui-cap-label-div`,
|
|
848
|
-
"cap-label-span": `blaze-ui-cap-label-span`
|
|
849
|
-
};
|
|
850
|
-
module.exports = ___CSS_LOADER_EXPORT___;
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
/***/ }),
|
|
854
|
-
|
|
855
|
-
/***/ 5353:
|
|
856
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
857
|
-
|
|
858
|
-
"use strict";
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
exports.__esModule = true;
|
|
862
|
-
exports["default"] = void 0;
|
|
863
|
-
var _antdV = __webpack_require__(4273);
|
|
864
|
-
var _classnames = _interopRequireDefault(__webpack_require__(6942));
|
|
865
|
-
var _react = _interopRequireWildcard(__webpack_require__(9206));
|
|
866
|
-
var _CapIcon = _interopRequireDefault(__webpack_require__(8244));
|
|
867
|
-
var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
|
|
868
|
-
var _CapRow = _interopRequireDefault(__webpack_require__(7375));
|
|
869
|
-
var
|
|
870
|
-
var
|
|
871
|
-
var
|
|
872
|
-
var
|
|
873
|
-
var
|
|
874
|
-
var _styles = _interopRequireDefault(__webpack_require__(8263));
|
|
875
|
-
var
|
|
876
|
-
var _jsxRuntime = __webpack_require__(4848);
|
|
877
|
-
const _excluded = ["type", "options", "value", "onChange", "placeholder", "className", "style", "isError", "errorMessage", "containerClassName", "popoverClassName", "allowClear", "headerLabel", "onUpload", "uploadLabel", "tooltip", "bylineText", "disabled", "showUpload", "customPopupRender", "showSearch", "searchBasedOn", "onSearch", "searchDebounce", "onConfirm", "clearText", "noResultCustomText", "noResultCustomIcon", "readOnly", "staticValue", "onFooterDownloadChange", "onPopupScroll", "hasMore", "enableVirtualization", "virtualRowHeight", "resetSearch", "resetData", "fetchMissingOptions"];
|
|
878
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
879
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
880
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
881
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
882
|
-
const CapUnifiedSelect = _ref => {
|
|
883
|
-
let {
|
|
884
|
-
type = _constants.SELECT_TYPES.SELECT,
|
|
885
|
-
options = [],
|
|
886
|
-
value,
|
|
887
|
-
onChange,
|
|
888
|
-
placeholder = _constants.DEFAULTS.PLACEHOLDER,
|
|
889
|
-
className = '',
|
|
890
|
-
style,
|
|
891
|
-
isError = false,
|
|
892
|
-
errorMessage,
|
|
893
|
-
containerClassName,
|
|
894
|
-
popoverClassName,
|
|
895
|
-
allowClear = false,
|
|
896
|
-
headerLabel,
|
|
897
|
-
onUpload,
|
|
898
|
-
uploadLabel = _constants.DEFAULTS.UPLOAD_LABEL,
|
|
899
|
-
tooltip,
|
|
900
|
-
bylineText,
|
|
901
|
-
disabled = false,
|
|
902
|
-
showUpload = false,
|
|
903
|
-
customPopupRender = true,
|
|
904
|
-
showSearch = true,
|
|
905
|
-
searchBasedOn = 'label',
|
|
906
|
-
onSearch,
|
|
907
|
-
searchDebounce = _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE,
|
|
908
|
-
onConfirm,
|
|
909
|
-
clearText = _constants.DEFAULTS.CLEAR_TEXT,
|
|
910
|
-
noResultCustomText = _constants.DEFAULTS.NO_RESULT_TEXT,
|
|
911
|
-
noResultCustomIcon = _constants.DEFAULTS.NO_RESULT_ICON,
|
|
912
|
-
readOnly = false,
|
|
913
|
-
staticValue = true,
|
|
914
|
-
onFooterDownloadChange,
|
|
915
|
-
onPopupScroll,
|
|
916
|
-
hasMore = true,
|
|
917
|
-
enableVirtualization = false,
|
|
918
|
-
virtualRowHeight = _constants.DEFAULTS.VIRTUAL_ROW_HEIGHT,
|
|
919
|
-
resetSearch = true,
|
|
920
|
-
resetData,
|
|
921
|
-
fetchMissingOptions
|
|
922
|
-
} = _ref,
|
|
923
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
924
|
-
const
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
fetchMissingOptionsCalledRef.current = true;
|
|
981
|
-
lastMissingValuesRef.current = missingValuesKey;
|
|
982
|
-
fetchMissingOptions([...missingValues]);
|
|
983
|
-
}
|
|
984
|
-
}, [value, options, fetchMissingOptions, staticValue]);
|
|
985
|
-
(0, _react.useEffect)(() => {
|
|
986
|
-
const isEqual = Array.isArray(value) && Array.isArray(tempValue) ? (value == null ? void 0 : value.length) === (tempValue == null ? void 0 : tempValue.length) && value.every(v => Array.isArray(tempValue) && tempValue.includes(v)) : value === tempValue;
|
|
987
|
-
if (!isEqual) {
|
|
988
|
-
setTempValue(value);
|
|
989
|
-
setOrderedOptions(null);
|
|
990
|
-
}
|
|
991
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
992
|
-
}, [value]);
|
|
993
|
-
(0, _react.useEffect)(() => {
|
|
994
|
-
const currentSelected = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
995
|
-
const findAndCacheOption = (opts, val) => {
|
|
996
|
-
for (const opt of opts) {
|
|
997
|
-
if (opt.value === val) {
|
|
998
|
-
selectedItemsCacheRef.current.set(val, opt);
|
|
999
|
-
return true;
|
|
1000
|
-
}
|
|
1001
|
-
if (opt.children && opt.children.length > 0) {
|
|
1002
|
-
if (findAndCacheOption(opt.children, val)) {
|
|
1003
|
-
return true;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return false;
|
|
1008
|
-
};
|
|
1009
|
-
currentSelected.forEach(val => {
|
|
1010
|
-
if (!selectedItemsCacheRef.current.has(val)) {
|
|
1011
|
-
findAndCacheOption(options, val);
|
|
1012
|
-
}
|
|
1013
|
-
});
|
|
1014
|
-
const selectedSet = new Set(currentSelected);
|
|
1015
|
-
selectedItemsCacheRef.current.forEach((_, value) => {
|
|
1016
|
-
if (!selectedSet.has(value)) {
|
|
1017
|
-
selectedItemsCacheRef.current.delete(value);
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
}, [tempValue, options]);
|
|
1021
|
-
(0, _react.useEffect)(() => {
|
|
1022
|
-
if (orderedOptions) {
|
|
1023
|
-
const currentSelected = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
1024
|
-
const checkValueExists = (opts, val) => {
|
|
1025
|
-
for (const opt of opts) {
|
|
1026
|
-
if (opt.value === val) return true;
|
|
1027
|
-
if (opt.children && opt.children.length > 0) {
|
|
1028
|
-
if (checkValueExists(opt.children, val)) return true;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
return false;
|
|
1032
|
-
};
|
|
1033
|
-
const allSelectedStillExist = currentSelected.every(val => checkValueExists(options, val));
|
|
1034
|
-
if (!allSelectedStillExist) {
|
|
1035
|
-
setOrderedOptions(null);
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
}, [options, orderedOptions, tempValue]);
|
|
1039
|
-
const debounceTimeout = searchDebounce != null ? searchDebounce : _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE;
|
|
1040
|
-
(0, _react.useEffect)(() => {
|
|
1041
|
-
optionsRef.current = options;
|
|
1042
|
-
}, [options]);
|
|
1043
|
-
(0, _react.useEffect)(() => {
|
|
1044
|
-
return () => {
|
|
1045
|
-
if (searchTimeoutRef.current) {
|
|
1046
|
-
clearTimeout(searchTimeoutRef.current);
|
|
1047
|
-
}
|
|
1048
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1049
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1050
|
-
}
|
|
1051
|
-
if (scrollThrottleTimeoutRef.current) {
|
|
1052
|
-
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
1053
|
-
}
|
|
1054
|
-
};
|
|
1055
|
-
}, []);
|
|
1056
|
-
(0, _react.useEffect)(() => {
|
|
1057
|
-
const hasSearchQuery = lastSearchQueryRef.current !== null && lastSearchQueryRef.current !== undefined;
|
|
1058
|
-
if (staticValue || !isSearching || !hasSearchQuery) {
|
|
1059
|
-
prevOptionsRef.current = options;
|
|
1060
|
-
return;
|
|
1061
|
-
}
|
|
1062
|
-
const optionsChanged = prevOptionsRef.current !== options || prevOptionsRef.current.length !== options.length;
|
|
1063
|
-
const searchCleared = lastSearchQueryRef.current === '';
|
|
1064
|
-
const timeSinceCleared = searchClearedTimeRef.current ? Date.now() - searchClearedTimeRef.current : Infinity;
|
|
1065
|
-
const hasOptionsData = options.length > 0;
|
|
1066
|
-
const clearedSearchReady = searchCleared && hasOptionsData && timeSinceCleared > _constants.TIMEOUTS.SEARCH_CLEARED_TIMEOUT;
|
|
1067
|
-
if (optionsChanged || clearedSearchReady) {
|
|
1068
|
-
const timeoutId = setTimeout(() => {
|
|
1069
|
-
setIsSearching(false);
|
|
1070
|
-
prevOptionsRef.current = options;
|
|
1071
|
-
if (searchCleared) {
|
|
1072
|
-
searchClearedTimeRef.current = null;
|
|
1073
|
-
}
|
|
1074
|
-
}, _constants.TIMEOUTS.SEARCH_STATE_UPDATE_DELAY);
|
|
1075
|
-
return () => clearTimeout(timeoutId);
|
|
1076
|
-
}
|
|
1077
|
-
prevOptionsRef.current = options;
|
|
1078
|
-
}, [options, staticValue, isSearching]);
|
|
1079
|
-
(0, _react.useEffect)(() => {
|
|
1080
|
-
const hasSearchQuery = lastSearchQueryRef.current !== null && lastSearchQueryRef.current !== undefined;
|
|
1081
|
-
if (!isSearching || staticValue || !hasSearchQuery) {
|
|
1082
|
-
return;
|
|
1083
|
-
}
|
|
1084
|
-
const searchCleared = lastSearchQueryRef.current === '';
|
|
1085
|
-
const timeoutDuration = searchCleared ? debounceTimeout + _constants.TIMEOUTS.SEARCH_CLEARED_BUFFER : debounceTimeout + _constants.TIMEOUTS.SEARCH_REGULAR_BUFFER;
|
|
1086
|
-
const fallbackTimeout = setTimeout(() => {
|
|
1087
|
-
setIsSearching(false);
|
|
1088
|
-
searchClearedTimeRef.current = null;
|
|
1089
|
-
}, timeoutDuration);
|
|
1090
|
-
return () => clearTimeout(fallbackTimeout);
|
|
1091
|
-
}, [isSearching, staticValue, debounceTimeout, options.length]);
|
|
1092
|
-
(0, _react.useEffect)(() => {
|
|
1093
|
-
if (!isResettingData) {
|
|
1094
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1095
|
-
resetDataCalledTimeRef.current = null;
|
|
1096
|
-
return;
|
|
1097
|
-
}
|
|
1098
|
-
const prevOptions = prevOptionsBeforeResetRef.current;
|
|
1099
|
-
const currentOptions = options;
|
|
1100
|
-
const optionsChanged = prevOptions !== currentOptions || prevOptions.length !== currentOptions.length || prevOptions.length === currentOptions.length && prevOptions.length > 0 && prevOptions.some((prevOpt, idx) => {
|
|
1101
|
-
const currentOpt = currentOptions[idx];
|
|
1102
|
-
return !currentOpt || prevOpt.value !== currentOpt.value || prevOpt.label !== currentOpt.label;
|
|
1103
|
-
});
|
|
1104
|
-
const timeSinceReset = resetDataCalledTimeRef.current ? Date.now() - resetDataCalledTimeRef.current : Infinity;
|
|
1105
|
-
const hasDataAfterTimeout = currentOptions.length > 0 && timeSinceReset > _constants.TIMEOUTS.RESET_DATA_MIN_TIME && timeSinceReset < _constants.TIMEOUTS.RESET_DATA_MAX_TIME;
|
|
1106
|
-
if (optionsChanged || hasDataAfterTimeout) {
|
|
1107
|
-
setIsResettingData(false);
|
|
1108
|
-
prevOptionsBeforeResetRef.current = currentOptions;
|
|
1109
|
-
resetDataCalledTimeRef.current = null;
|
|
1110
|
-
}
|
|
1111
|
-
}, [options, isResettingData]);
|
|
1112
|
-
(0, _react.useEffect)(() => {
|
|
1113
|
-
if (!isResettingData) {
|
|
1114
|
-
return;
|
|
1115
|
-
}
|
|
1116
|
-
const fallbackTimeout = setTimeout(() => {
|
|
1117
|
-
setIsResettingData(false);
|
|
1118
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1119
|
-
resetDataCalledTimeRef.current = null;
|
|
1120
|
-
}, _constants.TIMEOUTS.RESET_DATA_TIMEOUT);
|
|
1121
|
-
return () => clearTimeout(fallbackTimeout);
|
|
1122
|
-
}, [isResettingData, options]);
|
|
1123
|
-
(0, _react.useEffect)(() => {
|
|
1124
|
-
if (!hasMore && isLoadingOnScroll) {
|
|
1125
|
-
setIsLoadingOnScroll(false);
|
|
1126
|
-
isScrollProcessingRef.current = false;
|
|
1127
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1128
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1129
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
}, [hasMore, isLoadingOnScroll]);
|
|
1133
|
-
(0, _react.useEffect)(() => {
|
|
1134
|
-
if (!isLoadingOnScroll) {
|
|
1135
|
-
prevOptionsCountRef.current = options.length;
|
|
1136
|
-
prevOptionsRefForScroll.current = options;
|
|
1137
|
-
}
|
|
1138
|
-
if (!isLoadingOnScroll || !onPopupScroll) {
|
|
1139
|
-
return;
|
|
1140
|
-
}
|
|
1141
|
-
const optionsCountIncreased = options.length > prevOptionsCountRef.current;
|
|
1142
|
-
const optionsContentChanged = (() => {
|
|
1143
|
-
const prevCount = prevOptionsCountRef.current;
|
|
1144
|
-
const currentCount = options.length;
|
|
1145
|
-
if (prevCount !== currentCount) {
|
|
1146
|
-
return true;
|
|
1147
|
-
}
|
|
1148
|
-
if (currentCount > 0 && prevCount > 0 && prevOptionsRefForScroll.current.length > 0) {
|
|
1149
|
-
const prevOptions = prevOptionsRefForScroll.current;
|
|
1150
|
-
const lastPrevOption = prevOptions[prevOptions.length - 1];
|
|
1151
|
-
const lastCurrentOption = options[options.length - 1];
|
|
1152
|
-
if ((lastPrevOption == null ? void 0 : lastPrevOption.value) !== (lastCurrentOption == null ? void 0 : lastCurrentOption.value) || (lastPrevOption == null ? void 0 : lastPrevOption.label) !== (lastCurrentOption == null ? void 0 : lastCurrentOption.label)) {
|
|
1153
|
-
return true;
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
return false;
|
|
1157
|
-
})();
|
|
1158
|
-
if (optionsCountIncreased || optionsContentChanged) {
|
|
1159
|
-
setIsLoadingOnScroll(false);
|
|
1160
|
-
isScrollProcessingRef.current = false;
|
|
1161
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1162
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1163
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1164
|
-
}
|
|
1165
|
-
prevOptionsCountRef.current = options.length;
|
|
1166
|
-
prevOptionsRefForScroll.current = options;
|
|
1167
|
-
}
|
|
1168
|
-
}, [options, isLoadingOnScroll, onPopupScroll]);
|
|
1169
|
-
const handleSearch = (0, _react.useCallback)(query => {
|
|
1170
|
-
if (searchTimeoutRef.current) {
|
|
1171
|
-
clearTimeout(searchTimeoutRef.current);
|
|
1172
|
-
}
|
|
1173
|
-
const trimmedQuery = query.trim();
|
|
1174
|
-
const wasSearching = lastSearchQueryRef.current !== '';
|
|
1175
|
-
const isNowCleared = trimmedQuery === '';
|
|
1176
|
-
if (wasSearching && isNowCleared) {
|
|
1177
|
-
searchClearedTimeRef.current = Date.now();
|
|
1178
|
-
} else if (!isNowCleared) {
|
|
1179
|
-
searchClearedTimeRef.current = null;
|
|
1180
|
-
}
|
|
1181
|
-
lastSearchQueryRef.current = trimmedQuery;
|
|
1182
|
-
if (trimmedQuery.length > 0 || lastSearchQueryRef.current.length > 0) {
|
|
1183
|
-
hasInteractedRef.current = true;
|
|
1184
|
-
}
|
|
1185
|
-
if (!staticValue && onSearch) {
|
|
1186
|
-
setIsSearching(true);
|
|
1187
|
-
searchTimeoutRef.current = setTimeout(() => {
|
|
1188
|
-
onSearch(trimmedQuery);
|
|
1189
|
-
}, debounceTimeout);
|
|
1190
|
-
} else if (!trimmedQuery) {
|
|
1191
|
-
setIsSearching(false);
|
|
1192
|
-
} else {
|
|
1193
|
-
setIsSearching(true);
|
|
1194
|
-
searchTimeoutRef.current = setTimeout(() => {
|
|
1195
|
-
setIsSearching(false);
|
|
1196
|
-
}, _constants.TIMEOUTS.STATIC_SEARCH_DELAY);
|
|
1197
|
-
}
|
|
1198
|
-
}, [onSearch, staticValue, debounceTimeout]);
|
|
1199
|
-
const isMulti = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.MULTI_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
|
|
1200
|
-
const isTree = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.TREE_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
|
|
1201
|
-
const mergedOptions = (0, _react.useMemo)(() => {
|
|
1202
|
-
return options;
|
|
1203
|
-
}, [options]);
|
|
1204
|
-
const prevOptionsCountBeforeFetchMissingRef = (0, _react.useRef)(options.length);
|
|
1205
|
-
const prevOptionsBeforeFetchMissingRef = (0, _react.useRef)(options);
|
|
1206
|
-
(0, _react.useEffect)(() => {
|
|
1207
|
-
if (!orderedOptions || !onPopupScroll) {
|
|
1208
|
-
return;
|
|
1209
|
-
}
|
|
1210
|
-
const currentOptions = options;
|
|
1211
|
-
const optionsCountIncreased = currentOptions.length > scrollTriggerOptionsCountRef.current;
|
|
1212
|
-
if (optionsCountIncreased && scrollTriggerOptionsCountRef.current > 0) {
|
|
1213
|
-
const selectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
1214
|
-
if (selectedValues.length > 0) {
|
|
1215
|
-
const reordered = (0, _utils.reorderOptionsBySelection)(currentOptions, selectedValues);
|
|
1216
|
-
setOrderedOptions(reordered);
|
|
1217
|
-
scrollTriggerOptionsCountRef.current = currentOptions.length;
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
}, [options, orderedOptions, onPopupScroll, tempValue]);
|
|
1221
|
-
(0, _react.useEffect)(() => {
|
|
1222
|
-
if (!fetchMissingOptions) {
|
|
1223
|
-
prevOptionsCountBeforeFetchMissingRef.current = options.length;
|
|
1224
|
-
prevOptionsBeforeFetchMissingRef.current = options;
|
|
1225
|
-
return;
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
// For API-driven data, don't reorder options during active search
|
|
1229
|
-
// Only reorder when there's no search query or search is cleared
|
|
1230
|
-
const hasActiveSearch = !staticValue && lastSearchQueryRef.current.trim().length > 0;
|
|
1231
|
-
if (hasActiveSearch) {
|
|
1232
|
-
return;
|
|
1233
|
-
}
|
|
1234
|
-
const currentOptions = options;
|
|
1235
|
-
const currentSelectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
1236
|
-
const tempSelectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
1237
|
-
const selectedValues = tempSelectedValues.length > 0 ? tempSelectedValues : currentSelectedValues;
|
|
1238
|
-
if (selectedValues.length === 0) {
|
|
1239
|
-
prevOptionsCountBeforeFetchMissingRef.current = currentOptions.length;
|
|
1240
|
-
prevOptionsBeforeFetchMissingRef.current = currentOptions;
|
|
1241
|
-
return;
|
|
1242
|
-
}
|
|
1243
|
-
const prevOptions = prevOptionsBeforeFetchMissingRef.current;
|
|
1244
|
-
const optionsCountIncreased = currentOptions.length > prevOptionsCountBeforeFetchMissingRef.current;
|
|
1245
|
-
const optionsChanged = prevOptions !== currentOptions || optionsCountIncreased;
|
|
1246
|
-
const hasNewlyFetchedSelectedItems = (() => {
|
|
1247
|
-
if (selectedValues.length === 0 || !optionsChanged) {
|
|
1248
|
-
return false;
|
|
1249
|
-
}
|
|
1250
|
-
const previouslyMissingValues = selectedValues.filter(val => !(0, _utils.findValueInOptions)(prevOptions, val));
|
|
1251
|
-
if (previouslyMissingValues.length === 0) {
|
|
1252
|
-
return false;
|
|
1253
|
-
}
|
|
1254
|
-
const nowPresentValues = previouslyMissingValues.filter(val => (0, _utils.findValueInOptions)(currentOptions, val));
|
|
1255
|
-
return nowPresentValues.length > 0;
|
|
1256
|
-
})();
|
|
1257
|
-
if (optionsChanged && hasNewlyFetchedSelectedItems) {
|
|
1258
|
-
const reordered = (0, _utils.reorderOptionsBySelection)(currentOptions, selectedValues);
|
|
1259
|
-
setOrderedOptions(reordered);
|
|
1260
|
-
}
|
|
1261
|
-
prevOptionsCountBeforeFetchMissingRef.current = currentOptions.length;
|
|
1262
|
-
prevOptionsBeforeFetchMissingRef.current = currentOptions;
|
|
1263
|
-
}, [options, value, tempValue, fetchMissingOptions, staticValue]);
|
|
1264
|
-
(0, _react.useEffect)(() => {
|
|
1265
|
-
if (initialSortDoneRef.current || !(options != null && options.length)) {
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
1269
|
-
if (selectedValues.length === 0) {
|
|
1270
|
-
initialSortDoneRef.current = true;
|
|
1271
|
-
return;
|
|
1272
|
-
}
|
|
1273
|
-
const checkValueExists = (opts, val) => {
|
|
1274
|
-
for (const opt of opts) {
|
|
1275
|
-
if (opt.value === val) return true;
|
|
1276
|
-
if (opt.children && opt.children.length > 0) {
|
|
1277
|
-
if (checkValueExists(opt.children, val)) return true;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
return false;
|
|
1281
|
-
};
|
|
1282
|
-
const hasSelectedInOptions = selectedValues.some(val => checkValueExists(options, val));
|
|
1283
|
-
if (hasSelectedInOptions) {
|
|
1284
|
-
const reordered = (0, _utils.reorderOptionsBySelection)(options, selectedValues);
|
|
1285
|
-
setOrderedOptions(reordered);
|
|
1286
|
-
}
|
|
1287
|
-
initialSortDoneRef.current = true;
|
|
1288
|
-
}, [options, value]);
|
|
1289
|
-
const dataSource = (0, _react.useMemo)(() => {
|
|
1290
|
-
const sourceOptions = searchText.trim() ? mergedOptions : orderedOptions || mergedOptions;
|
|
1291
|
-
const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
1292
|
-
const hasSearchQuery = searchText.trim().length > 0;
|
|
1293
|
-
|
|
1294
|
-
// For API-driven data, don't append virtual options during search
|
|
1295
|
-
// Only show search results when searching
|
|
1296
|
-
const shouldAppendVirtualOptions = staticValue || !hasSearchQuery;
|
|
1297
|
-
const missingSelectedValues = [];
|
|
1298
|
-
if (shouldAppendVirtualOptions && selectedValues.length > 0) {
|
|
1299
|
-
selectedValues.forEach(val => {
|
|
1300
|
-
if (!(0, _utils.findValueInOptions)(sourceOptions, val)) {
|
|
1301
|
-
missingSelectedValues.push(val);
|
|
1302
|
-
}
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
const virtualOptions = missingSelectedValues.map(val => {
|
|
1306
|
-
const cachedOption = selectedItemsCacheRef.current.get(val);
|
|
1307
|
-
return _extends({
|
|
1308
|
-
value: val,
|
|
1309
|
-
label: (cachedOption == null ? void 0 : cachedOption.label) || String(val),
|
|
1310
|
-
key: (cachedOption == null ? void 0 : cachedOption.key) || val,
|
|
1311
|
-
title: cachedOption == null ? void 0 : cachedOption.title,
|
|
1312
|
-
optionSuffix: cachedOption == null ? void 0 : cachedOption.optionSuffix,
|
|
1313
|
-
optionSuffixInfo: cachedOption == null ? void 0 : cachedOption.optionSuffixInfo,
|
|
1314
|
-
optionTooltipInfo: cachedOption == null ? void 0 : cachedOption.optionTooltipInfo,
|
|
1315
|
-
disabled: cachedOption == null ? void 0 : cachedOption.disabled
|
|
1316
|
-
}, (cachedOption == null ? void 0 : cachedOption.children) && {
|
|
1317
|
-
children: cachedOption.children
|
|
1318
|
-
});
|
|
1319
|
-
});
|
|
1320
|
-
const allOptions = hasSearchQuery ? [...sourceOptions, ...virtualOptions] : [...virtualOptions, ...sourceOptions];
|
|
1321
|
-
if (!(allOptions != null && allOptions.length)) return [];
|
|
1322
|
-
const enhanceOptions = opts => opts.map(opt => {
|
|
1323
|
-
const decoratedTitle = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
1324
|
-
className: _styles.default['cap-unified-select-option-with-suffix'],
|
|
1325
|
-
justify: "space-between",
|
|
1326
|
-
align: "middle",
|
|
1327
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1328
|
-
className: _styles.default['cap-unified-select-option-label'],
|
|
1329
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1330
|
-
type: "label14",
|
|
1331
|
-
children: opt == null ? void 0 : opt.label
|
|
1332
|
-
})
|
|
1333
|
-
}), ((opt == null ? void 0 : opt.optionSuffix) || (opt == null ? void 0 : opt.optionTooltipInfo)) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1334
|
-
className: _styles.default['cap-unified-select-option-end'],
|
|
1335
|
-
children: [(opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
1336
|
-
className: _styles.default['cap-unified-select-option-suffix'],
|
|
1337
|
-
children: [opt == null ? void 0 : opt.optionSuffix, (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
1338
|
-
title: opt == null ? void 0 : opt.optionSuffixInfo
|
|
1339
|
-
})]
|
|
1340
|
-
}), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
1341
|
-
title: opt == null ? void 0 : opt.optionTooltipInfo
|
|
1342
|
-
})]
|
|
1343
|
-
})]
|
|
1344
|
-
});
|
|
1345
|
-
return _extends({}, opt, {
|
|
1346
|
-
title: decoratedTitle,
|
|
1347
|
-
label: opt == null ? void 0 : opt.label,
|
|
1348
|
-
children: opt != null && opt.children ? enhanceOptions(opt.children) : []
|
|
1349
|
-
});
|
|
1350
|
-
});
|
|
1351
|
-
return isTree ? enhanceOptions(allOptions) : allOptions.map(opt => _extends({}, opt, {
|
|
1352
|
-
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
1353
|
-
className: _styles.default['cap-unified-select-option-with-suffix'],
|
|
1354
|
-
justify: "space-between",
|
|
1355
|
-
align: "middle",
|
|
1356
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1357
|
-
className: _styles.default['cap-unified-select-option-label'],
|
|
1358
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1359
|
-
type: "label14",
|
|
1360
|
-
children: opt == null ? void 0 : opt.label
|
|
1361
|
-
})
|
|
1362
|
-
}), ((opt == null ? void 0 : opt.optionSuffix) || (opt == null ? void 0 : opt.optionTooltipInfo)) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1363
|
-
className: _styles.default['cap-unified-select-option-end'],
|
|
1364
|
-
children: [(opt == null ? void 0 : opt.optionSuffix) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
1365
|
-
className: _styles.default['cap-unified-select-option-suffix'],
|
|
1366
|
-
children: [opt == null ? void 0 : opt.optionSuffix, (opt == null ? void 0 : opt.optionSuffixInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
1367
|
-
title: opt == null ? void 0 : opt.optionSuffixInfo
|
|
1368
|
-
})]
|
|
1369
|
-
}), (opt == null ? void 0 : opt.optionTooltipInfo) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
1370
|
-
title: opt == null ? void 0 : opt.optionTooltipInfo
|
|
1371
|
-
})]
|
|
1372
|
-
})]
|
|
1373
|
-
}),
|
|
1374
|
-
label: opt == null ? void 0 : opt.label
|
|
1375
|
-
}));
|
|
1376
|
-
}, [isTree, mergedOptions, orderedOptions, searchText, value, staticValue]);
|
|
1377
|
-
const filteredTree = (0, _react.useMemo)(() => {
|
|
1378
|
-
const selectedValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
1379
|
-
return (0, _utils.filterTreeData)(dataSource, searchText.trim(), searchBasedOn, selectedValues.length > 0 ? selectedValues : undefined);
|
|
1380
|
-
}, [dataSource, searchText, searchBasedOn, tempValue]);
|
|
1381
|
-
const treeMaps = (0, _react.useMemo)(() => (0, _utils.buildTreeMaps)(options), [options]);
|
|
1382
|
-
const selectedLeafCount = (0, _react.useMemo)(() => (0, _utils.countSelectedLeaves)(treeMaps, Array.isArray(tempValue) ? tempValue : undefined), [treeMaps, tempValue]);
|
|
1383
|
-
const displayValue = dropdownOpen ? tempValue : value;
|
|
1384
|
-
const suffix = (0, _react.useMemo)(() => {
|
|
1385
|
-
const count = Array.isArray(displayValue) ? displayValue == null ? void 0 : displayValue.length : displayValue ? 1 : 0;
|
|
1386
|
-
const renderTooltipTitle = values => {
|
|
1387
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1388
|
-
className: _styles.default['cap-unified-select-more-tooltip-content'],
|
|
1389
|
-
children: values.map((val, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1390
|
-
children: val
|
|
1391
|
-
}, "cap-unified-select-tooltip-item-" + val + "-" + idx))
|
|
1392
|
-
});
|
|
1393
|
-
};
|
|
1394
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1395
|
-
children: [isMulti && count > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1396
|
-
className: _styles.default['cap-unified-select-more-text'],
|
|
1397
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltip.default, {
|
|
1398
|
-
title: renderTooltipTitle(Array.isArray(displayValue) ? displayValue.slice(1) : []),
|
|
1399
|
-
placement: "bottom",
|
|
1400
|
-
overlayClassName: _styles.default['cap-unified-select-more-tooltip'],
|
|
1401
|
-
arrowPointAtCenter: true,
|
|
1402
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
1403
|
-
children: ["+", count - 1, " more"]
|
|
1404
|
-
})
|
|
1405
|
-
})
|
|
1406
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
1407
|
-
className: _styles.default['cap-unified-select-suffix-icon'],
|
|
1408
|
-
type: dropdownOpen ? 'up' : 'down',
|
|
1409
|
-
size: "xs"
|
|
1410
|
-
})]
|
|
1411
|
-
});
|
|
1412
|
-
}, [isMulti, displayValue, dropdownOpen]);
|
|
1413
|
-
const prefix = (0, _react.useMemo)(() => {
|
|
1414
|
-
if (isMulti && Array.isArray(displayValue) && (displayValue == null ? void 0 : displayValue.length) > 0) {
|
|
1415
|
-
var _treeMaps$nodeMap;
|
|
1416
|
-
const firstLeafValue = displayValue.find(val => {
|
|
1417
|
-
var _treeMaps$leafValues;
|
|
1418
|
-
return treeMaps == null || (_treeMaps$leafValues = treeMaps.leafValues) == null ? void 0 : _treeMaps$leafValues.includes(val);
|
|
1419
|
-
});
|
|
1420
|
-
return firstLeafValue ? (treeMaps == null || (_treeMaps$nodeMap = treeMaps.nodeMap) == null || (_treeMaps$nodeMap = _treeMaps$nodeMap[firstLeafValue]) == null ? void 0 : _treeMaps$nodeMap.label) || null : null;
|
|
1421
|
-
}
|
|
1422
|
-
return null;
|
|
1423
|
-
}, [isMulti, displayValue, treeMaps]);
|
|
1424
|
-
const handleConfirm = (0, _react.useCallback)(() => {
|
|
1425
|
-
hasInteractedRef.current = true;
|
|
1426
|
-
const optionsToReorder = mergedOptions;
|
|
1427
|
-
if (isMulti && Array.isArray(tempValue) && tempValue.length > 0) {
|
|
1428
|
-
const reordered = (0, _utils.reorderOptionsBySelection)(optionsToReorder, tempValue);
|
|
1429
|
-
setOrderedOptions(reordered);
|
|
1430
|
-
} else if (!isMulti && tempValue && !Array.isArray(tempValue)) {
|
|
1431
|
-
// For single select, move selected item to top
|
|
1432
|
-
const reordered = (0, _utils.reorderOptionsBySelection)(optionsToReorder, [tempValue]);
|
|
1433
|
-
setOrderedOptions(reordered);
|
|
1434
|
-
} else {
|
|
1435
|
-
// No selection, reset to original order
|
|
1436
|
-
setOrderedOptions(null);
|
|
1437
|
-
}
|
|
1438
|
-
onChange == null || onChange(tempValue);
|
|
1439
|
-
setDropdownOpen(false);
|
|
1440
|
-
setIsSearching(false);
|
|
1441
|
-
searchClearedTimeRef.current = null;
|
|
1442
|
-
if (resetSearch) {
|
|
1443
|
-
setSearchText('');
|
|
1444
|
-
lastSearchQueryRef.current = '';
|
|
1445
|
-
}
|
|
1446
|
-
if (resetData && mergedOptions.length > 0) {
|
|
1447
|
-
prevOptionsBeforeResetRef.current = mergedOptions;
|
|
1448
|
-
setIsResettingData(true);
|
|
1449
|
-
resetDataCalledRef.current = true;
|
|
1450
|
-
resetDataCalledTimeRef.current = Date.now();
|
|
1451
|
-
resetData();
|
|
1452
|
-
}
|
|
1453
|
-
onConfirm == null || onConfirm(tempValue);
|
|
1454
|
-
}, [onChange, onConfirm, tempValue, resetSearch, isMulti, mergedOptions, resetData]);
|
|
1455
|
-
const handleClearAll = (0, _react.useCallback)(() => {
|
|
1456
|
-
// Reset all state as if it's a fresh dropdown
|
|
1457
|
-
const cleared = isMulti ? [] : undefined;
|
|
1458
|
-
|
|
1459
|
-
// Clear search state
|
|
1460
|
-
setSearchText('');
|
|
1461
|
-
setIsSearching(false);
|
|
1462
|
-
lastSearchQueryRef.current = '';
|
|
1463
|
-
searchClearedTimeRef.current = null;
|
|
1464
|
-
|
|
1465
|
-
// Clear timeouts
|
|
1466
|
-
if (searchTimeoutRef.current) {
|
|
1467
|
-
clearTimeout(searchTimeoutRef.current);
|
|
1468
|
-
searchTimeoutRef.current = null;
|
|
1469
|
-
}
|
|
1470
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1471
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1472
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1473
|
-
}
|
|
1474
|
-
if (scrollThrottleTimeoutRef.current) {
|
|
1475
|
-
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
1476
|
-
scrollThrottleTimeoutRef.current = null;
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
// Reset scroll state
|
|
1480
|
-
setIsLoadingOnScroll(false);
|
|
1481
|
-
isScrollProcessingRef.current = false;
|
|
1482
|
-
scrollContainerRef.current = null;
|
|
1483
|
-
|
|
1484
|
-
// Reset ordered options
|
|
1485
|
-
setOrderedOptions(null);
|
|
1486
|
-
initialSortDoneRef.current = false;
|
|
1487
|
-
|
|
1488
|
-
// Reset interaction flags
|
|
1489
|
-
hasInteractedRef.current = false;
|
|
1490
|
-
resetDataCalledRef.current = false;
|
|
1491
|
-
fetchMissingOptionsCalledRef.current = false;
|
|
1492
|
-
lastMissingValuesRef.current = '';
|
|
1493
|
-
|
|
1494
|
-
// Reset temp value and call onChange (same as allowClear X button)
|
|
1495
|
-
setTempValue(cleared);
|
|
1496
|
-
onChange == null || onChange(cleared);
|
|
1497
|
-
|
|
1498
|
-
// Close dropdown
|
|
1499
|
-
setDropdownOpen(false);
|
|
1500
|
-
|
|
1501
|
-
// Reset data if needed (same as allowClear X button behavior)
|
|
1502
|
-
if (resetData && options.length > 0) {
|
|
1503
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1504
|
-
setIsResettingData(true);
|
|
1505
|
-
resetDataCalledRef.current = true;
|
|
1506
|
-
resetDataCalledTimeRef.current = Date.now();
|
|
1507
|
-
resetData();
|
|
1508
|
-
}
|
|
1509
|
-
}, [isMulti, onChange, resetData, options]);
|
|
1510
|
-
const handleDropdownVisibilityChange = (0, _react.useCallback)(open => {
|
|
1511
|
-
if (readOnly || disabled) {
|
|
1512
|
-
return;
|
|
1513
|
-
}
|
|
1514
|
-
if (open) {
|
|
1515
|
-
initialTempValueRef.current = value;
|
|
1516
|
-
hasInteractedRef.current = false;
|
|
1517
|
-
resetDataCalledRef.current = false;
|
|
1518
|
-
fetchMissingOptionsCalledRef.current = false;
|
|
1519
|
-
lastMissingValuesRef.current = '';
|
|
1520
|
-
if (searchTimeoutRef.current) {
|
|
1521
|
-
clearTimeout(searchTimeoutRef.current);
|
|
1522
|
-
searchTimeoutRef.current = null;
|
|
1523
|
-
}
|
|
1524
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1525
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1526
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1527
|
-
}
|
|
1528
|
-
if (scrollThrottleTimeoutRef.current) {
|
|
1529
|
-
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
1530
|
-
scrollThrottleTimeoutRef.current = null;
|
|
1531
|
-
}
|
|
1532
|
-
setIsSearching(false);
|
|
1533
|
-
searchClearedTimeRef.current = null;
|
|
1534
|
-
setIsLoadingOnScroll(false);
|
|
1535
|
-
isScrollProcessingRef.current = false;
|
|
1536
|
-
if (isResettingData) {
|
|
1537
|
-
setIsResettingData(false);
|
|
1538
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1539
|
-
resetDataCalledTimeRef.current = null;
|
|
1540
|
-
}
|
|
1541
|
-
} else {
|
|
1542
|
-
if (!customPopupRender) {
|
|
1543
|
-
onChange == null || onChange(tempValue);
|
|
1544
|
-
} else {
|
|
1545
|
-
setTempValue(value);
|
|
1546
|
-
}
|
|
1547
|
-
if (resetSearch) {
|
|
1548
|
-
setSearchText('');
|
|
1549
|
-
setIsSearching(false);
|
|
1550
|
-
lastSearchQueryRef.current = '';
|
|
1551
|
-
searchClearedTimeRef.current = null;
|
|
1552
|
-
}
|
|
1553
|
-
setIsLoadingOnScroll(false);
|
|
1554
|
-
isScrollProcessingRef.current = false;
|
|
1555
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1556
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1557
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1558
|
-
}
|
|
1559
|
-
if (scrollThrottleTimeoutRef.current) {
|
|
1560
|
-
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
1561
|
-
scrollThrottleTimeoutRef.current = null;
|
|
1562
|
-
}
|
|
1563
|
-
scrollContainerRef.current = null;
|
|
1564
|
-
if (resetData && hasInteractedRef.current && !resetDataCalledRef.current && options.length > 0) {
|
|
1565
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1566
|
-
setIsResettingData(true);
|
|
1567
|
-
resetDataCalledRef.current = true;
|
|
1568
|
-
resetDataCalledTimeRef.current = Date.now();
|
|
1569
|
-
resetData();
|
|
1570
|
-
} else if (!hasInteractedRef.current) {
|
|
1571
|
-
if (searchTimeoutRef.current) {
|
|
1572
|
-
clearTimeout(searchTimeoutRef.current);
|
|
1573
|
-
searchTimeoutRef.current = null;
|
|
1574
|
-
}
|
|
1575
|
-
setIsSearching(false);
|
|
1576
|
-
setIsResettingData(false);
|
|
1577
|
-
lastSearchQueryRef.current = '';
|
|
1578
|
-
}
|
|
1579
|
-
hasInteractedRef.current = false;
|
|
1580
|
-
}
|
|
1581
|
-
setDropdownOpen(open);
|
|
1582
|
-
}, [customPopupRender, value, onChange, tempValue, readOnly, disabled, resetSearch, resetData, options, isResettingData]);
|
|
1583
|
-
const handleFooterDownload = (0, _react.useCallback)(() => {
|
|
1584
|
-
const currentValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
1585
|
-
onFooterDownloadChange == null || onFooterDownloadChange(currentValues);
|
|
1586
|
-
}, [tempValue, onFooterDownloadChange]);
|
|
1587
|
-
const handleUpload = (0, _react.useCallback)(() => {
|
|
1588
|
-
onUpload == null || onUpload();
|
|
1589
|
-
setDropdownOpen(false);
|
|
1590
|
-
}, [onUpload]);
|
|
1591
|
-
const handleSearchChange = (0, _react.useCallback)(e => {
|
|
1592
|
-
const query = e.target.value;
|
|
1593
|
-
setSearchText(query);
|
|
1594
|
-
handleSearch(query);
|
|
1595
|
-
}, [handleSearch]);
|
|
1596
|
-
const handleSearchKeyDown = (0, _react.useCallback)(e => {
|
|
1597
|
-
if (e.key === 'Backspace' || e.key === 'Delete') {
|
|
1598
|
-
e.stopPropagation();
|
|
1599
|
-
}
|
|
1600
|
-
if (e.key === 'Escape' && searchText.length > 0) {
|
|
1601
|
-
e.stopPropagation();
|
|
1602
|
-
}
|
|
1603
|
-
}, [searchText]);
|
|
1604
|
-
const handleScroll = (0, _react.useCallback)(event => {
|
|
1605
|
-
if (!onPopupScroll) return;
|
|
1606
|
-
const target = event.target;
|
|
1607
|
-
if (!target) return;
|
|
1608
|
-
const isNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
|
|
1609
|
-
if (!isNearBottom) {
|
|
1610
|
-
isScrollProcessingRef.current = false;
|
|
1611
|
-
return;
|
|
1612
|
-
}
|
|
1613
|
-
if (isScrollProcessingRef.current) return;
|
|
1614
|
-
if (isLoadingOnScroll) return;
|
|
1615
|
-
if (!hasMore) {
|
|
1616
|
-
isScrollProcessingRef.current = false;
|
|
1617
|
-
return;
|
|
1618
|
-
}
|
|
1619
|
-
if (scrollThrottleTimeoutRef.current) {
|
|
1620
|
-
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
1621
|
-
}
|
|
1622
|
-
isScrollProcessingRef.current = true;
|
|
1623
|
-
scrollThrottleTimeoutRef.current = setTimeout(() => {
|
|
1624
|
-
const stillNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
|
|
1625
|
-
if (!stillNearBottom || isLoadingOnScroll || !hasMore) {
|
|
1626
|
-
isScrollProcessingRef.current = false;
|
|
1627
|
-
return;
|
|
1628
|
-
}
|
|
1629
|
-
const currentOptions = optionsRef.current;
|
|
1630
|
-
prevOptionsCountRef.current = currentOptions.length;
|
|
1631
|
-
prevOptionsRefForScroll.current = currentOptions;
|
|
1632
|
-
scrollTriggerOptionsCountRef.current = currentOptions.length;
|
|
1633
|
-
setIsLoadingOnScroll(true);
|
|
1634
|
-
if (scrollLoadingTimeoutRef.current) {
|
|
1635
|
-
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
1636
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1637
|
-
}
|
|
1638
|
-
hasInteractedRef.current = true;
|
|
1639
|
-
onPopupScroll();
|
|
1640
|
-
scrollLoadingTimeoutRef.current = setTimeout(() => {
|
|
1641
|
-
setIsLoadingOnScroll(prev => {
|
|
1642
|
-
if (prev) {
|
|
1643
|
-
scrollLoadingTimeoutRef.current = null;
|
|
1644
|
-
isScrollProcessingRef.current = false;
|
|
1645
|
-
return false;
|
|
1646
|
-
}
|
|
1647
|
-
return prev;
|
|
1648
|
-
});
|
|
1649
|
-
}, _constants.TIMEOUTS.SCROLL_LOADING_TIMEOUT);
|
|
1650
|
-
}, 150);
|
|
1651
|
-
}, [onPopupScroll, isLoadingOnScroll, hasMore]);
|
|
1652
|
-
(0, _react.useEffect)(() => {
|
|
1653
|
-
if (!onPopupScroll || !dropdownOpen) return;
|
|
1654
|
-
const timeoutId = setTimeout(() => {
|
|
1655
|
-
const findScrollContainer = () => {
|
|
1656
|
-
const dropdowns = document.querySelectorAll('.ant-select-dropdown:not(.ant-select-dropdown-hidden)');
|
|
1657
|
-
if (dropdowns.length === 0) return null;
|
|
1658
|
-
const dropdown = Array.from(dropdowns).pop();
|
|
1659
|
-
if (!dropdown) return null;
|
|
1660
|
-
const treeList = dropdown.querySelector('.ant-select-tree-list-holder');
|
|
1661
|
-
if (treeList && treeList.scrollHeight > treeList.clientHeight) {
|
|
1662
|
-
return treeList;
|
|
1663
|
-
}
|
|
1664
|
-
const virtualList = dropdown.querySelector('.rc-virtual-list-holder');
|
|
1665
|
-
if (virtualList && virtualList.scrollHeight > virtualList.clientHeight) {
|
|
1666
|
-
return virtualList;
|
|
1667
|
-
}
|
|
1668
|
-
if (dropdown.scrollHeight > dropdown.clientHeight) {
|
|
1669
|
-
return dropdown;
|
|
1670
|
-
}
|
|
1671
|
-
return null;
|
|
1672
|
-
};
|
|
1673
|
-
const scrollContainer = findScrollContainer();
|
|
1674
|
-
if (scrollContainer) {
|
|
1675
|
-
scrollContainerRef.current = scrollContainer;
|
|
1676
|
-
scrollContainer.addEventListener('scroll', handleScroll, {
|
|
1677
|
-
passive: true
|
|
1678
|
-
});
|
|
1679
|
-
}
|
|
1680
|
-
}, _constants.TIMEOUTS.SCROLL_CONTAINER_DELAY);
|
|
1681
|
-
return () => {
|
|
1682
|
-
clearTimeout(timeoutId);
|
|
1683
|
-
if (scrollThrottleTimeoutRef.current) {
|
|
1684
|
-
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
1685
|
-
scrollThrottleTimeoutRef.current = null;
|
|
1686
|
-
}
|
|
1687
|
-
if (scrollContainerRef.current) {
|
|
1688
|
-
scrollContainerRef.current.removeEventListener('scroll', handleScroll);
|
|
1689
|
-
scrollContainerRef.current = null;
|
|
1690
|
-
}
|
|
1691
|
-
isScrollProcessingRef.current = false;
|
|
1491
|
+
"label16": `blaze-ui-label16`,
|
|
1492
|
+
"label17": `blaze-ui-label17`,
|
|
1493
|
+
"label18": `blaze-ui-label18`,
|
|
1494
|
+
"label19": `blaze-ui-label19`,
|
|
1495
|
+
"label20": `blaze-ui-label20`,
|
|
1496
|
+
"label21": `blaze-ui-label21`,
|
|
1497
|
+
"label22": `blaze-ui-label22`,
|
|
1498
|
+
"label23": `blaze-ui-label23`,
|
|
1499
|
+
"label24": `blaze-ui-label24`,
|
|
1500
|
+
"label25": `blaze-ui-label25`,
|
|
1501
|
+
"label26": `blaze-ui-label26`,
|
|
1502
|
+
"label27": `blaze-ui-label27`,
|
|
1503
|
+
"label28": `blaze-ui-label28`,
|
|
1504
|
+
"label29": `blaze-ui-label29`,
|
|
1505
|
+
"label30": `blaze-ui-label30`,
|
|
1506
|
+
"label31": `blaze-ui-label31`,
|
|
1507
|
+
"label32": `blaze-ui-label32`,
|
|
1508
|
+
"label33": `blaze-ui-label33`,
|
|
1509
|
+
"cap-label-div": `blaze-ui-cap-label-div`,
|
|
1510
|
+
"cap-label-span": `blaze-ui-cap-label-span`
|
|
1511
|
+
};
|
|
1512
|
+
module.exports = ___CSS_LOADER_EXPORT___;
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
/***/ }),
|
|
1516
|
+
|
|
1517
|
+
/***/ 5353:
|
|
1518
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1519
|
+
|
|
1520
|
+
"use strict";
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
exports.__esModule = true;
|
|
1524
|
+
exports["default"] = void 0;
|
|
1525
|
+
var _antdV = __webpack_require__(4273);
|
|
1526
|
+
var _classnames = _interopRequireDefault(__webpack_require__(6942));
|
|
1527
|
+
var _react = _interopRequireWildcard(__webpack_require__(9206));
|
|
1528
|
+
var _CapIcon = _interopRequireDefault(__webpack_require__(8244));
|
|
1529
|
+
var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
|
|
1530
|
+
var _CapRow = _interopRequireDefault(__webpack_require__(7375));
|
|
1531
|
+
var _CapTooltip = _interopRequireDefault(__webpack_require__(5636));
|
|
1532
|
+
var _constants = __webpack_require__(9788);
|
|
1533
|
+
var _CustomDropdown = __webpack_require__(8033);
|
|
1534
|
+
var _DropdownHeader = __webpack_require__(9315);
|
|
1535
|
+
var _enhanceOptions = __webpack_require__(1879);
|
|
1536
|
+
var _styles = _interopRequireDefault(__webpack_require__(8263));
|
|
1537
|
+
var _useCapUnifiedSelect = __webpack_require__(480);
|
|
1538
|
+
var _jsxRuntime = __webpack_require__(4848);
|
|
1539
|
+
const _excluded = ["type", "options", "value", "onChange", "placeholder", "className", "style", "isError", "errorMessage", "containerClassName", "popoverClassName", "allowClear", "headerLabel", "onUpload", "uploadLabel", "tooltip", "bylineText", "disabled", "showUpload", "customPopupRender", "showSearch", "searchBasedOn", "onSearch", "searchDebounce", "onConfirm", "clearText", "noResultCustomText", "noResultCustomIcon", "readOnly", "staticValue", "onFooterDownloadChange", "onPopupScroll", "hasMore", "enableVirtualization", "virtualRowHeight", "resetSearch", "resetData", "fetchMissingOptions"];
|
|
1540
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
1541
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1542
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1543
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1544
|
+
const CapUnifiedSelect = _ref => {
|
|
1545
|
+
let {
|
|
1546
|
+
type = _constants.SELECT_TYPES.SELECT,
|
|
1547
|
+
options = [],
|
|
1548
|
+
value,
|
|
1549
|
+
onChange,
|
|
1550
|
+
placeholder = _constants.DEFAULTS.PLACEHOLDER,
|
|
1551
|
+
className = '',
|
|
1552
|
+
style,
|
|
1553
|
+
isError = false,
|
|
1554
|
+
errorMessage,
|
|
1555
|
+
containerClassName,
|
|
1556
|
+
popoverClassName,
|
|
1557
|
+
allowClear = false,
|
|
1558
|
+
headerLabel,
|
|
1559
|
+
onUpload,
|
|
1560
|
+
uploadLabel = _constants.DEFAULTS.UPLOAD_LABEL,
|
|
1561
|
+
tooltip,
|
|
1562
|
+
bylineText,
|
|
1563
|
+
disabled = false,
|
|
1564
|
+
showUpload = false,
|
|
1565
|
+
customPopupRender = true,
|
|
1566
|
+
showSearch = true,
|
|
1567
|
+
searchBasedOn = 'label',
|
|
1568
|
+
onSearch,
|
|
1569
|
+
searchDebounce = _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE,
|
|
1570
|
+
onConfirm,
|
|
1571
|
+
clearText = _constants.DEFAULTS.CLEAR_TEXT,
|
|
1572
|
+
noResultCustomText = _constants.DEFAULTS.NO_RESULT_TEXT,
|
|
1573
|
+
noResultCustomIcon = _constants.DEFAULTS.NO_RESULT_ICON,
|
|
1574
|
+
readOnly = false,
|
|
1575
|
+
staticValue = true,
|
|
1576
|
+
onFooterDownloadChange,
|
|
1577
|
+
onPopupScroll,
|
|
1578
|
+
hasMore = true,
|
|
1579
|
+
enableVirtualization = false,
|
|
1580
|
+
virtualRowHeight = _constants.DEFAULTS.VIRTUAL_ROW_HEIGHT,
|
|
1581
|
+
resetSearch = true,
|
|
1582
|
+
resetData,
|
|
1583
|
+
fetchMissingOptions
|
|
1584
|
+
} = _ref,
|
|
1585
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1586
|
+
const isMulti = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.MULTI_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
|
|
1587
|
+
const {
|
|
1588
|
+
searchText,
|
|
1589
|
+
tempValue,
|
|
1590
|
+
setTempValue,
|
|
1591
|
+
dropdownOpen,
|
|
1592
|
+
isSearching,
|
|
1593
|
+
isLoadingOnScroll,
|
|
1594
|
+
isResettingData,
|
|
1595
|
+
filteredTree: rawFilteredTree,
|
|
1596
|
+
treeMaps,
|
|
1597
|
+
selectedLeafCount,
|
|
1598
|
+
displayValue,
|
|
1599
|
+
handleSearchChange,
|
|
1600
|
+
handleSearchKeyDown,
|
|
1601
|
+
handleConfirm,
|
|
1602
|
+
handleClearAll,
|
|
1603
|
+
handleDropdownVisibilityChange,
|
|
1604
|
+
handleSingleSelectChange,
|
|
1605
|
+
handleMultiSelectChange
|
|
1606
|
+
} = (0, _useCapUnifiedSelect.useCapUnifiedSelect)({
|
|
1607
|
+
type,
|
|
1608
|
+
options,
|
|
1609
|
+
value,
|
|
1610
|
+
onChange,
|
|
1611
|
+
staticValue,
|
|
1612
|
+
onSearch,
|
|
1613
|
+
searchDebounce,
|
|
1614
|
+
searchBasedOn,
|
|
1615
|
+
onConfirm,
|
|
1616
|
+
resetSearch,
|
|
1617
|
+
resetData,
|
|
1618
|
+
fetchMissingOptions,
|
|
1619
|
+
onPopupScroll,
|
|
1620
|
+
hasMore,
|
|
1621
|
+
customPopupRender,
|
|
1622
|
+
isMulti,
|
|
1623
|
+
disabled
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1626
|
+
// Enhance filtered tree with React components
|
|
1627
|
+
const filteredTree = (0, _react.useMemo)(() => {
|
|
1628
|
+
if (!(rawFilteredTree != null && rawFilteredTree.length)) return [];
|
|
1629
|
+
return (0, _enhanceOptions.enhanceOptionsWithComponents)(rawFilteredTree, type);
|
|
1630
|
+
}, [rawFilteredTree, type]);
|
|
1631
|
+
|
|
1632
|
+
// Suffix icon with "more" tooltip
|
|
1633
|
+
const suffix = (0, _react.useMemo)(() => {
|
|
1634
|
+
const count = Array.isArray(displayValue) ? displayValue == null ? void 0 : displayValue.length : displayValue ? 1 : 0;
|
|
1635
|
+
const renderTooltipTitle = values => {
|
|
1636
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1637
|
+
className: _styles.default['cap-unified-select-more-tooltip-content'],
|
|
1638
|
+
children: values.map((val, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1639
|
+
children: val
|
|
1640
|
+
}, "cap-unified-select-tooltip-item-" + val + "-" + idx))
|
|
1641
|
+
});
|
|
1692
1642
|
};
|
|
1693
|
-
}, [onPopupScroll, dropdownOpen, handleScroll]);
|
|
1694
|
-
const renderHeader = (0, _react.useMemo)(() => {
|
|
1695
|
-
if (!headerLabel && !tooltip) return null;
|
|
1696
1643
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1697
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
1698
|
-
className:
|
|
1699
|
-
children:
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
iconProps: {
|
|
1707
|
-
disabled
|
|
1708
|
-
}
|
|
1709
|
-
})]
|
|
1710
|
-
}), bylineText && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1711
|
-
className: _styles.default['cap-unified-select-header-byline-text'],
|
|
1712
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1713
|
-
className: (0, _classnames.default)(disabled && _styles.default.disabled, _styles.default['cap-unified-select-header-byline-text']),
|
|
1714
|
-
children: bylineText
|
|
1715
|
-
})
|
|
1716
|
-
})]
|
|
1717
|
-
});
|
|
1718
|
-
}, [headerLabel, tooltip, bylineText, disabled]);
|
|
1719
|
-
const renderCustomDropdown = (0, _react.useCallback)(menu => {
|
|
1720
|
-
if (!customPopupRender) return menu;
|
|
1721
|
-
const currentItems = filteredTree;
|
|
1722
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1723
|
-
className: (0, _classnames.default)(popoverClassName, _styles.default[type + "-popup-container"]),
|
|
1724
|
-
children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1725
|
-
className: _styles.default['cap-unified-select-search-container'],
|
|
1726
|
-
align: "middle",
|
|
1727
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.Input, {
|
|
1728
|
-
prefix: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
1729
|
-
type: "search",
|
|
1730
|
-
size: "s",
|
|
1731
|
-
className: _styles.default['cap-unified-select-search-icon']
|
|
1732
|
-
}),
|
|
1733
|
-
placeholder: _constants.DEFAULTS.SEARCH_PLACEHOLDER,
|
|
1734
|
-
variant: "borderless",
|
|
1735
|
-
value: searchText,
|
|
1736
|
-
onChange: handleSearchChange,
|
|
1737
|
-
onKeyDown: handleSearchKeyDown,
|
|
1738
|
-
allowClear: true,
|
|
1739
|
-
disabled: disabled
|
|
1740
|
-
})
|
|
1741
|
-
}), isMulti && showUpload && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
1742
|
-
className: _styles.default['cap-unified-select-upload-container'],
|
|
1743
|
-
align: "middle",
|
|
1744
|
-
onClick: handleUpload,
|
|
1745
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
1746
|
-
type: "upload",
|
|
1747
|
-
size: "s",
|
|
1748
|
-
className: _styles.default['cap-unified-select-upload-icon']
|
|
1749
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1750
|
-
type: "label14",
|
|
1751
|
-
className: _styles.default['cap-unified-select-upload-label'],
|
|
1752
|
-
children: uploadLabel
|
|
1753
|
-
})]
|
|
1754
|
-
}), isMulti && staticValue && currentItems.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectAllCheckbox, {
|
|
1755
|
-
currentItems: currentItems,
|
|
1756
|
-
tempValue: Array.isArray(tempValue) ? tempValue : undefined,
|
|
1757
|
-
setTempValue: val => setTempValue(val),
|
|
1758
|
-
processTreeData: _utils.buildTreeMaps,
|
|
1759
|
-
disabled: disabled
|
|
1760
|
-
}), currentItems.length === 0 ? isSearching || isResettingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1761
|
-
className: _styles.default['cap-unified-select-loading-container'],
|
|
1762
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1763
|
-
align: "middle",
|
|
1764
|
-
justify: "center",
|
|
1765
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
|
|
1766
|
-
size: "small"
|
|
1767
|
-
})
|
|
1768
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1769
|
-
align: "middle",
|
|
1770
|
-
justify: "center",
|
|
1771
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1772
|
-
type: "label14",
|
|
1773
|
-
children: "Loading..."
|
|
1644
|
+
children: [isMulti && count > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1645
|
+
className: _styles.default['cap-unified-select-more-text'],
|
|
1646
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltip.default, {
|
|
1647
|
+
title: renderTooltipTitle(Array.isArray(displayValue) ? displayValue.slice(1) : []),
|
|
1648
|
+
placement: "bottom",
|
|
1649
|
+
overlayClassName: _styles.default['cap-unified-select-more-tooltip'],
|
|
1650
|
+
arrowPointAtCenter: true,
|
|
1651
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
1652
|
+
children: ["+", count - 1, " more"]
|
|
1774
1653
|
})
|
|
1775
|
-
})]
|
|
1776
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoResult, {
|
|
1777
|
-
noResultCustomText: noResultCustomText,
|
|
1778
|
-
className: className,
|
|
1779
|
-
showUpload: showUpload,
|
|
1780
|
-
options: options,
|
|
1781
|
-
noResultCustomIcon: noResultCustomIcon
|
|
1782
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1783
|
-
className: _styles.default['cap-unified-select-menu-wrapper'],
|
|
1784
|
-
children: [menu, (isSearching || isResettingData) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1785
|
-
className: _styles.default['cap-unified-select-loading-overlay'],
|
|
1786
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1787
|
-
align: "middle",
|
|
1788
|
-
justify: "center",
|
|
1789
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
|
|
1790
|
-
size: "small"
|
|
1791
|
-
})
|
|
1792
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1793
|
-
align: "middle",
|
|
1794
|
-
justify: "center",
|
|
1795
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1796
|
-
type: "label14",
|
|
1797
|
-
children: "Loading..."
|
|
1798
|
-
})
|
|
1799
|
-
})]
|
|
1800
|
-
}), isLoadingOnScroll && onPopupScroll && hasMore && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1801
|
-
className: _styles.default['cap-unified-select-loading-overlay'],
|
|
1802
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1803
|
-
align: "middle",
|
|
1804
|
-
justify: "center",
|
|
1805
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
|
|
1806
|
-
size: "small"
|
|
1807
|
-
})
|
|
1808
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1809
|
-
align: "middle",
|
|
1810
|
-
justify: "center",
|
|
1811
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1812
|
-
type: "label14",
|
|
1813
|
-
children: "Loading..."
|
|
1814
|
-
})
|
|
1815
|
-
})]
|
|
1816
|
-
})]
|
|
1817
|
-
}), currentItems.length > 0 && isMulti && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1818
|
-
className: _styles.default['cap-unified-select-confirm-container'],
|
|
1819
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1820
|
-
className: _styles.default['cap-unified-select-confirm-button-group'],
|
|
1821
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.Button, {
|
|
1822
|
-
type: "primary",
|
|
1823
|
-
size: "small",
|
|
1824
|
-
className: _styles.default['cap-unified-select-confirm-button'],
|
|
1825
|
-
onClick: handleConfirm,
|
|
1826
|
-
disabled: disabled || selectedLeafCount === 0,
|
|
1827
|
-
children: "Confirm"
|
|
1828
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.Button, {
|
|
1829
|
-
type: "text",
|
|
1830
|
-
className: _styles.default['cap-unified-select-cancel-button'],
|
|
1831
|
-
size: "small",
|
|
1832
|
-
onClick: handleClearAll,
|
|
1833
|
-
disabled: disabled,
|
|
1834
|
-
children: clearText
|
|
1835
|
-
}), onFooterDownloadChange && selectedLeafCount > 0 && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
1836
|
-
className: _styles.default['cap-unified-select-footer-download-container'],
|
|
1837
|
-
align: "middle",
|
|
1838
|
-
onClick: handleFooterDownload,
|
|
1839
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
1840
|
-
type: "download",
|
|
1841
|
-
size: "s",
|
|
1842
|
-
className: _styles.default['cap-unified-select-footer-download-icon']
|
|
1843
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapLabel.default, {
|
|
1844
|
-
className: _styles.default['cap-unified-select-footer-download-label'],
|
|
1845
|
-
children: [selectedLeafCount, " selected"]
|
|
1846
|
-
})]
|
|
1847
|
-
})]
|
|
1848
|
-
})
|
|
1849
|
-
}), (type === _constants.SELECT_TYPES.SELECT || type === _constants.SELECT_TYPES.TREE_SELECT) && allowClear && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
1850
|
-
className: _styles.default['cap-unified-select-tree-clear-container'],
|
|
1851
|
-
onClick: handleClearAll,
|
|
1852
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
1853
|
-
className: _styles.default['cap-unified-select-tree-clear-label'],
|
|
1854
|
-
children: clearText
|
|
1855
1654
|
})
|
|
1655
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
1656
|
+
className: _styles.default['cap-unified-select-suffix-icon'],
|
|
1657
|
+
type: dropdownOpen ? 'up' : 'down',
|
|
1658
|
+
size: "xs"
|
|
1856
1659
|
})]
|
|
1857
1660
|
});
|
|
1858
|
-
}, [
|
|
1661
|
+
}, [isMulti, displayValue, dropdownOpen]);
|
|
1662
|
+
|
|
1663
|
+
// Prefix for multi-select (first selected item label)
|
|
1664
|
+
const prefix = (0, _react.useMemo)(() => {
|
|
1665
|
+
if (isMulti && Array.isArray(displayValue) && (displayValue == null ? void 0 : displayValue.length) > 0) {
|
|
1666
|
+
var _treeMaps$nodeMap;
|
|
1667
|
+
const firstLeafValue = displayValue.find(val => {
|
|
1668
|
+
var _treeMaps$leafValues;
|
|
1669
|
+
return treeMaps == null || (_treeMaps$leafValues = treeMaps.leafValues) == null ? void 0 : _treeMaps$leafValues.includes(val);
|
|
1670
|
+
});
|
|
1671
|
+
return firstLeafValue ? (treeMaps == null || (_treeMaps$nodeMap = treeMaps.nodeMap) == null || (_treeMaps$nodeMap = _treeMaps$nodeMap[firstLeafValue]) == null ? void 0 : _treeMaps$nodeMap.label) || null : null;
|
|
1672
|
+
}
|
|
1673
|
+
return null;
|
|
1674
|
+
}, [isMulti, displayValue, treeMaps]);
|
|
1675
|
+
|
|
1676
|
+
// Handle upload
|
|
1677
|
+
const handleUpload = () => {
|
|
1678
|
+
onUpload == null || onUpload();
|
|
1679
|
+
handleDropdownVisibilityChange(false);
|
|
1680
|
+
};
|
|
1681
|
+
|
|
1682
|
+
// Render custom dropdown
|
|
1683
|
+
const renderCustomDropdown = menu => {
|
|
1684
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomDropdown.CustomDropdown, {
|
|
1685
|
+
menu: menu,
|
|
1686
|
+
customPopupRender: customPopupRender,
|
|
1687
|
+
filteredTree: filteredTree,
|
|
1688
|
+
searchText: searchText,
|
|
1689
|
+
showSearch: showSearch,
|
|
1690
|
+
handleSearchChange: handleSearchChange,
|
|
1691
|
+
handleSearchKeyDown: handleSearchKeyDown,
|
|
1692
|
+
disabled: disabled,
|
|
1693
|
+
isMulti: isMulti,
|
|
1694
|
+
showUpload: showUpload,
|
|
1695
|
+
uploadLabel: uploadLabel,
|
|
1696
|
+
handleUpload: handleUpload,
|
|
1697
|
+
staticValue: staticValue,
|
|
1698
|
+
tempValue: tempValue,
|
|
1699
|
+
setTempValue: setTempValue,
|
|
1700
|
+
isSearching: isSearching,
|
|
1701
|
+
isResettingData: isResettingData,
|
|
1702
|
+
isLoadingOnScroll: isLoadingOnScroll,
|
|
1703
|
+
onPopupScroll: onPopupScroll,
|
|
1704
|
+
hasMore: hasMore,
|
|
1705
|
+
noResultCustomText: noResultCustomText,
|
|
1706
|
+
noResultCustomIcon: noResultCustomIcon,
|
|
1707
|
+
options: options,
|
|
1708
|
+
className: className,
|
|
1709
|
+
type: type,
|
|
1710
|
+
selectedLeafCount: selectedLeafCount,
|
|
1711
|
+
handleConfirm: handleConfirm,
|
|
1712
|
+
handleClearAll: handleClearAll,
|
|
1713
|
+
clearText: clearText,
|
|
1714
|
+
onFooterDownloadChange: onFooterDownloadChange,
|
|
1715
|
+
allowClear: allowClear,
|
|
1716
|
+
popoverClassName: popoverClassName
|
|
1717
|
+
});
|
|
1718
|
+
};
|
|
1859
1719
|
const combinedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(containerClassName, _styles.default['cap-unified-tree-select'], {
|
|
1860
1720
|
[_styles.default['cap-unified-tree-select-readonly']]: readOnly
|
|
1861
1721
|
}, className), [containerClassName, className, readOnly]);
|
|
1862
|
-
const handleSingleSelectChange = (0, _react.useCallback)(newValue => {
|
|
1863
|
-
if (disabled) {
|
|
1864
|
-
return;
|
|
1865
|
-
}
|
|
1866
|
-
if (newValue !== initialTempValueRef.current) {
|
|
1867
|
-
hasInteractedRef.current = true;
|
|
1868
|
-
}
|
|
1869
|
-
if (newValue === undefined || newValue === null) {
|
|
1870
|
-
if (resetData && options.length > 0) {
|
|
1871
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1872
|
-
setIsResettingData(true);
|
|
1873
|
-
resetDataCalledRef.current = true;
|
|
1874
|
-
resetDataCalledTimeRef.current = Date.now();
|
|
1875
|
-
resetData();
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
onChange == null || onChange(newValue);
|
|
1879
|
-
}, [onChange, resetData, options, disabled]);
|
|
1880
|
-
const handleMultiSelectChange = (0, _react.useCallback)(newValue => {
|
|
1881
|
-
if (disabled) {
|
|
1882
|
-
return;
|
|
1883
|
-
}
|
|
1884
|
-
const initialValue = initialTempValueRef.current;
|
|
1885
|
-
const hasChanged = Array.isArray(newValue) && Array.isArray(initialValue) ? newValue.length !== initialValue.length || !newValue.every(v => initialValue.includes(v)) || !initialValue.every(v => newValue.includes(v)) : newValue !== initialValue;
|
|
1886
|
-
if (hasChanged) {
|
|
1887
|
-
hasInteractedRef.current = true;
|
|
1888
|
-
}
|
|
1889
|
-
if (newValue === undefined || newValue === null || Array.isArray(newValue) && newValue.length === 0) {
|
|
1890
|
-
if (resetData && options.length > 0) {
|
|
1891
|
-
prevOptionsBeforeResetRef.current = options;
|
|
1892
|
-
setIsResettingData(true);
|
|
1893
|
-
resetDataCalledRef.current = true;
|
|
1894
|
-
resetDataCalledTimeRef.current = Date.now();
|
|
1895
|
-
resetData();
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
setTempValue(newValue);
|
|
1899
|
-
}, [resetData, options, disabled]);
|
|
1900
1722
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
1901
1723
|
className: className,
|
|
1902
|
-
children: [
|
|
1724
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DropdownHeader.DropdownHeader, {
|
|
1725
|
+
headerLabel: headerLabel,
|
|
1726
|
+
tooltip: tooltip,
|
|
1727
|
+
bylineText: bylineText,
|
|
1728
|
+
disabled: disabled
|
|
1729
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.TreeSelect, _extends({
|
|
1903
1730
|
treeData: filteredTree,
|
|
1904
1731
|
value: customPopupRender ? tempValue : value,
|
|
1905
1732
|
treeNodeLabelProp: "label",
|
|
@@ -1927,7 +1754,7 @@ const CapUnifiedSelect = _ref => {
|
|
|
1927
1754
|
onOpenChange: handleDropdownVisibilityChange,
|
|
1928
1755
|
virtual: !enableVirtualization,
|
|
1929
1756
|
popupMatchSelectWidth: false,
|
|
1930
|
-
disabled: disabled,
|
|
1757
|
+
disabled: disabled || readOnly,
|
|
1931
1758
|
filterTreeNode: false,
|
|
1932
1759
|
listHeight: _constants.DEFAULTS.LIST_HEIGHT,
|
|
1933
1760
|
listItemHeight: virtualRowHeight,
|
|
@@ -2653,6 +2480,209 @@ module.exports = insertBySelector;
|
|
|
2653
2480
|
|
|
2654
2481
|
/***/ }),
|
|
2655
2482
|
|
|
2483
|
+
/***/ 8033:
|
|
2484
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2485
|
+
|
|
2486
|
+
"use strict";
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
exports.__esModule = true;
|
|
2490
|
+
exports.CustomDropdown = void 0;
|
|
2491
|
+
var _antdV = __webpack_require__(4273);
|
|
2492
|
+
var _classnames = _interopRequireDefault(__webpack_require__(6942));
|
|
2493
|
+
var _react = _interopRequireDefault(__webpack_require__(9206));
|
|
2494
|
+
var _CapIcon = _interopRequireDefault(__webpack_require__(8244));
|
|
2495
|
+
var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
|
|
2496
|
+
var _CapRow = _interopRequireDefault(__webpack_require__(7375));
|
|
2497
|
+
var _CapSpin = _interopRequireDefault(__webpack_require__(1549));
|
|
2498
|
+
var _components = __webpack_require__(455);
|
|
2499
|
+
var _constants = __webpack_require__(9788);
|
|
2500
|
+
var _styles = _interopRequireDefault(__webpack_require__(8263));
|
|
2501
|
+
var _utils = __webpack_require__(8052);
|
|
2502
|
+
var _jsxRuntime = __webpack_require__(4848);
|
|
2503
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
2504
|
+
const CustomDropdown = _ref => {
|
|
2505
|
+
let {
|
|
2506
|
+
menu,
|
|
2507
|
+
customPopupRender,
|
|
2508
|
+
filteredTree,
|
|
2509
|
+
searchText,
|
|
2510
|
+
showSearch,
|
|
2511
|
+
handleSearchChange,
|
|
2512
|
+
handleSearchKeyDown,
|
|
2513
|
+
disabled,
|
|
2514
|
+
isMulti,
|
|
2515
|
+
showUpload,
|
|
2516
|
+
uploadLabel,
|
|
2517
|
+
handleUpload,
|
|
2518
|
+
staticValue,
|
|
2519
|
+
tempValue,
|
|
2520
|
+
setTempValue,
|
|
2521
|
+
isSearching,
|
|
2522
|
+
isResettingData,
|
|
2523
|
+
isLoadingOnScroll,
|
|
2524
|
+
onPopupScroll,
|
|
2525
|
+
hasMore,
|
|
2526
|
+
noResultCustomText,
|
|
2527
|
+
noResultCustomIcon,
|
|
2528
|
+
options,
|
|
2529
|
+
className,
|
|
2530
|
+
type,
|
|
2531
|
+
selectedLeafCount,
|
|
2532
|
+
handleConfirm,
|
|
2533
|
+
handleClearAll,
|
|
2534
|
+
clearText,
|
|
2535
|
+
onFooterDownloadChange,
|
|
2536
|
+
allowClear,
|
|
2537
|
+
popoverClassName
|
|
2538
|
+
} = _ref;
|
|
2539
|
+
if (!customPopupRender) return menu;
|
|
2540
|
+
const currentItems = filteredTree;
|
|
2541
|
+
const handleFooterDownload = () => {
|
|
2542
|
+
const currentValues = Array.isArray(tempValue) ? tempValue : tempValue ? [tempValue] : [];
|
|
2543
|
+
onFooterDownloadChange == null || onFooterDownloadChange(currentValues);
|
|
2544
|
+
};
|
|
2545
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2546
|
+
className: (0, _classnames.default)(popoverClassName, _styles.default[type + "-popup-container"]),
|
|
2547
|
+
children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2548
|
+
className: _styles.default['cap-unified-select-search-container'],
|
|
2549
|
+
align: "middle",
|
|
2550
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.Input, {
|
|
2551
|
+
prefix: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
2552
|
+
type: "search",
|
|
2553
|
+
size: "s",
|
|
2554
|
+
className: _styles.default['cap-unified-select-search-icon']
|
|
2555
|
+
}),
|
|
2556
|
+
placeholder: _constants.DEFAULTS.SEARCH_PLACEHOLDER,
|
|
2557
|
+
variant: "borderless",
|
|
2558
|
+
value: searchText,
|
|
2559
|
+
onChange: handleSearchChange,
|
|
2560
|
+
onKeyDown: handleSearchKeyDown,
|
|
2561
|
+
allowClear: true,
|
|
2562
|
+
disabled: disabled
|
|
2563
|
+
})
|
|
2564
|
+
}), isMulti && showUpload && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
2565
|
+
className: _styles.default['cap-unified-select-upload-container'],
|
|
2566
|
+
align: "middle",
|
|
2567
|
+
onClick: handleUpload,
|
|
2568
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
2569
|
+
type: "upload",
|
|
2570
|
+
size: "s",
|
|
2571
|
+
className: _styles.default['cap-unified-select-upload-icon']
|
|
2572
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
2573
|
+
type: "label14",
|
|
2574
|
+
className: _styles.default['cap-unified-select-upload-label'],
|
|
2575
|
+
children: uploadLabel
|
|
2576
|
+
})]
|
|
2577
|
+
}), isMulti && staticValue && currentItems.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectAllCheckbox, {
|
|
2578
|
+
currentItems: currentItems,
|
|
2579
|
+
tempValue: Array.isArray(tempValue) ? tempValue : undefined,
|
|
2580
|
+
setTempValue: val => setTempValue(val),
|
|
2581
|
+
processTreeData: _utils.buildTreeMaps,
|
|
2582
|
+
disabled: disabled
|
|
2583
|
+
}), currentItems.length === 0 ? isSearching || isResettingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2584
|
+
className: _styles.default['cap-unified-select-loading-container'],
|
|
2585
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2586
|
+
align: "middle",
|
|
2587
|
+
justify: "center",
|
|
2588
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
|
|
2589
|
+
size: "small"
|
|
2590
|
+
})
|
|
2591
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2592
|
+
align: "middle",
|
|
2593
|
+
justify: "center",
|
|
2594
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
2595
|
+
type: "label14",
|
|
2596
|
+
children: "Loading..."
|
|
2597
|
+
})
|
|
2598
|
+
})]
|
|
2599
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoResult, {
|
|
2600
|
+
noResultCustomText: noResultCustomText,
|
|
2601
|
+
className: className,
|
|
2602
|
+
showUpload: showUpload,
|
|
2603
|
+
options: options,
|
|
2604
|
+
noResultCustomIcon: noResultCustomIcon
|
|
2605
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2606
|
+
className: _styles.default['cap-unified-select-menu-wrapper'],
|
|
2607
|
+
children: [menu, (isSearching || isResettingData) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2608
|
+
className: _styles.default['cap-unified-select-loading-overlay'],
|
|
2609
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2610
|
+
align: "middle",
|
|
2611
|
+
justify: "center",
|
|
2612
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
|
|
2613
|
+
size: "small"
|
|
2614
|
+
})
|
|
2615
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2616
|
+
align: "middle",
|
|
2617
|
+
justify: "center",
|
|
2618
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
2619
|
+
type: "label14",
|
|
2620
|
+
children: "Loading..."
|
|
2621
|
+
})
|
|
2622
|
+
})]
|
|
2623
|
+
}), isLoadingOnScroll && onPopupScroll && hasMore && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2624
|
+
className: _styles.default['cap-unified-select-loading-overlay'],
|
|
2625
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2626
|
+
align: "middle",
|
|
2627
|
+
justify: "center",
|
|
2628
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSpin.default, {
|
|
2629
|
+
size: "small"
|
|
2630
|
+
})
|
|
2631
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2632
|
+
align: "middle",
|
|
2633
|
+
justify: "center",
|
|
2634
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
2635
|
+
type: "label14",
|
|
2636
|
+
children: "Loading..."
|
|
2637
|
+
})
|
|
2638
|
+
})]
|
|
2639
|
+
})]
|
|
2640
|
+
}), currentItems.length > 0 && isMulti && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2641
|
+
className: _styles.default['cap-unified-select-confirm-container'],
|
|
2642
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2643
|
+
className: _styles.default['cap-unified-select-confirm-button-group'],
|
|
2644
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.Button, {
|
|
2645
|
+
type: "primary",
|
|
2646
|
+
size: "small",
|
|
2647
|
+
className: _styles.default['cap-unified-select-confirm-button'],
|
|
2648
|
+
onClick: handleConfirm,
|
|
2649
|
+
disabled: disabled || selectedLeafCount === 0,
|
|
2650
|
+
children: "Confirm"
|
|
2651
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdV.Button, {
|
|
2652
|
+
type: "text",
|
|
2653
|
+
className: _styles.default['cap-unified-select-cancel-button'],
|
|
2654
|
+
size: "small",
|
|
2655
|
+
onClick: handleClearAll,
|
|
2656
|
+
disabled: disabled,
|
|
2657
|
+
children: clearText
|
|
2658
|
+
}), onFooterDownloadChange && selectedLeafCount > 0 && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
2659
|
+
className: _styles.default['cap-unified-select-footer-download-container'],
|
|
2660
|
+
align: "middle",
|
|
2661
|
+
onClick: handleFooterDownload,
|
|
2662
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
2663
|
+
type: "download",
|
|
2664
|
+
size: "s",
|
|
2665
|
+
className: _styles.default['cap-unified-select-footer-download-icon']
|
|
2666
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapLabel.default, {
|
|
2667
|
+
className: _styles.default['cap-unified-select-footer-download-label'],
|
|
2668
|
+
children: [selectedLeafCount, " selected"]
|
|
2669
|
+
})]
|
|
2670
|
+
})]
|
|
2671
|
+
})
|
|
2672
|
+
}), (type === _constants.SELECT_TYPES.SELECT || type === _constants.SELECT_TYPES.TREE_SELECT) && allowClear && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
|
|
2673
|
+
className: _styles.default['cap-unified-select-tree-clear-container'],
|
|
2674
|
+
onClick: handleClearAll,
|
|
2675
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
2676
|
+
className: _styles.default['cap-unified-select-tree-clear-label'],
|
|
2677
|
+
children: clearText
|
|
2678
|
+
})
|
|
2679
|
+
})]
|
|
2680
|
+
});
|
|
2681
|
+
};
|
|
2682
|
+
exports.CustomDropdown = CustomDropdown;
|
|
2683
|
+
|
|
2684
|
+
/***/ }),
|
|
2685
|
+
|
|
2656
2686
|
/***/ 8052:
|
|
2657
2687
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2658
2688
|
|
|
@@ -2660,7 +2690,7 @@ module.exports = insertBySelector;
|
|
|
2660
2690
|
|
|
2661
2691
|
|
|
2662
2692
|
exports.__esModule = true;
|
|
2663
|
-
exports.reorderOptionsBySelection = exports.findValueInOptions = exports.findMissingValues = exports.filterTreeData = exports.countSelectedLeaves = exports.buildTreeMaps = void 0;
|
|
2693
|
+
exports.reorderOptionsBySelection = exports.prepareDataSource = exports.getScrollContainer = exports.findValueInOptions = exports.findMissingValues = exports.filterTreeData = exports.countSelectedLeaves = exports.buildTreeMaps = void 0;
|
|
2664
2694
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2665
2695
|
/**
|
|
2666
2696
|
* Builds tree maps for efficient tree operations
|
|
@@ -2812,24 +2842,9 @@ const reorderOptionsBySelection = (opts, selectedOrder) => {
|
|
|
2812
2842
|
return topLevelItem;
|
|
2813
2843
|
}
|
|
2814
2844
|
|
|
2815
|
-
// Recursively search in children
|
|
2816
|
-
const searchInChildren = items => {
|
|
2817
|
-
for (const item of items) {
|
|
2818
|
-
if (item.value === targetValue) {
|
|
2819
|
-
return true; // Found it
|
|
2820
|
-
}
|
|
2821
|
-
if (item.children && item.children.length > 0) {
|
|
2822
|
-
if (searchInChildren(item.children)) {
|
|
2823
|
-
return true;
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
return false;
|
|
2828
|
-
};
|
|
2829
|
-
|
|
2830
2845
|
// If found in this top-level item's children, return the top-level item
|
|
2831
2846
|
if (topLevelItem.children && topLevelItem.children.length > 0) {
|
|
2832
|
-
if (
|
|
2847
|
+
if (findValueInOptions(topLevelItem.children, targetValue)) {
|
|
2833
2848
|
return topLevelItem;
|
|
2834
2849
|
}
|
|
2835
2850
|
}
|
|
@@ -2876,7 +2891,69 @@ const reorderOptionsBySelection = (opts, selectedOrder) => {
|
|
|
2876
2891
|
// Return selected items first (in selection order), then unselected items
|
|
2877
2892
|
return [...selectedItems, ...unselectedItems];
|
|
2878
2893
|
};
|
|
2894
|
+
|
|
2895
|
+
/**
|
|
2896
|
+
* Prepares data source with virtual options for selected values not in current options
|
|
2897
|
+
* Returns raw options without React component enhancement
|
|
2898
|
+
*/
|
|
2879
2899
|
exports.reorderOptionsBySelection = reorderOptionsBySelection;
|
|
2900
|
+
const prepareDataSource = (options, orderedOptions, searchText, value, staticValue, selectedItemsCache) => {
|
|
2901
|
+
const sourceOptions = searchText.trim() ? options : orderedOptions || options;
|
|
2902
|
+
const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
2903
|
+
const hasSearchQuery = searchText.trim().length > 0;
|
|
2904
|
+
const shouldAppendVirtualOptions = staticValue || !hasSearchQuery;
|
|
2905
|
+
const missingSelectedValues = [];
|
|
2906
|
+
if (shouldAppendVirtualOptions && selectedValues.length > 0) {
|
|
2907
|
+
selectedValues.forEach(val => {
|
|
2908
|
+
if (!findValueInOptions(sourceOptions, val)) {
|
|
2909
|
+
missingSelectedValues.push(val);
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
|
+
const virtualOptions = missingSelectedValues.map(val => {
|
|
2914
|
+
const cachedOption = selectedItemsCache.get(val);
|
|
2915
|
+
return _extends({
|
|
2916
|
+
value: val,
|
|
2917
|
+
label: (cachedOption == null ? void 0 : cachedOption.label) || String(val),
|
|
2918
|
+
key: (cachedOption == null ? void 0 : cachedOption.key) || val,
|
|
2919
|
+
title: cachedOption == null ? void 0 : cachedOption.title,
|
|
2920
|
+
optionSuffix: cachedOption == null ? void 0 : cachedOption.optionSuffix,
|
|
2921
|
+
optionSuffixInfo: cachedOption == null ? void 0 : cachedOption.optionSuffixInfo,
|
|
2922
|
+
optionTooltipInfo: cachedOption == null ? void 0 : cachedOption.optionTooltipInfo,
|
|
2923
|
+
disabled: cachedOption == null ? void 0 : cachedOption.disabled
|
|
2924
|
+
}, (cachedOption == null ? void 0 : cachedOption.children) && {
|
|
2925
|
+
children: cachedOption.children
|
|
2926
|
+
});
|
|
2927
|
+
});
|
|
2928
|
+
const allOptions = hasSearchQuery ? [...sourceOptions, ...virtualOptions] : [...virtualOptions, ...sourceOptions];
|
|
2929
|
+
return allOptions != null && allOptions.length ? allOptions : [];
|
|
2930
|
+
};
|
|
2931
|
+
|
|
2932
|
+
/**
|
|
2933
|
+
* Finds the scrollable container element within the dropdown
|
|
2934
|
+
* Checks for tree list holder, virtual list holder, or dropdown itself
|
|
2935
|
+
* Returns the first scrollable container found, or null if none
|
|
2936
|
+
*/
|
|
2937
|
+
exports.prepareDataSource = prepareDataSource;
|
|
2938
|
+
const getScrollContainer = () => {
|
|
2939
|
+
const dropdowns = document.querySelectorAll('.ant-select-dropdown:not(.ant-select-dropdown-hidden)');
|
|
2940
|
+
if (dropdowns.length === 0) return null;
|
|
2941
|
+
const dropdown = Array.from(dropdowns).pop();
|
|
2942
|
+
if (!dropdown) return null;
|
|
2943
|
+
const treeList = dropdown.querySelector('.ant-select-tree-list-holder');
|
|
2944
|
+
if (treeList && treeList.scrollHeight > treeList.clientHeight) {
|
|
2945
|
+
return treeList;
|
|
2946
|
+
}
|
|
2947
|
+
const virtualList = dropdown.querySelector('.rc-virtual-list-holder');
|
|
2948
|
+
if (virtualList && virtualList.scrollHeight > virtualList.clientHeight) {
|
|
2949
|
+
return virtualList;
|
|
2950
|
+
}
|
|
2951
|
+
if (dropdown.scrollHeight > dropdown.clientHeight) {
|
|
2952
|
+
return dropdown;
|
|
2953
|
+
}
|
|
2954
|
+
return null;
|
|
2955
|
+
};
|
|
2956
|
+
exports.getScrollContainer = getScrollContainer;
|
|
2880
2957
|
|
|
2881
2958
|
/***/ }),
|
|
2882
2959
|
|
|
@@ -2944,6 +3021,227 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
2944
3021
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default()) && (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) ? (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) : undefined);
|
|
2945
3022
|
|
|
2946
3023
|
|
|
3024
|
+
/***/ }),
|
|
3025
|
+
|
|
3026
|
+
/***/ 9103:
|
|
3027
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3028
|
+
|
|
3029
|
+
"use strict";
|
|
3030
|
+
|
|
3031
|
+
|
|
3032
|
+
exports.__esModule = true;
|
|
3033
|
+
exports.useInfiniteScroll = void 0;
|
|
3034
|
+
var _react = __webpack_require__(9206);
|
|
3035
|
+
var _constants = __webpack_require__(9788);
|
|
3036
|
+
var _utils = __webpack_require__(8052);
|
|
3037
|
+
/**
|
|
3038
|
+
* Custom hook for handling infinite scroll/pagination in dropdown
|
|
3039
|
+
* Manages scroll event listeners, loading states, and triggers onPopupScroll callback
|
|
3040
|
+
*/
|
|
3041
|
+
const useInfiniteScroll = _ref => {
|
|
3042
|
+
let {
|
|
3043
|
+
onPopupScroll,
|
|
3044
|
+
hasMore,
|
|
3045
|
+
options,
|
|
3046
|
+
dropdownOpen,
|
|
3047
|
+
optionsRef,
|
|
3048
|
+
hasInteractedRef
|
|
3049
|
+
} = _ref;
|
|
3050
|
+
const [isLoadingOnScroll, setIsLoadingOnScroll] = (0, _react.useState)(false);
|
|
3051
|
+
const scrollContainerRef = (0, _react.useRef)(null);
|
|
3052
|
+
const scrollLoadingTimeoutRef = (0, _react.useRef)(null);
|
|
3053
|
+
const isScrollProcessingRef = (0, _react.useRef)(false);
|
|
3054
|
+
const scrollThrottleTimeoutRef = (0, _react.useRef)(null);
|
|
3055
|
+
const prevOptionsRefForScroll = (0, _react.useRef)(options);
|
|
3056
|
+
const scrollTriggerOptionsCountRef = (0, _react.useRef)(options.length);
|
|
3057
|
+
const prevOptionsCountRef = (0, _react.useRef)(options.length);
|
|
3058
|
+
(0, _react.useEffect)(() => {
|
|
3059
|
+
optionsRef.current = options;
|
|
3060
|
+
}, [options, optionsRef]);
|
|
3061
|
+
(0, _react.useEffect)(() => {
|
|
3062
|
+
return () => {
|
|
3063
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3064
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3065
|
+
}
|
|
3066
|
+
if (scrollThrottleTimeoutRef.current) {
|
|
3067
|
+
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
3068
|
+
}
|
|
3069
|
+
};
|
|
3070
|
+
}, []);
|
|
3071
|
+
(0, _react.useEffect)(() => {
|
|
3072
|
+
if (!hasMore && isLoadingOnScroll) {
|
|
3073
|
+
setIsLoadingOnScroll(false);
|
|
3074
|
+
isScrollProcessingRef.current = false;
|
|
3075
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3076
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3077
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
}, [hasMore, isLoadingOnScroll]);
|
|
3081
|
+
|
|
3082
|
+
/**
|
|
3083
|
+
* PRIMARY MECHANISM: Detect when API call completes by monitoring options changes
|
|
3084
|
+
* When onPopupScroll() is called, it triggers an API call. When the API completes,
|
|
3085
|
+
* the options prop will change (new data loaded). This effect detects that change
|
|
3086
|
+
* and sets loading to false, which is the correct way to handle API completion.
|
|
3087
|
+
*
|
|
3088
|
+
* This is the primary mechanism for detecting API completion when onPopupScroll
|
|
3089
|
+
* doesn't return a Promise (backward compatibility).
|
|
3090
|
+
*/
|
|
3091
|
+
(0, _react.useEffect)(() => {
|
|
3092
|
+
if (!isLoadingOnScroll) {
|
|
3093
|
+
prevOptionsCountRef.current = options.length;
|
|
3094
|
+
prevOptionsRefForScroll.current = options;
|
|
3095
|
+
return;
|
|
3096
|
+
}
|
|
3097
|
+
if (!onPopupScroll) {
|
|
3098
|
+
return;
|
|
3099
|
+
}
|
|
3100
|
+
const optionsCountIncreased = options.length > prevOptionsCountRef.current;
|
|
3101
|
+
const optionsContentChanged = (() => {
|
|
3102
|
+
const prevCount = prevOptionsCountRef.current;
|
|
3103
|
+
const currentCount = options.length;
|
|
3104
|
+
if (prevCount !== currentCount) {
|
|
3105
|
+
return true;
|
|
3106
|
+
}
|
|
3107
|
+
if (currentCount > 0 && prevCount > 0 && prevOptionsRefForScroll.current.length > 0) {
|
|
3108
|
+
const prevOptions = prevOptionsRefForScroll.current;
|
|
3109
|
+
const lastPrevOption = prevOptions[prevOptions.length - 1];
|
|
3110
|
+
const lastCurrentOption = options[options.length - 1];
|
|
3111
|
+
if ((lastPrevOption == null ? void 0 : lastPrevOption.value) !== (lastCurrentOption == null ? void 0 : lastCurrentOption.value) || (lastPrevOption == null ? void 0 : lastPrevOption.label) !== (lastCurrentOption == null ? void 0 : lastCurrentOption.label)) {
|
|
3112
|
+
return true;
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
return false;
|
|
3116
|
+
})();
|
|
3117
|
+
if (optionsCountIncreased || optionsContentChanged) {
|
|
3118
|
+
setIsLoadingOnScroll(false);
|
|
3119
|
+
isScrollProcessingRef.current = false;
|
|
3120
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3121
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3122
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3123
|
+
}
|
|
3124
|
+
prevOptionsCountRef.current = options.length;
|
|
3125
|
+
prevOptionsRefForScroll.current = options;
|
|
3126
|
+
}
|
|
3127
|
+
}, [options, isLoadingOnScroll, onPopupScroll]);
|
|
3128
|
+
const handleScroll = (0, _react.useCallback)(event => {
|
|
3129
|
+
if (!onPopupScroll) return;
|
|
3130
|
+
const target = event.target;
|
|
3131
|
+
if (!target) return;
|
|
3132
|
+
const isNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
|
|
3133
|
+
if (!isNearBottom) {
|
|
3134
|
+
isScrollProcessingRef.current = false;
|
|
3135
|
+
return;
|
|
3136
|
+
}
|
|
3137
|
+
if (isScrollProcessingRef.current) return;
|
|
3138
|
+
if (isLoadingOnScroll) return;
|
|
3139
|
+
if (!hasMore) {
|
|
3140
|
+
isScrollProcessingRef.current = false;
|
|
3141
|
+
return;
|
|
3142
|
+
}
|
|
3143
|
+
if (scrollThrottleTimeoutRef.current) {
|
|
3144
|
+
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
3145
|
+
}
|
|
3146
|
+
isScrollProcessingRef.current = true;
|
|
3147
|
+
scrollThrottleTimeoutRef.current = setTimeout(() => {
|
|
3148
|
+
const stillNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
|
|
3149
|
+
if (!stillNearBottom || isLoadingOnScroll || !hasMore) {
|
|
3150
|
+
isScrollProcessingRef.current = false;
|
|
3151
|
+
return;
|
|
3152
|
+
}
|
|
3153
|
+
const currentOptions = optionsRef.current;
|
|
3154
|
+
prevOptionsCountRef.current = currentOptions.length;
|
|
3155
|
+
prevOptionsRefForScroll.current = currentOptions;
|
|
3156
|
+
scrollTriggerOptionsCountRef.current = currentOptions.length;
|
|
3157
|
+
setIsLoadingOnScroll(true);
|
|
3158
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3159
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3160
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3161
|
+
}
|
|
3162
|
+
hasInteractedRef.current = true;
|
|
3163
|
+
const scrollResult = onPopupScroll();
|
|
3164
|
+
if (scrollResult && typeof scrollResult === 'object' && 'then' in scrollResult) {
|
|
3165
|
+
Promise.resolve(scrollResult).then(() => {
|
|
3166
|
+
setIsLoadingOnScroll(false);
|
|
3167
|
+
isScrollProcessingRef.current = false;
|
|
3168
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3169
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3170
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3171
|
+
}
|
|
3172
|
+
}).catch(() => {
|
|
3173
|
+
setIsLoadingOnScroll(false);
|
|
3174
|
+
isScrollProcessingRef.current = false;
|
|
3175
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3176
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3177
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3178
|
+
}
|
|
3179
|
+
});
|
|
3180
|
+
}
|
|
3181
|
+
scrollLoadingTimeoutRef.current = setTimeout(() => {
|
|
3182
|
+
setIsLoadingOnScroll(prev => {
|
|
3183
|
+
if (prev) {
|
|
3184
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3185
|
+
isScrollProcessingRef.current = false;
|
|
3186
|
+
return false;
|
|
3187
|
+
}
|
|
3188
|
+
return prev;
|
|
3189
|
+
});
|
|
3190
|
+
}, _constants.TIMEOUTS.SCROLL_LOADING_TIMEOUT);
|
|
3191
|
+
}, 150);
|
|
3192
|
+
}, [onPopupScroll, isLoadingOnScroll, hasMore, optionsRef, hasInteractedRef]);
|
|
3193
|
+
(0, _react.useEffect)(() => {
|
|
3194
|
+
if (!onPopupScroll || !dropdownOpen) return;
|
|
3195
|
+
const timeoutId = setTimeout(() => {
|
|
3196
|
+
const scrollContainer = (0, _utils.getScrollContainer)();
|
|
3197
|
+
if (scrollContainer) {
|
|
3198
|
+
scrollContainerRef.current = scrollContainer;
|
|
3199
|
+
scrollContainer.addEventListener('scroll', handleScroll, {
|
|
3200
|
+
passive: true
|
|
3201
|
+
});
|
|
3202
|
+
}
|
|
3203
|
+
}, _constants.TIMEOUTS.SCROLL_CONTAINER_DELAY);
|
|
3204
|
+
return () => {
|
|
3205
|
+
clearTimeout(timeoutId);
|
|
3206
|
+
if (scrollThrottleTimeoutRef.current) {
|
|
3207
|
+
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
3208
|
+
scrollThrottleTimeoutRef.current = null;
|
|
3209
|
+
}
|
|
3210
|
+
if (scrollContainerRef.current) {
|
|
3211
|
+
scrollContainerRef.current.removeEventListener('scroll', handleScroll);
|
|
3212
|
+
scrollContainerRef.current = null;
|
|
3213
|
+
}
|
|
3214
|
+
isScrollProcessingRef.current = false;
|
|
3215
|
+
};
|
|
3216
|
+
}, [onPopupScroll, dropdownOpen, handleScroll]);
|
|
3217
|
+
|
|
3218
|
+
/**
|
|
3219
|
+
* Reset scroll state - used when clearing or closing dropdown
|
|
3220
|
+
*/
|
|
3221
|
+
const resetScrollState = (0, _react.useCallback)(() => {
|
|
3222
|
+
setIsLoadingOnScroll(false);
|
|
3223
|
+
isScrollProcessingRef.current = false;
|
|
3224
|
+
if (scrollLoadingTimeoutRef.current) {
|
|
3225
|
+
clearTimeout(scrollLoadingTimeoutRef.current);
|
|
3226
|
+
scrollLoadingTimeoutRef.current = null;
|
|
3227
|
+
}
|
|
3228
|
+
if (scrollThrottleTimeoutRef.current) {
|
|
3229
|
+
clearTimeout(scrollThrottleTimeoutRef.current);
|
|
3230
|
+
scrollThrottleTimeoutRef.current = null;
|
|
3231
|
+
}
|
|
3232
|
+
if (scrollContainerRef.current) {
|
|
3233
|
+
scrollContainerRef.current.removeEventListener('scroll', handleScroll);
|
|
3234
|
+
scrollContainerRef.current = null;
|
|
3235
|
+
}
|
|
3236
|
+
}, [handleScroll]);
|
|
3237
|
+
return {
|
|
3238
|
+
isLoadingOnScroll,
|
|
3239
|
+
resetScrollState,
|
|
3240
|
+
scrollTriggerOptionsCountRef
|
|
3241
|
+
};
|
|
3242
|
+
};
|
|
3243
|
+
exports.useInfiniteScroll = useInfiniteScroll;
|
|
3244
|
+
|
|
2947
3245
|
/***/ }),
|
|
2948
3246
|
|
|
2949
3247
|
/***/ 9206:
|
|
@@ -2954,6 +3252,56 @@ module.exports = require("react");
|
|
|
2954
3252
|
|
|
2955
3253
|
/***/ }),
|
|
2956
3254
|
|
|
3255
|
+
/***/ 9315:
|
|
3256
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3257
|
+
|
|
3258
|
+
"use strict";
|
|
3259
|
+
|
|
3260
|
+
|
|
3261
|
+
exports.__esModule = true;
|
|
3262
|
+
exports.DropdownHeader = void 0;
|
|
3263
|
+
var _classnames = _interopRequireDefault(__webpack_require__(6942));
|
|
3264
|
+
var _react = _interopRequireDefault(__webpack_require__(9206));
|
|
3265
|
+
var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
|
|
3266
|
+
var _CapTooltipWithInfo = _interopRequireDefault(__webpack_require__(2608));
|
|
3267
|
+
var _styles = _interopRequireDefault(__webpack_require__(8263));
|
|
3268
|
+
var _jsxRuntime = __webpack_require__(4848);
|
|
3269
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
3270
|
+
const DropdownHeader = _ref => {
|
|
3271
|
+
let {
|
|
3272
|
+
headerLabel,
|
|
3273
|
+
tooltip,
|
|
3274
|
+
bylineText,
|
|
3275
|
+
disabled = false
|
|
3276
|
+
} = _ref;
|
|
3277
|
+
if (!headerLabel && !tooltip) return null;
|
|
3278
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
3279
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
3280
|
+
className: (0, _classnames.default)(_styles.default['cap-unified-select-header-wrapper'], disabled && _styles.default.disabled, _styles.default['cap-unified-select-header']),
|
|
3281
|
+
children: [headerLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
3282
|
+
type: "label16",
|
|
3283
|
+
className: (0, _classnames.default)(disabled && _styles.default.disabled, _styles.default['cap-unified-select-header-label']),
|
|
3284
|
+
children: headerLabel
|
|
3285
|
+
}), tooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltipWithInfo.default, {
|
|
3286
|
+
title: tooltip,
|
|
3287
|
+
className: (0, _classnames.default)(disabled && _styles.default.disabled, _styles.default['cap-unified-select-header-tooltip']),
|
|
3288
|
+
iconProps: {
|
|
3289
|
+
disabled
|
|
3290
|
+
}
|
|
3291
|
+
})]
|
|
3292
|
+
}), bylineText && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
3293
|
+
className: _styles.default['cap-unified-select-header-byline-text'],
|
|
3294
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
3295
|
+
className: (0, _classnames.default)(disabled && _styles.default.disabled, _styles.default['cap-unified-select-header-byline-text']),
|
|
3296
|
+
children: bylineText
|
|
3297
|
+
})
|
|
3298
|
+
})]
|
|
3299
|
+
});
|
|
3300
|
+
};
|
|
3301
|
+
exports.DropdownHeader = DropdownHeader;
|
|
3302
|
+
|
|
3303
|
+
/***/ }),
|
|
3304
|
+
|
|
2957
3305
|
/***/ 9604:
|
|
2958
3306
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2959
3307
|
|
|
@@ -2962,7 +3310,7 @@ var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(1601);
|
|
|
2962
3310
|
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
|
|
2963
3311
|
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
|
|
2964
3312
|
// Module
|
|
2965
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-unified-select-header-wrapper{display:flex;align-items:center}.blaze-ui-cap-unified-select-header-wrapper.blaze-ui-disabled{opacity:.5;cursor:not-allowed}.blaze-ui-cap-unified-select-header-wrapper .blaze-ui-cap-unified-select-header-label{font-family:"Roboto",sans-serif;font-weight:500;font-size:1rem;line-height:1.429rem;letter-spacing:0}.blaze-ui-cap-unified-select-header-byline-text{font-family:"Roboto",sans-serif;font-weight:400;font-size:.857rem;letter-spacing:0;color:#97a0af}.blaze-ui-cap-unified-select-container{text-align:justify;min-width:13.786rem}.blaze-ui-cap-unified-select-container.blaze-ui-disabled{cursor:not-allowed}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-more-text{cursor:pointer;color:#091e42;margin-right:.286rem;position:relative}.blaze-ui-cap-unified-select-container.ant-select-disabled .blaze-ui-cap-unified-select-more-text{color:unset !important;cursor:not-allowed}.blaze-ui-cap-unified-select-container.ant-select-focused .ant-select-selector{border:.071rem solid #091e42 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-suffix-icon{color:#7a869a}.blaze-ui-cap-unified-select-container .blaze-ui-cap-tooltip-with-info-icon{margin-top:.143rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly{pointer-events:none}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly .blaze-ui-cap-unified-select-more-text{pointer-events:auto;color:unset !important}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select .ant-select-tree-treenode{padding-left:.286rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-selector{background-color:#fff;border-color:#ebecf0 !important;cursor:default}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-arrow{pointer-events:auto;color:#b3bac5}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:hover .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:active .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:focus .ant-select-selector{border-color:#ebecf0 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-status{color:#ea213a}.blaze-ui-cap-unified-select-container .ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-container .ant-select-selector{background-color:#fff !important;border:.071rem solid #7a869a !important;border-radius:.286rem !important}.blaze-ui-cap-unified-select-container .ant-select-selector .ant-select-selection-placeholder{pointer-events:unset;color:#97a0af;display:flex;align-items:center}.blaze-ui-cap-unified-select-container .ant-select-prefix{font-size:1rem;font-weight:400;color:unset !important;line-height:1.429rem}.blaze-ui-cap-unified-select-container .ant-select-disabled .ant-select-prefix{color:unset !important}.blaze-ui-cap-unified-select-container .ant-input-affix-wrapper .ant-input-prefix{left:.857rem}.blaze-ui-cap-unified-select-container .ant-select-selector{border-color:#7a869a !important;box-shadow:none !important;outline:0}.blaze-ui-cap-unified-select-container .ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{background-color:#47af46}.blaze-ui-cap-unified-select-container .ant-select-dropdown{margin-top:-0.571rem !important;border-radius:.286rem;background-color:#fff;box-shadow:0 .286rem .571rem -0.143rem rgba(9,30,66,.15),0 0 .071rem 0 rgba(9,30,66,.1);max-height:25.714rem;overflow:visible}.blaze-ui-cap-unified-select-container .ant-select-outlined.ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item,.blaze-ui-cap-unified-select-container .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap{align-self:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container{border-bottom:.071rem solid #ebecf0 !important;line-height:2.857rem !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container .blaze-ui-cap-unified-select-search-icon{color:#b3bac5}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container{padding:.643rem 1.071rem;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container .blaze-ui-cap-unified-select-select-all-checkbox{display:contents !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container{cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem;padding-left:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-label{margin-left:.857rem;color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container{display:flex;align-items:center;height:3.429rem;padding:.5rem;border-top:.071rem solid #ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group{display:flex;padding-left:.571rem;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button{background-color:#47af46;height:2.286rem;width:6.714rem;color:#fff}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:hover{background-color:#1f9a1d}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:disabled{background-color:#a1d8a0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-cancel-button{border:rgba(0,0,0,0);box-shadow:none;width:5.714rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-selected-count{display:flex;margin-left:auto;font-size:.857rem;font-weight:400;line-height:1.143rem;color:#5e6c84}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container{display:flex;justify-content:center;align-items:center;height:2.857rem;border-top:.071rem solid #ebecf0;cursor:pointer;color:#091e42}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container:hover{background-color:#ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container .blaze-ui-cap-unified-select-tree-clear-label{font-size:1rem;font-weight:400}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container{cursor:pointer;display:flex;align-items:center;margin-left:auto;padding-right:1.143rem;gap:.857rem;flex-wrap:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container:hover{opacity:.8}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-icon{color:#2466ea;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-label{color:#2466ea;font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:.857rem;line-height:1.143rem;letter-spacing:0;white-space:nowrap;display:inline-flex;align-items:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;color:#97a0af;font-size:1rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result .blaze-ui-cap-unified-select-no-result-text{font-weight:500}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;width:100%;gap:.571rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-more{display:flex;align-items:center;justify-content:center;padding:.857rem;border-top:.071rem solid #ebecf0;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-menu-wrapper{position:relative;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(255,255,255,.8);z-index:10;gap:.571rem;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix{display:flex;justify-content:start;align-items:center;width:100%;height:100%;line-height:1.5;vertical-align:middle;flex:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label{display:flex;align-items:center;flex-shrink:1;min-width:0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-end{display:flex;align-items:center;gap:.571rem;flex-shrink:0;margin-left:auto}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-suffix{display:flex;align-items:center;padding:0 .571rem;max-height:1.429rem;white-space:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon{margin-top:.357rem;color:#42526e}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon .blaze-ui-cap-icon{color:#42526e}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu{margin-top:0 !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu .ant-select-dropdown-menu-item{padding:.571rem 1.714rem !important;height:unset !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu-item-disabled{color:rgba(0,0,0,.25) !important;cursor:not-allowed !important;line-height:1.428rem !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0);height:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0) !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode{height:2.857rem;margin-bottom:0;display:flex;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode:hover{background-color:#fffbe6}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-selected{background-color:#f4f5f7 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled{cursor:not-allowed !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-unified-select-option-label{color:#b3bac5}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-icon{color:#b3bac5 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode.ant-select-tree-treenode-selected{background-color:#f4f5f7}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-leaf .ant-select-tree-switcher-noop{display:none}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox{display:flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox .ant-select-tree-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem;display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:hover{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{border-radius:0;padding-left:.214rem;width:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-title{width:100%;display:flex}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-indent{margin-left:.857rem;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher{display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon{font-size:.857rem;margin-top:1.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-list-holder-inner{width:fit-content !important;min-width:100%}.blaze-ui-cap-unified-select-popup .ant-tree-select:hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-popup .ant-tree-select-focused .ant-select-selector,.blaze-ui-cap-unified-select-popup .ant-tree-select-open .ant-select-selector{border-color:#7a869a;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper{padding-left:.571rem;border:none;box-shadow:none;border-radius:0;border-bottom:.071rem solid rgba(0,0,0,0);transition:border-color .2s ease}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:hover{border-bottom:.071rem solid #7a869a !important;box-shadow:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:focus-within{border-bottom:.071rem solid #091e42 !important;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper .ant-input{border:none !important;box-shadow:none !important}`, ""]);
|
|
3313
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-unified-select-header-wrapper{display:flex;align-items:center}.blaze-ui-cap-unified-select-header-wrapper.blaze-ui-disabled{opacity:.5;cursor:not-allowed}.blaze-ui-cap-unified-select-header-wrapper .blaze-ui-cap-unified-select-header-label{font-family:"Roboto",sans-serif;font-weight:500;font-size:1rem;line-height:1.429rem;letter-spacing:0}.blaze-ui-cap-unified-select-header-byline-text{font-family:"Roboto",sans-serif;font-weight:400;font-size:.857rem;letter-spacing:0;color:#97a0af}.blaze-ui-cap-unified-select-container{text-align:justify;min-width:13.786rem}.blaze-ui-cap-unified-select-container.blaze-ui-disabled{cursor:not-allowed}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-more-text{cursor:pointer;color:#091e42;margin-right:.286rem;position:relative}.blaze-ui-cap-unified-select-container.ant-select-disabled .blaze-ui-cap-unified-select-more-text{color:unset !important;cursor:not-allowed}.blaze-ui-cap-unified-select-container.ant-select-focused .ant-select-selector{border:.071rem solid #091e42 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-suffix-icon{color:#7a869a}.blaze-ui-cap-unified-select-container .blaze-ui-cap-tooltip-with-info-icon{margin-top:.143rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly{pointer-events:none}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly .blaze-ui-cap-unified-select-more-text{pointer-events:auto;color:unset !important}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select .ant-select-tree-treenode{padding-left:.286rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-selector{background-color:#fff;border-color:#ebecf0 !important;cursor:default}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-arrow{pointer-events:auto;color:#b3bac5}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:hover .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:active .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:focus .ant-select-selector{border-color:#ebecf0 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-status{color:#ea213a}.blaze-ui-cap-unified-select-container .ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-container .ant-select-selector{background-color:#fff !important;border:.071rem solid #7a869a !important;border-radius:.286rem !important}.blaze-ui-cap-unified-select-container .ant-select-selector .ant-select-selection-placeholder{pointer-events:unset;color:#97a0af;display:flex;align-items:center}.blaze-ui-cap-unified-select-container .ant-select-prefix{font-size:1rem;font-weight:400;color:unset !important;line-height:1.429rem}.blaze-ui-cap-unified-select-container .ant-select-disabled .ant-select-prefix{color:unset !important}.blaze-ui-cap-unified-select-container .ant-input-affix-wrapper .ant-input-prefix{left:.857rem}.blaze-ui-cap-unified-select-container .ant-select-selector{border-color:#7a869a !important;box-shadow:none !important;outline:0}.blaze-ui-cap-unified-select-container .ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{background-color:#47af46}.blaze-ui-cap-unified-select-container .ant-select-dropdown{margin-top:-0.571rem !important;border-radius:.286rem;background-color:#fff;box-shadow:0 .286rem .571rem -0.143rem rgba(9,30,66,.15),0 0 .071rem 0 rgba(9,30,66,.1);max-height:25.714rem;overflow:visible}.blaze-ui-cap-unified-select-container .ant-select-outlined.ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item,.blaze-ui-cap-unified-select-container .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap{align-self:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container{border-bottom:.071rem solid #ebecf0 !important;line-height:2.857rem !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container .blaze-ui-cap-unified-select-search-icon{color:#b3bac5}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container{padding:.643rem 1.071rem;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container .blaze-ui-cap-unified-select-select-all-checkbox{display:contents !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container{cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem;padding-left:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-label{margin-left:.857rem;color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container{display:flex;align-items:center;height:3.429rem;padding:.5rem;border-top:.071rem solid #ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group{display:flex;padding-left:.571rem;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button{background-color:#47af46;height:2.286rem;width:6.714rem;color:#fff}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:hover{background-color:#1f9a1d}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:disabled{background-color:#a1d8a0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-cancel-button{border:rgba(0,0,0,0);box-shadow:none;width:5.714rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-selected-count{display:flex;margin-left:auto;font-size:.857rem;font-weight:400;line-height:1.143rem;color:#5e6c84}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container{display:flex;justify-content:center;align-items:center;height:2.857rem;border-top:.071rem solid #ebecf0;cursor:pointer;color:#091e42}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container:hover{background-color:#ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container .blaze-ui-cap-unified-select-tree-clear-label{font-size:1rem;font-weight:400}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container{cursor:pointer;display:flex;align-items:center;margin-left:auto;padding-right:1.143rem;gap:.857rem;flex-wrap:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container:hover{opacity:.8}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-icon{color:#2466ea;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-label{color:#2466ea;font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:.857rem;line-height:1.143rem;letter-spacing:0;white-space:nowrap;display:inline-flex;align-items:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;color:#97a0af;font-size:1rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result .blaze-ui-cap-unified-select-no-result-text{font-weight:500}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;width:100%;gap:.571rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-more{display:flex;align-items:center;justify-content:center;padding:.857rem;border-top:.071rem solid #ebecf0;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-menu-wrapper{position:relative;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(255,255,255,.8);z-index:10;gap:.571rem;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix{display:flex;justify-content:start;align-items:center;width:100%;height:100%;line-height:1.5;vertical-align:middle;flex:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label{display:flex;align-items:center;flex-shrink:1;min-width:0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label.blaze-ui-truncate-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label.blaze-ui-truncate-text .cap-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-end{display:flex;align-items:center;gap:.571rem;flex-shrink:0;margin-left:auto}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-suffix{display:flex;align-items:center;padding:0 .571rem;max-height:1.429rem;white-space:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon{margin-top:.357rem;color:#42526e}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon .blaze-ui-cap-icon{color:#42526e}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu{margin-top:0 !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu .ant-select-dropdown-menu-item{padding:.571rem 1.714rem !important;height:unset !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu-item-disabled{color:rgba(0,0,0,.25) !important;cursor:not-allowed !important;line-height:1.428rem !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0);height:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0) !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode{height:2.857rem;margin-bottom:0;display:flex;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode:hover{background-color:#fffbe6}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-selected{background-color:#f4f5f7 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled{cursor:not-allowed !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-unified-select-option-label{color:#b3bac5}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-icon{color:#b3bac5 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode.ant-select-tree-treenode-selected{background-color:#f4f5f7}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-leaf .ant-select-tree-switcher-noop{display:none}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox{display:flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox .ant-select-tree-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem;display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:hover{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{border-radius:0;padding-left:.214rem;width:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-title{width:100%;display:flex}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-indent{margin-left:.857rem;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher{display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon{font-size:.857rem;margin-top:1.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-list-holder-inner{width:fit-content !important;min-width:100%}.blaze-ui-cap-unified-select-popup .ant-tree-select:hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-popup .ant-tree-select-focused .ant-select-selector,.blaze-ui-cap-unified-select-popup .ant-tree-select-open .ant-select-selector{border-color:#7a869a;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper{padding-left:.571rem;border:none;box-shadow:none;border-radius:0;border-bottom:.071rem solid rgba(0,0,0,0);transition:border-color .2s ease}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:hover{border-bottom:.071rem solid #7a869a !important;box-shadow:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:focus-within{border-bottom:.071rem solid #091e42 !important;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper .ant-input{border:none !important;box-shadow:none !important}`, ""]);
|
|
2966
3314
|
// Exports
|
|
2967
3315
|
___CSS_LOADER_EXPORT___.locals = {
|
|
2968
3316
|
"cap-unified-select-header-wrapper": `blaze-ui-cap-unified-select-header-wrapper`,
|
|
@@ -3002,6 +3350,7 @@ ___CSS_LOADER_EXPORT___.locals = {
|
|
|
3002
3350
|
"cap-unified-select-loading-overlay": `blaze-ui-cap-unified-select-loading-overlay`,
|
|
3003
3351
|
"cap-unified-select-option-with-suffix": `blaze-ui-cap-unified-select-option-with-suffix`,
|
|
3004
3352
|
"cap-unified-select-option-label": `blaze-ui-cap-unified-select-option-label`,
|
|
3353
|
+
"truncate-text": `blaze-ui-truncate-text`,
|
|
3005
3354
|
"cap-unified-select-option-end": `blaze-ui-cap-unified-select-option-end`,
|
|
3006
3355
|
"cap-unified-select-option-suffix": `blaze-ui-cap-unified-select-option-suffix`,
|
|
3007
3356
|
"cap-tooltip-with-info": `blaze-ui-cap-tooltip-with-info`,
|
|
@@ -3020,12 +3369,13 @@ module.exports = ___CSS_LOADER_EXPORT___;
|
|
|
3020
3369
|
|
|
3021
3370
|
exports.__esModule = true;
|
|
3022
3371
|
exports.TIMEOUTS = exports.SELECT_TYPES = exports.DEFAULTS = void 0;
|
|
3023
|
-
|
|
3024
|
-
SELECT
|
|
3025
|
-
MULTI_SELECT
|
|
3026
|
-
TREE_SELECT
|
|
3027
|
-
MULTI_TREE_SELECT
|
|
3028
|
-
|
|
3372
|
+
let SELECT_TYPES = exports.SELECT_TYPES = /*#__PURE__*/function (SELECT_TYPES) {
|
|
3373
|
+
SELECT_TYPES["SELECT"] = "select";
|
|
3374
|
+
SELECT_TYPES["MULTI_SELECT"] = "multiSelect";
|
|
3375
|
+
SELECT_TYPES["TREE_SELECT"] = "treeSelect";
|
|
3376
|
+
SELECT_TYPES["MULTI_TREE_SELECT"] = "multiTreeSelect";
|
|
3377
|
+
return SELECT_TYPES;
|
|
3378
|
+
}({});
|
|
3029
3379
|
const TIMEOUTS = exports.TIMEOUTS = {
|
|
3030
3380
|
DEFAULT_SEARCH_DEBOUNCE: 300,
|
|
3031
3381
|
SEARCH_STATE_UPDATE_DELAY: 100,
|