@pksep/yui 0.1.228 → 0.1.229

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
- modelValue: import('vue').PropType<Date | null>;
3
+ modelValue: import('vue').PropType<Date | string | null>;
4
4
  dataTestid: {
5
5
  type: import('vue').PropType<string>;
6
6
  default: string;
@@ -45,7 +45,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
45
45
  clear: () => void;
46
46
  change: (value: Date | null) => void;
47
47
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
48
- modelValue: import('vue').PropType<Date | null>;
48
+ modelValue: import('vue').PropType<Date | string | null>;
49
49
  dataTestid: {
50
50
  type: import('vue').PropType<string>;
51
51
  default: string;
@@ -51537,7 +51537,7 @@ const CoI = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
51537
51537
  class: "date-picker-yui-kit__header-btn__dash",
51538
51538
  "data-testid": `${I.dataTestid}-HeaderBtnDash-Placeholder`
51539
51539
  }, tI(e.defaultValue), 9, EQg)),
51540
- e.value ? (j(), Lg(FC, {
51540
+ e.value && !I.isTimeSelect ? (j(), Lg(FC, {
51541
51541
  key: 2,
51542
51542
  size: _(Zi).small,
51543
51543
  type: _(AC).ghost,
@@ -51567,7 +51567,7 @@ const CoI = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
51567
51567
  }, null, 8, ["disabled", "modelValue"])) : pg("", !0)
51568
51568
  ], 2));
51569
51569
  }
51570
- }), _Qg = /* @__PURE__ */ Tg(PQg, [["__scopeId", "data-v-134a1c51"]]), YF = ["top", "right", "bottom", "left"], aD = ["start", "end"], dD = /* @__PURE__ */ YF.reduce((C, g) => C.concat(g, g + "-" + aD[0], g + "-" + aD[1]), []), Vn = Math.min, Bt = Math.max, KB = Math.round, Ew = Math.floor, bs = (C) => ({
51570
+ }), _Qg = /* @__PURE__ */ Tg(PQg, [["__scopeId", "data-v-75b78477"]]), YF = ["top", "right", "bottom", "left"], aD = ["start", "end"], dD = /* @__PURE__ */ YF.reduce((C, g) => C.concat(g, g + "-" + aD[0], g + "-" + aD[1]), []), Vn = Math.min, Bt = Math.max, KB = Math.round, Ew = Math.floor, bs = (C) => ({
51571
51571
  x: C,
51572
51572
  y: C
51573
51573
  }), qQg = {
@@ -53065,57 +53065,61 @@ const qUg = /* @__PURE__ */ sg({
53065
53065
  isNotClear: !0,
53066
53066
  startDate: null,
53067
53067
  endDate: null
53068
- }), i = I, A = Tl(C, "modelValue"), n = () => {
53069
- t.isNotClear = !1, A.value = null, i("clear"), setTimeout(() => t.isNotClear = !0, 1), l({
53068
+ }), i = I, A = Tl(C, "modelValue"), n = x(() => {
53069
+ if (!A.value) return null;
53070
+ const B = new Date(A.value);
53071
+ return isNaN(B.getTime()) ? null : B;
53072
+ }), s = () => {
53073
+ t.isNotClear = !1, A.value = null, i("clear"), setTimeout(() => t.isNotClear = !0, 1), o({
53070
53074
  detail: {
53071
53075
  date: null
53072
53076
  }
53073
53077
  });
53074
- }, s = (W) => {
53075
- i("change", W ? new Date(W) : null);
53076
- }, l = ({ detail: W }) => {
53077
- if (!W) return;
53078
- let B = W.date;
53079
- A.value && B && (B = new Date(
53080
- B.getFullYear(),
53081
- B.getMonth(),
53082
- B.getDate(),
53083
- A.value.getHours(),
53084
- A.value.getMinutes()
53085
- )), A.value = B, t.isActive = !1, i("change", B);
53086
- }, o = () => {
53087
- t.isOpen.months = !0;
53078
+ }, l = (B) => {
53079
+ i("change", B ? new Date(B) : null);
53080
+ }, o = ({ detail: B }) => {
53081
+ if (!B) return;
53082
+ let p = B.date;
53083
+ n.value && p && (p = new Date(
53084
+ p.getFullYear(),
53085
+ p.getMonth(),
53086
+ p.getDate(),
53087
+ n.value.getHours(),
53088
+ n.value.getMinutes()
53089
+ )), A.value = p, t.isActive = !1, i("change", p);
53088
53090
  }, a = () => {
53089
- t.isOpen.years = !0;
53091
+ t.isOpen.months = !0;
53090
53092
  }, r = () => {
53091
- t.isOpen.months = !1;
53093
+ t.isOpen.years = !0;
53092
53094
  }, u = () => {
53093
- t.isOpen.years = !1;
53095
+ t.isOpen.months = !1;
53094
53096
  }, m = () => {
53095
- t.isActive = !1, r(), u();
53097
+ t.isOpen.years = !1;
53098
+ }, b = () => {
53099
+ t.isActive = !1, u(), m();
53096
53100
  };
53097
53101
  Ze(() => t.startDate = e.startDate ?? null), Ze(() => t.endDate = e.endDate ?? null);
53098
- const b = () => {
53099
- const W = t.startDate ?? /* @__PURE__ */ new Date();
53102
+ const Z = () => {
53103
+ const B = t.startDate ?? /* @__PURE__ */ new Date();
53100
53104
  if (e.startDate) {
53101
- const B = A.value ?? /* @__PURE__ */ new Date();
53102
- if (W.valueOf() <= B.valueOf())
53103
- return W;
53104
- if (W != null)
53105
- return W;
53105
+ const p = n.value ?? /* @__PURE__ */ new Date();
53106
+ if (B.valueOf() <= p.valueOf())
53107
+ return B;
53108
+ if (B != null)
53109
+ return B;
53106
53110
  }
53107
53111
  return null;
53108
- }, Z = () => {
53109
- const W = t.endDate ?? /* @__PURE__ */ new Date();
53112
+ }, G = () => {
53113
+ const B = t.endDate ?? /* @__PURE__ */ new Date();
53110
53114
  if (e.endDate) {
53111
- const B = A.value ?? /* @__PURE__ */ new Date();
53112
- if (W.valueOf() >= B.valueOf())
53113
- return W;
53114
- if (W != null)
53115
- return W;
53115
+ const p = n.value ?? /* @__PURE__ */ new Date();
53116
+ if (B.valueOf() >= p.valueOf())
53117
+ return B;
53118
+ if (B != null)
53119
+ return B;
53116
53120
  }
53117
53121
  return null;
53118
- }, G = () => {
53122
+ }, W = () => {
53119
53123
  t.isActive = !0;
53120
53124
  };
53121
53125
  return eg(
@@ -53124,21 +53128,21 @@ const qUg = /* @__PURE__ */ sg({
53124
53128
  A.value || (t.isNotClear = !1, A.value = null, setTimeout(() => t.isNotClear = !0, 1));
53125
53129
  }
53126
53130
  ), g({
53127
- clearChoose: n
53128
- }), (W, B) => (j(), U("div", {
53131
+ clearChoose: s
53132
+ }), (B, p) => (j(), U("div", {
53129
53133
  class: "date-picker-yui-kit__wrapper",
53130
53134
  "data-testid": `${e.dataTestid}-Wrapper`
53131
53135
  }, [
53132
53136
  dg($Ug, {
53133
53137
  open: !e.disabled && t.isActive,
53134
- onUnmountClose: m
53138
+ onUnmountClose: b
53135
53139
  }, {
53136
53140
  trigger: Jg(() => [
53137
53141
  dg(_Qg, {
53138
- onClick: G,
53139
- onClear: n,
53142
+ onClick: W,
53143
+ onClear: s,
53140
53144
  modelValue: A.value,
53141
- "onUpdate:modelValue": B[0] || (B[0] = (p) => A.value = p),
53145
+ "onUpdate:modelValue": p[0] || (p[0] = (y) => A.value = y),
53142
53146
  "is-time-select": e.isSelectTime,
53143
53147
  "is-active": t.isActive,
53144
53148
  "is-small": e.isSmall,
@@ -53146,37 +53150,37 @@ const qUg = /* @__PURE__ */ sg({
53146
53150
  disabled: e.disabled,
53147
53151
  "data-testid": `${e.dataTestid}-Choose`,
53148
53152
  value: _(I7g)(A.value || null, e.locale),
53149
- onChange: s
53153
+ onChange: l
53150
53154
  }, null, 8, ["modelValue", "is-time-select", "is-active", "is-small", "is-range", "disabled", "data-testid", "value"])
53151
53155
  ]),
53152
53156
  default: Jg(() => [
53153
53157
  $("col-cal", {
53154
- ".date": A.value,
53155
- ".minDate": b(),
53156
- ".maxDate": Z(),
53158
+ ".date": n.value,
53159
+ ".minDate": Z(),
53160
+ ".maxDate": G(),
53157
53161
  locale: e.locale ?? "ru-RU",
53158
53162
  "data-testid": `${e.dataTestid}-Component`,
53159
- onShowMonths: o,
53160
- onShowYears: a,
53161
- onHideMonths: r,
53162
- onHideYears: u,
53163
- onChangeDate: l,
53163
+ onShowMonths: a,
53164
+ onShowYears: r,
53165
+ onHideMonths: u,
53166
+ onHideYears: m,
53167
+ onChangeDate: o,
53164
53168
  class: "date-picker-yui-kit"
53165
53169
  }, [
53166
- (j(!0), U(WI, null, xI(Object.keys(t.isOpen), (p) => (j(), U(WI, { key: p }, [
53167
- t.isOpen[p] ? (j(), Lg(xg, {
53170
+ (j(!0), U(WI, null, xI(Object.keys(t.isOpen), (y) => (j(), U(WI, { key: y }, [
53171
+ t.isOpen[y] ? (j(), Lg(xg, {
53168
53172
  key: 0,
53169
53173
  name: _(yg).chevronUp,
53170
53174
  width: 16,
53171
53175
  height: 16,
53172
53176
  class: "open-popup",
53173
- slot: `${p}-popup-icon`
53177
+ slot: `${y}-popup-icon`
53174
53178
  }, null, 8, ["name", "slot"])) : (j(), Lg(xg, {
53175
53179
  key: 1,
53176
53180
  name: _(yg).chevronDown,
53177
53181
  width: 16,
53178
53182
  height: 16,
53179
- slot: `${p}-popup-icon`
53183
+ slot: `${y}-popup-icon`
53180
53184
  }, null, 8, ["name", "slot"]))
53181
53185
  ], 64))), 128)),
53182
53186
  dg(xg, {