@cimo/schedule_calendar 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 cimo - reinventsoftware.org
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Npm_schedule_calendar
2
+
3
+ Npm package, schedule calendar. Light, fast and secure.
4
+ Writed with native Typescript code and no dependencies are used.
5
+
6
+ ## Pack
7
+
8
+ 1. npm run build
9
+ 2. Copy the file "/build/package_name-x.x.x.tgz" in the project root folder.
10
+ 3. In the "package.json" file insert: "@cimo/package_name": "file:package_name-x.x.x.tgz"
11
+
12
+ ## Publish
13
+
14
+ 1. npm run build
15
+ 2. npm login --auth-type=legacy
16
+ 3. npm publish --auth-type=legacy --access public
17
+
18
+ ## Installation
19
+
20
+ 1. Link for npm package -> https://www.npmjs.com/package/@cimo/schedule_calendar
21
+
22
+ ## Example
23
+
24
+ - Example.ts
25
+
26
+ ```
27
+ ...
28
+
29
+ import { Csc } from "@cimo/schedule_calendar/dist/src/Main";
30
+
31
+ ...
32
+
33
+ const csc = new Csc(
34
+ { locale: "ja-JP", yearBack: 10, yearForward: 10, isStartOnMonday: false, isHighlightToday: true },
35
+ ".calendar"
36
+ );
37
+ csc.setWeekdayList(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]);
38
+ csc.callbackCurrent = (year: number, month: number) => {
39
+ console.log("callbackCurrent", year, month);
40
+ };
41
+ csc.callbackCell = (elementDiv: HTMLDivElement, dayNumber: number) => {
42
+ console.log("callbackCell", elementDiv, dayNumber);
43
+ };
44
+ csc.create();
45
+
46
+ ...
47
+
48
+ ```
@@ -0,0 +1,20 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ import { RuleContext } from "@typescript-eslint/utils/dist/ts-eslint";
3
+ export declare const rules: {
4
+ "no-array-assignment-for-object-type": {
5
+ meta: {
6
+ type: string;
7
+ docs: {
8
+ description: string;
9
+ recommended: boolean;
10
+ };
11
+ messages: {
12
+ noArrayAssignmentForObjectType: string;
13
+ };
14
+ schema: never[];
15
+ };
16
+ create(context: RuleContext<"noArrayAssignmentForObjectType", []>): {
17
+ TSArrayType(node: TSESTree.TSArrayType): void;
18
+ };
19
+ };
20
+ };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = void 0;
4
+ const utils_1 = require("@typescript-eslint/utils");
5
+ exports.rules = {
6
+ "no-array-assignment-for-object-type": {
7
+ meta: {
8
+ type: "problem",
9
+ docs: {
10
+ description: "Safe array assignment for object type.",
11
+ recommended: false
12
+ },
13
+ messages: {
14
+ noArrayAssignmentForObjectType: "Array assign for object type is disallowed."
15
+ },
16
+ schema: []
17
+ },
18
+ create(context) {
19
+ const parserServices = utils_1.ESLintUtils.getParserServices(context);
20
+ return {
21
+ TSArrayType(node) {
22
+ const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.elementType);
23
+ const checker = parserServices.program.getTypeChecker();
24
+ const type = checker.getTypeAtLocation(tsNode);
25
+ const indexType = type.getStringIndexType();
26
+ if (indexType) {
27
+ context.report({
28
+ node,
29
+ messageId: "noArrayAssignmentForObjectType"
30
+ });
31
+ }
32
+ }
33
+ };
34
+ }
35
+ }
36
+ };
37
+ //# sourceMappingURL=eslint.customRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.customRule.js","sourceRoot":"","sources":["../eslint.customRule.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AAGpD,QAAA,KAAK,GAAG;IACjB,qCAAqC,EAAE;QACnC,IAAI,EAAE;YACF,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACF,WAAW,EAAE,wCAAwC;gBACrD,WAAW,EAAE,KAAK;aACrB;YACD,QAAQ,EAAE;gBACN,8BAA8B,EAAE,6CAA6C;aAChF;YACD,MAAM,EAAE,EAAE;SACb;QACD,MAAM,CAAC,OAA0D;YAC7D,MAAM,cAAc,GAAG,mBAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAE9D,OAAO;gBACH,WAAW,CAAC,IAA0B;oBAClC,MAAM,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBAC1E,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;oBACxD,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;oBAE/C,MAAM,SAAS,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;oBAE5C,IAAI,SAAS,EAAE,CAAC;wBACZ,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,gCAAgC;yBAC9C,CAAC,CAAC;oBACP,CAAC;gBACL,CAAC;aACJ,CAAC;QACN,CAAC;KACJ;CACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const writeLog: (tag: string, value: string | Record<string, unknown> | Error) => void;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeLog = void 0;
4
+ const writeLog = (tag, value) => {
5
+ console.log(`WriteLog => ${tag}: `, value);
6
+ };
7
+ exports.writeLog = writeLog;
8
+ //# sourceMappingURL=HelperSrc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HelperSrc.js","sourceRoot":"","sources":["../../src/HelperSrc.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,KAA+C,EAAQ,EAAE;IAE3F,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;AAHW,QAAA,QAAQ,YAGnB"}
@@ -0,0 +1,3 @@
1
+ import Csc from "./Manager";
2
+ export * as CscModel from "./Model";
3
+ export { Csc };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Csc = exports.CscModel = void 0;
40
+ const Manager_1 = __importDefault(require("./Manager"));
41
+ exports.Csc = Manager_1.default;
42
+ exports.CscModel = __importStar(require("./Model"));
43
+ //# sourceMappingURL=Main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA4B;AAGnB,cAHF,iBAAG,CAGE;AADZ,oDAAoC"}
@@ -0,0 +1,27 @@
1
+ import * as model from "./Model";
2
+ export default class Manager {
3
+ private option;
4
+ private containerTag;
5
+ private weekdayList;
6
+ private date;
7
+ private yearMin;
8
+ private yearMax;
9
+ private yearCurrent;
10
+ private monthCurrent;
11
+ private elementButtonBack;
12
+ private elementTitle;
13
+ private elementButtonForward;
14
+ private elementSelectYear;
15
+ private elementButtonToday;
16
+ private elementWeekday;
17
+ private elementDay;
18
+ private childrenStyle;
19
+ private initializeHtml;
20
+ private render;
21
+ private event;
22
+ constructor(optionValue: model.Ioption, containerTagValue: string);
23
+ callbackCurrent?: (year: number, month: number) => void;
24
+ callbackCell?: (elementDiv: HTMLDivElement, dayNumber: number) => void;
25
+ setWeekdayList: (value: string[]) => void;
26
+ create: () => void;
27
+ }
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const helperSrc = __importStar(require("./HelperSrc"));
37
+ class Manager {
38
+ option;
39
+ containerTag;
40
+ weekdayList;
41
+ date;
42
+ yearMin;
43
+ yearMax;
44
+ yearCurrent;
45
+ monthCurrent;
46
+ elementButtonBack;
47
+ elementTitle;
48
+ elementButtonForward;
49
+ elementSelectYear;
50
+ elementButtonToday;
51
+ elementWeekday;
52
+ elementDay;
53
+ childrenStyle = () => {
54
+ const elementStyle = document.createElement("style");
55
+ elementStyle.textContent = `
56
+ .csc_wrapper {
57
+ margin: 20px;
58
+ }
59
+ .csc_toolbar {
60
+ display: flex;
61
+ align-items: center;
62
+ gap: 8px;
63
+ margin-block-end: 8px;
64
+ }
65
+ .csc_title {
66
+ flex: 1;
67
+ font-weight: 600;
68
+ text-transform: capitalize;
69
+ text-align: center;
70
+ font-size: 24px;
71
+ }
72
+ .csc_button {
73
+ border: 1px solid #c7c7c7;
74
+ background-color: #33b215 !important;
75
+ color: #ffffff;
76
+ border-radius: 4px;
77
+ box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.4);
78
+ cursor: pointer;
79
+ width: 40px;
80
+ height: 40px;
81
+ text-align: center;
82
+ vertical-align: middle;
83
+ }
84
+ .csc_button:disabled {
85
+ opacity: 0.5;
86
+ cursor: not-allowed;
87
+ }
88
+ .csc_year {
89
+ border: 1px solid #c7c7c7;
90
+ background-color: #33b215 !important;
91
+ color: #ffffff;
92
+ border-radius: 4px;
93
+ box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.4);
94
+ cursor: pointer;
95
+ padding: 5px;
96
+ }
97
+ .csc_year option {
98
+ color: #000000;
99
+ background-color: #ffffff;
100
+ }
101
+ .csc_page {
102
+ box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.4);
103
+ padding: 10px;
104
+ }
105
+ .csc_weekday, .csc_day {
106
+ display: grid;
107
+ grid-template-columns: repeat(7, 1fr);
108
+ gap: 4px;
109
+ }
110
+ .csc_weekday {
111
+ text-align: center;
112
+ font-weight: 600;
113
+ color: #444444;
114
+ padding: 6px 0;
115
+ }
116
+ .csc_cell {
117
+ aspect-ratio: 1;
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ border-radius: 4px;
122
+ color: #222222;
123
+ border: 1px solid #c7c7c7;
124
+ }
125
+ .csc_cell.csc_today {
126
+ outline: 2px solid #0078d4;
127
+ background: #e5f1fb;
128
+ font-weight: 700;
129
+ }
130
+ .csc_cell.csc_empty {
131
+ color: transparent;
132
+ pointer-events: none;
133
+ border: none;
134
+ }
135
+ .csc_cell:hover {
136
+ background: #f3f3f3;
137
+ }
138
+ `;
139
+ document.head.appendChild(elementStyle);
140
+ };
141
+ initializeHtml = () => {
142
+ const elementContainer = document.querySelector(this.containerTag);
143
+ if (!elementContainer) {
144
+ helperSrc.writeLog("@cimo/schedule_calendar - Manager.ts - initializeHtml()", "Not found: 'elementContainer'!");
145
+ return;
146
+ }
147
+ this.childrenStyle();
148
+ elementContainer.innerHTML = `
149
+ <div class="csc_wrapper">
150
+ <div class="csc_toolbar">
151
+ <button class="csc_button csc_back" type="button">‹</button>
152
+ <div class="csc_title"></div>
153
+ <button class="csc_button csc_forward" type="button">›</button>
154
+ <select class="csc_year"></select>
155
+ <button class="csc_button csc_today" type="button">[#]</button>
156
+ </div>
157
+ <div class="csc_page">
158
+ <div class="csc_weekday"></div>
159
+ <div class="csc_day"></div>
160
+ </div>
161
+ </div>
162
+ `;
163
+ this.elementButtonBack = elementContainer.querySelector(".csc_back");
164
+ this.elementTitle = elementContainer.querySelector(".csc_title");
165
+ this.elementButtonForward = elementContainer.querySelector(".csc_forward");
166
+ this.elementSelectYear = elementContainer.querySelector(".csc_year");
167
+ this.elementButtonToday = elementContainer.querySelector(".csc_today");
168
+ this.elementWeekday = elementContainer.querySelector(".csc_weekday");
169
+ this.elementDay = elementContainer.querySelector(".csc_day");
170
+ if (!this.elementSelectYear || !this.elementSelectYear) {
171
+ helperSrc.writeLog("@cimo/schedule_calendar - Manager.ts - initializeHtml()", "Not found: 'elementSelectYear' or 'elementSelectYear'!");
172
+ return;
173
+ }
174
+ this.elementSelectYear.value = this.yearCurrent.toString();
175
+ for (let a = this.yearMax; a >= this.yearMin; a--) {
176
+ const elementOption = document.createElement("option");
177
+ elementOption.value = a.toString();
178
+ elementOption.textContent = a.toString();
179
+ this.elementSelectYear.appendChild(elementOption);
180
+ }
181
+ };
182
+ render = () => {
183
+ if (!this.elementButtonBack ||
184
+ !this.elementTitle ||
185
+ !this.elementButtonForward ||
186
+ !this.elementSelectYear ||
187
+ !this.elementButtonToday ||
188
+ !this.elementWeekday ||
189
+ !this.elementDay) {
190
+ helperSrc.writeLog("@cimo/schedule_calendar - Manager.ts - render()", "Not found render element!");
191
+ return;
192
+ }
193
+ if (this.callbackCurrent) {
194
+ this.callbackCurrent(this.yearCurrent, this.monthCurrent);
195
+ }
196
+ this.elementTitle.textContent = new Intl.DateTimeFormat(this.option.locale, { month: "long", year: "numeric" }).format(new Date(this.yearCurrent, this.monthCurrent, 1));
197
+ this.elementWeekday.innerHTML = "";
198
+ this.elementDay.innerHTML = "";
199
+ const dayFirst = new Date(this.yearCurrent, this.monthCurrent, 1).getDay();
200
+ const dayTotal = new Date(this.yearCurrent, this.monthCurrent + 1, 0).getDate();
201
+ const offset = this.option.isStartOnMonday ? (dayFirst === 0 ? 6 : dayFirst - 1) : dayFirst;
202
+ if (offset === 1) {
203
+ this.weekdayList = this.weekdayList.slice(6).concat(this.weekdayList.slice(0, 6));
204
+ }
205
+ for (const weekday of this.weekdayList) {
206
+ const elementDiv = document.createElement("div");
207
+ elementDiv.className = "csc_weekday_label";
208
+ elementDiv.textContent = weekday;
209
+ this.elementWeekday.appendChild(elementDiv);
210
+ }
211
+ for (let a = 0; a < 42; a++) {
212
+ const elementDiv = document.createElement("div");
213
+ elementDiv.className = "csc_cell";
214
+ const dayNumber = a - offset + 1;
215
+ if (dayNumber > 0 && dayNumber <= dayTotal) {
216
+ elementDiv.innerHTML = `<p>${dayNumber}</p>`;
217
+ if (this.option.isHighlightToday &&
218
+ dayNumber === this.date.getDate() &&
219
+ this.monthCurrent === this.date.getMonth() &&
220
+ this.yearCurrent === this.date.getFullYear()) {
221
+ elementDiv.classList.add("csc_today");
222
+ }
223
+ if (this.callbackCell) {
224
+ this.callbackCell(elementDiv, dayNumber);
225
+ }
226
+ }
227
+ else {
228
+ if (a % 7 === 0 && dayNumber > dayTotal) {
229
+ break;
230
+ }
231
+ elementDiv.classList.add("csc_empty");
232
+ elementDiv.textContent = "";
233
+ }
234
+ this.elementDay.appendChild(elementDiv);
235
+ }
236
+ this.elementButtonBack.disabled = this.yearCurrent === this.yearMin && this.monthCurrent === 0;
237
+ this.elementButtonForward.disabled = this.yearCurrent === this.yearMax && this.monthCurrent === 11;
238
+ this.elementSelectYear.value = this.yearCurrent.toString();
239
+ };
240
+ event = () => {
241
+ if (!this.elementButtonBack || !this.elementButtonForward || !this.elementSelectYear || !this.elementButtonToday) {
242
+ helperSrc.writeLog("@cimo/schedule_calendar - Manager.ts - event()", "Not found: 'elementButtonBack' or 'elementButtonForward' or 'elementSelectYear' or 'elementButtonToday'!");
243
+ return;
244
+ }
245
+ this.elementButtonBack.addEventListener("click", () => {
246
+ if (this.yearCurrent === this.yearMin && this.monthCurrent === 0) {
247
+ return;
248
+ }
249
+ if (this.monthCurrent === 0) {
250
+ this.monthCurrent = 11;
251
+ this.yearCurrent--;
252
+ }
253
+ else {
254
+ this.monthCurrent--;
255
+ }
256
+ this.render();
257
+ });
258
+ this.elementButtonForward.addEventListener("click", () => {
259
+ if (this.yearCurrent === this.yearMax && this.monthCurrent === 11) {
260
+ return;
261
+ }
262
+ if (this.monthCurrent === 11) {
263
+ this.monthCurrent = 0;
264
+ this.yearCurrent++;
265
+ }
266
+ else {
267
+ this.monthCurrent++;
268
+ }
269
+ this.render();
270
+ });
271
+ this.elementSelectYear.addEventListener("change", (event) => {
272
+ const target = event.target;
273
+ const targetValue = Number(target.value);
274
+ this.yearCurrent = targetValue;
275
+ this.render();
276
+ });
277
+ this.elementButtonToday.addEventListener("click", () => {
278
+ this.date = new Date();
279
+ this.yearCurrent = this.date.getFullYear();
280
+ this.monthCurrent = this.date.getMonth();
281
+ this.render();
282
+ });
283
+ };
284
+ constructor(optionValue, containerTagValue) {
285
+ this.option = optionValue;
286
+ this.containerTag = containerTagValue;
287
+ this.weekdayList = [];
288
+ this.date = new Date();
289
+ this.yearMin = this.date.getFullYear() - this.option.yearBack;
290
+ this.yearMax = this.date.getFullYear() + this.option.yearForward;
291
+ this.yearCurrent = this.date.getFullYear();
292
+ this.monthCurrent = this.date.getMonth();
293
+ this.elementButtonBack = null;
294
+ this.elementTitle = null;
295
+ this.elementButtonForward = null;
296
+ this.elementSelectYear = null;
297
+ this.elementButtonToday = null;
298
+ this.elementWeekday = null;
299
+ this.elementDay = null;
300
+ }
301
+ callbackCurrent;
302
+ callbackCell;
303
+ setWeekdayList = (value) => {
304
+ this.weekdayList = value;
305
+ };
306
+ create = () => {
307
+ this.initializeHtml();
308
+ this.render();
309
+ this.event();
310
+ };
311
+ }
312
+ exports.default = Manager;
313
+ //# sourceMappingURL=Manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Manager.js","sourceRoot":"","sources":["../../src/Manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uDAAyC;AAGzC,MAAqB,OAAO;IAChB,MAAM,CAAgB;IACtB,YAAY,CAAS;IAErB,WAAW,CAAW;IAEtB,IAAI,CAAO;IACX,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,WAAW,CAAS;IACpB,YAAY,CAAS;IAErB,iBAAiB,CAA2B;IAC5C,YAAY,CAAwB;IACpC,oBAAoB,CAA2B;IAC/C,iBAAiB,CAA2B;IAC5C,kBAAkB,CAA2B;IAC7C,cAAc,CAAwB;IACtC,UAAU,CAAwB;IAElC,aAAa,GAAG,GAAS,EAAE;QAC/B,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAErD,YAAY,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAmF1B,CAAC;QAEF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC,CAAC;IAEM,cAAc,GAAG,GAAS,EAAE;QAChC,MAAM,gBAAgB,GAAuB,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY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C;QACjC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,eAAe,CAAyC;IACxD,YAAY,CAA2D;IAEvE,cAAc,GAAG,CAAC,KAAe,EAAQ,EAAE;QACvC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,GAAG,GAAS,EAAE;QAChB,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,IAAI,CAAC,MAAM,EAAE,CAAC;QAEd,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC,CAAC;CACL;AAvVD,0BAuVC"}
@@ -0,0 +1,7 @@
1
+ export interface Ioption {
2
+ locale: string;
3
+ yearBack: number;
4
+ yearForward: number;
5
+ isStartOnMonday: boolean;
6
+ isHighlightToday: boolean;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/Model.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"root":["../eslint.customRule.ts","../global.d.ts","../src/HelperSrc.ts","../src/Main.ts","../src/Manager.ts","../src/Model.ts"],"version":"5.7.2"}
@@ -0,0 +1 @@
1
+ {"root":["../eslint.customRule.ts","../global.d.ts"],"version":"5.7.2"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@cimo/schedule_calendar",
3
+ "version": "1.0.0",
4
+ "description": "Schedule calendar. Light, fast and secure.",
5
+ "author": "cimo",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/cimo/Npm_schedule_calendar.git"
10
+ },
11
+ "scripts": {
12
+ "remove_dist": "node -e \"const fs = require('fs'); try{ fs.rmdirSync('./dist/', { recursive: true }) } catch{}; process.exit(0);\"",
13
+ "remove_build": "node -e \"const fs = require('fs'); try{ fs.rmdirSync('./build/', { recursive: true }) } catch{}; process.exit(0);\"",
14
+ "check": "eslint --no-cache --config eslint.config.js",
15
+ "build_tsc": "npm run remove_dist && tsc --build tsconfig.tsc.json",
16
+ "build_library": "npm run remove_build && tsc --build tsconfig.json && npm pack && mkdir -p ./build/ && mv *.tgz ./build/",
17
+ "build": "npm audit && npm run build_tsc && npm run check && npm run build_library"
18
+ },
19
+ "dependencies": {},
20
+ "devDependencies": {
21
+ "typescript": "5.7.2",
22
+ "eslint": "9.31.0",
23
+ "@typescript-eslint/parser": "8.24.1",
24
+ "@typescript-eslint/eslint-plugin": "8.24.1",
25
+ "eslint-plugin-prettier": "5.2.1",
26
+ "prettier": "3.4.2",
27
+ "globals": "15.13.0",
28
+ "@types/node": "22.10.2"
29
+ },
30
+ "resolutions": {},
31
+ "files": [
32
+ "./dist/"
33
+ ],
34
+ "main": "./dist/Main.js",
35
+ "types": "./dist/Main.d.ts",
36
+ "keywords": [
37
+ "calendar",
38
+ "schedule",
39
+ "nodejs",
40
+ "typescript",
41
+ "cimo",
42
+ "native",
43
+ "no dependencies"
44
+ ]
45
+ }