cynx-lib 1.3.77 → 1.3.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-lib",
3
- "version": "1.3.77",
3
+ "version": "1.3.78",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -97,8 +97,7 @@ export function DatePicker({
97
97
  maxDate,
98
98
  disabled,
99
99
  size = 'md',
100
- showStepper = false,
101
- stepperPosition = 'off',
100
+ stepper = 'off',
102
101
  locale = 'en',
103
102
  style,
104
103
  fullWidth = false,
@@ -833,12 +832,6 @@ export function DatePicker({
833
832
  </button>
834
833
  );
835
834
 
836
- const actualPos = stepperPosition || 'around';
837
- const showStepperEffective = showStepper && actualPos !== 'off';
838
- const posMode = actualPos === 'left' || actualPos === 'start' ? 'left'
839
- : actualPos === 'right' || actualPos === 'end' ? 'right'
840
- : 'around';
841
-
842
835
  return (
843
836
  <div style={{
844
837
  display: fullWidth || style?.display === 'flex' ? 'flex' : 'inline-flex',
@@ -864,15 +857,23 @@ export function DatePicker({
864
857
  maxWidth: '100%',
865
858
  minWidth: 0,
866
859
  }}>
867
- {showStepperEffective && posMode === 'around' && renderPrevBtn()}
868
- {showStepperEffective && posMode === 'left' && renderPrevBtn()}
869
- {showStepperEffective && posMode === 'left' && renderNextBtn()}
860
+ {stepper === 'around' && renderPrevBtn()}
861
+ {stepper === 'left' && (
862
+ <>
863
+ {renderPrevBtn()}
864
+ {renderNextBtn()}
865
+ </>
866
+ )}
870
867
 
871
868
  {renderTriggerBtn()}
872
869
 
873
- {showStepperEffective && posMode === 'around' && renderNextBtn()}
874
- {showStepperEffective && posMode === 'right' && renderPrevBtn()}
875
- {showStepperEffective && posMode === 'right' && renderNextBtn()}
870
+ {stepper === 'around' && renderNextBtn()}
871
+ {stepper === 'right' && (
872
+ <>
873
+ {renderPrevBtn()}
874
+ {renderNextBtn()}
875
+ </>
876
+ )}
876
877
  </div>
877
878
 
878
879
  {/* Dropdown via portal */}
@@ -151,8 +151,7 @@ const props = withDefaults(
151
151
  maxDate?: any;
152
152
  disabled?: boolean;
153
153
  size?: "xs" | "sm" | "md" | "lg";
154
- showStepper?: boolean;
155
- stepperPosition?: "off" | "around" | "left" | "right" | "start" | "end";
154
+ stepper?: "off" | "around" | "left" | "right";
156
155
  locale?: "en" | "ru" | DatePickerLocale | string;
157
156
  clearable?: boolean;
158
157
  fullWidth?: boolean;
@@ -174,8 +173,7 @@ const props = withDefaults(
174
173
  maxDate: undefined,
175
174
  disabled: false,
176
175
  size: "md",
177
- showStepper: false,
178
- stepperPosition: "off",
176
+ stepper: "off",
179
177
  locale: "en",
180
178
  clearable: true,
181
179
  fullWidth: false,
@@ -644,15 +642,6 @@ const isYearDisabled = (yr: number) => {
644
642
  return Boolean(disMin || disMax);
645
643
  };
646
644
 
647
- const showStepperEffective = computed(
648
- () => props.showStepper && props.stepperPosition !== "off"
649
- );
650
- const posMode = computed(() => {
651
- const p = props.stepperPosition;
652
- if (p === "left" || p === "start") return "left";
653
- if (p === "right" || p === "end") return "right";
654
- return "around";
655
- });
656
645
  </script>
657
646
 
658
647
  <template>
@@ -698,7 +687,7 @@ const posMode = computed(() => {
698
687
  >
699
688
  <!-- Left stepper buttons -->
700
689
  <button
701
- v-if="showStepperEffective && (posMode === 'around' || posMode === 'left')"
690
+ v-if="props.stepper === 'around' || props.stepper === 'left'"
702
691
  type="button"
703
692
  :disabled="disabled || isCellDisabled(new Date(new Date(valDate || new Date()).setDate((valDate || new Date()).getDate() - 1)))"
704
693
  style="
@@ -725,6 +714,34 @@ const posMode = computed(() => {
725
714
  <ChevronLeft :size="s.iconSize + 2" />
726
715
  </button>
727
716
 
717
+ <button
718
+ v-if="props.stepper === 'left'"
719
+ type="button"
720
+ :disabled="disabled || isCellDisabled(new Date(new Date(valDate || new Date()).setDate((valDate || new Date()).getDate() + 1)))"
721
+ style="
722
+ display: flex;
723
+ align-items: center;
724
+ justify-content: center;
725
+ border-radius: var(--rads, 8px);
726
+ border: 1px solid var(--border, #e2e8f0);
727
+ background: var(--surface, #ffffff);
728
+ color: var(--muted, #797b8d);
729
+ box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08));
730
+ flex-shrink: 0;
731
+ cursor: pointer;
732
+ transition: all .15s;
733
+ "
734
+ :style="{
735
+ width: `${s.btnSize}px`,
736
+ height: `${s.btnSize}px`,
737
+ opacity: disabled ? 0.35 : 1,
738
+ }"
739
+ title="Next day (+1)"
740
+ @click.stop="changeDay(1)"
741
+ >
742
+ <ChevronRight :size="s.iconSize + 2" />
743
+ </button>
744
+
728
745
  <!-- Trigger button -->
729
746
  <button
730
747
  ref="btnRef"
@@ -794,7 +811,35 @@ const posMode = computed(() => {
794
811
 
795
812
  <!-- Right stepper buttons -->
796
813
  <button
797
- v-if="showStepperEffective && (posMode === 'around' || posMode === 'right')"
814
+ v-if="props.stepper === 'right'"
815
+ type="button"
816
+ :disabled="disabled || isCellDisabled(new Date(new Date(valDate || new Date()).setDate((valDate || new Date()).getDate() - 1)))"
817
+ style="
818
+ display: flex;
819
+ align-items: center;
820
+ justify-content: center;
821
+ border-radius: var(--rads, 8px);
822
+ border: 1px solid var(--border, #e2e8f0);
823
+ background: var(--surface, #ffffff);
824
+ color: var(--muted, #797b8d);
825
+ box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08));
826
+ flex-shrink: 0;
827
+ cursor: pointer;
828
+ transition: all .15s;
829
+ "
830
+ :style="{
831
+ width: `${s.btnSize}px`,
832
+ height: `${s.btnSize}px`,
833
+ opacity: disabled ? 0.35 : 1,
834
+ }"
835
+ title="Previous day (-1)"
836
+ @click.stop="changeDay(-1)"
837
+ >
838
+ <ChevronLeft :size="s.iconSize + 2" />
839
+ </button>
840
+
841
+ <button
842
+ v-if="props.stepper === 'around' || props.stepper === 'right'"
798
843
  type="button"
799
844
  :disabled="disabled || isCellDisabled(new Date(new Date(valDate || new Date()).setDate((valDate || new Date()).getDate() + 1)))"
800
845
  style="