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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import t,{ariaLabel as n,PrimeReactContext as r,FilterService as o}from"primereact/api";import{ComponentBase as i,useHandleStyle as l}from"primereact/componentbase";import{useMountEffect as a,useUpdateEffect as c}from"primereact/hooks";import{classNames as u,mergeProps as s,ObjectUtils as p,IconUtils as m,DomHandler as d,UniqueComponentId as f}from"primereact/utils";import{Button as v}from"primereact/button";import{AngleDoubleDownIcon as g}from"primereact/icons/angledoubledown";import{AngleDoubleUpIcon as y}from"primereact/icons/angledoubleup";import{AngleDownIcon as h}from"primereact/icons/angledown";import{AngleUpIcon as b}from"primereact/icons/angleup";import{SearchIcon as I}from"primereact/icons/search";import{Ripple as E}from"primereact/ripple";function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(Array.isArray(e))return w(e)}function S(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(e){return x(e)||S(e)||O(e)||D()}function N(e){if(Array.isArray(e))return e}function T(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return a}}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){return N(e)||T(e,t)||O(e,t)||k()}var K=i.extend({defaultProps:{__TYPE:"OrderList",id:null,value:null,header:null,style:null,className:null,listStyle:null,dragdrop:!1,tabIndex:0,filterIcon:null,moveUpIcon:null,moveTopIcon:null,moveDownIcon:null,moveBottomIcon:null,dataKey:null,breakpoint:"960px",onChange:null,itemTemplate:null,filter:!1,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,filterPlaceholder:null,filterTemplate:null,onFilter:null,children:void 0},css:{classes:{root:"p-orderlist p-component",controls:"p-orderlist-controls",droppoint:"p-orderlist-droppoint",header:"p-orderlist-header",list:"p-orderlist-list",icon:"p-orderlist-filter",filter:"p-orderlist-filter",filterInput:"p-orderlist-filter-input p-inputtext p-component",filterIcon:"p-orderlist-filter-icon",filterContainer:"p-orderlist-filter-container",container:"p-orderlist-list-container",item:function(e){return u("p-orderlist-item",{"p-highlight":(0,e.isSelected)(e.item)})}},styles:"\n@layer primereact {\n .p-orderlist {\n display: flex;\n }\n \n .p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n \n .p-orderlist-list-container {\n flex: 1 1 auto;\n }\n \n .p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n \n .p-orderlist-filter {\n position: relative;\n }\n \n .p-orderlist-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-orderlist-filter-input {\n width: 100%;\n }\n \n .p-orderlist.p-state-disabled .p-orderlist-item,\n .p-orderlist.p-state-disabled .p-button {\n cursor: default;\n }\n \n .p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n }\n \n .p-orderlist .p-orderlist-droppoint {\n height: 0.5rem;\n }\n \n .p-orderlist .p-orderlist-droppoint.p-orderlist-droppoint-highlight {\n background: var(--primary-color);\n }\n}\n"}}),L=e.memo((function(t){var r=t.moveUpIcon||e.createElement(b,null),o=t.moveTopIcon||e.createElement(y,null),i=t.moveDownIcon||e.createElement(h,null),l=t.moveBottomIcon||e.createElement(g,null),a=t.ptm,c=t.unstyled,u=s({className:(0,t.cx)("controls")},a("controls",{hostName:t.hostName})),m=s({type:"button",unstyled:c,icon:r,onClick:function(e){if(t.selection){for(var n=C(t.value),r=0;r<t.selection.length;r++){var o=p.findIndexInList(t.selection[r],n,t.dataKey);if(0===o)break;var i=n[o-1];n[o-1]=n[o],n[o]=i}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"up"})}},"aria-label":n("moveUp"),__parentMetadata:{parent:t.metaData}},a("moveUpButton")),d=s({type:"button",unstyled:c,icon:o,onClick:function(e){if(t.selection){for(var n=C(t.value),r=0;r<t.selection.length;r++){var o=p.findIndexInList(t.selection[r],n,t.dataKey);if(0===o)break;var i=n.splice(o,1)[0];n.unshift(i)}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"top"})}},"aria-label":n("moveTop"),__parentMetadata:{parent:t.metaData}},a("moveTopButton")),f=s({type:"button",unstyled:c,icon:i,onClick:function(e){if(t.selection){for(var n=C(t.value),r=t.selection.length-1;r>=0;r--){var o=p.findIndexInList(t.selection[r],n,t.dataKey);if(o===n.length-1)break;var i=n[o+1];n[o+1]=n[o],n[o]=i}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"down"})}},"aria-label":n("moveDown"),__parentMetadata:{parent:t.metaData}},a("moveDownButton")),I=s({type:"button",unstyled:c,icon:l,onClick:function(e){if(t.selection){for(var n=C(t.value),r=t.selection.length-1;r>=0;r--){var o=p.findIndexInList(t.selection[r],n,t.dataKey);if(o===n.length-1)break;var i=n.splice(o,1)[0];n.push(i)}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"bottom"})}},"aria-label":n("moveBottom"),__parentMetadata:{parent:t.metaData}},a("moveBottomButton"));return e.createElement("div",u,e.createElement(v,m),e.createElement(v,d),e.createElement(v,f),e.createElement(v,I))}));function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function B(e,t){if("object"!==R(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function F(e){var t=B(e,"string");return"symbol"===R(t)?t:String(t)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){var r,o,i;r=e,i=n[t],(o=F(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}L.displayName="OrderListControls";var _=e.memo((function(t){var n,r,o,i=t.ptm,l=t.cx,a=function(e,n){return i(e,M({hostName:t.hostName},n))},c=function(e,t){return a(t,{context:{selected:b(e)}})},f=e.useRef(null),v=e.useRef(null),g=e.useRef(null),y=e.useRef(null),h={filter:function(e){return t.onFilterInputChange(e)},reset:function(){return t.resetFilter()}},b=function(e){return-1!==p.findIndexInList(e,t.selection,t.dataKey)},w=function(e,t){v.current!==t&&v.current+1!==t&&(g.current=t,d.addClass(e.target,"p-orderlist-droppoint-highlight"),e.preventDefault())},x=function(e){g.current=null,d.removeClass(e.target,"p-orderlist-droppoint-highlight")},S=function(e){var n=v.current>g.current?g.current:0===g.current?0:g.current-1,r=C(t.value);p.reorderArray(r,v.current,n),g.current=null,d.removeClass(e.target,"p-orderlist-droppoint-highlight"),t.onChange&&t.onChange({originalEvent:e,value:r})},O=function(e){f.current=!1},D=function(e){if(f.current){var t=y.current.getBoundingClientRect().top+d.getWindowScrollTop(),n=t+y.current.clientHeight-e.pageY,r=e.pageY-t;n<25&&n>0?y.current.scrollTop+=15:r<25&&r>0&&(y.current.scrollTop-=15)}},N=function(e){13===e.which&&e.preventDefault()},T=function(t,n){var r=s({className:l("droppoint"),onDragOver:function(e){return w(e,t+1)},onDragLeave:x,onDrop:S},a("droppoint"));return e.createElement("li",P({key:n},r))},k=(n=s({className:l("header")},a("header")),t.header?e.createElement("div",n,t.header):null),j=function(){var n=s({className:l("icon")},a("icon")),r=m.getJSXIcon(t.filterIcon||e.createElement(I,n),M({},n),{props:t});if(t.filter){var o=s({className:l("filter")},a("filter")),i=s({type:"text",value:t.filterValue,onChange:t.onFilter,onKeyDown:N,placeholder:t.placeholder,className:l("filterInput")},a("filterInput")),c=s({className:l("filterIcon")},a("filterIcon")),u=e.createElement("div",o,e.createElement("input",i),e.createElement("span",c,r));if(t.filterTemplate)u=p.getJSXElement(t.filterTemplate,{className:"p-orderlist-filter",inputProps:{inputClassName:"p-orderlist-filter-input p-inputtext p-component",onChange:t.onFilter,onKeyDown:N},filterOptions:h,iconClassName:"p-orderlist-filter-icon",element:u,props:t});var d=s({className:l("filterContainer")},a("filterContainer"));return e.createElement("div",d,u)}return null}(),K=(r=t.value?t.value.map((function(n,r){var o=t.itemTemplate?t.itemTemplate(n):n,i=JSON.stringify(n),a=s({className:u(t.className,l("item",{item:n,isSelected:b})),onClick:function(e){return t.onItemClick({originalEvent:e,value:n,index:r})},onKeyDown:function(e){return t.onItemKeyDown({originalEvent:e,value:n,index:r})},role:"option","aria-selected":b(n),draggable:"true",onDragStart:function(e){return n=e,o=r,f.current=!0,v.current=o,void(t.dragdropScope&&n.dataTransfer.setData("text","orderlist"));var n,o},onDragEnd:O,tabIndex:t.tabIndex},c(n,"item"));if(t.dragdrop){var p=[];return 0===r&&p.push(T(n,r)),p.push(e.createElement("li",P({key:i},a),o,e.createElement(E,null))),p.push(T(r,i+"_droppoint")),p}var m=s({role:"option",tabIndex:t.tabIndex,className:u(t.className,l("item",{item:n,isSelected:b})),onClick:function(e){return t.onItemClick({originalEvent:e,value:n,index:r})},onKeyDown:function(e){return t.onItemKeyDown({originalEvent:e,value:n,index:r})},"aria-selected":b(n),"data-p-highlight":b(n)},c(n,"item"));return e.createElement("li",P({key:i},m),o)})):null,o=s({ref:y,className:l("list"),style:t.listStyle,onDragOver:D,role:"listbox","aria-multiselectable":!0},a("list")),e.createElement("ul",o,r)),L=s({className:l("container")},a("container"));return e.createElement("div",L,k,j,K)}));_.displayName="OrderListSubList";var U=e.memo(e.forwardRef((function(n,i){var m=e.useContext(r),v=K.getProps(n,m),g=j(e.useState([]),2),y=g[0],h=g[1],b=j(e.useState(""),2),I=b[0],E=b[1],w=j(e.useState(null),2),x=w[0],S=w[1],O=p.isNotEmpty(I),D=e.useRef(null),N=e.useRef(null),T=e.useRef(null),k={props:v,state:{selection:y,filterValue:I,attributeSelector:x}},P=K.setMetaData(k),R=P.ptm,B=P.cx;l(K.css.styles,P.isUnstyled,{name:"orderlist"});var F=function(e){var t,n=e.originalEvent.metaKey||e.originalEvent.ctrlKey,r=p.findIndexInList(e.value,y,v.dataKey);t=-1!==r?n?y.filter((function(e,t){return t!==r})):[e.value]:n?[].concat(C(y),[e.value]):[e.value],h(t)},A=function e(t){var n=t.nextElementSibling;return n?"item"===!d.getAttribute(n,"data-pc-section")?e(n):n:null},M=function e(t){var n=t.previousElementSibling;return n?"item"===!d.getAttribute(n,"data-pc-section")?e(n):n:null},U=function(){var e=d.findSingle(D.current,".p-orderlist-list"),t=d.find(e,".p-orderlist-item.p-highlight");if(t&&t.length)switch(T.current){case"up":d.scrollInView(e,t[0]);break;case"top":e.scrollTop=0;break;case"down":d.scrollInView(e,t[t.length-1]);break;case"bottom":setTimeout((function(){return e.scrollTop=e.scrollHeight}),100)}},H=function(){if(!N.current){N.current=d.createInlineStyle(m&&m.nonce||t.nonce);var e="\n@media screen and (max-width: ".concat(v.breakpoint,") {\n .p-orderlist[").concat(x,"] {\n flex-direction: column;\n }\n\n .p-orderlist[").concat(x,"] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[").concat(x,"] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[").concat(x,"] .p-orderlist-controls .p-button:last-child {\n margin-right: 0;\n }\n}\n");N.current.innerHTML=e}};e.useImperativeHandle(i,(function(){return{props:v,getElement:function(){return D.current}}})),a((function(){!x&&S(f())})),c((function(){return x&&(D.current.setAttribute(x,""),H()),function(){N.current=d.removeInlineStyle(N.current)}}),[x,v.breakpoint]),c((function(){T.current&&(U(),T.current=null)}));var V=function(){if(O){var e=I.trim().toLocaleLowerCase(v.filterLocale),t=v.filterBy?v.filterBy.split(","):[];return o.filter(v.value,t,e,v.filterMatchMode,v.filterLocale)}return v.value}(),J=s({ref:D,id:v.id,className:u(v.className,B("root")),style:v.style},K.getOtherProps(v),R("root"));return e.createElement("div",J,e.createElement(L,{hostName:"OrderList",value:V,selection:y,onReorder:function(e){v.onChange&&v.onChange({event:e.originalEvent,value:e.value}),T.current=e.direction},dataKey:v.dataKey,moveUpIcon:v.moveUpIcon,moveTopIcon:v.moveTopIcon,moveDownIcon:v.moveDownIcon,moveBottomIcon:v.moveBottomIcon,ptm:R,cx:B,unstyled:v.unstyled,metaData:k}),e.createElement(_,{hostName:"OrderList",value:V,selection:y,onItemClick:F,onItemKeyDown:function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var r=A(n);r&&r.focus(),t.preventDefault();break;case 38:var o=M(n);o&&o.focus(),t.preventDefault();break;case 13:F(e),t.preventDefault()}},onFilterInputChange:function(e){var t=e.target.value;E(t),v.onFilter&&v.onFilter({originalEvent:e,filter:t})},itemTemplate:v.itemTemplate,filter:v.filter,onFilter:function(e){var t=e.target.value;E(t),v.onFilter&&v.onFilter({originalEvent:e,value:t})},resetFilter:function(){E(""),v.onFilter&&v.onFilter({filter:""})},filterTemplate:v.filterTemplate,header:v.header,listStyle:v.listStyle,dataKey:v.dataKey,dragdrop:v.dragdrop,onChange:v.onChange,tabIndex:v.tabIndex,filterIcon:v.filterIcon,ptm:R,cx:B}))})));U.displayName="OrderList";export{U as OrderList};
|
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { classNames, mergeProps, IconUtils, ObjectUtils, DomHandler } from 'primereact/utils';
|
|
5
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
|
-
import { ChevronDownIcon } from 'primereact/icons/chevrondown';
|
|
7
|
-
import { ChevronUpIcon } from 'primereact/icons/chevronup';
|
|
8
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
9
|
-
|
|
10
|
-
function _arrayLikeToArray(arr, len) {
|
|
11
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
12
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13
|
-
return arr2;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function _arrayWithoutHoles(arr) {
|
|
17
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function _iterableToArray(iter) {
|
|
21
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
25
|
-
if (!o) return;
|
|
26
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
27
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
28
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
29
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
30
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _nonIterableSpread() {
|
|
34
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _toConsumableArray(arr) {
|
|
38
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var styles = "\n@layer primereact {\n .p-organizationchart-table {\n border-spacing: 0;\n border-collapse: separate;\n margin: 0 auto;\n }\n \n .p-organizationchart-table > tbody > tr > td {\n text-align: center;\n vertical-align: top;\n padding: 0 .75rem;\n }\n \n .p-organizationchart-node-content {\n display: inline-block;\n position: relative;\n }\n \n .p-organizationchart-node-content .p-node-toggler {\n position: absolute;\n bottom: -.75rem;\n margin-left: -.75rem;\n z-index: 2;\n left: 50%;\n user-select: none;\n cursor: pointer;\n width: 1.5rem;\n height: 1.5rem;\n text-decoration: none;\n }\n \n .p-organizationchart-node-content .p-node-toggler .p-node-toggler-icon {\n position: relative;\n top: .25rem;\n }\n \n .p-organizationchart-line-down {\n margin: 0 auto;\n height: 20px;\n width: 1px;\n }\n \n .p-organizationchart-line-right {\n border-radius: 0px;\n }\n \n .p-organizationchart-line-left {\n border-radius: 0;\n }\n \n .p-organizationchart-selectable-node {\n cursor: pointer;\n }\n}\n";
|
|
42
|
-
var classes = {
|
|
43
|
-
root: 'p-organizationchart p-component',
|
|
44
|
-
table: 'p-organizationchart-table',
|
|
45
|
-
node: function node(_ref) {
|
|
46
|
-
var props = _ref.nodeProps,
|
|
47
|
-
_node = _ref.node,
|
|
48
|
-
selected = _ref.selected;
|
|
49
|
-
return classNames('p-organizationchart-node-content', {
|
|
50
|
-
'p-organizationchart-selectable-node': props.selectionMode && _node.selectable !== false,
|
|
51
|
-
'p-highlight': selected
|
|
52
|
-
}, _node.className);
|
|
53
|
-
},
|
|
54
|
-
nodes: 'p-organizationchart-nodes',
|
|
55
|
-
lines: 'p-organizationchart-lines',
|
|
56
|
-
lineLeft: function lineLeft(_ref2) {
|
|
57
|
-
var index = _ref2.index;
|
|
58
|
-
return classNames('p-organizationchart-line-left', {
|
|
59
|
-
'p-organizationchart-line-top': index !== 0
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
lineRight: function lineRight(_ref3) {
|
|
63
|
-
var index = _ref3.index,
|
|
64
|
-
nodeChildLength = _ref3.nodeChildLength;
|
|
65
|
-
return classNames('p-organizationchart-line-right', {
|
|
66
|
-
'p-organizationchart-line-top': index !== nodeChildLength - 1
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
lineDown: 'p-organizationchart-line-down',
|
|
70
|
-
nodeTogglerIcon: 'p-node-toggler-icon',
|
|
71
|
-
nodeToggler: 'p-node-toggler'
|
|
72
|
-
};
|
|
73
|
-
var OrganizationChartBase = ComponentBase.extend({
|
|
74
|
-
defaultProps: {
|
|
75
|
-
__TYPE: 'OrganizationChart',
|
|
76
|
-
id: null,
|
|
77
|
-
value: null,
|
|
78
|
-
style: null,
|
|
79
|
-
className: null,
|
|
80
|
-
selectionMode: null,
|
|
81
|
-
selection: null,
|
|
82
|
-
nodeTemplate: null,
|
|
83
|
-
onSelectionChange: null,
|
|
84
|
-
onNodeSelect: null,
|
|
85
|
-
onNodeUnselect: null,
|
|
86
|
-
togglerIcon: null,
|
|
87
|
-
children: undefined
|
|
88
|
-
},
|
|
89
|
-
css: {
|
|
90
|
-
classes: classes,
|
|
91
|
-
styles: styles
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
function _extends() {
|
|
96
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
97
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
98
|
-
var source = arguments[i];
|
|
99
|
-
for (var key in source) {
|
|
100
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
101
|
-
target[key] = source[key];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return target;
|
|
106
|
-
};
|
|
107
|
-
return _extends.apply(this, arguments);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function _typeof(o) {
|
|
111
|
-
"@babel/helpers - typeof";
|
|
112
|
-
|
|
113
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
114
|
-
return typeof o;
|
|
115
|
-
} : function (o) {
|
|
116
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
117
|
-
}, _typeof(o);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _toPrimitive(input, hint) {
|
|
121
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
122
|
-
var prim = input[Symbol.toPrimitive];
|
|
123
|
-
if (prim !== undefined) {
|
|
124
|
-
var res = prim.call(input, hint || "default");
|
|
125
|
-
if (_typeof(res) !== "object") return res;
|
|
126
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
127
|
-
}
|
|
128
|
-
return (hint === "string" ? String : Number)(input);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function _toPropertyKey(arg) {
|
|
132
|
-
var key = _toPrimitive(arg, "string");
|
|
133
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function _defineProperty(obj, key, value) {
|
|
137
|
-
key = _toPropertyKey(key);
|
|
138
|
-
if (key in obj) {
|
|
139
|
-
Object.defineProperty(obj, key, {
|
|
140
|
-
value: value,
|
|
141
|
-
enumerable: true,
|
|
142
|
-
configurable: true,
|
|
143
|
-
writable: true
|
|
144
|
-
});
|
|
145
|
-
} else {
|
|
146
|
-
obj[key] = value;
|
|
147
|
-
}
|
|
148
|
-
return obj;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function _arrayWithHoles(arr) {
|
|
152
|
-
if (Array.isArray(arr)) return arr;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function _iterableToArrayLimit(r, l) {
|
|
156
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
157
|
-
if (null != t) {
|
|
158
|
-
var e,
|
|
159
|
-
n,
|
|
160
|
-
i,
|
|
161
|
-
u,
|
|
162
|
-
a = [],
|
|
163
|
-
f = !0,
|
|
164
|
-
o = !1;
|
|
165
|
-
try {
|
|
166
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
167
|
-
if (Object(t) !== t) return;
|
|
168
|
-
f = !1;
|
|
169
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
170
|
-
} catch (r) {
|
|
171
|
-
o = !0, n = r;
|
|
172
|
-
} finally {
|
|
173
|
-
try {
|
|
174
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
175
|
-
} finally {
|
|
176
|
-
if (o) throw n;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return a;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function _nonIterableRest() {
|
|
184
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function _slicedToArray(arr, i) {
|
|
188
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
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; }
|
|
192
|
-
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; }
|
|
193
|
-
var OrganizationChartNode = /*#__PURE__*/React.memo(function (props) {
|
|
194
|
-
var node = props.node;
|
|
195
|
-
var _React$useState = React.useState(node.expanded),
|
|
196
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
197
|
-
expandedState = _React$useState2[0],
|
|
198
|
-
setExpandedState = _React$useState2[1];
|
|
199
|
-
var leaf = node.leaf === false ? false : !(node.children && node.children.length);
|
|
200
|
-
var colspan = node.children && node.children.length ? node.children.length * 2 : null;
|
|
201
|
-
var selected = props.isSelected(node);
|
|
202
|
-
var visibility = !leaf && expandedState ? 'inherit' : 'hidden';
|
|
203
|
-
var ptm = props.ptm,
|
|
204
|
-
cx = props.cx,
|
|
205
|
-
sx = props.sx;
|
|
206
|
-
var _ptm = function _ptm(key, options) {
|
|
207
|
-
return ptm(key, _objectSpread({
|
|
208
|
-
hostName: props.hostName
|
|
209
|
-
}, options));
|
|
210
|
-
};
|
|
211
|
-
var getPTOptions = function getPTOptions(key) {
|
|
212
|
-
return _ptm(key, {
|
|
213
|
-
state: {
|
|
214
|
-
expanded: expandedState
|
|
215
|
-
},
|
|
216
|
-
context: {
|
|
217
|
-
selected: props.isSelected(node)
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
var getNodePTOptions = function getNodePTOptions(lineTop, key) {
|
|
222
|
-
return _ptm(key, {
|
|
223
|
-
context: {
|
|
224
|
-
lineTop: lineTop
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
var onNodeClick = function onNodeClick(event, node) {
|
|
229
|
-
props.onNodeClick(event, node);
|
|
230
|
-
};
|
|
231
|
-
var toggleNode = function toggleNode(event, node) {
|
|
232
|
-
setExpandedState(function (prevExpanded) {
|
|
233
|
-
return !prevExpanded;
|
|
234
|
-
});
|
|
235
|
-
event.preventDefault();
|
|
236
|
-
};
|
|
237
|
-
var createChildNodes = function createChildNodes() {
|
|
238
|
-
var nodesProps = mergeProps({
|
|
239
|
-
className: cx('nodes'),
|
|
240
|
-
style: {
|
|
241
|
-
visibility: visibility
|
|
242
|
-
}
|
|
243
|
-
}, _ptm('nodes'));
|
|
244
|
-
var nodeCellProps = mergeProps({
|
|
245
|
-
colSpan: '2'
|
|
246
|
-
}, _ptm('nodeCell'));
|
|
247
|
-
return /*#__PURE__*/React.createElement("tr", nodesProps, node.children && node.children.map(function (child, index) {
|
|
248
|
-
return /*#__PURE__*/React.createElement("td", _extends({
|
|
249
|
-
key: index
|
|
250
|
-
}, nodeCellProps), /*#__PURE__*/React.createElement(OrganizationChartNode, {
|
|
251
|
-
node: child,
|
|
252
|
-
nodeTemplate: props.nodeTemplate,
|
|
253
|
-
selectionMode: props.selectionMode,
|
|
254
|
-
onNodeClick: props.onNodeClick,
|
|
255
|
-
isSelected: props.isSelected,
|
|
256
|
-
togglerIcon: props.togglerIcon,
|
|
257
|
-
ptm: ptm,
|
|
258
|
-
cx: cx,
|
|
259
|
-
sx: sx
|
|
260
|
-
}));
|
|
261
|
-
}));
|
|
262
|
-
};
|
|
263
|
-
var createLinesMiddle = function createLinesMiddle() {
|
|
264
|
-
var nodeChildLength = node.children && node.children.length;
|
|
265
|
-
var linesProps = mergeProps({
|
|
266
|
-
className: cx('lines'),
|
|
267
|
-
style: {
|
|
268
|
-
visibility: visibility
|
|
269
|
-
}
|
|
270
|
-
}, _ptm('lines'));
|
|
271
|
-
var lineCellProps = mergeProps({
|
|
272
|
-
colSpan: colspan
|
|
273
|
-
}, _ptm('lineCell'));
|
|
274
|
-
var lineDownProps = mergeProps({
|
|
275
|
-
className: cx('lineDown')
|
|
276
|
-
}, _ptm('lineDown'));
|
|
277
|
-
return /*#__PURE__*/React.createElement("tr", linesProps, node.children && node.children.length === 1 && /*#__PURE__*/React.createElement("td", lineCellProps, /*#__PURE__*/React.createElement("div", lineDownProps)), node.children && node.children.length > 1 && node.children.map(function (_, index) {
|
|
278
|
-
var lineLeftProps = mergeProps({
|
|
279
|
-
className: cx('lineLeft', {
|
|
280
|
-
index: index
|
|
281
|
-
})
|
|
282
|
-
}, getNodePTOptions(index !== 0, 'lineLeft'));
|
|
283
|
-
var lineRightProps = mergeProps({
|
|
284
|
-
className: cx('lineRight', {
|
|
285
|
-
index: index,
|
|
286
|
-
nodeChildLength: nodeChildLength
|
|
287
|
-
})
|
|
288
|
-
}, getNodePTOptions(index !== nodeChildLength - 1, 'lineRight'));
|
|
289
|
-
return [/*#__PURE__*/React.createElement("td", _extends({
|
|
290
|
-
key: index + '_lineleft'
|
|
291
|
-
}, lineLeftProps), "\xA0"), /*#__PURE__*/React.createElement("td", _extends({
|
|
292
|
-
key: index + '_lineright'
|
|
293
|
-
}, lineRightProps), "\xA0")];
|
|
294
|
-
}));
|
|
295
|
-
};
|
|
296
|
-
var createLinesDown = function createLinesDown() {
|
|
297
|
-
var linesProps = mergeProps({
|
|
298
|
-
className: cx('lines'),
|
|
299
|
-
style: {
|
|
300
|
-
visibility: visibility
|
|
301
|
-
}
|
|
302
|
-
}, _ptm('lines'));
|
|
303
|
-
var lineCellProps = mergeProps({
|
|
304
|
-
colSpan: colspan
|
|
305
|
-
}, _ptm('lineCell'));
|
|
306
|
-
var lineDownProps = mergeProps({
|
|
307
|
-
className: cx('lineDown')
|
|
308
|
-
}, _ptm('lineDown'));
|
|
309
|
-
return /*#__PURE__*/React.createElement("tr", linesProps, /*#__PURE__*/React.createElement("td", lineCellProps, /*#__PURE__*/React.createElement("div", lineDownProps)));
|
|
310
|
-
};
|
|
311
|
-
var createToggler = function createToggler() {
|
|
312
|
-
if (!leaf) {
|
|
313
|
-
var nodeTogglerIconProps = mergeProps({
|
|
314
|
-
className: cx('nodeTogglerIcon')
|
|
315
|
-
}, _ptm('nodeTogglerIcon'));
|
|
316
|
-
var icon;
|
|
317
|
-
if (expandedState) {
|
|
318
|
-
icon = props.togglerIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, nodeTogglerIconProps);
|
|
319
|
-
} else {
|
|
320
|
-
icon = props.togglerIcon || /*#__PURE__*/React.createElement(ChevronUpIcon, nodeTogglerIconProps);
|
|
321
|
-
}
|
|
322
|
-
var togglerIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, nodeTogglerIconProps), {
|
|
323
|
-
props: props
|
|
324
|
-
});
|
|
325
|
-
var nodeTogglerProps = mergeProps({
|
|
326
|
-
className: cx('nodeToggler'),
|
|
327
|
-
onClick: function onClick(e) {
|
|
328
|
-
return toggleNode(e);
|
|
329
|
-
},
|
|
330
|
-
href: '#'
|
|
331
|
-
}, getPTOptions('nodeToggler'));
|
|
332
|
-
return (
|
|
333
|
-
/*#__PURE__*/
|
|
334
|
-
/* eslint-disable */
|
|
335
|
-
React.createElement("a", nodeTogglerProps, /*#__PURE__*/React.createElement("i", null, " ", togglerIcon, " "))
|
|
336
|
-
/* eslint-enable */
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
return null;
|
|
341
|
-
};
|
|
342
|
-
var createNodeLabel = function createNodeLabel() {
|
|
343
|
-
var label = props.nodeTemplate && ObjectUtils.getJSXElement(props.nodeTemplate, node) || node.label;
|
|
344
|
-
return /*#__PURE__*/React.createElement("div", null, label);
|
|
345
|
-
};
|
|
346
|
-
var createNodeContent = function createNodeContent() {
|
|
347
|
-
var label = createNodeLabel();
|
|
348
|
-
var toggler = createToggler();
|
|
349
|
-
var cellProps = mergeProps({
|
|
350
|
-
colSpan: colspan
|
|
351
|
-
}, _ptm('cell'));
|
|
352
|
-
var nodeProps = mergeProps({
|
|
353
|
-
className: cx('node', {
|
|
354
|
-
selected: selected,
|
|
355
|
-
node: node,
|
|
356
|
-
nodeProps: props
|
|
357
|
-
}),
|
|
358
|
-
style: node.style,
|
|
359
|
-
onClick: function onClick(e) {
|
|
360
|
-
return onNodeClick(e, node);
|
|
361
|
-
}
|
|
362
|
-
}, getPTOptions('node'));
|
|
363
|
-
var rowProps = mergeProps(_ptm('row'));
|
|
364
|
-
return /*#__PURE__*/React.createElement("tr", rowProps, /*#__PURE__*/React.createElement("td", cellProps, /*#__PURE__*/React.createElement("div", nodeProps, label, toggler)));
|
|
365
|
-
};
|
|
366
|
-
var nodeContent = createNodeContent();
|
|
367
|
-
var linesDown = createLinesDown();
|
|
368
|
-
var linesMiddle = createLinesMiddle();
|
|
369
|
-
var childNodes = createChildNodes();
|
|
370
|
-
var tableProps = mergeProps({
|
|
371
|
-
className: cx('table')
|
|
372
|
-
}, _ptm('table'));
|
|
373
|
-
return /*#__PURE__*/React.createElement("table", tableProps, /*#__PURE__*/React.createElement("tbody", null, nodeContent, linesDown, linesMiddle, childNodes));
|
|
374
|
-
});
|
|
375
|
-
OrganizationChartNode.displayName = 'OrganizationChartNode';
|
|
376
|
-
|
|
377
|
-
var OrganizationChart = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
378
|
-
var context = React.useContext(PrimeReactContext);
|
|
379
|
-
var props = OrganizationChartBase.getProps(inProps, context);
|
|
380
|
-
var _OrganizationChartBas = OrganizationChartBase.setMetaData({
|
|
381
|
-
props: props
|
|
382
|
-
}),
|
|
383
|
-
ptm = _OrganizationChartBas.ptm,
|
|
384
|
-
cx = _OrganizationChartBas.cx,
|
|
385
|
-
sx = _OrganizationChartBas.sx,
|
|
386
|
-
isUnstyled = _OrganizationChartBas.isUnstyled;
|
|
387
|
-
useHandleStyle(OrganizationChartBase.css.styles, isUnstyled, {
|
|
388
|
-
name: 'orgchart'
|
|
389
|
-
});
|
|
390
|
-
var elementRef = React.useRef(null);
|
|
391
|
-
var root = props.value && props.value.length ? props.value[0] : null;
|
|
392
|
-
var onNodeClick = function onNodeClick(event, node) {
|
|
393
|
-
if (props.selectionMode) {
|
|
394
|
-
var target = event.target;
|
|
395
|
-
if (node.selectable === false || DomHandler.hasClass(target, 'p-node-toggler') || DomHandler.hasClass(target, 'p-node-toggler-icon')) {
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
var index = findIndexInSelection(node);
|
|
399
|
-
var selected = index >= 0;
|
|
400
|
-
var selection;
|
|
401
|
-
if (props.selectionMode === 'single') {
|
|
402
|
-
if (selected) {
|
|
403
|
-
selection = null;
|
|
404
|
-
props.onNodeUnselect && props.onNodeUnselect({
|
|
405
|
-
originalEvent: event,
|
|
406
|
-
node: node
|
|
407
|
-
});
|
|
408
|
-
} else {
|
|
409
|
-
selection = node;
|
|
410
|
-
props.onNodeSelect && props.onNodeSelect({
|
|
411
|
-
originalEvent: event,
|
|
412
|
-
node: node
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
} else if (props.selectionMode === 'multiple') {
|
|
416
|
-
if (selected) {
|
|
417
|
-
selection = props.selection.filter(function (_, i) {
|
|
418
|
-
return i !== index;
|
|
419
|
-
});
|
|
420
|
-
props.onNodeUnselect && props.onNodeUnselect({
|
|
421
|
-
originalEvent: event,
|
|
422
|
-
node: node
|
|
423
|
-
});
|
|
424
|
-
} else {
|
|
425
|
-
selection = [].concat(_toConsumableArray(props.selection || []), [node]);
|
|
426
|
-
props.onNodeSelect && props.onNodeSelect({
|
|
427
|
-
originalEvent: event,
|
|
428
|
-
node: node
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
if (props.onSelectionChange) {
|
|
433
|
-
props.onSelectionChange({
|
|
434
|
-
originalEvent: event,
|
|
435
|
-
data: selection
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
var findIndexInSelection = function findIndexInSelection(node) {
|
|
441
|
-
if (props.selectionMode && props.selection) {
|
|
442
|
-
if (props.selectionMode === 'single') return props.selection === node ? 0 : -1;else if (props.selectionMode === 'multiple') return props.selection.findIndex(function (selectedNode) {
|
|
443
|
-
return selectedNode === node;
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
return -1;
|
|
447
|
-
};
|
|
448
|
-
var isSelected = function isSelected(node) {
|
|
449
|
-
return findIndexInSelection(node) !== -1;
|
|
450
|
-
};
|
|
451
|
-
React.useImperativeHandle(ref, function () {
|
|
452
|
-
return {
|
|
453
|
-
props: props,
|
|
454
|
-
getElement: function getElement() {
|
|
455
|
-
return elementRef.current;
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
});
|
|
459
|
-
var rootProps = mergeProps({
|
|
460
|
-
id: props.id,
|
|
461
|
-
ref: elementRef,
|
|
462
|
-
style: props.style,
|
|
463
|
-
className: classNames(props.className, cx('root'))
|
|
464
|
-
}, OrganizationChartBase.getOtherProps(props), ptm('root'));
|
|
465
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement(OrganizationChartNode, {
|
|
466
|
-
hostName: "OrganizationChart",
|
|
467
|
-
node: root,
|
|
468
|
-
nodeTemplate: props.nodeTemplate,
|
|
469
|
-
selectionMode: props.selectionMode,
|
|
470
|
-
onNodeClick: onNodeClick,
|
|
471
|
-
isSelected: isSelected,
|
|
472
|
-
togglerIcon: props.togglerIcon,
|
|
473
|
-
ptm: ptm,
|
|
474
|
-
cx: cx,
|
|
475
|
-
sx: sx
|
|
476
|
-
}));
|
|
477
|
-
}));
|
|
478
|
-
OrganizationChart.displayName = 'OrganizationChart';
|
|
479
|
-
|
|
480
|
-
export { OrganizationChart };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{classNames as n,mergeProps as t,IconUtils as r,ObjectUtils as o,DomHandler as l}from"primereact/utils";import{ComponentBase as i,useHandleStyle as a}from"primereact/componentbase";import{ChevronDownIcon as c}from"primereact/icons/chevrondown";import{ChevronUpIcon as s}from"primereact/icons/chevronup";import{PrimeReactContext as d}from"primereact/api";function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function p(e){if(Array.isArray(e))return u(e)}function m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,n){if(e){if("string"==typeof e)return u(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,n):void 0}}function f(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=i.extend({defaultProps:{__TYPE:"OrganizationChart",id:null,value:null,style:null,className:null,selectionMode:null,selection:null,nodeTemplate:null,onSelectionChange:null,onNodeSelect:null,onNodeUnselect:null,togglerIcon:null,children:void 0},css:{classes:{root:"p-organizationchart p-component",table:"p-organizationchart-table",node:function(e){var t=e.node;return n("p-organizationchart-node-content",{"p-organizationchart-selectable-node":e.nodeProps.selectionMode&&!1!==t.selectable,"p-highlight":e.selected},t.className)},nodes:"p-organizationchart-nodes",lines:"p-organizationchart-lines",lineLeft:function(e){return n("p-organizationchart-line-left",{"p-organizationchart-line-top":0!==e.index})},lineRight:function(e){return n("p-organizationchart-line-right",{"p-organizationchart-line-top":e.index!==e.nodeChildLength-1})},lineDown:"p-organizationchart-line-down",nodeTogglerIcon:"p-node-toggler-icon",nodeToggler:"p-node-toggler"},styles:"\n@layer primereact {\n .p-organizationchart-table {\n border-spacing: 0;\n border-collapse: separate;\n margin: 0 auto;\n }\n \n .p-organizationchart-table > tbody > tr > td {\n text-align: center;\n vertical-align: top;\n padding: 0 .75rem;\n }\n \n .p-organizationchart-node-content {\n display: inline-block;\n position: relative;\n }\n \n .p-organizationchart-node-content .p-node-toggler {\n position: absolute;\n bottom: -.75rem;\n margin-left: -.75rem;\n z-index: 2;\n left: 50%;\n user-select: none;\n cursor: pointer;\n width: 1.5rem;\n height: 1.5rem;\n text-decoration: none;\n }\n \n .p-organizationchart-node-content .p-node-toggler .p-node-toggler-icon {\n position: relative;\n top: .25rem;\n }\n \n .p-organizationchart-line-down {\n margin: 0 auto;\n height: 20px;\n width: 1px;\n }\n \n .p-organizationchart-line-right {\n border-radius: 0px;\n }\n \n .p-organizationchart-line-left {\n border-radius: 0;\n }\n \n .p-organizationchart-selectable-node {\n cursor: pointer;\n }\n}\n"}});function y(){return y=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},y.apply(this,arguments)}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function v(e,n){if("object"!==b(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function S(e){var n=v(e,"string");return"symbol"===b(n)?n:String(n)}function E(e){if(Array.isArray(e))return e}function N(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,l,i,a=[],c=!0,s=!1;try{if(l=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=l.call(t)).done)&&(a.push(r.value),a.length!==n);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw o}}return a}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function x(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){var r,o,l;r=e,l=t[n],(o=S(o=n))in r?Object.defineProperty(r,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[o]=l})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var z=e.memo((function(n){var l,i,a,d,u,p,m,f,h,b,v,S,w=n.node,j=e.useState(w.expanded),C=(i=2,E(l=j)||N(l,i)||g(l,i)||O()),I=C[0],P=C[1],T=!1!==w.leaf&&!(w.children&&w.children.length),M=w.children&&w.children.length?2*w.children.length:null,k=n.isSelected(w),D=!T&&I?"inherit":"hidden",A=n.ptm,U=n.cx,L=n.sx,R=function(e,t){return A(e,x({hostName:n.hostName},t))},_=function(e){return R(e,{state:{expanded:I},context:{selected:n.isSelected(w)}})},J=function(e,n){return R(n,{context:{lineTop:e}})},X=function(e,t){n.onNodeClick(e,t)},H=function(){if(!T){var o=t({className:U("nodeTogglerIcon")},R("nodeTogglerIcon")),l=r.getJSXIcon(I?n.togglerIcon||e.createElement(c,o):n.togglerIcon||e.createElement(s,o),x({},o),{props:n}),i=t({className:U("nodeToggler"),onClick:function(e){return n=e,P((function(e){return!e})),void n.preventDefault();var n},href:"#"},_("nodeToggler"));return e.createElement("a",i,e.createElement("i",null," ",l," "))}return null},Y=function(){var t=n.nodeTemplate&&o.getJSXElement(n.nodeTemplate,w)||w.label;return e.createElement("div",null,t)},$=(a=Y(),d=H(),u=t({colSpan:M},R("cell")),p=t({className:U("node",{selected:k,node:w,nodeProps:n}),style:w.style,onClick:function(e){return X(e,w)}},_("node")),m=t(R("row")),e.createElement("tr",m,e.createElement("td",u,e.createElement("div",p,a,d)))),q=(f=t({className:U("lines"),style:{visibility:D}},R("lines")),h=t({colSpan:M},R("lineCell")),b=t({className:U("lineDown")},R("lineDown")),e.createElement("tr",f,e.createElement("td",h,e.createElement("div",b)))),B=function(){var n=w.children&&w.children.length,r=t({className:U("lines"),style:{visibility:D}},R("lines")),o=t({colSpan:M},R("lineCell")),l=t({className:U("lineDown")},R("lineDown"));return e.createElement("tr",r,w.children&&1===w.children.length&&e.createElement("td",o,e.createElement("div",l)),w.children&&w.children.length>1&&w.children.map((function(r,o){var l=t({className:U("lineLeft",{index:o})},J(0!==o,"lineLeft")),i=t({className:U("lineRight",{index:o,nodeChildLength:n})},J(o!==n-1,"lineRight"));return[e.createElement("td",y({key:o+"_lineleft"},l)," "),e.createElement("td",y({key:o+"_lineright"},i)," ")]})))}(),F=(v=t({className:U("nodes"),style:{visibility:D}},R("nodes")),S=t({colSpan:"2"},R("nodeCell")),e.createElement("tr",v,w.children&&w.children.map((function(t,r){return e.createElement("td",y({key:r},S),e.createElement(z,{node:t,nodeTemplate:n.nodeTemplate,selectionMode:n.selectionMode,onNodeClick:n.onNodeClick,isSelected:n.isSelected,togglerIcon:n.togglerIcon,ptm:A,cx:U,sx:L}))})))),G=t({className:U("table")},R("table"));return e.createElement("table",G,e.createElement("tbody",null,$,q,B,F))}));z.displayName="OrganizationChartNode";var j=e.memo(e.forwardRef((function(r,o){var i=e.useContext(d),c=h.getProps(r,i),s=h.setMetaData({props:c}),u=s.ptm,y=s.cx,b=s.sx;a(h.css.styles,s.isUnstyled,{name:"orgchart"});var v=e.useRef(null),S=c.value&&c.value.length?c.value[0]:null,E=function(e){if(c.selectionMode&&c.selection){if("single"===c.selectionMode)return c.selection===e?0:-1;if("multiple"===c.selectionMode)return c.selection.findIndex((function(n){return n===e}))}return-1};e.useImperativeHandle(o,(function(){return{props:c,getElement:function(){return v.current}}}));var N=t({id:c.id,ref:v,style:c.style,className:n(c.className,y("root"))},h.getOtherProps(c),u("root"));return e.createElement("div",N,e.createElement(z,{hostName:"OrganizationChart",node:S,nodeTemplate:c.nodeTemplate,selectionMode:c.selectionMode,onNodeClick:function(e,n){if(c.selectionMode){var t=e.target;if(!1===n.selectable||l.hasClass(t,"p-node-toggler")||l.hasClass(t,"p-node-toggler-icon"))return;var r,o=E(n),i=o>=0;"single"===c.selectionMode?i?(r=null,c.onNodeUnselect&&c.onNodeUnselect({originalEvent:e,node:n})):(r=n,c.onNodeSelect&&c.onNodeSelect({originalEvent:e,node:n})):"multiple"===c.selectionMode&&(i?(r=c.selection.filter((function(e,n){return n!==o})),c.onNodeUnselect&&c.onNodeUnselect({originalEvent:e,node:n})):(r=[].concat(p(a=c.selection||[])||m(a)||g(a)||f(),[n]),c.onNodeSelect&&c.onNodeSelect({originalEvent:e,node:n}))),c.onSelectionChange&&c.onSelectionChange({originalEvent:e,data:r})}var a},isSelected:function(e){return-1!==E(e)},togglerIcon:c.togglerIcon,ptm:u,cx:y,sx:b}))})));j.displayName="OrganizationChart";export{j as OrganizationChart};
|