feat : surlignage plage en pilule pleine cellule + playground DateRange en largeur ERP (#MUI-33)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,42 +1,57 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="max-w-md space-y-6">
|
<div class="space-y-6 p-4">
|
||||||
<h1 class="text-2xl font-bold">MalioDateRange</h1>
|
<h1 class="text-2xl font-bold">MalioDateRange</h1>
|
||||||
|
|
||||||
<MalioDateRange
|
<div class="flex flex-wrap items-start gap-10">
|
||||||
v-model="value"
|
<div class="w-[480px] space-y-3">
|
||||||
label="Période"
|
<h2 class="font-semibold">Large (480px)</h2>
|
||||||
hint="Clique deux fois pour définir une plage"
|
<MalioDateRange
|
||||||
/>
|
v-model="value"
|
||||||
|
label="Période"
|
||||||
|
hint="Clique deux fois pour définir une plage"
|
||||||
|
/>
|
||||||
|
<div class="rounded border p-3 text-sm">
|
||||||
|
<p>Début : <code>{{ value?.start ?? 'null' }}</code></p>
|
||||||
|
<p>Fin : <code>{{ value?.end ?? 'null' }}</code></p>
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded bg-m-primary px-3 py-1.5 text-white"
|
||||||
|
@click="value = {start: '2026-12-20', end: '2026-12-31'}"
|
||||||
|
>
|
||||||
|
Forcer 20→31/12/2026
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="rounded border px-3 py-1.5"
|
||||||
|
@click="value = null"
|
||||||
|
>
|
||||||
|
Réinitialiser
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="rounded border p-3 text-sm">
|
<div class="w-[396px] space-y-3">
|
||||||
<p>Début : <code>{{ value?.start ?? 'null' }}</code></p>
|
<h2 class="font-semibold">ERP (396px)</h2>
|
||||||
<p>Fin : <code>{{ value?.end ?? 'null' }}</code></p>
|
<MalioDateRange
|
||||||
|
v-model="erpValue"
|
||||||
|
label="Période"
|
||||||
|
hint="Largeur cible ERP"
|
||||||
|
/>
|
||||||
|
<div class="rounded border p-3 text-sm">
|
||||||
|
<p>Début : <code>{{ erpValue?.start ?? 'null' }}</code></p>
|
||||||
|
<p>Fin : <code>{{ erpValue?.end ?? 'null' }}</code></p>
|
||||||
|
</div>
|
||||||
|
<MalioDateRange
|
||||||
|
v-model="bounded"
|
||||||
|
label="Plage bornée"
|
||||||
|
:min="todayIso"
|
||||||
|
:max="maxIso"
|
||||||
|
hint="Entre aujourd'hui et +30 jours"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="rounded bg-m-primary px-3 py-1.5 text-white"
|
|
||||||
@click="value = {start: '2026-12-20', end: '2026-12-31'}"
|
|
||||||
>
|
|
||||||
Forcer 20→31/12/2026
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="rounded border px-3 py-1.5"
|
|
||||||
@click="value = null"
|
|
||||||
>
|
|
||||||
Réinitialiser
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<MalioDateRange
|
|
||||||
v-model="bounded"
|
|
||||||
label="Plage bornée"
|
|
||||||
:min="todayIso"
|
|
||||||
:max="maxIso"
|
|
||||||
hint="Entre aujourd'hui et +30 jours"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,5 +67,6 @@ const todayIso = toIso(now)
|
|||||||
const maxIso = toIso(new Date(now.getTime() + 30 * 86400000))
|
const maxIso = toIso(new Date(now.getTime() + 30 * 86400000))
|
||||||
|
|
||||||
const value = ref<RangeValue | null>(null)
|
const value = ref<RangeValue | null>(null)
|
||||||
|
const erpValue = ref<RangeValue | null>(null)
|
||||||
const bounded = ref<RangeValue | null>(null)
|
const bounded = ref<RangeValue | null>(null)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -47,15 +47,15 @@
|
|||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="roleOf(cell) === 'in-range'"
|
v-if="roleOf(cell) === 'in-range'"
|
||||||
class="absolute inset-0 bg-m-primary-light"
|
class="absolute inset-x-0 top-1/2 h-10 -translate-y-1/2 bg-m-primary-light"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
v-else-if="roleOf(cell) === 'start'"
|
v-else-if="roleOf(cell) === 'start'"
|
||||||
class="absolute inset-y-0 left-1/2 right-0 bg-m-primary-light"
|
class="absolute inset-x-0 top-1/2 h-10 -translate-y-1/2 rounded-l-full bg-m-primary-light"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
v-else-if="roleOf(cell) === 'end'"
|
v-else-if="roleOf(cell) === 'end'"
|
||||||
class="absolute inset-y-0 left-0 right-1/2 bg-m-primary-light"
|
class="absolute inset-x-0 top-1/2 h-10 -translate-y-1/2 rounded-r-full bg-m-primary-light"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class="relative flex h-10 w-10 items-center justify-center rounded-full text-sm font-medium transition-colors duration-100"
|
class="relative flex h-10 w-10 items-center justify-center rounded-full text-sm font-medium transition-colors duration-100"
|
||||||
|
|||||||
Reference in New Issue
Block a user