@blueking/date-picker 0.0.55 → 0.0.57

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.
@@ -18694,6 +18694,7 @@ const tT = (e) => {
18694
18694
  y: "年"
18695
18695
  }, U0 = {
18696
18696
  前: "Previous",
18697
+ 取消: "Cancel",
18697
18698
  将来: "Future",
18698
18699
  常用时间: "Common",
18699
18700
  开始时间: "Start Time",
@@ -20349,17 +20350,18 @@ class $i {
20349
20350
  ["Y"]
20350
20351
  );
20351
20352
  if (a.length > 1 && a.includes("D") && this.startDate.isSame(this.endDate, "year")) {
20352
- const [, o] = this.format.match(/(Y+)/);
20353
+ const [, o] = this.format.match(/(Y+)/) || [];
20353
20354
  let u = this.format.replace(o, this.startDate.format(o));
20354
- if (r = r.replace(/Y+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "month")) {
20355
- const [, d] = this.format.match(/(M+)/);
20356
- if (u = u.replace(d, this.startDate.format(d)), r = r.replace(/M+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "day")) {
20357
- const [, v] = this.format.match(/(d+|D+)/);
20358
- u = u.replace(v, this.startDate.format(v)), r = r.replace(/(d|D)+[-/\\\s]/, "");
20355
+ if (r = r.replace(/Y+[^\w\s]*/, ""), this.startDate.isSame(this.endDate, "day") && this.startDate.isSame(this.endDate, "month")) {
20356
+ const [, v] = this.format.match(/(M+)/) || [];
20357
+ if (u = u.replace(v, this.startDate.format(v)), r = r.replace(/M+[^\w\s]*/, ""), this.startDate.isSame(this.endDate, "day")) {
20358
+ const [, l] = this.format.match(/(d+|D+)/) || [];
20359
+ u = u.replace(l, this.startDate.format(l)), r = r.replace(/(d|D)+[^\w\s]*/, "");
20359
20360
  }
20360
20361
  }
20361
- return u.replace(
20362
- r,
20362
+ const d = u.replace(r, "").slice(-1);
20363
+ return console.info(u, r, d), u.length <= r.length ? `${this.startDate.format(this.format)} ~ ${this.endDate.format(this.format)}` : u.replace(
20364
+ `${d.match(/([^\w\s]{1})/) ? d : ""}${r}`,
20363
20365
  ` ( ${this.startDate.format(r)} ~ ${this.endDate.format(r)} )`
20364
20366
  );
20365
20367
  }
@@ -20581,14 +20583,14 @@ const NT = OT, jT = (0, bn.defineComponent)({
20581
20583
  theme: "primary"
20582
20584
  }, {
20583
20585
  default: function() {
20584
- return [s.value.ok];
20586
+ return [t.confirmText || s.value.ok];
20585
20587
  }
20586
20588
  }), (0, bn.createVNode)(r0.default, {
20587
20589
  onClick: u,
20588
20590
  size: "small"
20589
20591
  }, {
20590
20592
  default: function() {
20591
- return [s.value.cancel];
20593
+ return [t.cancelText || s.value.cancel];
20592
20594
  }
20593
20595
  })])]);
20594
20596
  }
@@ -21257,6 +21259,8 @@ const KT = { class: "common-panel-tab" }, N3 = /* @__PURE__ */ Nt({
21257
21259
  trigger: "click",
21258
21260
  width: 189,
21259
21261
  onConfirm: n[1] || (n[1] = (r) => t.$emit("confirm")),
21262
+ "confirm-text": me(we)("确定"),
21263
+ "cancel-text": me(we)("取消"),
21260
21264
  "ext-cls": "__bk-date-picker-popover__ __bk-date-picker-popover-delete__"
21261
21265
  }, {
21262
21266
  default: ht(() => [
@@ -21264,7 +21268,7 @@ const KT = { class: "common-panel-tab" }, N3 = /* @__PURE__ */ Nt({
21264
21268
  ]),
21265
21269
  _: 1
21266
21270
  /* STABLE */
21267
- }, 8, ["content"])) : vo("v-if", !0)
21271
+ }, 8, ["content", "confirm-text", "cancel-text"])) : vo("v-if", !0)
21268
21272
  ]));
21269
21273
  }
21270
21274
  });
@@ -21453,9 +21457,9 @@ function lL() {
21453
21457
  var cL = function() {
21454
21458
  var t = (0, _t.getCurrentInstance)(), n = t.props, r = t.emit, a = (0, _t.inject)(N2, Et.EMPTY_OBJ), i = !(0, Et.isEmptyObj)(a), s = (0, _t.ref)(), o = (0, _t.ref)(n.checked), u = (0, _t.computed)(function() {
21455
21459
  return i && a.props.disabled ? !0 : n.disabled;
21456
- }), d = function() {
21457
- var c = o.value ? n.trueLabel : n.falseLabel;
21458
- r("update:modelValue", c), r("change", c), i && a.handleChange(), (0, _t.nextTick)(function() {
21460
+ }), d = function(c) {
21461
+ var p = o.value ? n.trueLabel : n.falseLabel;
21462
+ r("update:modelValue", p), r("change", p, c), i && a.handleChange(), (0, _t.nextTick)(function() {
21459
21463
  s.value.checked !== o.value && (s.value.checked = o.value);
21460
21464
  });
21461
21465
  };
@@ -21482,7 +21486,7 @@ var cL = function() {
21482
21486
  }, l = function(c) {
21483
21487
  if (!u.value) {
21484
21488
  var p = c.target;
21485
- o.value = p.checked, d();
21489
+ o.value = p.checked, d(c);
21486
21490
  }
21487
21491
  };
21488
21492
  return (0, _t.onMounted)(function() {
@@ -21516,8 +21520,11 @@ const dL = (0, _t.defineComponent)({
21516
21520
  "update:modelValue": function(t) {
21517
21521
  return t !== void 0;
21518
21522
  },
21519
- change: function(t) {
21523
+ change: function(t, n) {
21520
21524
  return t !== void 0;
21525
+ },
21526
+ click: function(t) {
21527
+ return !0;
21521
21528
  }
21522
21529
  },
21523
21530
  setup: function(t) {
@@ -21643,23 +21650,25 @@ const vL = { class: "date-panel" }, mL = { class: "date-panel-title" }, gL = { c
21643
21650
  qt(
21644
21651
  o,
21645
21652
  () => {
21646
- const l = o.value.startOf("month").startOf("week"), f = [];
21647
- for (let c = 0; c < _3 * El; c++)
21648
- f.push(l.add(c, "day"));
21649
- i.value = f;
21653
+ const f = o.value.startOf("month").startOf("week"), c = [];
21654
+ for (let p = 0; p < _3 * El; p++)
21655
+ c.push(f.add(p, "day"));
21656
+ i.value = c;
21650
21657
  },
21651
21658
  {
21652
21659
  immediate: !0
21653
21660
  }
21654
21661
  );
21655
- const u = (l) => {
21656
- o.value = o.value.add(l, "month");
21657
- }, d = (l) => {
21658
- o.value = o.value.add(l, "year");
21659
- }, v = (l) => {
21660
- n.minDate && l.isBefore(n.minDate, "day") || r("update:modelValue", l);
21662
+ const u = (f) => {
21663
+ o.value = o.value.add(f, "month");
21664
+ }, d = (f) => {
21665
+ o.value = o.value.add(f, "year");
21666
+ }, v = (f) => {
21667
+ n.minDate && f.isBefore(n.minDate, "day") || r("update:modelValue", f);
21668
+ }, l = (f) => {
21669
+ f.preventDefault(), r("update:isNow", !n.isNow);
21661
21670
  };
21662
- return (l, f) => (Ge(), lt("div", vL, [
21671
+ return (f, c) => (Ge(), lt("div", vL, [
21663
21672
  Se("div", mL, [
21664
21673
  gn(
21665
21674
  it(me(we)("结束时间")) + " ",
@@ -21668,7 +21677,7 @@ const vL = { class: "date-panel" }, mL = { class: "date-panel-title" }, gL = { c
21668
21677
  ),
21669
21678
  De(me(x2), {
21670
21679
  "model-value": n.isNow,
21671
- "onUpdate:modelValue": f[0] || (f[0] = (c) => l.$emit("update:isNow", !c)),
21680
+ onMousedown: l,
21672
21681
  class: "title-check",
21673
21682
  size: "small"
21674
21683
  }, {
@@ -21683,11 +21692,11 @@ const vL = { class: "date-panel" }, mL = { class: "date-panel-title" }, gL = { c
21683
21692
  Se("div", hL, [
21684
21693
  Se("div", yL, [
21685
21694
  De(me(wx), {
21686
- onClick: f[1] || (f[1] = (c) => d(-1)),
21695
+ onClick: c[0] || (c[0] = (p) => d(-1)),
21687
21696
  class: "hand-icon"
21688
21697
  }),
21689
21698
  De(me(e2), {
21690
- onClick: f[2] || (f[2] = (c) => u(-1)),
21699
+ onClick: c[1] || (c[1] = (p) => u(-1)),
21691
21700
  class: "hand-icon"
21692
21701
  })
21693
21702
  ]),
@@ -21706,11 +21715,11 @@ const vL = { class: "date-panel" }, mL = { class: "date-panel-title" }, gL = { c
21706
21715
  ]),
21707
21716
  Se("div", IL, [
21708
21717
  De(me(t2), {
21709
- onClick: f[3] || (f[3] = (c) => u(1)),
21718
+ onClick: c[2] || (c[2] = (p) => u(1)),
21710
21719
  class: "hand-icon"
21711
21720
  }),
21712
21721
  De(me(Ix), {
21713
- onClick: f[4] || (f[4] = (c) => d(1)),
21722
+ onClick: c[3] || (c[3] = (p) => d(1)),
21714
21723
  class: "hand-icon"
21715
21724
  })
21716
21725
  ])
@@ -21720,13 +21729,13 @@ const vL = { class: "date-panel" }, mL = { class: "date-panel-title" }, gL = { c
21720
21729
  (Ge(!0), lt(
21721
21730
  ut,
21722
21731
  null,
21723
- Pn(me(a), (c, p) => (Ge(), lt(
21732
+ Pn(me(a), (p, b) => (Ge(), lt(
21724
21733
  "li",
21725
21734
  {
21726
- key: p,
21735
+ key: b,
21727
21736
  class: "date-grid-item not-click"
21728
21737
  },
21729
- it(c),
21738
+ it(p),
21730
21739
  1
21731
21740
  /* TEXT */
21732
21741
  ))),
@@ -21737,24 +21746,24 @@ const vL = { class: "date-panel" }, mL = { class: "date-panel-title" }, gL = { c
21737
21746
  (Ge(), lt(
21738
21747
  ut,
21739
21748
  null,
21740
- Pn(_3, (c) => Se("ul", {
21741
- key: c,
21749
+ Pn(_3, (p) => Se("ul", {
21750
+ key: p,
21742
21751
  class: "date-grid"
21743
21752
  }, [
21744
21753
  (Ge(!0), lt(
21745
21754
  ut,
21746
21755
  null,
21747
- Pn(i.value.slice((c - 1) * El, (c - 1) * El + El), (p) => (Ge(), lt("li", {
21756
+ Pn(i.value.slice((p - 1) * El, (p - 1) * El + El), (b) => (Ge(), lt("li", {
21748
21757
  class: Na([{
21749
- "is-last-month": p.isBefore(o.value, "month"),
21750
- "is-next-month": p.isAfter(o.value, "month"),
21751
- "is-today": p.isSame(me(s), "day"),
21752
- "is-disabled": l.minDate && p.isBefore(l.minDate, "day"),
21753
- "is-selected": n.modelValue && p.isSame(n.modelValue, "day")
21758
+ "is-last-month": b.isBefore(o.value, "month"),
21759
+ "is-next-month": b.isAfter(o.value, "month"),
21760
+ "is-today": b.isSame(me(s), "day"),
21761
+ "is-disabled": f.minDate && b.isBefore(f.minDate, "day"),
21762
+ "is-selected": n.modelValue && b.isSame(n.modelValue, "day")
21754
21763
  }, "date-grid-item"]),
21755
- key: p.unix(),
21756
- onClick: fv((b) => v(p), ["prevent"])
21757
- }, it(p.date()), 11, OL))),
21764
+ key: b.unix(),
21765
+ onClick: fv((_) => v(b), ["prevent"])
21766
+ }, it(b.date()), 11, OL))),
21758
21767
  128
21759
21768
  /* KEYED_FRAGMENT */
21760
21769
  ))