@idds/js 1.0.40 → 1.0.41
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/dist/index.iife.js +25 -33
- package/dist/index.js +25 -33
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -264,7 +264,6 @@ var InaUI = (() => {
|
|
|
264
264
|
btn.classList.add("ina-month-picker__month-option--selected");
|
|
265
265
|
btn.textContent = m;
|
|
266
266
|
btn.addEventListener("click", (e) => {
|
|
267
|
-
e.stopPropagation();
|
|
268
267
|
currentMonthIdx = idx;
|
|
269
268
|
updateText();
|
|
270
269
|
togglePicker(false);
|
|
@@ -275,7 +274,6 @@ var InaUI = (() => {
|
|
|
275
274
|
pickerPanel.appendChild(grid);
|
|
276
275
|
container.append(pickerTrigger, pickerPanel);
|
|
277
276
|
pickerTrigger.addEventListener("click", (e) => {
|
|
278
|
-
e.stopPropagation();
|
|
279
277
|
togglePicker(!isPickerOpen);
|
|
280
278
|
});
|
|
281
279
|
function togglePicker(show) {
|
|
@@ -321,7 +319,6 @@ var InaUI = (() => {
|
|
|
321
319
|
prevBtn.className = "ina-year-picker__nav-button";
|
|
322
320
|
prevBtn.innerHTML = createIcon("chevron-left");
|
|
323
321
|
prevBtn.onclick = (e) => {
|
|
324
|
-
e.stopPropagation();
|
|
325
322
|
decadeStart -= 20;
|
|
326
323
|
renderGrid();
|
|
327
324
|
};
|
|
@@ -330,7 +327,6 @@ var InaUI = (() => {
|
|
|
330
327
|
nextBtn.className = "ina-year-picker__nav-button";
|
|
331
328
|
nextBtn.innerHTML = createIcon("chevron-right");
|
|
332
329
|
nextBtn.onclick = (e) => {
|
|
333
|
-
e.stopPropagation();
|
|
334
330
|
decadeStart += 20;
|
|
335
331
|
renderGrid();
|
|
336
332
|
};
|
|
@@ -350,7 +346,6 @@ var InaUI = (() => {
|
|
|
350
346
|
btn.classList.add("ina-year-picker__year-option--selected");
|
|
351
347
|
btn.textContent = y;
|
|
352
348
|
btn.addEventListener("click", (e) => {
|
|
353
|
-
e.stopPropagation();
|
|
354
349
|
currentYearVal = y;
|
|
355
350
|
updateText();
|
|
356
351
|
togglePicker(false);
|
|
@@ -362,7 +357,6 @@ var InaUI = (() => {
|
|
|
362
357
|
pickerPanel.append(header, grid);
|
|
363
358
|
container.append(pickerTrigger, pickerPanel);
|
|
364
359
|
pickerTrigger.addEventListener("click", (e) => {
|
|
365
|
-
e.stopPropagation();
|
|
366
360
|
togglePicker(!isPickerOpen);
|
|
367
361
|
});
|
|
368
362
|
function togglePicker(show) {
|
|
@@ -403,7 +397,6 @@ var InaUI = (() => {
|
|
|
403
397
|
prevBtn.className = "ina-date-picker__nav-button";
|
|
404
398
|
prevBtn.innerHTML = createIcon("chevron-left");
|
|
405
399
|
prevBtn.onclick = (e) => {
|
|
406
|
-
e.stopPropagation();
|
|
407
400
|
viewDate.setMonth(viewDate.getMonth() - 1);
|
|
408
401
|
render();
|
|
409
402
|
};
|
|
@@ -413,31 +406,33 @@ var InaUI = (() => {
|
|
|
413
406
|
spacer.style.width = "32px";
|
|
414
407
|
header.appendChild(spacer);
|
|
415
408
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
409
|
+
const controls = document.createElement("div");
|
|
410
|
+
controls.className = isNextMonth ? "ina-date-picker__next-month-controls" : "ina-date-picker__header-controls";
|
|
411
|
+
controls.className = "ina-date-picker__header-controls";
|
|
412
|
+
const monthCont = document.createElement("div");
|
|
413
|
+
monthCont.className = "ina-date-picker__dropdown-container";
|
|
414
|
+
const monthPicker = createMonthPicker(month, (m) => {
|
|
415
|
+
if (isNextMonth) {
|
|
416
|
+
viewDate = new Date(year, m - 1, 1);
|
|
417
|
+
} else {
|
|
422
418
|
viewDate.setMonth(m);
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
419
|
+
}
|
|
420
|
+
render();
|
|
421
|
+
});
|
|
422
|
+
monthCont.appendChild(monthPicker.element);
|
|
423
|
+
const yearCont = document.createElement("div");
|
|
424
|
+
yearCont.className = "ina-date-picker__dropdown-container";
|
|
425
|
+
const yearPicker = createYearPicker(year, (y) => {
|
|
426
|
+
if (isNextMonth) {
|
|
427
|
+
viewDate = new Date(y, month - 1, 1);
|
|
428
|
+
} else {
|
|
429
429
|
viewDate.setFullYear(y);
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
const title = document.createElement("div");
|
|
437
|
-
title.className = "ina-date-picker__calendar-title";
|
|
438
|
-
title.textContent = `${MONTHS_ID[month]} ${year}`;
|
|
439
|
-
header.appendChild(title);
|
|
440
|
-
}
|
|
430
|
+
}
|
|
431
|
+
render();
|
|
432
|
+
});
|
|
433
|
+
yearCont.appendChild(yearPicker.element);
|
|
434
|
+
controls.append(monthCont, yearCont);
|
|
435
|
+
header.appendChild(controls);
|
|
441
436
|
const showNextBtn = mode === "single" && !isNextMonth || isNextMonth;
|
|
442
437
|
if (showNextBtn) {
|
|
443
438
|
const nextBtn = document.createElement("button");
|
|
@@ -445,7 +440,6 @@ var InaUI = (() => {
|
|
|
445
440
|
nextBtn.className = "ina-date-picker__nav-button";
|
|
446
441
|
nextBtn.innerHTML = createIcon("chevron-right");
|
|
447
442
|
nextBtn.onclick = (e) => {
|
|
448
|
-
e.stopPropagation();
|
|
449
443
|
viewDate.setMonth(viewDate.getMonth() + 1);
|
|
450
444
|
render();
|
|
451
445
|
};
|
|
@@ -503,7 +497,6 @@ var InaUI = (() => {
|
|
|
503
497
|
if (!isSelected && !isInRange)
|
|
504
498
|
btn.classList.add("ina-date-picker__day--hover");
|
|
505
499
|
btn.onclick = (e) => {
|
|
506
|
-
e.stopPropagation();
|
|
507
500
|
if (mode === "single") {
|
|
508
501
|
selectedDate = date;
|
|
509
502
|
close();
|
|
@@ -581,7 +574,6 @@ var InaUI = (() => {
|
|
|
581
574
|
else open();
|
|
582
575
|
}
|
|
583
576
|
trigger.addEventListener("click", (e) => {
|
|
584
|
-
e.stopPropagation();
|
|
585
577
|
toggle();
|
|
586
578
|
});
|
|
587
579
|
document.addEventListener("click", (e) => {
|
package/dist/index.js
CHANGED
|
@@ -252,7 +252,6 @@ function initDatepicker() {
|
|
|
252
252
|
btn.classList.add("ina-month-picker__month-option--selected");
|
|
253
253
|
btn.textContent = m;
|
|
254
254
|
btn.addEventListener("click", (e) => {
|
|
255
|
-
e.stopPropagation();
|
|
256
255
|
currentMonthIdx = idx;
|
|
257
256
|
updateText();
|
|
258
257
|
togglePicker(false);
|
|
@@ -263,7 +262,6 @@ function initDatepicker() {
|
|
|
263
262
|
pickerPanel.appendChild(grid);
|
|
264
263
|
container.append(pickerTrigger, pickerPanel);
|
|
265
264
|
pickerTrigger.addEventListener("click", (e) => {
|
|
266
|
-
e.stopPropagation();
|
|
267
265
|
togglePicker(!isPickerOpen);
|
|
268
266
|
});
|
|
269
267
|
function togglePicker(show) {
|
|
@@ -309,7 +307,6 @@ function initDatepicker() {
|
|
|
309
307
|
prevBtn.className = "ina-year-picker__nav-button";
|
|
310
308
|
prevBtn.innerHTML = createIcon("chevron-left");
|
|
311
309
|
prevBtn.onclick = (e) => {
|
|
312
|
-
e.stopPropagation();
|
|
313
310
|
decadeStart -= 20;
|
|
314
311
|
renderGrid();
|
|
315
312
|
};
|
|
@@ -318,7 +315,6 @@ function initDatepicker() {
|
|
|
318
315
|
nextBtn.className = "ina-year-picker__nav-button";
|
|
319
316
|
nextBtn.innerHTML = createIcon("chevron-right");
|
|
320
317
|
nextBtn.onclick = (e) => {
|
|
321
|
-
e.stopPropagation();
|
|
322
318
|
decadeStart += 20;
|
|
323
319
|
renderGrid();
|
|
324
320
|
};
|
|
@@ -338,7 +334,6 @@ function initDatepicker() {
|
|
|
338
334
|
btn.classList.add("ina-year-picker__year-option--selected");
|
|
339
335
|
btn.textContent = y;
|
|
340
336
|
btn.addEventListener("click", (e) => {
|
|
341
|
-
e.stopPropagation();
|
|
342
337
|
currentYearVal = y;
|
|
343
338
|
updateText();
|
|
344
339
|
togglePicker(false);
|
|
@@ -350,7 +345,6 @@ function initDatepicker() {
|
|
|
350
345
|
pickerPanel.append(header, grid);
|
|
351
346
|
container.append(pickerTrigger, pickerPanel);
|
|
352
347
|
pickerTrigger.addEventListener("click", (e) => {
|
|
353
|
-
e.stopPropagation();
|
|
354
348
|
togglePicker(!isPickerOpen);
|
|
355
349
|
});
|
|
356
350
|
function togglePicker(show) {
|
|
@@ -391,7 +385,6 @@ function initDatepicker() {
|
|
|
391
385
|
prevBtn.className = "ina-date-picker__nav-button";
|
|
392
386
|
prevBtn.innerHTML = createIcon("chevron-left");
|
|
393
387
|
prevBtn.onclick = (e) => {
|
|
394
|
-
e.stopPropagation();
|
|
395
388
|
viewDate.setMonth(viewDate.getMonth() - 1);
|
|
396
389
|
render();
|
|
397
390
|
};
|
|
@@ -401,31 +394,33 @@ function initDatepicker() {
|
|
|
401
394
|
spacer.style.width = "32px";
|
|
402
395
|
header.appendChild(spacer);
|
|
403
396
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
397
|
+
const controls = document.createElement("div");
|
|
398
|
+
controls.className = isNextMonth ? "ina-date-picker__next-month-controls" : "ina-date-picker__header-controls";
|
|
399
|
+
controls.className = "ina-date-picker__header-controls";
|
|
400
|
+
const monthCont = document.createElement("div");
|
|
401
|
+
monthCont.className = "ina-date-picker__dropdown-container";
|
|
402
|
+
const monthPicker = createMonthPicker(month, (m) => {
|
|
403
|
+
if (isNextMonth) {
|
|
404
|
+
viewDate = new Date(year, m - 1, 1);
|
|
405
|
+
} else {
|
|
410
406
|
viewDate.setMonth(m);
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
407
|
+
}
|
|
408
|
+
render();
|
|
409
|
+
});
|
|
410
|
+
monthCont.appendChild(monthPicker.element);
|
|
411
|
+
const yearCont = document.createElement("div");
|
|
412
|
+
yearCont.className = "ina-date-picker__dropdown-container";
|
|
413
|
+
const yearPicker = createYearPicker(year, (y) => {
|
|
414
|
+
if (isNextMonth) {
|
|
415
|
+
viewDate = new Date(y, month - 1, 1);
|
|
416
|
+
} else {
|
|
417
417
|
viewDate.setFullYear(y);
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
const title = document.createElement("div");
|
|
425
|
-
title.className = "ina-date-picker__calendar-title";
|
|
426
|
-
title.textContent = `${MONTHS_ID[month]} ${year}`;
|
|
427
|
-
header.appendChild(title);
|
|
428
|
-
}
|
|
418
|
+
}
|
|
419
|
+
render();
|
|
420
|
+
});
|
|
421
|
+
yearCont.appendChild(yearPicker.element);
|
|
422
|
+
controls.append(monthCont, yearCont);
|
|
423
|
+
header.appendChild(controls);
|
|
429
424
|
const showNextBtn = mode === "single" && !isNextMonth || isNextMonth;
|
|
430
425
|
if (showNextBtn) {
|
|
431
426
|
const nextBtn = document.createElement("button");
|
|
@@ -433,7 +428,6 @@ function initDatepicker() {
|
|
|
433
428
|
nextBtn.className = "ina-date-picker__nav-button";
|
|
434
429
|
nextBtn.innerHTML = createIcon("chevron-right");
|
|
435
430
|
nextBtn.onclick = (e) => {
|
|
436
|
-
e.stopPropagation();
|
|
437
431
|
viewDate.setMonth(viewDate.getMonth() + 1);
|
|
438
432
|
render();
|
|
439
433
|
};
|
|
@@ -491,7 +485,6 @@ function initDatepicker() {
|
|
|
491
485
|
if (!isSelected && !isInRange)
|
|
492
486
|
btn.classList.add("ina-date-picker__day--hover");
|
|
493
487
|
btn.onclick = (e) => {
|
|
494
|
-
e.stopPropagation();
|
|
495
488
|
if (mode === "single") {
|
|
496
489
|
selectedDate = date;
|
|
497
490
|
close();
|
|
@@ -569,7 +562,6 @@ function initDatepicker() {
|
|
|
569
562
|
else open();
|
|
570
563
|
}
|
|
571
564
|
trigger.addEventListener("click", (e) => {
|
|
572
|
-
e.stopPropagation();
|
|
573
565
|
toggle();
|
|
574
566
|
});
|
|
575
567
|
document.addEventListener("click", (e) => {
|