arengibook 2.4.590 → 2.4.592
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 +410 -85
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5748,6 +5748,31 @@ function _arrayWithHoles$8(r) {
|
|
|
5748
5748
|
function _arrayWithoutHoles$6(r) {
|
|
5749
5749
|
if (Array.isArray(r)) return _arrayLikeToArray$a(r);
|
|
5750
5750
|
}
|
|
5751
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
5752
|
+
try {
|
|
5753
|
+
var i = n[a](c),
|
|
5754
|
+
u = i.value;
|
|
5755
|
+
} catch (n) {
|
|
5756
|
+
return void e(n);
|
|
5757
|
+
}
|
|
5758
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
5759
|
+
}
|
|
5760
|
+
function _asyncToGenerator(n) {
|
|
5761
|
+
return function () {
|
|
5762
|
+
var t = this,
|
|
5763
|
+
e = arguments;
|
|
5764
|
+
return new Promise(function (r, o) {
|
|
5765
|
+
var a = n.apply(t, e);
|
|
5766
|
+
function _next(n) {
|
|
5767
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
5768
|
+
}
|
|
5769
|
+
function _throw(n) {
|
|
5770
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
5771
|
+
}
|
|
5772
|
+
_next(void 0);
|
|
5773
|
+
});
|
|
5774
|
+
};
|
|
5775
|
+
}
|
|
5751
5776
|
function _defineProperty$a(e, r, t) {
|
|
5752
5777
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5753
5778
|
value: t,
|
|
@@ -5839,6 +5864,116 @@ function _objectWithoutPropertiesLoose$2(r, e) {
|
|
|
5839
5864
|
}
|
|
5840
5865
|
return t;
|
|
5841
5866
|
}
|
|
5867
|
+
function _regenerator() {
|
|
5868
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5869
|
+
var e,
|
|
5870
|
+
t,
|
|
5871
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
5872
|
+
n = r.iterator || "@@iterator",
|
|
5873
|
+
o = r.toStringTag || "@@toStringTag";
|
|
5874
|
+
function i(r, n, o, i) {
|
|
5875
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
5876
|
+
u = Object.create(c.prototype);
|
|
5877
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
5878
|
+
var i,
|
|
5879
|
+
c,
|
|
5880
|
+
u,
|
|
5881
|
+
f = 0,
|
|
5882
|
+
p = o || [],
|
|
5883
|
+
y = false,
|
|
5884
|
+
G = {
|
|
5885
|
+
p: 0,
|
|
5886
|
+
n: 0,
|
|
5887
|
+
v: e,
|
|
5888
|
+
a: d,
|
|
5889
|
+
f: d.bind(e, 4),
|
|
5890
|
+
d: function (t, r) {
|
|
5891
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
5892
|
+
}
|
|
5893
|
+
};
|
|
5894
|
+
function d(r, n) {
|
|
5895
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
5896
|
+
var o,
|
|
5897
|
+
i = p[t],
|
|
5898
|
+
d = G.p,
|
|
5899
|
+
l = i[2];
|
|
5900
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
5901
|
+
}
|
|
5902
|
+
if (o || r > 1) return a;
|
|
5903
|
+
throw y = true, n;
|
|
5904
|
+
}
|
|
5905
|
+
return function (o, p, l) {
|
|
5906
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
5907
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
5908
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
5909
|
+
try {
|
|
5910
|
+
if (f = 2, i) {
|
|
5911
|
+
if (c || (o = "next"), t = i[o]) {
|
|
5912
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
5913
|
+
if (!t.done) return t;
|
|
5914
|
+
u = t.value, c < 2 && (c = 0);
|
|
5915
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
5916
|
+
i = e;
|
|
5917
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
5918
|
+
} catch (t) {
|
|
5919
|
+
i = e, c = 1, u = t;
|
|
5920
|
+
} finally {
|
|
5921
|
+
f = 1;
|
|
5922
|
+
}
|
|
5923
|
+
}
|
|
5924
|
+
return {
|
|
5925
|
+
value: t,
|
|
5926
|
+
done: y
|
|
5927
|
+
};
|
|
5928
|
+
};
|
|
5929
|
+
}(r, o, i), true), u;
|
|
5930
|
+
}
|
|
5931
|
+
var a = {};
|
|
5932
|
+
function Generator() {}
|
|
5933
|
+
function GeneratorFunction() {}
|
|
5934
|
+
function GeneratorFunctionPrototype() {}
|
|
5935
|
+
t = Object.getPrototypeOf;
|
|
5936
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
5937
|
+
return this;
|
|
5938
|
+
}), t),
|
|
5939
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
5940
|
+
function f(e) {
|
|
5941
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
5942
|
+
}
|
|
5943
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
5944
|
+
return this;
|
|
5945
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
5946
|
+
return "[object Generator]";
|
|
5947
|
+
}), (_regenerator = function () {
|
|
5948
|
+
return {
|
|
5949
|
+
w: i,
|
|
5950
|
+
m: f
|
|
5951
|
+
};
|
|
5952
|
+
})();
|
|
5953
|
+
}
|
|
5954
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
5955
|
+
var i = Object.defineProperty;
|
|
5956
|
+
try {
|
|
5957
|
+
i({}, "", {});
|
|
5958
|
+
} catch (e) {
|
|
5959
|
+
i = 0;
|
|
5960
|
+
}
|
|
5961
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
5962
|
+
if (r) i ? i(e, r, {
|
|
5963
|
+
value: n,
|
|
5964
|
+
enumerable: !t,
|
|
5965
|
+
configurable: !t,
|
|
5966
|
+
writable: !t
|
|
5967
|
+
}) : e[r] = n;else {
|
|
5968
|
+
function o(r, n) {
|
|
5969
|
+
_regeneratorDefine(e, r, function (e) {
|
|
5970
|
+
return this._invoke(r, n, e);
|
|
5971
|
+
});
|
|
5972
|
+
}
|
|
5973
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
5974
|
+
}
|
|
5975
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
5976
|
+
}
|
|
5842
5977
|
function _slicedToArray$8(r, e) {
|
|
5843
5978
|
return _arrayWithHoles$8(r) || _iterableToArrayLimit$8(r, e) || _unsupportedIterableToArray$a(r, e) || _nonIterableRest$8();
|
|
5844
5979
|
}
|
|
@@ -35863,52 +35998,86 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35863
35998
|
_useState2 = _slicedToArray$8(_useState, 2),
|
|
35864
35999
|
optionSelected = _useState2[0],
|
|
35865
36000
|
setOptionSelected = _useState2[1];
|
|
35866
|
-
|
|
35867
|
-
length: 100000
|
|
35868
|
-
}));
|
|
36001
|
+
useRef([]);
|
|
35869
36002
|
var _useState3 = useState(false),
|
|
35870
36003
|
_useState4 = _slicedToArray$8(_useState3, 2),
|
|
35871
36004
|
loading = _useState4[0],
|
|
35872
36005
|
setLoading = _useState4[1];
|
|
35873
|
-
|
|
36006
|
+
useRef([]);
|
|
36007
|
+
var currentPageRef = useRef(1);
|
|
36008
|
+
var _useState5 = useState([]),
|
|
36009
|
+
_useState6 = _slicedToArray$8(_useState5, 2),
|
|
36010
|
+
loadedOptions = _useState6[0],
|
|
36011
|
+
setLoadedOptions = _useState6[1];
|
|
36012
|
+
var isOptionLoadFunction = typeof options === 'function';
|
|
36013
|
+
|
|
36014
|
+
// useEffect(() => {
|
|
36015
|
+
// if (isOptionLoadFunction) {
|
|
36016
|
+
// const loadOptions = async () => {
|
|
36017
|
+
// setLoading(true);
|
|
36018
|
+
// try {
|
|
36019
|
+
// const result = await options();
|
|
36020
|
+
// setLoadedOptions(result);
|
|
36021
|
+
// } catch (err) {
|
|
36022
|
+
// console.error('Erreur lors du chargement des options:', err);
|
|
36023
|
+
// } finally {
|
|
36024
|
+
// setLoading(false);
|
|
36025
|
+
// }
|
|
36026
|
+
// };
|
|
36027
|
+
//
|
|
36028
|
+
// loadOptions();
|
|
36029
|
+
// } else {
|
|
36030
|
+
// setLoadedOptions(options);
|
|
36031
|
+
// }
|
|
36032
|
+
// }, [options, isOptionLoadFunction]);
|
|
36033
|
+
|
|
36034
|
+
useEffect(function () {
|
|
36035
|
+
var loadOptions = /*#__PURE__*/function () {
|
|
36036
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
36037
|
+
var result, _t;
|
|
36038
|
+
return _regenerator().w(function (_context) {
|
|
36039
|
+
while (1) switch (_context.n) {
|
|
36040
|
+
case 0:
|
|
36041
|
+
if (!isOptionLoadFunction) {
|
|
36042
|
+
_context.n = 6;
|
|
36043
|
+
break;
|
|
36044
|
+
}
|
|
36045
|
+
setLoading(true);
|
|
36046
|
+
_context.p = 1;
|
|
36047
|
+
_context.n = 2;
|
|
36048
|
+
return options();
|
|
36049
|
+
case 2:
|
|
36050
|
+
result = _context.v;
|
|
36051
|
+
setLoadedOptions(Array.isArray(result.options) ? result.options : []);
|
|
36052
|
+
_context.n = 4;
|
|
36053
|
+
break;
|
|
36054
|
+
case 3:
|
|
36055
|
+
_context.p = 3;
|
|
36056
|
+
_t = _context.v;
|
|
36057
|
+
console.error('Erreur lors du chargement des options:', _t);
|
|
36058
|
+
case 4:
|
|
36059
|
+
_context.p = 4;
|
|
36060
|
+
setLoading(false);
|
|
36061
|
+
return _context.f(4);
|
|
36062
|
+
case 5:
|
|
36063
|
+
_context.n = 7;
|
|
36064
|
+
break;
|
|
36065
|
+
case 6:
|
|
36066
|
+
setLoadedOptions(options);
|
|
36067
|
+
case 7:
|
|
36068
|
+
return _context.a(2);
|
|
36069
|
+
}
|
|
36070
|
+
}, _callee, null, [[1, 3, 4, 5]]);
|
|
36071
|
+
}));
|
|
36072
|
+
return function loadOptions() {
|
|
36073
|
+
return _ref2.apply(this, arguments);
|
|
36074
|
+
};
|
|
36075
|
+
}();
|
|
36076
|
+
loadOptions();
|
|
36077
|
+
}, [options, isOptionLoadFunction]);
|
|
35874
36078
|
useEffect(function () {
|
|
35875
36079
|
setOptionSelected(value !== null && value !== void 0 ? value : null);
|
|
35876
36080
|
}, [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
36081
|
var style = {
|
|
35913
36082
|
border: invalid ? '1px solid red' : '1px solid #ccc',
|
|
35914
36083
|
width: '100%'
|
|
@@ -35918,7 +36087,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35918
36087
|
var g = parseInt(hexColor.substr(3, 2), 16);
|
|
35919
36088
|
var b = parseInt(hexColor.substr(5, 2), 16);
|
|
35920
36089
|
var luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
35921
|
-
return luminance > 0.
|
|
36090
|
+
return luminance > 0.18 ? '#000000' : '#FFFFFF';
|
|
35922
36091
|
};
|
|
35923
36092
|
var optionTemplate = function optionTemplate(option) {
|
|
35924
36093
|
if (!isSelectMeta) {
|
|
@@ -35928,9 +36097,9 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35928
36097
|
}, optionStyle)
|
|
35929
36098
|
}, option === null || option === void 0 ? void 0 : option[optionLabel]);
|
|
35930
36099
|
} else {
|
|
35931
|
-
var
|
|
35932
|
-
labelStyle =
|
|
35933
|
-
generalIcon =
|
|
36100
|
+
var _ref3 = selectMetaConfig || {},
|
|
36101
|
+
labelStyle = _ref3.labelStyle,
|
|
36102
|
+
generalIcon = _ref3.generalIcon;
|
|
35934
36103
|
var styleLabel = {
|
|
35935
36104
|
marginLeft: '10px'
|
|
35936
36105
|
};
|
|
@@ -35960,7 +36129,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35960
36129
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
35961
36130
|
style: _objectSpread2({
|
|
35962
36131
|
backgroundColor: option === null || option === void 0 ? void 0 : option.color,
|
|
35963
|
-
color:
|
|
36132
|
+
color: iconColor,
|
|
35964
36133
|
padding: '0.5rem',
|
|
35965
36134
|
borderRadius: '1rem',
|
|
35966
36135
|
display: 'inline-block'
|
|
@@ -35983,25 +36152,52 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35983
36152
|
}, (option === null || option === void 0 ? void 0 : option[optionLabel]) || placeholder);
|
|
35984
36153
|
}
|
|
35985
36154
|
};
|
|
35986
|
-
var onLazyLoad = function
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
|
|
35990
|
-
|
|
35991
|
-
|
|
35992
|
-
|
|
35993
|
-
|
|
35994
|
-
|
|
35995
|
-
|
|
35996
|
-
|
|
35997
|
-
|
|
35998
|
-
|
|
35999
|
-
|
|
36000
|
-
|
|
36001
|
-
|
|
36002
|
-
|
|
36003
|
-
|
|
36004
|
-
|
|
36155
|
+
var onLazyLoad = /*#__PURE__*/function () {
|
|
36156
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(event) {
|
|
36157
|
+
var _event$filter;
|
|
36158
|
+
var search, _res$options, _res$additional$page, _res$additional, res, newOptions, _t2;
|
|
36159
|
+
return _regenerator().w(function (_context2) {
|
|
36160
|
+
while (1) switch (_context2.n) {
|
|
36161
|
+
case 0:
|
|
36162
|
+
if (isOptionLoadFunction) {
|
|
36163
|
+
_context2.n = 1;
|
|
36164
|
+
break;
|
|
36165
|
+
}
|
|
36166
|
+
return _context2.a(2);
|
|
36167
|
+
case 1:
|
|
36168
|
+
setLoading(true);
|
|
36169
|
+
search = (_event$filter = event === null || event === void 0 ? void 0 : event.filter) !== null && _event$filter !== void 0 ? _event$filter : '';
|
|
36170
|
+
_context2.p = 2;
|
|
36171
|
+
_context2.n = 3;
|
|
36172
|
+
return options(search, loadedOptions, {
|
|
36173
|
+
page: currentPageRef.current
|
|
36174
|
+
});
|
|
36175
|
+
case 3:
|
|
36176
|
+
res = _context2.v;
|
|
36177
|
+
newOptions = (_res$options = res === null || res === void 0 ? void 0 : res.options) !== null && _res$options !== void 0 ? _res$options : [];
|
|
36178
|
+
setLoadedOptions(function (prevOptions) {
|
|
36179
|
+
return [].concat(_toConsumableArray$6(prevOptions), _toConsumableArray$6(newOptions));
|
|
36180
|
+
});
|
|
36181
|
+
currentPageRef.current = (_res$additional$page = res === null || res === void 0 || (_res$additional = res.additional) === null || _res$additional === void 0 ? void 0 : _res$additional.page) !== null && _res$additional$page !== void 0 ? _res$additional$page : currentPageRef.current + 1;
|
|
36182
|
+
_context2.n = 5;
|
|
36183
|
+
break;
|
|
36184
|
+
case 4:
|
|
36185
|
+
_context2.p = 4;
|
|
36186
|
+
_t2 = _context2.v;
|
|
36187
|
+
console.error('Erreur lors du chargement des options:', _t2);
|
|
36188
|
+
case 5:
|
|
36189
|
+
_context2.p = 5;
|
|
36190
|
+
setLoading(false);
|
|
36191
|
+
return _context2.f(5);
|
|
36192
|
+
case 6:
|
|
36193
|
+
return _context2.a(2);
|
|
36194
|
+
}
|
|
36195
|
+
}, _callee2, null, [[2, 4, 5, 6]]);
|
|
36196
|
+
}));
|
|
36197
|
+
return function onLazyLoad(_x) {
|
|
36198
|
+
return _ref4.apply(this, arguments);
|
|
36199
|
+
};
|
|
36200
|
+
}();
|
|
36005
36201
|
var handleChange = function handleChange(e) {
|
|
36006
36202
|
var newValue = e.value;
|
|
36007
36203
|
setOptionSelected(newValue);
|
|
@@ -36010,22 +36206,19 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36010
36206
|
}
|
|
36011
36207
|
};
|
|
36012
36208
|
var groupedItemTemplate = function groupedItemTemplate(option) {
|
|
36013
|
-
var
|
|
36014
|
-
showImage =
|
|
36015
|
-
imageKey =
|
|
36016
|
-
imageStyle =
|
|
36017
|
-
showIcon =
|
|
36018
|
-
iconKey =
|
|
36019
|
-
labelStyle =
|
|
36020
|
-
generalIcon =
|
|
36021
|
-
generalImage =
|
|
36209
|
+
var _ref5 = groupedItemTemplateConfig || {},
|
|
36210
|
+
showImage = _ref5.showImage,
|
|
36211
|
+
imageKey = _ref5.imageKey,
|
|
36212
|
+
imageStyle = _ref5.imageStyle,
|
|
36213
|
+
showIcon = _ref5.showIcon,
|
|
36214
|
+
iconKey = _ref5.iconKey,
|
|
36215
|
+
labelStyle = _ref5.labelStyle,
|
|
36216
|
+
generalIcon = _ref5.generalIcon,
|
|
36217
|
+
generalImage = _ref5.generalImage;
|
|
36022
36218
|
var icon = option.value && option.value[iconKey];
|
|
36023
|
-
var styleLabel = {
|
|
36024
|
-
|
|
36025
|
-
|
|
36026
|
-
'marginLeft': '10px'
|
|
36027
|
-
};
|
|
36028
|
-
}
|
|
36219
|
+
var styleLabel = generalIcon || showImage && option[imageKey] || showIcon && icon ? {
|
|
36220
|
+
marginLeft: '10px'
|
|
36221
|
+
} : {};
|
|
36029
36222
|
if (option.group) {
|
|
36030
36223
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
36031
36224
|
className: "flex align-items-center"
|
|
@@ -36035,11 +36228,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36035
36228
|
fontWeight: 'bold'
|
|
36036
36229
|
}, labelStyle)
|
|
36037
36230
|
}, generalIcon && /*#__PURE__*/React__default.createElement("i", {
|
|
36231
|
+
className: generalIcon,
|
|
36038
36232
|
style: _objectSpread2({
|
|
36039
36233
|
fontSize: '15px',
|
|
36040
36234
|
fontWeight: 'bold'
|
|
36041
|
-
}, labelStyle)
|
|
36042
|
-
className: generalIcon
|
|
36235
|
+
}, labelStyle)
|
|
36043
36236
|
}), generalImage && /*#__PURE__*/React__default.createElement("img", {
|
|
36044
36237
|
alt: "General",
|
|
36045
36238
|
src: generalImage,
|
|
@@ -36057,11 +36250,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36057
36250
|
},
|
|
36058
36251
|
className: "mr-2"
|
|
36059
36252
|
}), showIcon && icon && /*#__PURE__*/React__default.createElement("i", {
|
|
36253
|
+
className: "mr-2 ".concat(icon),
|
|
36060
36254
|
style: _objectSpread2({
|
|
36061
36255
|
fontSize: '15px',
|
|
36062
36256
|
fontWeight: 'bold'
|
|
36063
|
-
}, labelStyle)
|
|
36064
|
-
className: 'mr-2 ' + icon
|
|
36257
|
+
}, labelStyle)
|
|
36065
36258
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
36066
36259
|
style: styleLabel
|
|
36067
36260
|
}, option.label)));
|
|
@@ -36071,7 +36264,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36071
36264
|
className: "flex flex-col gap-1"
|
|
36072
36265
|
}, /*#__PURE__*/React__default.createElement(Dropdown$1, _extends$A({
|
|
36073
36266
|
value: optionSelected,
|
|
36074
|
-
options:
|
|
36267
|
+
options: loadedOptions,
|
|
36075
36268
|
onChange: handleChange,
|
|
36076
36269
|
placeholder: placeholder,
|
|
36077
36270
|
disabled: disabled,
|
|
@@ -36081,13 +36274,12 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36081
36274
|
style: style,
|
|
36082
36275
|
itemTemplate: optionTemplate,
|
|
36083
36276
|
valueTemplate: valueTemplate,
|
|
36084
|
-
onHide: resetDropdownFilter,
|
|
36085
36277
|
showClear: showClear,
|
|
36086
36278
|
optionGroupTemplate: isGroupedOption ? groupedItemTemplate : null
|
|
36087
36279
|
}, isGroupedOption && {
|
|
36088
36280
|
optionGroupLabel: 'label',
|
|
36089
36281
|
optionGroupChildren: 'items'
|
|
36090
|
-
}, isSelectMeta && {
|
|
36282
|
+
}, (isSelectMeta || isOptionLoadFunction) && {
|
|
36091
36283
|
virtualScrollerOptions: {
|
|
36092
36284
|
lazy: true,
|
|
36093
36285
|
onLazyLoad: onLazyLoad,
|
|
@@ -36188,6 +36380,33 @@ var optionsWithColors = [{
|
|
|
36188
36380
|
value: 'cyan',
|
|
36189
36381
|
color: '#00FFFF'
|
|
36190
36382
|
}];
|
|
36383
|
+
var createFakeOptions = function createFakeOptions(start, length) {
|
|
36384
|
+
var options = [];
|
|
36385
|
+
for (var i = start; i < length; i++) {
|
|
36386
|
+
options.push({
|
|
36387
|
+
value: i,
|
|
36388
|
+
label: "Option ".concat(i)
|
|
36389
|
+
// Ajoutez d'autres propriétés si nécessaire
|
|
36390
|
+
});
|
|
36391
|
+
}
|
|
36392
|
+
return options;
|
|
36393
|
+
};
|
|
36394
|
+
var generateOptions = function generateOptions(length) {
|
|
36395
|
+
return Array.from({
|
|
36396
|
+
length: length
|
|
36397
|
+
}, function (_, i) {
|
|
36398
|
+
return {
|
|
36399
|
+
id: i,
|
|
36400
|
+
nom: "Option ".concat(i),
|
|
36401
|
+
color: '#ccc'
|
|
36402
|
+
};
|
|
36403
|
+
});
|
|
36404
|
+
};
|
|
36405
|
+
var simulateNetworkDelay = function simulateNetworkDelay() {
|
|
36406
|
+
return new Promise(function (res) {
|
|
36407
|
+
return setTimeout(res, 400);
|
|
36408
|
+
});
|
|
36409
|
+
};
|
|
36191
36410
|
var DropdownPresets = {
|
|
36192
36411
|
Default: {
|
|
36193
36412
|
placeholder: 'Sélectionnez une option',
|
|
@@ -36217,6 +36436,112 @@ var DropdownPresets = {
|
|
|
36217
36436
|
fontFamily: 'Arial'
|
|
36218
36437
|
}
|
|
36219
36438
|
},
|
|
36439
|
+
AsyncLoad: {
|
|
36440
|
+
placeholder: 'Chargement distant simulé',
|
|
36441
|
+
options: function () {
|
|
36442
|
+
var _options = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(search, loadedOptions, _ref) {
|
|
36443
|
+
var page, length, start, data;
|
|
36444
|
+
return _regenerator().w(function (_context) {
|
|
36445
|
+
while (1) switch (_context.n) {
|
|
36446
|
+
case 0:
|
|
36447
|
+
page = _ref.page;
|
|
36448
|
+
length = 20;
|
|
36449
|
+
start = (page - 1) * length; // Simule un délai réseau
|
|
36450
|
+
_context.n = 1;
|
|
36451
|
+
return new Promise(function (res) {
|
|
36452
|
+
return setTimeout(res, 500);
|
|
36453
|
+
});
|
|
36454
|
+
case 1:
|
|
36455
|
+
data = createFakeOptions(start, length);
|
|
36456
|
+
return _context.a(2, {
|
|
36457
|
+
options: data.map(function (opt) {
|
|
36458
|
+
return _objectSpread2(_objectSpread2({}, opt), {}, {
|
|
36459
|
+
label: opt.label,
|
|
36460
|
+
value: opt.value,
|
|
36461
|
+
color: 'blue'
|
|
36462
|
+
});
|
|
36463
|
+
}),
|
|
36464
|
+
hasMore: page * length < 100,
|
|
36465
|
+
additional: {
|
|
36466
|
+
page: page + 1
|
|
36467
|
+
}
|
|
36468
|
+
});
|
|
36469
|
+
}
|
|
36470
|
+
}, _callee);
|
|
36471
|
+
}));
|
|
36472
|
+
function options(_x, _x2, _x3) {
|
|
36473
|
+
return _options.apply(this, arguments);
|
|
36474
|
+
}
|
|
36475
|
+
return options;
|
|
36476
|
+
}(),
|
|
36477
|
+
selectMetaConfig: {
|
|
36478
|
+
generalIcon: 'pi pi-circle-fill'
|
|
36479
|
+
},
|
|
36480
|
+
isSelectMeta: true,
|
|
36481
|
+
valueStyle: {
|
|
36482
|
+
fontSize: '14px',
|
|
36483
|
+
fontFamily: 'Arial'
|
|
36484
|
+
},
|
|
36485
|
+
optionStyle: {
|
|
36486
|
+
fontSize: '14px',
|
|
36487
|
+
fontFamily: 'Arial'
|
|
36488
|
+
}
|
|
36489
|
+
},
|
|
36490
|
+
AsyncSearch: {
|
|
36491
|
+
placeholder: 'Recherchez une option...',
|
|
36492
|
+
filter: true,
|
|
36493
|
+
options: function () {
|
|
36494
|
+
var _options2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(search, loadedOptions, _ref2) {
|
|
36495
|
+
var page, length, allOptions, filteredOptions, start, pageSlice;
|
|
36496
|
+
return _regenerator().w(function (_context2) {
|
|
36497
|
+
while (1) switch (_context2.n) {
|
|
36498
|
+
case 0:
|
|
36499
|
+
page = _ref2.page;
|
|
36500
|
+
length = 10;
|
|
36501
|
+
_context2.n = 1;
|
|
36502
|
+
return simulateNetworkDelay();
|
|
36503
|
+
case 1:
|
|
36504
|
+
// Générer toutes les options possibles
|
|
36505
|
+
allOptions = generateOptions(100); // Filtrer les options en fonction de la recherche
|
|
36506
|
+
filteredOptions = allOptions.filter(function (opt) {
|
|
36507
|
+
return opt.nom.toLowerCase().includes(search.toLowerCase());
|
|
36508
|
+
}); // Pagination des résultats filtrés
|
|
36509
|
+
start = (page - 1) * length;
|
|
36510
|
+
pageSlice = filteredOptions.slice(start, start + length);
|
|
36511
|
+
return _context2.a(2, {
|
|
36512
|
+
options: pageSlice.map(function (opt) {
|
|
36513
|
+
return _objectSpread2(_objectSpread2({}, opt), {}, {
|
|
36514
|
+
label: opt.nom,
|
|
36515
|
+
value: opt.id,
|
|
36516
|
+
color: 'red'
|
|
36517
|
+
});
|
|
36518
|
+
}),
|
|
36519
|
+
hasMore: start + length < filteredOptions.length,
|
|
36520
|
+
additional: {
|
|
36521
|
+
page: page + 1
|
|
36522
|
+
}
|
|
36523
|
+
});
|
|
36524
|
+
}
|
|
36525
|
+
}, _callee2);
|
|
36526
|
+
}));
|
|
36527
|
+
function options(_x4, _x5, _x6) {
|
|
36528
|
+
return _options2.apply(this, arguments);
|
|
36529
|
+
}
|
|
36530
|
+
return options;
|
|
36531
|
+
}(),
|
|
36532
|
+
isSelectMeta: true,
|
|
36533
|
+
selectMetaConfig: {
|
|
36534
|
+
generalIcon: 'pi pi-search'
|
|
36535
|
+
},
|
|
36536
|
+
valueStyle: {
|
|
36537
|
+
fontSize: '14px',
|
|
36538
|
+
fontFamily: 'Arial'
|
|
36539
|
+
},
|
|
36540
|
+
optionStyle: {
|
|
36541
|
+
fontSize: '14px',
|
|
36542
|
+
fontFamily: 'Arial'
|
|
36543
|
+
}
|
|
36544
|
+
},
|
|
36220
36545
|
Group: {
|
|
36221
36546
|
placeholder: 'Veuillez choisir une option',
|
|
36222
36547
|
options: optionsGroup,
|