arengibook 2.4.587 → 2.4.589
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/index.js +270 -182
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -94,20 +94,20 @@ function classNames() {
|
|
|
94
94
|
return undefined;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function _arrayWithoutHoles$
|
|
97
|
+
function _arrayWithoutHoles$a(r) {
|
|
98
98
|
if (Array.isArray(r)) return _arrayLikeToArray$2$1(r);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
function _iterableToArray$
|
|
101
|
+
function _iterableToArray$a(r) {
|
|
102
102
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
function _nonIterableSpread$
|
|
105
|
+
function _nonIterableSpread$a() {
|
|
106
106
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
function _toConsumableArray$
|
|
110
|
-
return _arrayWithoutHoles$
|
|
109
|
+
function _toConsumableArray$a(r) {
|
|
110
|
+
return _arrayWithoutHoles$a(r) || _iterableToArray$a(r) || _unsupportedIterableToArray$2$1(r) || _nonIterableSpread$a();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function _classCallCheck$3(a, n) {
|
|
@@ -428,7 +428,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
428
428
|
} else if (key === 'p-bind') {
|
|
429
429
|
_this.setAttributes(element, value);
|
|
430
430
|
} else {
|
|
431
|
-
value = key === 'class' ? _toConsumableArray$
|
|
431
|
+
value = key === 'class' ? _toConsumableArray$a(new Set(_computedStyles('class', value))).join(' ').trim() : key === 'style' ? _computedStyles('style', value).join(';').trim() : value;
|
|
432
432
|
(element.$attrs = element.$attrs || {}) && (element.$attrs[key] = value);
|
|
433
433
|
element.setAttribute(key, value);
|
|
434
434
|
}
|
|
@@ -1874,7 +1874,7 @@ var ObjectUtils = /*#__PURE__*/function () {
|
|
|
1874
1874
|
try {
|
|
1875
1875
|
item = arr.findLast(callback);
|
|
1876
1876
|
} catch (_unused2) {
|
|
1877
|
-
item = _toConsumableArray$
|
|
1877
|
+
item = _toConsumableArray$a(arr).reverse().find(callback);
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
1880
|
return item;
|
|
@@ -1892,7 +1892,7 @@ var ObjectUtils = /*#__PURE__*/function () {
|
|
|
1892
1892
|
try {
|
|
1893
1893
|
index = arr.findLastIndex(callback);
|
|
1894
1894
|
} catch (_unused3) {
|
|
1895
|
-
index = arr.lastIndexOf(_toConsumableArray$
|
|
1895
|
+
index = arr.lastIndexOf(_toConsumableArray$a(arr).reverse().find(callback));
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
return index;
|
|
@@ -2703,7 +2703,7 @@ function handler() {
|
|
|
2703
2703
|
};
|
|
2704
2704
|
var getLastZIndex = function getLastZIndex(key, autoZIndex) {
|
|
2705
2705
|
var baseZIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2706
|
-
return _toConsumableArray$
|
|
2706
|
+
return _toConsumableArray$a(zIndexes).reverse().find(function (obj) {
|
|
2707
2707
|
return autoZIndex ? true : obj.key === key;
|
|
2708
2708
|
}) || {
|
|
2709
2709
|
key: key,
|
|
@@ -3495,20 +3495,20 @@ var useDisplayOrder = function useDisplayOrder(group) {
|
|
|
3495
3495
|
return displayOrder;
|
|
3496
3496
|
};
|
|
3497
3497
|
|
|
3498
|
-
function _arrayWithoutHoles$
|
|
3498
|
+
function _arrayWithoutHoles$9(r) {
|
|
3499
3499
|
if (Array.isArray(r)) return _arrayLikeToArray$f(r);
|
|
3500
3500
|
}
|
|
3501
3501
|
|
|
3502
|
-
function _iterableToArray$
|
|
3502
|
+
function _iterableToArray$9(r) {
|
|
3503
3503
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
3504
3504
|
}
|
|
3505
3505
|
|
|
3506
|
-
function _nonIterableSpread$
|
|
3506
|
+
function _nonIterableSpread$9() {
|
|
3507
3507
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3508
3508
|
}
|
|
3509
3509
|
|
|
3510
|
-
function _toConsumableArray$
|
|
3511
|
-
return _arrayWithoutHoles$
|
|
3510
|
+
function _toConsumableArray$9(r) {
|
|
3511
|
+
return _arrayWithoutHoles$9(r) || _iterableToArray$9(r) || _unsupportedIterableToArray$f(r) || _nonIterableSpread$9();
|
|
3512
3512
|
}
|
|
3513
3513
|
|
|
3514
3514
|
/**
|
|
@@ -3548,9 +3548,9 @@ var globalEscKeyHandlingLogic = {
|
|
|
3548
3548
|
return;
|
|
3549
3549
|
}
|
|
3550
3550
|
var escKeyListeners = globalEscKeyHandlingLogic.escKeyListeners;
|
|
3551
|
-
var maxPrimaryPriority = Math.max.apply(Math, _toConsumableArray$
|
|
3551
|
+
var maxPrimaryPriority = Math.max.apply(Math, _toConsumableArray$9(escKeyListeners.keys()));
|
|
3552
3552
|
var theMostImportantEscHandlersSet = escKeyListeners.get(maxPrimaryPriority);
|
|
3553
|
-
var maxSecondaryPriority = Math.max.apply(Math, _toConsumableArray$
|
|
3553
|
+
var maxSecondaryPriority = Math.max.apply(Math, _toConsumableArray$9(theMostImportantEscHandlersSet.keys()));
|
|
3554
3554
|
var theMostImportantEscHandler = theMostImportantEscHandlersSet.get(maxSecondaryPriority);
|
|
3555
3555
|
theMostImportantEscHandler(event);
|
|
3556
3556
|
},
|
|
@@ -3938,11 +3938,11 @@ function _arrayLikeToArray$e(r, a) {
|
|
|
3938
3938
|
return n;
|
|
3939
3939
|
}
|
|
3940
3940
|
|
|
3941
|
-
function _arrayWithoutHoles$
|
|
3941
|
+
function _arrayWithoutHoles$8(r) {
|
|
3942
3942
|
if (Array.isArray(r)) return _arrayLikeToArray$e(r);
|
|
3943
3943
|
}
|
|
3944
3944
|
|
|
3945
|
-
function _iterableToArray$
|
|
3945
|
+
function _iterableToArray$8(r) {
|
|
3946
3946
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
3947
3947
|
}
|
|
3948
3948
|
|
|
@@ -3954,12 +3954,12 @@ function _unsupportedIterableToArray$e(r, a) {
|
|
|
3954
3954
|
}
|
|
3955
3955
|
}
|
|
3956
3956
|
|
|
3957
|
-
function _nonIterableSpread$
|
|
3957
|
+
function _nonIterableSpread$8() {
|
|
3958
3958
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3959
3959
|
}
|
|
3960
3960
|
|
|
3961
|
-
function _toConsumableArray$
|
|
3962
|
-
return _arrayWithoutHoles$
|
|
3961
|
+
function _toConsumableArray$8(r) {
|
|
3962
|
+
return _arrayWithoutHoles$8(r) || _iterableToArray$8(r) || _unsupportedIterableToArray$e(r) || _nonIterableSpread$8();
|
|
3963
3963
|
}
|
|
3964
3964
|
|
|
3965
3965
|
function _typeof$d(o) {
|
|
@@ -4066,7 +4066,7 @@ var ComponentBase = {
|
|
|
4066
4066
|
var value = _getOptionValue.apply(void 0, arguments);
|
|
4067
4067
|
if (Array.isArray(value)) {
|
|
4068
4068
|
return {
|
|
4069
|
-
className: classNames.apply(void 0, _toConsumableArray$
|
|
4069
|
+
className: classNames.apply(void 0, _toConsumableArray$8(value))
|
|
4070
4070
|
};
|
|
4071
4071
|
}
|
|
4072
4072
|
if (ObjectUtils.isString(value)) {
|
|
@@ -4076,7 +4076,7 @@ var ComponentBase = {
|
|
|
4076
4076
|
}
|
|
4077
4077
|
if (value !== null && value !== void 0 && value.hasOwnProperty('className') && Array.isArray(value.className)) {
|
|
4078
4078
|
return {
|
|
4079
|
-
className: classNames.apply(void 0, _toConsumableArray$
|
|
4079
|
+
className: classNames.apply(void 0, _toConsumableArray$8(value.className))
|
|
4080
4080
|
};
|
|
4081
4081
|
}
|
|
4082
4082
|
return value;
|
|
@@ -4721,11 +4721,11 @@ function _arrayLikeToArray$b(r, a) {
|
|
|
4721
4721
|
return n;
|
|
4722
4722
|
}
|
|
4723
4723
|
|
|
4724
|
-
function _arrayWithoutHoles$
|
|
4724
|
+
function _arrayWithoutHoles$7(r) {
|
|
4725
4725
|
if (Array.isArray(r)) return _arrayLikeToArray$b(r);
|
|
4726
4726
|
}
|
|
4727
4727
|
|
|
4728
|
-
function _iterableToArray$
|
|
4728
|
+
function _iterableToArray$7(r) {
|
|
4729
4729
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
4730
4730
|
}
|
|
4731
4731
|
|
|
@@ -4737,12 +4737,12 @@ function _unsupportedIterableToArray$b(r, a) {
|
|
|
4737
4737
|
}
|
|
4738
4738
|
}
|
|
4739
4739
|
|
|
4740
|
-
function _nonIterableSpread$
|
|
4740
|
+
function _nonIterableSpread$7() {
|
|
4741
4741
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4742
4742
|
}
|
|
4743
4743
|
|
|
4744
|
-
function _toConsumableArray$
|
|
4745
|
-
return _arrayWithoutHoles$
|
|
4744
|
+
function _toConsumableArray$7(r) {
|
|
4745
|
+
return _arrayWithoutHoles$7(r) || _iterableToArray$7(r) || _unsupportedIterableToArray$b(r) || _nonIterableSpread$7();
|
|
4746
4746
|
}
|
|
4747
4747
|
|
|
4748
4748
|
function _arrayWithHoles$9(r) {
|
|
@@ -5229,7 +5229,7 @@ var Tooltip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (in
|
|
|
5229
5229
|
return target.parentElement;
|
|
5230
5230
|
} else if (target.hasWrapper) {
|
|
5231
5231
|
var _target$parentElement;
|
|
5232
|
-
(_target$parentElement = target.parentElement).replaceWith.apply(_target$parentElement, _toConsumableArray$
|
|
5232
|
+
(_target$parentElement = target.parentElement).replaceWith.apply(_target$parentElement, _toConsumableArray$7(target.parentElement.childNodes));
|
|
5233
5233
|
delete target.hasWrapper;
|
|
5234
5234
|
}
|
|
5235
5235
|
return target;
|
|
@@ -5745,6 +5745,9 @@ function _arrayLikeToArray$a(r, a) {
|
|
|
5745
5745
|
function _arrayWithHoles$8(r) {
|
|
5746
5746
|
if (Array.isArray(r)) return r;
|
|
5747
5747
|
}
|
|
5748
|
+
function _arrayWithoutHoles$6(r) {
|
|
5749
|
+
if (Array.isArray(r)) return _arrayLikeToArray$a(r);
|
|
5750
|
+
}
|
|
5748
5751
|
function _defineProperty$a(e, r, t) {
|
|
5749
5752
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5750
5753
|
value: t,
|
|
@@ -5762,6 +5765,9 @@ function _extends$A() {
|
|
|
5762
5765
|
return n;
|
|
5763
5766
|
}, _extends$A.apply(null, arguments);
|
|
5764
5767
|
}
|
|
5768
|
+
function _iterableToArray$6(r) {
|
|
5769
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
5770
|
+
}
|
|
5765
5771
|
function _iterableToArrayLimit$8(r, l) {
|
|
5766
5772
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
5767
5773
|
if (null != t) {
|
|
@@ -5789,6 +5795,9 @@ function _iterableToArrayLimit$8(r, l) {
|
|
|
5789
5795
|
function _nonIterableRest$8() {
|
|
5790
5796
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
5791
5797
|
}
|
|
5798
|
+
function _nonIterableSpread$6() {
|
|
5799
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
5800
|
+
}
|
|
5792
5801
|
function ownKeys$p(e, r) {
|
|
5793
5802
|
var t = Object.keys(e);
|
|
5794
5803
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -5833,6 +5842,9 @@ function _objectWithoutPropertiesLoose$2(r, e) {
|
|
|
5833
5842
|
function _slicedToArray$8(r, e) {
|
|
5834
5843
|
return _arrayWithHoles$8(r) || _iterableToArrayLimit$8(r, e) || _unsupportedIterableToArray$a(r, e) || _nonIterableRest$8();
|
|
5835
5844
|
}
|
|
5845
|
+
function _toConsumableArray$6(r) {
|
|
5846
|
+
return _arrayWithoutHoles$6(r) || _iterableToArray$6(r) || _unsupportedIterableToArray$a(r) || _nonIterableSpread$6();
|
|
5847
|
+
}
|
|
5836
5848
|
function _toPrimitive(t, r) {
|
|
5837
5849
|
if ("object" != typeof t || !t) return t;
|
|
5838
5850
|
var e = t[Symbol.toPrimitive];
|
|
@@ -35801,46 +35813,106 @@ var PopupPresets = {
|
|
|
35801
35813
|
var Dropdown = function Dropdown(_ref) {
|
|
35802
35814
|
var _ref$options = _ref.options,
|
|
35803
35815
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
35816
|
+
_ref$isGroupedOption = _ref.isGroupedOption,
|
|
35817
|
+
isGroupedOption = _ref$isGroupedOption === void 0 ? false : _ref$isGroupedOption,
|
|
35804
35818
|
value = _ref.value,
|
|
35805
35819
|
_ref$placeholder = _ref.placeholder,
|
|
35806
35820
|
placeholder = _ref$placeholder === void 0 ? 'Sélectionnez une option' : _ref$placeholder,
|
|
35807
|
-
_ref$
|
|
35808
|
-
|
|
35809
|
-
_ref$
|
|
35810
|
-
|
|
35821
|
+
_ref$disabled = _ref.disabled,
|
|
35822
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
35823
|
+
_ref$filter = _ref.filter,
|
|
35824
|
+
filter = _ref$filter === void 0 ? false : _ref$filter,
|
|
35825
|
+
_ref$optionLabel = _ref.optionLabel,
|
|
35826
|
+
optionLabel = _ref$optionLabel === void 0 ? 'label' : _ref$optionLabel,
|
|
35827
|
+
_ref$optionValue = _ref.optionValue,
|
|
35828
|
+
optionValue = _ref$optionValue === void 0 ? 'value' : _ref$optionValue,
|
|
35829
|
+
_ref$invalid = _ref.invalid,
|
|
35830
|
+
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
35831
|
+
_ref$errorMessage = _ref.errorMessage,
|
|
35832
|
+
errorMessage = _ref$errorMessage === void 0 ? '' : _ref$errorMessage,
|
|
35833
|
+
_ref$valueStyle = _ref.valueStyle,
|
|
35834
|
+
valueStyle = _ref$valueStyle === void 0 ? {
|
|
35835
|
+
paddingTop: '1rem',
|
|
35836
|
+
paddingBottom: '1rem'
|
|
35837
|
+
} : _ref$valueStyle,
|
|
35838
|
+
onChange = _ref.onChange,
|
|
35839
|
+
_ref$optionStyle = _ref.optionStyle,
|
|
35840
|
+
optionStyle = _ref$optionStyle === void 0 ? {} : _ref$optionStyle,
|
|
35811
35841
|
name = _ref.name,
|
|
35812
|
-
|
|
35813
|
-
|
|
35814
|
-
|
|
35842
|
+
_ref$showClear = _ref.showClear,
|
|
35843
|
+
showClear = _ref$showClear === void 0 ? false : _ref$showClear,
|
|
35844
|
+
_ref$groupedItemTempl = _ref.groupedItemTemplateConfig,
|
|
35845
|
+
groupedItemTemplateConfig = _ref$groupedItemTempl === void 0 ? {
|
|
35846
|
+
showIcon: false,
|
|
35847
|
+
iconKey: 'icon',
|
|
35848
|
+
showImage: false,
|
|
35849
|
+
imageKey: 'image',
|
|
35850
|
+
imageStyle: null,
|
|
35851
|
+
labelStyle: null,
|
|
35852
|
+
generalIcon: null,
|
|
35853
|
+
generalImage: null
|
|
35854
|
+
} : _ref$groupedItemTempl,
|
|
35815
35855
|
_ref$isSelectMeta = _ref.isSelectMeta,
|
|
35816
35856
|
isSelectMeta = _ref$isSelectMeta === void 0 ? false : _ref$isSelectMeta,
|
|
35817
35857
|
_ref$selectMetaConfig = _ref.selectMetaConfig,
|
|
35818
35858
|
selectMetaConfig = _ref$selectMetaConfig === void 0 ? {
|
|
35859
|
+
labelStyle: null,
|
|
35819
35860
|
generalIcon: null
|
|
35820
|
-
} : _ref$selectMetaConfig
|
|
35821
|
-
_ref$valueStyle = _ref.valueStyle,
|
|
35822
|
-
valueStyle = _ref$valueStyle === void 0 ? {
|
|
35823
|
-
fontSize: '14px',
|
|
35824
|
-
fontFamily: 'Arial'
|
|
35825
|
-
} : _ref$valueStyle,
|
|
35826
|
-
_ref$optionStyle = _ref.optionStyle,
|
|
35827
|
-
optionStyle = _ref$optionStyle === void 0 ? {
|
|
35828
|
-
fontSize: '14px',
|
|
35829
|
-
fontFamily: 'Arial'
|
|
35830
|
-
} : _ref$optionStyle;
|
|
35861
|
+
} : _ref$selectMetaConfig;
|
|
35831
35862
|
var _useState = useState(value !== null && value !== void 0 ? value : null),
|
|
35832
35863
|
_useState2 = _slicedToArray$8(_useState, 2),
|
|
35833
35864
|
optionSelected = _useState2[0],
|
|
35834
35865
|
setOptionSelected = _useState2[1];
|
|
35866
|
+
var items = useRef(Array.from({
|
|
35867
|
+
length: 100000
|
|
35868
|
+
}));
|
|
35835
35869
|
var _useState3 = useState(false),
|
|
35836
35870
|
_useState4 = _slicedToArray$8(_useState3, 2),
|
|
35837
|
-
|
|
35838
|
-
|
|
35839
|
-
var
|
|
35840
|
-
var refValue = useRef();
|
|
35871
|
+
loading = _useState4[0],
|
|
35872
|
+
setLoading = _useState4[1];
|
|
35873
|
+
var loadLazyTimeout = useRef();
|
|
35841
35874
|
useEffect(function () {
|
|
35842
35875
|
setOptionSelected(value !== null && value !== void 0 ? value : null);
|
|
35843
35876
|
}, [value]);
|
|
35877
|
+
useEffect(function () {
|
|
35878
|
+
var handleScroll = function handleScroll(e) {
|
|
35879
|
+
var target = e.target;
|
|
35880
|
+
|
|
35881
|
+
// Si on scroll dans la liste elle-même (aucun effet de suppression de liste)
|
|
35882
|
+
if (target.closest && target.closest('.p-dropdown-panel')) {
|
|
35883
|
+
return;
|
|
35884
|
+
}
|
|
35885
|
+
// Sinon, le zone de liste est fermée
|
|
35886
|
+
var dropdownPanels = document.querySelectorAll('.p-dropdown-panel');
|
|
35887
|
+
dropdownPanels.forEach(function (panel) {
|
|
35888
|
+
if (panel && panel.style.display !== 'none') {
|
|
35889
|
+
document.body.click(); // Déclenche un "click outside"
|
|
35890
|
+
}
|
|
35891
|
+
});
|
|
35892
|
+
};
|
|
35893
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
35894
|
+
return function () {
|
|
35895
|
+
window.removeEventListener('scroll', handleScroll, true);
|
|
35896
|
+
};
|
|
35897
|
+
}, []);
|
|
35898
|
+
var resetDropdownFilter = function resetDropdownFilter() {
|
|
35899
|
+
setTimeout(function () {
|
|
35900
|
+
var dropdownPanels = document.querySelectorAll('.p-dropdown-panel');
|
|
35901
|
+
dropdownPanels.forEach(function (panel) {
|
|
35902
|
+
var input = panel.querySelector('.p-dropdown-filter');
|
|
35903
|
+
if (input) {
|
|
35904
|
+
input.value = '';
|
|
35905
|
+
input.dispatchEvent(new Event('input', {
|
|
35906
|
+
bubbles: true
|
|
35907
|
+
}));
|
|
35908
|
+
}
|
|
35909
|
+
});
|
|
35910
|
+
}, 50);
|
|
35911
|
+
};
|
|
35912
|
+
var style = {
|
|
35913
|
+
border: invalid ? '1px solid red' : '1px solid #ccc',
|
|
35914
|
+
width: '100%'
|
|
35915
|
+
};
|
|
35844
35916
|
var inverseColor = function inverseColor(hexColor) {
|
|
35845
35917
|
var r = parseInt(hexColor.substr(1, 2), 16);
|
|
35846
35918
|
var g = parseInt(hexColor.substr(3, 2), 16);
|
|
@@ -35848,103 +35920,6 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35848
35920
|
var luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
35849
35921
|
return luminance > 0.5 ? '#000000' : '#FFFFFF';
|
|
35850
35922
|
};
|
|
35851
|
-
var handleChange = function handleChange(e) {
|
|
35852
|
-
var newValue = e.value;
|
|
35853
|
-
setOptionSelected(newValue);
|
|
35854
|
-
if (onChangeFunction) {
|
|
35855
|
-
onChangeFunction(newValue);
|
|
35856
|
-
}
|
|
35857
|
-
if (!multiple) {
|
|
35858
|
-
setIsOpen(false);
|
|
35859
|
-
}
|
|
35860
|
-
};
|
|
35861
|
-
var onMenuOpen = function onMenuOpen() {
|
|
35862
|
-
setIsOpen(true);
|
|
35863
|
-
};
|
|
35864
|
-
var onMenuClose = function onMenuClose() {
|
|
35865
|
-
setIsOpen(false);
|
|
35866
|
-
};
|
|
35867
|
-
var handleClickOutside = function handleClickOutside(e) {
|
|
35868
|
-
if (ref.current && !ref.current.contains(e.target)) {
|
|
35869
|
-
setIsOpen(false);
|
|
35870
|
-
}
|
|
35871
|
-
};
|
|
35872
|
-
useEffect(function () {
|
|
35873
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
35874
|
-
return function () {
|
|
35875
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
35876
|
-
};
|
|
35877
|
-
}, []);
|
|
35878
|
-
var renderSelectedItems = function renderSelectedItems() {
|
|
35879
|
-
if (!optionSelected) return null;
|
|
35880
|
-
if (multiple && Array.isArray(optionSelected)) {
|
|
35881
|
-
if (optionSelected.length <= 5) {
|
|
35882
|
-
return optionSelected.map(function (opt, index) {
|
|
35883
|
-
return opt && opt.color && opt.nom ? /*#__PURE__*/React__default.createElement("span", {
|
|
35884
|
-
key: index,
|
|
35885
|
-
className: "badge badge-primary select-badge",
|
|
35886
|
-
style: {
|
|
35887
|
-
backgroundColor: opt.color
|
|
35888
|
-
}
|
|
35889
|
-
}, opt.nom) : null;
|
|
35890
|
-
});
|
|
35891
|
-
} else {
|
|
35892
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
35893
|
-
onClick: function onClick(e) {
|
|
35894
|
-
e.stopPropagation();
|
|
35895
|
-
setIsOpen(false);
|
|
35896
|
-
var event = new CustomEvent('openInfoSelect', {
|
|
35897
|
-
detail: {
|
|
35898
|
-
value: optionSelected
|
|
35899
|
-
}
|
|
35900
|
-
});
|
|
35901
|
-
document.dispatchEvent(event);
|
|
35902
|
-
}
|
|
35903
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
35904
|
-
className: "selectMetaCounter"
|
|
35905
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
35906
|
-
className: "badge trigger_popup_fricc"
|
|
35907
|
-
}, optionSelected.length), /*#__PURE__*/React__default.createElement("div", {
|
|
35908
|
-
className: "test-title-ON"
|
|
35909
|
-
}, "Toggle")));
|
|
35910
|
-
}
|
|
35911
|
-
} else if (optionSelected.color && optionSelected.nom) {
|
|
35912
|
-
return /*#__PURE__*/React__default.createElement("span", {
|
|
35913
|
-
className: "badge badge-primary select-badge",
|
|
35914
|
-
style: {
|
|
35915
|
-
backgroundColor: optionSelected.color,
|
|
35916
|
-
color: inverseColor(optionSelected.color)
|
|
35917
|
-
}
|
|
35918
|
-
}, optionSelected.nom);
|
|
35919
|
-
}
|
|
35920
|
-
};
|
|
35921
|
-
var renderHiddenInputs = function renderHiddenInputs() {
|
|
35922
|
-
if (multiple && Array.isArray(optionSelected)) {
|
|
35923
|
-
return optionSelected.map(function (opt, index) {
|
|
35924
|
-
return opt && opt.id ? /*#__PURE__*/React__default.createElement("input", {
|
|
35925
|
-
type: "hidden",
|
|
35926
|
-
key: index,
|
|
35927
|
-
name: !readOnly ? name : '',
|
|
35928
|
-
className: classInput,
|
|
35929
|
-
"data-id-onglet": ongletID,
|
|
35930
|
-
value: opt.id,
|
|
35931
|
-
"data-name": opt.nom,
|
|
35932
|
-
ref: index === 0 ? refValue : null
|
|
35933
|
-
}) : null;
|
|
35934
|
-
});
|
|
35935
|
-
} else if (optionSelected && optionSelected.id) {
|
|
35936
|
-
return /*#__PURE__*/React__default.createElement("input", {
|
|
35937
|
-
type: "hidden",
|
|
35938
|
-
name: !readOnly ? name : '',
|
|
35939
|
-
className: classInput,
|
|
35940
|
-
"data-id-onglet": ongletID,
|
|
35941
|
-
value: optionSelected.id,
|
|
35942
|
-
"data-name": optionSelected.nom,
|
|
35943
|
-
ref: refValue
|
|
35944
|
-
});
|
|
35945
|
-
}
|
|
35946
|
-
return null;
|
|
35947
|
-
};
|
|
35948
35923
|
var optionTemplate = function optionTemplate(option) {
|
|
35949
35924
|
if (!isSelectMeta) {
|
|
35950
35925
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -35954,10 +35929,10 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35954
35929
|
}, option.label);
|
|
35955
35930
|
} else {
|
|
35956
35931
|
var _ref2 = selectMetaConfig || {},
|
|
35932
|
+
labelStyle = _ref2.labelStyle,
|
|
35957
35933
|
generalIcon = _ref2.generalIcon;
|
|
35958
35934
|
var styleLabel = {
|
|
35959
|
-
marginLeft: '10px'
|
|
35960
|
-
color: option === null || option === void 0 ? void 0 : option.color
|
|
35935
|
+
marginLeft: '10px'
|
|
35961
35936
|
};
|
|
35962
35937
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
35963
35938
|
className: "flex align-items-center",
|
|
@@ -35965,10 +35940,10 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35965
35940
|
width: '100%'
|
|
35966
35941
|
}
|
|
35967
35942
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
35968
|
-
style: {
|
|
35943
|
+
style: _objectSpread2({
|
|
35969
35944
|
fontSize: '15px',
|
|
35970
35945
|
fontWeight: 'bold'
|
|
35971
|
-
}
|
|
35946
|
+
}, labelStyle)
|
|
35972
35947
|
}, generalIcon && /*#__PURE__*/React__default.createElement("i", {
|
|
35973
35948
|
style: {
|
|
35974
35949
|
color: option === null || option === void 0 ? void 0 : option.color
|
|
@@ -35976,48 +35951,161 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35976
35951
|
className: generalIcon
|
|
35977
35952
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
35978
35953
|
style: styleLabel
|
|
35979
|
-
},
|
|
35954
|
+
}, option === null || option === void 0 ? void 0 : option.label)));
|
|
35980
35955
|
}
|
|
35981
35956
|
};
|
|
35982
35957
|
var valueTemplate = function valueTemplate(option) {
|
|
35983
|
-
if (
|
|
35958
|
+
if (isSelectMeta) {
|
|
35959
|
+
var iconColor = option !== null && option !== void 0 && option.color ? inverseColor(option === null || option === void 0 ? void 0 : option.color) : '#FFFFFF';
|
|
35960
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
35961
|
+
style: _objectSpread2({
|
|
35962
|
+
backgroundColor: option === null || option === void 0 ? void 0 : option.color,
|
|
35963
|
+
color: 'white',
|
|
35964
|
+
padding: '0.5rem',
|
|
35965
|
+
borderRadius: '1rem',
|
|
35966
|
+
display: 'inline-block'
|
|
35967
|
+
}, valueStyle)
|
|
35968
|
+
}, option !== null && option !== void 0 && option.label ? /*#__PURE__*/React__default.createElement("span", {
|
|
35969
|
+
style: {
|
|
35970
|
+
color: iconColor
|
|
35971
|
+
}
|
|
35972
|
+
}, option === null || option === void 0 ? void 0 : option.label) : /*#__PURE__*/React__default.createElement("span", {
|
|
35973
|
+
style: {
|
|
35974
|
+
color: '#000000'
|
|
35975
|
+
}
|
|
35976
|
+
}, placeholder));
|
|
35977
|
+
} else {
|
|
35984
35978
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
35985
|
-
style:
|
|
35986
|
-
|
|
35979
|
+
style: _objectSpread2({
|
|
35980
|
+
fontFamily: 'Arial',
|
|
35981
|
+
fontSize: '14px'
|
|
35982
|
+
}, valueStyle)
|
|
35983
|
+
}, (option === null || option === void 0 ? void 0 : option.label) || placeholder);
|
|
35984
|
+
}
|
|
35985
|
+
};
|
|
35986
|
+
var onLazyLoad = function onLazyLoad(event) {
|
|
35987
|
+
setLoading(true);
|
|
35988
|
+
if (loadLazyTimeout.current) {
|
|
35989
|
+
clearTimeout(loadLazyTimeout.current);
|
|
35990
|
+
}
|
|
35991
|
+
loadLazyTimeout.current = setTimeout(function () {
|
|
35992
|
+
var first = event.first,
|
|
35993
|
+
last = event.last;
|
|
35994
|
+
var _items = _toConsumableArray$6(items.current);
|
|
35995
|
+
for (var i = first; i < last; i++) {
|
|
35996
|
+
_items[i] = {
|
|
35997
|
+
label: "Item #".concat(i),
|
|
35998
|
+
value: i
|
|
35999
|
+
};
|
|
36000
|
+
}
|
|
36001
|
+
items.current = _items;
|
|
36002
|
+
setLoading(false);
|
|
36003
|
+
}, Math.random() * 1000 + 250);
|
|
36004
|
+
};
|
|
36005
|
+
var handleChange = function handleChange(e) {
|
|
36006
|
+
var newValue = e.value;
|
|
36007
|
+
setOptionSelected(newValue);
|
|
36008
|
+
if (onChange) {
|
|
36009
|
+
onChange(newValue);
|
|
36010
|
+
}
|
|
36011
|
+
};
|
|
36012
|
+
var groupedItemTemplate = function groupedItemTemplate(option) {
|
|
36013
|
+
var _ref3 = groupedItemTemplateConfig || {},
|
|
36014
|
+
showImage = _ref3.showImage,
|
|
36015
|
+
imageKey = _ref3.imageKey,
|
|
36016
|
+
imageStyle = _ref3.imageStyle,
|
|
36017
|
+
showIcon = _ref3.showIcon,
|
|
36018
|
+
iconKey = _ref3.iconKey,
|
|
36019
|
+
labelStyle = _ref3.labelStyle,
|
|
36020
|
+
generalIcon = _ref3.generalIcon,
|
|
36021
|
+
generalImage = _ref3.generalImage;
|
|
36022
|
+
var icon = option.value && option.value[iconKey];
|
|
36023
|
+
var styleLabel = {};
|
|
36024
|
+
if (generalIcon || generalIcon || showImage && option[imageKey] || showIcon && icon) {
|
|
36025
|
+
styleLabel = {
|
|
36026
|
+
'marginLeft': '10px'
|
|
36027
|
+
};
|
|
36028
|
+
}
|
|
36029
|
+
if (option.group) {
|
|
36030
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
36031
|
+
className: "flex align-items-center"
|
|
36032
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
36033
|
+
style: _objectSpread2({
|
|
36034
|
+
fontSize: '15px',
|
|
36035
|
+
fontWeight: 'bold'
|
|
36036
|
+
}, labelStyle)
|
|
36037
|
+
}, generalIcon && /*#__PURE__*/React__default.createElement("i", {
|
|
36038
|
+
style: _objectSpread2({
|
|
36039
|
+
fontSize: '15px',
|
|
36040
|
+
fontWeight: 'bold'
|
|
36041
|
+
}, labelStyle),
|
|
36042
|
+
className: generalIcon
|
|
36043
|
+
}), generalImage && /*#__PURE__*/React__default.createElement("img", {
|
|
36044
|
+
alt: "General",
|
|
36045
|
+
src: generalImage,
|
|
36046
|
+
style: imageStyle || {
|
|
36047
|
+
width: '18px',
|
|
36048
|
+
marginRight: '0.5rem'
|
|
36049
|
+
},
|
|
36050
|
+
className: "mr-2"
|
|
36051
|
+
}), showImage && option[imageKey] && /*#__PURE__*/React__default.createElement("img", {
|
|
36052
|
+
alt: option.label,
|
|
36053
|
+
src: option[imageKey],
|
|
36054
|
+
style: imageStyle || {
|
|
36055
|
+
width: '18px',
|
|
36056
|
+
marginRight: '0.5rem'
|
|
36057
|
+
},
|
|
36058
|
+
className: "mr-2"
|
|
36059
|
+
}), showIcon && icon && /*#__PURE__*/React__default.createElement("i", {
|
|
36060
|
+
style: _objectSpread2({
|
|
36061
|
+
fontSize: '15px',
|
|
36062
|
+
fontWeight: 'bold'
|
|
36063
|
+
}, labelStyle),
|
|
36064
|
+
className: 'mr-2 ' + icon
|
|
36065
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
36066
|
+
style: styleLabel
|
|
36067
|
+
}, option.label)));
|
|
35987
36068
|
}
|
|
35988
|
-
var iconColor = option !== null && option !== void 0 && option.color ? inverseColor(option.color) : '#FFFFFF';
|
|
35989
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
35990
|
-
style: _objectSpread2({
|
|
35991
|
-
backgroundColor: option.color,
|
|
35992
|
-
color: iconColor,
|
|
35993
|
-
padding: '0.5rem',
|
|
35994
|
-
borderRadius: '1rem',
|
|
35995
|
-
display: 'inline-block'
|
|
35996
|
-
}, valueStyle)
|
|
35997
|
-
}, option.nom || option.label);
|
|
35998
36069
|
};
|
|
35999
36070
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
36000
|
-
className: "
|
|
36001
|
-
|
|
36002
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
36003
|
-
className: "select-badges-container",
|
|
36004
|
-
onClick: function onClick() {
|
|
36005
|
-
return !readOnly && setIsOpen(true);
|
|
36006
|
-
}
|
|
36007
|
-
}, renderSelectedItems()), !readOnly && /*#__PURE__*/React__default.createElement("span", {
|
|
36008
|
-
className: "caret"
|
|
36009
|
-
}), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
36071
|
+
className: "flex flex-col gap-1"
|
|
36072
|
+
}, /*#__PURE__*/React__default.createElement(Dropdown$1, _extends$A({
|
|
36010
36073
|
value: optionSelected,
|
|
36011
36074
|
options: options,
|
|
36012
36075
|
onChange: handleChange,
|
|
36013
36076
|
placeholder: placeholder,
|
|
36014
|
-
disabled:
|
|
36015
|
-
|
|
36016
|
-
|
|
36017
|
-
|
|
36077
|
+
disabled: disabled,
|
|
36078
|
+
filter: filter,
|
|
36079
|
+
optionLabel: optionLabel,
|
|
36080
|
+
optionValue: optionValue,
|
|
36081
|
+
style: style,
|
|
36018
36082
|
itemTemplate: optionTemplate,
|
|
36019
|
-
valueTemplate: valueTemplate
|
|
36020
|
-
|
|
36083
|
+
valueTemplate: valueTemplate,
|
|
36084
|
+
onHide: resetDropdownFilter,
|
|
36085
|
+
showClear: showClear,
|
|
36086
|
+
optionGroupTemplate: isGroupedOption ? groupedItemTemplate : null
|
|
36087
|
+
}, isGroupedOption && {
|
|
36088
|
+
optionGroupLabel: 'label',
|
|
36089
|
+
optionGroupChildren: 'items'
|
|
36090
|
+
}, isSelectMeta && {
|
|
36091
|
+
virtualScrollerOptions: {
|
|
36092
|
+
lazy: true,
|
|
36093
|
+
onLazyLoad: onLazyLoad,
|
|
36094
|
+
itemSize: 38,
|
|
36095
|
+
showLoader: true,
|
|
36096
|
+
loading: loading,
|
|
36097
|
+
delay: 250
|
|
36098
|
+
}
|
|
36099
|
+
})), name && /*#__PURE__*/React__default.createElement("input", {
|
|
36100
|
+
type: "hidden",
|
|
36101
|
+
name: name,
|
|
36102
|
+
value: optionSelected !== null && optionSelected !== void 0 ? optionSelected : ''
|
|
36103
|
+
}), invalid && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("small", {
|
|
36104
|
+
style: {
|
|
36105
|
+
color: 'red',
|
|
36106
|
+
fontStyle: 'italic'
|
|
36107
|
+
}
|
|
36108
|
+
}, errorMessage || 'Sélection invalide')));
|
|
36021
36109
|
};
|
|
36022
36110
|
|
|
36023
36111
|
var optionsExample = [{
|