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.71 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HighlightWeekends={})}(this,(function(e){"use strict";class t{constructor(){this.isAction=!0}}t.prototype.isAction=!0,e.Plugin= /** * 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={}){const i=e.weekdays||[6,0];let s,n,o=!0;class l extends t{constructor(e,t){super(),this.highlight(e,t.time.leftGlobalDate)}update(e,t){this.highlight(e,t.time.leftGlobalDate)}highlight(e,t){const n=e.classList.contains(s);if(!o)return void(n&&e.classList.remove(s));const l=i.includes(t.day());!n&&l?e.classList.add(s):n&&!l&&e.classList.remove(s)}}return function(t){const i=t.api.mergeDeep,c=[];n=t.api,s=e.className||n.getClass("chart-timeline-grid-row-cell")+"--weekend";const a=t.state.get("config.plugin.HighlightWeekends");return a&&(e=i({},e,a)),c.push(t.state.subscribe("$data.chart.time.format.period",(e=>o="day"===e))),t.state.update("config.actions.chart-timeline-grid-row-cell",(e=>(e.push(l),e))),n.pluginInitialized("HighlightWeekends"),function(){c.forEach((e=>e())),t.state.update("config.actions.chart-timeline-grid-row-cell",(e=>e.filter((e=>e!==l)))),n.pluginDestroyed("HighlightWeekends")}}},Object.defineProperty(e,"__esModule",{value:!0})}));