-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8960.d3f83a33c25daef4.js
1 lines (1 loc) · 14.9 KB
/
8960.d3f83a33c25daef4.js
1
"use strict";(self.webpackChunknp_ui_lib_app=self.webpackChunknp_ui_lib_app||[]).push([[8960],{8960:(J,r,o)=>{o.r(r),o.d(r,{NpTreeViewDemoModule:()=>Z});var p=o(6895),_=o(8379),t=o(5499),e=o(4650),c=o(433);const u=["treeview"],A=["treeview2"],I=["treeview3"];function w(T,a){if(1&T&&e._uU(0),2&T){const d=a.item;e.AsE(" (",d.data.index,") ",d.label," ")}}class s{constructor(){this.importText="import { NpTreeViewModule } from 'np-ui-lib';",this.htmlText='<np-tree-view [items]="items">\n</np-tree-view>',this.modelText="items: NpTreeViewItem[] = [\n new NpTreeViewItem({\n label: 'Item 1',\n id: 'Item 1',\n childItems: [\n new NpTreeViewItem({\n label: 'Item 1.1', id: 'Item 1.1', childItems: [\n new NpTreeViewItem({ label: 'Item 1.1.1', id: 'Item 1.1.1' }),\n new NpTreeViewItem({ label: 'Item 1.1.2', id: 'Item 1.1.2' }),\n new NpTreeViewItem({ label: 'Item 1.1.3', id: 'Item 1.1.3' }),\n new NpTreeViewItem({ label: 'Item 1.1.4', id: 'Item 1.1.4' }),\n ]\n })\n ]\n }),\n ...\n];",this.itemTemplateText='<ng-template #itemTemplate let-item="item">\n {{item.label}}, {{item.key}}\n</ng-template>',this.items=[new t.JJ({label:"Item 1",iconCss:"fa fa-folder",childItems:[new t.JJ({label:"Item 1.1",iconCss:"fa fa-folder",childItems:[new t.JJ({label:"Item 1.1.1",iconCss:"fa fa-file"}),new t.JJ({label:"Item 1.1.2",iconCss:"fa fa-file"}),new t.JJ({label:"Item 1.1.3",iconCss:"fa fa-file"}),new t.JJ({label:"Item 1.1.4",iconCss:"fa fa-file"})]}),new t.JJ({label:"Item 1.2",iconCss:"fa fa-file"}),new t.JJ({label:"Item 1.3",iconCss:"fa fa-file"}),new t.JJ({label:"Item 1.4",iconCss:"fa fa-file"})]}),new t.JJ({label:"Item 2",iconCss:"fa fa-folder",childItems:[new t.JJ({label:"Item 2.1",iconCss:"fa fa-folder",childItems:[new t.JJ({label:"Item 2.1.1",iconCss:"fa fa-file"}),new t.JJ({label:"Item 2.1.2",iconCss:"fa fa-file"}),new t.JJ({label:"Item 2.1.3",iconCss:"fa fa-file"}),new t.JJ({label:"Item 2.1.4",iconCss:"fa fa-file"})]}),new t.JJ({label:"Item 2.2",iconCss:"fa fa-file"}),new t.JJ({label:"Item 2.3",iconCss:"fa fa-file"}),new t.JJ({label:"Item 2.4",iconCss:"fa fa-file"})]}),new t.JJ({label:"Item 3",iconCss:"fa fa-folder",childItems:[]}),new t.JJ({label:"Item 4",iconCss:"fa fa-file"}),new t.JJ({label:"Item 5",iconCss:"fa fa-file"})],this.items2=[new t.JJ({label:"Item 1",id:"Item 1",data:{index:"1"},childItems:[new t.JJ({label:"Item 1.1",id:"Item 1.1",data:{index:"1.1"},childItems:[new t.JJ({label:"Item 1.1.1",id:"Item 1.1.1",data:{index:"1.1.1"}}),new t.JJ({label:"Item 1.1.2",id:"Item 1.1.2",data:{index:"1.1.2"}}),new t.JJ({label:"Item 1.1.3",id:"Item 1.1.3",data:{index:"1.1.3"}}),new t.JJ({label:"Item 1.1.4",id:"Item 1.1.4",data:{index:"1.1.4"}})]}),new t.JJ({label:"Item 1.2",id:"Item 1.2",data:{index:"1.2"}}),new t.JJ({label:"Item 1.3",id:"Item 1.3",data:{index:"1.3"}}),new t.JJ({label:"Item 1.4",id:"Item 1.4",data:{index:"1.4"}})]}),new t.JJ({label:"Item 2",id:"Item 2",data:{index:"2"},childItems:[new t.JJ({label:"Item 2.1",id:"Item 2.1",data:{index:"2.1"},childItems:[new t.JJ({label:"Item 2.1.1",id:"Item 2.1.1",data:{index:"2.2.1"}}),new t.JJ({label:"Item 2.1.2",id:"Item 2.1.2",data:{index:"2.2.2"}}),new t.JJ({label:"Item 2.1.3",id:"Item 2.1.3",data:{index:"2.2.3"}}),new t.JJ({label:"Item 2.1.4",id:"Item 2.1.4",data:{index:"2.2.4"}})]}),new t.JJ({label:"Item 2.2",id:"Item 2.2",data:{index:"2.2"}}),new t.JJ({label:"Item 2.3",id:"Item 2.3",data:{index:"2.3"}}),new t.JJ({label:"Item 2.4",id:"Item 2.4",data:{index:"2.4"}})]}),new t.JJ({label:"Item 3",id:"Item 3",data:{index:"3"},childItems:[]}),new t.JJ({label:"Item 4",id:"Item 4",data:{index:"4"}}),new t.JJ({label:"Item 5",id:"Item 5",data:{index:"5"}})],this.items3=[new t.JJ({label:"Item 1",id:"Item 1",data:{index:"1"},childItems:[new t.JJ({label:"Item 1.1",id:"Item 1.1",data:{index:"1.1"},childItems:[new t.JJ({label:"Item 1.1.1",id:"Item 1.1.1",data:{index:"1.1.1"}}),new t.JJ({label:"Item 1.1.2",id:"Item 1.1.2",data:{index:"1.1.2"}}),new t.JJ({label:"Item 1.1.3",id:"Item 1.1.3",data:{index:"1.1.3"}}),new t.JJ({label:"Item 1.1.4",id:"Item 1.1.4",data:{index:"1.1.4"}})]}),new t.JJ({label:"Item 1.2",id:"Item 1.2",data:{index:"1.2"}}),new t.JJ({label:"Item 1.3",id:"Item 1.3",data:{index:"1.3"}}),new t.JJ({label:"Item 1.4",id:"Item 1.4",data:{index:"1.4"}})]}),new t.JJ({label:"Item 2",id:"Item 2",data:{index:"2"},childItems:[new t.JJ({label:"Item 2.1",id:"Item 2.1",data:{index:"2.1"},childItems:[new t.JJ({label:"Item 2.1.1",id:"Item 2.1.1",data:{index:"2.2.1"}}),new t.JJ({label:"Item 2.1.2",id:"Item 2.1.2",data:{index:"2.2.2"}}),new t.JJ({label:"Item 2.1.3",id:"Item 2.1.3",data:{index:"2.2.3"}}),new t.JJ({label:"Item 2.1.4",id:"Item 2.1.4",data:{index:"2.2.4"}})]}),new t.JJ({label:"Item 2.2",id:"Item 2.2",data:{index:"2.2"}}),new t.JJ({label:"Item 2.3",id:"Item 2.3",data:{index:"2.3"}}),new t.JJ({label:"Item 2.4",id:"Item 2.4",data:{index:"2.4"}})]}),new t.JJ({label:"Item 3",id:"Item 3",data:{index:"3"},childItems:[]}),new t.JJ({label:"Item 4",id:"Item 4",data:{index:"4"}}),new t.JJ({label:"Item 5",id:"Item 5",data:{index:"5"}})],this.selection3=[{label:"Item 4",id:"Item 4",data:{index:"4"}},{label:"Item 1.1.1",id:"Item 1.1.1",data:{index:"1.1.1"}}],this.isCascadeSelection=!0}ngOnInit(){}setAllExpand(){this.treeview.expandAll()}setAllCollapse(){this.treeview.collapseAll()}onClick(a){alert(a.label)}onExpand(a){console.log(a.label+" is expanded.")}onCollapse(a){console.log(a.label+" is collapsed.")}onExpandAll(a){console.log("All are expanded.")}onCollapseAll(a){console.log("All are collapsed.")}onSelect(a){console.log("Node selected.")}onDeselect(a){console.log("Node deselected.")}selectAll(){this.treeview3.selectAll()}deselectAll(){this.treeview3.deselectAll()}static#e=this.\u0275fac=function(d){return new(d||s)};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["app-np-tree-view-demo"]],viewQuery:function(d,l){if(1&d&&(e.Gf(u,7),e.Gf(A,7),e.Gf(I,7)),2&d){let n;e.iGM(n=e.CRH())&&(l.treeview=n.first),e.iGM(n=e.CRH())&&(l.treeview2=n.first),e.iGM(n=e.CRH())&&(l.treeview3=n.first)}},decls:286,vars:20,consts:[[1,"page-header"],["title","Documentation"],[3,"innerText"],[1,"np-table"],[1,"np-text-danger"],["title","Examples"],[3,"items","onClick","onExpand","onCollapse","onExpandAll","onCollapseAll"],["treeview",""],[1,"np-btn-group"],[1,"np-btn",3,"click"],[3,"items","selection","selectionMode","selectionChange","onSelect","onDeselect"],["treeview2",""],[3,"items","itemTemplate","selection","selectionMode","cascadeSelection","selectionChange"],["treeview3",""],[3,"ngModel","ngModelChange"],["itemTemplate",""]],template:function(d,l){if(1&d&&(e.TgZ(0,"h2",0),e._uU(1,"Tree View"),e.qZA(),e.TgZ(2,"np-tabs")(3,"np-tab",1)(4,"np-card")(5,"np-card-body")(6,"b"),e._uU(7,"Module to import"),e.qZA(),e.TgZ(8,"div")(9,"pre"),e._UZ(10,"code",2),e.qZA()()()(),e.TgZ(11,"np-card")(12,"np-card-body")(13,"b"),e._uU(14,"HTML"),e.qZA(),e.TgZ(15,"div")(16,"pre"),e._UZ(17,"code",2),e.qZA()()()(),e.TgZ(18,"np-card")(19,"np-card-body")(20,"table",3)(21,"tr")(22,"th"),e._uU(23,"Property"),e.qZA(),e.TgZ(24,"th"),e._uU(25,"Description"),e.qZA(),e.TgZ(26,"th"),e._uU(27,"Type"),e.qZA(),e.TgZ(28,"th"),e._uU(29,"Default"),e.qZA()(),e.TgZ(30,"tr")(31,"td"),e._uU(32,"items"),e.qZA(),e.TgZ(33,"td"),e._uU(34,"Array of data in hierarchical structure"),e.qZA(),e.TgZ(35,"td"),e._uU(36,"NpTreeViewItem[]"),e.qZA(),e._UZ(37,"td"),e.qZA(),e.TgZ(38,"tr")(39,"td"),e._uU(40,"selectionMode"),e.qZA(),e.TgZ(41,"td"),e._uU(42,"Set selection mode as 'single' or 'multiple'"),e.qZA(),e.TgZ(43,"td"),e._uU(44,"string"),e.qZA(),e._UZ(45,"td"),e.qZA(),e.TgZ(46,"tr")(47,"td"),e._uU(48,"itemTemplate"),e.qZA(),e.TgZ(49,"td"),e._uU(50," Set template for each item "),e.TgZ(51,"pre"),e._UZ(52,"code",2),e.qZA()(),e.TgZ(53,"td"),e._uU(54,"TemplateRef<any>"),e.qZA(),e._UZ(55,"td"),e.qZA(),e.TgZ(56,"tr")(57,"td"),e._uU(58,"selection"),e.qZA(),e.TgZ(59,"td"),e._uU(60,"Get/Set selected nodes"),e.qZA(),e.TgZ(61,"td"),e._uU(62,"NpTreeViewItem[]"),e.qZA(),e._UZ(63,"td"),e.qZA(),e.TgZ(64,"tr")(65,"td"),e._uU(66,"cascadeSelection"),e.qZA(),e.TgZ(67,"td"),e._uU(68," If set true then, select/deselect descendant nodes when users select items "),e.qZA(),e.TgZ(69,"td"),e._uU(70,"boolean"),e.qZA(),e.TgZ(71,"td"),e._uU(72,"false"),e.qZA()(),e.TgZ(73,"tr")(74,"td"),e._uU(75,"styleClass"),e.qZA(),e.TgZ(76,"td"),e._uU(77,"Set extra class on component"),e.qZA(),e.TgZ(78,"td"),e._uU(79,"string"),e.qZA(),e._UZ(80,"td"),e.qZA(),e.TgZ(81,"tr")(82,"td"),e._uU(83,"inputId"),e.qZA(),e.TgZ(84,"td"),e._uU(85,"Set id attribute"),e.qZA(),e.TgZ(86,"td"),e._uU(87,"string"),e.qZA(),e._UZ(88,"td"),e.qZA()()()(),e.TgZ(89,"np-card")(90,"np-card-body")(91,"table",3)(92,"tr")(93,"th"),e._uU(94,"Method"),e.qZA(),e.TgZ(95,"th"),e._uU(96,"Description"),e.qZA(),e.TgZ(97,"th"),e._uU(98,"Parameters"),e.qZA()(),e.TgZ(99,"tr")(100,"td"),e._uU(101,"onClick(NpTreeViewItem : node)"),e.qZA(),e.TgZ(102,"td"),e._uU(103,"Callback to click event on node"),e.qZA(),e.TgZ(104,"td"),e._uU(105,"NpTreeViewItem : node"),e.qZA()(),e.TgZ(106,"tr")(107,"td"),e._uU(108,"onExpand(NpTreeViewItem : node)"),e.qZA(),e.TgZ(109,"td"),e._uU(110,"Callback when expanding node"),e.qZA(),e.TgZ(111,"td"),e._uU(112,"NpTreeViewItem : node"),e.qZA()(),e.TgZ(113,"tr")(114,"td"),e._uU(115,"onCollapse(NpTreeViewItem : node)"),e.qZA(),e.TgZ(116,"td"),e._uU(117,"Callback when collapsing node"),e.qZA(),e.TgZ(118,"td"),e._uU(119,"NpTreeViewItem : node"),e.qZA()(),e.TgZ(120,"tr")(121,"td"),e._uU(122,"onExpandAll()"),e.qZA(),e.TgZ(123,"td"),e._uU(124,"Callback when expanding all node"),e.qZA(),e._UZ(125,"td"),e.qZA(),e.TgZ(126,"tr")(127,"td"),e._uU(128,"onCollapseAll()"),e.qZA(),e.TgZ(129,"td"),e._uU(130,"Callback when collapsing all node"),e.qZA(),e._UZ(131,"td"),e.qZA(),e.TgZ(132,"tr")(133,"td"),e._uU(134,"onSelect(NpTreeViewItem : node)"),e.qZA(),e.TgZ(135,"td"),e._uU(136,"Callback when selecting node"),e.qZA(),e.TgZ(137,"td"),e._uU(138,"NpTreeViewItem : node"),e.qZA()(),e.TgZ(139,"tr")(140,"td"),e._uU(141,"onDeselect(NpTreeViewItem : node)"),e.qZA(),e.TgZ(142,"td"),e._uU(143,"Callback when deselecting node"),e.qZA(),e.TgZ(144,"td"),e._uU(145,"NpTreeViewItem : node"),e.qZA()()()()(),e.TgZ(146,"np-card")(147,"np-card-body")(148,"table",3)(149,"tr")(150,"th"),e._uU(151,"Api"),e.qZA(),e.TgZ(152,"th"),e._uU(153,"Description"),e.qZA(),e.TgZ(154,"th"),e._uU(155,"Parameters"),e.qZA()(),e.TgZ(156,"tr")(157,"td"),e._uU(158,"expandAll()"),e.qZA(),e.TgZ(159,"td"),e._uU(160,"Expand all nodes"),e.qZA(),e._UZ(161,"td"),e.qZA(),e.TgZ(162,"tr")(163,"td"),e._uU(164,"collapseAll()"),e.qZA(),e.TgZ(165,"td"),e._uU(166,"Collapse all nodes"),e.qZA(),e._UZ(167,"td"),e.qZA(),e.TgZ(168,"tr")(169,"td"),e._uU(170,"selectAll()"),e.qZA(),e.TgZ(171,"td"),e._uU(172,"Select all nodes"),e.qZA(),e._UZ(173,"td"),e.qZA(),e.TgZ(174,"tr")(175,"td"),e._uU(176,"deselectAll()"),e.qZA(),e.TgZ(177,"td"),e._uU(178,"Deselect all nodes"),e.qZA(),e._UZ(179,"td"),e.qZA()()()(),e.TgZ(180,"np-card")(181,"np-card-body")(182,"b"),e._uU(183,"NpTreeViewItem"),e.qZA(),e.TgZ(184,"pre")(185,"code"),e._uU(186),e.qZA()(),e.TgZ(187,"table",3)(188,"tr")(189,"th"),e._uU(190,"Property"),e.qZA(),e.TgZ(191,"th"),e._uU(192,"Description"),e.qZA(),e.TgZ(193,"th"),e._uU(194,"Type"),e.qZA(),e.TgZ(195,"th"),e._uU(196,"Default"),e.qZA()(),e.TgZ(197,"tr")(198,"td"),e._uU(199,"label"),e.qZA(),e.TgZ(200,"td"),e._uU(201,"Label to display"),e.qZA(),e.TgZ(202,"td"),e._uU(203,"string"),e.qZA(),e._UZ(204,"td"),e.qZA(),e.TgZ(205,"tr")(206,"td"),e._uU(207,"id"),e.qZA(),e.TgZ(208,"td"),e._uU(209," Unique id for object identification in selection, "),e._UZ(210,"br"),e.TgZ(211,"span",4),e._uU(212," id must be defined for selection. "),e.qZA()(),e.TgZ(213,"td"),e._uU(214,"any"),e.qZA(),e._UZ(215,"td"),e.qZA(),e.TgZ(216,"tr")(217,"td"),e._uU(218,"iconCss"),e.qZA(),e.TgZ(219,"td"),e._uU(220,"Set Class name for icon like 'fa fa-file'"),e.qZA(),e.TgZ(221,"td"),e._uU(222,"string"),e.qZA(),e._UZ(223,"td"),e.qZA(),e.TgZ(224,"tr")(225,"td"),e._uU(226,"childItems"),e.qZA(),e.TgZ(227,"td"),e._uU(228,"Child nodes"),e.qZA(),e.TgZ(229,"td"),e._uU(230,"NpTreeViewItem[]"),e.qZA(),e._UZ(231,"td"),e.qZA(),e.TgZ(232,"tr")(233,"td"),e._uU(234,"isExpanded"),e.qZA(),e.TgZ(235,"td"),e._uU(236,"Set expanded on load time"),e.qZA(),e.TgZ(237,"td"),e._uU(238,"boolean"),e.qZA(),e.TgZ(239,"td"),e._uU(240,"false"),e.qZA()(),e.TgZ(241,"tr")(242,"td"),e._uU(243,"data"),e.qZA(),e.TgZ(244,"td"),e._uU(245,"Set data"),e.qZA(),e.TgZ(246,"td"),e._uU(247,"any"),e.qZA(),e._UZ(248,"td"),e.qZA()()()()(),e.TgZ(249,"np-tab",5)(250,"fieldset")(251,"legend"),e._uU(252,"Treeview basic"),e.qZA(),e.TgZ(253,"np-tree-view",6,7),e.NdJ("onClick",function(i){return l.onClick(i)})("onExpand",function(i){return l.onExpand(i)})("onCollapse",function(i){return l.onCollapse(i)})("onExpandAll",function(i){return l.onExpandAll(i)})("onCollapseAll",function(i){return l.onCollapseAll(i)}),e.qZA(),e.TgZ(255,"div",8)(256,"button",9),e.NdJ("click",function(){return l.setAllExpand()}),e._uU(257,"Expand All"),e.qZA(),e.TgZ(258,"button",9),e.NdJ("click",function(){return l.setAllCollapse()}),e._uU(259,"Collapse All"),e.qZA()()(),e.TgZ(260,"fieldset")(261,"legend"),e._uU(262,"Treeview single selection"),e.qZA(),e.TgZ(263,"np-tree-view",10,11),e.NdJ("selectionChange",function(i){return l.selection2=i})("onSelect",function(i){return l.onSelect(i)})("onDeselect",function(i){return l.onDeselect(i)}),e.qZA(),e.TgZ(265,"div"),e._uU(266),e.ALo(267,"json"),e.qZA()(),e.TgZ(268,"fieldset")(269,"legend"),e._uU(270,"Treeview multiple selection with template"),e.qZA(),e.TgZ(271,"np-tree-view",12,13),e.NdJ("selectionChange",function(i){return l.selection3=i}),e.qZA(),e.TgZ(273,"div"),e._uU(274),e.ALo(275,"json"),e.qZA(),e.TgZ(276,"div",8)(277,"button",9),e.NdJ("click",function(){return l.selectAll()}),e._uU(278,"Select All"),e.qZA(),e.TgZ(279,"button",9),e.NdJ("click",function(){return l.deselectAll()}),e._uU(280,"Deselect All"),e.qZA()(),e.TgZ(281,"div"),e._uU(282," cascadeSelection: "),e.TgZ(283,"np-switch",14),e.NdJ("ngModelChange",function(i){return l.isCascadeSelection=i}),e.qZA()(),e.YNc(284,w,1,2,"ng-template",null,15,e.W1O),e.qZA()()()),2&d){const n=e.MAs(285);e.xp6(10),e.Q6J("innerText",l.importText),e.xp6(7),e.Q6J("innerText",l.htmlText),e.xp6(35),e.Q6J("innerText",l.itemTemplateText),e.xp6(134),e.Oqu(l.modelText),e.xp6(67),e.Q6J("items",l.items),e.xp6(10),e.Q6J("items",l.items2)("selection",l.selection2)("selectionMode","single"),e.xp6(3),e.hij("Selected value : ",e.lcZ(267,16,l.selection2),""),e.xp6(5),e.Q6J("items",l.items3)("itemTemplate",n)("selection",l.selection3)("selectionMode","multiple")("cascadeSelection",l.isCascadeSelection),e.xp6(3),e.hij("Selected value : ",e.lcZ(275,18,l.selection3),""),e.xp6(9),e.Q6J("ngModel",l.isCascadeSelection)}},dependencies:[c.JJ,c.On,t.JP,t.KA,t.Qk,t.c0,t.El,t.Mc,p.Ts],encapsulation:2})}const g=[{path:"",component:s}];class m{static#e=this.\u0275fac=function(d){return new(d||m)};static#t=this.\u0275mod=e.oAB({type:m});static#l=this.\u0275inj=e.cJS({imports:[_.Bz.forChild(g),_.Bz]})}class Z{static#e=this.\u0275fac=function(d){return new(d||Z)};static#t=this.\u0275mod=e.oAB({type:Z});static#l=this.\u0275inj=e.cJS({imports:[p.ez,c.u5,m,t.n8,t.i7,t.Tk,t.kH]})}}}]);