@m3ui-vue/m3ui-vue 1.3.8 → 1.4.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/API.md +1102 -20
- package/dist/{MButton-D5eJiDza.js → MButton-DQMTIlaV.js} +2 -2
- package/dist/{MButton-D5eJiDza.js.map → MButton-DQMTIlaV.js.map} +1 -1
- package/dist/{MDialog-WqB0jewp.js → MDialog-cdgapGfZ.js} +2 -2
- package/dist/{MDialog-WqB0jewp.js.map → MDialog-cdgapGfZ.js.map} +1 -1
- package/dist/{MListItem-Cf-C2Ru-.js → MListItem-ZkSGIIrb.js} +2 -2
- package/dist/{MListItem-Cf-C2Ru-.js.map → MListItem-ZkSGIIrb.js.map} +1 -1
- package/dist/{MLoadingIndicator-D4GzEZoH.js → MLoadingIndicator-U6_oGx8z.js} +2 -2
- package/dist/{MLoadingIndicator-D4GzEZoH.js.map → MLoadingIndicator-U6_oGx8z.js.map} +1 -1
- package/dist/{MSeekBar-B19xoWE3.js → MSeekBar-DTZVizZg.js} +2 -2
- package/dist/{MSeekBar-B19xoWE3.js.map → MSeekBar-DTZVizZg.js.map} +1 -1
- package/dist/{MSlider-9RoiuebS.js → MSlider-CqJkEYRZ.js} +2 -2
- package/dist/{MSlider-9RoiuebS.js.map → MSlider-CqJkEYRZ.js.map} +1 -1
- package/dist/{MSpinner-BNF8MN-L.js → MSpinner-Btgc-0nb.js} +2 -2
- package/dist/{MSpinner-BNF8MN-L.js.map → MSpinner-Btgc-0nb.js.map} +1 -1
- package/dist/{MTextField-CuG0T3qh.js → MTextField-B6M0gJEO.js} +2 -2
- package/dist/{MTextField-CuG0T3qh.js.map → MTextField-B6M0gJEO.js.map} +1 -1
- package/dist/{MTooltip-Bv7yxngk.js → MTooltip-Dspji4XG.js} +4 -4
- package/dist/{MTooltip-Bv7yxngk.js.map → MTooltip-Dspji4XG.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +2 -2
- package/dist/components/MAvailabilityCalendar.vue.d.ts +83 -0
- package/dist/components/MBeforeAfter.vue.d.ts +61 -0
- package/dist/components/MBodyMap.vue.d.ts +70 -0
- package/dist/components/MCandlestickChart.vue.d.ts +82 -0
- package/dist/components/MCertificate.vue.d.ts +76 -0
- package/dist/components/MCountdown.vue.d.ts +80 -0
- package/dist/components/MCreditCardInput.vue.d.ts +75 -0
- package/dist/components/MMortgageCalculator.vue.d.ts +83 -0
- package/dist/components/MOdontogram.vue.d.ts +86 -0
- package/dist/components/MOrderBook.vue.d.ts +89 -0
- package/dist/components/MOrderTicket.vue.d.ts +91 -0
- package/dist/components/MPosKeypad.vue.d.ts +84 -0
- package/dist/components/MProductConfigurator.vue.d.ts +136 -0
- package/dist/components/MQuiz.vue.d.ts +102 -0
- package/dist/components/MReceipt.vue.d.ts +93 -0
- package/dist/components/MSeatMap.vue.d.ts +131 -0
- package/dist/components/MSeekBar.vue.d.ts +1 -1
- package/dist/components/MTicket.vue.d.ts +83 -0
- package/dist/components/MVideoPlayer.vue.d.ts +1 -1
- package/dist/components/MVitalsChart.vue.d.ts +73 -0
- package/dist/composables/_printElement.d.ts +9 -0
- package/dist/composables/cardBrand.d.ts +25 -0
- package/dist/composables/mortgage.d.ts +37 -0
- package/dist/composables/useLocale.d.ts +131 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +1 -1
- package/dist/index.d.ts +37 -0
- package/dist/locales/index.js +924 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10125 -5263
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +5 -5
- package/dist/media.js +4 -4
- package/dist/pdf.js +4 -4
- package/dist/rich-text-editor.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/{useLocale-D2ucaY-l.js → useLocale-DLKJIRFi.js} +133 -2
- package/dist/useLocale-DLKJIRFi.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAvailabilityCalendar.test.ts +85 -0
- package/src/__tests__/MBeforeAfter.test.ts +79 -0
- package/src/__tests__/MBodyMap.test.ts +60 -0
- package/src/__tests__/MCandlestickChart.test.ts +66 -0
- package/src/__tests__/MCertificate.test.ts +32 -0
- package/src/__tests__/MCountdown.test.ts +75 -0
- package/src/__tests__/MCreditCardInput.test.ts +122 -0
- package/src/__tests__/MMortgageCalculator.test.ts +49 -0
- package/src/__tests__/MOdontogram.test.ts +93 -0
- package/src/__tests__/MOrderBook.test.ts +66 -0
- package/src/__tests__/MOrderTicket.test.ts +68 -0
- package/src/__tests__/MPosKeypad.test.ts +116 -0
- package/src/__tests__/MProductConfigurator.test.ts +73 -0
- package/src/__tests__/MQuiz.test.ts +104 -0
- package/src/__tests__/MReceipt.test.ts +52 -0
- package/src/__tests__/MSeatMap.test.ts +76 -0
- package/src/__tests__/MTicket.test.ts +38 -0
- package/src/__tests__/MVitalsChart.test.ts +49 -0
- package/src/__tests__/clearToNull.test.ts +30 -0
- package/src/__tests__/mortgage.test.ts +25 -0
- package/src/__tests__/ssr.test.ts +11 -0
- package/src/components/MAutocomplete.vue +2 -2
- package/src/components/MAvailabilityCalendar.vue +460 -0
- package/src/components/MBeforeAfter.vue +248 -0
- package/src/components/MBodyMap.vue +266 -0
- package/src/components/MCandlestickChart.vue +479 -0
- package/src/components/MCertificate.vue +351 -0
- package/src/components/MCountdown.vue +200 -0
- package/src/components/MCreditCardInput.vue +351 -0
- package/src/components/MMortgageCalculator.vue +258 -0
- package/src/components/MOdontogram.vue +462 -0
- package/src/components/MOrderBook.vue +287 -0
- package/src/components/MOrderTicket.vue +217 -0
- package/src/components/MPosKeypad.vue +406 -0
- package/src/components/MProductConfigurator.vue +412 -0
- package/src/components/MQuiz.vue +531 -0
- package/src/components/MReceipt.vue +249 -0
- package/src/components/MSeatMap.vue +431 -0
- package/src/components/MSelect.vue +2 -2
- package/src/components/MTicket.vue +209 -0
- package/src/components/MVitalsChart.vue +303 -0
- package/src/composables/_printElement.ts +36 -0
- package/src/composables/cardBrand.ts +104 -0
- package/src/composables/mortgage.ts +70 -0
- package/src/composables/useLocale.ts +277 -0
- package/src/index.ts +37 -0
- package/src/locales/de.ts +131 -0
- package/src/locales/es.ts +131 -0
- package/src/locales/fr.ts +131 -0
- package/src/locales/ja.ts +131 -0
- package/src/locales/ko.ts +131 -0
- package/src/locales/pt.ts +131 -0
- package/src/locales/zh.ts +131 -0
- package/dist/useLocale-D2ucaY-l.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import MTicket from '../components/MTicket.vue'
|
|
4
|
+
|
|
5
|
+
describe('MTicket', () => {
|
|
6
|
+
it('renders the route, fields and stub', () => {
|
|
7
|
+
const w = mount(MTicket, {
|
|
8
|
+
props: {
|
|
9
|
+
title: 'Aerolíneas',
|
|
10
|
+
from: { code: 'EZE', name: 'Buenos Aires', time: '08:40' },
|
|
11
|
+
to: { code: 'MDZ', name: 'Mendoza', time: '10:35' },
|
|
12
|
+
fields: [{ label: 'Gate', value: 'B12' }, { label: 'Seat', value: '14C', strong: true }],
|
|
13
|
+
},
|
|
14
|
+
slots: { stub: '<div data-test="qr">QR</div>' },
|
|
15
|
+
})
|
|
16
|
+
expect(w.find('[data-route]').text()).toContain('EZE')
|
|
17
|
+
expect(w.find('[data-route]').text()).toContain('MDZ')
|
|
18
|
+
expect(w.findAll('dt').map((d) => d.text())).toEqual(['Gate', 'Seat'])
|
|
19
|
+
expect(w.find('[data-test="qr"]').exists()).toBe(true)
|
|
20
|
+
expect(w.find('.m3-ticket__perforation').exists()).toBe(true)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('has no stub or route when not given', () => {
|
|
24
|
+
const w = mount(MTicket, { props: { title: 'Coupon' }, slots: { default: '20% off' } })
|
|
25
|
+
expect(w.find('.m3-ticket__stub').exists()).toBe(false)
|
|
26
|
+
expect(w.find('[data-route]').exists()).toBe(false)
|
|
27
|
+
expect(w.text()).toContain('20% off')
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('colors the band with a role or a CSS color', async () => {
|
|
31
|
+
const w = mount(MTicket, { props: { title: 'T', color: 'tertiary' } })
|
|
32
|
+
const band = () => w.find('.m3-ticket__main > div').attributes('style')
|
|
33
|
+
expect(band()).toContain('var(--color-tertiary)')
|
|
34
|
+
await w.setProps({ color: 'secondary', orientation: 'vertical' })
|
|
35
|
+
expect(band()).toContain('var(--color-secondary)')
|
|
36
|
+
expect(w.attributes('data-orientation')).toBe('vertical')
|
|
37
|
+
})
|
|
38
|
+
})
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import MVitalsChart from '../components/MVitalsChart.vue'
|
|
4
|
+
import type { VitalSeries } from '../components/MVitalsChart.vue'
|
|
5
|
+
|
|
6
|
+
const h = (n: number) => Date.UTC(2026, 10, 17, n)
|
|
7
|
+
const series: VitalSeries[] = [
|
|
8
|
+
{ key: 'hr', label: 'Heart rate', unit: 'bpm', normal: [60, 100], data: [{ time: h(8), value: 72 }, { time: h(12), value: 88 }, { time: h(16), value: 112 }] },
|
|
9
|
+
{ key: 'bp', label: 'Blood pressure', unit: 'mmHg', normal: [[90, 120], [60, 80]], data: [{ time: h(8), value: [118, 76] }, { time: h(16), value: [124, 82] }] },
|
|
10
|
+
{ key: 'temp', label: 'Temperature', unit: '°C', decimals: 1, normal: [36.1, 37.2], data: [{ time: h(12), value: 35.6 }] },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
describe('MVitalsChart', () => {
|
|
14
|
+
it('shows the latest reading of each vital with its status', () => {
|
|
15
|
+
const w = mount(MVitalsChart, { props: { series } })
|
|
16
|
+
const row = (k: string) => w.find(`[data-vital="${k}"]`)
|
|
17
|
+
expect(row('hr').find('[data-value]').text()).toBe('112')
|
|
18
|
+
expect(row('hr').find('[data-status]').text()).toBe('High')
|
|
19
|
+
expect(row('bp').find('[data-value]').text()).toBe('124/82')
|
|
20
|
+
expect(row('bp').find('[data-status]').text()).toBe('High')
|
|
21
|
+
expect(row('temp').find('[data-value]').text()).toBe('35.6')
|
|
22
|
+
expect(row('temp').find('[data-status]').text()).toBe('Low')
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('draws normal bands and flags readings outside them', () => {
|
|
26
|
+
const w = mount(MVitalsChart, { props: { series } })
|
|
27
|
+
expect(w.findAll('[data-vital="hr"] [data-band]')).toHaveLength(1)
|
|
28
|
+
expect(w.findAll('[data-vital="bp"] [data-band]')).toHaveLength(2)
|
|
29
|
+
expect(w.findAll('[data-vital="hr"] [data-out]')).toHaveLength(1)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('moves a shared crosshair with the arrow keys', async () => {
|
|
33
|
+
const w = mount(MVitalsChart, { props: { series } })
|
|
34
|
+
await w.trigger('keydown', { key: 'ArrowLeft' })
|
|
35
|
+
expect(w.emitted('hover')![0]![0]).toBe(h(16))
|
|
36
|
+
await w.trigger('keydown', { key: 'ArrowLeft' })
|
|
37
|
+
expect(w.emitted('hover')![1]![0]).toBe(h(12))
|
|
38
|
+
// At 12:00 each row shows its latest reading so far
|
|
39
|
+
expect(w.find('[data-vital="hr"] [data-value]').text()).toBe('88')
|
|
40
|
+
expect(w.find('[data-vital="bp"] [data-value]').text()).toBe('118/76')
|
|
41
|
+
expect(w.find('[data-vital="bp"] [data-status]').exists()).toBe(false)
|
|
42
|
+
expect(w.find('[data-hover-time]').exists()).toBe(true)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('says when there are no readings', () => {
|
|
46
|
+
const w = mount(MVitalsChart, { props: { series: [{ key: 'x', label: 'X', data: [] }] } })
|
|
47
|
+
expect(w.text()).toContain('No readings')
|
|
48
|
+
})
|
|
49
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import MSelect from '../components/MSelect.vue'
|
|
4
|
+
import MAutocomplete from '../components/MAutocomplete.vue'
|
|
5
|
+
|
|
6
|
+
const options = [
|
|
7
|
+
{ value: 1, label: 'One' },
|
|
8
|
+
{ value: 2, label: 'Two' },
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
// The clear (X) button must leave the v-model at null, not undefined: undefined drops the key
|
|
12
|
+
// from JSON.stringify, so a form sent to an API never told the backend the field was emptied.
|
|
13
|
+
describe.each([
|
|
14
|
+
['MSelect', MSelect],
|
|
15
|
+
['MAutocomplete', MAutocomplete],
|
|
16
|
+
])('%s clear button', (_name, Comp) => {
|
|
17
|
+
it('emits null', async () => {
|
|
18
|
+
const wrapper = mount(Comp as any, {
|
|
19
|
+
props: { modelValue: 1, options, clearable: true, label: 'Field' },
|
|
20
|
+
attachTo: document.body,
|
|
21
|
+
})
|
|
22
|
+
const clear = wrapper.find('button[aria-label="Clear"]')
|
|
23
|
+
expect(clear.exists()).toBe(true)
|
|
24
|
+
await clear.trigger('click')
|
|
25
|
+
const emitted = wrapper.emitted('update:modelValue')!
|
|
26
|
+
expect(emitted.at(-1)).toEqual([null])
|
|
27
|
+
expect(emitted.at(-1)![0]).not.toBeUndefined()
|
|
28
|
+
wrapper.unmount()
|
|
29
|
+
})
|
|
30
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { amortize } from '../composables/mortgage'
|
|
3
|
+
|
|
4
|
+
describe('amortize', () => {
|
|
5
|
+
it('computes the fixed payment of a french loan', () => {
|
|
6
|
+
const a = amortize({ principal: 200_000, rate: 6, years: 30 })
|
|
7
|
+
expect(a.payments).toHaveLength(360)
|
|
8
|
+
expect(a.firstPayment).toBeCloseTo(1199.1, 1)
|
|
9
|
+
expect(a.payments.at(-1)!.balance).toBe(0)
|
|
10
|
+
expect(a.totalPaid).toBeCloseTo(a.totalInterest + 200_000, 1)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it('keeps the principal fixed in a german loan', () => {
|
|
14
|
+
const a = amortize({ principal: 120_000, rate: 12, years: 10, system: 'german' })
|
|
15
|
+
expect(a.payments[0]!.principal).toBe(1000)
|
|
16
|
+
expect(a.firstPayment).toBe(2200)
|
|
17
|
+
expect(a.lastPayment).toBeCloseTo(1010, 0)
|
|
18
|
+
expect(a.payments.at(-1)!.balance).toBe(0)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('handles a zero rate and an empty loan', () => {
|
|
22
|
+
expect(amortize({ principal: 12_000, rate: 0, years: 1 }).firstPayment).toBe(1000)
|
|
23
|
+
expect(amortize({ principal: 0, rate: 5, years: 10 }).payments).toEqual([])
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -27,6 +27,17 @@ const props: Record<string, Record<string, unknown>> = {
|
|
|
27
27
|
MTreeTable: { columns: [{ key: 'a', label: 'A' }], rows: [] },
|
|
28
28
|
MTree: { nodes: [{ id: 1, label: 'a' }] },
|
|
29
29
|
MKbd: { keys: 'Ctrl+K' },
|
|
30
|
+
MOrderTicket: { number: 1, createdAt: 0, items: [{ id: 1, name: 'Pizza' }] },
|
|
31
|
+
MSeatMap: { layout: ['ss_ss', 'ss_ss'], modelValue: ['A1'] },
|
|
32
|
+
MCreditCardInput: { modelValue: { number: '4242', expiry: '', cvc: '' } },
|
|
33
|
+
MReceipt: { items: [{ name: 'Coffee', price: 2 }] },
|
|
34
|
+
MProductConfigurator: { groups: [{ key: 's', label: 'Size', options: [{ value: 'm', label: 'M' }] }] },
|
|
35
|
+
MCandlestickChart: { data: [{ time: 0, open: 1, high: 2, low: 0.5, close: 1.5 }] },
|
|
36
|
+
MOrderBook: { bids: [[1, 1]], asks: [[2, 1]] },
|
|
37
|
+
MMortgageCalculator: { modelValue: { price: 100, down: 10, rate: 5, years: 10 } },
|
|
38
|
+
MVitalsChart: { series: [{ key: 'hr', label: 'HR', data: [{ time: 0, value: 70 }] }] },
|
|
39
|
+
MQuiz: { questions: [{ id: 1, prompt: 'Q', options: ['a', 'b'], answer: 0 }] },
|
|
40
|
+
MCertificate: { recipient: 'Ana' },
|
|
30
41
|
MPasswordMeter: { value: 'abc' },
|
|
31
42
|
MRelativeTime: { value: new Date(0) },
|
|
32
43
|
MResult: { status: 'success', title: 't' },
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Like MSelect but with a text input for filtering. Type to search, arrow keys to navigate, Enter to select.
|
|
4
4
|
*
|
|
5
|
-
* @event update:modelValue Emitted on selection — powers v-model
|
|
5
|
+
* @event update:modelValue Emitted on selection — powers v-model (`null` when the clear button empties it)
|
|
6
6
|
* @event debounced Emitted debounce ms after the user stops typing the search query (only when debounce > 0)
|
|
7
7
|
*/
|
|
8
8
|
import { computed, ref, useId, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
|
@@ -393,7 +393,7 @@ const labelClasses = computed(() => {
|
|
|
393
393
|
v-if="clearable && hasValue && !disabled"
|
|
394
394
|
type="button"
|
|
395
395
|
class="absolute right-9 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface"
|
|
396
|
-
@click.stop="emit('update:modelValue',
|
|
396
|
+
@click.stop="emit('update:modelValue', null); closeDropdown()"
|
|
397
397
|
>
|
|
398
398
|
<MIcon name="close" :size="18" />
|
|
399
399
|
</button>
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A booking calendar for stays (hotel, cabin, apartment, equipment rental): picks a check-in and a check-out
|
|
4
|
+
* night with the price of each night under its day, booked nights blocked, and a minimum / maximum stay. Once a
|
|
5
|
+
* check-in is chosen, only the days that make a valid stay stay pickable: a stay can't run over a booked night, but
|
|
6
|
+
* it can check out on the morning a booked night starts.
|
|
7
|
+
*
|
|
8
|
+
* Dates are `YYYY-MM-DD` strings in local time; each date's price and availability are those of the night that
|
|
9
|
+
* starts on it.
|
|
10
|
+
*
|
|
11
|
+
* @slot day Replaces a day's content (the button stays). Slot props: `{ date, day, price, state }`
|
|
12
|
+
* @slot footer Replaces the summary under the months. Slot props: `{ start, end, nights, total, clear }`
|
|
13
|
+
* @event update:modelValue `[checkIn, checkOut]`, either one `null` — powers v-model
|
|
14
|
+
* @event change Emitted when a stay is complete: `{ start, end, nights, total }`
|
|
15
|
+
*/
|
|
16
|
+
import { computed, nextTick, ref, watch } from 'vue'
|
|
17
|
+
import MIconButton from './MIconButton.vue'
|
|
18
|
+
import MButton from './MButton.vue'
|
|
19
|
+
import { useLocale } from '../composables/useLocale'
|
|
20
|
+
|
|
21
|
+
const locale = useLocale()
|
|
22
|
+
|
|
23
|
+
type Range = [string | null, string | null]
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(
|
|
26
|
+
defineProps<{
|
|
27
|
+
/** `[checkIn, checkOut]` as `YYYY-MM-DD` (v-model) */
|
|
28
|
+
modelValue?: Range
|
|
29
|
+
/** Price of the night starting on each date: a map or a function */
|
|
30
|
+
prices?: Record<string, number> | ((date: string) => number | undefined)
|
|
31
|
+
/** Nights already booked or closed: a list of dates or a function */
|
|
32
|
+
unavailable?: string[] | ((date: string) => boolean)
|
|
33
|
+
/** Shortest stay, in nights */
|
|
34
|
+
minNights?: number
|
|
35
|
+
/** Longest stay, in nights */
|
|
36
|
+
maxNights?: number
|
|
37
|
+
/** First bookable date. Defaults to today */
|
|
38
|
+
min?: string
|
|
39
|
+
/** Last bookable night */
|
|
40
|
+
max?: string
|
|
41
|
+
/** Months shown side by side (they wrap on narrow screens) */
|
|
42
|
+
months?: number
|
|
43
|
+
/** 0 = Sunday … 6 = Saturday. Defaults to the locale's first day of the week */
|
|
44
|
+
firstDayOfWeek?: number
|
|
45
|
+
/** ISO 4217 code to format prices */
|
|
46
|
+
currency?: string
|
|
47
|
+
/** Colors the cheapest quarter of the nights shown as deals */
|
|
48
|
+
highlightDeals?: boolean
|
|
49
|
+
/** Hides the summary under the months */
|
|
50
|
+
hideFooter?: boolean
|
|
51
|
+
disabled?: boolean
|
|
52
|
+
}>(),
|
|
53
|
+
{
|
|
54
|
+
modelValue: () => [null, null],
|
|
55
|
+
minNights: 1,
|
|
56
|
+
months: 2,
|
|
57
|
+
highlightDeals: false,
|
|
58
|
+
hideFooter: false,
|
|
59
|
+
disabled: false,
|
|
60
|
+
},
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
const emit = defineEmits<{
|
|
64
|
+
'update:modelValue': [Range]
|
|
65
|
+
change: [{ start: string; end: string; nights: number; total: number }]
|
|
66
|
+
}>()
|
|
67
|
+
|
|
68
|
+
// ── date helpers (local time, YYYY-MM-DD) ──
|
|
69
|
+
const pad = (n: number) => String(n).padStart(2, '0')
|
|
70
|
+
function key(d: Date) {
|
|
71
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
|
|
72
|
+
}
|
|
73
|
+
function parse(k: string) {
|
|
74
|
+
const [y, m, d] = k.split('-').map(Number)
|
|
75
|
+
return new Date(y!, m! - 1, d!)
|
|
76
|
+
}
|
|
77
|
+
function addDays(k: string, n: number) {
|
|
78
|
+
const d = parse(k)
|
|
79
|
+
d.setDate(d.getDate() + n)
|
|
80
|
+
return key(d)
|
|
81
|
+
}
|
|
82
|
+
function diffDays(a: string, b: string) {
|
|
83
|
+
return Math.round((parse(b).getTime() - parse(a).getTime()) / 86_400_000)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const minDate = computed(() => props.min ?? key(new Date()))
|
|
87
|
+
|
|
88
|
+
const firstDay = computed(() => {
|
|
89
|
+
if (props.firstDayOfWeek !== undefined) return props.firstDayOfWeek
|
|
90
|
+
try {
|
|
91
|
+
const loc = new Intl.Locale(locale.lang) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } }
|
|
92
|
+
const info = loc.getWeekInfo?.() ?? loc.weekInfo
|
|
93
|
+
if (info) return info.firstDay % 7
|
|
94
|
+
} catch { /* old engines */ }
|
|
95
|
+
return 0
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const start = computed(() => props.modelValue[0])
|
|
99
|
+
const end = computed(() => props.modelValue[1])
|
|
100
|
+
|
|
101
|
+
// ── view ──
|
|
102
|
+
const initial = start.value ? parse(start.value) : parse(minDate.value)
|
|
103
|
+
const view = ref(new Date(initial.getFullYear(), initial.getMonth(), 1))
|
|
104
|
+
|
|
105
|
+
const unavailableSet = computed(() => (Array.isArray(props.unavailable) ? new Set(props.unavailable) : null))
|
|
106
|
+
function isBooked(k: string) {
|
|
107
|
+
if (typeof props.unavailable === 'function') return props.unavailable(k)
|
|
108
|
+
return unavailableSet.value?.has(k) ?? false
|
|
109
|
+
}
|
|
110
|
+
function priceOf(k: string) {
|
|
111
|
+
return typeof props.prices === 'function' ? props.prices(k) : props.prices?.[k]
|
|
112
|
+
}
|
|
113
|
+
function inBounds(k: string) {
|
|
114
|
+
return k >= minDate.value && (!props.max || k <= props.max)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** First booked (or out of range) night on or after `from`, within `limit` nights */
|
|
118
|
+
function firstBlocked(from: string, limit: number) {
|
|
119
|
+
for (let i = 0; i < limit; i++) {
|
|
120
|
+
const k = addDays(from, i)
|
|
121
|
+
if (isBooked(k) || !inBounds(k)) return i
|
|
122
|
+
}
|
|
123
|
+
return -1
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function canCheckIn(k: string) {
|
|
127
|
+
if (!inBounds(k) || isBooked(k)) return false
|
|
128
|
+
// the minimum stay must fit before the next booked night
|
|
129
|
+
return firstBlocked(k, props.minNights) === -1
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function canCheckOut(k: string) {
|
|
133
|
+
const s = start.value
|
|
134
|
+
if (!s || end.value) return false
|
|
135
|
+
const n = diffDays(s, k)
|
|
136
|
+
if (n < props.minNights || (props.maxNights !== undefined && n > props.maxNights)) return false
|
|
137
|
+
return firstBlocked(s, n) === -1
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const hover = ref<string | null>(null)
|
|
141
|
+
|
|
142
|
+
type DayState = 'start' | 'end' | 'range' | 'preview' | 'booked' | 'disabled' | 'available' | 'checkout-only'
|
|
143
|
+
|
|
144
|
+
function stateOf(k: string): DayState {
|
|
145
|
+
if (k === start.value) return 'start'
|
|
146
|
+
if (k === end.value) return 'end'
|
|
147
|
+
if (start.value && end.value && k > start.value && k < end.value) return 'range'
|
|
148
|
+
if (start.value && !end.value) {
|
|
149
|
+
if (canCheckOut(k)) {
|
|
150
|
+
if (hover.value && canCheckOut(hover.value) && k > start.value && k < hover.value) return 'preview'
|
|
151
|
+
return isBooked(k) ? 'checkout-only' : 'available'
|
|
152
|
+
}
|
|
153
|
+
if (k > start.value) return isBooked(k) ? 'booked' : 'disabled'
|
|
154
|
+
}
|
|
155
|
+
if (isBooked(k)) return 'booked'
|
|
156
|
+
if (!canCheckIn(k)) return 'disabled'
|
|
157
|
+
return 'available'
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function pickable(k: string) {
|
|
161
|
+
const s = stateOf(k)
|
|
162
|
+
return s !== 'booked' && s !== 'disabled'
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface Cell { key: string; day: number; price?: number }
|
|
166
|
+
const monthsView = computed(() =>
|
|
167
|
+
Array.from({ length: props.months }, (_, i) => {
|
|
168
|
+
const first = new Date(view.value.getFullYear(), view.value.getMonth() + i, 1)
|
|
169
|
+
const lead = (first.getDay() - firstDay.value + 7) % 7
|
|
170
|
+
const days = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate()
|
|
171
|
+
const cells: (Cell | null)[] = Array.from({ length: lead }, () => null)
|
|
172
|
+
for (let d = 1; d <= days; d++) {
|
|
173
|
+
const k = key(new Date(first.getFullYear(), first.getMonth(), d))
|
|
174
|
+
cells.push({ key: k, day: d, price: priceOf(k) })
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
id: key(first).slice(0, 7),
|
|
178
|
+
label: new Intl.DateTimeFormat(locale.lang, { month: 'long', year: 'numeric' }).format(first),
|
|
179
|
+
cells,
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
const weekdays = computed(() => {
|
|
185
|
+
const f = new Intl.DateTimeFormat(locale.lang, { weekday: 'narrow' })
|
|
186
|
+
const long = new Intl.DateTimeFormat(locale.lang, { weekday: 'long' })
|
|
187
|
+
// 2023-01-01 was a Sunday
|
|
188
|
+
return Array.from({ length: 7 }, (_, i) => {
|
|
189
|
+
const d = new Date(2023, 0, 1 + ((i + firstDay.value) % 7))
|
|
190
|
+
return { short: f.format(d), long: long.format(d) }
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
/** Prices at or under this are deals */
|
|
195
|
+
const dealLimit = computed(() => {
|
|
196
|
+
if (!props.highlightDeals) return -Infinity
|
|
197
|
+
const ps = monthsView.value.flatMap((m) => m.cells).filter((c): c is Cell => !!c && c.price !== undefined && pickable(c.key)).map((c) => c.price!)
|
|
198
|
+
if (ps.length < 4) return -Infinity
|
|
199
|
+
ps.sort((a, b) => a - b)
|
|
200
|
+
return ps[Math.floor(ps.length / 4) - 1]!
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
function money(n: number, compact = false) {
|
|
204
|
+
return new Intl.NumberFormat(locale.lang, {
|
|
205
|
+
...(props.currency ? { style: 'currency', currency: props.currency } : {}),
|
|
206
|
+
...(compact ? { maximumFractionDigits: 0 } : {}),
|
|
207
|
+
}).format(n)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const nights = computed(() => (start.value && end.value ? diffDays(start.value, end.value) : 0))
|
|
211
|
+
const total = computed(() => {
|
|
212
|
+
let t = 0
|
|
213
|
+
for (let i = 0; i < nights.value; i++) t += priceOf(addDays(start.value!, i)) ?? 0
|
|
214
|
+
return Math.round(t * 100) / 100
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
function select(k: string) {
|
|
218
|
+
if (props.disabled || !pickable(k)) return
|
|
219
|
+
if (start.value && !end.value && canCheckOut(k)) {
|
|
220
|
+
const range: Range = [start.value, k]
|
|
221
|
+
emit('update:modelValue', range)
|
|
222
|
+
const n = diffDays(start.value, k)
|
|
223
|
+
let t = 0
|
|
224
|
+
for (let i = 0; i < n; i++) t += priceOf(addDays(start.value, i)) ?? 0
|
|
225
|
+
emit('change', { start: start.value, end: k, nights: n, total: Math.round(t * 100) / 100 })
|
|
226
|
+
} else if (canCheckIn(k)) {
|
|
227
|
+
emit('update:modelValue', [k, null])
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function clear() {
|
|
232
|
+
emit('update:modelValue', [null, null])
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const hint = computed(() => {
|
|
236
|
+
if (!start.value) return locale.availSelectCheckIn
|
|
237
|
+
if (!end.value) return props.minNights > 1 ? `${locale.availSelectCheckOut} · ${locale.availMinNights.replace('{n}', String(props.minNights))}` : locale.availSelectCheckOut
|
|
238
|
+
return ''
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
function nightsText(n: number) {
|
|
242
|
+
return n === 1 ? locale.availNight : locale.availNights.replace('{n}', String(n))
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function dayLabel(c: Cell) {
|
|
246
|
+
const s = stateOf(c.key)
|
|
247
|
+
const parts = [new Intl.DateTimeFormat(locale.lang, { dateStyle: 'full' }).format(parse(c.key))]
|
|
248
|
+
if (c.price !== undefined && s !== 'booked') parts.push(money(c.price))
|
|
249
|
+
if (s === 'start') parts.push(locale.availCheckIn)
|
|
250
|
+
if (s === 'end') parts.push(locale.availCheckOut)
|
|
251
|
+
if (s === 'booked') parts.push(locale.availUnavailable)
|
|
252
|
+
return parts.join(', ')
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ── navigation ──
|
|
256
|
+
const canPrev = computed(() => {
|
|
257
|
+
const m = parse(minDate.value)
|
|
258
|
+
return view.value > new Date(m.getFullYear(), m.getMonth(), 1)
|
|
259
|
+
})
|
|
260
|
+
const canNext = computed(() => {
|
|
261
|
+
if (!props.max) return true
|
|
262
|
+
const m = parse(props.max)
|
|
263
|
+
return new Date(view.value.getFullYear(), view.value.getMonth() + props.months - 1, 1) < new Date(m.getFullYear(), m.getMonth(), 1)
|
|
264
|
+
})
|
|
265
|
+
function shift(n: number) {
|
|
266
|
+
view.value = new Date(view.value.getFullYear(), view.value.getMonth() + n, 1)
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Roving focus: one day is tabbable
|
|
270
|
+
const focusKey = ref(start.value ?? (inBounds(key(new Date())) ? key(new Date()) : minDate.value))
|
|
271
|
+
const rootEl = ref<HTMLElement | null>(null)
|
|
272
|
+
const tabKey = computed(() => {
|
|
273
|
+
const keys = monthsView.value.flatMap((m) => m.cells).filter(Boolean).map((c) => c!.key)
|
|
274
|
+
return keys.includes(focusKey.value) ? focusKey.value : keys[0]
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
function ensureVisible(k: string) {
|
|
278
|
+
const d = parse(k)
|
|
279
|
+
const first = new Date(d.getFullYear(), d.getMonth(), 1)
|
|
280
|
+
const last = new Date(view.value.getFullYear(), view.value.getMonth() + props.months - 1, 1)
|
|
281
|
+
if (first < view.value) view.value = first
|
|
282
|
+
else if (first > last) view.value = new Date(d.getFullYear(), d.getMonth() - props.months + 1, 1)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async function onKeydown(e: KeyboardEvent, k: string) {
|
|
286
|
+
const moves: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 }
|
|
287
|
+
let next: string | null = null
|
|
288
|
+
if (e.key in moves) next = addDays(k, moves[e.key]!)
|
|
289
|
+
else if (e.key === 'PageUp' || e.key === 'PageDown') {
|
|
290
|
+
const d = parse(k)
|
|
291
|
+
d.setMonth(d.getMonth() + (e.key === 'PageUp' ? -1 : 1))
|
|
292
|
+
next = key(d)
|
|
293
|
+
} else if (e.key === 'Home') next = addDays(k, -((parse(k).getDay() - firstDay.value + 7) % 7))
|
|
294
|
+
else if (e.key === 'End') next = addDays(k, 6 - ((parse(k).getDay() - firstDay.value + 7) % 7))
|
|
295
|
+
else if (e.key === 'Enter' || e.key === ' ') {
|
|
296
|
+
e.preventDefault()
|
|
297
|
+
select(k)
|
|
298
|
+
return
|
|
299
|
+
} else if (e.key === 'Escape' && start.value && !end.value) {
|
|
300
|
+
e.preventDefault()
|
|
301
|
+
clear()
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
if (!next) return
|
|
305
|
+
e.preventDefault()
|
|
306
|
+
focusKey.value = next
|
|
307
|
+
ensureVisible(next)
|
|
308
|
+
hover.value = next
|
|
309
|
+
await nextTick()
|
|
310
|
+
rootEl.value?.querySelector<HTMLElement>(`[data-date="${next}"]`)?.focus()
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
watch(start, (s) => {
|
|
314
|
+
if (s) focusKey.value = s
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
defineExpose({ nights, total, clear })
|
|
318
|
+
</script>
|
|
319
|
+
|
|
320
|
+
<template>
|
|
321
|
+
<div ref="rootEl" class="m3-availability text-on-surface" @mouseleave="hover = null">
|
|
322
|
+
<div class="flex flex-wrap gap-x-8 gap-y-4">
|
|
323
|
+
<div v-for="(m, mi) in monthsView" :key="m.id" class="min-w-64 flex-1">
|
|
324
|
+
<div class="mb-2 flex h-12 items-center">
|
|
325
|
+
<MIconButton
|
|
326
|
+
icon="chevron_left"
|
|
327
|
+
:aria-label="locale.previous"
|
|
328
|
+
:class="mi === 0 ? '' : 'invisible'"
|
|
329
|
+
:disabled="!canPrev"
|
|
330
|
+
data-nav="prev"
|
|
331
|
+
@click="shift(-1)"
|
|
332
|
+
/>
|
|
333
|
+
<h3 class="flex-1 text-center text-title-medium capitalize">{{ m.label }}</h3>
|
|
334
|
+
<MIconButton
|
|
335
|
+
icon="chevron_right"
|
|
336
|
+
:aria-label="locale.next"
|
|
337
|
+
:class="mi === monthsView.length - 1 ? '' : 'invisible'"
|
|
338
|
+
:disabled="!canNext"
|
|
339
|
+
data-nav="next"
|
|
340
|
+
@click="shift(1)"
|
|
341
|
+
/>
|
|
342
|
+
</div>
|
|
343
|
+
<div role="grid" :aria-label="m.label" class="grid grid-cols-7">
|
|
344
|
+
<div role="row" class="contents">
|
|
345
|
+
<span
|
|
346
|
+
v-for="w in weekdays"
|
|
347
|
+
:key="w.long"
|
|
348
|
+
role="columnheader"
|
|
349
|
+
:aria-label="w.long"
|
|
350
|
+
class="flex h-8 items-center justify-center text-label-medium text-on-surface-variant"
|
|
351
|
+
>{{ w.short }}</span>
|
|
352
|
+
</div>
|
|
353
|
+
<div role="row" class="contents">
|
|
354
|
+
<template v-for="(c, ci) in m.cells" :key="c?.key ?? `x${ci}`">
|
|
355
|
+
<span v-if="!c" role="gridcell" />
|
|
356
|
+
<div
|
|
357
|
+
v-else
|
|
358
|
+
role="gridcell"
|
|
359
|
+
class="m3-availability__cell relative flex h-14 items-center justify-center"
|
|
360
|
+
:data-state="stateOf(c.key)"
|
|
361
|
+
:data-lone="stateOf(c.key) === 'start' && !end && !(hover && hover !== start && canCheckOut(hover)) ? '' : undefined"
|
|
362
|
+
>
|
|
363
|
+
<button
|
|
364
|
+
type="button"
|
|
365
|
+
class="m3-availability__day relative z-[1] flex h-12 w-full max-w-12 flex-col items-center justify-center rounded-full text-body-large leading-tight"
|
|
366
|
+
:class="[
|
|
367
|
+
stateOf(c.key) === 'start' || stateOf(c.key) === 'end' ? 'bg-primary text-on-primary' : '',
|
|
368
|
+
stateOf(c.key) === 'booked' ? 'text-on-surface/40 line-through' : '',
|
|
369
|
+
stateOf(c.key) === 'disabled' ? 'text-on-surface/40' : '',
|
|
370
|
+
]"
|
|
371
|
+
:tabindex="c.key === tabKey ? 0 : -1"
|
|
372
|
+
:aria-label="dayLabel(c)"
|
|
373
|
+
:aria-pressed="stateOf(c.key) === 'start' || stateOf(c.key) === 'end' || stateOf(c.key) === 'range'"
|
|
374
|
+
:aria-disabled="!pickable(c.key) || disabled || undefined"
|
|
375
|
+
:data-date="c.key"
|
|
376
|
+
@click="select(c.key)"
|
|
377
|
+
@mouseenter="hover = c.key"
|
|
378
|
+
@focus="focusKey = c.key"
|
|
379
|
+
@keydown="onKeydown($event, c.key)"
|
|
380
|
+
>
|
|
381
|
+
<slot name="day" :date="c.key" :day="c.day" :price="c.price" :state="stateOf(c.key)">
|
|
382
|
+
<span :class="{ 'font-medium': c.key === key(new Date()) }">{{ c.day }}</span>
|
|
383
|
+
<span
|
|
384
|
+
v-if="c.price !== undefined && stateOf(c.key) !== 'booked' && stateOf(c.key) !== 'disabled'"
|
|
385
|
+
class="text-[10px] tabular-nums"
|
|
386
|
+
:class="stateOf(c.key) === 'start' || stateOf(c.key) === 'end'
|
|
387
|
+
? 'text-on-primary/80'
|
|
388
|
+
: c.price <= dealLimit ? 'font-medium text-success' : 'text-on-surface-variant'"
|
|
389
|
+
>{{ money(c.price, true) }}</span>
|
|
390
|
+
</slot>
|
|
391
|
+
</button>
|
|
392
|
+
</div>
|
|
393
|
+
</template>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
|
|
399
|
+
<div v-if="!hideFooter" class="mt-3 flex min-h-12 flex-wrap items-center gap-3 border-t border-outline-variant pt-3">
|
|
400
|
+
<slot name="footer" :start="start" :end="end" :nights="nights" :total="total" :clear="clear">
|
|
401
|
+
<p class="flex-1 text-body-large" data-summary>
|
|
402
|
+
<template v-if="nights">
|
|
403
|
+
{{ nightsText(nights) }}<template v-if="prices"> · <strong class="tabular-nums">{{ money(total) }}</strong></template>
|
|
404
|
+
</template>
|
|
405
|
+
<span v-else class="text-on-surface-variant">{{ hint }}</span>
|
|
406
|
+
</p>
|
|
407
|
+
<MButton v-if="start" variant="text" @click="clear">{{ locale.clear }}</MButton>
|
|
408
|
+
</slot>
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
</template>
|
|
412
|
+
|
|
413
|
+
<style>
|
|
414
|
+
/* The band between check-in and check-out runs behind the day circles */
|
|
415
|
+
.m3-availability__cell[data-state='range']::before,
|
|
416
|
+
.m3-availability__cell[data-state='preview']::before,
|
|
417
|
+
.m3-availability__cell[data-state='start']::before,
|
|
418
|
+
.m3-availability__cell[data-state='end']::before {
|
|
419
|
+
content: '';
|
|
420
|
+
position: absolute;
|
|
421
|
+
inset: 4px 0;
|
|
422
|
+
background: var(--color-secondary-container);
|
|
423
|
+
}
|
|
424
|
+
.m3-availability__cell[data-state='preview']::before {
|
|
425
|
+
background: color-mix(in srgb, var(--color-secondary-container) 55%, transparent);
|
|
426
|
+
}
|
|
427
|
+
.m3-availability__cell[data-state='start']::before {
|
|
428
|
+
left: 50%;
|
|
429
|
+
}
|
|
430
|
+
.m3-availability__cell[data-state='end']::before {
|
|
431
|
+
right: 50%;
|
|
432
|
+
}
|
|
433
|
+
/* A lone check-in (no check-out yet, none previewed) has no band */
|
|
434
|
+
.m3-availability__cell[data-lone]::before {
|
|
435
|
+
display: none;
|
|
436
|
+
}
|
|
437
|
+
.m3-availability__cell[data-state='range'] .m3-availability__day,
|
|
438
|
+
.m3-availability__cell[data-state='preview'] .m3-availability__day {
|
|
439
|
+
color: var(--color-on-secondary-container);
|
|
440
|
+
}
|
|
441
|
+
.m3-availability__day:not([aria-disabled]):not([aria-pressed='true']):hover {
|
|
442
|
+
background: color-mix(in srgb, var(--color-on-surface) 8%, transparent);
|
|
443
|
+
}
|
|
444
|
+
.m3-availability__day[aria-disabled] {
|
|
445
|
+
cursor: default;
|
|
446
|
+
}
|
|
447
|
+
.m3-availability__day:focus-visible {
|
|
448
|
+
outline: 3px solid var(--color-secondary);
|
|
449
|
+
outline-offset: -1px;
|
|
450
|
+
}
|
|
451
|
+
.m3-availability__cell[data-state='checkout-only'] .m3-availability__day::after {
|
|
452
|
+
content: '';
|
|
453
|
+
position: absolute;
|
|
454
|
+
bottom: 4px;
|
|
455
|
+
width: 4px;
|
|
456
|
+
height: 4px;
|
|
457
|
+
border-radius: 50%;
|
|
458
|
+
background: var(--color-outline);
|
|
459
|
+
}
|
|
460
|
+
</style>
|