(scheduler2, container, state = {})
| 8984 | } |
| 8985 | class DatePicker { |
| 8986 | constructor(scheduler2, container, state = {}) { |
| 8987 | this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], filterDays: null, currentModeIndex: 0, ...state }; |
| 8988 | this.container = null; |
| 8989 | this.element = null; |
| 8990 | this.onStateChangeHandlers = []; |
| 8991 | this.scheduler = scheduler2; |
| 8992 | this._domEvents = scheduler2._createDomEventScope(); |
| 8993 | this.state = this.getState(); |
| 8994 | makeEventable(this); |
| 8995 | if (container) { |
| 8996 | this.container = container; |
| 8997 | this.render(this.container); |
| 8998 | } |
| 8999 | this.onStateChange((oldState, newState) => { |
| 9000 | this.callEvent("onStateChange", [newState, oldState]); |
| 9001 | }); |
| 9002 | } |
| 9003 | getState() { |
| 9004 | return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] }; |
| 9005 | } |
nothing calls this directly
no test coverage detected