-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3868.26c17a761a43cf85.js
1 lines (1 loc) · 11.1 KB
/
3868.26c17a761a43cf85.js
1
"use strict";(self.webpackChunknp_ui_lib_app=self.webpackChunknp_ui_lib_app||[]).push([[3868],{3868:(q,c,s)=>{s.r(c),s.d(c,{NpCalendarDemoModule:()=>u});var _=s(6895),p=s(8379),o=s(5499),t=s(4650);const g=["myCalendar"],m=["myCalendar2"],T=function(i){return{event:i}};function A(i,a){if(1&i&&(t.TgZ(0,"div",12)(1,"b"),t._uU(2),t.qZA(),t.TgZ(3,"div"),t._uU(4),t.qZA()()),2&i){const n=a.event;t.oxw();const e=t.MAs(245);t.Q6J("body",e)("context",t.VKq(4,T,n)),t.xp6(2),t.Oqu(n.startDate.toTimeString().substring(0,5)),t.xp6(2),t.Oqu(n.title)}}function U(i,a){if(1&i&&(t.TgZ(0,"div")(1,"b"),t._uU(2,"Start: "),t.qZA(),t._uU(3),t.qZA(),t.TgZ(4,"div")(5,"b"),t._uU(6,"Title: "),t.qZA(),t._uU(7),t.qZA()),2&i){const n=a.event;t.xp6(3),t.hij(" ",n.startDate,""),t.xp6(4),t.hij(" ",n.title,"")}}class l{constructor(a){this.dialogService=a,this.importText="import { NpCalendarModule } from 'np-ui-lib';",this.htmlText="<np-calendar></np-calendar>",this.disabledDates=[],this.disableWeekDays=["Sunday","Saturday"],this.eventTemplateStr='<ng-template #eventTemplate let-event="event">\n <div [npTooltip]="event.title">\n {{event.startDate.toTimeString().substring(0,5)}} {{event.title}}\n </div>\n</ng-template>',this.dateClassText='function(date: Date) { return "red-background";}'}ngOnInit(){const a=new Date;a.setDate(1);const n=new Date;n.setDate(2),this.disabledDates=[a,n];const e=new Date;e.setHours(1);const r=new Date;r.setHours(2);const d=new Date;d.setHours(24);const v=[new o.Lx({startDate:e,description:"Meeting with client"}),new o.Lx({startDate:r,description:"Retrospective Meeting with scrum team of np-ui-lib project",backgroundColor:"#1e7e34",fontColor:"black"}),new o.Lx({startDate:d,description:"Weekly sync up meeting on skype"})];this.myCalendar.addEvents(v)}onClickDate(a){this.dialogService.open("Add Event Title",new o.aj({type:"prompt"}),null).onClose.subscribe(e=>{null!=e&&null!=e&&e.length>0&&this.myCalendar.addEvents([new o.Lx({startDate:a,description:e})])})}onClickEvent(a){this.dialogService.open("Are you sure to delete event?",new o.aj({type:"confirm"}),null).onClose.subscribe(e=>{e&&this.myCalendar.removeEvents([a])})}onLoadMonth(a){console.log(JSON.stringify(a))}onClickDate2(a){this.dialogService.open("Add Event Title",new o.aj({type:"prompt"}),null).onClose.subscribe(e=>{null!=e&&null!=e&&e.length>0&&this.myCalendar2.addEvents([new o.Lx({startDate:a,description:e})])})}onClickEvent2(a){this.dialogService.open("Are you sure to delete event?",new o.aj({type:"confirm"}),null).onClose.subscribe(e=>{e&&this.myCalendar2.removeEvents([a])})}onLoadMonth2(a){console.log(JSON.stringify(a));const n=new Date;n.setHours(1);const e=new Date;e.setHours(2);const r=new Date;r.setHours(24);const d=[new o.Lx({startDate:n,description:"Meeting with client"}),new o.Lx({startDate:n,description:"Team lunch"}),new o.Lx({startDate:e,description:"Retrospective Meeting with scrum team of np-ui-lib project",backgroundColor:"#1e7e34",fontColor:"black"}),new o.Lx({startDate:r,description:"Weekly sync up meeting on skype"})];this.myCalendar2.addEvents(d)}getClassForDate(a){return 1==a.getDate()||28==a.getDate()?"red-background":"green-background"}static#t=this.\u0275fac=function(n){return new(n||l)(t.Y36(o.rD))};static#e=this.\u0275cmp=t.Xpm({type:l,selectors:[["app-np-calendar-demo"]],viewQuery:function(n,e){if(1&n&&(t.Gf(g,7),t.Gf(m,7)),2&n){let r;t.iGM(r=t.CRH())&&(e.myCalendar=r.first),t.iGM(r=t.CRH())&&(e.myCalendar2=r.first)}},decls:246,vars:10,consts:[[1,"page-header"],["title","Documentation"],[3,"innerText"],[1,"np-table"],["title","Basic example"],[3,"disableDates","onClickDate","onClickEvent","onLoadMonth"],["myCalendar",""],["title","Example with event template"],[3,"disableWeekDays","isStartMonthWithMonday","resetEventsOnLoad","eventTemplate","dateClass","onClickDate","onClickEvent","onLoadMonth"],["myCalendar2",""],["eventTemplate",""],["eventPopBody",""],["npPopover","",3,"body","context"]],template:function(n,e){if(1&n&&(t.TgZ(0,"h2",0),t._uU(1,"Calendar"),t.qZA(),t.TgZ(2,"np-tabs")(3,"np-tab",1)(4,"np-card")(5,"np-card-body")(6,"b"),t._uU(7,"Module to import"),t.qZA(),t.TgZ(8,"div")(9,"pre"),t._UZ(10,"code",2),t.qZA()()()(),t.TgZ(11,"np-card")(12,"np-card-body")(13,"b"),t._uU(14,"HTML"),t.qZA(),t.TgZ(15,"div")(16,"pre"),t._UZ(17,"code",2),t.qZA()()()(),t.TgZ(18,"np-card")(19,"np-card-body")(20,"table",3)(21,"tr")(22,"th"),t._uU(23,"Property"),t.qZA(),t.TgZ(24,"th"),t._uU(25,"Description"),t.qZA(),t.TgZ(26,"th"),t._uU(27,"Type"),t.qZA(),t.TgZ(28,"th"),t._uU(29,"Default"),t.qZA()(),t.TgZ(30,"tr")(31,"td"),t._uU(32,"disableWeekDays"),t.qZA(),t.TgZ(33,"td"),t._uU(34," Set week day as disabled, Set like [disableWeekDays]=\"['Saturday','Sunday']\" "),t.qZA(),t.TgZ(35,"td"),t._uU(36,"string[]"),t.qZA(),t._UZ(37,"td"),t.qZA(),t.TgZ(38,"tr")(39,"td"),t._uU(40,"disableDates"),t.qZA(),t.TgZ(41,"td"),t._uU(42,"Set dates disabled, list of object type Date"),t.qZA(),t.TgZ(43,"td"),t._uU(44,"Date[]"),t.qZA(),t._UZ(45,"td"),t.qZA(),t.TgZ(46,"tr")(47,"td"),t._uU(48,"dateClass"),t.qZA(),t.TgZ(49,"td"),t._uU(50," Add CSS class on each date based on conditions, pass function which returns string CSS class. "),t.qZA(),t._UZ(51,"td",2)(52,"td"),t.qZA(),t.TgZ(53,"tr")(54,"td"),t._uU(55,"isStartMonthWithMonday"),t.qZA(),t.TgZ(56,"td"),t._uU(57,"Start month with monday. By default it starts with sunday"),t.qZA(),t.TgZ(58,"td"),t._uU(59,"boolean"),t.qZA(),t._UZ(60,"td"),t.qZA(),t.TgZ(61,"tr")(62,"td"),t._uU(63,"resetEventsOnLoad"),t.qZA(),t.TgZ(64,"td"),t._uU(65," Reset events on load new month, useful for lazy loading. "),t._UZ(66,"br"),t._uU(67,"If fetching events on loading each month then set this property true "),t.qZA(),t.TgZ(68,"td"),t._uU(69,"boolean"),t.qZA(),t.TgZ(70,"td"),t._uU(71,"false"),t.qZA()(),t.TgZ(72,"tr")(73,"td"),t._uU(74,"eventTemplate"),t.qZA(),t.TgZ(75,"td"),t._uU(76," Event template, here event variable is type of NpCalendarEvent "),t._UZ(77,"br"),t.TgZ(78,"pre"),t._UZ(79,"code",2),t.qZA()(),t.TgZ(80,"td"),t._uU(81,"TemplateRef<any>"),t.qZA(),t._UZ(82,"td"),t.qZA(),t.TgZ(83,"tr")(84,"td"),t._uU(85,"styleClass"),t.qZA(),t.TgZ(86,"td"),t._uU(87,"Set extra class on component"),t.qZA(),t.TgZ(88,"td"),t._uU(89,"string"),t.qZA(),t._UZ(90,"td"),t.qZA(),t.TgZ(91,"tr")(92,"td"),t._uU(93,"inputId"),t.qZA(),t.TgZ(94,"td"),t._uU(95,"Set id attribute"),t.qZA(),t.TgZ(96,"td"),t._uU(97,"string"),t.qZA(),t._UZ(98,"td"),t.qZA()()()(),t.TgZ(99,"np-card")(100,"np-card-body")(101,"table",3)(102,"tr")(103,"th"),t._uU(104,"Method"),t.qZA(),t.TgZ(105,"th"),t._uU(106,"Description"),t.qZA(),t.TgZ(107,"th"),t._uU(108,"Parameters"),t.qZA()(),t.TgZ(109,"tr")(110,"td"),t._uU(111,"onLoadMonth(\u2774month: number, year: number\u2775)"),t.qZA(),t.TgZ(112,"td"),t._uU(113,"Callback event on loading new month."),t.qZA(),t.TgZ(114,"td"),t._uU(115,"\u2774month: number, year: number\u2775"),t.qZA()(),t.TgZ(116,"tr")(117,"td"),t._uU(118,"onClickDate(date: Date)"),t.qZA(),t.TgZ(119,"td"),t._uU(120,"Callback event on click date. Here time will be 0:0:0."),t.qZA(),t.TgZ(121,"td"),t._uU(122,"date: Date"),t.qZA()(),t.TgZ(123,"tr")(124,"td"),t._uU(125,"onClickEvent(event: NpCalendarEvent)"),t.qZA(),t.TgZ(126,"td"),t._uU(127,"Callback event on click event dom."),t.qZA(),t.TgZ(128,"td"),t._uU(129,"event: NpCalendarEvent"),t.qZA()()()()(),t.TgZ(130,"np-card")(131,"np-card-body")(132,"table",3)(133,"tr")(134,"th"),t._uU(135,"Api"),t.qZA(),t.TgZ(136,"th"),t._uU(137,"Description"),t.qZA(),t.TgZ(138,"th"),t._uU(139,"Parameters"),t.qZA()(),t.TgZ(140,"tr")(141,"td"),t._uU(142,"refresh()"),t.qZA(),t.TgZ(143,"td"),t._uU(144," Refresh current month, on Refresh it will callback "),t.TgZ(145,"b"),t._uU(146,"onLoadMonth"),t.qZA(),t._uU(147," method. "),t.qZA(),t._UZ(148,"td"),t.qZA(),t.TgZ(149,"tr")(150,"td"),t._uU(151,"addEvents(events: NpCalendarEvent[])"),t.qZA(),t.TgZ(152,"td"),t._uU(153," Add events to current month. "),t._UZ(154,"br"),t._uU(155," On Each new month load, events will be cleared. "),t._UZ(156,"br"),t._uU(157," For lazy loading fill event in "),t.TgZ(158,"b"),t._uU(159,"onLoadMonth"),t.qZA(),t._uU(160," method of calendar component. "),t.qZA(),t.TgZ(161,"td"),t._uU(162,"events: NpCalendarEvent[]"),t.qZA()(),t.TgZ(163,"tr")(164,"td"),t._uU(165,"removeEvents(events: NpCalendarEvent[])"),t.qZA(),t.TgZ(166,"td"),t._uU(167," Remove events from current month. "),t._UZ(168,"br"),t._uU(169," Events will be filtered based on startDate, endDate and title. "),t.qZA(),t.TgZ(170,"td"),t._uU(171,"events: NpCalendarEvent[]"),t.qZA()()()()(),t.TgZ(172,"np-card")(173,"np-card-body")(174,"b"),t._uU(175,"NpCalendarEvent"),t.qZA(),t.TgZ(176,"table",3)(177,"tr")(178,"th"),t._uU(179,"Property"),t.qZA(),t.TgZ(180,"th"),t._uU(181,"Description"),t.qZA(),t.TgZ(182,"th"),t._uU(183,"Type"),t.qZA(),t.TgZ(184,"th"),t._uU(185,"Default"),t.qZA()(),t.TgZ(186,"tr")(187,"td"),t._uU(188,"startDate"),t.qZA(),t.TgZ(189,"td"),t._uU(190,"Start date with time"),t.qZA(),t.TgZ(191,"td"),t._uU(192,"Date"),t.qZA(),t._UZ(193,"td"),t.qZA(),t.TgZ(194,"tr")(195,"td"),t._uU(196,"endDate"),t.qZA(),t.TgZ(197,"td"),t._uU(198,"End date with time"),t.qZA(),t.TgZ(199,"td"),t._uU(200,"Date"),t.qZA(),t._UZ(201,"td"),t.qZA(),t.TgZ(202,"tr")(203,"td"),t._uU(204,"title"),t.qZA(),t.TgZ(205,"td"),t._uU(206,"Title of event"),t.qZA(),t.TgZ(207,"td"),t._uU(208,"string"),t.qZA(),t._UZ(209,"td"),t.qZA(),t.TgZ(210,"tr")(211,"td"),t._uU(212,"data"),t.qZA(),t.TgZ(213,"td"),t._uU(214,"Pass other data to event"),t.qZA(),t.TgZ(215,"td"),t._uU(216,"any"),t.qZA(),t._UZ(217,"td"),t.qZA(),t.TgZ(218,"tr")(219,"td"),t._uU(220,"backgroundColor"),t.qZA(),t.TgZ(221,"td"),t._uU(222,"Event background color"),t.qZA(),t.TgZ(223,"td"),t._uU(224,"string"),t.qZA(),t.TgZ(225,"td"),t._uU(226,"#007bff"),t.qZA()(),t.TgZ(227,"tr")(228,"td"),t._uU(229,"fontColor"),t.qZA(),t.TgZ(230,"td"),t._uU(231,"Event font color"),t.qZA(),t.TgZ(232,"td"),t._uU(233,"any"),t.qZA(),t.TgZ(234,"td"),t._uU(235,"#ffffff"),t.qZA()()()()()(),t.TgZ(236,"np-tab",4)(237,"np-calendar",5,6),t.NdJ("onClickDate",function(d){return e.onClickDate(d)})("onClickEvent",function(d){return e.onClickEvent(d)})("onLoadMonth",function(d){return e.onLoadMonth(d)}),t.qZA()(),t.TgZ(239,"np-tab",7)(240,"np-calendar",8,9),t.NdJ("onClickDate",function(d){return e.onClickDate2(d)})("onClickEvent",function(d){return e.onClickEvent2(d)})("onLoadMonth",function(d){return e.onLoadMonth2(d)}),t.qZA(),t.YNc(242,A,5,6,"ng-template",null,10,t.W1O),t.YNc(244,U,8,2,"ng-template",null,11,t.W1O),t.qZA()()),2&n){const r=t.MAs(243);t.xp6(10),t.Q6J("innerText",e.importText),t.xp6(7),t.Q6J("innerText",e.htmlText),t.xp6(34),t.Q6J("innerText",e.dateClassText),t.xp6(28),t.Q6J("innerText",e.eventTemplateStr),t.xp6(158),t.Q6J("disableDates",e.disabledDates),t.xp6(3),t.Q6J("disableWeekDays",e.disableWeekDays)("isStartMonthWithMonday",!0)("resetEventsOnLoad",!0)("eventTemplate",r)("dateClass",e.getClassForDate)}},dependencies:[o.nr,o.KA,o.Qk,o.c0,o.El,o.cQ],encapsulation:2})}const h=[{path:"",component:l}];class Z{static#t=this.\u0275fac=function(n){return new(n||Z)};static#e=this.\u0275mod=t.oAB({type:Z});static#n=this.\u0275inj=t.cJS({imports:[p.Bz.forChild(h),p.Bz]})}class u{static#t=this.\u0275fac=function(n){return new(n||u)};static#e=this.\u0275mod=t.oAB({type:u});static#n=this.\u0275inj=t.cJS({imports:[_.ez,Z,o.MO,o.pe,o.i7,o.Tk,o.bn]})}}}]);