arengibook 2.4.585 → 2.4.586
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 +297 -148
- 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,8 +35813,6 @@ 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,
|
|
35804
|
-
_ref$isGroupedOption = _ref.isGroupedOption,
|
|
35805
|
-
isGroupedOption = _ref$isGroupedOption === void 0 ? false : _ref$isGroupedOption,
|
|
35806
35816
|
value = _ref.value,
|
|
35807
35817
|
_ref$placeholder = _ref.placeholder,
|
|
35808
35818
|
placeholder = _ref$placeholder === void 0 ? 'Sélectionnez une option' : _ref$placeholder,
|
|
@@ -35828,163 +35838,200 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35828
35838
|
name = _ref.name,
|
|
35829
35839
|
_ref$showClear = _ref.showClear,
|
|
35830
35840
|
showClear = _ref$showClear === void 0 ? false : _ref$showClear,
|
|
35831
|
-
_ref$
|
|
35832
|
-
|
|
35833
|
-
|
|
35834
|
-
|
|
35835
|
-
showImage: false,
|
|
35836
|
-
imageKey: 'image',
|
|
35837
|
-
imageStyle: null,
|
|
35841
|
+
_ref$isSelectMeta = _ref.isSelectMeta,
|
|
35842
|
+
isSelectMeta = _ref$isSelectMeta === void 0 ? false : _ref$isSelectMeta,
|
|
35843
|
+
_ref$selectMetaConfig = _ref.selectMetaConfig,
|
|
35844
|
+
selectMetaConfig = _ref$selectMetaConfig === void 0 ? {
|
|
35838
35845
|
labelStyle: null,
|
|
35839
|
-
generalIcon: null
|
|
35840
|
-
|
|
35841
|
-
|
|
35846
|
+
generalIcon: null
|
|
35847
|
+
} : _ref$selectMetaConfig,
|
|
35848
|
+
onChangeFunction = _ref.onChangeFunction,
|
|
35849
|
+
classInput = _ref.classInput,
|
|
35850
|
+
_ref$readOnly = _ref.readOnly,
|
|
35851
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
35852
|
+
_ref$multiple = _ref.multiple,
|
|
35853
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple;
|
|
35854
|
+
_ref.async;
|
|
35855
|
+
_ref.url;
|
|
35856
|
+
_ref.filterIds;
|
|
35857
|
+
_ref.filterContent;
|
|
35858
|
+
_ref.formid;
|
|
35859
|
+
var ongletID = _ref.ongletID;
|
|
35860
|
+
_ref.node;
|
|
35861
|
+
var _ref$defaultMenuIsOpe = _ref.defaultMenuIsOpen,
|
|
35862
|
+
defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe;
|
|
35842
35863
|
var _useState = useState(value !== null && value !== void 0 ? value : null),
|
|
35843
35864
|
_useState2 = _slicedToArray$8(_useState, 2),
|
|
35844
35865
|
optionSelected = _useState2[0],
|
|
35845
35866
|
setOptionSelected = _useState2[1];
|
|
35867
|
+
var _useState3 = useState(defaultMenuIsOpen),
|
|
35868
|
+
_useState4 = _slicedToArray$8(_useState3, 2);
|
|
35869
|
+
_useState4[0];
|
|
35870
|
+
var setIsOpen = _useState4[1];
|
|
35871
|
+
var _useState5 = useState(defaultMenuIsOpen),
|
|
35872
|
+
_useState6 = _slicedToArray$8(_useState5, 2),
|
|
35873
|
+
menuIsOpen = _useState6[0],
|
|
35874
|
+
setMenuIsOpen = _useState6[1];
|
|
35875
|
+
var ref = useRef();
|
|
35876
|
+
var refValue = useRef();
|
|
35877
|
+
var items = useRef(Array.from({
|
|
35878
|
+
length: 100000
|
|
35879
|
+
}));
|
|
35880
|
+
var _useState7 = useState(false),
|
|
35881
|
+
_useState8 = _slicedToArray$8(_useState7, 2),
|
|
35882
|
+
loading = _useState8[0],
|
|
35883
|
+
setLoading = _useState8[1];
|
|
35884
|
+
var loadLazyTimeout = useRef();
|
|
35846
35885
|
useEffect(function () {
|
|
35847
35886
|
setOptionSelected(value !== null && value !== void 0 ? value : null);
|
|
35848
35887
|
}, [value]);
|
|
35849
|
-
|
|
35850
|
-
var
|
|
35851
|
-
|
|
35852
|
-
|
|
35853
|
-
|
|
35854
|
-
|
|
35855
|
-
|
|
35888
|
+
var inverseColor = function inverseColor(hexColor) {
|
|
35889
|
+
var r = parseInt(hexColor.substr(1, 2), 16);
|
|
35890
|
+
var g = parseInt(hexColor.substr(3, 2), 16);
|
|
35891
|
+
var b = parseInt(hexColor.substr(5, 2), 16);
|
|
35892
|
+
var luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
35893
|
+
return luminance > 0.5 ? '#000000' : '#FFFFFF';
|
|
35894
|
+
};
|
|
35895
|
+
var onLazyLoad = function onLazyLoad(event) {
|
|
35896
|
+
setLoading(true);
|
|
35897
|
+
if (loadLazyTimeout.current) {
|
|
35898
|
+
clearTimeout(loadLazyTimeout.current);
|
|
35899
|
+
}
|
|
35900
|
+
loadLazyTimeout.current = setTimeout(function () {
|
|
35901
|
+
var first = event.first,
|
|
35902
|
+
last = event.last;
|
|
35903
|
+
var _items = _toConsumableArray$6(items.current);
|
|
35904
|
+
for (var i = first; i < last; i++) {
|
|
35905
|
+
_items[i] = {
|
|
35906
|
+
label: "Item #".concat(i),
|
|
35907
|
+
value: i
|
|
35908
|
+
};
|
|
35856
35909
|
}
|
|
35857
|
-
|
|
35858
|
-
|
|
35859
|
-
|
|
35860
|
-
|
|
35861
|
-
|
|
35862
|
-
|
|
35863
|
-
|
|
35864
|
-
|
|
35865
|
-
|
|
35866
|
-
|
|
35910
|
+
items.current = _items;
|
|
35911
|
+
setLoading(false);
|
|
35912
|
+
}, Math.random() * 1000 + 250);
|
|
35913
|
+
};
|
|
35914
|
+
var handleChange = function handleChange(e) {
|
|
35915
|
+
var newValue = e.value;
|
|
35916
|
+
setOptionSelected(newValue);
|
|
35917
|
+
if (onChangeFunction) {
|
|
35918
|
+
onChangeFunction(newValue);
|
|
35919
|
+
}
|
|
35920
|
+
if (!multiple) {
|
|
35921
|
+
setIsOpen(false);
|
|
35922
|
+
}
|
|
35923
|
+
};
|
|
35924
|
+
var onMenuOpen = function onMenuOpen() {
|
|
35925
|
+
setMenuIsOpen(true);
|
|
35926
|
+
setIsOpen(true);
|
|
35927
|
+
};
|
|
35928
|
+
var onMenuClose = function onMenuClose() {
|
|
35929
|
+
setMenuIsOpen(false);
|
|
35930
|
+
setIsOpen(false);
|
|
35931
|
+
};
|
|
35932
|
+
var handleClickOutside = function handleClickOutside(e) {
|
|
35933
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
35934
|
+
setMenuIsOpen(false);
|
|
35935
|
+
setIsOpen(false);
|
|
35936
|
+
}
|
|
35937
|
+
};
|
|
35938
|
+
useEffect(function () {
|
|
35939
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
35867
35940
|
return function () {
|
|
35868
|
-
|
|
35941
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
35869
35942
|
};
|
|
35870
35943
|
}, []);
|
|
35871
|
-
var resetDropdownFilter = function resetDropdownFilter() {
|
|
35872
|
-
setTimeout(function () {
|
|
35873
|
-
var dropdownPanels = document.querySelectorAll('.p-dropdown-panel');
|
|
35874
|
-
dropdownPanels.forEach(function (panel) {
|
|
35875
|
-
var input = panel.querySelector('.p-dropdown-filter');
|
|
35876
|
-
if (input) {
|
|
35877
|
-
input.value = '';
|
|
35878
|
-
input.dispatchEvent(new Event('input', {
|
|
35879
|
-
bubbles: true
|
|
35880
|
-
}));
|
|
35881
|
-
}
|
|
35882
|
-
});
|
|
35883
|
-
}, 50);
|
|
35884
|
-
};
|
|
35885
|
-
var style = {
|
|
35886
|
-
border: invalid ? '1px solid red' : '1px solid #ccc',
|
|
35887
|
-
width: '100%'
|
|
35888
|
-
};
|
|
35889
35944
|
var optionTemplate = function optionTemplate(option) {
|
|
35890
|
-
|
|
35891
|
-
|
|
35892
|
-
|
|
35893
|
-
|
|
35894
|
-
|
|
35895
|
-
|
|
35896
|
-
|
|
35897
|
-
|
|
35898
|
-
|
|
35899
|
-
|
|
35900
|
-
|
|
35901
|
-
|
|
35902
|
-
|
|
35903
|
-
};
|
|
35904
|
-
var groupedItemTemplate = function groupedItemTemplate(option) {
|
|
35905
|
-
var _ref2 = groupedItemTemplateConfig || {},
|
|
35906
|
-
showImage = _ref2.showImage,
|
|
35907
|
-
imageKey = _ref2.imageKey,
|
|
35908
|
-
imageStyle = _ref2.imageStyle,
|
|
35909
|
-
showIcon = _ref2.showIcon,
|
|
35910
|
-
iconKey = _ref2.iconKey,
|
|
35911
|
-
labelStyle = _ref2.labelStyle,
|
|
35912
|
-
generalIcon = _ref2.generalIcon,
|
|
35913
|
-
generalImage = _ref2.generalImage;
|
|
35914
|
-
var icon = option.value && option.value[iconKey];
|
|
35915
|
-
var styleLabel = {};
|
|
35916
|
-
if (generalIcon || generalIcon || showImage && option[imageKey] || showIcon && icon) {
|
|
35917
|
-
styleLabel = {
|
|
35918
|
-
'marginLeft': '10px'
|
|
35945
|
+
if (!isSelectMeta) {
|
|
35946
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
35947
|
+
style: _objectSpread2({
|
|
35948
|
+
fontSize: '14px'
|
|
35949
|
+
}, optionStyle)
|
|
35950
|
+
}, option.label);
|
|
35951
|
+
} else {
|
|
35952
|
+
var _ref2 = selectMetaConfig || {},
|
|
35953
|
+
labelStyle = _ref2.labelStyle,
|
|
35954
|
+
generalIcon = _ref2.generalIcon;
|
|
35955
|
+
var styleLabel = {
|
|
35956
|
+
marginLeft: '10px',
|
|
35957
|
+
color: option === null || option === void 0 ? void 0 : option.color
|
|
35919
35958
|
};
|
|
35920
|
-
}
|
|
35921
|
-
if (option.group) {
|
|
35922
35959
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
35923
|
-
className: "flex align-items-center"
|
|
35960
|
+
className: "flex align-items-center",
|
|
35961
|
+
style: {
|
|
35962
|
+
width: '100%'
|
|
35963
|
+
}
|
|
35924
35964
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
35925
35965
|
style: _objectSpread2({
|
|
35926
35966
|
fontSize: '15px',
|
|
35927
35967
|
fontWeight: 'bold'
|
|
35928
35968
|
}, labelStyle)
|
|
35929
35969
|
}, generalIcon && /*#__PURE__*/React__default.createElement("i", {
|
|
35930
|
-
style:
|
|
35931
|
-
|
|
35932
|
-
fontWeight: 'bold'
|
|
35933
|
-
}, labelStyle),
|
|
35934
|
-
className: generalIcon
|
|
35935
|
-
}), generalImage && /*#__PURE__*/React__default.createElement("img", {
|
|
35936
|
-
alt: "General",
|
|
35937
|
-
src: generalImage,
|
|
35938
|
-
style: imageStyle || {
|
|
35939
|
-
width: '18px',
|
|
35940
|
-
marginRight: '0.5rem'
|
|
35941
|
-
},
|
|
35942
|
-
className: "mr-2"
|
|
35943
|
-
}), showImage && option[imageKey] && /*#__PURE__*/React__default.createElement("img", {
|
|
35944
|
-
alt: option.label,
|
|
35945
|
-
src: option[imageKey],
|
|
35946
|
-
style: imageStyle || {
|
|
35947
|
-
width: '18px',
|
|
35948
|
-
marginRight: '0.5rem'
|
|
35970
|
+
style: {
|
|
35971
|
+
color: option === null || option === void 0 ? void 0 : option.color
|
|
35949
35972
|
},
|
|
35950
|
-
className:
|
|
35951
|
-
}), showIcon && icon && /*#__PURE__*/React__default.createElement("i", {
|
|
35952
|
-
style: _objectSpread2({
|
|
35953
|
-
fontSize: '15px',
|
|
35954
|
-
fontWeight: 'bold'
|
|
35955
|
-
}, labelStyle),
|
|
35956
|
-
className: 'mr-2 ' + icon
|
|
35973
|
+
className: generalIcon
|
|
35957
35974
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
35958
35975
|
style: styleLabel
|
|
35959
|
-
}, option.label)));
|
|
35976
|
+
}, option === null || option === void 0 ? void 0 : option.label)));
|
|
35960
35977
|
}
|
|
35961
35978
|
};
|
|
35979
|
+
var valueTemplate = function valueTemplate(option) {
|
|
35980
|
+
if (!option) {
|
|
35981
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
35982
|
+
style: valueStyle
|
|
35983
|
+
}, placeholder);
|
|
35984
|
+
}
|
|
35985
|
+
var iconColor = option !== null && option !== void 0 && option.color ? inverseColor(option.color) : '#FFFFFF';
|
|
35986
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
35987
|
+
style: _objectSpread2({
|
|
35988
|
+
backgroundColor: option.color,
|
|
35989
|
+
color: iconColor,
|
|
35990
|
+
padding: '0.5rem',
|
|
35991
|
+
borderRadius: '1rem',
|
|
35992
|
+
display: 'inline-block'
|
|
35993
|
+
}, valueStyle)
|
|
35994
|
+
}, option.label);
|
|
35995
|
+
};
|
|
35996
|
+
var style = {
|
|
35997
|
+
border: invalid ? '1px solid red' : '1px solid #ccc',
|
|
35998
|
+
width: '300px'
|
|
35999
|
+
};
|
|
35962
36000
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
35963
|
-
className: "flex flex-col gap-1"
|
|
36001
|
+
className: "flex flex-col gap-1",
|
|
36002
|
+
ref: ref
|
|
35964
36003
|
}, /*#__PURE__*/React__default.createElement(Dropdown$1, _extends$A({
|
|
35965
36004
|
value: optionSelected,
|
|
35966
36005
|
options: options,
|
|
35967
|
-
onChange:
|
|
35968
|
-
return setOptionSelected(e.value);
|
|
35969
|
-
},
|
|
36006
|
+
onChange: handleChange,
|
|
35970
36007
|
placeholder: placeholder,
|
|
35971
|
-
disabled: disabled,
|
|
36008
|
+
disabled: disabled || readOnly,
|
|
35972
36009
|
filter: filter,
|
|
35973
36010
|
optionLabel: optionLabel,
|
|
35974
36011
|
optionValue: optionValue,
|
|
35975
36012
|
style: style,
|
|
35976
36013
|
itemTemplate: optionTemplate,
|
|
35977
36014
|
valueTemplate: valueTemplate,
|
|
35978
|
-
onHide: resetDropdownFilter,
|
|
35979
36015
|
showClear: showClear,
|
|
35980
|
-
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
|
|
36016
|
+
onShow: onMenuOpen,
|
|
36017
|
+
onHide: onMenuClose,
|
|
36018
|
+
menuIsOpen: menuIsOpen
|
|
36019
|
+
}, isSelectMeta && {
|
|
36020
|
+
virtualScrollerOptions: {
|
|
36021
|
+
lazy: true,
|
|
36022
|
+
onLazyLoad: onLazyLoad,
|
|
36023
|
+
itemSize: 38,
|
|
36024
|
+
showLoader: true,
|
|
36025
|
+
loading: loading,
|
|
36026
|
+
delay: 250
|
|
36027
|
+
}
|
|
35984
36028
|
})), name && /*#__PURE__*/React__default.createElement("input", {
|
|
35985
36029
|
type: "hidden",
|
|
35986
|
-
|
|
35987
|
-
|
|
36030
|
+
className: classInput,
|
|
36031
|
+
"data-id-onglet": ongletID,
|
|
36032
|
+
name: !readOnly ? name : '',
|
|
36033
|
+
value: optionSelected ? optionSelected.value : '',
|
|
36034
|
+
ref: refValue
|
|
35988
36035
|
}), invalid && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("small", {
|
|
35989
36036
|
style: {
|
|
35990
36037
|
color: 'red',
|
|
@@ -36003,6 +36050,76 @@ var optionsExample = [{
|
|
|
36003
36050
|
label: 'Option 3',
|
|
36004
36051
|
value: '3'
|
|
36005
36052
|
}];
|
|
36053
|
+
var optionsGroup = [{
|
|
36054
|
+
label: 'Germany',
|
|
36055
|
+
code: 'DE',
|
|
36056
|
+
items: [{
|
|
36057
|
+
label: 'Berlin',
|
|
36058
|
+
value: 'Berlin'
|
|
36059
|
+
}, {
|
|
36060
|
+
label: 'Frankfurt',
|
|
36061
|
+
value: 'Frankfurt'
|
|
36062
|
+
}, {
|
|
36063
|
+
label: 'Hamburg',
|
|
36064
|
+
value: 'Hamburg'
|
|
36065
|
+
}, {
|
|
36066
|
+
label: 'Munich',
|
|
36067
|
+
value: 'Munich'
|
|
36068
|
+
}]
|
|
36069
|
+
}, {
|
|
36070
|
+
label: 'USA',
|
|
36071
|
+
code: 'US',
|
|
36072
|
+
items: [{
|
|
36073
|
+
label: 'Chicago',
|
|
36074
|
+
value: 'Chicago'
|
|
36075
|
+
}, {
|
|
36076
|
+
label: 'Los Angeles',
|
|
36077
|
+
value: 'Los Angeles'
|
|
36078
|
+
}, {
|
|
36079
|
+
label: 'New York',
|
|
36080
|
+
value: 'New York'
|
|
36081
|
+
}, {
|
|
36082
|
+
label: 'San Francisco',
|
|
36083
|
+
value: 'San Francisco'
|
|
36084
|
+
}]
|
|
36085
|
+
}, {
|
|
36086
|
+
label: 'Japan',
|
|
36087
|
+
code: 'JP',
|
|
36088
|
+
items: [{
|
|
36089
|
+
label: 'Kyoto',
|
|
36090
|
+
value: 'Kyoto'
|
|
36091
|
+
}, {
|
|
36092
|
+
label: 'Osaka',
|
|
36093
|
+
value: 'Osaka'
|
|
36094
|
+
}, {
|
|
36095
|
+
label: 'Tokyo',
|
|
36096
|
+
value: 'Tokyo'
|
|
36097
|
+
}, {
|
|
36098
|
+
label: 'Yokohama',
|
|
36099
|
+
value: 'Yokohama'
|
|
36100
|
+
}]
|
|
36101
|
+
}];
|
|
36102
|
+
var optionsWithColors = [{
|
|
36103
|
+
label: 'Rouge',
|
|
36104
|
+
value: 'rouge',
|
|
36105
|
+
color: '#FF0000'
|
|
36106
|
+
}, {
|
|
36107
|
+
label: 'Vert',
|
|
36108
|
+
value: 'vert',
|
|
36109
|
+
color: '#00FF00'
|
|
36110
|
+
}, {
|
|
36111
|
+
label: 'Bleu',
|
|
36112
|
+
value: 'bleu',
|
|
36113
|
+
color: '#0000FF'
|
|
36114
|
+
}, {
|
|
36115
|
+
label: 'Jaune',
|
|
36116
|
+
value: 'jaune',
|
|
36117
|
+
color: '#FFFF00'
|
|
36118
|
+
}, {
|
|
36119
|
+
label: 'Cyan',
|
|
36120
|
+
value: 'cyan',
|
|
36121
|
+
color: '#00FFFF'
|
|
36122
|
+
}];
|
|
36006
36123
|
var DropdownPresets = {
|
|
36007
36124
|
Default: {
|
|
36008
36125
|
placeholder: 'Sélectionnez une option',
|
|
@@ -36016,6 +36133,38 @@ var DropdownPresets = {
|
|
|
36016
36133
|
fontFamily: 'Arial'
|
|
36017
36134
|
}
|
|
36018
36135
|
},
|
|
36136
|
+
SelectMeta: {
|
|
36137
|
+
placeholder: 'Sélectionnez une couleur',
|
|
36138
|
+
options: optionsWithColors,
|
|
36139
|
+
isSelectMeta: true,
|
|
36140
|
+
selectMetaConfig: {
|
|
36141
|
+
generalIcon: 'pi pi-circle-fill'
|
|
36142
|
+
},
|
|
36143
|
+
valueStyle: {
|
|
36144
|
+
fontSize: '14px',
|
|
36145
|
+
fontFamily: 'Arial'
|
|
36146
|
+
},
|
|
36147
|
+
optionStyle: {
|
|
36148
|
+
fontSize: '14px',
|
|
36149
|
+
fontFamily: 'Arial'
|
|
36150
|
+
}
|
|
36151
|
+
},
|
|
36152
|
+
Group: {
|
|
36153
|
+
placeholder: 'Veuillez choisir une option',
|
|
36154
|
+
options: optionsGroup,
|
|
36155
|
+
disabled: false,
|
|
36156
|
+
isGroupedOption: true,
|
|
36157
|
+
groupedItemTemplateConfig: {
|
|
36158
|
+
showIcon: false,
|
|
36159
|
+
iconKey: 'icon',
|
|
36160
|
+
showImage: false,
|
|
36161
|
+
imageKey: 'image',
|
|
36162
|
+
imageStyle: null,
|
|
36163
|
+
labelStyle: null,
|
|
36164
|
+
generalIcon: null,
|
|
36165
|
+
generalImage: 'https://tse1.mm.bing.net/th/id/OIP.IQHLwUwt5fy7E-ag0W-34gHaHa?w=474&h=474&c=7'
|
|
36166
|
+
}
|
|
36167
|
+
},
|
|
36019
36168
|
Disabled: {
|
|
36020
36169
|
placeholder: 'Sélection désactivée',
|
|
36021
36170
|
options: optionsExample,
|