@idds/js 1.0.90 → 1.0.91
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 +8 -5
- package/dist/index.js +8 -5
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -628,7 +628,7 @@ var InaUI = (() => {
|
|
|
628
628
|
container.className = `${PREFIX}-year-picker`;
|
|
629
629
|
let currentYearVal = initialYear;
|
|
630
630
|
let isPickerOpen = false;
|
|
631
|
-
let decadeStart = Math.floor(initialYear / 20) * 20;
|
|
631
|
+
let decadeStart = Math.floor(initialYear / (window.innerWidth <= 639 ? 9 : 20)) * (window.innerWidth <= 639 ? 9 : 20);
|
|
632
632
|
const pickerTrigger = document.createElement("button");
|
|
633
633
|
pickerTrigger.type = "button";
|
|
634
634
|
pickerTrigger.className = `${PREFIX}-year-picker__trigger ${PREFIX}-year-picker__trigger--size-sm`;
|
|
@@ -645,7 +645,8 @@ var InaUI = (() => {
|
|
|
645
645
|
prevBtn.className = `${PREFIX}-year-picker__nav-button`;
|
|
646
646
|
prevBtn.innerHTML = this.createIcon("chevron-left");
|
|
647
647
|
prevBtn.onclick = () => {
|
|
648
|
-
|
|
648
|
+
const currentDecadeSize = window.innerWidth <= 639 ? 9 : 20;
|
|
649
|
+
decadeStart -= currentDecadeSize;
|
|
649
650
|
renderGrid();
|
|
650
651
|
};
|
|
651
652
|
const nextBtn = document.createElement("button");
|
|
@@ -653,7 +654,8 @@ var InaUI = (() => {
|
|
|
653
654
|
nextBtn.className = `${PREFIX}-year-picker__nav-button`;
|
|
654
655
|
nextBtn.innerHTML = this.createIcon("chevron-right");
|
|
655
656
|
nextBtn.onclick = () => {
|
|
656
|
-
|
|
657
|
+
const currentDecadeSize = window.innerWidth <= 639 ? 9 : 20;
|
|
658
|
+
decadeStart += currentDecadeSize;
|
|
657
659
|
renderGrid();
|
|
658
660
|
};
|
|
659
661
|
const rangeText = document.createElement("span");
|
|
@@ -663,8 +665,9 @@ var InaUI = (() => {
|
|
|
663
665
|
grid.className = `${PREFIX}-year-picker__grid`;
|
|
664
666
|
const renderGrid = () => {
|
|
665
667
|
grid.innerHTML = "";
|
|
666
|
-
|
|
667
|
-
|
|
668
|
+
const currentDecadeSize = window.innerWidth <= 639 ? 9 : 20;
|
|
669
|
+
rangeText.textContent = `${decadeStart} - ${decadeStart + currentDecadeSize - 1}`;
|
|
670
|
+
for (let y = decadeStart; y < decadeStart + currentDecadeSize; y++) {
|
|
668
671
|
const btn = document.createElement("button");
|
|
669
672
|
btn.type = "button";
|
|
670
673
|
btn.className = `${PREFIX}-year-picker__year-option`;
|
package/dist/index.js
CHANGED
|
@@ -618,7 +618,7 @@ var DatePicker = class {
|
|
|
618
618
|
container.className = `${PREFIX}-year-picker`;
|
|
619
619
|
let currentYearVal = initialYear;
|
|
620
620
|
let isPickerOpen = false;
|
|
621
|
-
let decadeStart = Math.floor(initialYear / 20) * 20;
|
|
621
|
+
let decadeStart = Math.floor(initialYear / (window.innerWidth <= 639 ? 9 : 20)) * (window.innerWidth <= 639 ? 9 : 20);
|
|
622
622
|
const pickerTrigger = document.createElement("button");
|
|
623
623
|
pickerTrigger.type = "button";
|
|
624
624
|
pickerTrigger.className = `${PREFIX}-year-picker__trigger ${PREFIX}-year-picker__trigger--size-sm`;
|
|
@@ -635,7 +635,8 @@ var DatePicker = class {
|
|
|
635
635
|
prevBtn.className = `${PREFIX}-year-picker__nav-button`;
|
|
636
636
|
prevBtn.innerHTML = this.createIcon("chevron-left");
|
|
637
637
|
prevBtn.onclick = () => {
|
|
638
|
-
|
|
638
|
+
const currentDecadeSize = window.innerWidth <= 639 ? 9 : 20;
|
|
639
|
+
decadeStart -= currentDecadeSize;
|
|
639
640
|
renderGrid();
|
|
640
641
|
};
|
|
641
642
|
const nextBtn = document.createElement("button");
|
|
@@ -643,7 +644,8 @@ var DatePicker = class {
|
|
|
643
644
|
nextBtn.className = `${PREFIX}-year-picker__nav-button`;
|
|
644
645
|
nextBtn.innerHTML = this.createIcon("chevron-right");
|
|
645
646
|
nextBtn.onclick = () => {
|
|
646
|
-
|
|
647
|
+
const currentDecadeSize = window.innerWidth <= 639 ? 9 : 20;
|
|
648
|
+
decadeStart += currentDecadeSize;
|
|
647
649
|
renderGrid();
|
|
648
650
|
};
|
|
649
651
|
const rangeText = document.createElement("span");
|
|
@@ -653,8 +655,9 @@ var DatePicker = class {
|
|
|
653
655
|
grid.className = `${PREFIX}-year-picker__grid`;
|
|
654
656
|
const renderGrid = () => {
|
|
655
657
|
grid.innerHTML = "";
|
|
656
|
-
|
|
657
|
-
|
|
658
|
+
const currentDecadeSize = window.innerWidth <= 639 ? 9 : 20;
|
|
659
|
+
rangeText.textContent = `${decadeStart} - ${decadeStart + currentDecadeSize - 1}`;
|
|
660
|
+
for (let y = decadeStart; y < decadeStart + currentDecadeSize; y++) {
|
|
658
661
|
const btn = document.createElement("button");
|
|
659
662
|
btn.type = "button";
|
|
660
663
|
btn.className = `${PREFIX}-year-picker__year-option`;
|