@starasia/admin 8.2.0 → 8.2.1

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.es.js CHANGED
@@ -3234,30 +3234,36 @@ const Rn = ({
3234
3234
  return /* @__PURE__ */ e(m, { paddingBlock: "sm", paddingInline: "sm", children: /* @__PURE__ */ e(C, { fontSize: "xs", color: "subtlest", children: "No further input required." }) });
3235
3235
  if (r === "is-between") {
3236
3236
  const o = t != null && t.from && (t != null && t.to) ? { from: new Date(t.from), to: new Date(t.to) } : void 0;
3237
- return /* @__PURE__ */ e(
3238
- Ke,
3239
- {
3240
- size: "sm",
3241
- input: !1,
3242
- clearable: !0,
3243
- rangedDate: !0,
3244
- value: o,
3245
- onChange: (i) => {
3246
- if (i == null) {
3247
- n({ op: r });
3248
- return;
3249
- }
3250
- if (typeof i == "object" && i !== null && "from" in i && "to" in i) {
3251
- const { from: l, to: c } = i;
3252
- n({
3253
- op: r,
3254
- from: new Date(l).toISOString(),
3255
- to: new Date(c).toISOString()
3256
- });
3257
- }
3237
+ return (
3238
+ // `key` forces a fresh StarasiaDate when switching to/from is-between —
3239
+ // React would otherwise reuse the instance, leaving the wrong inner
3240
+ // calendar (JustDate vs RangeDate) mounted.
3241
+ /* @__PURE__ */ e(
3242
+ Ke,
3243
+ {
3244
+ size: "sm",
3245
+ input: !1,
3246
+ clearable: !0,
3247
+ rangedDate: !0,
3248
+ value: o,
3249
+ onChange: (i) => {
3250
+ if (i == null) {
3251
+ n({ op: r });
3252
+ return;
3253
+ }
3254
+ if (typeof i == "object" && i !== null && "from" in i && "to" in i) {
3255
+ const { from: l, to: c } = i;
3256
+ n({
3257
+ op: r,
3258
+ from: new Date(l).toISOString(),
3259
+ to: new Date(c).toISOString()
3260
+ });
3261
+ }
3262
+ },
3263
+ withPadding: !1
3258
3264
  },
3259
- withPadding: !1
3260
- }
3265
+ "range"
3266
+ )
3261
3267
  );
3262
3268
  }
3263
3269
  return r === "is-relative-to-today" ? /* @__PURE__ */ e(
@@ -3281,7 +3287,8 @@ const Rn = ({
3281
3287
  o instanceof Date && n({ op: r, date: o.toISOString() });
3282
3288
  },
3283
3289
  withPadding: !1
3284
- }
3290
+ },
3291
+ "single"
3285
3292
  );
3286
3293
  }, qn = ({ value: t, onChange: r }) => {
3287
3294
  const n = (t == null ? void 0 : t.direction) ?? "past", o = (t == null ? void 0 : t.count) ?? 1, i = (t == null ? void 0 : t.period) ?? "week", l = n !== "this";