@cscfi/csc-ui 4.0.0-alpha.26 → 4.0.0-alpha.28
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/csc-ui.js +9514 -7086
- package/dist/custom-elements.json +6934 -4840
- package/dist/docs/c-date-picker/usage.md +190 -0
- package/dist/docs/c-number-field/usage.md +82 -0
- package/dist/docs/c-text-field/usage.md +106 -0
- package/dist/docs/c-time-picker/usage.md +143 -0
- package/dist/styles/css/tailwind-theme.css +1 -0
- package/dist/styles/css/tokens.css +10 -0
- package/dist/vscode.css-custom-data.json +140 -0
- package/dist/vscode.html-custom-data.json +302 -1
- package/dist/web-types.json +1132 -130
- package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +268 -0
- package/dist-types/components/c-date-picker/dates.d.ts +119 -0
- package/dist-types/components/c-number-field/CNumberField.vue.d.ts +153 -0
- package/dist-types/components/c-number-field/numbers.d.ts +42 -0
- package/dist-types/components/c-slider/CSlider.vue.d.ts +2 -2
- package/dist-types/components/c-text-field/CTextField.vue.d.ts +12 -2
- package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +199 -0
- package/dist-types/components/c-time-picker/times.d.ts +82 -0
- package/dist-types/index.d.ts +3 -0
- package/dist-types/shared/TypedField.vue.d.ts +40 -0
- package/dist-types/shared/inputMask.d.ts +106 -0
- package/dist-types/shared/useAnchoredPanel.d.ts +5 -2
- package/dist-types/shared/useTypedField.d.ts +103 -0
- package/dist-types/tag-name-map.d.ts +300 -2
- package/package.json +1 -1
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
import type { CAutocompleteFilter, CAutocompleteItem, CAutocompleteTexts, CAutocompleteValue } from './components/c-autocomplete/CAutocomplete.vue';
|
|
13
13
|
import type { CButtonGroupValue } from './components/c-button-group/CButtonGroup.vue';
|
|
14
14
|
import type { CDataTableCellContent, CDataTableColumn, CDataTableExpandedContext, CDataTableRow, CDataTableSort, CDataTableTexts } from './components/c-data-table/CDataTable.vue';
|
|
15
|
+
import type { CDatePickerDisabledDate, CDatePickerText, CDatePickerTexts, CDatePickerValue } from './components/c-date-picker/CDatePicker.vue';
|
|
15
16
|
import type { CPaginationOptions } from './components/c-pagination/CPagination.vue';
|
|
16
17
|
import type { CSelectTexts, CSelectValue } from './components/c-select/CSelect.vue';
|
|
18
|
+
import type { CTimePickerText, CTimePickerTexts, CTimePickerValue } from './components/c-time-picker/CTimePicker.vue';
|
|
17
19
|
import type { CTreeSelectFilter, CTreeSelectItem, CTreeSelectTexts, CTreeSelectValue } from './components/c-tree-select/CTreeSelect.vue';
|
|
18
20
|
import type { CSelectItem, CToastMessage } from './types';
|
|
19
21
|
type AccordionPrimitive = number | string;
|
|
@@ -514,6 +516,126 @@ export interface CDataTableElement extends Omit<HTMLElement, 'autohide' | 'colum
|
|
|
514
516
|
removeEventListener<K extends keyof CDataTableElementEventMap>(type: K, listener: (this: CDataTableElement, ev: CDataTableElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
515
517
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
516
518
|
}
|
|
519
|
+
/** Events dispatched by `<c-date-picker>`. */
|
|
520
|
+
export interface CDatePickerElementEventMap {
|
|
521
|
+
/**
|
|
522
|
+
* Fired when the value changes — a day or range is picked, typed text is
|
|
523
|
+
* committed, or the field is cleared — carrying the new value: an ISO
|
|
524
|
+
* date, `{ start, end }` under `range`, or `null`.
|
|
525
|
+
*/
|
|
526
|
+
change: CustomEvent<CDatePickerValue>;
|
|
527
|
+
/**
|
|
528
|
+
* Fired with the displayed month as `YYYY-MM` whenever it changes, and
|
|
529
|
+
* when the panel opens — the signal to load that month's `disabled-dates`.
|
|
530
|
+
*/
|
|
531
|
+
'change:month': CustomEvent<string>;
|
|
532
|
+
/**
|
|
533
|
+
* Fired on every commit of typed text (Enter or leaving the input) with the
|
|
534
|
+
* text as typed — `{ start, end }` under `range`. Read `badInput` to tell
|
|
535
|
+
* whether it named a date that can be picked.
|
|
536
|
+
*/
|
|
537
|
+
'change:text': CustomEvent<CDatePickerText>;
|
|
538
|
+
/**
|
|
539
|
+
* Native bubbling input event dispatched alongside every value change so a
|
|
540
|
+
* plain `v-model` stays in sync. Carries no detail.
|
|
541
|
+
*/
|
|
542
|
+
input: CustomEvent<void>;
|
|
543
|
+
/** Fired alongside `change` with the same detail — the `v-model` contract. */
|
|
544
|
+
'update:value': CustomEvent<CDatePickerValue>;
|
|
545
|
+
}
|
|
546
|
+
/** A date field that takes a typed date, or opens a calendar panel for picking one, or a start and end date under `range`. */
|
|
547
|
+
export interface CDatePickerElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'disabledDates' | 'errorMessage' | 'firstDayOfWeek' | 'format' | 'hideDetails' | 'hint' | 'hostId' | 'isDateDisabled' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'range' | 'required' | 'shadow' | 'showWeekNumbers' | 'size' | 'texts' | 'type' | 'valid' | 'value'> {
|
|
548
|
+
/** Make the value clearable */
|
|
549
|
+
clearable?: boolean;
|
|
550
|
+
/** Disable the field */
|
|
551
|
+
disabled?: boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Dates that cannot be picked: ISO dates and inclusive `{ start, end }`
|
|
554
|
+
* spans. Arrays have no attribute form — bind as a DOM property
|
|
555
|
+
*/
|
|
556
|
+
disabledDates?: CDatePickerDisabledDate[];
|
|
557
|
+
/** Error message shown in place of the hint while the field is invalid */
|
|
558
|
+
errorMessage?: string;
|
|
559
|
+
/**
|
|
560
|
+
* First day of the week in the calendar, numbered like `Date.getDay()`:
|
|
561
|
+
* 0 = Sunday, 1 = Monday … 6 = Saturday
|
|
562
|
+
*/
|
|
563
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
564
|
+
/**
|
|
565
|
+
* How dates are shown and read from typing: a pattern of the tokens `d`,
|
|
566
|
+
* `dd`, `M`, `MM` and `yyyy` with any separators, e.g. `yyyy-MM-dd`
|
|
567
|
+
*/
|
|
568
|
+
format?: string;
|
|
569
|
+
/** Hide the hint and error messages */
|
|
570
|
+
hideDetails?: boolean;
|
|
571
|
+
/** Hint text for the field */
|
|
572
|
+
hint?: string;
|
|
573
|
+
/** Id of the element */
|
|
574
|
+
hostId?: string;
|
|
575
|
+
/**
|
|
576
|
+
* Predicate for dates that cannot be picked (weekends, say); receives an
|
|
577
|
+
* ISO date. Functions have no attribute form — bind as a DOM property
|
|
578
|
+
*/
|
|
579
|
+
isDateDisabled?: (iso: string) => boolean;
|
|
580
|
+
/** Element label */
|
|
581
|
+
label?: string;
|
|
582
|
+
/** Label on top of the field */
|
|
583
|
+
labelOnTop?: boolean;
|
|
584
|
+
/**
|
|
585
|
+
* The latest date that can be picked or typed, as an ISO date; also bounds
|
|
586
|
+
* the calendar's navigation
|
|
587
|
+
*/
|
|
588
|
+
max?: string;
|
|
589
|
+
/**
|
|
590
|
+
* The earliest date that can be picked or typed, as an ISO date; also
|
|
591
|
+
* bounds the calendar's navigation
|
|
592
|
+
*/
|
|
593
|
+
min?: string;
|
|
594
|
+
/** Input field name */
|
|
595
|
+
name?: string;
|
|
596
|
+
/** Placeholder of the input; the `format` pattern when empty */
|
|
597
|
+
placeholder?: string;
|
|
598
|
+
/**
|
|
599
|
+
* Pick a range: the value becomes `{ start, end }` and the field holds two
|
|
600
|
+
* inputs
|
|
601
|
+
*/
|
|
602
|
+
range?: boolean;
|
|
603
|
+
/** Set the field as required */
|
|
604
|
+
required?: boolean;
|
|
605
|
+
/** Shadow variant */
|
|
606
|
+
shadow?: boolean;
|
|
607
|
+
/**
|
|
608
|
+
* Show ISO 8601 week numbers beside the calendar rows (meaningful with a
|
|
609
|
+
* Monday week start)
|
|
610
|
+
*/
|
|
611
|
+
showWeekNumbers?: boolean;
|
|
612
|
+
/** Field height: the 52px default (the shared control height) or the 36px `small` box */
|
|
613
|
+
size?: 'default' | 'small';
|
|
614
|
+
/**
|
|
615
|
+
* UI text overrides (i18n), merged over the names `Intl` gives for the
|
|
616
|
+
* page's `lang` and the English defaults. Objects have no attribute form —
|
|
617
|
+
* bind as a DOM property
|
|
618
|
+
*/
|
|
619
|
+
texts?: CDatePickerTexts;
|
|
620
|
+
/**
|
|
621
|
+
* What the field picks: a calendar date, or a year and a month
|
|
622
|
+
* (`'YYYY-MM'`)
|
|
623
|
+
*/
|
|
624
|
+
type?: 'date' | 'month';
|
|
625
|
+
/** Set the validity of the field */
|
|
626
|
+
valid?: boolean;
|
|
627
|
+
/**
|
|
628
|
+
* The date as an ISO `YYYY-MM-DD` string (an ISO `YYYY-MM` month under
|
|
629
|
+
* `type="month"`), or `{ start, end }` under `range`; `null` when empty
|
|
630
|
+
*/
|
|
631
|
+
value?: CDatePickerValue;
|
|
632
|
+
/** Whether the committed text names no date that can be picked — the value is then `null` (CONTEXT.md "Bad input"). */
|
|
633
|
+
readonly badInput: boolean;
|
|
634
|
+
addEventListener<K extends keyof CDatePickerElementEventMap>(type: K, listener: (this: CDatePickerElement, ev: CDatePickerElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
635
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
636
|
+
removeEventListener<K extends keyof CDatePickerElementEventMap>(type: K, listener: (this: CDatePickerElement, ev: CDatePickerElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
637
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
638
|
+
}
|
|
517
639
|
export interface CDividerElement extends Omit<HTMLElement, 'vertical'> {
|
|
518
640
|
/** Render a vertical separator instead of the default horizontal one. */
|
|
519
641
|
vertical?: boolean;
|
|
@@ -872,6 +994,73 @@ export interface CModalElement extends Omit<HTMLElement, 'disableBackdropBlur' |
|
|
|
872
994
|
}
|
|
873
995
|
export interface CNavigationButtonElement extends HTMLElement {
|
|
874
996
|
}
|
|
997
|
+
/** Events dispatched by `<c-number-field>`. */
|
|
998
|
+
export interface CNumberFieldElementEventMap {
|
|
999
|
+
/**
|
|
1000
|
+
* Fired whenever typing changes the number, carrying it — `null` once the
|
|
1001
|
+
* field holds no digit. Not fired when only the text changes (a group
|
|
1002
|
+
* separator, a trailing decimal separator) or when `value` is set.
|
|
1003
|
+
*/
|
|
1004
|
+
change: CustomEvent<null | number>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Native bubbling input event fired alongside every value change so a
|
|
1007
|
+
* plain Vue `v-model` works. No detail.
|
|
1008
|
+
*/
|
|
1009
|
+
input: CustomEvent<void>;
|
|
1010
|
+
/** v-model contract event, fired with `change`. */
|
|
1011
|
+
'update:value': CustomEvent<null | number>;
|
|
1012
|
+
}
|
|
1013
|
+
/** A field for a number — an integer, or one with decimals — shown with thousands separators as it is typed. */
|
|
1014
|
+
export interface CNumberFieldElement extends Omit<HTMLElement, 'decimals' | 'decimalSeparator' | 'disabled' | 'errorMessage' | 'fixedDecimals' | 'groupSeparator' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'shadow' | 'size' | 'valid' | 'value'> {
|
|
1015
|
+
/** The most fraction digits the field takes; `0` makes it an integer field */
|
|
1016
|
+
decimals?: number;
|
|
1017
|
+
/** The decimal separator. Empty follows the page's `lang` (`,` for `fi`, `.` for `en`) */
|
|
1018
|
+
decimalSeparator?: string;
|
|
1019
|
+
/** Disable the field */
|
|
1020
|
+
disabled?: boolean;
|
|
1021
|
+
/** Error message shown in place of the hint while the field is invalid */
|
|
1022
|
+
errorMessage?: string;
|
|
1023
|
+
/** Pad the fraction to exactly `decimals` digits when the field is left (`12,5` → `12,50`) */
|
|
1024
|
+
fixedDecimals?: boolean;
|
|
1025
|
+
/** The thousands separator. Empty follows the page's `lang` (a space for `fi`, `,` for `en`) */
|
|
1026
|
+
groupSeparator?: string;
|
|
1027
|
+
/** Hide the hint and error messages */
|
|
1028
|
+
hideDetails?: boolean;
|
|
1029
|
+
/** Hint text for the field */
|
|
1030
|
+
hint?: string;
|
|
1031
|
+
/** Id of the input */
|
|
1032
|
+
hostId?: string;
|
|
1033
|
+
/** Label of the field */
|
|
1034
|
+
label?: string;
|
|
1035
|
+
/** Label on top of the field */
|
|
1036
|
+
labelOnTop?: boolean;
|
|
1037
|
+
/** The largest number in range; a larger one is kept and reported as out of range */
|
|
1038
|
+
max?: null | number;
|
|
1039
|
+
/** The smallest number in range; a smaller one is kept and reported as out of range. At `0` or above, the minus key is ignored */
|
|
1040
|
+
min?: null | number;
|
|
1041
|
+
/** Name of the input */
|
|
1042
|
+
name?: string;
|
|
1043
|
+
/** Placeholder of the input */
|
|
1044
|
+
placeholder?: string;
|
|
1045
|
+
/** Mark as readonly */
|
|
1046
|
+
readonly?: boolean;
|
|
1047
|
+
/** Set the field as required */
|
|
1048
|
+
required?: boolean;
|
|
1049
|
+
/** Shadow variant of the field */
|
|
1050
|
+
shadow?: boolean;
|
|
1051
|
+
/** Field height: the 52px default (the shared control height) or the 36px `small` box */
|
|
1052
|
+
size?: 'default' | 'small';
|
|
1053
|
+
/** Set the validity of the field */
|
|
1054
|
+
valid?: boolean;
|
|
1055
|
+
/** The number, or `null` when the field is empty. A string is read as the number it spells, and `''` as empty — what an attribute, or a plain `v-model` holding `null`, writes; the field always emits a number or `null` */
|
|
1056
|
+
value?: null | number | string;
|
|
1057
|
+
/** Whether the number is below `min` or above `max` (CONTEXT.md "Out of range") */
|
|
1058
|
+
readonly outOfRange: boolean;
|
|
1059
|
+
addEventListener<K extends keyof CNumberFieldElementEventMap>(type: K, listener: (this: CNumberFieldElement, ev: CNumberFieldElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
1060
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1061
|
+
removeEventListener<K extends keyof CNumberFieldElementEventMap>(type: K, listener: (this: CNumberFieldElement, ev: CNumberFieldElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
1062
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1063
|
+
}
|
|
875
1064
|
export interface COptionElement extends Omit<HTMLElement, 'disabled' | 'name' | 'selected' | 'value'> {
|
|
876
1065
|
/** Set option as disabled */
|
|
877
1066
|
disabled?: boolean;
|
|
@@ -1582,7 +1771,8 @@ export interface CTextFieldElementEventMap {
|
|
|
1582
1771
|
*/
|
|
1583
1772
|
'update:value': CustomEvent<string>;
|
|
1584
1773
|
}
|
|
1585
|
-
|
|
1774
|
+
/** A text field for a single line of text, or several lines under `rows`, with a label, a hint and an error message. */
|
|
1775
|
+
export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'mask' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'size' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
|
|
1586
1776
|
/** HTML input autocomplete */
|
|
1587
1777
|
autocomplete?: string;
|
|
1588
1778
|
/**
|
|
@@ -1608,6 +1798,8 @@ export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'a
|
|
|
1608
1798
|
label?: string;
|
|
1609
1799
|
/** Label on top of the input */
|
|
1610
1800
|
labelOnTop?: boolean;
|
|
1801
|
+
/** Input mask the typed text follows: `#` a digit, `A` a letter, `*` a letter or a digit, `\` escapes the next character, `[…]` wraps a trailing optional section, anything else is a literal. Applies to a single-line `text`, `tel` or `search` field */
|
|
1802
|
+
mask?: string;
|
|
1611
1803
|
/** Maximum value on a numeric input */
|
|
1612
1804
|
max?: null | number;
|
|
1613
1805
|
/** Minimum value on a numeric input */
|
|
@@ -1636,11 +1828,108 @@ export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'a
|
|
|
1636
1828
|
valid?: boolean;
|
|
1637
1829
|
/** Value of the input */
|
|
1638
1830
|
value?: string;
|
|
1831
|
+
/** Whether a masked field has every mask token filled (always `true` without a mask) */
|
|
1832
|
+
readonly maskComplete: boolean;
|
|
1833
|
+
/** The text without the mask's literals: only the characters filling its tokens (the text as is without a mask) */
|
|
1834
|
+
readonly unmaskedValue: string;
|
|
1639
1835
|
addEventListener<K extends keyof CTextFieldElementEventMap>(type: K, listener: (this: CTextFieldElement, ev: CTextFieldElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
1640
1836
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1641
1837
|
removeEventListener<K extends keyof CTextFieldElementEventMap>(type: K, listener: (this: CTextFieldElement, ev: CTextFieldElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
1642
1838
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1643
1839
|
}
|
|
1840
|
+
/** Events dispatched by `<c-time-picker>`. */
|
|
1841
|
+
export interface CTimePickerElementEventMap {
|
|
1842
|
+
/**
|
|
1843
|
+
* Fired when the value changes — a row is picked or moved to in a column,
|
|
1844
|
+
* typed text is committed, or the field is cleared — carrying the new
|
|
1845
|
+
* value: an ISO `HH:mm` time, `{ start, end }` under `range`, or `null`.
|
|
1846
|
+
*/
|
|
1847
|
+
change: CustomEvent<CTimePickerValue>;
|
|
1848
|
+
/**
|
|
1849
|
+
* Fired on every commit of typed text (Enter or leaving the input) with the
|
|
1850
|
+
* text as typed — `{ start, end }` under `range`. Read `badInput` to tell
|
|
1851
|
+
* whether it named a time that can be picked.
|
|
1852
|
+
*/
|
|
1853
|
+
'change:text': CustomEvent<CTimePickerText>;
|
|
1854
|
+
/**
|
|
1855
|
+
* Native bubbling input event dispatched alongside every value change so a
|
|
1856
|
+
* plain `v-model` stays in sync. Carries no detail.
|
|
1857
|
+
*/
|
|
1858
|
+
input: CustomEvent<void>;
|
|
1859
|
+
/** Fired alongside `change` with the same detail — the `v-model` contract. */
|
|
1860
|
+
'update:value': CustomEvent<CTimePickerValue>;
|
|
1861
|
+
}
|
|
1862
|
+
/** A time field that takes a typed time, or opens hour and minute columns for picking one, or a start and end time under `range`. */
|
|
1863
|
+
export interface CTimePickerElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'format' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'minuteStep' | 'name' | 'placeholder' | 'range' | 'required' | 'shadow' | 'size' | 'texts' | 'valid' | 'value'> {
|
|
1864
|
+
/** Make the value clearable */
|
|
1865
|
+
clearable?: boolean;
|
|
1866
|
+
/** Disable the field */
|
|
1867
|
+
disabled?: boolean;
|
|
1868
|
+
/** Error message shown in place of the hint while the field is invalid */
|
|
1869
|
+
errorMessage?: string;
|
|
1870
|
+
/**
|
|
1871
|
+
* How times are shown and read from typing: a pattern of the tokens `H`,
|
|
1872
|
+
* `HH` (24-hour), `h`, `hh` (12-hour, with the period `a`) and `mm` with
|
|
1873
|
+
* any separators, e.g. `HH:mm` or `h:mm a`
|
|
1874
|
+
*/
|
|
1875
|
+
format?: string;
|
|
1876
|
+
/** Hide the hint and error messages */
|
|
1877
|
+
hideDetails?: boolean;
|
|
1878
|
+
/** Hint text for the field */
|
|
1879
|
+
hint?: string;
|
|
1880
|
+
/** Id of the element */
|
|
1881
|
+
hostId?: string;
|
|
1882
|
+
/** Element label */
|
|
1883
|
+
label?: string;
|
|
1884
|
+
/** Label on top of the field */
|
|
1885
|
+
labelOnTop?: boolean;
|
|
1886
|
+
/** The latest time that can be picked or typed, as an ISO `HH:mm` time */
|
|
1887
|
+
max?: string;
|
|
1888
|
+
/**
|
|
1889
|
+
* The earliest time that can be picked or typed, as an ISO `HH:mm` time;
|
|
1890
|
+
* a `min` after `max` is invalid and both are ignored
|
|
1891
|
+
*/
|
|
1892
|
+
min?: string;
|
|
1893
|
+
/**
|
|
1894
|
+
* Minutes between the minute column's rows; typed times need not fall on
|
|
1895
|
+
* the step
|
|
1896
|
+
*/
|
|
1897
|
+
minuteStep?: number;
|
|
1898
|
+
/** Input field name */
|
|
1899
|
+
name?: string;
|
|
1900
|
+
/** Placeholder of the input; the `format` pattern when empty */
|
|
1901
|
+
placeholder?: string;
|
|
1902
|
+
/**
|
|
1903
|
+
* Pick a range: the value becomes `{ start, end }` and the field holds two
|
|
1904
|
+
* inputs
|
|
1905
|
+
*/
|
|
1906
|
+
range?: boolean;
|
|
1907
|
+
/** Set the field as required */
|
|
1908
|
+
required?: boolean;
|
|
1909
|
+
/** Shadow variant */
|
|
1910
|
+
shadow?: boolean;
|
|
1911
|
+
/** Field height: the 52px default (the shared control height) or the 36px `small` box */
|
|
1912
|
+
size?: 'default' | 'small';
|
|
1913
|
+
/**
|
|
1914
|
+
* UI text overrides (i18n), merged over the AM/PM texts `Intl` gives for
|
|
1915
|
+
* the page's `lang` and the English defaults. Objects have no attribute
|
|
1916
|
+
* form — bind as a DOM property
|
|
1917
|
+
*/
|
|
1918
|
+
texts?: CTimePickerTexts;
|
|
1919
|
+
/** Set the validity of the field */
|
|
1920
|
+
valid?: boolean;
|
|
1921
|
+
/**
|
|
1922
|
+
* The time as an ISO `HH:mm` string on a 24-hour clock, or `{ start, end }`
|
|
1923
|
+
* under `range`; `null` when empty
|
|
1924
|
+
*/
|
|
1925
|
+
value?: CTimePickerValue;
|
|
1926
|
+
/** Whether the committed text names no time that can be picked — the value is then `null` (CONTEXT.md "Bad input"). */
|
|
1927
|
+
readonly badInput: boolean;
|
|
1928
|
+
addEventListener<K extends keyof CTimePickerElementEventMap>(type: K, listener: (this: CTimePickerElement, ev: CTimePickerElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
1929
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1930
|
+
removeEventListener<K extends keyof CTimePickerElementEventMap>(type: K, listener: (this: CTimePickerElement, ev: CTimePickerElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
1931
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1932
|
+
}
|
|
1644
1933
|
/** Events dispatched by `<c-toast>`. */
|
|
1645
1934
|
export interface CToastElementEventMap {
|
|
1646
1935
|
/**
|
|
@@ -1829,20 +2118,26 @@ export interface CTreeSelectElement extends Omit<HTMLElement, 'allowBranch' | 'c
|
|
|
1829
2118
|
export interface AppDefaults {
|
|
1830
2119
|
'c-autocomplete'?: Partial<Pick<CAutocompleteElement, 'hideDetails' | 'itemsPerPage' | 'labelOnTop' | 'shadow' | 'size' | 'texts'>>;
|
|
1831
2120
|
'c-data-table'?: Partial<Pick<CDataTableElement, 'texts'>>;
|
|
2121
|
+
'c-date-picker'?: Partial<Pick<CDatePickerElement, 'firstDayOfWeek' | 'format' | 'hideDetails' | 'labelOnTop' | 'shadow' | 'showWeekNumbers' | 'size' | 'texts'>>;
|
|
2122
|
+
'c-number-field'?: Partial<Pick<CNumberFieldElement, 'decimalSeparator' | 'decimals' | 'fixedDecimals' | 'groupSeparator' | 'hideDetails' | 'labelOnTop' | 'shadow' | 'size'>>;
|
|
1832
2123
|
'c-select'?: Partial<Pick<CSelectElement, 'hideDetails' | 'itemsPerPage' | 'labelOnTop' | 'shadow' | 'size' | 'texts'>>;
|
|
1833
2124
|
'c-text-field'?: Partial<Pick<CTextFieldElement, 'hideDetails' | 'labelOnTop' | 'shadow' | 'size'>>;
|
|
2125
|
+
'c-time-picker'?: Partial<Pick<CTimePickerElement, 'format' | 'hideDetails' | 'labelOnTop' | 'shadow' | 'size' | 'texts'>>;
|
|
1834
2126
|
'c-tree-select'?: Partial<Pick<CTreeSelectElement, 'hideDetails' | 'itemsPerPage' | 'labelOnTop' | 'shadow' | 'size' | 'texts'>>;
|
|
1835
2127
|
}
|
|
1836
2128
|
/** Runtime allow-list behind `applyDefaults()` validation — the same data as `AppDefaults`. */
|
|
1837
2129
|
export declare const DEFAULTABLE_PROPS: {
|
|
1838
2130
|
readonly 'c-autocomplete': readonly ["hideDetails", "itemsPerPage", "labelOnTop", "shadow", "size", "texts"];
|
|
1839
2131
|
readonly 'c-data-table': readonly ["texts"];
|
|
2132
|
+
readonly 'c-date-picker': readonly ["firstDayOfWeek", "format", "hideDetails", "labelOnTop", "shadow", "showWeekNumbers", "size", "texts"];
|
|
2133
|
+
readonly 'c-number-field': readonly ["decimalSeparator", "decimals", "fixedDecimals", "groupSeparator", "hideDetails", "labelOnTop", "shadow", "size"];
|
|
1840
2134
|
readonly 'c-select': readonly ["hideDetails", "itemsPerPage", "labelOnTop", "shadow", "size", "texts"];
|
|
1841
2135
|
readonly 'c-text-field': readonly ["hideDetails", "labelOnTop", "shadow", "size"];
|
|
2136
|
+
readonly 'c-time-picker': readonly ["format", "hideDetails", "labelOnTop", "shadow", "size", "texts"];
|
|
1842
2137
|
readonly 'c-tree-select': readonly ["hideDetails", "itemsPerPage", "labelOnTop", "shadow", "size", "texts"];
|
|
1843
2138
|
};
|
|
1844
2139
|
/** Tags dispatching the v-model contract event `update:value` — the value controls (CONTEXT.md). */
|
|
1845
|
-
export declare const VALUE_TAGS: readonly ["c-accordion", "c-autocomplete", "c-button-group", "c-checkbox", "c-modal", "c-otp-input", "c-pagination", "c-radio-group", "c-select", "c-slider", "c-switch", "c-tabs", "c-text-field", "c-tree-select"];
|
|
2140
|
+
export declare const VALUE_TAGS: readonly ["c-accordion", "c-autocomplete", "c-button-group", "c-checkbox", "c-date-picker", "c-modal", "c-number-field", "c-otp-input", "c-pagination", "c-radio-group", "c-select", "c-slider", "c-switch", "c-tabs", "c-text-field", "c-time-picker", "c-tree-select"];
|
|
1846
2141
|
declare global {
|
|
1847
2142
|
interface HTMLElementTagNameMap {
|
|
1848
2143
|
'c-accordion': CAccordionElement;
|
|
@@ -1859,6 +2154,7 @@ declare global {
|
|
|
1859
2154
|
'c-checkbox': CCheckboxElement;
|
|
1860
2155
|
'c-csc-logo': CCscLogoElement;
|
|
1861
2156
|
'c-data-table': CDataTableElement;
|
|
2157
|
+
'c-date-picker': CDatePickerElement;
|
|
1862
2158
|
'c-divider': CDividerElement;
|
|
1863
2159
|
'c-dropdown': CDropdownElement;
|
|
1864
2160
|
'c-icon': CIconElement;
|
|
@@ -1882,6 +2178,7 @@ declare global {
|
|
|
1882
2178
|
'c-message': CMessageElement;
|
|
1883
2179
|
'c-modal': CModalElement;
|
|
1884
2180
|
'c-navigation-button': CNavigationButtonElement;
|
|
2181
|
+
'c-number-field': CNumberFieldElement;
|
|
1885
2182
|
'c-option': COptionElement;
|
|
1886
2183
|
'c-option-value': COptionValueElement;
|
|
1887
2184
|
'c-otp-input': COtpInputElement;
|
|
@@ -1912,6 +2209,7 @@ declare global {
|
|
|
1912
2209
|
'c-tag': CTagElement;
|
|
1913
2210
|
'c-tags': CTagsElement;
|
|
1914
2211
|
'c-text-field': CTextFieldElement;
|
|
2212
|
+
'c-time-picker': CTimePickerElement;
|
|
1915
2213
|
'c-toast': CToastElement;
|
|
1916
2214
|
'c-toasts': CToastsElement;
|
|
1917
2215
|
'c-toolbar': CToolbarElement;
|
package/package.json
CHANGED