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.
65 lines
1.7 KiB
65 lines
1.7 KiB
import type { Morfo } from '../types';
|
|
import { v } from '../types';
|
|
|
|
export const dateRangeFieldMorfo = {
|
|
name: 'DateRangeField',
|
|
kebab: 'date-range-field',
|
|
scope: ['soma'],
|
|
translations: {
|
|
start: { es: 'Fecha inicial', en: 'Start date' },
|
|
end: { es: 'Fecha final', en: 'End date' },
|
|
separator: { es: 'hasta', en: 'to' }
|
|
},
|
|
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;
|