arengibook 3.1.2913-main → 3.1.2914-main
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 +185 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37068,6 +37068,7 @@ var DropdownSelectMetaAsync = function DropdownSelectMetaAsync(_ref) {
|
|
|
37068
37068
|
var dropdownRef = useRef(null);
|
|
37069
37069
|
useRef(null);
|
|
37070
37070
|
var clickedFromList = useRef(false);
|
|
37071
|
+
var panelListenersRef = useRef([]);
|
|
37071
37072
|
var _useState9 = useState(''),
|
|
37072
37073
|
_useState0 = _slicedToArray$d(_useState9, 2),
|
|
37073
37074
|
inputText = _useState0[0];
|
|
@@ -37181,6 +37182,14 @@ var DropdownSelectMetaAsync = function DropdownSelectMetaAsync(_ref) {
|
|
|
37181
37182
|
}
|
|
37182
37183
|
};
|
|
37183
37184
|
}, [dropdownRef.current]);
|
|
37185
|
+
var repositionPanel = function repositionPanel() {
|
|
37186
|
+
var panel = document.querySelector('.p-dropdown-panel.p-component');
|
|
37187
|
+
if (!panel || !dropdownRef.current) return;
|
|
37188
|
+
var rect = dropdownRef.current.getBoundingClientRect();
|
|
37189
|
+
var scrollY = window.scrollY || window.pageYOffset;
|
|
37190
|
+
panel.style.top = rect.bottom + scrollY + 'px';
|
|
37191
|
+
panel.style.left = rect.left + window.scrollX + 'px';
|
|
37192
|
+
};
|
|
37184
37193
|
var handleChange = function handleChange(e) {
|
|
37185
37194
|
setOptionSelected(e.value);
|
|
37186
37195
|
if (clickedFromList.current) {
|
|
@@ -37363,6 +37372,43 @@ var DropdownSelectMetaAsync = function DropdownSelectMetaAsync(_ref) {
|
|
|
37363
37372
|
maxHeight: 'auto',
|
|
37364
37373
|
overflowY: 'auto'
|
|
37365
37374
|
},
|
|
37375
|
+
onShow: function onShow() {
|
|
37376
|
+
var _dropdownRef$current2;
|
|
37377
|
+
var el = (_dropdownRef$current2 = dropdownRef.current) === null || _dropdownRef$current2 === void 0 ? void 0 : _dropdownRef$current2.parentElement;
|
|
37378
|
+
while (el) {
|
|
37379
|
+
var _style = window.getComputedStyle(el);
|
|
37380
|
+
if (/auto|scroll/.test(_style.overflow + _style.overflowX + _style.overflowY)) {
|
|
37381
|
+
el.addEventListener('scroll', repositionPanel, {
|
|
37382
|
+
passive: true
|
|
37383
|
+
});
|
|
37384
|
+
panelListenersRef.current.push({
|
|
37385
|
+
element: el,
|
|
37386
|
+
handler: repositionPanel
|
|
37387
|
+
});
|
|
37388
|
+
}
|
|
37389
|
+
el = el.parentElement;
|
|
37390
|
+
}
|
|
37391
|
+
window.addEventListener('scroll', repositionPanel, {
|
|
37392
|
+
passive: true,
|
|
37393
|
+
capture: true
|
|
37394
|
+
});
|
|
37395
|
+
panelListenersRef.current.push({
|
|
37396
|
+
element: window,
|
|
37397
|
+
handler: repositionPanel,
|
|
37398
|
+
capture: true
|
|
37399
|
+
});
|
|
37400
|
+
},
|
|
37401
|
+
onHide: function onHide() {
|
|
37402
|
+
panelListenersRef.current.forEach(function (_ref5) {
|
|
37403
|
+
var element = _ref5.element,
|
|
37404
|
+
handler = _ref5.handler,
|
|
37405
|
+
capture = _ref5.capture;
|
|
37406
|
+
element.removeEventListener('scroll', handler, {
|
|
37407
|
+
capture: !!capture
|
|
37408
|
+
});
|
|
37409
|
+
});
|
|
37410
|
+
panelListenersRef.current = [];
|
|
37411
|
+
},
|
|
37366
37412
|
dropdownMode: "current",
|
|
37367
37413
|
itemTemplate: optionTemplate,
|
|
37368
37414
|
valueTemplate: valueTemplate,
|
|
@@ -37536,6 +37582,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
37536
37582
|
var dropdownComposantRef = useRef(null);
|
|
37537
37583
|
var containerRef = useRef(null);
|
|
37538
37584
|
var didMountRef = useRef(false);
|
|
37585
|
+
var panelListenersRef = useRef([]);
|
|
37539
37586
|
var clickedFromList = useRef(false);
|
|
37540
37587
|
var currentPageRef = useRef(1);
|
|
37541
37588
|
var filterRef = useRef('');
|
|
@@ -37672,6 +37719,14 @@ var Dropdown = function Dropdown(props) {
|
|
|
37672
37719
|
var handleHide = function handleHide() {
|
|
37673
37720
|
return setIsDropdownOpen(false);
|
|
37674
37721
|
};
|
|
37722
|
+
var repositionPanel = function repositionPanel() {
|
|
37723
|
+
var panel = document.querySelector('.p-dropdown-panel.p-component');
|
|
37724
|
+
if (!panel || !containerRef.current) return;
|
|
37725
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
37726
|
+
var scrollY = window.scrollY || window.pageYOffset;
|
|
37727
|
+
panel.style.top = rect.bottom + scrollY + 'px';
|
|
37728
|
+
panel.style.left = rect.left + window.scrollX + 'px';
|
|
37729
|
+
};
|
|
37675
37730
|
var handleChange = function handleChange(e) {
|
|
37676
37731
|
if (readOnly) return;
|
|
37677
37732
|
var newValue = e.value;
|
|
@@ -38211,14 +38266,34 @@ var Dropdown = function Dropdown(props) {
|
|
|
38211
38266
|
optionGroupChildren: 'items'
|
|
38212
38267
|
}, {
|
|
38213
38268
|
onShow: function onShow() {
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38219
|
-
|
|
38220
|
-
|
|
38269
|
+
var _containerRef$current;
|
|
38270
|
+
var el = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.parentElement;
|
|
38271
|
+
while (el) {
|
|
38272
|
+
var _style3 = window.getComputedStyle(el);
|
|
38273
|
+
if (/auto|scroll/.test(_style3.overflow + _style3.overflowX + _style3.overflowY)) {
|
|
38274
|
+
el.addEventListener('scroll', repositionPanel, {
|
|
38275
|
+
passive: true
|
|
38276
|
+
});
|
|
38277
|
+
panelListenersRef.current.push({
|
|
38278
|
+
element: el,
|
|
38279
|
+
handler: repositionPanel
|
|
38280
|
+
});
|
|
38281
|
+
}
|
|
38282
|
+
el = el.parentElement;
|
|
38221
38283
|
}
|
|
38284
|
+
window.addEventListener('scroll', repositionPanel, {
|
|
38285
|
+
passive: true,
|
|
38286
|
+
capture: true
|
|
38287
|
+
});
|
|
38288
|
+
panelListenersRef.current.push({
|
|
38289
|
+
element: window,
|
|
38290
|
+
handler: repositionPanel,
|
|
38291
|
+
capture: true
|
|
38292
|
+
});
|
|
38293
|
+
if (isGroupedOption && showTooltipGroup) handleShow();
|
|
38294
|
+
if (enableItemTooltip) setTooltipKey(function (k) {
|
|
38295
|
+
return k + 1;
|
|
38296
|
+
});
|
|
38222
38297
|
if (filter) {
|
|
38223
38298
|
setTimeout(function () {
|
|
38224
38299
|
var filterInput = document.querySelector('.dropdownbook .p-dropdown-filter');
|
|
@@ -38228,6 +38303,15 @@ var Dropdown = function Dropdown(props) {
|
|
|
38228
38303
|
},
|
|
38229
38304
|
onHide: function onHide() {
|
|
38230
38305
|
var _dropdownComposantRef4;
|
|
38306
|
+
panelListenersRef.current.forEach(function (_ref5) {
|
|
38307
|
+
var element = _ref5.element,
|
|
38308
|
+
handler = _ref5.handler,
|
|
38309
|
+
capture = _ref5.capture;
|
|
38310
|
+
element.removeEventListener('scroll', handler, {
|
|
38311
|
+
capture: !!capture
|
|
38312
|
+
});
|
|
38313
|
+
});
|
|
38314
|
+
panelListenersRef.current = [];
|
|
38231
38315
|
if (isGroupedOption && showTooltipGroup) handleHide();
|
|
38232
38316
|
(_dropdownComposantRef4 = dropdownComposantRef.current) === null || _dropdownComposantRef4 === void 0 || (_dropdownComposantRef4 = _dropdownComposantRef4.getElement()) === null || _dropdownComposantRef4 === void 0 || (_dropdownComposantRef4 = _dropdownComposantRef4.querySelector('.p-dropdown-label')) === null || _dropdownComposantRef4 === void 0 || _dropdownComposantRef4.blur();
|
|
38233
38317
|
},
|
|
@@ -41115,7 +41199,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41115
41199
|
valueToapply = _ref.valueToapply,
|
|
41116
41200
|
_ref$closeIcon = _ref.closeIcon,
|
|
41117
41201
|
closeIcon = _ref$closeIcon === void 0 ? null : _ref$closeIcon,
|
|
41118
|
-
|
|
41202
|
+
_onHide = _ref.onHide;
|
|
41119
41203
|
_ref.withSearch;
|
|
41120
41204
|
_ref.renderValue;
|
|
41121
41205
|
_ref.onModeChange;
|
|
@@ -41138,6 +41222,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41138
41222
|
var loadedOptionsRef = useRef([]);
|
|
41139
41223
|
var multiSelectRef = useRef(null);
|
|
41140
41224
|
var containerRef = useRef(null);
|
|
41225
|
+
var panelListenersRef = useRef([]);
|
|
41141
41226
|
var _useState5 = useState(false),
|
|
41142
41227
|
_useState6 = _slicedToArray$d(_useState5, 2),
|
|
41143
41228
|
loading = _useState6[0],
|
|
@@ -41395,6 +41480,14 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41395
41480
|
return k + 1;
|
|
41396
41481
|
});
|
|
41397
41482
|
}, [loadedOptions, enableItemTooltip]);
|
|
41483
|
+
var repositionPanel = function repositionPanel() {
|
|
41484
|
+
var panel = document.querySelector('.p-multiselect-panel.p-component');
|
|
41485
|
+
if (!panel || !containerRef.current) return;
|
|
41486
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
41487
|
+
var scrollY = window.scrollY || window.pageYOffset;
|
|
41488
|
+
panel.style.top = rect.bottom + scrollY + 'px';
|
|
41489
|
+
panel.style.left = rect.left + window.scrollX + 'px';
|
|
41490
|
+
};
|
|
41398
41491
|
var onLazyLoad = function onLazyLoad(event) {
|
|
41399
41492
|
if (isOptionsArray) return;
|
|
41400
41493
|
setLoading(true);
|
|
@@ -42227,11 +42320,46 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
42227
42320
|
selectedItemsLabel: '{0} éléments sélectionnés'
|
|
42228
42321
|
}, {
|
|
42229
42322
|
onShow: function onShow() {
|
|
42323
|
+
var _containerRef$current;
|
|
42324
|
+
var el = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.parentElement;
|
|
42325
|
+
while (el) {
|
|
42326
|
+
var _style = window.getComputedStyle(el);
|
|
42327
|
+
if (/auto|scroll/.test(_style.overflow + _style.overflowX + _style.overflowY)) {
|
|
42328
|
+
el.addEventListener('scroll', repositionPanel, {
|
|
42329
|
+
passive: true
|
|
42330
|
+
});
|
|
42331
|
+
panelListenersRef.current.push({
|
|
42332
|
+
element: el,
|
|
42333
|
+
handler: repositionPanel
|
|
42334
|
+
});
|
|
42335
|
+
}
|
|
42336
|
+
el = el.parentElement;
|
|
42337
|
+
}
|
|
42338
|
+
window.addEventListener('scroll', repositionPanel, {
|
|
42339
|
+
passive: true,
|
|
42340
|
+
capture: true
|
|
42341
|
+
});
|
|
42342
|
+
panelListenersRef.current.push({
|
|
42343
|
+
element: window,
|
|
42344
|
+
handler: repositionPanel,
|
|
42345
|
+
capture: true
|
|
42346
|
+
});
|
|
42230
42347
|
if (enableItemTooltip) setTooltipKey(function (k) {
|
|
42231
42348
|
return k + 1;
|
|
42232
42349
|
});
|
|
42233
42350
|
},
|
|
42234
|
-
onHide: onHide
|
|
42351
|
+
onHide: function onHide() {
|
|
42352
|
+
panelListenersRef.current.forEach(function (_ref1) {
|
|
42353
|
+
var element = _ref1.element,
|
|
42354
|
+
handler = _ref1.handler,
|
|
42355
|
+
capture = _ref1.capture;
|
|
42356
|
+
element.removeEventListener('scroll', handler, {
|
|
42357
|
+
capture: !!capture
|
|
42358
|
+
});
|
|
42359
|
+
});
|
|
42360
|
+
panelListenersRef.current = [];
|
|
42361
|
+
if (_onHide) _onHide();
|
|
42362
|
+
},
|
|
42235
42363
|
onMouseDown: function onMouseDown() {
|
|
42236
42364
|
if (enableItemTooltip) setTooltipKey(function (k) {
|
|
42237
42365
|
return k + 1;
|
|
@@ -42454,7 +42582,7 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
42454
42582
|
truncateAt = props.truncateAt,
|
|
42455
42583
|
_props$subItem = props.subItem,
|
|
42456
42584
|
subItem = _props$subItem === void 0 ? false : _props$subItem,
|
|
42457
|
-
|
|
42585
|
+
_onHide = props.onHide,
|
|
42458
42586
|
_props$required = props.required,
|
|
42459
42587
|
required = _props$required === void 0 ? false : _props$required;
|
|
42460
42588
|
var isAsyncOptions = typeof options === 'function' || optionsUrl;
|
|
@@ -42493,6 +42621,7 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
42493
42621
|
var multiSelectRef = useRef(null);
|
|
42494
42622
|
var containerRef = useRef(null);
|
|
42495
42623
|
var didMountRef = useRef(false);
|
|
42624
|
+
var panelListenersRef = useRef([]);
|
|
42496
42625
|
var _useState1 = useState(null),
|
|
42497
42626
|
_useState10 = _slicedToArray$d(_useState1, 2),
|
|
42498
42627
|
sortOrder = _useState10[0],
|
|
@@ -42565,6 +42694,14 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
42565
42694
|
};
|
|
42566
42695
|
}, []);
|
|
42567
42696
|
useEffect(function () {}, []);
|
|
42697
|
+
var repositionPanel = function repositionPanel() {
|
|
42698
|
+
var panel = document.querySelector('.p-multiselect-panel.p-component');
|
|
42699
|
+
if (!panel || !containerRef.current) return;
|
|
42700
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
42701
|
+
var scrollY = window.scrollY || window.pageYOffset;
|
|
42702
|
+
panel.style.top = rect.bottom + scrollY + 'px';
|
|
42703
|
+
panel.style.left = rect.left + window.scrollX + 'px';
|
|
42704
|
+
};
|
|
42568
42705
|
var toggleGroupCollapse = function toggleGroupCollapse(groupLabel) {
|
|
42569
42706
|
setCollapsedGroups(function (prev) {
|
|
42570
42707
|
if (prev.includes(groupLabel)) {
|
|
@@ -43462,13 +43599,46 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
43462
43599
|
}))))
|
|
43463
43600
|
}), {
|
|
43464
43601
|
onShow: function onShow() {
|
|
43465
|
-
|
|
43466
|
-
|
|
43467
|
-
|
|
43468
|
-
|
|
43602
|
+
var _containerRef$current;
|
|
43603
|
+
var el = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.parentElement;
|
|
43604
|
+
while (el) {
|
|
43605
|
+
var _style = window.getComputedStyle(el);
|
|
43606
|
+
if (/auto|scroll/.test(_style.overflow + _style.overflowX + _style.overflowY)) {
|
|
43607
|
+
el.addEventListener('scroll', repositionPanel, {
|
|
43608
|
+
passive: true
|
|
43609
|
+
});
|
|
43610
|
+
panelListenersRef.current.push({
|
|
43611
|
+
element: el,
|
|
43612
|
+
handler: repositionPanel
|
|
43613
|
+
});
|
|
43614
|
+
}
|
|
43615
|
+
el = el.parentElement;
|
|
43469
43616
|
}
|
|
43617
|
+
window.addEventListener('scroll', repositionPanel, {
|
|
43618
|
+
passive: true,
|
|
43619
|
+
capture: true
|
|
43620
|
+
});
|
|
43621
|
+
panelListenersRef.current.push({
|
|
43622
|
+
element: window,
|
|
43623
|
+
handler: repositionPanel,
|
|
43624
|
+
capture: true
|
|
43625
|
+
});
|
|
43626
|
+
if (enableItemTooltip) setTooltipKey(function (k) {
|
|
43627
|
+
return k + 1;
|
|
43628
|
+
});
|
|
43629
|
+
},
|
|
43630
|
+
onHide: function onHide() {
|
|
43631
|
+
panelListenersRef.current.forEach(function (_ref5) {
|
|
43632
|
+
var element = _ref5.element,
|
|
43633
|
+
handler = _ref5.handler,
|
|
43634
|
+
capture = _ref5.capture;
|
|
43635
|
+
element.removeEventListener('scroll', handler, {
|
|
43636
|
+
capture: !!capture
|
|
43637
|
+
});
|
|
43638
|
+
});
|
|
43639
|
+
panelListenersRef.current = [];
|
|
43640
|
+
if (_onHide) _onHide();
|
|
43470
43641
|
},
|
|
43471
|
-
onHide: onHide,
|
|
43472
43642
|
onMouseDown: function onMouseDown() {
|
|
43473
43643
|
if (enableItemTooltip) setTooltipKey(function (k) {
|
|
43474
43644
|
return k + 1;
|