@cscfi/csc-ui 4.0.0-alpha.2 → 4.0.0-alpha.4
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 +6427 -6059
- package/dist/custom-elements.json +727 -160
- package/dist/docs/c-popover/usage.md +27 -0
- package/dist/docs/c-radio/usage.md +29 -0
- package/dist/docs/c-radio-group/usage.md +67 -0
- package/dist/docs/c-tooltip/usage.md +30 -0
- package/dist/styles/css/tailwind-theme.css +30 -0
- package/dist/styles/css/tokens.css +77 -1
- package/dist/vscode.css-custom-data.json +80 -12
- package/dist/vscode.html-custom-data.json +136 -22
- package/dist/web-types.json +398 -79
- package/dist-types/components/c-alert/CAlert.vue.d.ts +10 -3
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +4 -1
- package/dist-types/components/c-button/CButton.vue.d.ts +1 -1
- package/dist-types/components/c-icon/CIcon.vue.d.ts +1 -1
- package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +1 -1
- package/dist-types/components/c-input/CInput.vue.d.ts +4 -0
- package/dist-types/components/c-login-button/CLoginButton.vue.d.ts +4 -2
- package/dist-types/components/c-menu/CMenu.vue.d.ts +3 -3
- package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +29 -3
- package/dist-types/components/c-popover/CPopover.vue.d.ts +34 -0
- package/dist-types/components/c-radio/CRadio.vue.d.ts +0 -10
- package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +8 -46
- package/dist-types/components/c-select/CSelect.vue.d.ts +4 -1
- package/dist-types/components/c-spinner/CSpinner.vue.d.ts +1 -1
- package/dist-types/components/c-tag/CTag.vue.d.ts +1 -1
- package/dist-types/components/c-text-field/CTextField.vue.d.ts +4 -0
- package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +39 -0
- package/dist-types/index.d.ts +3 -1
- package/dist-types/shared/FieldMessage.vue.d.ts +21 -0
- package/dist-types/shared/positionArea.d.ts +13 -0
- package/dist-types/tag-name-map.d.ts +142 -31
- package/dist-types/types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -21,11 +21,6 @@ type DropdownItem = {
|
|
|
21
21
|
selected?: boolean;
|
|
22
22
|
value: number | string;
|
|
23
23
|
};
|
|
24
|
-
interface RadioItem {
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
name: string;
|
|
27
|
-
value: number | string;
|
|
28
|
-
}
|
|
29
24
|
/** Events dispatched by `<c-accordion>`. */
|
|
30
25
|
export interface CAccordionElementEventMap {
|
|
31
26
|
/**
|
|
@@ -92,9 +87,26 @@ export interface CAccordionItemElement extends Omit<HTMLElement, 'collapsable' |
|
|
|
92
87
|
removeEventListener<K extends keyof CAccordionItemElementEventMap>(type: K, listener: (this: CAccordionItemElement, ev: CAccordionItemElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
93
88
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
94
89
|
}
|
|
95
|
-
|
|
90
|
+
/** Events dispatched by `<c-alert>`. */
|
|
91
|
+
export interface CAlertElementEventMap {
|
|
92
|
+
/**
|
|
93
|
+
* Fired when the dismiss button is pressed. The alert does not hide
|
|
94
|
+
* itself — the consumer owns removal.
|
|
95
|
+
*/
|
|
96
|
+
dismiss: CustomEvent<void>;
|
|
97
|
+
}
|
|
98
|
+
export interface CAlertElement extends Omit<HTMLElement, 'dismissible' | 'type'> {
|
|
99
|
+
/**
|
|
100
|
+
* Show a dismiss button. The alert only emits `dismiss` — removing it from
|
|
101
|
+
* the page stays the consumer's job.
|
|
102
|
+
*/
|
|
103
|
+
dismissible?: boolean;
|
|
96
104
|
/** Type of the alert */
|
|
97
105
|
type?: 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
106
|
+
addEventListener<K extends keyof CAlertElementEventMap>(type: K, listener: (this: CAlertElement, ev: CAlertElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
107
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
108
|
+
removeEventListener<K extends keyof CAlertElementEventMap>(type: K, listener: (this: CAlertElement, ev: CAlertElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
109
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
98
110
|
}
|
|
99
111
|
/** Events dispatched by `<c-autocomplete>`. */
|
|
100
112
|
export interface CAutocompleteElementEventMap {
|
|
@@ -130,7 +142,7 @@ export interface CAutocompleteElementEventMap {
|
|
|
130
142
|
'update:value': CustomEvent<CAutocompleteItem | null | number | string>;
|
|
131
143
|
}
|
|
132
144
|
/** A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options. */
|
|
133
|
-
export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'external' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
|
|
145
|
+
export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'external' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'size' | 'valid' | 'value'> {
|
|
134
146
|
/** Make the selected value clearable */
|
|
135
147
|
clearable?: boolean;
|
|
136
148
|
/** Disable the input */
|
|
@@ -173,6 +185,8 @@ export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'd
|
|
|
173
185
|
returnObject?: boolean;
|
|
174
186
|
/** Shadow variant */
|
|
175
187
|
shadow?: boolean;
|
|
188
|
+
/** Field height: the 44px default or the 36px `small` box */
|
|
189
|
+
size?: 'default' | 'small';
|
|
176
190
|
/** Set the validity of the input */
|
|
177
191
|
valid?: boolean;
|
|
178
192
|
/** Selected value (scalar, or object when return-object is set) */
|
|
@@ -534,7 +548,7 @@ export interface CIconButtonElement extends Omit<HTMLElement, 'badge' | 'danger'
|
|
|
534
548
|
/** Text variant of the button */
|
|
535
549
|
text?: boolean;
|
|
536
550
|
}
|
|
537
|
-
export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' | 'errorMessage' | 'filled' | 'hideDetails' | 'hint' | 'inputId' | 'isTextarea' | 'label' | 'labelOnTop' | 'required' | 'shadow' | 'valid'> {
|
|
551
|
+
export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' | 'errorMessage' | 'filled' | 'hideDetails' | 'hint' | 'inputId' | 'isTextarea' | 'label' | 'labelOnTop' | 'required' | 'shadow' | 'size' | 'valid'> {
|
|
538
552
|
/** Set by the wrapping form component when its input has focus or holds a value. */
|
|
539
553
|
active?: boolean;
|
|
540
554
|
/** Disable the input */
|
|
@@ -559,6 +573,8 @@ export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' |
|
|
|
559
573
|
required?: boolean;
|
|
560
574
|
/** Shadow variant of the input */
|
|
561
575
|
shadow?: boolean;
|
|
576
|
+
/** Field height: the 44px default or the 36px `small` box */
|
|
577
|
+
size?: 'default' | 'small';
|
|
562
578
|
/** Set the validíty of the input */
|
|
563
579
|
valid?: boolean;
|
|
564
580
|
}
|
|
@@ -693,11 +709,28 @@ export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'p
|
|
|
693
709
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
694
710
|
}
|
|
695
711
|
/** A single command in a `c-menu`. */
|
|
696
|
-
export interface CMenuItemElement extends Omit<HTMLElement, 'danger' | 'disabled' | 'value'> {
|
|
712
|
+
export interface CMenuItemElement extends Omit<HTMLElement, 'active' | 'activeIcon' | 'danger' | 'disabled' | 'icon' | 'value'> {
|
|
713
|
+
/**
|
|
714
|
+
* Marks the item as the currently selected choice: renders the trailing
|
|
715
|
+
* indicator icon and stamps `role="menuitemradio"` + `aria-checked`. Leave
|
|
716
|
+
* unset for regular command items — only a true/false value marks the item
|
|
717
|
+
* as a selectable choice. The state is consumer-owned: the menu emits
|
|
718
|
+
* `select` as usual and never toggles this itself. Distinct from the
|
|
719
|
+
* keyboard highlight (the `data-active` attribute the controlling menu
|
|
720
|
+
* moves between rows).
|
|
721
|
+
*/
|
|
722
|
+
active?: boolean;
|
|
723
|
+
/**
|
|
724
|
+
* SVG path for the trailing indicator shown while `active`; defaults to a
|
|
725
|
+
* check mark.
|
|
726
|
+
*/
|
|
727
|
+
activeIcon?: string;
|
|
697
728
|
/** Marks the action as destructive (renders in the error colour). */
|
|
698
729
|
danger?: boolean;
|
|
699
730
|
/** Disables the item — it is skipped by keyboard nav and emits no select. */
|
|
700
731
|
disabled?: boolean;
|
|
732
|
+
/** SVG path for a leading icon rendered before the item's content. */
|
|
733
|
+
icon?: string;
|
|
701
734
|
/** Value reported in the menu's `select` event when this item is chosen. */
|
|
702
735
|
value?: string;
|
|
703
736
|
closeSubmenu(): void;
|
|
@@ -859,6 +892,36 @@ export interface CPaginationElement extends Omit<HTMLElement, 'hideDetails' | 'h
|
|
|
859
892
|
removeEventListener<K extends keyof CPaginationElementEventMap>(type: K, listener: (this: CPaginationElement, ev: CPaginationElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
860
893
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
861
894
|
}
|
|
895
|
+
/** Events dispatched by `<c-popover>`. */
|
|
896
|
+
export interface CPopoverElementEventMap {
|
|
897
|
+
/**
|
|
898
|
+
* Fired whenever the popover opens or closes, carrying the new open state.
|
|
899
|
+
* Named `change:open`, not `update:open`: Vue's runtime silently drops
|
|
900
|
+
* `onUpdate:*` listeners on custom elements (`isModelListener`), so a
|
|
901
|
+
* template `@update:open` would never be attached.
|
|
902
|
+
*/
|
|
903
|
+
'change:open': CustomEvent<boolean>;
|
|
904
|
+
}
|
|
905
|
+
/** A click-opened, non-modal surface anchored to its trigger, floating in the top layer; its content may be interactive. */
|
|
906
|
+
export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading' | 'open' | 'position'> {
|
|
907
|
+
/** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
|
|
908
|
+
distance?: number | string;
|
|
909
|
+
/**
|
|
910
|
+
* Heading rendered at the top of the panel, doubling as its accessible
|
|
911
|
+
* name. Without it, set `aria-label` on the host. Named `heading`, not
|
|
912
|
+
* `title`: a `title` attribute on the host would trigger the browser's
|
|
913
|
+
* native tooltip and collides with `HTMLElement.title`.
|
|
914
|
+
*/
|
|
915
|
+
heading?: string;
|
|
916
|
+
/** Whether the popover is open. Two-way: emits `change:open`. */
|
|
917
|
+
open?: boolean;
|
|
918
|
+
/** Preferred placement of the panel relative to the trigger. */
|
|
919
|
+
position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
920
|
+
addEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
921
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
922
|
+
removeEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
923
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
924
|
+
}
|
|
862
925
|
export interface CProgressBarElement extends Omit<HTMLElement, 'hideDetails' | 'indeterminate' | 'label' | 'singleLine' | 'value'> {
|
|
863
926
|
/** Hide the percentage display */
|
|
864
927
|
hideDetails?: boolean;
|
|
@@ -871,33 +934,44 @@ export interface CProgressBarElement extends Omit<HTMLElement, 'hideDetails' | '
|
|
|
871
934
|
/** Progress bar value in percentage (0 to 100) */
|
|
872
935
|
value?: number;
|
|
873
936
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
937
|
+
/** Events dispatched by `<c-radio>`. */
|
|
938
|
+
export interface CRadioElementEventMap {
|
|
939
|
+
/**
|
|
940
|
+
* Fired when the radio is selected by the user, carrying its `value`.
|
|
941
|
+
* Bubbles composed so the parent `<c-radio-group>` — whose shadow root a
|
|
942
|
+
* light-DOM event never enters — catches it on its host; a consumer
|
|
943
|
+
* listening on the group hears it too, with the radio as `target`.
|
|
944
|
+
*/
|
|
945
|
+
change: CustomEvent<string>;
|
|
946
|
+
}
|
|
947
|
+
/** A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label. */
|
|
948
|
+
export interface CRadioElement extends Omit<HTMLElement, 'disabled' | 'value'> {
|
|
877
949
|
/** Disable the radio button */
|
|
878
950
|
disabled?: boolean;
|
|
879
951
|
/** Radio button value */
|
|
880
952
|
value?: string;
|
|
953
|
+
addEventListener<K extends keyof CRadioElementEventMap>(type: K, listener: (this: CRadioElement, ev: CRadioElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
954
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
955
|
+
removeEventListener<K extends keyof CRadioElementEventMap>(type: K, listener: (this: CRadioElement, ev: CRadioElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
956
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
881
957
|
}
|
|
882
958
|
/** Events dispatched by `<c-radio-group>`. */
|
|
883
959
|
export interface CRadioGroupElementEventMap {
|
|
884
|
-
/**
|
|
885
|
-
|
|
886
|
-
* value — or the whole item object when `return-object` is set.
|
|
887
|
-
*/
|
|
888
|
-
changeValue: CustomEvent<number | RadioItem | string>;
|
|
960
|
+
/** Fired when a radio is selected, carrying the selected radio's value. */
|
|
961
|
+
changeValue: CustomEvent<string>;
|
|
889
962
|
/**
|
|
890
963
|
* Native bubbling input event fired on selection so a plain Vue `v-model`
|
|
891
964
|
* works without the `v-control` directive. No detail.
|
|
892
965
|
*/
|
|
893
966
|
input: CustomEvent<void>;
|
|
894
967
|
/**
|
|
895
|
-
* v-model contract event fired on selection, carrying the selected
|
|
896
|
-
* value
|
|
968
|
+
* v-model contract event fired on selection, carrying the selected radio's
|
|
969
|
+
* value.
|
|
897
970
|
*/
|
|
898
|
-
'update:value': CustomEvent<
|
|
971
|
+
'update:value': CustomEvent<string>;
|
|
899
972
|
}
|
|
900
|
-
|
|
973
|
+
/** A radio group is a set of mutually exclusive choices where exactly one can be selected, authored as slotted `c-radio` children. Give the group a `label` so the choice it represents is named for every user, and a `hint` describing how to answer. */
|
|
974
|
+
export interface CRadioGroupElement extends Omit<HTMLElement, 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'inline' | 'label' | 'required' | 'valid' | 'value'> {
|
|
901
975
|
/** Disable the radio group */
|
|
902
976
|
disabled?: boolean;
|
|
903
977
|
/** Error message shown in place of the hint while the group is invalid */
|
|
@@ -906,22 +980,19 @@ export interface CRadioGroupElement extends Omit<HTMLElement, 'disabled' | 'erro
|
|
|
906
980
|
hideDetails?: boolean;
|
|
907
981
|
/** Hint text for the input */
|
|
908
982
|
hint?: string;
|
|
909
|
-
/** Id of the element */
|
|
910
|
-
hostId?: string;
|
|
911
983
|
/** Display radio buttons inline */
|
|
912
984
|
inline?: boolean;
|
|
913
|
-
/** Radio group items */
|
|
914
|
-
items?: RadioItem[];
|
|
915
985
|
/** Label of the radio group */
|
|
916
986
|
label?: string;
|
|
917
987
|
/** Set as required */
|
|
918
988
|
required?: boolean;
|
|
919
|
-
/** Return the whole item object */
|
|
920
|
-
returnObject?: boolean;
|
|
921
989
|
/** Set the validity of the input */
|
|
922
990
|
valid?: boolean;
|
|
923
|
-
/**
|
|
924
|
-
|
|
991
|
+
/**
|
|
992
|
+
* Value of the radio group; matched against each radio's `value` by strict
|
|
993
|
+
* string equality
|
|
994
|
+
*/
|
|
995
|
+
value?: null | string;
|
|
925
996
|
addEventListener<K extends keyof CRadioGroupElementEventMap>(type: K, listener: (this: CRadioGroupElement, ev: CRadioGroupElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
926
997
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
927
998
|
removeEventListener<K extends keyof CRadioGroupElementEventMap>(type: K, listener: (this: CRadioGroupElement, ev: CRadioGroupElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
@@ -946,7 +1017,7 @@ export interface CSelectElementEventMap {
|
|
|
946
1017
|
*/
|
|
947
1018
|
'update:value': CustomEvent<CSelectItem | null | number | string>;
|
|
948
1019
|
}
|
|
949
|
-
export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'optionAsSelection' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
|
|
1020
|
+
export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'optionAsSelection' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'size' | 'valid' | 'value'> {
|
|
950
1021
|
/** Make the selected value clearable */
|
|
951
1022
|
clearable?: boolean;
|
|
952
1023
|
/** Disable the input */
|
|
@@ -981,6 +1052,8 @@ export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disable
|
|
|
981
1052
|
returnObject?: boolean;
|
|
982
1053
|
/** Shadow variant */
|
|
983
1054
|
shadow?: boolean;
|
|
1055
|
+
/** Field height: the 44px default or the 36px `small` box */
|
|
1056
|
+
size?: 'default' | 'small';
|
|
984
1057
|
/** Set the validity of the input */
|
|
985
1058
|
valid?: boolean;
|
|
986
1059
|
/** Selected value (scalar, or object when return-object is set) */
|
|
@@ -1367,7 +1440,7 @@ export interface CTextFieldElementEventMap {
|
|
|
1367
1440
|
*/
|
|
1368
1441
|
'update:value': CustomEvent<string>;
|
|
1369
1442
|
}
|
|
1370
|
-
export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
|
|
1443
|
+
export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'size' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
|
|
1371
1444
|
/** HTML input autocomplete */
|
|
1372
1445
|
autocomplete?: string;
|
|
1373
1446
|
/**
|
|
@@ -1409,6 +1482,8 @@ export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'a
|
|
|
1409
1482
|
rows?: number;
|
|
1410
1483
|
/** Shadow variant of the input */
|
|
1411
1484
|
shadow?: boolean;
|
|
1485
|
+
/** Field height: the 44px default or the 36px `small` box (single-line fields) */
|
|
1486
|
+
size?: 'default' | 'small';
|
|
1412
1487
|
/** Step size on a numeric input */
|
|
1413
1488
|
step?: null | number;
|
|
1414
1489
|
/** Trim whitespace from the return value */
|
|
@@ -1458,6 +1533,40 @@ export interface CToastsElement extends Omit<HTMLElement, 'absolute' | 'horizont
|
|
|
1458
1533
|
}
|
|
1459
1534
|
export interface CToolbarElement extends HTMLElement {
|
|
1460
1535
|
}
|
|
1536
|
+
/** Events dispatched by `<c-tooltip>`. */
|
|
1537
|
+
export interface CTooltipElementEventMap {
|
|
1538
|
+
/**
|
|
1539
|
+
* Fired whenever the tooltip shows or hides, carrying the new open state.
|
|
1540
|
+
* Named `change:open`, not `update:open`: Vue's runtime silently drops
|
|
1541
|
+
* `onUpdate:*` listeners on custom elements (`isModelListener`), so a
|
|
1542
|
+
* template `@update:open` would never be attached.
|
|
1543
|
+
*/
|
|
1544
|
+
'change:open': CustomEvent<boolean>;
|
|
1545
|
+
}
|
|
1546
|
+
/** A non-interactive text hint shown when its trigger is hovered or keyboard-focused, floating in the top layer on the inverted surface tier. */
|
|
1547
|
+
export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance' | 'open' | 'position' | 'text'> {
|
|
1548
|
+
/**
|
|
1549
|
+
* Delay before the tooltip shows on hover, in milliseconds. Keyboard focus
|
|
1550
|
+
* shows the tooltip immediately, regardless of this value. Defaults to
|
|
1551
|
+
* `400`.
|
|
1552
|
+
*/
|
|
1553
|
+
delay?: number | string;
|
|
1554
|
+
/** Distance from the trigger to the tooltip, in pixels. Defaults to `4`. */
|
|
1555
|
+
distance?: number | string;
|
|
1556
|
+
/** Whether the tooltip is open. Two-way: emits `change:open`. */
|
|
1557
|
+
open?: boolean;
|
|
1558
|
+
/** Preferred placement of the tooltip relative to the trigger. */
|
|
1559
|
+
position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
1560
|
+
/**
|
|
1561
|
+
* The tooltip text. Overridden by the `content` slot when that is
|
|
1562
|
+
* populated.
|
|
1563
|
+
*/
|
|
1564
|
+
text?: string;
|
|
1565
|
+
addEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
1566
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1567
|
+
removeEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
1568
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1569
|
+
}
|
|
1461
1570
|
declare global {
|
|
1462
1571
|
interface HTMLElementTagNameMap {
|
|
1463
1572
|
'c-accordion': CAccordionElement;
|
|
@@ -1502,6 +1611,7 @@ declare global {
|
|
|
1502
1611
|
'c-otp-input': COtpInputElement;
|
|
1503
1612
|
'c-page': CPageElement;
|
|
1504
1613
|
'c-pagination': CPaginationElement;
|
|
1614
|
+
'c-popover': CPopoverElement;
|
|
1505
1615
|
'c-progress-bar': CProgressBarElement;
|
|
1506
1616
|
'c-radio': CRadioElement;
|
|
1507
1617
|
'c-radio-group': CRadioGroupElement;
|
|
@@ -1528,6 +1638,7 @@ declare global {
|
|
|
1528
1638
|
'c-toast': CToastElement;
|
|
1529
1639
|
'c-toasts': CToastsElement;
|
|
1530
1640
|
'c-toolbar': CToolbarElement;
|
|
1641
|
+
'c-tooltip': CTooltipElement;
|
|
1531
1642
|
}
|
|
1532
1643
|
}
|
|
1533
1644
|
export {};
|
package/dist-types/types.d.ts
CHANGED
|
@@ -6,6 +6,19 @@
|
|
|
6
6
|
*
|
|
7
7
|
* import type { CSelectItem } from '@cscfi/csc-ui';
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Field height of the form controls built on `c-input`. `default` is the 44px
|
|
11
|
+
* field; `small` is the 36px field. Owned here because the value passes from
|
|
12
|
+
* the wrapping control (`c-select`) into `c-input`.
|
|
13
|
+
*/
|
|
14
|
+
export type CFieldSize = 'default' | 'small';
|
|
15
|
+
/**
|
|
16
|
+
* Preferred placement of a floating panel relative to its anchor, shared by
|
|
17
|
+
* the anchor-positioned overlay components (`c-menu`, `c-tooltip`,
|
|
18
|
+
* `c-popover`). The side names the panel's position; `-start`/`-end` align
|
|
19
|
+
* the panel's edge with the anchor's on the cross axis.
|
|
20
|
+
*/
|
|
21
|
+
export type CPlacement = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
9
22
|
/**
|
|
10
23
|
* A selectable item for the value-selection components (`c-select`,
|
|
11
24
|
* `c-autocomplete`) when options are supplied via the `items` prop instead of
|
package/package.json
CHANGED