@idds/js 1.0.90 → 1.0.92

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.
@@ -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
- decadeStart -= 20;
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
- decadeStart += 20;
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
- rangeText.textContent = `${decadeStart} - ${decadeStart + 19}`;
667
- for (let y = decadeStart; y < decadeStart + 20; y++) {
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`;
@@ -993,6 +996,7 @@ var InaUI = (() => {
993
996
  minuteStep: 1,
994
997
  secondStep: 1,
995
998
  onChange: null,
999
+ size: this.container.dataset.size || "md",
996
1000
  ...options
997
1001
  };
998
1002
  this.state = {
@@ -1114,7 +1118,7 @@ var InaUI = (() => {
1114
1118
  wrapper.appendChild(prefixIcon);
1115
1119
  input = document.createElement("input");
1116
1120
  input.type = "text";
1117
- input.className = `${PREFIX}-time-picker__input ${PREFIX}-time-picker__input--size-md ${PREFIX}-time-picker__input--with-prefix`;
1121
+ input.className = `${PREFIX}-time-picker__input ${PREFIX}-time-picker__input--size-${this.options.size} ${PREFIX}-time-picker__input--with-prefix`;
1118
1122
  if (this.options.allowClear)
1119
1123
  input.classList.add(`${PREFIX}-time-picker__input--with-suffix`);
1120
1124
  input.placeholder = this.container.getAttribute("placeholder") || "Select time";
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
- decadeStart -= 20;
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
- decadeStart += 20;
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
- rangeText.textContent = `${decadeStart} - ${decadeStart + 19}`;
657
- for (let y = decadeStart; y < decadeStart + 20; y++) {
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`;
@@ -983,6 +986,7 @@ var TimePicker = class {
983
986
  minuteStep: 1,
984
987
  secondStep: 1,
985
988
  onChange: null,
989
+ size: this.container.dataset.size || "md",
986
990
  ...options
987
991
  };
988
992
  this.state = {
@@ -1104,7 +1108,7 @@ var TimePicker = class {
1104
1108
  wrapper.appendChild(prefixIcon);
1105
1109
  input = document.createElement("input");
1106
1110
  input.type = "text";
1107
- input.className = `${PREFIX}-time-picker__input ${PREFIX}-time-picker__input--size-md ${PREFIX}-time-picker__input--with-prefix`;
1111
+ input.className = `${PREFIX}-time-picker__input ${PREFIX}-time-picker__input--size-${this.options.size} ${PREFIX}-time-picker__input--with-prefix`;
1108
1112
  if (this.options.allowClear)
1109
1113
  input.classList.add(`${PREFIX}-time-picker__input--with-suffix`);
1110
1114
  input.placeholder = this.container.getAttribute("placeholder") || "Select time";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idds/js",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },