-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9828.f23b2d70712fa415.js
1 lines (1 loc) · 13.4 KB
/
9828.f23b2d70712fa415.js
1
"use strict";(self.webpackChunknp_ui_lib_app=self.webpackChunknp_ui_lib_app||[]).push([[9828],{9828:(C,g,r)=>{r.r(g),r.d(g,{NpListDemoModule:()=>m});var u=r(6895),p=r(8379),e=r(4650),_=r(529),o=r(5499);const c=["list2"];function T(s,n){if(1&s&&(e._uU(0),e._UZ(1,"br"),e._uU(2)),2&s){const t=n.item;e.hij(" Name: ",t.name,","),e.xp6(2),e.hij(" Age: ",t.age," ")}}function A(s,n){if(1&s&&(e._uU(0," Name: "),e.TgZ(1,"b"),e._uU(2),e.qZA(),e._uU(3,","),e._UZ(4,"br"),e._uU(5," Age: "),e.TgZ(6,"b"),e._uU(7),e.qZA()),2&s){const t=n.item;e.xp6(2),e.Oqu(t.name),e.xp6(5),e.Oqu(t.age)}}function U(s,n){if(1&s&&(e._uU(0),e._UZ(1,"br"),e._uU(2),e._UZ(3,"br"),e._uU(4)),2&s){const t=n.item;e.hij(" Id: ",t.id,","),e.xp6(2),e.hij(" Name: ",t.name,","),e.xp6(2),e.hij(" Age: ",t.age," ")}}function h(s,n){if(1&s&&(e._uU(0),e._UZ(1,"br"),e._uU(2),e._UZ(3,"br"),e._uU(4)),2&s){const t=n.item;e.hij(" Name: ",t.ProductName,","),e.xp6(2),e.hij(" Unit price: ",t.UnitPrice,","),e.xp6(2),e.hij(" In stock: ",t.UnitsInStock," ")}}class d{constructor(n){this.http=n,this.importText="import { NpListModule } from 'np-ui-lib';",this.htmlText='<np-list [items]="items" [itemTemplate]="listTemplate">\n</np-list>\n\n<ng-template let-item="item" #listTemplate>\n Name: {{item.name}},<br> Age: {{item.age}}\n</ng-template>',this.serverSideHtmlText='<np-list [items]="serverData" [showTiles]="true" [itemTemplate]="TileTemplate"\n [isServerOperations]="true" [totalItems]="serverDataCount" [pageSize]="10" (onPageChange)="onLoadData($event)">\n</np-list>\n\n<ng-template let-item="item" #TileTemplate>\n Name: {{item.ProductName}},<br> Unit price: {{item.UnitPrice}},<br> In stock: {{item.UnitsInStock}}\n</ng-template>',this.serverSideCtrlText="onLoadData(options) {\n const skip = (options.currentPage - 1) * options.pageSize;\n const take = options.pageSize;\n this.http.get(url)\n .subscribe((data: any) => {\n if (data && data.value) {\n this.serverData = data.value;\n this.serverDataCount = data['@odata.count'];\n }\n });\n}",this.selection1=[],this.selection2=[],this.items=[{id:1,name:"Maria",age:28},{id:2,name:"Karl",age:6},{id:3,name:"Jose",age:41},{id:4,name:"Yoshi",age:8},{id:5,name:"Jonas",age:9},{id:6,name:"Hari",age:18},{id:7,name:"Karl",age:33},{id:8,name:"Daniel",age:18},{id:9,name:"Yvonne",age:27},{id:10,name:"John",age:26},{id:11,name:"Mario",age:53},{id:12,name:"Martine",age:65},{id:13,name:"Jean",age:12},{id:14,name:"Marie",age:46},{id:15,name:"Paula",age:60},{id:16,name:"Paul",age:69},{id:17,name:"Fr\xe9d\xe9rique",age:34},{id:18,name:"Aria",age:64},{id:19,name:"Pedro",age:31},{id:20,name:"Janete",age:36},{id:21,name:"Maria",age:28},{id:22,name:"Karl",age:6},{id:23,name:"Jose",age:41},{id:24,name:"Yoshi",age:8},{id:25,name:"Jonas",age:9},{id:26,name:"Hari",age:18},{id:27,name:"Karl",age:33},{id:28,name:"Daniel",age:18},{id:29,name:"Yvonne",age:27},{id:30,name:"John",age:26},{id:31,name:"Mario",age:53},{id:32,name:"Martine",age:65},{id:33,name:"Jean",age:12},{id:34,name:"Marie",age:46},{id:35,name:"Paula",age:60},{id:36,name:"Paul",age:69},{id:37,name:"Fr\xe9d\xe9rique",age:34},{id:38,name:"Aria",age:64},{id:39,name:"Pedro",age:31},{id:40,name:"Janete",age:36}],this.tilesViewTotal2=0}ngOnInit(){}getSelectedItems(){alert(JSON.stringify(this.selection1))}selectItems(){this.selection1=[{id:1,name:"Maria",age:28},{id:2,name:"Karl",age:6},{id:3,name:"Jose",age:41}]}deselectAll(){this.list2.deselectAll()}selectAll(){this.list2.selectAll()}onClick(n){alert(n.id)}onLoadData(n){this.http.get(`https://services.odata.org/V4/Northwind/Northwind.svc/Products?$top=${n.pageSize}&$skip=${(n.currentPage-1)*n.pageSize}&$count=true`).subscribe(a=>{a&&a.value&&(this.tilesView2=a.value,this.tilesViewTotal2=a["@odata.count"])})}static#e=this.\u0275fac=function(t){return new(t||d)(e.Y36(_.eN))};static#t=this.\u0275cmp=e.Xpm({type:d,selectors:[["app-np-list-demo"]],viewQuery:function(t,i){if(1&t&&e.Gf(c,7),2&t){let a;e.iGM(a=e.CRH())&&(i.list2=a.first)}},decls:292,vars:36,consts:[[1,"page-header"],["title","Documentation"],[3,"innerText"],[1,"np-table"],["title","Examples"],[3,"items","itemTemplate","height","orderBy","orderDir","header","onClick"],["list1Template",""],[3,"items","itemTemplate","selectionMode","height","selection","styleClass","selectionChange"],["list2",""],["list2Template",""],[1,"np-btn-group"],["type","button",1,"np-btn",3,"click"],[3,"items","showTiles","itemTemplate","height","header","onClick"],["TileTemplate",""],[3,"items","showTiles","columnSize","itemTemplate","selectionMode","selection","height","header","isServerOperations","totalItems","pageSize","valueKey","selectionChange","onPageChange"],["TileTemplate2",""]],template:function(t,i){if(1&t&&(e.TgZ(0,"h2",0),e._uU(1,"List"),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,"b"),e._uU(19,"For server side operation"),e.qZA(),e.TgZ(20,"div")(21,"pre"),e._UZ(22,"code",2),e.qZA()()()(),e.TgZ(23,"np-card")(24,"np-card-body")(25,"table",3)(26,"tr")(27,"th"),e._uU(28,"Property"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Description"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Type"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Default"),e.qZA()(),e.TgZ(35,"tr")(36,"td"),e._uU(37,"header"),e.qZA(),e.TgZ(38,"td"),e._uU(39,"Header of list as plain text or html string"),e.qZA(),e.TgZ(40,"td"),e._uU(41,"string"),e.qZA(),e._UZ(42,"td"),e.qZA(),e.TgZ(43,"tr")(44,"td"),e._uU(45,"items"),e.qZA(),e.TgZ(46,"td"),e._uU(47,"Array of items"),e.qZA(),e.TgZ(48,"td"),e._uU(49,"any[]"),e.qZA(),e.TgZ(50,"td"),e._uU(51,"false"),e.qZA()(),e.TgZ(52,"tr")(53,"td"),e._uU(54,"itemTemplate"),e.qZA(),e.TgZ(55,"td"),e._uU(56,'Template to display item, with variable let-item="item"'),e.qZA(),e.TgZ(57,"td"),e._uU(58,"TemplateRef<any>"),e.qZA(),e._UZ(59,"td"),e.qZA(),e.TgZ(60,"tr")(61,"td"),e._uU(62,"selectionMode"),e.qZA(),e.TgZ(63,"td"),e._uU(64,"Set selection mode as 'single' or 'multiple'"),e.qZA(),e.TgZ(65,"td"),e._uU(66,"string"),e.qZA(),e._UZ(67,"td"),e.qZA(),e.TgZ(68,"tr")(69,"td"),e._uU(70,"valueKey"),e.qZA(),e.TgZ(71,"td"),e._uU(72,"Set Unique key property name of the item"),e.qZA(),e.TgZ(73,"td"),e._uU(74,"string"),e.qZA(),e._UZ(75,"td"),e.qZA(),e.TgZ(76,"tr")(77,"td"),e._uU(78,"selection"),e.qZA(),e.TgZ(79,"td"),e._uU(80,"Get/Set selected items"),e.qZA(),e.TgZ(81,"td"),e._uU(82,"any[]"),e.qZA(),e._UZ(83,"td"),e.qZA(),e.TgZ(84,"tr")(85,"td"),e._uU(86,"height"),e.qZA(),e.TgZ(87,"td"),e._uU(88,"Set height of list in px"),e.qZA(),e.TgZ(89,"td"),e._uU(90,"number"),e.qZA(),e._UZ(91,"td"),e.qZA(),e.TgZ(92,"tr")(93,"td"),e._uU(94,"orderBy"),e.qZA(),e.TgZ(95,"td"),e._uU(96,"Set order by property"),e.qZA(),e.TgZ(97,"td"),e._uU(98,"string"),e.qZA(),e._UZ(99,"td"),e.qZA(),e.TgZ(100,"tr")(101,"td"),e._uU(102,"orderDir"),e.qZA(),e.TgZ(103,"td"),e._uU(104," Set order direction 'asc' or 'desc'. Default value is 'asc'. "),e._UZ(105,"br"),e._uU(106," If data is type of string[], then only use orderDir. "),e.qZA(),e.TgZ(107,"td"),e._uU(108,"string"),e.qZA(),e._UZ(109,"td"),e.qZA(),e.TgZ(110,"tr")(111,"td"),e._uU(112,"showTiles"),e.qZA(),e.TgZ(113,"td"),e._uU(114,"Show list as tiles"),e.qZA(),e.TgZ(115,"td"),e._uU(116,"boolean"),e.qZA(),e.TgZ(117,"td"),e._uU(118,"false"),e.qZA()(),e.TgZ(119,"tr")(120,"td"),e._uU(121,"columnSize"),e.qZA(),e.TgZ(122,"td"),e._uU(123,"Set column size for tiles view, based on grid layout system"),e.qZA(),e.TgZ(124,"td"),e._uU(125,"number"),e.qZA(),e.TgZ(126,"td"),e._uU(127,"4"),e.qZA()(),e.TgZ(128,"tr")(129,"td"),e._uU(130,"isServerOperations"),e.qZA(),e.TgZ(131,"td"),e._uU(132,"Set true if fetching data from server, and paginator will shown only when it's server side operations. "),e.qZA(),e.TgZ(133,"td"),e._uU(134,"boolean"),e.qZA(),e.TgZ(135,"td"),e._uU(136,"false"),e.qZA()(),e.TgZ(137,"tr")(138,"td"),e._uU(139,"pageSize"),e.qZA(),e.TgZ(140,"td"),e._uU(141,"Set pagesize for server side operation"),e.qZA(),e.TgZ(142,"td"),e._uU(143,"number"),e.qZA(),e.TgZ(144,"td"),e._uU(145,"10"),e.qZA()(),e.TgZ(146,"tr")(147,"td"),e._uU(148,"totalItems"),e.qZA(),e.TgZ(149,"td"),e._uU(150," Set total items for list, update it when fetching data in "),e.TgZ(151,"b"),e._uU(152,"onPageChange"),e.qZA(),e._uU(153," method "),e.qZA(),e.TgZ(154,"td"),e._uU(155,"number"),e.qZA(),e.TgZ(156,"td"),e._uU(157,"0"),e.qZA()(),e.TgZ(158,"tr")(159,"td"),e._uU(160,"styleClass"),e.qZA(),e.TgZ(161,"td"),e._uU(162,"Add extra class to component"),e.qZA(),e.TgZ(163,"td"),e._uU(164,"string"),e.qZA(),e._UZ(165,"td"),e.qZA(),e.TgZ(166,"tr")(167,"td"),e._uU(168,"inputId"),e.qZA(),e.TgZ(169,"td"),e._uU(170,"Set id attribute"),e.qZA(),e.TgZ(171,"td"),e._uU(172,"string"),e.qZA(),e._UZ(173,"td"),e.qZA()()()(),e.TgZ(174,"np-card")(175,"np-card-body")(176,"table",3)(177,"tr")(178,"th"),e._uU(179,"Method"),e.qZA(),e.TgZ(180,"th"),e._uU(181,"Description"),e.qZA(),e.TgZ(182,"th"),e._uU(183,"Parameters"),e.qZA()(),e.TgZ(184,"tr")(185,"td"),e._uU(186,"onPageChange(options: any)"),e.qZA(),e.TgZ(187,"td"),e._uU(188," Callback event on page change. Fetch total items count from server and update "),e.TgZ(189,"b"),e._uU(190,"totalItems"),e.qZA(),e._uU(191,"."),e._UZ(192,"br"),e._uU(193," Fetch data based on options and assign to "),e.TgZ(194,"b"),e._uU(195,"items"),e.qZA(),e._uU(196,". "),e.TgZ(197,"div")(198,"pre"),e._UZ(199,"code",2),e.qZA()()(),e.TgZ(200,"td"),e._uU(201,'{"currentPage":1,"pageSize":10}'),e.qZA()(),e.TgZ(202,"tr")(203,"td"),e._uU(204,"onClick(item: any)"),e.qZA(),e.TgZ(205,"td"),e._uU(206,"Callback to click event on node"),e.qZA(),e.TgZ(207,"td"),e._uU(208,"item : any"),e.qZA()(),e.TgZ(209,"tr")(210,"td"),e._uU(211,"onSelect(item: any)"),e.qZA(),e.TgZ(212,"td"),e._uU(213,"Callback event on selecting item"),e.qZA(),e.TgZ(214,"td"),e._uU(215,"item: any"),e.qZA()(),e.TgZ(216,"tr")(217,"td"),e._uU(218,"onDeselect(item: any)"),e.qZA(),e.TgZ(219,"td"),e._uU(220,"Callback event on deselecting item"),e.qZA(),e.TgZ(221,"td"),e._uU(222,"item: any"),e.qZA()()()()(),e.TgZ(223,"np-card")(224,"np-card-body")(225,"table",3)(226,"tr")(227,"th"),e._uU(228,"Api"),e.qZA(),e.TgZ(229,"th"),e._uU(230,"Description"),e.qZA(),e.TgZ(231,"th"),e._uU(232,"Parameters"),e.qZA()(),e.TgZ(233,"tr")(234,"td"),e._uU(235,"refresh()"),e.qZA(),e.TgZ(236,"td"),e._uU(237," Refresh data by calling method "),e.TgZ(238,"b"),e._uU(239,"onPageChange"),e.qZA(),e._uU(240," again. Only used for server side operations. "),e.qZA(),e._UZ(241,"td"),e.qZA(),e.TgZ(242,"tr")(243,"td"),e._uU(244,"selectAll()"),e.qZA(),e.TgZ(245,"td"),e._uU(246,"Select all"),e.qZA(),e._UZ(247,"td"),e.qZA(),e.TgZ(248,"tr")(249,"td"),e._uU(250,"deselectAll()"),e.qZA(),e.TgZ(251,"td"),e._uU(252,"Clear all selected items"),e.qZA(),e._UZ(253,"td"),e.qZA()()()()(),e.TgZ(254,"np-tab",4)(255,"fieldset")(256,"legend"),e._uU(257,"Basic list with height"),e.qZA(),e.TgZ(258,"np-list",5),e.NdJ("onClick",function(l){return i.onClick(l)}),e.qZA(),e.YNc(259,T,3,2,"ng-template",null,6,e.W1O),e.qZA(),e.TgZ(261,"fieldset")(262,"legend"),e._uU(263,"List with selection"),e.qZA(),e.TgZ(264,"np-list",7,8),e.NdJ("selectionChange",function(l){return i.selection1=l}),e.qZA(),e.YNc(266,A,8,2,"ng-template",null,9,e.W1O),e.TgZ(268,"div",10)(269,"button",11),e.NdJ("click",function(){return i.getSelectedItems()}),e._uU(270," Get selected items "),e.qZA(),e.TgZ(271,"button",11),e.NdJ("click",function(){return i.selectItems()}),e._uU(272," Set selected items "),e.qZA(),e.TgZ(273,"button",11),e.NdJ("click",function(){return i.selectAll()}),e._uU(274," Select All "),e.qZA(),e.TgZ(275,"button",11),e.NdJ("click",function(){return i.deselectAll()}),e._uU(276," Deselect all "),e.qZA()()(),e.TgZ(277,"fieldset")(278,"legend"),e._uU(279,"Tiles view"),e.qZA(),e.TgZ(280,"np-list",12),e.NdJ("onClick",function(l){return i.onClick(l)}),e.qZA(),e.YNc(281,U,5,3,"ng-template",null,13,e.W1O),e.qZA(),e.TgZ(283,"fieldset")(284,"legend"),e._uU(285,"Tiles view with server side data with valueKey"),e.qZA(),e.TgZ(286,"np-list",14),e.NdJ("selectionChange",function(l){return i.selection2=l})("onPageChange",function(l){return i.onLoadData(l)}),e.qZA(),e.TgZ(287,"p"),e._uU(288),e.ALo(289,"json"),e.qZA(),e.YNc(290,h,5,3,"ng-template",null,15,e.W1O),e.qZA()()()),2&t){const a=e.MAs(260),l=e.MAs(267),b=e.MAs(282),f=e.MAs(291);e.xp6(10),e.Q6J("innerText",i.importText),e.xp6(7),e.Q6J("innerText",i.htmlText),e.xp6(5),e.Q6J("innerText",i.serverSideHtmlText),e.xp6(177),e.Q6J("innerText",i.serverSideCtrlText),e.xp6(59),e.Q6J("items",i.items)("itemTemplate",a)("height",200)("orderBy","name")("orderDir","asc")("header","Employee List"),e.xp6(6),e.Q6J("items",i.items)("itemTemplate",l)("selectionMode","multiple")("height",200)("selection",i.selection1)("styleClass","myClass"),e.xp6(16),e.Q6J("items",i.items)("showTiles",!0)("itemTemplate",b)("height",300)("header","Employee List"),e.xp6(6),e.Q6J("items",i.tilesView2)("showTiles",!0)("columnSize",6)("itemTemplate",f)("selectionMode","single")("selection",i.selection2)("height",300)("header","Product List")("isServerOperations",!0)("totalItems",i.tilesViewTotal2)("pageSize",10)("valueKey","ProductID"),e.xp6(2),e.hij("Selected: ",e.lcZ(289,34,i.selection2),"")}},dependencies:[o.A4,o.KA,o.Qk,o.c0,o.El,u.Ts],encapsulation:2})}const q=[{path:"",component:d}];class Z{static#e=this.\u0275fac=function(t){return new(t||Z)};static#t=this.\u0275mod=e.oAB({type:Z});static#i=this.\u0275inj=e.cJS({imports:[p.Bz.forChild(q),p.Bz]})}class m{static#e=this.\u0275fac=function(t){return new(t||m)};static#t=this.\u0275mod=e.oAB({type:m});static#i=this.\u0275inj=e.cJS({imports:[u.ez,Z,o._0,o.i7,o.Tk]})}}}]);