@celestia-island/hikari 0.55.144 → 0.55.145
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 +1 -1
- package/src/components/HkDatePicker.test.ts +21 -20
- package/src/components/HkDatePicker.tsx +6 -2
- package/src/components/HkDateTimePicker.test.ts +15 -14
- package/src/components/HkDateTimePicker.tsx +1 -1
- package/src/components/HkFilterBar.tsx +1 -0
- package/src/components/HkFilterPanel.tsx +13 -1
package/package.json
CHANGED
|
@@ -194,7 +194,7 @@ describe("HkDatePicker", () => {
|
|
|
194
194
|
});
|
|
195
195
|
|
|
196
196
|
it("disables days outside the inclusive min/max bounds", async () => {
|
|
197
|
-
const p = mountPicker({ modelValue: "2026-08-16", min: "2026-08-10", max: "2026-08-20" });
|
|
197
|
+
const p = mountPicker({ modelValue: "2026-08-16", min: "2026-08-10", max: "2026-08-20", nativeOnMobile: true });
|
|
198
198
|
openViaEnter(p);
|
|
199
199
|
await nextTick();
|
|
200
200
|
const byDay = new Map(
|
|
@@ -453,22 +453,12 @@ describe("HkDatePicker", () => {
|
|
|
453
453
|
expect(stage?.querySelectorAll<HTMLButtonElement>(".hk-dp-cell:not([data-variant])").length).toBe(42);
|
|
454
454
|
});
|
|
455
455
|
|
|
456
|
-
// ── Mobile
|
|
456
|
+
// ── Mobile: the CALENDAR is the default; the native input is the
|
|
457
|
+
// ── explicit opt-out (2026-10-11 direction: no native controls) ──
|
|
457
458
|
|
|
458
|
-
it("
|
|
459
|
+
it("keeps the calendar on mobile by default (no native input)", async () => {
|
|
459
460
|
useMobileViewport();
|
|
460
461
|
const p = mountPicker({ modelValue: "2026-08-16" });
|
|
461
|
-
const input = nativeInput(p.container);
|
|
462
|
-
expect(input).not.toBeNull();
|
|
463
|
-
expect(input?.type).toBe("date");
|
|
464
|
-
expect(input?.value).toBe("2026-08-16");
|
|
465
|
-
expect(p.container.querySelector(".hk-dp-trigger")).toBeNull();
|
|
466
|
-
expect(p.container.querySelector(".hk-dp-panel")).toBeNull();
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
it("keeps the custom calendar on mobile when nativeOnMobile is false", async () => {
|
|
470
|
-
useMobileViewport();
|
|
471
|
-
const p = mountPicker({ modelValue: "2026-08-16", nativeOnMobile: false });
|
|
472
462
|
expect(p.container.querySelector(".hk-dp-trigger")).not.toBeNull();
|
|
473
463
|
expect(nativeInput(p.container)).toBeNull();
|
|
474
464
|
openViaEnter(p);
|
|
@@ -479,17 +469,28 @@ describe("HkDatePicker", () => {
|
|
|
479
469
|
expect(panel()?.classList.contains("is-touch")).toBe(true);
|
|
480
470
|
});
|
|
481
471
|
|
|
482
|
-
it("
|
|
472
|
+
it("renders a native date input on mobile only when nativeOnMobile opts in", () => {
|
|
473
|
+
useMobileViewport();
|
|
474
|
+
const p = mountPicker({ modelValue: "2026-08-16", nativeOnMobile: true });
|
|
475
|
+
const input = nativeInput(p.container);
|
|
476
|
+
expect(input).not.toBeNull();
|
|
477
|
+
expect(input?.type).toBe("date");
|
|
478
|
+
expect(input?.value).toBe("2026-08-16");
|
|
479
|
+
expect(p.container.querySelector(".hk-dp-trigger")).toBeNull();
|
|
480
|
+
expect(p.container.querySelector(".hk-dp-panel")).toBeNull();
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
it("passes min/max through to the native input (explicit opt-in)", () => {
|
|
483
484
|
useMobileViewport();
|
|
484
|
-
const p = mountPicker({ modelValue: "2026-08-16", min: "2026-08-10", max: "2026-08-20" });
|
|
485
|
+
const p = mountPicker({ modelValue: "2026-08-16", min: "2026-08-10", max: "2026-08-20", nativeOnMobile: true });
|
|
485
486
|
const input = nativeInput(p.container);
|
|
486
487
|
expect(input?.min).toBe("2026-08-10");
|
|
487
488
|
expect(input?.max).toBe("2026-08-20");
|
|
488
489
|
});
|
|
489
490
|
|
|
490
|
-
it("native input edits emit the ISO date and clearing emits null", async () => {
|
|
491
|
+
it("native input edits emit the ISO date and clearing emits null (explicit opt-in)", async () => {
|
|
491
492
|
useMobileViewport();
|
|
492
|
-
const p = mountPicker({ modelValue: "2026-08-16" });
|
|
493
|
+
const p = mountPicker({ modelValue: "2026-08-16", nativeOnMobile: true });
|
|
493
494
|
const input = nativeInput(p.container);
|
|
494
495
|
input!.value = "2026-08-20";
|
|
495
496
|
input!.dispatchEvent(new Event("input", { bubbles: true }));
|
|
@@ -503,9 +504,9 @@ describe("HkDatePicker", () => {
|
|
|
503
504
|
expect(p.emitted).toEqual(["2026-08-20", null]);
|
|
504
505
|
});
|
|
505
506
|
|
|
506
|
-
it("native input edits outside the bounds are rejected and re-synced", async () => {
|
|
507
|
+
it("native input edits outside the bounds are rejected and re-synced (explicit opt-in)", async () => {
|
|
507
508
|
useMobileViewport();
|
|
508
|
-
const p = mountPicker({ modelValue: "2026-08-16", max: "2026-08-20" });
|
|
509
|
+
const p = mountPicker({ modelValue: "2026-08-16", max: "2026-08-20", nativeOnMobile: true });
|
|
509
510
|
const input = nativeInput(p.container);
|
|
510
511
|
input!.value = "2026-09-01";
|
|
511
512
|
input!.dispatchEvent(new Event("input", { bubbles: true }));
|
|
@@ -73,8 +73,12 @@ export default defineComponent({
|
|
|
73
73
|
min: { type: String as PropType<string | undefined>, default: undefined },
|
|
74
74
|
/** Inclusive upper bound as an ISO date; later days render disabled. */
|
|
75
75
|
max: { type: String as PropType<string | undefined>, default: undefined },
|
|
76
|
-
/** Render the OS native `<input type="date">` on touch-sized viewports.
|
|
77
|
-
|
|
76
|
+
/** Render the OS native `<input type="date">` on touch-sized viewports.
|
|
77
|
+
* DEFAULTS FALSE since 2026-10-11 (user direction: no native controls
|
|
78
|
+
* anywhere) — the calendar serves phones as a bottom sheet with the
|
|
79
|
+
* enlarged touch chrome. The prop stays for one-off hosts that truly
|
|
80
|
+
* want the OS picker; new callers should not set it. */
|
|
81
|
+
nativeOnMobile: { type: Boolean, default: false },
|
|
78
82
|
},
|
|
79
83
|
emits: {
|
|
80
84
|
"update:modelValue": (_value: string | null) => true,
|
|
@@ -324,11 +324,12 @@ describe("HkDateTimePicker", () => {
|
|
|
324
324
|
expect(document.querySelectorAll(".hk-dtp-popup .hk-dtp-cell").length).toBe(42);
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
-
// ── Mobile
|
|
327
|
+
// ── Mobile: the calendar is the default; native is the explicit ──
|
|
328
|
+
// ── opt-out (2026-10-11 direction: no native controls) ───────────
|
|
328
329
|
|
|
329
|
-
it("renders a native datetime-local input
|
|
330
|
+
it("renders a native datetime-local input on mobile only when nativeOnMobile opts in", () => {
|
|
330
331
|
useMobileViewport();
|
|
331
|
-
const p = mountPicker();
|
|
332
|
+
const p = mountPicker({ nativeOnMobile: true });
|
|
332
333
|
const input = nativeInput(p.container);
|
|
333
334
|
expect(input).not.toBeNull();
|
|
334
335
|
expect(input?.type).toBe("datetime-local");
|
|
@@ -337,9 +338,9 @@ describe("HkDateTimePicker", () => {
|
|
|
337
338
|
expect(p.container.querySelector(".hk-dtp-grid")).toBeNull();
|
|
338
339
|
});
|
|
339
340
|
|
|
340
|
-
it("uses a native date input when showTime is false", () => {
|
|
341
|
+
it("uses a native date input when showTime is false (explicit opt-in)", () => {
|
|
341
342
|
useMobileViewport();
|
|
342
|
-
const p = mountPicker({ showTime: false });
|
|
343
|
+
const p = mountPicker({ showTime: false, nativeOnMobile: true });
|
|
343
344
|
const input = nativeInput(p.container);
|
|
344
345
|
expect(input?.type).toBe("date");
|
|
345
346
|
expect(input?.value).toBe(isoDay(BASE));
|
|
@@ -347,15 +348,15 @@ describe("HkDateTimePicker", () => {
|
|
|
347
348
|
|
|
348
349
|
it("passes min/max through to the native input in its wire format", () => {
|
|
349
350
|
useMobileViewport();
|
|
350
|
-
const p = mountPicker({ min: dayOf(10, 8, 0), max: dayOf(20, 18, 30) });
|
|
351
|
+
const p = mountPicker({ min: dayOf(10, 8, 0), max: dayOf(20, 18, 30), nativeOnMobile: true });
|
|
351
352
|
const input = nativeInput(p.container);
|
|
352
353
|
expect(input?.min).toBe(isoMinute(dayOf(10, 8, 0)));
|
|
353
354
|
expect(input?.max).toBe(isoMinute(dayOf(20, 18, 30)));
|
|
354
355
|
});
|
|
355
356
|
|
|
356
|
-
it("keeps the custom calendar on mobile
|
|
357
|
+
it("keeps the custom calendar on mobile by default", () => {
|
|
357
358
|
useMobileViewport();
|
|
358
|
-
const p = mountPicker(
|
|
359
|
+
const p = mountPicker();
|
|
359
360
|
expect(p.container.querySelector(".hk-dtp")).not.toBeNull();
|
|
360
361
|
expect(dayCells().length).toBe(42);
|
|
361
362
|
expect(nativeInput(p.container)).toBeNull();
|
|
@@ -365,7 +366,7 @@ describe("HkDateTimePicker", () => {
|
|
|
365
366
|
|
|
366
367
|
it("native input edits update the model as a local-time Date", async () => {
|
|
367
368
|
useMobileViewport();
|
|
368
|
-
const p = mountPicker();
|
|
369
|
+
const p = mountPicker({ nativeOnMobile: true });
|
|
369
370
|
const input = nativeInput(p.container);
|
|
370
371
|
input!.value = isoMinute(dayOf(20, 14, 5));
|
|
371
372
|
input!.dispatchEvent(new Event("input", { bubbles: true }));
|
|
@@ -377,7 +378,7 @@ describe("HkDateTimePicker", () => {
|
|
|
377
378
|
|
|
378
379
|
it("native date edits preserve the clock time when showTime is false", async () => {
|
|
379
380
|
useMobileViewport();
|
|
380
|
-
const p = mountPicker({ showTime: false });
|
|
381
|
+
const p = mountPicker({ showTime: false, nativeOnMobile: true });
|
|
381
382
|
const input = nativeInput(p.container);
|
|
382
383
|
input!.value = isoDay(dayOf(20));
|
|
383
384
|
input!.dispatchEvent(new Event("input", { bubbles: true }));
|
|
@@ -387,7 +388,7 @@ describe("HkDateTimePicker", () => {
|
|
|
387
388
|
|
|
388
389
|
it("native input edits outside the bounds are rejected and re-synced", async () => {
|
|
389
390
|
useMobileViewport();
|
|
390
|
-
const p = mountPicker({ max: dayOf(20, 23, 59) });
|
|
391
|
+
const p = mountPicker({ max: dayOf(20, 23, 59), nativeOnMobile: true });
|
|
391
392
|
const input = nativeInput(p.container);
|
|
392
393
|
// Next month, past the max bound.
|
|
393
394
|
input!.value = isoMinute(new Date(BASE.getFullYear(), BASE.getMonth() + 1, 1, 10, 0));
|
|
@@ -399,7 +400,7 @@ describe("HkDateTimePicker", () => {
|
|
|
399
400
|
|
|
400
401
|
it("clearing the native input falls back to the model value", async () => {
|
|
401
402
|
useMobileViewport();
|
|
402
|
-
const p = mountPicker();
|
|
403
|
+
const p = mountPicker({ nativeOnMobile: true });
|
|
403
404
|
const input = nativeInput(p.container);
|
|
404
405
|
input!.value = "";
|
|
405
406
|
input!.dispatchEvent(new Event("input", { bubbles: true }));
|
|
@@ -408,9 +409,9 @@ describe("HkDateTimePicker", () => {
|
|
|
408
409
|
expect(input?.value).toBe(isoMinute(BASE));
|
|
409
410
|
});
|
|
410
411
|
|
|
411
|
-
it("native input replaces even the popup chrome on mobile", () => {
|
|
412
|
+
it("native input replaces even the popup chrome on mobile (explicit opt-in)", () => {
|
|
412
413
|
useMobileViewport();
|
|
413
|
-
const p = mountPicker({ mode: "popup", confirmLabel: "Confirm" });
|
|
414
|
+
const p = mountPicker({ mode: "popup", confirmLabel: "Confirm", nativeOnMobile: true });
|
|
414
415
|
expect(nativeInput(p.container)).not.toBeNull();
|
|
415
416
|
expect(p.container.querySelector(".hk-dtp-trigger")).toBeNull();
|
|
416
417
|
});
|
|
@@ -95,7 +95,7 @@ export default defineComponent({
|
|
|
95
95
|
confirmLabel: { type: String, default: undefined },
|
|
96
96
|
showTime: { type: Boolean, default: true },
|
|
97
97
|
/** Render the OS native `<input type="datetime-local">` on touch-sized viewports. */
|
|
98
|
-
nativeOnMobile: { type: Boolean, default:
|
|
98
|
+
nativeOnMobile: { type: Boolean, default: false }, // 2026-10-11: no native controls — the picker sheet serves phones
|
|
99
99
|
},
|
|
100
100
|
emits: {
|
|
101
101
|
"update:modelValue": (_d: Date) => true,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, defineComponent, type PropType } from "vue";
|
|
2
2
|
|
|
3
|
+
import HkDatePicker from "./HkDatePicker";
|
|
3
4
|
import HkInput from "./HkInput";
|
|
4
5
|
import HkPopupSelect, { type HkPopupSelectOption } from "./HkPopupSelect";
|
|
5
6
|
import { useI18n } from "../i18n/context";
|
|
@@ -168,9 +169,20 @@ export default defineComponent({
|
|
|
168
169
|
disabled={props.disabled}
|
|
169
170
|
options={selectOptions(field)}
|
|
170
171
|
/>
|
|
172
|
+
) : field.kind === "date" ? (
|
|
173
|
+
// The calendar picker — never the OS native input
|
|
174
|
+
// (2026-10-11 direction); the wire format is the same
|
|
175
|
+
// ISO YYYY-MM-DD the native input spoke.
|
|
176
|
+
<HkDatePicker
|
|
177
|
+
modelValue={condition.value || null}
|
|
178
|
+
onUpdate:modelValue={(v: string | null) =>
|
|
179
|
+
emitCondition(field, { value: v ?? "" })
|
|
180
|
+
}
|
|
181
|
+
disabled={props.disabled}
|
|
182
|
+
/>
|
|
171
183
|
) : (
|
|
172
184
|
<HkInput
|
|
173
|
-
type=
|
|
185
|
+
type="text"
|
|
174
186
|
variant={field.kind === "number" ? "number" : "text"}
|
|
175
187
|
modelValue={condition.value}
|
|
176
188
|
onUpdate:modelValue={(v: string) =>
|