primereact 10.0.0 → 10.0.1
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/README.md +1 -1
- package/componentbase/componentbase.cjs.js +12 -7
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.min.mjs +1 -1
- package/componentbase/componentbase.esm.mjs +12 -7
- package/componentbase/componentbase.js +12 -7
- package/componentbase/componentbase.min.js +1 -1
- package/core/core.js +12 -7
- package/core/core.min.js +1 -1
- package/package.json +1 -1
- package/primereact.all.cjs.js +12 -7
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.min.mjs +1 -1
- package/primereact.all.esm.mjs +12 -7
- package/primereact.all.js +12 -7
- package/primereact.all.min.js +1 -1
- package/web-types.json +1 -1
- package/accordion/accordion.esm.js +0 -421
- package/accordion/accordion.esm.min.js +0 -1
- package/api/api.esm.js +0 -944
- package/api/api.esm.min.js +0 -1
- package/autocomplete/autocomplete.esm.js +0 -1127
- package/autocomplete/autocomplete.esm.min.js +0 -1
- package/avatar/avatar.esm.js +0 -245
- package/avatar/avatar.esm.min.js +0 -1
- package/avatargroup/avatargroup.esm.js +0 -55
- package/avatargroup/avatargroup.esm.min.js +0 -1
- package/badge/badge.esm.js +0 -110
- package/badge/badge.esm.min.js +0 -1
- package/blockui/blockui.esm.js +0 -265
- package/blockui/blockui.esm.min.js +0 -1
- package/breadcrumb/breadcrumb.esm.js +0 -351
- package/breadcrumb/breadcrumb.esm.min.js +0 -1
- package/button/button.esm.js +0 -295
- package/button/button.esm.min.js +0 -1
- package/calendar/calendar.esm.js +0 -3473
- package/calendar/calendar.esm.min.js +0 -1
- package/card/card.esm.js +0 -98
- package/card/card.esm.min.js +0 -1
- package/carousel/carousel.esm.js +0 -801
- package/carousel/carousel.esm.min.js +0 -1
- package/cascadeselect/cascadeselect.esm.js +0 -819
- package/cascadeselect/cascadeselect.esm.min.js +0 -1
- package/chart/chart.esm.js +0 -155
- package/chart/chart.esm.min.js +0 -1
- package/checkbox/checkbox.esm.js +0 -357
- package/checkbox/checkbox.esm.min.js +0 -1
- package/chip/chip.esm.js +0 -248
- package/chip/chip.esm.min.js +0 -1
- package/chips/chips.esm.js +0 -501
- package/chips/chips.esm.min.js +0 -1
- package/colorpicker/colorpicker.esm.js +0 -788
- package/colorpicker/colorpicker.esm.min.js +0 -1
- package/column/column.esm.js +0 -8
- package/column/column.esm.min.js +0 -1
- package/columngroup/columngroup.esm.js +0 -6
- package/columngroup/columngroup.esm.min.js +0 -1
- package/componentbase/componentbase.esm.js +0 -323
- package/componentbase/componentbase.esm.min.js +0 -1
- package/confirmdialog/confirmdialog.esm.js +0 -376
- package/confirmdialog/confirmdialog.esm.min.js +0 -1
- package/confirmpopup/confirmpopup.esm.js +0 -610
- package/confirmpopup/confirmpopup.esm.min.js +0 -1
- package/contextmenu/contextmenu.esm.js +0 -664
- package/contextmenu/contextmenu.esm.min.js +0 -1
- package/csstransition/csstransition.esm.js +0 -138
- package/csstransition/csstransition.esm.min.js +0 -1
- package/datascroller/datascroller.esm.js +0 -320
- package/datascroller/datascroller.esm.min.js +0 -1
- package/datatable/datatable.esm.js +0 -6636
- package/datatable/datatable.esm.min.js +0 -1
- package/dataview/dataview.esm.js +0 -506
- package/dataview/dataview.esm.min.js +0 -1
- package/deferredcontent/deferredcontent.esm.js +0 -133
- package/deferredcontent/deferredcontent.esm.min.js +0 -1
- package/dialog/dialog.esm.js +0 -983
- package/dialog/dialog.esm.min.js +0 -1
- package/divider/divider.esm.js +0 -79
- package/divider/divider.esm.min.js +0 -1
- package/dock/dock.esm.js +0 -348
- package/dock/dock.esm.min.js +0 -1
- package/dropdown/dropdown.esm.js +0 -1380
- package/dropdown/dropdown.esm.min.js +0 -1
- package/editor/editor.esm.js +0 -338
- package/editor/editor.esm.min.js +0 -1
- package/fieldset/fieldset.esm.js +0 -270
- package/fieldset/fieldset.esm.min.js +0 -1
- package/fileupload/fileupload.esm.js +0 -1005
- package/fileupload/fileupload.esm.min.js +0 -1
- package/galleria/galleria.esm.js +0 -1090
- package/galleria/galleria.esm.min.js +0 -1
- package/hooks/hooks.esm.js +0 -1042
- package/hooks/hooks.esm.min.js +0 -1
- package/iconbase/iconbase.esm.js +0 -33
- package/iconbase/iconbase.esm.min.js +0 -1
- package/icons/angledoubledown/index.esm.js +0 -39
- package/icons/angledoubledown/index.esm.min.js +0 -1
- package/icons/angledoubleleft/index.esm.js +0 -39
- package/icons/angledoubleleft/index.esm.min.js +0 -1
- package/icons/angledoubleright/index.esm.js +0 -39
- package/icons/angledoubleright/index.esm.min.js +0 -1
- package/icons/angledoubleup/index.esm.js +0 -39
- package/icons/angledoubleup/index.esm.min.js +0 -1
- package/icons/angledown/index.esm.js +0 -37
- package/icons/angledown/index.esm.min.js +0 -1
- package/icons/angleleft/index.esm.js +0 -37
- package/icons/angleleft/index.esm.min.js +0 -1
- package/icons/angleright/index.esm.js +0 -37
- package/icons/angleright/index.esm.min.js +0 -1
- package/icons/angleup/index.esm.js +0 -37
- package/icons/angleup/index.esm.min.js +0 -1
- package/icons/arrowdown/index.esm.js +0 -661
- package/icons/arrowdown/index.esm.min.js +0 -1
- package/icons/arrowup/index.esm.js +0 -661
- package/icons/arrowup/index.esm.min.js +0 -1
- package/icons/ban/index.esm.js +0 -659
- package/icons/ban/index.esm.min.js +0 -1
- package/icons/bars/index.esm.js +0 -39
- package/icons/bars/index.esm.min.js +0 -1
- package/icons/calendar/index.esm.js +0 -37
- package/icons/calendar/index.esm.min.js +0 -1
- package/icons/check/index.esm.js +0 -37
- package/icons/check/index.esm.min.js +0 -1
- package/icons/chevrondown/index.esm.js +0 -37
- package/icons/chevrondown/index.esm.min.js +0 -1
- package/icons/chevronleft/index.esm.js +0 -37
- package/icons/chevronleft/index.esm.min.js +0 -1
- package/icons/chevronright/index.esm.js +0 -37
- package/icons/chevronright/index.esm.min.js +0 -1
- package/icons/chevronup/index.esm.js +0 -37
- package/icons/chevronup/index.esm.min.js +0 -1
- package/icons/download/index.esm.js +0 -661
- package/icons/download/index.esm.min.js +0 -1
- package/icons/exclamationtriangle/index.esm.js +0 -665
- package/icons/exclamationtriangle/index.esm.min.js +0 -1
- package/icons/eye/index.esm.js +0 -39
- package/icons/eye/index.esm.min.js +0 -1
- package/icons/eyeslash/index.esm.js +0 -661
- package/icons/eyeslash/index.esm.min.js +0 -1
- package/icons/filter/index.esm.js +0 -659
- package/icons/filter/index.esm.min.js +0 -1
- package/icons/filterslash/index.esm.js +0 -661
- package/icons/filterslash/index.esm.min.js +0 -1
- package/icons/infocircle/index.esm.js +0 -661
- package/icons/infocircle/index.esm.min.js +0 -1
- package/icons/minus/index.esm.js +0 -37
- package/icons/minus/index.esm.min.js +0 -1
- package/icons/pencil/index.esm.js +0 -659
- package/icons/pencil/index.esm.min.js +0 -1
- package/icons/plus/index.esm.js +0 -659
- package/icons/plus/index.esm.min.js +0 -1
- package/icons/refresh/index.esm.js +0 -661
- package/icons/refresh/index.esm.min.js +0 -1
- package/icons/search/index.esm.js +0 -661
- package/icons/search/index.esm.min.js +0 -1
- package/icons/searchminus/index.esm.js +0 -661
- package/icons/searchminus/index.esm.min.js +0 -1
- package/icons/searchplus/index.esm.js +0 -661
- package/icons/searchplus/index.esm.min.js +0 -1
- package/icons/sortalt/index.esm.js +0 -668
- package/icons/sortalt/index.esm.min.js +0 -1
- package/icons/sortamountdown/index.esm.js +0 -674
- package/icons/sortamountdown/index.esm.min.js +0 -1
- package/icons/sortamountupalt/index.esm.js +0 -674
- package/icons/sortamountupalt/index.esm.min.js +0 -1
- package/icons/spinner/index.esm.js +0 -659
- package/icons/spinner/index.esm.min.js +0 -1
- package/icons/star/index.esm.js +0 -659
- package/icons/star/index.esm.min.js +0 -1
- package/icons/starfill/index.esm.js +0 -659
- package/icons/starfill/index.esm.min.js +0 -1
- package/icons/thlarge/index.esm.js +0 -661
- package/icons/thlarge/index.esm.min.js +0 -1
- package/icons/times/index.esm.js +0 -37
- package/icons/times/index.esm.min.js +0 -1
- package/icons/timescircle/index.esm.js +0 -661
- package/icons/timescircle/index.esm.min.js +0 -1
- package/icons/trash/index.esm.js +0 -661
- package/icons/trash/index.esm.min.js +0 -1
- package/icons/undo/index.esm.js +0 -661
- package/icons/undo/index.esm.min.js +0 -1
- package/icons/upload/index.esm.js +0 -661
- package/icons/upload/index.esm.min.js +0 -1
- package/icons/windowmaximize/index.esm.js +0 -661
- package/icons/windowmaximize/index.esm.min.js +0 -1
- package/icons/windowminimize/index.esm.js +0 -661
- package/icons/windowminimize/index.esm.min.js +0 -1
- package/image/image.esm.js +0 -1162
- package/image/image.esm.min.js +0 -1
- package/inplace/inplace.esm.js +0 -243
- package/inplace/inplace.esm.min.js +0 -1
- package/inputmask/inputmask.esm.js +0 -560
- package/inputmask/inputmask.esm.min.js +0 -1
- package/inputnumber/inputnumber.esm.js +0 -1209
- package/inputnumber/inputnumber.esm.min.js +0 -1
- package/inputswitch/inputswitch.esm.js +0 -291
- package/inputswitch/inputswitch.esm.min.js +0 -1
- package/inputtext/inputtext.esm.js +0 -171
- package/inputtext/inputtext.esm.min.js +0 -1
- package/inputtextarea/inputtextarea.esm.js +0 -220
- package/inputtextarea/inputtextarea.esm.min.js +0 -1
- package/keyfilter/keyfilter.esm.js +0 -108
- package/keyfilter/keyfilter.esm.min.js +0 -1
- package/knob/knob.esm.js +0 -318
- package/knob/knob.esm.min.js +0 -1
- package/listbox/listbox.esm.js +0 -810
- package/listbox/listbox.esm.min.js +0 -1
- package/megamenu/megamenu.esm.js +0 -716
- package/megamenu/megamenu.esm.min.js +0 -1
- package/mention/mention.esm.js +0 -771
- package/mention/mention.esm.min.js +0 -1
- package/menu/menu.esm.js +0 -485
- package/menu/menu.esm.min.js +0 -1
- package/menubar/menubar.esm.js +0 -584
- package/menubar/menubar.esm.min.js +0 -1
- package/message/message.esm.js +0 -169
- package/message/message.esm.min.js +0 -1
- package/messages/messages.esm.js +0 -439
- package/messages/messages.esm.min.js +0 -1
- package/multiselect/multiselect.esm.js +0 -1724
- package/multiselect/multiselect.esm.min.js +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +0 -352
- package/multistatecheckbox/multistatecheckbox.esm.min.js +0 -1
- package/orderlist/orderlist.esm.js +0 -816
- package/orderlist/orderlist.esm.min.js +0 -1
- package/organizationchart/organizationchart.esm.js +0 -480
- package/organizationchart/organizationchart.esm.min.js +0 -1
- package/overlaypanel/overlaypanel.esm.js +0 -516
- package/overlaypanel/overlaypanel.esm.min.js +0 -1
- package/overlayservice/overlayservice.esm.js +0 -7
- package/overlayservice/overlayservice.esm.min.js +0 -1
- package/paginator/paginator.esm.js +0 -933
- package/paginator/paginator.esm.min.js +0 -1
- package/panel/panel.esm.js +0 -316
- package/panel/panel.esm.min.js +0 -1
- package/panelmenu/panelmenu.esm.js +0 -645
- package/panelmenu/panelmenu.esm.min.js +0 -1
- package/passthrough/index.esm.js +0 -71
- package/passthrough/index.esm.min.js +0 -1
- package/passthrough/tailwind/index.esm.js +0 -3509
- package/passthrough/tailwind/index.esm.min.js +0 -1
- package/password/password.esm.js +0 -567
- package/password/password.esm.min.js +0 -1
- package/picklist/picklist.esm.js +0 -1119
- package/picklist/picklist.esm.min.js +0 -1
- package/portal/portal.esm.js +0 -110
- package/portal/portal.esm.min.js +0 -1
- package/primereact.all.esm.js +0 -51646
- package/primereact.all.esm.min.js +0 -1
- package/progressbar/progressbar.esm.js +0 -190
- package/progressbar/progressbar.esm.min.js +0 -1
- package/progressspinner/progressspinner.esm.js +0 -88
- package/progressspinner/progressspinner.esm.min.js +0 -1
- package/radiobutton/radiobutton.esm.js +0 -329
- package/radiobutton/radiobutton.esm.min.js +0 -1
- package/rating/rating.esm.js +0 -273
- package/rating/rating.esm.min.js +0 -1
- package/ripple/ripple.esm.js +0 -100
- package/ripple/ripple.esm.min.js +0 -1
- package/row/row.esm.js +0 -36
- package/row/row.esm.min.js +0 -1
- package/scrollpanel/scrollpanel.esm.js +0 -210
- package/scrollpanel/scrollpanel.esm.min.js +0 -1
- package/scrolltop/scrolltop.esm.js +0 -269
- package/scrolltop/scrolltop.esm.min.js +0 -1
- package/selectbutton/selectbutton.esm.js +0 -327
- package/selectbutton/selectbutton.esm.min.js +0 -1
- package/sidebar/sidebar.esm.js +0 -543
- package/sidebar/sidebar.esm.min.js +0 -1
- package/skeleton/skeleton.esm.js +0 -125
- package/skeleton/skeleton.esm.min.js +0 -1
- package/slidemenu/slidemenu.esm.js +0 -689
- package/slidemenu/slidemenu.esm.min.js +0 -1
- package/slider/slider.esm.js +0 -478
- package/slider/slider.esm.min.js +0 -1
- package/speeddial/speeddial.esm.js +0 -521
- package/speeddial/speeddial.esm.min.js +0 -1
- package/splitbutton/splitbutton.esm.js +0 -545
- package/splitbutton/splitbutton.esm.min.js +0 -1
- package/splitter/splitter.esm.js +0 -466
- package/splitter/splitter.esm.min.js +0 -1
- package/steps/steps.esm.js +0 -294
- package/steps/steps.esm.min.js +0 -1
- package/styleclass/styleclass.esm.js +0 -269
- package/styleclass/styleclass.esm.min.js +0 -1
- package/tabmenu/tabmenu.esm.js +0 -332
- package/tabmenu/tabmenu.esm.min.js +0 -1
- package/tabview/tabview.esm.js +0 -678
- package/tabview/tabview.esm.min.js +0 -1
- package/tag/tag.esm.js +0 -117
- package/tag/tag.esm.min.js +0 -1
- package/terminal/terminal.esm.js +0 -280
- package/terminal/terminal.esm.min.js +0 -1
- package/terminalservice/terminalservice.esm.js +0 -7
- package/terminalservice/terminalservice.esm.min.js +0 -1
- package/tieredmenu/tieredmenu.esm.js +0 -699
- package/tieredmenu/tieredmenu.esm.min.js +0 -1
- package/timeline/timeline.esm.js +0 -164
- package/timeline/timeline.esm.min.js +0 -1
- package/toast/toast.esm.js +0 -739
- package/toast/toast.esm.min.js +0 -1
- package/togglebutton/togglebutton.esm.js +0 -217
- package/togglebutton/togglebutton.esm.min.js +0 -1
- package/toolbar/toolbar.esm.js +0 -79
- package/toolbar/toolbar.esm.min.js +0 -1
- package/tooltip/tooltip.esm.js +0 -696
- package/tooltip/tooltip.esm.min.js +0 -1
- package/tree/tree.esm.js +0 -1403
- package/tree/tree.esm.min.js +0 -1
- package/treeselect/treeselect.esm.js +0 -930
- package/treeselect/treeselect.esm.min.js +0 -1
- package/treetable/treetable.esm.js +0 -3094
- package/treetable/treetable.esm.min.js +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +0 -292
- package/tristatecheckbox/tristatecheckbox.esm.min.js +0 -1
- package/utils/utils.esm.js +0 -2383
- package/utils/utils.esm.min.js +0 -1
- package/virtualscroller/virtualscroller.esm.js +0 -972
- package/virtualscroller/virtualscroller.esm.min.js +0 -1
package/picklist/picklist.esm.js
DELETED
|
@@ -1,1119 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import PrimeReact, { PrimeReactContext, FilterService } from 'primereact/api';
|
|
5
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
|
-
import { useMatchMedia, useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
7
|
-
import { classNames, mergeProps, ObjectUtils, IconUtils, DomHandler, UniqueComponentId } from 'primereact/utils';
|
|
8
|
-
import { Button } from 'primereact/button';
|
|
9
|
-
import { AngleDoubleDownIcon } from 'primereact/icons/angledoubledown';
|
|
10
|
-
import { AngleDoubleUpIcon } from 'primereact/icons/angledoubleup';
|
|
11
|
-
import { AngleDownIcon } from 'primereact/icons/angledown';
|
|
12
|
-
import { AngleUpIcon } from 'primereact/icons/angleup';
|
|
13
|
-
import { SearchIcon } from 'primereact/icons/search';
|
|
14
|
-
import { Ripple } from 'primereact/ripple';
|
|
15
|
-
import { AngleDoubleLeftIcon } from 'primereact/icons/angledoubleleft';
|
|
16
|
-
import { AngleDoubleRightIcon } from 'primereact/icons/angledoubleright';
|
|
17
|
-
import { AngleLeftIcon } from 'primereact/icons/angleleft';
|
|
18
|
-
import { AngleRightIcon } from 'primereact/icons/angleright';
|
|
19
|
-
|
|
20
|
-
function _arrayWithHoles(arr) {
|
|
21
|
-
if (Array.isArray(arr)) return arr;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _iterableToArrayLimit(r, l) {
|
|
25
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
26
|
-
if (null != t) {
|
|
27
|
-
var e,
|
|
28
|
-
n,
|
|
29
|
-
i,
|
|
30
|
-
u,
|
|
31
|
-
a = [],
|
|
32
|
-
f = !0,
|
|
33
|
-
o = !1;
|
|
34
|
-
try {
|
|
35
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
36
|
-
if (Object(t) !== t) return;
|
|
37
|
-
f = !1;
|
|
38
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
39
|
-
} catch (r) {
|
|
40
|
-
o = !0, n = r;
|
|
41
|
-
} finally {
|
|
42
|
-
try {
|
|
43
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
44
|
-
} finally {
|
|
45
|
-
if (o) throw n;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return a;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _arrayLikeToArray(arr, len) {
|
|
53
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
54
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
55
|
-
return arr2;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
59
|
-
if (!o) return;
|
|
60
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
61
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
62
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
63
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
64
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function _nonIterableRest() {
|
|
68
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function _slicedToArray(arr, i) {
|
|
72
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
var classes = {
|
|
76
|
-
root: 'p-picklist p-component',
|
|
77
|
-
buttons: 'p-picklist-buttons p-picklist-transfer-buttons',
|
|
78
|
-
header: 'p-picklist-header',
|
|
79
|
-
filterIcon: 'p-picklist-filter-icon',
|
|
80
|
-
filter: 'p-picklist-filter',
|
|
81
|
-
filterInput: 'p-picklist-filter-input p-inputtext p-component',
|
|
82
|
-
filterContainer: 'p-picklist-filter-container',
|
|
83
|
-
list: 'p-picklist-list',
|
|
84
|
-
listWrapper: 'p-picklist-list-wrapper',
|
|
85
|
-
item: function item(_ref) {
|
|
86
|
-
var subProps = _ref.subProps;
|
|
87
|
-
return classNames('p-picklist-item', {
|
|
88
|
-
'p-highlight': subProps.selected
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
controls: 'p-picklist-buttons'
|
|
92
|
-
};
|
|
93
|
-
var styles = "\n@layer primereact {\n .p-picklist {\n display: flex;\n }\n \n .p-picklist-buttons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n \n .p-picklist-list-wrapper {\n flex: 1 1 50%;\n }\n \n .p-picklist-list {\n list-style-type: none;\n margin: 0;\n padding: 0;\n overflow: auto;\n min-height: 12rem;\n max-height: 24rem;\n }\n \n .p-picklist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n \n .p-picklist-filter {\n position: relative;\n }\n \n .p-picklist-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-picklist-filter-input {\n width: 100%;\n }\n}\n";
|
|
94
|
-
var PickListBase = ComponentBase.extend({
|
|
95
|
-
defaultProps: {
|
|
96
|
-
__TYPE: 'PickList',
|
|
97
|
-
id: null,
|
|
98
|
-
source: null,
|
|
99
|
-
target: null,
|
|
100
|
-
sourceHeader: null,
|
|
101
|
-
targetHeader: null,
|
|
102
|
-
style: null,
|
|
103
|
-
className: null,
|
|
104
|
-
sourceStyle: null,
|
|
105
|
-
targetStyle: null,
|
|
106
|
-
sourceSelection: null,
|
|
107
|
-
targetSelection: null,
|
|
108
|
-
showSourceControls: true,
|
|
109
|
-
showTargetControls: true,
|
|
110
|
-
metaKeySelection: true,
|
|
111
|
-
filter: false,
|
|
112
|
-
filterBy: null,
|
|
113
|
-
filterMatchMode: 'contains',
|
|
114
|
-
targetFilterIcon: null,
|
|
115
|
-
sourceFilterIcon: null,
|
|
116
|
-
moveAllToSourceIcon: null,
|
|
117
|
-
moveToSourceIcon: null,
|
|
118
|
-
moveAllToTargetIcon: null,
|
|
119
|
-
moveToTargetIcon: null,
|
|
120
|
-
moveBottomIcon: null,
|
|
121
|
-
moveUpIcon: null,
|
|
122
|
-
moveTopIcon: null,
|
|
123
|
-
moveDownIcon: null,
|
|
124
|
-
filterLocale: undefined,
|
|
125
|
-
sourceFilterValue: null,
|
|
126
|
-
targetFilterValue: null,
|
|
127
|
-
showSourceFilter: true,
|
|
128
|
-
showTargetFilter: true,
|
|
129
|
-
sourceFilterPlaceholder: null,
|
|
130
|
-
targetFilterPlaceholder: null,
|
|
131
|
-
sourceFilterTemplate: null,
|
|
132
|
-
targetFilterTemplate: null,
|
|
133
|
-
tabIndex: 0,
|
|
134
|
-
dataKey: null,
|
|
135
|
-
breakpoint: '960px',
|
|
136
|
-
itemTemplate: null,
|
|
137
|
-
sourceItemTemplate: null,
|
|
138
|
-
targetItemTemplate: null,
|
|
139
|
-
onChange: null,
|
|
140
|
-
onMoveToSource: null,
|
|
141
|
-
onMoveAllToSource: null,
|
|
142
|
-
onMoveToTarget: null,
|
|
143
|
-
onMoveAllToTarget: null,
|
|
144
|
-
onSourceSelectionChange: null,
|
|
145
|
-
onTargetSelectionChange: null,
|
|
146
|
-
onSourceFilterChange: null,
|
|
147
|
-
onTargetFilterChange: null,
|
|
148
|
-
children: undefined
|
|
149
|
-
},
|
|
150
|
-
css: {
|
|
151
|
-
classes: classes,
|
|
152
|
-
styles: styles
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
function _arrayWithoutHoles(arr) {
|
|
157
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function _iterableToArray(iter) {
|
|
161
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function _nonIterableSpread() {
|
|
165
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function _toConsumableArray(arr) {
|
|
169
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
var PickListControls = /*#__PURE__*/React.memo(function (props) {
|
|
173
|
-
var ptm = props.ptm,
|
|
174
|
-
cx = props.cx,
|
|
175
|
-
unstyled = props.unstyled;
|
|
176
|
-
var moveUpIcon = props.moveUpIcon || /*#__PURE__*/React.createElement(AngleUpIcon, null);
|
|
177
|
-
var moveTopIcon = props.moveTopIcon || /*#__PURE__*/React.createElement(AngleDoubleUpIcon, null);
|
|
178
|
-
var moveDownIcon = props.moveDownIcon || /*#__PURE__*/React.createElement(AngleDownIcon, null);
|
|
179
|
-
var moveBottomIcon = props.moveBottomIcon || /*#__PURE__*/React.createElement(AngleDoubleDownIcon, null);
|
|
180
|
-
var moveDisabled = !props.selection || !props.selection.length;
|
|
181
|
-
var moveUp = function moveUp(event) {
|
|
182
|
-
var selectedItems = props.selection;
|
|
183
|
-
if (selectedItems && selectedItems.length) {
|
|
184
|
-
var list = _toConsumableArray(props.list);
|
|
185
|
-
for (var i = 0; i < selectedItems.length; i++) {
|
|
186
|
-
var selectedItem = selectedItems[i];
|
|
187
|
-
var selectedItemIndex = ObjectUtils.findIndexInList(selectedItem, list, props.dataKey);
|
|
188
|
-
if (selectedItemIndex !== 0) {
|
|
189
|
-
var movedItem = list[selectedItemIndex];
|
|
190
|
-
var temp = list[selectedItemIndex - 1];
|
|
191
|
-
list[selectedItemIndex - 1] = movedItem;
|
|
192
|
-
list[selectedItemIndex] = temp;
|
|
193
|
-
} else {
|
|
194
|
-
break;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
if (props.onReorder) {
|
|
198
|
-
props.onReorder({
|
|
199
|
-
originalEvent: event,
|
|
200
|
-
value: list,
|
|
201
|
-
direction: 'up'
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
var moveTop = function moveTop(event) {
|
|
207
|
-
var selectedItems = props.selection;
|
|
208
|
-
if (selectedItems && selectedItems.length) {
|
|
209
|
-
var list = _toConsumableArray(props.list);
|
|
210
|
-
for (var i = 0; i < selectedItems.length; i++) {
|
|
211
|
-
var selectedItem = selectedItems[i];
|
|
212
|
-
var selectedItemIndex = ObjectUtils.findIndexInList(selectedItem, list, props.dataKey);
|
|
213
|
-
if (selectedItemIndex !== 0) {
|
|
214
|
-
var movedItem = list.splice(selectedItemIndex, 1)[0];
|
|
215
|
-
list.unshift(movedItem);
|
|
216
|
-
} else {
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (props.onReorder) {
|
|
221
|
-
props.onReorder({
|
|
222
|
-
originalEvent: event,
|
|
223
|
-
value: list,
|
|
224
|
-
direction: 'top'
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
var moveDown = function moveDown(event) {
|
|
230
|
-
var selectedItems = props.selection;
|
|
231
|
-
if (selectedItems && selectedItems.length) {
|
|
232
|
-
var list = _toConsumableArray(props.list);
|
|
233
|
-
for (var i = selectedItems.length - 1; i >= 0; i--) {
|
|
234
|
-
var selectedItem = selectedItems[i];
|
|
235
|
-
var selectedItemIndex = ObjectUtils.findIndexInList(selectedItem, list, props.dataKey);
|
|
236
|
-
if (selectedItemIndex !== list.length - 1) {
|
|
237
|
-
var movedItem = list[selectedItemIndex];
|
|
238
|
-
var temp = list[selectedItemIndex + 1];
|
|
239
|
-
list[selectedItemIndex + 1] = movedItem;
|
|
240
|
-
list[selectedItemIndex] = temp;
|
|
241
|
-
} else {
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
if (props.onReorder) {
|
|
246
|
-
props.onReorder({
|
|
247
|
-
originalEvent: event,
|
|
248
|
-
value: list,
|
|
249
|
-
direction: 'down'
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
var moveBottom = function moveBottom(event) {
|
|
255
|
-
var selectedItems = props.selection;
|
|
256
|
-
if (selectedItems && selectedItems.length) {
|
|
257
|
-
var list = _toConsumableArray(props.list);
|
|
258
|
-
for (var i = selectedItems.length - 1; i >= 0; i--) {
|
|
259
|
-
var selectedItem = selectedItems[i];
|
|
260
|
-
var selectedItemIndex = ObjectUtils.findIndexInList(selectedItem, list, props.dataKey);
|
|
261
|
-
if (selectedItemIndex !== list.length - 1) {
|
|
262
|
-
var movedItem = list.splice(selectedItemIndex, 1)[0];
|
|
263
|
-
list.push(movedItem);
|
|
264
|
-
} else {
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
if (props.onReorder) {
|
|
269
|
-
props.onReorder({
|
|
270
|
-
originalEvent: event,
|
|
271
|
-
value: list,
|
|
272
|
-
direction: 'bottom'
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
var controlsProps = mergeProps({
|
|
278
|
-
className: classNames(props.className, cx('controls'))
|
|
279
|
-
}, ptm('controls', {
|
|
280
|
-
hostName: props.hostName
|
|
281
|
-
}));
|
|
282
|
-
return /*#__PURE__*/React.createElement("div", controlsProps, /*#__PURE__*/React.createElement(Button, {
|
|
283
|
-
disabled: moveDisabled,
|
|
284
|
-
type: "button",
|
|
285
|
-
icon: moveUpIcon,
|
|
286
|
-
onClick: moveUp,
|
|
287
|
-
pt: ptm('moveUpButton'),
|
|
288
|
-
unstyled: unstyled,
|
|
289
|
-
__parentMetadata: {
|
|
290
|
-
parent: props.metaData
|
|
291
|
-
}
|
|
292
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
293
|
-
disabled: moveDisabled,
|
|
294
|
-
type: "button",
|
|
295
|
-
icon: moveTopIcon,
|
|
296
|
-
onClick: moveTop,
|
|
297
|
-
pt: ptm('moveTopButton'),
|
|
298
|
-
unstyled: unstyled,
|
|
299
|
-
__parentMetadata: {
|
|
300
|
-
parent: props.metaData
|
|
301
|
-
}
|
|
302
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
303
|
-
disabled: moveDisabled,
|
|
304
|
-
type: "button",
|
|
305
|
-
icon: moveDownIcon,
|
|
306
|
-
onClick: moveDown,
|
|
307
|
-
pt: ptm('moveDownButton'),
|
|
308
|
-
unstyled: unstyled,
|
|
309
|
-
__parentMetadata: {
|
|
310
|
-
parent: props.metaData
|
|
311
|
-
}
|
|
312
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
313
|
-
disabled: moveDisabled,
|
|
314
|
-
type: "button",
|
|
315
|
-
icon: moveBottomIcon,
|
|
316
|
-
onClick: moveBottom,
|
|
317
|
-
pt: ptm('moveBottomButton'),
|
|
318
|
-
unstyled: unstyled,
|
|
319
|
-
__parentMetadata: {
|
|
320
|
-
parent: props.metaData
|
|
321
|
-
}
|
|
322
|
-
}));
|
|
323
|
-
});
|
|
324
|
-
PickListControls.displayName = 'PickListControls';
|
|
325
|
-
|
|
326
|
-
function _typeof(o) {
|
|
327
|
-
"@babel/helpers - typeof";
|
|
328
|
-
|
|
329
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
330
|
-
return typeof o;
|
|
331
|
-
} : function (o) {
|
|
332
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
333
|
-
}, _typeof(o);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function _toPrimitive(input, hint) {
|
|
337
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
338
|
-
var prim = input[Symbol.toPrimitive];
|
|
339
|
-
if (prim !== undefined) {
|
|
340
|
-
var res = prim.call(input, hint || "default");
|
|
341
|
-
if (_typeof(res) !== "object") return res;
|
|
342
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
343
|
-
}
|
|
344
|
-
return (hint === "string" ? String : Number)(input);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function _toPropertyKey(arg) {
|
|
348
|
-
var key = _toPrimitive(arg, "string");
|
|
349
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
function _defineProperty(obj, key, value) {
|
|
353
|
-
key = _toPropertyKey(key);
|
|
354
|
-
if (key in obj) {
|
|
355
|
-
Object.defineProperty(obj, key, {
|
|
356
|
-
value: value,
|
|
357
|
-
enumerable: true,
|
|
358
|
-
configurable: true,
|
|
359
|
-
writable: true
|
|
360
|
-
});
|
|
361
|
-
} else {
|
|
362
|
-
obj[key] = value;
|
|
363
|
-
}
|
|
364
|
-
return obj;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
var PickListItem = /*#__PURE__*/React.memo(function (props) {
|
|
368
|
-
var ptm = props.ptm,
|
|
369
|
-
cx = props.cx;
|
|
370
|
-
var getPTOptions = function getPTOptions(key) {
|
|
371
|
-
return ptm(key, {
|
|
372
|
-
hostName: props.hostName,
|
|
373
|
-
context: {
|
|
374
|
-
selected: props.selected
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
};
|
|
378
|
-
var onClick = function onClick(event) {
|
|
379
|
-
if (props.onClick) {
|
|
380
|
-
props.onClick({
|
|
381
|
-
originalEvent: event,
|
|
382
|
-
value: props.value
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
var onKeyDown = function onKeyDown(event) {
|
|
387
|
-
if (props.onKeyDown) {
|
|
388
|
-
props.onKeyDown({
|
|
389
|
-
originalEvent: event,
|
|
390
|
-
value: props.value
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
var content = props.template ? props.template(props.value) : props.value;
|
|
395
|
-
var itemProps = mergeProps({
|
|
396
|
-
className: classNames(props.className, cx('item', {
|
|
397
|
-
subProps: props
|
|
398
|
-
})),
|
|
399
|
-
onClick: onClick,
|
|
400
|
-
onKeyDown: onKeyDown,
|
|
401
|
-
tabIndex: props.tabIndex,
|
|
402
|
-
role: 'option',
|
|
403
|
-
'aria-selected': props.selected
|
|
404
|
-
}, getPTOptions('item'));
|
|
405
|
-
return /*#__PURE__*/React.createElement("li", itemProps, content, /*#__PURE__*/React.createElement(Ripple, null));
|
|
406
|
-
});
|
|
407
|
-
PickListItem.displayName = 'PickListItem';
|
|
408
|
-
|
|
409
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
410
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
411
|
-
var PickListSubList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
412
|
-
var listElementRef = React.useRef(null);
|
|
413
|
-
var ptm = props.ptm,
|
|
414
|
-
cx = props.cx;
|
|
415
|
-
var getPTOptions = function getPTOptions(key, options) {
|
|
416
|
-
return ptm(key, _objectSpread({
|
|
417
|
-
hostName: props.hostName
|
|
418
|
-
}, options));
|
|
419
|
-
};
|
|
420
|
-
var onItemClick = function onItemClick(event) {
|
|
421
|
-
var originalEvent = event.originalEvent;
|
|
422
|
-
var item = event.value;
|
|
423
|
-
var selection = _toConsumableArray(props.selection);
|
|
424
|
-
var index = ObjectUtils.findIndexInList(item, selection, props.dataKey);
|
|
425
|
-
var selected = index !== -1;
|
|
426
|
-
var metaSelection = props.metaKeySelection;
|
|
427
|
-
if (metaSelection) {
|
|
428
|
-
var metaKey = originalEvent.metaKey || originalEvent.ctrlKey;
|
|
429
|
-
if (selected && metaKey) {
|
|
430
|
-
selection.splice(index, 1);
|
|
431
|
-
} else {
|
|
432
|
-
if (!metaKey) {
|
|
433
|
-
selection.length = 0;
|
|
434
|
-
}
|
|
435
|
-
selection.push(item);
|
|
436
|
-
}
|
|
437
|
-
} else {
|
|
438
|
-
if (selected) selection.splice(index, 1);else selection.push(item);
|
|
439
|
-
}
|
|
440
|
-
if (props.onSelectionChange) {
|
|
441
|
-
props.onSelectionChange({
|
|
442
|
-
event: originalEvent,
|
|
443
|
-
value: selection
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
var onItemKeyDown = function onItemKeyDown(event) {
|
|
448
|
-
var originalEvent = event.originalEvent;
|
|
449
|
-
var listItem = originalEvent.currentTarget;
|
|
450
|
-
switch (originalEvent.which) {
|
|
451
|
-
//down
|
|
452
|
-
case 40:
|
|
453
|
-
var nextItem = findNextItem(listItem);
|
|
454
|
-
nextItem && nextItem.focus();
|
|
455
|
-
originalEvent.preventDefault();
|
|
456
|
-
break;
|
|
457
|
-
|
|
458
|
-
//up
|
|
459
|
-
case 38:
|
|
460
|
-
var prevItem = findPrevItem(listItem);
|
|
461
|
-
prevItem && prevItem.focus();
|
|
462
|
-
originalEvent.preventDefault();
|
|
463
|
-
break;
|
|
464
|
-
|
|
465
|
-
//enter
|
|
466
|
-
case 13:
|
|
467
|
-
onItemClick(event);
|
|
468
|
-
originalEvent.preventDefault();
|
|
469
|
-
break;
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
var findNextItem = function findNextItem(item) {
|
|
473
|
-
var nextItem = item.nextElementSibling;
|
|
474
|
-
return nextItem ? !DomHandler.hasClass(nextItem, 'p-picklist-item') ? findNextItem(nextItem) : nextItem : null;
|
|
475
|
-
};
|
|
476
|
-
var findPrevItem = function findPrevItem(item) {
|
|
477
|
-
var prevItem = item.previousElementSibling;
|
|
478
|
-
return prevItem ? !DomHandler.hasClass(prevItem, 'p-picklist-item') ? findPrevItem(prevItem) : prevItem : null;
|
|
479
|
-
};
|
|
480
|
-
var isSelected = function isSelected(item) {
|
|
481
|
-
return ObjectUtils.findIndexInList(item, props.selection, props.dataKey) !== -1;
|
|
482
|
-
};
|
|
483
|
-
var onFilter = function onFilter(event) {
|
|
484
|
-
if (props.onFilter) {
|
|
485
|
-
props.onFilter({
|
|
486
|
-
originalEvent: event,
|
|
487
|
-
value: event.target.value,
|
|
488
|
-
type: props.type
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
var onFilterInputKeyDown = function onFilterInputKeyDown(event) {
|
|
493
|
-
//enter
|
|
494
|
-
if (event.which === 13) {
|
|
495
|
-
event.preventDefault();
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
React.useImperativeHandle(ref, function () {
|
|
499
|
-
return {
|
|
500
|
-
listElementRef: listElementRef
|
|
501
|
-
};
|
|
502
|
-
});
|
|
503
|
-
var createHeader = function createHeader() {
|
|
504
|
-
var headerProps = mergeProps({
|
|
505
|
-
className: cx('header')
|
|
506
|
-
}, getPTOptions('header'));
|
|
507
|
-
if (props.header) {
|
|
508
|
-
return /*#__PURE__*/React.createElement("div", headerProps, ObjectUtils.getJSXElement(props.header, props));
|
|
509
|
-
}
|
|
510
|
-
return null;
|
|
511
|
-
};
|
|
512
|
-
var createItems = function createItems() {
|
|
513
|
-
if (props.list) {
|
|
514
|
-
return props.list.map(function (item) {
|
|
515
|
-
var key = JSON.stringify(item);
|
|
516
|
-
var selected = isSelected(item);
|
|
517
|
-
return /*#__PURE__*/React.createElement(PickListItem, {
|
|
518
|
-
hostName: props.hostName,
|
|
519
|
-
key: key,
|
|
520
|
-
value: item,
|
|
521
|
-
template: props.itemTemplate,
|
|
522
|
-
selected: selected,
|
|
523
|
-
onClick: onItemClick,
|
|
524
|
-
onKeyDown: onItemKeyDown,
|
|
525
|
-
tabIndex: props.tabIndex,
|
|
526
|
-
ptm: ptm,
|
|
527
|
-
cx: cx
|
|
528
|
-
});
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
return null;
|
|
532
|
-
};
|
|
533
|
-
var createFilter = function createFilter() {
|
|
534
|
-
var iconClassName = 'p-picklist-filter-icon';
|
|
535
|
-
var filterIconProps = mergeProps({
|
|
536
|
-
className: cx('filterIcon')
|
|
537
|
-
}, getPTOptions('filterIcon'));
|
|
538
|
-
var icon = props.type === 'source' ? props.sourceFilterIcon || /*#__PURE__*/React.createElement(SearchIcon, filterIconProps) : props.targetFilterIcon || /*#__PURE__*/React.createElement(SearchIcon, filterIconProps);
|
|
539
|
-
var filterIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, filterIconProps), {
|
|
540
|
-
props: props
|
|
541
|
-
});
|
|
542
|
-
if (props.showFilter) {
|
|
543
|
-
var filterProps = mergeProps({
|
|
544
|
-
className: cx('filter')
|
|
545
|
-
}, getPTOptions('filter'));
|
|
546
|
-
var filterInputProps = mergeProps({
|
|
547
|
-
type: 'text',
|
|
548
|
-
value: props.filterValue,
|
|
549
|
-
onChange: onFilter,
|
|
550
|
-
onKeyDown: onFilterInputKeyDown,
|
|
551
|
-
placeholder: props.placeholder,
|
|
552
|
-
className: cx('filterInput')
|
|
553
|
-
}, getPTOptions('filterInput'));
|
|
554
|
-
var content = /*#__PURE__*/React.createElement("div", filterProps, /*#__PURE__*/React.createElement("input", filterInputProps), /*#__PURE__*/React.createElement("span", null, " ", filterIcon, " "));
|
|
555
|
-
if (props.filterTemplate) {
|
|
556
|
-
var defaultContentOptions = {
|
|
557
|
-
className: 'p-picklist-filter',
|
|
558
|
-
inputProps: {
|
|
559
|
-
className: 'p-picklist-filter-input p-inputtext p-component',
|
|
560
|
-
onChange: onFilter,
|
|
561
|
-
onKeyDown: onFilterInputKeyDown
|
|
562
|
-
},
|
|
563
|
-
iconClassName: iconClassName,
|
|
564
|
-
element: content,
|
|
565
|
-
props: props
|
|
566
|
-
};
|
|
567
|
-
content = ObjectUtils.getJSXElement(props.filterTemplate, defaultContentOptions);
|
|
568
|
-
}
|
|
569
|
-
var filterContainerProps = mergeProps({
|
|
570
|
-
className: cx('filterContainer')
|
|
571
|
-
}, getPTOptions('filterContainer'));
|
|
572
|
-
return /*#__PURE__*/React.createElement("div", filterContainerProps, content);
|
|
573
|
-
}
|
|
574
|
-
return null;
|
|
575
|
-
};
|
|
576
|
-
var createList = function createList() {
|
|
577
|
-
var items = createItems();
|
|
578
|
-
var listProps = mergeProps({
|
|
579
|
-
className: classNames(props.listClassName, cx('list')),
|
|
580
|
-
role: 'listbox',
|
|
581
|
-
'aria-multiselectable': true,
|
|
582
|
-
style: props.style
|
|
583
|
-
}, getPTOptions('list'));
|
|
584
|
-
return /*#__PURE__*/React.createElement("ul", listProps, items);
|
|
585
|
-
};
|
|
586
|
-
var header = createHeader();
|
|
587
|
-
var filter = createFilter();
|
|
588
|
-
var list = createList();
|
|
589
|
-
var listWrapperProps = mergeProps({
|
|
590
|
-
className: classNames(props.className, cx('listWrapper')),
|
|
591
|
-
ref: listElementRef
|
|
592
|
-
}, getPTOptions('listWrapper'));
|
|
593
|
-
return /*#__PURE__*/React.createElement("div", listWrapperProps, header, filter, list);
|
|
594
|
-
}));
|
|
595
|
-
PickListSubList.displayName = 'PickListSubList';
|
|
596
|
-
|
|
597
|
-
var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
|
|
598
|
-
var viewChanged = useMatchMedia("(max-width: ".concat(props.breakpoint, ")"), props.breakpoint);
|
|
599
|
-
var ptm = props.ptm,
|
|
600
|
-
cx = props.cx,
|
|
601
|
-
unstyled = props.unstyled;
|
|
602
|
-
function getIconComponent(iconType) {
|
|
603
|
-
switch (iconType) {
|
|
604
|
-
case 'moveToTargetIcon':
|
|
605
|
-
return props.moveToTargetIcon || viewChanged ? props.moveToTargetIcon || /*#__PURE__*/React.createElement(AngleDownIcon, null) : props.moveToTargetIcon || /*#__PURE__*/React.createElement(AngleRightIcon, null);
|
|
606
|
-
case 'moveAllToTargetIcon':
|
|
607
|
-
return props.moveAllToTargetIcon || viewChanged ? props.moveAllToTargetIcon || /*#__PURE__*/React.createElement(AngleDoubleDownIcon, null) : props.moveAllToTargetIcon || /*#__PURE__*/React.createElement(AngleDoubleRightIcon, null);
|
|
608
|
-
case 'moveToSourceIcon':
|
|
609
|
-
return props.moveToSourceIcon || viewChanged ? props.moveToSourceIcon || /*#__PURE__*/React.createElement(AngleUpIcon, null) : props.moveToSourceIcon || /*#__PURE__*/React.createElement(AngleLeftIcon, null);
|
|
610
|
-
case 'moveAllToSourceIcon':
|
|
611
|
-
return props.moveAllToSourceIcon || viewChanged ? props.moveAllToSourceIcon || /*#__PURE__*/React.createElement(AngleDoubleUpIcon, null) : props.moveAllToSourceIcon || /*#__PURE__*/React.createElement(AngleDoubleLeftIcon, null);
|
|
612
|
-
default:
|
|
613
|
-
return null;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
var moveToTargetIcon = IconUtils.getJSXIcon(getIconComponent('moveToTargetIcon'), undefined, {
|
|
617
|
-
props: props,
|
|
618
|
-
viewChanged: viewChanged
|
|
619
|
-
});
|
|
620
|
-
var moveAllToTargetIcon = IconUtils.getJSXIcon(getIconComponent('moveAllToTargetIcon'), undefined, {
|
|
621
|
-
props: props,
|
|
622
|
-
viewChanged: viewChanged
|
|
623
|
-
});
|
|
624
|
-
var moveToSourceIcon = IconUtils.getJSXIcon(getIconComponent('moveToSourceIcon'), undefined, {
|
|
625
|
-
props: props,
|
|
626
|
-
viewChanged: viewChanged
|
|
627
|
-
});
|
|
628
|
-
var moveAllToSourceIcon = IconUtils.getJSXIcon(getIconComponent('moveAllToSourceIcon'), undefined, {
|
|
629
|
-
props: props,
|
|
630
|
-
viewChanged: viewChanged
|
|
631
|
-
});
|
|
632
|
-
var moveRightDisabled = ObjectUtils.isEmpty(props.sourceSelection) || ObjectUtils.isEmpty(props.visibleSourceList);
|
|
633
|
-
var moveLeftDisabled = ObjectUtils.isEmpty(props.targetSelection) || ObjectUtils.isEmpty(props.visibleTargetList);
|
|
634
|
-
var moveAllRightDisabled = ObjectUtils.isEmpty(props.visibleSourceList);
|
|
635
|
-
var moveAllLeftDisabled = ObjectUtils.isEmpty(props.visibleTargetList);
|
|
636
|
-
var moveRight = function moveRight(event) {
|
|
637
|
-
var selection = props.sourceSelection;
|
|
638
|
-
if (ObjectUtils.isNotEmpty(selection)) {
|
|
639
|
-
var targetList = _toConsumableArray(props.target);
|
|
640
|
-
var sourceList = _toConsumableArray(props.source);
|
|
641
|
-
for (var i = 0; i < selection.length; i++) {
|
|
642
|
-
var selectedItem = selection[i];
|
|
643
|
-
if (ObjectUtils.findIndexInList(selectedItem, targetList, props.dataKey) === -1) {
|
|
644
|
-
targetList.push(sourceList.splice(ObjectUtils.findIndexInList(selectedItem, sourceList, props.dataKey), 1)[0]);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
if (props.onTransfer) {
|
|
648
|
-
props.onTransfer({
|
|
649
|
-
originalEvent: event,
|
|
650
|
-
source: sourceList,
|
|
651
|
-
target: targetList,
|
|
652
|
-
direction: 'toTarget'
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
var moveAllRight = function moveAllRight(event) {
|
|
658
|
-
if (props.source) {
|
|
659
|
-
var targetList = [].concat(_toConsumableArray(props.target), _toConsumableArray(props.visibleSourceList));
|
|
660
|
-
var sourceList = props.source.filter(function (s) {
|
|
661
|
-
return !props.visibleSourceList.some(function (vs) {
|
|
662
|
-
return vs === s;
|
|
663
|
-
});
|
|
664
|
-
});
|
|
665
|
-
if (props.onTransfer) {
|
|
666
|
-
props.onTransfer({
|
|
667
|
-
originalEvent: event,
|
|
668
|
-
source: sourceList,
|
|
669
|
-
target: targetList,
|
|
670
|
-
direction: 'allToTarget'
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
};
|
|
675
|
-
var moveLeft = function moveLeft(event) {
|
|
676
|
-
var selection = props.targetSelection;
|
|
677
|
-
if (ObjectUtils.isNotEmpty(selection)) {
|
|
678
|
-
var targetList = _toConsumableArray(props.target);
|
|
679
|
-
var sourceList = _toConsumableArray(props.source);
|
|
680
|
-
for (var i = 0; i < selection.length; i++) {
|
|
681
|
-
var selectedItem = selection[i];
|
|
682
|
-
if (ObjectUtils.findIndexInList(selectedItem, sourceList, props.dataKey) === -1) {
|
|
683
|
-
sourceList.push(targetList.splice(ObjectUtils.findIndexInList(selectedItem, targetList, props.dataKey), 1)[0]);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
if (props.onTransfer) {
|
|
687
|
-
props.onTransfer({
|
|
688
|
-
originalEvent: event,
|
|
689
|
-
source: sourceList,
|
|
690
|
-
target: targetList,
|
|
691
|
-
direction: 'toSource'
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
var moveAllLeft = function moveAllLeft(event) {
|
|
697
|
-
if (props.source) {
|
|
698
|
-
var sourceList = [].concat(_toConsumableArray(props.source), _toConsumableArray(props.visibleTargetList));
|
|
699
|
-
var targetList = props.target.filter(function (t) {
|
|
700
|
-
return !props.visibleTargetList.some(function (vt) {
|
|
701
|
-
return vt === t;
|
|
702
|
-
});
|
|
703
|
-
});
|
|
704
|
-
if (props.onTransfer) {
|
|
705
|
-
props.onTransfer({
|
|
706
|
-
originalEvent: event,
|
|
707
|
-
source: sourceList,
|
|
708
|
-
target: targetList,
|
|
709
|
-
direction: 'allToSource'
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
var buttonsProps = mergeProps({
|
|
715
|
-
className: classNames(props.className, cx('buttons'))
|
|
716
|
-
}, ptm('buttons', {
|
|
717
|
-
hostName: props.hostName
|
|
718
|
-
}));
|
|
719
|
-
return /*#__PURE__*/React.createElement("div", buttonsProps, /*#__PURE__*/React.createElement(Button, {
|
|
720
|
-
disabled: moveRightDisabled,
|
|
721
|
-
type: "button",
|
|
722
|
-
icon: moveToTargetIcon,
|
|
723
|
-
onClick: moveRight,
|
|
724
|
-
pt: ptm('moveToTargetButton'),
|
|
725
|
-
unstyled: unstyled,
|
|
726
|
-
__parentMetadata: {
|
|
727
|
-
parent: props.metaData
|
|
728
|
-
}
|
|
729
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
730
|
-
disabled: moveAllRightDisabled,
|
|
731
|
-
type: "button",
|
|
732
|
-
icon: moveAllToTargetIcon,
|
|
733
|
-
onClick: moveAllRight,
|
|
734
|
-
pt: ptm('moveAllToTargetButton'),
|
|
735
|
-
unstyled: unstyled,
|
|
736
|
-
__parentMetadata: {
|
|
737
|
-
parent: props.metaData
|
|
738
|
-
}
|
|
739
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
740
|
-
disabled: moveLeftDisabled,
|
|
741
|
-
type: "button",
|
|
742
|
-
icon: moveToSourceIcon,
|
|
743
|
-
onClick: moveLeft,
|
|
744
|
-
pt: ptm('moveToSourceButton'),
|
|
745
|
-
unstyled: unstyled,
|
|
746
|
-
__parentMetadata: {
|
|
747
|
-
parent: props.metaData
|
|
748
|
-
}
|
|
749
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
750
|
-
disabled: moveAllLeftDisabled,
|
|
751
|
-
type: "button",
|
|
752
|
-
icon: moveAllToSourceIcon,
|
|
753
|
-
onClick: moveAllLeft,
|
|
754
|
-
pt: ptm('moveAllToSourceButton'),
|
|
755
|
-
unstyled: unstyled,
|
|
756
|
-
__parentMetadata: {
|
|
757
|
-
parent: props.metaData
|
|
758
|
-
}
|
|
759
|
-
}));
|
|
760
|
-
});
|
|
761
|
-
PickListTransferControls.displayName = 'PickListTransferControls';
|
|
762
|
-
|
|
763
|
-
var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
764
|
-
var context = React.useContext(PrimeReactContext);
|
|
765
|
-
var props = PickListBase.getProps(inProps, context);
|
|
766
|
-
var _React$useState = React.useState([]),
|
|
767
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
768
|
-
sourceSelectionState = _React$useState2[0],
|
|
769
|
-
setSourceSelectionState = _React$useState2[1];
|
|
770
|
-
var _React$useState3 = React.useState([]),
|
|
771
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
772
|
-
targetSelectionState = _React$useState4[0],
|
|
773
|
-
setTargetSelectionState = _React$useState4[1];
|
|
774
|
-
var _React$useState5 = React.useState(''),
|
|
775
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
776
|
-
sourceFilterValueState = _React$useState6[0],
|
|
777
|
-
setSourceFilterValueState = _React$useState6[1];
|
|
778
|
-
var _React$useState7 = React.useState(''),
|
|
779
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
780
|
-
targetFilterValueState = _React$useState8[0],
|
|
781
|
-
setTargetFilterValueState = _React$useState8[1];
|
|
782
|
-
var _React$useState9 = React.useState(null),
|
|
783
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
784
|
-
attributeSelectorState = _React$useState10[0],
|
|
785
|
-
setAttributeSelectorState = _React$useState10[1];
|
|
786
|
-
var metaData = {
|
|
787
|
-
props: props,
|
|
788
|
-
state: {
|
|
789
|
-
sourceSelection: sourceSelectionState,
|
|
790
|
-
targetSelection: targetSelectionState,
|
|
791
|
-
sourceFilterValue: sourceFilterValueState,
|
|
792
|
-
targetFilterValue: targetFilterValueState,
|
|
793
|
-
attributeSelector: attributeSelectorState
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
var _PickListBase$setMeta = PickListBase.setMetaData(metaData),
|
|
797
|
-
ptm = _PickListBase$setMeta.ptm,
|
|
798
|
-
cx = _PickListBase$setMeta.cx,
|
|
799
|
-
isUnstyled = _PickListBase$setMeta.isUnstyled;
|
|
800
|
-
useHandleStyle(PickListBase.css.styles, isUnstyled, {
|
|
801
|
-
name: 'picklist'
|
|
802
|
-
});
|
|
803
|
-
var elementRef = React.useRef(null);
|
|
804
|
-
var sourceListElementRef = React.useRef(null);
|
|
805
|
-
var targetListElementRef = React.useRef(null);
|
|
806
|
-
var reorderedListElementRef = React.useRef(null);
|
|
807
|
-
var reorderDirection = React.useRef(null);
|
|
808
|
-
var styleElementRef = React.useRef(null);
|
|
809
|
-
var sourceSelection = props.sourceSelection ? props.sourceSelection : sourceSelectionState;
|
|
810
|
-
var targetSelection = props.targetSelection ? props.targetSelection : targetSelectionState;
|
|
811
|
-
var sourceFilteredValue = props.onSourceFilterChange ? props.sourceFilterValue : sourceFilterValueState;
|
|
812
|
-
var targetFilteredValue = props.onTargetFilterChange ? props.targetFilterValue : targetFilterValueState;
|
|
813
|
-
var hasFilterBy = ObjectUtils.isNotEmpty(props.filterBy);
|
|
814
|
-
var showSourceFilter = hasFilterBy && props.showSourceFilter;
|
|
815
|
-
var showTargetFilter = hasFilterBy && props.showTargetFilter;
|
|
816
|
-
var onSourceReorder = function onSourceReorder(event) {
|
|
817
|
-
handleChange(event, event.value, props.target);
|
|
818
|
-
reorderedListElementRef.current = sourceListElementRef.current.listElementRef.current;
|
|
819
|
-
reorderDirection.current = event.direction;
|
|
820
|
-
};
|
|
821
|
-
var onTargetReorder = function onTargetReorder(event) {
|
|
822
|
-
handleChange(event, props.source, event.value);
|
|
823
|
-
reorderedListElementRef.current = targetListElementRef.current.listElementRef.current;
|
|
824
|
-
reorderDirection.current = event.direction;
|
|
825
|
-
};
|
|
826
|
-
var handleScrollPosition = function handleScrollPosition(listElement, direction) {
|
|
827
|
-
if (listElement) {
|
|
828
|
-
var list = DomHandler.findSingle(listElement, '[data-pc-section="list"]');
|
|
829
|
-
switch (direction) {
|
|
830
|
-
case 'up':
|
|
831
|
-
scrollInView(list, -1);
|
|
832
|
-
break;
|
|
833
|
-
case 'top':
|
|
834
|
-
list.scrollTop = 0;
|
|
835
|
-
break;
|
|
836
|
-
case 'down':
|
|
837
|
-
scrollInView(list, 1);
|
|
838
|
-
break;
|
|
839
|
-
case 'bottom':
|
|
840
|
-
/* TODO: improve this code block */
|
|
841
|
-
setTimeout(function () {
|
|
842
|
-
return list.scrollTop = list.scrollHeight;
|
|
843
|
-
}, 100);
|
|
844
|
-
break;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
};
|
|
848
|
-
var handleChange = function handleChange(event, source, target) {
|
|
849
|
-
if (props.onChange) {
|
|
850
|
-
props.onChange({
|
|
851
|
-
originalEvent: event.originalEvent,
|
|
852
|
-
source: source,
|
|
853
|
-
target: target
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
var onTransfer = function onTransfer(event) {
|
|
858
|
-
var originalEvent = event.originalEvent,
|
|
859
|
-
source = event.source,
|
|
860
|
-
target = event.target,
|
|
861
|
-
direction = event.direction;
|
|
862
|
-
var selectedValue = [];
|
|
863
|
-
switch (direction) {
|
|
864
|
-
case 'toTarget':
|
|
865
|
-
selectedValue = sourceSelection;
|
|
866
|
-
if (props.onMoveToTarget) {
|
|
867
|
-
props.onMoveToTarget({
|
|
868
|
-
originalEvent: originalEvent,
|
|
869
|
-
value: selectedValue
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
break;
|
|
873
|
-
case 'allToTarget':
|
|
874
|
-
selectedValue = props.source;
|
|
875
|
-
if (props.onMoveAllToTarget) {
|
|
876
|
-
props.onMoveAllToTarget({
|
|
877
|
-
originalEvent: originalEvent,
|
|
878
|
-
value: selectedValue
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
|
-
selectedValue = [];
|
|
882
|
-
break;
|
|
883
|
-
case 'toSource':
|
|
884
|
-
selectedValue = targetSelection;
|
|
885
|
-
if (props.onMoveToSource) {
|
|
886
|
-
props.onMoveToSource({
|
|
887
|
-
originalEvent: originalEvent,
|
|
888
|
-
value: selectedValue
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
break;
|
|
892
|
-
case 'allToSource':
|
|
893
|
-
selectedValue = props.target;
|
|
894
|
-
if (props.onMoveAllToSource) {
|
|
895
|
-
props.onMoveAllToSource({
|
|
896
|
-
originalEvent: originalEvent,
|
|
897
|
-
value: selectedValue
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
selectedValue = [];
|
|
901
|
-
break;
|
|
902
|
-
}
|
|
903
|
-
_onSelectionChange({
|
|
904
|
-
originalEvent: originalEvent,
|
|
905
|
-
value: selectedValue
|
|
906
|
-
}, 'sourceSelection', props.onSourceSelectionChange);
|
|
907
|
-
_onSelectionChange({
|
|
908
|
-
originalEvent: originalEvent,
|
|
909
|
-
value: selectedValue
|
|
910
|
-
}, 'targetSelection', props.onTargetSelectionChange);
|
|
911
|
-
handleChange(event, source, target);
|
|
912
|
-
};
|
|
913
|
-
var scrollInView = function scrollInView(listContainer) {
|
|
914
|
-
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
915
|
-
var selectedItems = listContainer.getElementsByClassName('p-highlight');
|
|
916
|
-
if (ObjectUtils.isNotEmpty(selectedItems)) {
|
|
917
|
-
DomHandler.scrollInView(listContainer, direction === -1 ? selectedItems[0] : selectedItems[selectedItems.length - 1]);
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
var _onSelectionChange = function onSelectionChange(e, stateKey, callback) {
|
|
921
|
-
if (stateKey === 'sourceSelection') setSourceSelectionState(e.value);else setTargetSelectionState(e.value);
|
|
922
|
-
if (callback) {
|
|
923
|
-
callback(e);
|
|
924
|
-
}
|
|
925
|
-
if (ObjectUtils.isNotEmpty(sourceSelection) && stateKey === 'targetSelection') {
|
|
926
|
-
setSourceSelectionState([]);
|
|
927
|
-
} else if (ObjectUtils.isNotEmpty(targetSelection) && stateKey === 'sourceSelection') {
|
|
928
|
-
setTargetSelectionState([]);
|
|
929
|
-
}
|
|
930
|
-
};
|
|
931
|
-
var onFilter = function onFilter(event) {
|
|
932
|
-
var originalEvent = event.originalEvent,
|
|
933
|
-
value = event.value,
|
|
934
|
-
type = event.type;
|
|
935
|
-
var _ref = type === 'source' ? [setSourceFilterValueState, props.onSourceFilterChange] : [setTargetFilterValueState, props.onTargetFilterChange],
|
|
936
|
-
_ref2 = _slicedToArray(_ref, 2),
|
|
937
|
-
setFilterState = _ref2[0],
|
|
938
|
-
onFilterChange = _ref2[1];
|
|
939
|
-
if (onFilterChange) {
|
|
940
|
-
onFilterChange({
|
|
941
|
-
originalEvent: originalEvent,
|
|
942
|
-
value: value
|
|
943
|
-
});
|
|
944
|
-
} else {
|
|
945
|
-
setFilterState(value);
|
|
946
|
-
}
|
|
947
|
-
};
|
|
948
|
-
var getVisibleList = function getVisibleList(list, type) {
|
|
949
|
-
var _ref3 = type === 'source' ? [sourceFilteredValue, filterSource] : [targetFilteredValue, filterTarget],
|
|
950
|
-
_ref4 = _slicedToArray(_ref3, 2),
|
|
951
|
-
filteredValue = _ref4[0],
|
|
952
|
-
filterCallback = _ref4[1];
|
|
953
|
-
return hasFilterBy && ObjectUtils.isNotEmpty(filteredValue) ? filterCallback(filteredValue) : list;
|
|
954
|
-
};
|
|
955
|
-
var filterSource = function filterSource() {
|
|
956
|
-
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
957
|
-
var filteredValue = value.trim().toLocaleLowerCase(props.filterLocale);
|
|
958
|
-
return filter(props.source, filteredValue);
|
|
959
|
-
};
|
|
960
|
-
var filterTarget = function filterTarget() {
|
|
961
|
-
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
962
|
-
var filteredValue = value.trim().toLocaleLowerCase(props.filterLocale);
|
|
963
|
-
return filter(props.target, filteredValue);
|
|
964
|
-
};
|
|
965
|
-
var filter = function filter(list, filterValue) {
|
|
966
|
-
var searchFields = hasFilterBy ? props.filterBy.split(',') : [];
|
|
967
|
-
return FilterService.filter(list, searchFields, filterValue, props.filterMatchMode, props.filterLocale);
|
|
968
|
-
};
|
|
969
|
-
var createStyle = function createStyle() {
|
|
970
|
-
if (!styleElementRef.current) {
|
|
971
|
-
styleElementRef.current = DomHandler.createInlineStyle(context && context.nonce || PrimeReact.nonce);
|
|
972
|
-
var innerHTML = "\n@media screen and (max-width: ".concat(props.breakpoint, ") {\n .p-picklist[").concat(attributeSelectorState, "] {\n flex-direction: column;\n }\n\n .p-picklist[").concat(attributeSelectorState, "] .p-picklist-buttons {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-picklist[").concat(attributeSelectorState, "] .p-picklist-buttons .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-picklist[").concat(attributeSelectorState, "] .p-picklist-buttons .p-button:last-child {\n margin-right: 0;\n }\n}\n");
|
|
973
|
-
styleElementRef.current.innerHTML = innerHTML;
|
|
974
|
-
}
|
|
975
|
-
};
|
|
976
|
-
var destroyStyle = function destroyStyle() {
|
|
977
|
-
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
978
|
-
};
|
|
979
|
-
React.useImperativeHandle(ref, function () {
|
|
980
|
-
return {
|
|
981
|
-
props: props,
|
|
982
|
-
getElement: function getElement() {
|
|
983
|
-
return elementRef.current;
|
|
984
|
-
}
|
|
985
|
-
};
|
|
986
|
-
});
|
|
987
|
-
useMountEffect(function () {
|
|
988
|
-
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
989
|
-
});
|
|
990
|
-
useUpdateEffect(function () {
|
|
991
|
-
if (attributeSelectorState) {
|
|
992
|
-
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
993
|
-
createStyle();
|
|
994
|
-
}
|
|
995
|
-
return function () {
|
|
996
|
-
destroyStyle();
|
|
997
|
-
};
|
|
998
|
-
}, [attributeSelectorState, props.breakpoint]);
|
|
999
|
-
useUpdateEffect(function () {
|
|
1000
|
-
if (reorderedListElementRef.current) {
|
|
1001
|
-
handleScrollPosition(reorderedListElementRef.current, reorderDirection.current);
|
|
1002
|
-
reorderedListElementRef.current = null;
|
|
1003
|
-
reorderDirection.current = null;
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
var sourceItemTemplate = props.sourceItemTemplate ? props.sourceItemTemplate : props.itemTemplate;
|
|
1007
|
-
var targetItemTemplate = props.targetItemTemplate ? props.targetItemTemplate : props.itemTemplate;
|
|
1008
|
-
var sourceList = getVisibleList(props.source, 'source');
|
|
1009
|
-
var targetList = getVisibleList(props.target, 'target');
|
|
1010
|
-
var rootProps = mergeProps({
|
|
1011
|
-
id: props.id,
|
|
1012
|
-
ref: elementRef,
|
|
1013
|
-
className: classNames(props.className, cx('root')),
|
|
1014
|
-
style: props.style
|
|
1015
|
-
}, PickListBase.getOtherProps(props), ptm('root'));
|
|
1016
|
-
return /*#__PURE__*/React.createElement("div", rootProps, props.showSourceControls && /*#__PURE__*/React.createElement(PickListControls, {
|
|
1017
|
-
hostName: "PickList",
|
|
1018
|
-
list: props.source,
|
|
1019
|
-
selection: sourceSelection,
|
|
1020
|
-
onReorder: onSourceReorder,
|
|
1021
|
-
className: "p-picklist-source-controls",
|
|
1022
|
-
dataKey: props.dataKey,
|
|
1023
|
-
moveUpIcon: props.moveUpIcon,
|
|
1024
|
-
moveTopIcon: props.moveTopIcon,
|
|
1025
|
-
moveDownIcon: props.moveDownIcon,
|
|
1026
|
-
moveBottomIcon: props.moveBottomIcon,
|
|
1027
|
-
ptm: ptm,
|
|
1028
|
-
cx: cx,
|
|
1029
|
-
unstyled: props.unstyled,
|
|
1030
|
-
metaData: metaData
|
|
1031
|
-
}), /*#__PURE__*/React.createElement(PickListSubList, {
|
|
1032
|
-
hostName: "PickList",
|
|
1033
|
-
ref: sourceListElementRef,
|
|
1034
|
-
type: "source",
|
|
1035
|
-
list: sourceList,
|
|
1036
|
-
selection: sourceSelection,
|
|
1037
|
-
onSelectionChange: function onSelectionChange(e) {
|
|
1038
|
-
return _onSelectionChange(e, 'sourceSelection', props.onSourceSelectionChange);
|
|
1039
|
-
},
|
|
1040
|
-
itemTemplate: sourceItemTemplate,
|
|
1041
|
-
header: props.sourceHeader,
|
|
1042
|
-
style: props.sourceStyle,
|
|
1043
|
-
className: "p-picklist-source-wrapper",
|
|
1044
|
-
listClassName: "p-picklist-source",
|
|
1045
|
-
metaKeySelection: props.metaKeySelection,
|
|
1046
|
-
tabIndex: props.tabIndex,
|
|
1047
|
-
dataKey: props.dataKey,
|
|
1048
|
-
filterValue: sourceFilteredValue,
|
|
1049
|
-
onFilter: onFilter,
|
|
1050
|
-
showFilter: showSourceFilter,
|
|
1051
|
-
placeholder: props.sourceFilterPlaceholder,
|
|
1052
|
-
filterTemplate: props.sourceFilterTemplate,
|
|
1053
|
-
sourceFilterIcon: props.sourceFilterIcon,
|
|
1054
|
-
ptm: ptm,
|
|
1055
|
-
cx: cx
|
|
1056
|
-
}), /*#__PURE__*/React.createElement(PickListTransferControls, {
|
|
1057
|
-
hostName: "PickList",
|
|
1058
|
-
onTransfer: onTransfer,
|
|
1059
|
-
source: props.source,
|
|
1060
|
-
visibleSourceList: sourceList,
|
|
1061
|
-
target: props.target,
|
|
1062
|
-
breakpoint: props.breakpoint,
|
|
1063
|
-
visibleTargetList: targetList,
|
|
1064
|
-
sourceSelection: sourceSelection,
|
|
1065
|
-
targetSelection: targetSelection,
|
|
1066
|
-
dataKey: props.dataKey,
|
|
1067
|
-
moveToTargetIcon: props.moveToTargetIcon,
|
|
1068
|
-
moveAllToTargetIcon: props.moveAllToTargetIcon,
|
|
1069
|
-
moveToSourceIcon: props.moveToSourceIcon,
|
|
1070
|
-
moveAllToSourceIcon: props.moveAllToSourceIcon,
|
|
1071
|
-
ptm: ptm,
|
|
1072
|
-
cx: cx,
|
|
1073
|
-
unstyled: props.unstyled,
|
|
1074
|
-
metaData: metaData
|
|
1075
|
-
}), /*#__PURE__*/React.createElement(PickListSubList, {
|
|
1076
|
-
hostName: "PickList",
|
|
1077
|
-
ref: targetListElementRef,
|
|
1078
|
-
type: "target",
|
|
1079
|
-
list: targetList,
|
|
1080
|
-
selection: targetSelection,
|
|
1081
|
-
onSelectionChange: function onSelectionChange(e) {
|
|
1082
|
-
return _onSelectionChange(e, 'targetSelection', props.onTargetSelectionChange);
|
|
1083
|
-
},
|
|
1084
|
-
itemTemplate: targetItemTemplate,
|
|
1085
|
-
header: props.targetHeader,
|
|
1086
|
-
style: props.targetStyle,
|
|
1087
|
-
className: "p-picklist-target-wrapper",
|
|
1088
|
-
listClassName: "p-picklist-target",
|
|
1089
|
-
metaKeySelection: props.metaKeySelection,
|
|
1090
|
-
tabIndex: props.tabIndex,
|
|
1091
|
-
dataKey: props.dataKey,
|
|
1092
|
-
filterValue: targetFilteredValue,
|
|
1093
|
-
onFilter: onFilter,
|
|
1094
|
-
showFilter: showTargetFilter,
|
|
1095
|
-
placeholder: props.targetFilterPlaceholder,
|
|
1096
|
-
filterTemplate: props.targetFilterTemplate,
|
|
1097
|
-
targetFilterIcon: props.targetFilterIcon,
|
|
1098
|
-
ptm: ptm,
|
|
1099
|
-
cx: cx
|
|
1100
|
-
}), props.showTargetControls && /*#__PURE__*/React.createElement(PickListControls, {
|
|
1101
|
-
hostName: "PickList",
|
|
1102
|
-
list: props.target,
|
|
1103
|
-
selection: targetSelection,
|
|
1104
|
-
onReorder: onTargetReorder,
|
|
1105
|
-
className: "p-picklist-target-controls",
|
|
1106
|
-
dataKey: props.dataKey,
|
|
1107
|
-
moveUpIcon: props.moveUpIcon,
|
|
1108
|
-
moveTopIcon: props.moveTopIcon,
|
|
1109
|
-
moveDownIcon: props.moveDownIcon,
|
|
1110
|
-
moveBottomIcon: props.moveBottomIcon,
|
|
1111
|
-
ptm: ptm,
|
|
1112
|
-
cx: cx,
|
|
1113
|
-
unstyled: props.unstyled,
|
|
1114
|
-
metaData: metaData
|
|
1115
|
-
}));
|
|
1116
|
-
}));
|
|
1117
|
-
PickList.displayName = 'PickList';
|
|
1118
|
-
|
|
1119
|
-
export { PickList };
|