You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.1 KiB
71 lines
2.1 KiB
import type { Morfo } from '../types';
|
|
import { v } from '../types';
|
|
|
|
export const timeRangeFieldMorfo = {
|
|
name: 'TimeRangeField',
|
|
kebab: 'time-range-field',
|
|
scope: ['soma', 'eidos'],
|
|
// Sema events forwarded by the composed TimeField instances (one per
|
|
// endpoint) — same delegation as date-range-field.
|
|
expression: 'delegated',
|
|
// Per-segment spinbutton — the same pattern the single time-field and the
|
|
// date-range-field twin cite.
|
|
apg: 'https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/',
|
|
texts: {
|
|
label: '#?components.time-range-field.label|Time Range Field',
|
|
'start-label': '#?components.time-range-field.start-label|Start time',
|
|
'end-label': '#?components.time-range-field.end-label|End time'
|
|
},
|
|
parts: [
|
|
{
|
|
name: 'Provider',
|
|
kebab: 'provider',
|
|
archetype: 'provider',
|
|
kind: 'public',
|
|
defaultElement: 'div',
|
|
role: 'group',
|
|
optional: false,
|
|
data: [
|
|
{ attr: 'data-invalid', value: v.propRef('invalid'), severity: 'optional' },
|
|
{ attr: 'data-disabled', value: v.propRef('disabled'), severity: 'optional' },
|
|
{ attr: 'data-readonly', value: v.propRef('readonly'), severity: 'optional' },
|
|
{ attr: 'data-required', value: v.propRef('required'), severity: 'optional' }
|
|
],
|
|
aria: [
|
|
{ attr: 'aria-label', value: v.propRef('ariaLabel'), severity: 'optional' },
|
|
{
|
|
attr: 'aria-labelledby',
|
|
value: v.partRef('label'),
|
|
condition: { when: 'part-present', part: 'label' },
|
|
severity: 'recommended'
|
|
},
|
|
{ attr: 'aria-disabled', value: v.propRef('disabled'), severity: 'optional' }
|
|
]
|
|
},
|
|
{
|
|
name: 'Label',
|
|
kebab: 'label',
|
|
archetype: 'label',
|
|
kind: 'public',
|
|
defaultElement: 'label',
|
|
optional: true,
|
|
data: [
|
|
{ attr: 'data-invalid', value: v.propRef('invalid'), severity: 'optional' },
|
|
{ attr: 'data-disabled', value: v.propRef('disabled'), severity: 'optional' }
|
|
],
|
|
aria: []
|
|
},
|
|
{
|
|
name: 'Input',
|
|
kebab: 'input',
|
|
archetype: 'input',
|
|
kind: 'public',
|
|
defaultElement: 'div',
|
|
role: 'group',
|
|
optional: false,
|
|
data: [{ attr: 'data-endpoint', values: ['start', 'end'] }],
|
|
aria: []
|
|
}
|
|
]
|
|
} as const satisfies Morfo;
|