UNPKG

gantt-schedule-timeline-calendar

Version:

Gantt, Schedule, Timeline, Calendar components all in one. [gantt, timeline, schedule, scheduler, calendar, booking, gantt chart, reservation, javascript gantt, javascript timeline, javascript schedule, javascript scheduler, javascript calendar, javascrip

14 lines 1.43 kB
class t{constructor(){this.isAction=!0}} /** * HighlightWeekends plugin * * @copyright NEURONET - Rafal Pospiech * @author Rafal Pospiech <neuronet.io@gmail.com> * @module gantt-schedule-timeline-calendar * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar * @link https://gantt-schedule-timeline-calendar.neuronet.io * @version 3.40.7 * @released 2025-05-27 * @license SEE LICENSE IN LICENSE FILE */ function e(e={}){const i=e.weekdays||[6,0];let s,a,n=!0;class c extends t{constructor(t,e){super(),this.highlight(t,e.time.leftGlobalDate)}update(t,e){this.highlight(t,e.time.leftGlobalDate)}highlight(t,e){const a=t.classList.contains(s);if(!n)return void(a&&t.classList.remove(s));const c=i.includes(e.day());!a&&c?t.classList.add(s):a&&!c&&t.classList.remove(s)}}return function(t){const i=t.api.mergeDeep,l=[];a=t.api,s=e.className||a.getClass("chart-timeline-grid-row-cell")+"--weekend";const o=t.state.get("config.plugin.HighlightWeekends");return o&&(e=i({},e,o)),l.push(t.state.subscribe("$data.chart.time.format.period",(t=>n="day"===t))),t.state.update("config.actions.chart-timeline-grid-row-cell",(t=>(t.push(c),t))),a.pluginInitialized("HighlightWeekends"),function(){l.forEach((t=>t())),t.state.update("config.actions.chart-timeline-grid-row-cell",(t=>t.filter((t=>t!==c)))),a.pluginDestroyed("HighlightWeekends")}}}t.prototype.isAction=!0;export{e as Plugin};