@cscfi/csc-ui 4.0.0-alpha.9 → 4.0.0-rc.2
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/README.md +36 -2
- package/dist/csc-ui.js +22771 -14908
- package/dist/custom-elements.json +8943 -5632
- package/dist/docs/c-accordion/usage.md +60 -0
- package/dist/docs/c-accordion-item/usage.md +1 -0
- package/dist/docs/c-alert/usage.md +5 -5
- package/dist/docs/c-autocomplete/usage.md +156 -0
- package/dist/docs/c-badge/usage.md +50 -0
- package/dist/docs/c-breadcrumb/usage.md +104 -0
- package/dist/docs/c-breadcrumb-item/usage.md +1 -0
- package/dist/docs/c-button/usage.md +13 -0
- package/dist/docs/c-button-group/usage.md +16 -2
- package/dist/docs/c-card/usage.md +55 -0
- package/dist/docs/c-card-actions/usage.md +1 -0
- package/dist/docs/c-card-content/usage.md +1 -0
- package/dist/docs/c-card-title/usage.md +3 -0
- package/dist/docs/c-checkbox/usage.md +37 -5
- package/dist/docs/c-color-picker/usage.md +160 -0
- package/dist/docs/c-csc-logo/usage.md +25 -0
- package/dist/docs/c-data-table/usage.md +180 -0
- package/dist/docs/c-date-picker/usage.md +224 -0
- package/dist/docs/c-divider/usage.md +36 -0
- package/dist/docs/c-file-upload/usage.md +189 -0
- package/dist/docs/c-icon/usage.md +51 -0
- package/dist/docs/c-icon-button/usage.md +80 -0
- package/dist/docs/c-link/usage.md +45 -1
- package/dist/docs/c-list/usage.md +50 -0
- package/dist/docs/c-list-item/usage.md +1 -0
- package/dist/docs/c-list-item-title/usage.md +1 -0
- package/dist/docs/c-loader/usage.md +52 -1
- package/dist/docs/c-login-button/usage.md +1 -0
- package/dist/docs/c-login-buttons/usage.md +48 -0
- package/dist/docs/c-login-card/usage.md +45 -0
- package/dist/docs/c-login-card-actions/usage.md +1 -0
- package/dist/docs/c-login-card-content/usage.md +1 -0
- package/dist/docs/c-login-card-title/usage.md +3 -0
- package/dist/docs/c-main/usage.md +21 -1
- package/dist/docs/c-menu/usage.md +15 -0
- package/dist/docs/c-menu-item/usage.md +11 -0
- package/dist/docs/c-message/usage.md +56 -0
- package/dist/docs/c-modal/usage.md +18 -12
- package/dist/docs/c-navigation-button/usage.md +32 -0
- package/dist/docs/c-number-field/usage.md +114 -0
- package/dist/docs/c-option/usage.md +1 -0
- package/dist/docs/c-option-value/usage.md +1 -0
- package/dist/docs/c-otp-input/usage.md +95 -0
- package/dist/docs/c-page/usage.md +44 -0
- package/dist/docs/c-pagination/usage.md +69 -0
- package/dist/docs/c-popover/usage.md +1 -1
- package/dist/docs/c-progress-bar/usage.md +1 -1
- package/dist/docs/c-progress-circle/usage.md +1 -1
- package/dist/docs/c-radio/usage.md +9 -6
- package/dist/docs/c-radio-group/usage.md +5 -6
- package/dist/docs/c-select/usage.md +131 -0
- package/dist/docs/c-side-navigation/usage.md +70 -0
- package/dist/docs/c-side-navigation-item/usage.md +1 -0
- package/dist/docs/c-side-navigation-title/usage.md +1 -0
- package/dist/docs/c-slider/usage.md +78 -0
- package/dist/docs/c-spinner/usage.md +1 -1
- package/dist/docs/c-status/usage.md +46 -0
- package/dist/docs/c-step/usage.md +1 -0
- package/dist/docs/c-steps/usage.md +35 -0
- package/dist/docs/c-sub-navigation-item/usage.md +1 -0
- package/dist/docs/c-switch/usage.md +10 -3
- package/dist/docs/c-tab/usage.md +1 -0
- package/dist/docs/c-tab-buttons/usage.md +15 -0
- package/dist/docs/c-tab-item/usage.md +1 -0
- package/dist/docs/c-tab-items/usage.md +1 -0
- package/dist/docs/c-table/usage.md +1 -1
- package/dist/docs/c-tabs/usage.md +77 -0
- package/dist/docs/c-tag/usage.md +1 -0
- package/dist/docs/c-tags/usage.md +85 -0
- package/dist/docs/c-text-field/usage.md +109 -0
- package/dist/docs/c-time-picker/usage.md +170 -0
- package/dist/docs/c-toasts/usage.md +27 -3
- package/dist/docs/c-toolbar/usage.md +17 -0
- package/dist/docs/c-tree-select/usage.md +156 -0
- package/dist/floating-ui.dom-DvzxEaDJ.js +1292 -0
- package/dist/styles/css/tailwind-theme.css +2 -1
- package/dist/styles/css/tokens.css +609 -178
- package/dist/vscode.css-custom-data.json +556 -99
- package/dist/vscode.html-custom-data.json +1050 -480
- package/dist/web-types.json +3303 -1707
- package/dist-types/components/c-accordion/CAccordion.vue.d.ts +21 -25
- package/dist-types/components/c-accordion-item/CAccordionItem.vue.d.ts +13 -12
- package/dist-types/components/c-alert/CAlert.vue.d.ts +12 -17
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +124 -31
- package/dist-types/components/c-breadcrumb/CBreadcrumb.vue.d.ts +35 -0
- package/dist-types/components/c-breadcrumb/fit.d.ts +29 -0
- package/dist-types/components/c-breadcrumb-item/CBreadcrumbItem.vue.d.ts +31 -0
- package/dist-types/components/c-button/CButton.vue.d.ts +52 -63
- package/dist-types/components/c-button-group/CButtonGroup.vue.d.ts +16 -14
- package/dist-types/components/c-card/CCard.vue.d.ts +2 -3
- package/dist-types/components/c-card-actions/CCardActions.vue.d.ts +5 -7
- package/dist-types/components/c-card-title/CCardTitle.vue.d.ts +11 -1
- package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +33 -52
- package/dist-types/components/c-color-picker/CColorPicker.vue.d.ts +189 -0
- package/dist-types/components/c-color-picker/colors.d.ts +66 -0
- package/dist-types/components/c-csc-logo/CCscLogo.vue.d.ts +1 -3
- package/dist-types/components/c-data-table/CDataTable.vue.d.ts +75 -51
- package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +277 -0
- package/dist-types/components/c-date-picker/dates.d.ts +119 -0
- package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +51 -8
- package/dist-types/components/c-file-upload/CFileUpload.vue.d.ts +204 -0
- package/dist-types/components/c-file-upload/files.d.ts +99 -0
- package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +23 -36
- package/dist-types/components/c-input/CInput.vue.d.ts +21 -43
- package/dist-types/components/c-link/CLink.vue.d.ts +6 -14
- package/dist-types/components/c-list/CList.vue.d.ts +4 -6
- package/dist-types/components/c-list-item/CListItem.vue.d.ts +14 -19
- package/dist-types/components/c-list-item-title/CListItemTitle.vue.d.ts +3 -2
- package/dist-types/components/c-loader/CLoader.vue.d.ts +13 -29
- package/dist-types/components/c-login-button/CLoginButton.vue.d.ts +9 -9
- package/dist-types/components/c-login-card/CLoginCard.vue.d.ts +11 -16
- package/dist-types/components/c-login-card-actions/CLoginCardActions.vue.d.ts +5 -7
- package/dist-types/components/c-login-card-title/CLoginCardTitle.vue.d.ts +11 -1
- package/dist-types/components/c-main/CMain.vue.d.ts +12 -5
- package/dist-types/components/c-menu/CMenu.vue.d.ts +17 -16
- package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +27 -35
- package/dist-types/components/c-message/CMessage.vue.d.ts +5 -15
- package/dist-types/components/c-modal/CModal.vue.d.ts +3 -3
- package/dist-types/components/c-navigation-button/CNavigationButton.vue.d.ts +20 -1
- package/dist-types/components/c-number-field/CNumberField.vue.d.ts +169 -0
- package/dist-types/components/c-number-field/numbers.d.ts +58 -0
- package/dist-types/components/c-option/COption.vue.d.ts +1 -1
- package/dist-types/components/c-otp-input/COtpInput.vue.d.ts +16 -30
- package/dist-types/components/c-page/CPage.vue.d.ts +2 -3
- package/dist-types/components/c-pagination/CPagination.vue.d.ts +56 -26
- package/dist-types/components/c-popover/CPopover.vue.d.ts +11 -7
- package/dist-types/components/c-progress-bar/CProgressBar.vue.d.ts +10 -14
- package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +7 -7
- package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +11 -8
- package/dist-types/components/c-select/CSelect.vue.d.ts +119 -35
- package/dist-types/components/c-side-navigation/CSideNavigation.vue.d.ts +10 -18
- package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +22 -14
- package/dist-types/components/c-slider/CSlider.vue.d.ts +29 -73
- package/dist-types/components/c-spinner/CSpinner.vue.d.ts +4 -8
- package/dist-types/components/c-status/CStatus.vue.d.ts +8 -9
- package/dist-types/components/c-step/CStep.vue.d.ts +6 -4
- package/dist-types/components/c-steps/CSteps.vue.d.ts +3 -7
- package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +23 -17
- package/dist-types/components/c-switch/CSwitch.vue.d.ts +17 -30
- package/dist-types/components/c-tab/CTab.vue.d.ts +11 -28
- package/dist-types/components/c-tab-buttons/CTabButtons.vue.d.ts +11 -13
- package/dist-types/components/c-tab-item/CTabItem.vue.d.ts +4 -5
- package/dist-types/components/c-tab-items/CTabItems.vue.d.ts +5 -4
- package/dist-types/components/c-table/CTable.vue.d.ts +7 -7
- package/dist-types/components/c-tabs/CTabs.vue.d.ts +13 -20
- package/dist-types/components/c-tag/CTag.vue.d.ts +22 -21
- package/dist-types/components/c-tags/CTags.vue.d.ts +9 -10
- package/dist-types/components/c-text-field/CTextField.vue.d.ts +74 -77
- package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +205 -0
- package/dist-types/components/c-time-picker/times.d.ts +82 -0
- package/dist-types/components/c-toast/CToast.vue.d.ts +3 -4
- package/dist-types/components/c-toast/swipe.d.ts +40 -0
- package/dist-types/components/c-toasts/CToasts.vue.d.ts +14 -16
- package/dist-types/components/c-toolbar/CToolbar.vue.d.ts +10 -1
- package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +12 -8
- package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +257 -0
- package/dist-types/index.d.ts +41 -32
- package/dist-types/registry.d.ts +9 -0
- package/dist-types/shared/FieldMessage.vue.d.ts +8 -5
- package/dist-types/shared/PanelHeadingRow.vue.d.ts +13 -0
- package/dist-types/shared/SelectionIndicator.vue.d.ts +21 -0
- package/dist-types/shared/TypedField.vue.d.ts +48 -0
- package/dist-types/shared/appDefaults.d.ts +75 -0
- package/dist-types/shared/defineElement.d.ts +1 -0
- package/dist-types/shared/inputMask.d.ts +106 -0
- package/dist-types/shared/lightDismiss.d.ts +35 -0
- package/dist-types/shared/modalStack.d.ts +4 -3
- package/dist-types/shared/navigationDrawer.d.ts +4 -0
- package/dist-types/shared/optionLabel.d.ts +18 -0
- package/dist-types/shared/pageLock.d.ts +26 -0
- package/dist-types/shared/peekCap.d.ts +35 -0
- package/dist-types/shared/popoverChain.d.ts +13 -10
- package/dist-types/shared/positionArea.d.ts +9 -4
- package/dist-types/shared/reducedMotion.d.ts +10 -0
- package/dist-types/shared/selectAll.d.ts +29 -0
- package/dist-types/shared/splitMatches.d.ts +18 -0
- package/dist-types/shared/useAnchoredPanel.d.ts +107 -0
- package/dist-types/shared/useControlAttrs.d.ts +8 -0
- package/dist-types/shared/useDesignatedTrigger.d.ts +5 -4
- package/dist-types/shared/useFallbackPosition.d.ts +71 -0
- package/dist-types/shared/useHostEmit.d.ts +38 -0
- package/dist-types/shared/useIdReferences.d.ts +39 -0
- package/dist-types/shared/useKeyboardModality.d.ts +7 -0
- package/dist-types/shared/useNarrowViewport.d.ts +19 -0
- package/dist-types/shared/useScrollStrip.d.ts +39 -0
- package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
- package/dist-types/shared/useTypedField.d.ts +108 -0
- package/dist-types/shared/valueEvents.d.ts +41 -0
- package/dist-types/shared/visualViewport.d.ts +51 -0
- package/dist-types/tag-name-map.d.ts +1572 -672
- package/dist-types/theme/applyTheme.d.ts +6 -6
- package/dist-types/theme/chart-data.d.ts +51 -0
- package/dist-types/theme/ramp.d.ts +38 -0
- package/dist-types/theme/themeMode.d.ts +51 -0
- package/dist-types/types.d.ts +7 -11
- package/package.json +32 -21
- package/dist/css-anchor-positioning-fn-RTxo68pt.js +0 -6447
- package/dist/docs/c-toast/usage.md +0 -1
- package/dist-types/shared/anchorPolyfill.d.ts +0 -24
- package/dist-types/shared/emitModelValue.d.ts +0 -37
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Preferred placement of the tooltip relative to its trigger: the side, and
|
|
3
|
+
* `-start`/`-end` to align their edges on the cross axis.
|
|
4
|
+
*/
|
|
5
|
+
export type CTooltipPosition = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
6
|
+
interface CTooltipProps {
|
|
3
7
|
/**
|
|
4
8
|
* Delay before the tooltip shows on hover, in milliseconds. Keyboard focus
|
|
5
9
|
* shows the tooltip immediately, regardless of this value. Defaults to
|
|
6
10
|
* `400`.
|
|
7
11
|
*/
|
|
8
|
-
delay?: number
|
|
12
|
+
delay?: number;
|
|
9
13
|
/** Distance from the trigger to the tooltip, in pixels. Defaults to `4`. */
|
|
10
|
-
distance?: number
|
|
14
|
+
distance?: number;
|
|
11
15
|
/** Whether the tooltip is open. Two-way: emits `change:open`. */
|
|
12
16
|
open?: boolean;
|
|
13
17
|
/** Preferred placement of the tooltip relative to the trigger. */
|
|
14
|
-
position?:
|
|
18
|
+
position?: CTooltipPosition;
|
|
15
19
|
/**
|
|
16
20
|
* The tooltip text. Overridden by the `content` slot when that is
|
|
17
21
|
* populated.
|
|
@@ -33,10 +37,10 @@ export default _default;
|
|
|
33
37
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CTooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTooltipProps> & Readonly<{}>, {
|
|
34
38
|
text: string;
|
|
35
39
|
open: boolean;
|
|
36
|
-
distance: number
|
|
37
|
-
position:
|
|
40
|
+
distance: number;
|
|
41
|
+
position: CTooltipPosition;
|
|
38
42
|
trigger: HTMLElement | string;
|
|
39
|
-
delay: number
|
|
43
|
+
delay: number;
|
|
40
44
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
41
45
|
trigger?: (props: {}) => any;
|
|
42
46
|
} & {
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { CFieldSize } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom search predicate for `c-tree-select`. Receives the item, the query
|
|
4
|
+
* and the item's ancestors root-first; return `true` to list the item. The
|
|
5
|
+
* default matches the query case-insensitively anywhere in the `name` or
|
|
6
|
+
* `code` of the item or of any of its ancestors.
|
|
7
|
+
*/
|
|
8
|
+
export type CTreeSelectFilter = (item: CTreeSelectItem, query: string, path: CTreeSelectItem[]) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* One item of a `c-tree-select` tree. An item with a non-empty `children`
|
|
11
|
+
* array is a branch; any other item is a leaf. Values must be unique across
|
|
12
|
+
* the whole tree.
|
|
13
|
+
*/
|
|
14
|
+
export interface CTreeSelectItem {
|
|
15
|
+
/** Child items; present and non-empty for a branch. */
|
|
16
|
+
children?: CTreeSelectItem[];
|
|
17
|
+
/**
|
|
18
|
+
* Short code shown before the name and matched by the search (a
|
|
19
|
+
* classification number, say).
|
|
20
|
+
*/
|
|
21
|
+
code?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Disable the item: a disabled branch cannot be entered, a disabled leaf
|
|
24
|
+
* cannot be committed.
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** The item's label. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** The item's value, unique across the tree. */
|
|
30
|
+
value: number | string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The committed item as emitted with `return-object`: a fresh object — never
|
|
34
|
+
* the `items` entry itself — with its ancestors root-first and without
|
|
35
|
+
* `children`.
|
|
36
|
+
*/
|
|
37
|
+
export interface CTreeSelectSelection {
|
|
38
|
+
/** The committed item's code, when it has one. */
|
|
39
|
+
code?: string;
|
|
40
|
+
/** The committed item's label. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** The committed item's ancestors, root-first. */
|
|
43
|
+
path: Array<{
|
|
44
|
+
code?: string;
|
|
45
|
+
name: string;
|
|
46
|
+
value: number | string;
|
|
47
|
+
}>;
|
|
48
|
+
/** The committed item's value. */
|
|
49
|
+
value: number | string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* UI texts of `c-tree-select`, shallow-merged over the English defaults.
|
|
53
|
+
* Static labels are strings; interpolated ones are functions.
|
|
54
|
+
*/
|
|
55
|
+
export interface CTreeSelectTexts {
|
|
56
|
+
/** Accessible label of the breadcrumb navigation in the panel. */
|
|
57
|
+
breadcrumb?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Label of the "Browse instead" control shown in the header while a query
|
|
60
|
+
* is typed.
|
|
61
|
+
*/
|
|
62
|
+
browse?: string;
|
|
63
|
+
/** Meta text on a branch row; receives its number of children. */
|
|
64
|
+
children?: (count: number) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Header text in browse mode; receives the label of the level being
|
|
67
|
+
* listed.
|
|
68
|
+
*/
|
|
69
|
+
choose?: (levelLabel: string) => string;
|
|
70
|
+
/** Accessible label of the clear button. */
|
|
71
|
+
clearSelection?: string;
|
|
72
|
+
/** Accessible label of the close button in the fullscreen panel (narrow viewports). */
|
|
73
|
+
closePanel?: string;
|
|
74
|
+
/** Accessible label of the search input inside the panel. */
|
|
75
|
+
filterOptions?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Header text of a level whose rows are all leaves in an unevenly deep
|
|
78
|
+
* tree (an evenly deep tree shows the step counter instead).
|
|
79
|
+
*/
|
|
80
|
+
final?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Default label of level `n` (1 = the top level) when `level-labels` gives
|
|
83
|
+
* none.
|
|
84
|
+
*/
|
|
85
|
+
level?: (n: number) => string;
|
|
86
|
+
/**
|
|
87
|
+
* Header level counter shown while the tree is evenly deep (every leaf at
|
|
88
|
+
* one level); receives the level and the number of levels.
|
|
89
|
+
*/
|
|
90
|
+
levelCounter?: (n: number, total: number) => string;
|
|
91
|
+
/** Header text in search mode; receives the number of matches. */
|
|
92
|
+
matches?: (count: number) => string;
|
|
93
|
+
/** Text of the row shown when nothing is listed. */
|
|
94
|
+
noResults?: string;
|
|
95
|
+
/** Label of the root crumb. */
|
|
96
|
+
root?: string;
|
|
97
|
+
/** Placeholder of the search input when the `placeholder` prop is empty. */
|
|
98
|
+
searchPlaceholder?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Label of the pinned select-branch row; receives the current branch's
|
|
101
|
+
* name.
|
|
102
|
+
*/
|
|
103
|
+
selectBranch?: (name: string) => string;
|
|
104
|
+
/** Accessible label of the chevron button that opens and closes the panel. */
|
|
105
|
+
toggleOptions?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Selection value of `c-tree-select`: the committed item's value — or a
|
|
109
|
+
* {@link CTreeSelectSelection} with `return-object` — and `null` when
|
|
110
|
+
* cleared.
|
|
111
|
+
*/
|
|
112
|
+
export type CTreeSelectValue = CTreeSelectSelection | null | number | string;
|
|
113
|
+
interface CTreeSelectProps {
|
|
114
|
+
/**
|
|
115
|
+
* Let a branch be committed as the value: a pinned select-branch row heads
|
|
116
|
+
* every level below the root, and matching branches are listed as search
|
|
117
|
+
* results
|
|
118
|
+
*/
|
|
119
|
+
allowBranch?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Make the selected value clearable
|
|
122
|
+
*/
|
|
123
|
+
clearable?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Disable the field
|
|
126
|
+
*/
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Error message shown in place of the hint while the field is invalid
|
|
130
|
+
*
|
|
131
|
+
* @freeform
|
|
132
|
+
*/
|
|
133
|
+
errorMessage?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Custom search predicate; receives the item, the query and the item's
|
|
136
|
+
* ancestors. Functions have no attribute form — bind as a DOM property
|
|
137
|
+
*/
|
|
138
|
+
filter?: CTreeSelectFilter;
|
|
139
|
+
/**
|
|
140
|
+
* Hide the hint and error messages
|
|
141
|
+
*
|
|
142
|
+
* @defaultable false
|
|
143
|
+
*/
|
|
144
|
+
hideDetails?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Hint text for the field
|
|
147
|
+
*
|
|
148
|
+
* @freeform
|
|
149
|
+
*/
|
|
150
|
+
hint?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Show the control as invalid: its `error-message`, when set, replaces the
|
|
153
|
+
* hint, and the control is marked `aria-invalid`.
|
|
154
|
+
*/
|
|
155
|
+
invalid?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* The tree to pick from. Arrays have no attribute form — bind as a DOM
|
|
158
|
+
* property (`:items.prop` in Vue)
|
|
159
|
+
*/
|
|
160
|
+
items?: CTreeSelectItem[];
|
|
161
|
+
/**
|
|
162
|
+
* Items per page before the list scrolls
|
|
163
|
+
*
|
|
164
|
+
* @defaultable 6
|
|
165
|
+
*/
|
|
166
|
+
itemsPerPage?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Element label
|
|
169
|
+
*
|
|
170
|
+
* @freeform
|
|
171
|
+
*/
|
|
172
|
+
label?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Label on top of the field
|
|
175
|
+
*
|
|
176
|
+
* @defaultable false
|
|
177
|
+
*/
|
|
178
|
+
labelOnTop?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Names of the levels, top level first, shown in the panel header; a
|
|
181
|
+
* missing entry falls back to `texts.level(n)`. Arrays have no attribute
|
|
182
|
+
* form — bind as a DOM property
|
|
183
|
+
*/
|
|
184
|
+
levelLabels?: string[];
|
|
185
|
+
/**
|
|
186
|
+
* Input field name
|
|
187
|
+
*
|
|
188
|
+
* @freeform
|
|
189
|
+
*/
|
|
190
|
+
name?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Placeholder for the search input inside the panel
|
|
193
|
+
*
|
|
194
|
+
* @freeform
|
|
195
|
+
*/
|
|
196
|
+
placeholder?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Set the field as required
|
|
199
|
+
*/
|
|
200
|
+
required?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Emit the committed item with its path as a `CTreeSelectSelection` instead
|
|
203
|
+
* of its value
|
|
204
|
+
*/
|
|
205
|
+
returnObject?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Shadow variant
|
|
208
|
+
*
|
|
209
|
+
* @defaultable false
|
|
210
|
+
*/
|
|
211
|
+
shadow?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Field height: the 52px default (the shared control height) or the 36px `small` box
|
|
214
|
+
*
|
|
215
|
+
* @defaultable 'default'
|
|
216
|
+
*/
|
|
217
|
+
size?: CFieldSize;
|
|
218
|
+
/**
|
|
219
|
+
* UI text overrides (i18n), merged over the English defaults. Objects have
|
|
220
|
+
* no attribute form — bind as a DOM property (`:texts.prop` in Vue)
|
|
221
|
+
*
|
|
222
|
+
* @defaultable {}
|
|
223
|
+
*/
|
|
224
|
+
texts?: CTreeSelectTexts;
|
|
225
|
+
/**
|
|
226
|
+
* Selected value: the committed item's value, or the `CTreeSelectSelection`
|
|
227
|
+
* with `return-object`; `null` when nothing is selected
|
|
228
|
+
*/
|
|
229
|
+
value?: CTreeSelectValue;
|
|
230
|
+
}
|
|
231
|
+
declare const _default: typeof __VLS_export;
|
|
232
|
+
export default _default;
|
|
233
|
+
declare const __VLS_export: import("vue").DefineComponent<CTreeSelectProps, {
|
|
234
|
+
focus: (options?: FocusOptions) => void;
|
|
235
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTreeSelectProps> & Readonly<{}>, {
|
|
236
|
+
label: string;
|
|
237
|
+
filter: CTreeSelectFilter;
|
|
238
|
+
invalid: boolean;
|
|
239
|
+
name: string;
|
|
240
|
+
value: CTreeSelectValue;
|
|
241
|
+
itemsPerPage: number;
|
|
242
|
+
size: CFieldSize;
|
|
243
|
+
texts: CTreeSelectTexts;
|
|
244
|
+
hideDetails: boolean;
|
|
245
|
+
labelOnTop: boolean;
|
|
246
|
+
shadow: boolean;
|
|
247
|
+
clearable: boolean;
|
|
248
|
+
disabled: boolean;
|
|
249
|
+
errorMessage: string;
|
|
250
|
+
hint: string;
|
|
251
|
+
items: CTreeSelectItem[];
|
|
252
|
+
placeholder: string;
|
|
253
|
+
required: boolean;
|
|
254
|
+
returnObject: boolean;
|
|
255
|
+
allowBranch: boolean;
|
|
256
|
+
levelLabels: string[];
|
|
257
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,41 +1,50 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type {
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
13
|
-
export type {
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
18
|
-
export type {
|
|
19
|
-
export type {
|
|
20
|
-
export type {
|
|
21
|
-
export type {
|
|
1
|
+
export type { CAccordionValue } from './components/c-accordion/CAccordion.vue';
|
|
2
|
+
export type { CAlertType } from './components/c-alert/CAlert.vue';
|
|
3
|
+
export type { CAutocompleteFilter, CAutocompleteItem, CAutocompleteOption, CAutocompleteTexts, CAutocompleteValue, } from './components/c-autocomplete/CAutocomplete.vue';
|
|
4
|
+
export type { CBreadcrumbTexts } from './components/c-breadcrumb/CBreadcrumb.vue';
|
|
5
|
+
export type { CButtonGroupSize, CButtonGroupValue, } from './components/c-button-group/CButtonGroup.vue';
|
|
6
|
+
export type { CButtonSize, CButtonType, } from './components/c-button/CButton.vue';
|
|
7
|
+
export type { CCardActionsAlign, CCardActionsJustify, } from './components/c-card-actions/CCardActions.vue';
|
|
8
|
+
export type { CColorPickerFormat, CColorPickerSwatch, CColorPickerTexts, CColorPickerValue, } from './components/c-color-picker/CColorPicker.vue';
|
|
9
|
+
export type { CDataTableAlign, CDataTableCellContent, CDataTableCellContext, CDataTableColumn, CDataTableColumnExpansion, CDataTableColumnPin, CDataTableExpandedContext, CDataTableFooterContext, CDataTableRow, CDataTableSelectionMode, CDataTableSort, CDataTableSortDirection, CDataTableTexts, } from './components/c-data-table/CDataTable.vue';
|
|
10
|
+
export type { CDatePickerDisabledDate, CDatePickerRange, CDatePickerText, CDatePickerTexts, CDatePickerType, CDatePickerValue, CDatePickerWeekday, } from './components/c-date-picker/CDatePicker.vue';
|
|
11
|
+
export type { CFileUploadContext, CFileUploadEntry, CFileUploadFunction, CFileUploadRejection, CFileUploadRejectReason, CFileUploadStatus, CFileUploadTexts, } from './components/c-file-upload/CFileUpload.vue';
|
|
12
|
+
export type { CIconButtonSize } from './components/c-icon-button/CIconButton.vue';
|
|
13
|
+
export type { CLoginCardActionsAlign, CLoginCardActionsJustify, } from './components/c-login-card-actions/CLoginCardActions.vue';
|
|
14
|
+
export type { CLoginCardBlendMode } from './components/c-login-card/CLoginCard.vue';
|
|
15
|
+
export type { CMenuItemType } from './components/c-menu-item/CMenuItem.vue';
|
|
16
|
+
export type { CMenuPosition } from './components/c-menu/CMenu.vue';
|
|
17
|
+
export type { CNavigationButtonTexts } from './components/c-navigation-button/CNavigationButton.vue';
|
|
18
|
+
export type { CNumberFieldTexts } from './components/c-number-field/CNumberField.vue';
|
|
19
|
+
export type { CPaginationOptions, CPaginationSize, CPaginationTexts, } from './components/c-pagination/CPagination.vue';
|
|
20
|
+
export type { CPopoverPosition } from './components/c-popover/CPopover.vue';
|
|
21
|
+
export type { CSelectTexts, CSelectValue, } from './components/c-select/CSelect.vue';
|
|
22
|
+
export type { CStatusType } from './components/c-status/CStatus.vue';
|
|
23
|
+
export type { CTabButtonsSize } from './components/c-tab-buttons/CTabButtons.vue';
|
|
24
|
+
export type { CTabsJustify } from './components/c-tabs/CTabs.vue';
|
|
25
|
+
export type { CTagSize } from './components/c-tag/CTag.vue';
|
|
26
|
+
export type { CTagsSize } from './components/c-tags/CTags.vue';
|
|
27
|
+
export type { CTextFieldAutocapitalize, CTextFieldType, } from './components/c-text-field/CTextField.vue';
|
|
28
|
+
export type { CTimePickerRange, CTimePickerText, CTimePickerTexts, CTimePickerValue, } from './components/c-time-picker/CTimePicker.vue';
|
|
29
|
+
export type { CToastsHorizontal, CToastsVertical, } from './components/c-toasts/CToasts.vue';
|
|
30
|
+
export type { CTooltipPosition } from './components/c-tooltip/CTooltip.vue';
|
|
31
|
+
export type { CTreeSelectFilter, CTreeSelectItem, CTreeSelectSelection, CTreeSelectTexts, CTreeSelectValue, } from './components/c-tree-select/CTreeSelect.vue';
|
|
32
|
+
export { applyDefaults, DEFAULTABLE_PROPS, resetDefaults, } from './shared/appDefaults';
|
|
33
|
+
export type { CAppDefaults, CDefaultableTag } from './shared/appDefaults';
|
|
22
34
|
export type * from './tag-name-map';
|
|
23
35
|
export { applyTheme, resetTheme, themeToCss } from './theme/applyTheme';
|
|
24
|
-
export type {
|
|
25
|
-
export
|
|
36
|
+
export type { CFamily, CThemeSeeds } from './theme/applyTheme';
|
|
37
|
+
export { chartAnatomy, chartAnatomyHex, chartSlots, chartSlotsHex, } from './theme/chart-data';
|
|
38
|
+
export type { CChartAnatomy, CChartSlots } from './theme/chart-data';
|
|
39
|
+
export { DEFAULT_SEEDS, FAMILIES } from './theme/ramp.js';
|
|
40
|
+
export { observeThemeMode, themeMode } from './theme/themeMode';
|
|
41
|
+
export type { CThemeMode } from './theme/themeMode';
|
|
42
|
+
export type { CFieldSize, CSelectItem, CToastMessage, CToastType, } from './types';
|
|
26
43
|
export { h } from 'vue';
|
|
27
44
|
export type { VNode, VNodeChild } from 'vue';
|
|
28
45
|
/**
|
|
29
|
-
* Register
|
|
46
|
+
* Register every component as a custom element. Idempotent; safe
|
|
30
47
|
* to call multiple times. Tags already defined (e.g. by the Stencil
|
|
31
48
|
* loader) are skipped silently.
|
|
32
49
|
*/
|
|
33
50
|
export declare function defineCustomElements(): void;
|
|
34
|
-
/** List of tags this package will register. Useful for docs/tests. */
|
|
35
|
-
export declare const migratedTags: ReadonlyArray<string>;
|
|
36
|
-
/**
|
|
37
|
-
* Tags converted to the tailwind-variants styling system.
|
|
38
|
-
* Append a tag as each component is migrated. Used by the docs to mark
|
|
39
|
-
* conversion progress in the side navigation.
|
|
40
|
-
*/
|
|
41
|
-
export declare const tailwindVariantTags: ReadonlyArray<string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map of custom-element tag → Vue SFC component: the single source of truth
|
|
3
|
+
* for what `csc-ui` registers, internal tags included, in registration order.
|
|
4
|
+
* Not part of the package entry (the manifest lists the public tags); the
|
|
5
|
+
* conformance suites enrol every tag from it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const components: ReadonlyArray<readonly [string, unknown]>;
|
|
8
|
+
/** Every tag `defineCustomElements()` registers, internal ones included. */
|
|
9
|
+
export declare const registeredTags: ReadonlyArray<string>;
|
|
@@ -3,19 +3,22 @@ interface FieldMessageProps {
|
|
|
3
3
|
errorMessage?: string;
|
|
4
4
|
/** Suppress the whole message area (no reserved height either). */
|
|
5
5
|
hideDetails?: boolean;
|
|
6
|
-
/** Neutral helper text shown
|
|
6
|
+
/** Neutral helper text, shown unless the control is invalid with an error message. */
|
|
7
7
|
hint?: string;
|
|
8
|
+
/** The host control is invalid: the error message, when set, replaces the hint. */
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
/** The field's label sits on top of it (c-input's `label-on-top`). */
|
|
11
|
+
labelOnTop?: boolean;
|
|
8
12
|
/** Part name stamped on the message area (`message` unless the host reserves it). */
|
|
9
13
|
part?: string;
|
|
10
|
-
/** Host control's validity; `false` switches to the error message when one is supplied. */
|
|
11
|
-
valid?: boolean;
|
|
12
14
|
}
|
|
13
15
|
declare const __VLS_export: import("vue").DefineComponent<FieldMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FieldMessageProps> & Readonly<{}>, {
|
|
16
|
+
invalid: boolean;
|
|
14
17
|
part: string;
|
|
15
|
-
errorMessage: string;
|
|
16
18
|
hideDetails: boolean;
|
|
19
|
+
labelOnTop: boolean;
|
|
20
|
+
errorMessage: string;
|
|
17
21
|
hint: string;
|
|
18
|
-
valid: boolean;
|
|
19
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
23
|
declare const _default: typeof __VLS_export;
|
|
21
24
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Accessible label of the close button. */
|
|
3
|
+
closeLabel: string;
|
|
4
|
+
/** The field's label, shown as the panel heading. */
|
|
5
|
+
heading: string;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
close: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onClose?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface SelectionIndicatorProps {
|
|
2
|
+
/** Fill the box and show the check glyph. */
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
/** Paint the disabled colour channel. */
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Paint the error colour channel (box unless disabled; mark always). */
|
|
7
|
+
error?: boolean;
|
|
8
|
+
/** Render the keyboard focus halo pseudo-element for the host to reveal. */
|
|
9
|
+
focusHalo?: boolean;
|
|
10
|
+
/** Fill the box and show the indeterminate bar (wins over `checked`). */
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<SelectionIndicatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SelectionIndicatorProps> & Readonly<{}>, {
|
|
14
|
+
error: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
checked: boolean;
|
|
17
|
+
indeterminate: boolean;
|
|
18
|
+
focusHalo: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CFieldSize } from '../types';
|
|
2
|
+
import { type TypedField } from './useTypedField';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** The `anchor-name` style from `useAnchoredPanel`. */
|
|
5
|
+
anchorStyle: string;
|
|
6
|
+
clearable: boolean;
|
|
7
|
+
/** Accessible label of the clear button. */
|
|
8
|
+
clearLabel: string;
|
|
9
|
+
/** The host's ARIA attributes, for the inputs (`useControlAttrs`). */
|
|
10
|
+
controlAttrs: Record<string, unknown>;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
errorMessage: string;
|
|
13
|
+
/** The `useTypedField` state this field renders. */
|
|
14
|
+
field: TypedField;
|
|
15
|
+
hideDetails: boolean;
|
|
16
|
+
hint: string;
|
|
17
|
+
inputId: string;
|
|
18
|
+
/** The virtual keyboard the inputs ask for. */
|
|
19
|
+
inputmode: 'numeric' | 'text';
|
|
20
|
+
invalid: boolean;
|
|
21
|
+
label: string;
|
|
22
|
+
labelOnTop: boolean;
|
|
23
|
+
name: string;
|
|
24
|
+
/** Whether the host's panel is open — the field stays active. */
|
|
25
|
+
open: boolean;
|
|
26
|
+
required: boolean;
|
|
27
|
+
shadow: boolean;
|
|
28
|
+
size: CFieldSize;
|
|
29
|
+
};
|
|
30
|
+
declare var __VLS_25: {
|
|
31
|
+
buttonSize: "x-small";
|
|
32
|
+
iconSize: number;
|
|
33
|
+
} | {
|
|
34
|
+
buttonSize: "default";
|
|
35
|
+
iconSize: number;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_Slots = {} & {
|
|
38
|
+
trigger?: (props: typeof __VLS_25) => any;
|
|
39
|
+
};
|
|
40
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-wide prop defaults (ADR-0048).
|
|
3
|
+
*
|
|
4
|
+
* A consumer sets a *defaultable* prop once for every instance of a tag —
|
|
5
|
+
* `labelOnTop` on every text field, one `texts` translation per list field —
|
|
6
|
+
* instead of repeating it per instance:
|
|
7
|
+
*
|
|
8
|
+
* applyDefaults({ 'c-text-field': { labelOnTop: true } });
|
|
9
|
+
*
|
|
10
|
+
* Only props tagged `@defaultable <built-in>` in their SFC take part; the
|
|
11
|
+
* analyzer derives the `CAppDefaults` type and the `DEFAULTABLE_PROPS`
|
|
12
|
+
* allow-list from those tags (src/tag-name-map.ts). Each such prop declares
|
|
13
|
+
* `undefined` in `withDefaults` — so "unset" is observable — and resolves
|
|
14
|
+
* through `useAppDefault` below, in this order:
|
|
15
|
+
*
|
|
16
|
+
* host attribute → own property (non-nullish) → app default → built-in
|
|
17
|
+
*
|
|
18
|
+
* Why the host attribute comes first — two Vue `defineCustomElement` quirks:
|
|
19
|
+
* 1. A Boolean prop supplied via *attribute* (`<c-select hide-details>`)
|
|
20
|
+
* has been observed to reset to its default on the wrapper's re-render
|
|
21
|
+
* (it re-renders on every value change): the host attribute persists,
|
|
22
|
+
* but the prop flips. The attribute is the stable signal.
|
|
23
|
+
* 2. Binding `hide-details` to a nested `c-input` in a template is mangled
|
|
24
|
+
* on update — the key matches c-input's declared prop, so Vue treats it
|
|
25
|
+
* as a property, and the reset above reflects back out and removes the
|
|
26
|
+
* attribute. Wrappers therefore forward it through a plain
|
|
27
|
+
* `data-hide-details` attribute (no declared-prop collision, so Vue
|
|
28
|
+
* patches it reliably) that c-input reads back.
|
|
29
|
+
* Property writes reflect to attributes as well (`el.size = 'small'` writes
|
|
30
|
+
* `size="small"`, `el.labelOnTop = false` removes the attribute), so one
|
|
31
|
+
* attribute-first order is sound for Booleans, strings and numbers alike.
|
|
32
|
+
*
|
|
33
|
+
* The registry is a module-level `reactive()` object and every resolved
|
|
34
|
+
* computed depends on it, so a later `applyDefaults()` re-renders mounted
|
|
35
|
+
* elements (runtime language switching). Not provide/inject: the library
|
|
36
|
+
* coordinates through module singletons (modalStack, popoverChain,
|
|
37
|
+
* applyTheme), and a per-element app context would not be live for trees
|
|
38
|
+
* that are already mounted.
|
|
39
|
+
*/
|
|
40
|
+
import { type ComputedRef } from 'vue';
|
|
41
|
+
import { type CAppDefaults } from '../tag-name-map';
|
|
42
|
+
export type { CAppDefaults } from '../tag-name-map';
|
|
43
|
+
export { DEFAULTABLE_PROPS } from '../tag-name-map';
|
|
44
|
+
/** A tag with at least one defaultable prop. */
|
|
45
|
+
export type CDefaultableTag = keyof CAppDefaults;
|
|
46
|
+
type Bucket<T extends CDefaultableTag> = NonNullable<CAppDefaults[T]>;
|
|
47
|
+
/** The value a resolved prop takes: the element member type, made required. */
|
|
48
|
+
type Resolved<T extends CDefaultableTag, K extends keyof Bucket<T>> = Required<NonNullable<Bucket<T>[K]>>;
|
|
49
|
+
/**
|
|
50
|
+
* Set app-wide defaults. Merges with previously applied defaults tag by tag;
|
|
51
|
+
* a key set to `undefined` clears that key. An object prop (`texts`) is stored
|
|
52
|
+
* whole and merged key by key with the built-in and per-instance texts at each
|
|
53
|
+
* element. Live: mounted elements re-render. No-op outside the browser — a
|
|
54
|
+
* module-level registry must not leak across server requests, and custom
|
|
55
|
+
* elements never render on the server.
|
|
56
|
+
*/
|
|
57
|
+
export declare function applyDefaults(defaults: CAppDefaults): void;
|
|
58
|
+
/** Clear the app-wide defaults of the given tags, or of every tag when omitted. */
|
|
59
|
+
export declare function resetDefaults(tags?: CDefaultableTag[]): void;
|
|
60
|
+
/**
|
|
61
|
+
* Per-instance resolver for defaultable props. Call once in setup, then one
|
|
62
|
+
* line per prop:
|
|
63
|
+
*
|
|
64
|
+
* const appDefault = useAppDefault('c-text-field', props);
|
|
65
|
+
* const labelOnTopResolved = appDefault('labelOnTop', false);
|
|
66
|
+
*
|
|
67
|
+
* Scalars: host attribute → own property (non-nullish) → app default →
|
|
68
|
+
* built-in, with Boolean coercion applied *after* the layer is chosen
|
|
69
|
+
* (`coerceBoolean(undefined)` is `false` and would swallow the fallthrough).
|
|
70
|
+
* Objects (`texts`): per-key merge, built-in ← app default ← own.
|
|
71
|
+
*
|
|
72
|
+
* A nullish own value counts as "unset" (Vue itself treats `null` as an
|
|
73
|
+
* explicit value; here it falls through to the app default).
|
|
74
|
+
*/
|
|
75
|
+
export declare const useAppDefault: <T extends CDefaultableTag>(tag: T, props: object) => <K extends keyof Bucket<T> & string>(key: K, builtIn: Resolved<T, K>) => ComputedRef<Resolved<T, K>>;
|