funda-ui 2.0.475 → 2.0.555
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/MultiFuncSelect/index.css +3 -0
- package/MultiFuncSelect/index.d.ts +6 -0
- package/MultiFuncSelect/index.js +36 -4
- package/Tabs/index.js +5 -14
- package/lib/cjs/MultiFuncSelect/index.d.ts +6 -0
- package/lib/cjs/MultiFuncSelect/index.js +36 -4
- package/lib/cjs/Tabs/index.js +5 -14
- package/lib/css/MultiFuncSelect/index.css +3 -0
- package/lib/esm/MultiFuncSelect/index.scss +4 -0
- package/lib/esm/MultiFuncSelect/index.tsx +76 -12
- package/lib/esm/Tabs/TabPanel.tsx +2 -17
- package/package.json +1 -1
|
@@ -143,6 +143,9 @@
|
|
|
143
143
|
text-overflow: ellipsis;
|
|
144
144
|
position: relative;
|
|
145
145
|
}
|
|
146
|
+
.mf-select__wrapper .mf-select-multi__inputplaceholder-wrapper ul.mf-select-multi__list li.mf-select-multi__list-item-statusstring {
|
|
147
|
+
background: transparent;
|
|
148
|
+
}
|
|
146
149
|
.mf-select__wrapper .mf-select-multi__inputplaceholder-wrapper ul.mf-select-multi__list li.mf-select-multi__list-item-placeholder {
|
|
147
150
|
background: transparent;
|
|
148
151
|
color: var(--mf-sel-placeholder-color);
|
|
@@ -23,6 +23,11 @@ interface MultiSelectConfig {
|
|
|
23
23
|
selectAllLabel?: string;
|
|
24
24
|
data: MultiSelectDataConfig | null;
|
|
25
25
|
}
|
|
26
|
+
interface multiSelectSelectedItemOnlyStatusConfig {
|
|
27
|
+
itemsLabel?: string;
|
|
28
|
+
allItemsLabel?: string;
|
|
29
|
+
noneLabel?: string;
|
|
30
|
+
}
|
|
26
31
|
interface CleanTriggerConfig {
|
|
27
32
|
valid: boolean;
|
|
28
33
|
cleanValueLabel?: string;
|
|
@@ -31,6 +36,7 @@ declare type MultiFuncSelectProps = {
|
|
|
31
36
|
wrapperClassName?: string;
|
|
32
37
|
controlClassName?: string;
|
|
33
38
|
multiSelect?: MultiSelectConfig;
|
|
39
|
+
multiSelectSelectedItemOnlyStatus?: multiSelectSelectedItemOnlyStatusConfig;
|
|
34
40
|
cleanTrigger?: CleanTriggerConfig;
|
|
35
41
|
value?: string;
|
|
36
42
|
label?: React.ReactNode | string;
|
package/MultiFuncSelect/index.js
CHANGED
|
@@ -876,7 +876,7 @@ var enableBodyScroll = function enableBodyScroll(targetElement) {
|
|
|
876
876
|
// EXTERNAL MODULE: ./src/utils/tree.js
|
|
877
877
|
var tree = __webpack_require__(602);
|
|
878
878
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
879
|
-
var _excluded = ["wrapperClassName", "controlClassName", "multiSelect", "disabled", "required", "value", "label", "name", "readOnly", "placeholder", "id", "options", "cleanTrigger", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "fetchTrigger", "fetchTriggerForDefaultData", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus"];
|
|
879
|
+
var _excluded = ["wrapperClassName", "controlClassName", "multiSelect", "multiSelectSelectedItemOnlyStatus", "disabled", "required", "value", "label", "name", "readOnly", "placeholder", "id", "options", "cleanTrigger", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "fetchTrigger", "fetchTriggerForDefaultData", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus"];
|
|
880
880
|
function src_toConsumableArray(arr) { return src_arrayWithoutHoles(arr) || src_iterableToArray(arr) || src_unsupportedIterableToArray(arr) || src_nonIterableSpread(); }
|
|
881
881
|
function src_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
882
882
|
function src_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -913,6 +913,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
913
913
|
var wrapperClassName = props.wrapperClassName,
|
|
914
914
|
controlClassName = props.controlClassName,
|
|
915
915
|
multiSelect = props.multiSelect,
|
|
916
|
+
multiSelectSelectedItemOnlyStatus = props.multiSelectSelectedItemOnlyStatus,
|
|
916
917
|
disabled = props.disabled,
|
|
917
918
|
required = props.required,
|
|
918
919
|
value = props.value,
|
|
@@ -1010,6 +1011,11 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
1010
1011
|
var selectedSign = false;
|
|
1011
1012
|
var MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
|
|
1012
1013
|
var MULTI_SEL_LABEL = multiSelect ? multiSelect.selectAllLabel : 'Select all options';
|
|
1014
|
+
var MULTI_SEL_SELECTED_STATUS = {
|
|
1015
|
+
itemsLabel: '{num} Selected',
|
|
1016
|
+
allItemsLabel: 'All Content',
|
|
1017
|
+
noneLabel: 'No items selected'
|
|
1018
|
+
};
|
|
1013
1019
|
var _useState17 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
|
1014
1020
|
labels: [],
|
|
1015
1021
|
values: []
|
|
@@ -2567,7 +2573,9 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2567
2573
|
className: "mf-select-multi__inputplaceholder-inner"
|
|
2568
2574
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
|
|
2569
2575
|
className: "mf-select-multi__list"
|
|
2570
|
-
},
|
|
2576
|
+
}, typeof multiSelectSelectedItemOnlyStatus !== 'undefined' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
2577
|
+
className: "mf-select-multi__list-item-statusstring"
|
|
2578
|
+
}, typeof multiSelectSelectedItemOnlyStatus.itemsLabel === 'string' && controlArr.labels.length > 0 && controlArr.labels.length < optionsData.length ? multiSelectSelectedItemOnlyStatus.itemsLabel.replace('{num}', controlArr.labels.length) : null, typeof multiSelectSelectedItemOnlyStatus.noneLabel === 'string' && controlArr.labels.length === 0 ? multiSelectSelectedItemOnlyStatus.noneLabel : null, typeof multiSelectSelectedItemOnlyStatus.allItemsLabel === 'string' && controlArr.labels.length === optionsData.length ? multiSelectSelectedItemOnlyStatus.allItemsLabel : null, typeof multiSelectSelectedItemOnlyStatus.itemsLabel !== 'string' && controlArr.labels.length > 0 ? MULTI_SEL_SELECTED_STATUS.itemsLabel.replace('{num}', controlArr.labels.length) : null, typeof multiSelectSelectedItemOnlyStatus.noneLabel !== 'string' && controlArr.labels.length === 0 ? MULTI_SEL_SELECTED_STATUS.noneLabel : null, typeof multiSelectSelectedItemOnlyStatus.allItemsLabel !== 'string' && controlArr.labels.length === optionsData.length ? MULTI_SEL_SELECTED_STATUS.allItemsLabel : null)) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, controlArr.labels.map(function (item, index) {
|
|
2571
2579
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
2572
2580
|
key: index
|
|
2573
2581
|
}, stripHTML(item), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
|
|
@@ -2587,7 +2595,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2587
2595
|
className: "mf-select-multi__list-item-placeholder ".concat(typeof placeholder === 'undefined' || placeholder === '' ? 'hide' : '')
|
|
2588
2596
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2589
2597
|
className: "mf-select-multi__control-blinking-cursor ".concat(generateInputFocusStr() === placeholder && placeholder !== '' && typeof placeholder !== 'undefined' ? 'control-placeholder' : '', " ").concat(generateInputFocusStr() === '|' ? 'animated' : '')
|
|
2590
|
-
}, generateInputFocusStr()))))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2598
|
+
}, generateInputFocusStr())))))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2591
2599
|
className: "arrow position-absolute top-0 end-0 me-2 mt-1",
|
|
2592
2600
|
style: {
|
|
2593
2601
|
translate: 'all .2s',
|
|
@@ -2683,6 +2691,30 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2683
2691
|
}, fetchNoneInfo || 'No match yet'), optionsData ? optionsData.map(function (item, index) {
|
|
2684
2692
|
var startItemBorder = index === 0 ? 'border-top-0' : '';
|
|
2685
2693
|
var endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
|
|
2694
|
+
|
|
2695
|
+
// disable selected options (only single selection)
|
|
2696
|
+
var disabledCurrentOption = false;
|
|
2697
|
+
if (typeof value !== 'undefined' && value !== null && value !== '' && typeof item.value !== 'undefined' && item.value !== null && item.value !== '') {
|
|
2698
|
+
if (!MULTI_SEL_VALID) {
|
|
2699
|
+
var _defaultValue = value.toString();
|
|
2700
|
+
var filterRes = [];
|
|
2701
|
+
var filterResQueryValue = optionsData.filter(function (item) {
|
|
2702
|
+
return item.value == _defaultValue;
|
|
2703
|
+
});
|
|
2704
|
+
var filterResQueryLabel = optionsData.filter(function (item) {
|
|
2705
|
+
return item.label == _defaultValue;
|
|
2706
|
+
});
|
|
2707
|
+
if (filterResQueryValue.length === 0 && filterResQueryLabel.length > 0) {
|
|
2708
|
+
filterRes = filterResQueryValue;
|
|
2709
|
+
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
2710
|
+
}
|
|
2711
|
+
var _targetValue = filterRes.length > 0 ? filterRes[0].value : _defaultValue;
|
|
2712
|
+
var _realValue = item.value.toString();
|
|
2713
|
+
if (_realValue === _targetValue && _targetValue !== '') {
|
|
2714
|
+
disabledCurrentOption = true;
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2686
2718
|
if (!MULTI_SEL_VALID) {
|
|
2687
2719
|
// ++++++++++++++++++++
|
|
2688
2720
|
// Single selection
|
|
@@ -2692,7 +2724,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2692
2724
|
type: "button",
|
|
2693
2725
|
"data-index": index,
|
|
2694
2726
|
key: index,
|
|
2695
|
-
className: "list-group-item list-group-item-action border-start-0 border-end-0 mf-select-multi__control-option-item ".concat(startItemBorder, " ").concat(endItemBorder, " border-bottom-0 ").concat(typeof item.disabled === 'undefined' ? '' : item.disabled == true ? 'disabled' : ''),
|
|
2727
|
+
className: "list-group-item list-group-item-action border-start-0 border-end-0 mf-select-multi__control-option-item ".concat(startItemBorder, " ").concat(endItemBorder, " border-bottom-0 ").concat(typeof item.disabled === 'undefined' ? '' : item.disabled == true ? 'disabled' : '', " ").concat(disabledCurrentOption ? 'active disabled' : ''),
|
|
2696
2728
|
"data-value": "".concat(item.value),
|
|
2697
2729
|
"data-label": "".concat(item.label),
|
|
2698
2730
|
"data-querystring": "".concat(typeof item.queryString === 'undefined' ? '' : item.queryString),
|
package/Tabs/index.js
CHANGED
|
@@ -141,26 +141,17 @@ var TabPanel = function TabPanel(props) {
|
|
|
141
141
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
142
142
|
var _expandClassName = typeof expandedActiveClassNameForPanel !== 'undefined' ? expandedActiveClassNameForPanel : '';
|
|
143
143
|
var activedClassName = typeof defaultActive !== 'undefined' && defaultActive !== false ? " active ".concat(_expandClassName) : " ".concat(_expandClassName);
|
|
144
|
+
var activedStyles = typeof defaultActive !== 'undefined' && defaultActive !== false ? {} : {
|
|
145
|
+
height: '0',
|
|
146
|
+
overflow: 'hidden'
|
|
147
|
+
};
|
|
144
148
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", _extends({
|
|
145
149
|
"data-index": index,
|
|
146
150
|
"data-tabpanel-index": index,
|
|
147
151
|
role: "tabpanel",
|
|
148
152
|
id: targetId,
|
|
149
153
|
className: tabpanelClass ? "tab-pane d-block ".concat(tabpanelClass, " ").concat(activedClassName) : "tab-pane d-block ".concat(activedClassName),
|
|
150
|
-
|
|
151
|
-
if (node) {
|
|
152
|
-
// !!!Special note:
|
|
153
|
-
// If you want to hide the tab in advance, please use `{ height: 0; overflow: hidden; }`, do not use `{ display: none }`
|
|
154
|
-
// Otherwise it will cause the scrollHeight of the element inside the child node to be 0
|
|
155
|
-
if (typeof defaultActive !== 'undefined' && defaultActive !== false) {
|
|
156
|
-
node.style.removeProperty('height');
|
|
157
|
-
node.style.removeProperty('overflow');
|
|
158
|
-
} else {
|
|
159
|
-
node.style.setProperty('height', '0', 'important');
|
|
160
|
-
node.style.setProperty('overflow', 'hidden', 'important');
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
154
|
+
style: activedStyles
|
|
164
155
|
}, attributes)));
|
|
165
156
|
};
|
|
166
157
|
/* harmony default export */ const src_TabPanel = (TabPanel);
|
|
@@ -23,6 +23,11 @@ interface MultiSelectConfig {
|
|
|
23
23
|
selectAllLabel?: string;
|
|
24
24
|
data: MultiSelectDataConfig | null;
|
|
25
25
|
}
|
|
26
|
+
interface multiSelectSelectedItemOnlyStatusConfig {
|
|
27
|
+
itemsLabel?: string;
|
|
28
|
+
allItemsLabel?: string;
|
|
29
|
+
noneLabel?: string;
|
|
30
|
+
}
|
|
26
31
|
interface CleanTriggerConfig {
|
|
27
32
|
valid: boolean;
|
|
28
33
|
cleanValueLabel?: string;
|
|
@@ -31,6 +36,7 @@ declare type MultiFuncSelectProps = {
|
|
|
31
36
|
wrapperClassName?: string;
|
|
32
37
|
controlClassName?: string;
|
|
33
38
|
multiSelect?: MultiSelectConfig;
|
|
39
|
+
multiSelectSelectedItemOnlyStatus?: multiSelectSelectedItemOnlyStatusConfig;
|
|
34
40
|
cleanTrigger?: CleanTriggerConfig;
|
|
35
41
|
value?: string;
|
|
36
42
|
label?: React.ReactNode | string;
|
|
@@ -876,7 +876,7 @@ var enableBodyScroll = function enableBodyScroll(targetElement) {
|
|
|
876
876
|
// EXTERNAL MODULE: ./src/utils/tree.js
|
|
877
877
|
var tree = __webpack_require__(602);
|
|
878
878
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
879
|
-
var _excluded = ["wrapperClassName", "controlClassName", "multiSelect", "disabled", "required", "value", "label", "name", "readOnly", "placeholder", "id", "options", "cleanTrigger", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "fetchTrigger", "fetchTriggerForDefaultData", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus"];
|
|
879
|
+
var _excluded = ["wrapperClassName", "controlClassName", "multiSelect", "multiSelectSelectedItemOnlyStatus", "disabled", "required", "value", "label", "name", "readOnly", "placeholder", "id", "options", "cleanTrigger", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "fetchTrigger", "fetchTriggerForDefaultData", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus"];
|
|
880
880
|
function src_toConsumableArray(arr) { return src_arrayWithoutHoles(arr) || src_iterableToArray(arr) || src_unsupportedIterableToArray(arr) || src_nonIterableSpread(); }
|
|
881
881
|
function src_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
882
882
|
function src_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -913,6 +913,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
913
913
|
var wrapperClassName = props.wrapperClassName,
|
|
914
914
|
controlClassName = props.controlClassName,
|
|
915
915
|
multiSelect = props.multiSelect,
|
|
916
|
+
multiSelectSelectedItemOnlyStatus = props.multiSelectSelectedItemOnlyStatus,
|
|
916
917
|
disabled = props.disabled,
|
|
917
918
|
required = props.required,
|
|
918
919
|
value = props.value,
|
|
@@ -1010,6 +1011,11 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
1010
1011
|
var selectedSign = false;
|
|
1011
1012
|
var MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
|
|
1012
1013
|
var MULTI_SEL_LABEL = multiSelect ? multiSelect.selectAllLabel : 'Select all options';
|
|
1014
|
+
var MULTI_SEL_SELECTED_STATUS = {
|
|
1015
|
+
itemsLabel: '{num} Selected',
|
|
1016
|
+
allItemsLabel: 'All Content',
|
|
1017
|
+
noneLabel: 'No items selected'
|
|
1018
|
+
};
|
|
1013
1019
|
var _useState17 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
|
1014
1020
|
labels: [],
|
|
1015
1021
|
values: []
|
|
@@ -2567,7 +2573,9 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2567
2573
|
className: "mf-select-multi__inputplaceholder-inner"
|
|
2568
2574
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
|
|
2569
2575
|
className: "mf-select-multi__list"
|
|
2570
|
-
},
|
|
2576
|
+
}, typeof multiSelectSelectedItemOnlyStatus !== 'undefined' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
2577
|
+
className: "mf-select-multi__list-item-statusstring"
|
|
2578
|
+
}, typeof multiSelectSelectedItemOnlyStatus.itemsLabel === 'string' && controlArr.labels.length > 0 && controlArr.labels.length < optionsData.length ? multiSelectSelectedItemOnlyStatus.itemsLabel.replace('{num}', controlArr.labels.length) : null, typeof multiSelectSelectedItemOnlyStatus.noneLabel === 'string' && controlArr.labels.length === 0 ? multiSelectSelectedItemOnlyStatus.noneLabel : null, typeof multiSelectSelectedItemOnlyStatus.allItemsLabel === 'string' && controlArr.labels.length === optionsData.length ? multiSelectSelectedItemOnlyStatus.allItemsLabel : null, typeof multiSelectSelectedItemOnlyStatus.itemsLabel !== 'string' && controlArr.labels.length > 0 ? MULTI_SEL_SELECTED_STATUS.itemsLabel.replace('{num}', controlArr.labels.length) : null, typeof multiSelectSelectedItemOnlyStatus.noneLabel !== 'string' && controlArr.labels.length === 0 ? MULTI_SEL_SELECTED_STATUS.noneLabel : null, typeof multiSelectSelectedItemOnlyStatus.allItemsLabel !== 'string' && controlArr.labels.length === optionsData.length ? MULTI_SEL_SELECTED_STATUS.allItemsLabel : null)) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, controlArr.labels.map(function (item, index) {
|
|
2571
2579
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
2572
2580
|
key: index
|
|
2573
2581
|
}, stripHTML(item), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
|
|
@@ -2587,7 +2595,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2587
2595
|
className: "mf-select-multi__list-item-placeholder ".concat(typeof placeholder === 'undefined' || placeholder === '' ? 'hide' : '')
|
|
2588
2596
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2589
2597
|
className: "mf-select-multi__control-blinking-cursor ".concat(generateInputFocusStr() === placeholder && placeholder !== '' && typeof placeholder !== 'undefined' ? 'control-placeholder' : '', " ").concat(generateInputFocusStr() === '|' ? 'animated' : '')
|
|
2590
|
-
}, generateInputFocusStr()))))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2598
|
+
}, generateInputFocusStr())))))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
2591
2599
|
className: "arrow position-absolute top-0 end-0 me-2 mt-1",
|
|
2592
2600
|
style: {
|
|
2593
2601
|
translate: 'all .2s',
|
|
@@ -2683,6 +2691,30 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2683
2691
|
}, fetchNoneInfo || 'No match yet'), optionsData ? optionsData.map(function (item, index) {
|
|
2684
2692
|
var startItemBorder = index === 0 ? 'border-top-0' : '';
|
|
2685
2693
|
var endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
|
|
2694
|
+
|
|
2695
|
+
// disable selected options (only single selection)
|
|
2696
|
+
var disabledCurrentOption = false;
|
|
2697
|
+
if (typeof value !== 'undefined' && value !== null && value !== '' && typeof item.value !== 'undefined' && item.value !== null && item.value !== '') {
|
|
2698
|
+
if (!MULTI_SEL_VALID) {
|
|
2699
|
+
var _defaultValue = value.toString();
|
|
2700
|
+
var filterRes = [];
|
|
2701
|
+
var filterResQueryValue = optionsData.filter(function (item) {
|
|
2702
|
+
return item.value == _defaultValue;
|
|
2703
|
+
});
|
|
2704
|
+
var filterResQueryLabel = optionsData.filter(function (item) {
|
|
2705
|
+
return item.label == _defaultValue;
|
|
2706
|
+
});
|
|
2707
|
+
if (filterResQueryValue.length === 0 && filterResQueryLabel.length > 0) {
|
|
2708
|
+
filterRes = filterResQueryValue;
|
|
2709
|
+
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
2710
|
+
}
|
|
2711
|
+
var _targetValue = filterRes.length > 0 ? filterRes[0].value : _defaultValue;
|
|
2712
|
+
var _realValue = item.value.toString();
|
|
2713
|
+
if (_realValue === _targetValue && _targetValue !== '') {
|
|
2714
|
+
disabledCurrentOption = true;
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2686
2718
|
if (!MULTI_SEL_VALID) {
|
|
2687
2719
|
// ++++++++++++++++++++
|
|
2688
2720
|
// Single selection
|
|
@@ -2692,7 +2724,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
|
|
|
2692
2724
|
type: "button",
|
|
2693
2725
|
"data-index": index,
|
|
2694
2726
|
key: index,
|
|
2695
|
-
className: "list-group-item list-group-item-action border-start-0 border-end-0 mf-select-multi__control-option-item ".concat(startItemBorder, " ").concat(endItemBorder, " border-bottom-0 ").concat(typeof item.disabled === 'undefined' ? '' : item.disabled == true ? 'disabled' : ''),
|
|
2727
|
+
className: "list-group-item list-group-item-action border-start-0 border-end-0 mf-select-multi__control-option-item ".concat(startItemBorder, " ").concat(endItemBorder, " border-bottom-0 ").concat(typeof item.disabled === 'undefined' ? '' : item.disabled == true ? 'disabled' : '', " ").concat(disabledCurrentOption ? 'active disabled' : ''),
|
|
2696
2728
|
"data-value": "".concat(item.value),
|
|
2697
2729
|
"data-label": "".concat(item.label),
|
|
2698
2730
|
"data-querystring": "".concat(typeof item.queryString === 'undefined' ? '' : item.queryString),
|
package/lib/cjs/Tabs/index.js
CHANGED
|
@@ -141,26 +141,17 @@ var TabPanel = function TabPanel(props) {
|
|
|
141
141
|
attributes = _objectWithoutProperties(props, _excluded);
|
|
142
142
|
var _expandClassName = typeof expandedActiveClassNameForPanel !== 'undefined' ? expandedActiveClassNameForPanel : '';
|
|
143
143
|
var activedClassName = typeof defaultActive !== 'undefined' && defaultActive !== false ? " active ".concat(_expandClassName) : " ".concat(_expandClassName);
|
|
144
|
+
var activedStyles = typeof defaultActive !== 'undefined' && defaultActive !== false ? {} : {
|
|
145
|
+
height: '0',
|
|
146
|
+
overflow: 'hidden'
|
|
147
|
+
};
|
|
144
148
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", _extends({
|
|
145
149
|
"data-index": index,
|
|
146
150
|
"data-tabpanel-index": index,
|
|
147
151
|
role: "tabpanel",
|
|
148
152
|
id: targetId,
|
|
149
153
|
className: tabpanelClass ? "tab-pane d-block ".concat(tabpanelClass, " ").concat(activedClassName) : "tab-pane d-block ".concat(activedClassName),
|
|
150
|
-
|
|
151
|
-
if (node) {
|
|
152
|
-
// !!!Special note:
|
|
153
|
-
// If you want to hide the tab in advance, please use `{ height: 0; overflow: hidden; }`, do not use `{ display: none }`
|
|
154
|
-
// Otherwise it will cause the scrollHeight of the element inside the child node to be 0
|
|
155
|
-
if (typeof defaultActive !== 'undefined' && defaultActive !== false) {
|
|
156
|
-
node.style.removeProperty('height');
|
|
157
|
-
node.style.removeProperty('overflow');
|
|
158
|
-
} else {
|
|
159
|
-
node.style.setProperty('height', '0', 'important');
|
|
160
|
-
node.style.setProperty('overflow', 'hidden', 'important');
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
154
|
+
style: activedStyles
|
|
164
155
|
}, attributes)));
|
|
165
156
|
};
|
|
166
157
|
/* harmony default export */ const src_TabPanel = (TabPanel);
|
|
@@ -143,6 +143,9 @@
|
|
|
143
143
|
text-overflow: ellipsis;
|
|
144
144
|
position: relative;
|
|
145
145
|
}
|
|
146
|
+
.mf-select__wrapper .mf-select-multi__inputplaceholder-wrapper ul.mf-select-multi__list li.mf-select-multi__list-item-statusstring {
|
|
147
|
+
background: transparent;
|
|
148
|
+
}
|
|
146
149
|
.mf-select__wrapper .mf-select-multi__inputplaceholder-wrapper ul.mf-select-multi__list li.mf-select-multi__list-item-placeholder {
|
|
147
150
|
background: transparent;
|
|
148
151
|
color: var(--mf-sel-placeholder-color);
|
|
@@ -200,6 +200,10 @@
|
|
|
200
200
|
text-overflow: ellipsis;
|
|
201
201
|
position: relative;
|
|
202
202
|
|
|
203
|
+
&.mf-select-multi__list-item-statusstring {
|
|
204
|
+
background: transparent;
|
|
205
|
+
}
|
|
206
|
+
|
|
203
207
|
&.mf-select-multi__list-item-placeholder {
|
|
204
208
|
background: transparent;
|
|
205
209
|
color: var(--mf-sel-placeholder-color);
|
|
@@ -50,6 +50,15 @@ interface MultiSelectConfig {
|
|
|
50
50
|
data: MultiSelectDataConfig | null;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
interface multiSelectSelectedItemOnlyStatusConfig {
|
|
54
|
+
itemsLabel?: string;
|
|
55
|
+
allItemsLabel?: string;
|
|
56
|
+
noneLabel?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
53
62
|
interface CleanTriggerConfig {
|
|
54
63
|
valid: boolean;
|
|
55
64
|
cleanValueLabel?: string;
|
|
@@ -60,6 +69,7 @@ type MultiFuncSelectProps = {
|
|
|
60
69
|
wrapperClassName?: string;
|
|
61
70
|
controlClassName?: string;
|
|
62
71
|
multiSelect?: MultiSelectConfig;
|
|
72
|
+
multiSelectSelectedItemOnlyStatus?: multiSelectSelectedItemOnlyStatusConfig;
|
|
63
73
|
cleanTrigger?: CleanTriggerConfig;
|
|
64
74
|
value?: string;
|
|
65
75
|
label?: React.ReactNode | string;
|
|
@@ -109,6 +119,7 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
109
119
|
wrapperClassName,
|
|
110
120
|
controlClassName,
|
|
111
121
|
multiSelect,
|
|
122
|
+
multiSelectSelectedItemOnlyStatus,
|
|
112
123
|
disabled,
|
|
113
124
|
required,
|
|
114
125
|
value,
|
|
@@ -190,10 +201,18 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
190
201
|
let selectedSign: boolean = false;
|
|
191
202
|
const MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
|
|
192
203
|
const MULTI_SEL_LABEL = multiSelect ? multiSelect.selectAllLabel : 'Select all options';
|
|
204
|
+
const MULTI_SEL_SELECTED_STATUS = {
|
|
205
|
+
itemsLabel: '{num} Selected',
|
|
206
|
+
allItemsLabel: 'All Content',
|
|
207
|
+
noneLabel: 'No items selected',
|
|
208
|
+
};
|
|
209
|
+
|
|
193
210
|
const [controlArr, setControlArr] = useState<any>({
|
|
194
211
|
labels: [],
|
|
195
212
|
values: []
|
|
196
213
|
});
|
|
214
|
+
|
|
215
|
+
|
|
197
216
|
const multiSelControlOptionExist = (arr: any[], val: any) => {
|
|
198
217
|
const _data = arr.filter(Boolean);
|
|
199
218
|
return _data.map((v: any) => v.toString()).includes(val.toString());
|
|
@@ -1996,19 +2015,35 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
1996
2015
|
<div>
|
|
1997
2016
|
<ul className="mf-select-multi__list">
|
|
1998
2017
|
|
|
1999
|
-
{
|
|
2000
|
-
|
|
2001
|
-
|
|
2018
|
+
{typeof multiSelectSelectedItemOnlyStatus !== 'undefined' ? <>
|
|
2019
|
+
|
|
2020
|
+
<li className="mf-select-multi__list-item-statusstring">
|
|
2021
|
+
{typeof multiSelectSelectedItemOnlyStatus.itemsLabel === 'string' && controlArr.labels.length > 0 && controlArr.labels.length < optionsData.length ? multiSelectSelectedItemOnlyStatus.itemsLabel.replace('{num}', controlArr.labels.length) : null }
|
|
2022
|
+
{typeof multiSelectSelectedItemOnlyStatus.noneLabel === 'string' && controlArr.labels.length === 0 ? multiSelectSelectedItemOnlyStatus.noneLabel : null }
|
|
2023
|
+
{typeof multiSelectSelectedItemOnlyStatus.allItemsLabel === 'string' && controlArr.labels.length === optionsData.length ? multiSelectSelectedItemOnlyStatus.allItemsLabel : null }
|
|
2002
2024
|
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2025
|
+
{/*-----*/}
|
|
2026
|
+
{typeof multiSelectSelectedItemOnlyStatus.itemsLabel !== 'string' && controlArr.labels.length > 0 ? MULTI_SEL_SELECTED_STATUS.itemsLabel.replace('{num}', controlArr.labels.length) : null }
|
|
2027
|
+
{typeof multiSelectSelectedItemOnlyStatus.noneLabel !== 'string' && controlArr.labels.length === 0 ? MULTI_SEL_SELECTED_STATUS.noneLabel : null }
|
|
2028
|
+
{typeof multiSelectSelectedItemOnlyStatus.allItemsLabel !== 'string' && controlArr.labels.length === optionsData.length ? MULTI_SEL_SELECTED_STATUS.allItemsLabel : null }
|
|
2006
2029
|
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2030
|
+
</li>
|
|
2031
|
+
</> : <>
|
|
2032
|
+
{controlArr.labels.map((item: any, index: number) => (
|
|
2033
|
+
<li key={index}>
|
|
2034
|
+
{stripHTML(item)}
|
|
2035
|
+
|
|
2036
|
+
<a href="#" tabIndex={-1} onClick={handleMultiControlItemRemove} data-item={controlArr.values[index]}><svg width="10px" height="10px" viewBox="0 0 1024 1024"><path fill="#000" d="M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z" /></svg></a>
|
|
2037
|
+
</li>
|
|
2038
|
+
))}
|
|
2039
|
+
|
|
2040
|
+
<li className={`mf-select-multi__list-item-placeholder ${typeof placeholder === 'undefined' || placeholder === '' ? 'hide' : ''}`}>
|
|
2041
|
+
<span className={`mf-select-multi__control-blinking-cursor ${generateInputFocusStr() === placeholder && placeholder !== '' && typeof placeholder !== 'undefined' ? 'control-placeholder' : ''} ${generateInputFocusStr() === '|' ? 'animated' : ''}`}>
|
|
2042
|
+
{generateInputFocusStr()}
|
|
2043
|
+
</span>
|
|
2044
|
+
</li>
|
|
2045
|
+
</>}
|
|
2046
|
+
|
|
2012
2047
|
</ul>
|
|
2013
2048
|
|
|
2014
2049
|
</div>
|
|
@@ -2113,6 +2148,35 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
2113
2148
|
const endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
|
|
2114
2149
|
|
|
2115
2150
|
|
|
2151
|
+
// disable selected options (only single selection)
|
|
2152
|
+
let disabledCurrentOption: boolean = false;
|
|
2153
|
+
if (
|
|
2154
|
+
(typeof value !== 'undefined' && value !== null && value !== '') &&
|
|
2155
|
+
(typeof item.value !== 'undefined' && item.value !== null && item.value !== '')
|
|
2156
|
+
) {
|
|
2157
|
+
|
|
2158
|
+
if (!MULTI_SEL_VALID) {
|
|
2159
|
+
const _defaultValue = value.toString();
|
|
2160
|
+
let filterRes: any = [];
|
|
2161
|
+
const filterResQueryValue = optionsData.filter((item: any) => item.value == _defaultValue);
|
|
2162
|
+
const filterResQueryLabel = optionsData.filter((item: any) => item.label == _defaultValue);
|
|
2163
|
+
|
|
2164
|
+
if (filterResQueryValue.length === 0 && filterResQueryLabel.length > 0) {
|
|
2165
|
+
filterRes = filterResQueryValue;
|
|
2166
|
+
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
const _targetValue = filterRes.length > 0 ? filterRes[0].value : _defaultValue;
|
|
2170
|
+
const _realValue = item.value.toString();
|
|
2171
|
+
|
|
2172
|
+
if (_realValue === _targetValue && _targetValue !== '') {
|
|
2173
|
+
disabledCurrentOption = true;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
|
|
2116
2180
|
|
|
2117
2181
|
if (!MULTI_SEL_VALID) {
|
|
2118
2182
|
|
|
@@ -2124,7 +2188,7 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
2124
2188
|
type="button"
|
|
2125
2189
|
data-index={index}
|
|
2126
2190
|
key={index}
|
|
2127
|
-
className={`list-group-item list-group-item-action border-start-0 border-end-0 mf-select-multi__control-option-item ${startItemBorder} ${endItemBorder} border-bottom-0 ${typeof item.disabled === 'undefined' ? '' : (item.disabled == true ? 'disabled' : '')}`}
|
|
2191
|
+
className={`list-group-item list-group-item-action border-start-0 border-end-0 mf-select-multi__control-option-item ${startItemBorder} ${endItemBorder} border-bottom-0 ${typeof item.disabled === 'undefined' ? '' : (item.disabled == true ? 'disabled' : '')} ${disabledCurrentOption ? 'active disabled' : ''}`}
|
|
2128
2192
|
data-value={`${item.value}`}
|
|
2129
2193
|
data-label={`${item.label}`}
|
|
2130
2194
|
data-querystring={`${typeof item.queryString === 'undefined' ? '' : item.queryString}`}
|
|
@@ -23,8 +23,8 @@ const TabPanel = (props: TabPanelProps) => {
|
|
|
23
23
|
|
|
24
24
|
const _expandClassName = typeof(expandedActiveClassNameForPanel) !== 'undefined' ? expandedActiveClassNameForPanel : '';
|
|
25
25
|
const activedClassName = typeof(defaultActive) !== 'undefined' && defaultActive !== false ? ` active ${_expandClassName}` : ` ${_expandClassName}`;
|
|
26
|
+
const activedStyles = typeof(defaultActive) !== 'undefined' && defaultActive !== false ? {} : {height: '0', overflow: 'hidden'};
|
|
26
27
|
|
|
27
|
-
|
|
28
28
|
return (
|
|
29
29
|
<>
|
|
30
30
|
|
|
@@ -33,22 +33,7 @@ const TabPanel = (props: TabPanelProps) => {
|
|
|
33
33
|
data-tabpanel-index={index}
|
|
34
34
|
role="tabpanel" id={targetId}
|
|
35
35
|
className={ tabpanelClass ? `tab-pane d-block ${tabpanelClass} ${activedClassName}` : `tab-pane d-block ${activedClassName}`}
|
|
36
|
-
|
|
37
|
-
if (node) {
|
|
38
|
-
|
|
39
|
-
// !!!Special note:
|
|
40
|
-
// If you want to hide the tab in advance, please use `{ height: 0; overflow: hidden; }`, do not use `{ display: none }`
|
|
41
|
-
// Otherwise it will cause the scrollHeight of the element inside the child node to be 0
|
|
42
|
-
if (typeof(defaultActive) !== 'undefined' && defaultActive !== false) {
|
|
43
|
-
node.style.removeProperty('height');
|
|
44
|
-
node.style.removeProperty('overflow');
|
|
45
|
-
} else {
|
|
46
|
-
node.style.setProperty('height', '0', 'important');
|
|
47
|
-
node.style.setProperty('overflow', 'hidden', 'important');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}}
|
|
36
|
+
style={activedStyles}
|
|
52
37
|
{...attributes}
|
|
53
38
|
></div>
|
|
54
39
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "UIUX Lab",
|
|
3
3
|
"email": "uiuxlab@gmail.com",
|
|
4
4
|
"name": "funda-ui",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.555",
|
|
6
6
|
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|