@cscfi/csc-ui 4.0.0-alpha.3 → 4.0.0-alpha.31

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.
Files changed (115) hide show
  1. package/dist/csc-ui.js +14305 -8019
  2. package/dist/custom-elements.json +8952 -4605
  3. package/dist/docs/c-alert/usage.md +24 -0
  4. package/dist/docs/c-autocomplete/usage.md +152 -0
  5. package/dist/docs/c-breadcrumb/usage.md +104 -0
  6. package/dist/docs/c-breadcrumb-item/usage.md +1 -0
  7. package/dist/docs/c-button-group/usage.md +14 -1
  8. package/dist/docs/c-checkbox/usage.md +53 -0
  9. package/dist/docs/c-date-picker/usage.md +224 -0
  10. package/dist/docs/c-main/usage.md +21 -1
  11. package/dist/docs/c-menu/usage.md +15 -0
  12. package/dist/docs/c-menu-item/usage.md +6 -0
  13. package/dist/docs/c-number-field/usage.md +112 -0
  14. package/dist/docs/c-option-value/usage.md +1 -0
  15. package/dist/docs/c-popover/usage.md +33 -0
  16. package/dist/docs/c-progress-bar/usage.md +23 -0
  17. package/dist/docs/c-progress-circle/usage.md +25 -0
  18. package/dist/docs/c-radio/usage.md +45 -0
  19. package/dist/docs/c-radio-group/usage.md +67 -0
  20. package/dist/docs/c-select/usage.md +127 -0
  21. package/dist/docs/c-side-navigation/usage.md +21 -0
  22. package/dist/docs/c-spinner/usage.md +21 -0
  23. package/dist/docs/c-switch/usage.md +36 -0
  24. package/dist/docs/c-tab-buttons/usage.md +7 -0
  25. package/dist/docs/c-table/usage.md +14 -0
  26. package/dist/docs/c-text-field/usage.md +106 -0
  27. package/dist/docs/c-time-picker/usage.md +170 -0
  28. package/dist/docs/c-toolbar/usage.md +17 -0
  29. package/dist/docs/c-tooltip/usage.md +30 -0
  30. package/dist/docs/c-tree-select/usage.md +156 -0
  31. package/dist/floating-ui.dom-DvzxEaDJ.js +1292 -0
  32. package/dist/styles/css/tailwind-theme.css +33 -0
  33. package/dist/styles/css/tokens.css +719 -197
  34. package/dist/vscode.css-custom-data.json +474 -20
  35. package/dist/vscode.html-custom-data.json +659 -57
  36. package/dist/web-types.json +2813 -697
  37. package/dist-types/components/c-alert/CAlert.vue.d.ts +18 -4
  38. package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +118 -21
  39. package/dist-types/components/c-breadcrumb/CBreadcrumb.vue.d.ts +35 -0
  40. package/dist-types/components/c-breadcrumb/fit.d.ts +29 -0
  41. package/dist-types/components/c-breadcrumb-item/CBreadcrumbItem.vue.d.ts +31 -0
  42. package/dist-types/components/c-button/CButton.vue.d.ts +4 -4
  43. package/dist-types/components/c-button-group/CButtonGroup.vue.d.ts +1 -1
  44. package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +3 -3
  45. package/dist-types/components/c-data-table/CDataTable.vue.d.ts +6 -2
  46. package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +282 -0
  47. package/dist-types/components/c-date-picker/dates.d.ts +119 -0
  48. package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +50 -7
  49. package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +1 -1
  50. package/dist-types/components/c-input/CInput.vue.d.ts +6 -6
  51. package/dist-types/components/c-list-item/CListItem.vue.d.ts +1 -1
  52. package/dist-types/components/c-main/CMain.vue.d.ts +10 -2
  53. package/dist-types/components/c-menu/CMenu.vue.d.ts +13 -3
  54. package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +30 -3
  55. package/dist-types/components/c-number-field/CNumberField.vue.d.ts +174 -0
  56. package/dist-types/components/c-number-field/numbers.d.ts +58 -0
  57. package/dist-types/components/c-otp-input/COtpInput.vue.d.ts +1 -1
  58. package/dist-types/components/c-pagination/CPagination.vue.d.ts +1 -1
  59. package/dist-types/components/c-popover/CPopover.vue.d.ts +43 -0
  60. package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +32 -0
  61. package/dist-types/components/c-radio/CRadio.vue.d.ts +7 -11
  62. package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +10 -48
  63. package/dist-types/components/c-select/CSelect.vue.d.ts +115 -27
  64. package/dist-types/components/c-side-navigation/CSideNavigation.vue.d.ts +1 -1
  65. package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +1 -1
  66. package/dist-types/components/c-slider/CSlider.vue.d.ts +3 -3
  67. package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +1 -1
  68. package/dist-types/components/c-tab-buttons/CTabButtons.vue.d.ts +1 -1
  69. package/dist-types/components/c-table/CTable.vue.d.ts +11 -1
  70. package/dist-types/components/c-table/injectTableStyles.d.ts +1 -0
  71. package/dist-types/components/c-tag/CTag.vue.d.ts +7 -0
  72. package/dist-types/components/c-tags/CTags.vue.d.ts +1 -1
  73. package/dist-types/components/c-text-field/CTextField.vue.d.ts +27 -10
  74. package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +210 -0
  75. package/dist-types/components/c-time-picker/times.d.ts +82 -0
  76. package/dist-types/components/c-toasts/CToasts.vue.d.ts +1 -1
  77. package/dist-types/components/c-toolbar/CToolbar.vue.d.ts +10 -1
  78. package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +49 -0
  79. package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +261 -0
  80. package/dist-types/index.d.ts +19 -2
  81. package/dist-types/shared/FieldMessage.vue.d.ts +21 -0
  82. package/dist-types/shared/PanelHeadingRow.vue.d.ts +13 -0
  83. package/dist-types/shared/SelectionIndicator.vue.d.ts +21 -0
  84. package/dist-types/shared/TypedField.vue.d.ts +46 -0
  85. package/dist-types/shared/appDefaults.d.ts +75 -0
  86. package/dist-types/shared/defineElement.d.ts +1 -0
  87. package/dist-types/shared/inputMask.d.ts +106 -0
  88. package/dist-types/shared/lightDismiss.d.ts +35 -0
  89. package/dist-types/shared/modalStack.d.ts +4 -3
  90. package/dist-types/shared/optionLabel.d.ts +18 -0
  91. package/dist-types/shared/pageLock.d.ts +26 -0
  92. package/dist-types/shared/peekCap.d.ts +35 -0
  93. package/dist-types/shared/popoverChain.d.ts +65 -0
  94. package/dist-types/shared/positionArea.d.ts +13 -0
  95. package/dist-types/shared/reducedMotion.d.ts +10 -0
  96. package/dist-types/shared/selectAll.d.ts +29 -0
  97. package/dist-types/shared/splitMatches.d.ts +18 -0
  98. package/dist-types/shared/useAnchoredPanel.d.ts +102 -0
  99. package/dist-types/shared/useDesignatedTrigger.d.ts +41 -0
  100. package/dist-types/shared/useFallbackPosition.d.ts +63 -0
  101. package/dist-types/shared/useHostStates.d.ts +25 -0
  102. package/dist-types/shared/useKeyboardModality.d.ts +7 -0
  103. package/dist-types/shared/useNarrowViewport.d.ts +19 -0
  104. package/dist-types/shared/useScrollStrip.d.ts +39 -0
  105. package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
  106. package/dist-types/shared/useTypedField.d.ts +103 -0
  107. package/dist-types/shared/visualViewport.d.ts +51 -0
  108. package/dist-types/tag-name-map.d.ts +769 -54
  109. package/dist-types/theme/chart-data.d.ts +51 -0
  110. package/dist-types/theme/ramp.d.ts +38 -0
  111. package/dist-types/theme/themeMode.d.ts +51 -0
  112. package/dist-types/types.d.ts +7 -0
  113. package/package.json +21 -9
  114. package/dist/css-anchor-positioning-fn-RTxo68pt.js +0 -6447
  115. package/dist-types/shared/anchorPolyfill.d.ts +0 -24
@@ -0,0 +1,174 @@
1
+ import type { CFieldSize } from '../../types';
2
+ export interface CNumberFieldProps {
3
+ /**
4
+ * The most fraction digits the field takes; `0` makes it an integer field
5
+ *
6
+ * @defaultable 0
7
+ */
8
+ decimals?: number;
9
+ /**
10
+ * The decimal separator. Empty follows the page's `lang` (`,` for `fi`, `.` for `en`)
11
+ *
12
+ * @defaultable ''
13
+ * @freeform one character
14
+ */
15
+ decimalSeparator?: string;
16
+ /**
17
+ * Disable the field
18
+ */
19
+ disabled?: boolean;
20
+ /**
21
+ * Error message shown in place of the hint while the field is invalid
22
+ *
23
+ * @freeform
24
+ */
25
+ errorMessage?: string;
26
+ /**
27
+ * Pad the fraction to exactly `decimals` digits when the field is left (`12,5` → `12,50`)
28
+ *
29
+ * @defaultable false
30
+ */
31
+ fixedDecimals?: boolean;
32
+ /**
33
+ * The thousands separator. Empty follows the page's `lang` (a space for `fi`, `,` for `en`)
34
+ *
35
+ * @defaultable ''
36
+ * @freeform one character
37
+ */
38
+ groupSeparator?: string;
39
+ /**
40
+ * Hide the hint and error messages
41
+ *
42
+ * @defaultable false
43
+ */
44
+ hideDetails?: boolean;
45
+ /**
46
+ * Hint text for the field
47
+ *
48
+ * @freeform
49
+ */
50
+ hint?: string;
51
+ /**
52
+ * Id of the input
53
+ *
54
+ * @freeform
55
+ */
56
+ hostId?: string;
57
+ /**
58
+ * Label of the field
59
+ *
60
+ * @freeform
61
+ */
62
+ label?: string;
63
+ /**
64
+ * Label on top of the field
65
+ *
66
+ * @defaultable false
67
+ */
68
+ labelOnTop?: boolean;
69
+ /**
70
+ * The largest number in range; a larger one is kept and reported as out of range
71
+ */
72
+ max?: null | number;
73
+ /**
74
+ * 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
75
+ */
76
+ min?: null | number;
77
+ /**
78
+ * Name of the input
79
+ *
80
+ * @freeform
81
+ */
82
+ name?: string;
83
+ /**
84
+ * Placeholder of the input
85
+ *
86
+ * @freeform
87
+ */
88
+ placeholder?: string;
89
+ /**
90
+ * Mark as readonly
91
+ */
92
+ readonly?: boolean;
93
+ /**
94
+ * Set the field as required
95
+ */
96
+ required?: boolean;
97
+ /**
98
+ * Shadow variant of the field
99
+ *
100
+ * @defaultable false
101
+ */
102
+ shadow?: boolean;
103
+ /**
104
+ * Field height: the 52px default (the shared control height) or the 36px `small` box
105
+ *
106
+ * @defaultable 'default'
107
+ */
108
+ size?: CFieldSize;
109
+ /**
110
+ * The spacing of the grid the step buttons and arrow keys move along, counted from `min` (or `0`)
111
+ *
112
+ * @defaultable 1
113
+ */
114
+ step?: number;
115
+ /**
116
+ * UI text overrides (i18n), merged over the English defaults. Objects have no attribute form — bind as a DOM property
117
+ *
118
+ * @defaultable {}
119
+ */
120
+ texts?: CNumberFieldTexts;
121
+ /**
122
+ * Set the validity of the field
123
+ */
124
+ valid?: boolean;
125
+ /**
126
+ * 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`
127
+ */
128
+ value?: null | number | string;
129
+ }
130
+ /** UI texts of `c-number-field`, merged key by key over the English defaults. */
131
+ export interface CNumberFieldTexts {
132
+ /** Accessible label of the step-down button. */
133
+ decrease?: string;
134
+ /** Accessible label of the step-up button. */
135
+ increase?: string;
136
+ }
137
+ declare const _default: typeof __VLS_export;
138
+ export default _default;
139
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CNumberFieldProps, {
140
+ outOfRange: import("vue").ComputedRef<boolean>;
141
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CNumberFieldProps> & Readonly<{}>, {
142
+ label: string;
143
+ value: null | number | string;
144
+ name: string;
145
+ size: CFieldSize;
146
+ texts: CNumberFieldTexts;
147
+ hideDetails: boolean;
148
+ labelOnTop: boolean;
149
+ shadow: boolean;
150
+ decimalSeparator: string;
151
+ decimals: number;
152
+ fixedDecimals: boolean;
153
+ groupSeparator: string;
154
+ step: number;
155
+ disabled: boolean;
156
+ errorMessage: string;
157
+ hint: string;
158
+ hostId: string;
159
+ placeholder: string;
160
+ required: boolean;
161
+ valid: boolean;
162
+ max: null | number;
163
+ min: null | number;
164
+ readonly: boolean;
165
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
166
+ pre?: (props: {}) => any;
167
+ } & {
168
+ post?: (props: {}) => any;
169
+ }>;
170
+ type __VLS_WithSlots<T, S> = T & {
171
+ new (): {
172
+ $slots: S;
173
+ };
174
+ };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The number core behind `c-number-field` (ADR-0060): the page language's
3
+ * separators, conforming typed text to grouped digits with its caret, and
4
+ * reading and formatting the number. Pure — no DOM, no component state.
5
+ */
6
+ import type { ConformResult } from '../../shared/inputMask';
7
+ export interface CNumberFieldConform extends ConformResult {
8
+ /** The number the text reads as; `null` when it holds no digit. */
9
+ value: null | number;
10
+ }
11
+ export interface CNumberFieldFormat extends CNumberFieldSeparators {
12
+ /** Whether a leading minus is kept (`false` when `min` ≥ 0). */
13
+ allowNegative: boolean;
14
+ /** The most fraction digits; `0` for an integer field. */
15
+ decimals: number;
16
+ }
17
+ export interface CNumberFieldSeparators {
18
+ decimal: string;
19
+ group: string;
20
+ }
21
+ /** More integer digits than this stop being exact as a JS number. */
22
+ export declare const MAX_INTEGER_DIGITS = 15;
23
+ /**
24
+ * The group and decimal separators `Intl.NumberFormat` uses for `lang`
25
+ * (`fi` → non-breaking space and `,`; `en` → `,` and `.`), else the fallback.
26
+ */
27
+ export declare const numberSeparators: (lang: string) => CNumberFieldSeparators;
28
+ /**
29
+ * Conform typed text to the number format: keep a leading minus, digits
30
+ * and one decimal separator (up to `decimals` fraction digits and
31
+ * `MAX_INTEGER_DIGITS` integer digits, leading zeros dropped), and regroup
32
+ * the integer digits in threes. The caret keeps its place among the typed
33
+ * characters; group separators are inserted ones (`tokenAt` false).
34
+ */
35
+ export declare const conformNumber: (text: string, caret: number, format: CNumberFieldFormat) => CNumberFieldConform;
36
+ /** The number `text` reads as under `format`; `null` when it holds no digit. */
37
+ export declare const readNumber: (text: string, format: CNumberFieldFormat) => null | number;
38
+ /**
39
+ * Display a number: rounded to `decimals`, grouped, with trailing fraction
40
+ * zeros kept only when `fixed`. A non-finite value or `null` shows as empty.
41
+ */
42
+ export declare const formatNumber: (value: null | number | undefined, format: CNumberFieldFormat, fixed?: boolean) => string;
43
+ export interface CNumberFieldStepOptions {
44
+ /** The most fraction digits; a stepped number is rounded to them. */
45
+ decimals: number;
46
+ max: null | number;
47
+ min: null | number;
48
+ /** The spacing of the grid, counted from `min` (or `0`); not a positive number reads as `1`. */
49
+ step: number;
50
+ }
51
+ /**
52
+ * Move a number `count` points along its step grid (ADR-0064): to the next
53
+ * point of `base + k·step` above it (`direction` 1) or below it (-1), where
54
+ * `base` is `min`, or `0`. The result is rounded to `decimals` and held in
55
+ * `min`–`max`: a move that would pass a bound lands on it, and a number at or
56
+ * beyond the bound in `direction` stays put. An empty field counts from `0`.
57
+ */
58
+ export declare const stepNumber: (current: null | number, direction: -1 | 1, options: CNumberFieldStepOptions, count?: number) => null | number;
@@ -69,8 +69,8 @@ declare const __VLS_base: import("vue").DefineComponent<COtpInputProps, {}, {},
69
69
  label: string;
70
70
  length: number;
71
71
  value: string;
72
- errorMessage: string;
73
72
  hideDetails: boolean;
73
+ errorMessage: string;
74
74
  hint: string;
75
75
  required: boolean;
76
76
  valid: boolean;
@@ -50,8 +50,8 @@ declare const _default: typeof __VLS_export;
50
50
  export default _default;
51
51
  declare const __VLS_export: import("vue").DefineComponent<CPaginationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CPaginationProps> & Readonly<{}>, {
52
52
  value: CPaginationOptions;
53
- hideDetails: boolean;
54
53
  size: CPaginationSize;
54
+ hideDetails: boolean;
55
55
  hideRange: boolean;
56
56
  simple: boolean;
57
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,43 @@
1
+ import type { CPlacement } from '../../types';
2
+ export interface CPopoverProps {
3
+ /** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
4
+ distance?: number | string;
5
+ /**
6
+ * Heading rendered at the top of the panel, doubling as its accessible
7
+ * name. Without it, set `aria-label` on the host. Named `heading`, not
8
+ * `title`: a `title` attribute on the host would trigger the browser's
9
+ * native tooltip and collides with `HTMLElement.title`.
10
+ * @freeform
11
+ */
12
+ heading?: string;
13
+ /** Whether the popover is open. Two-way: emits `change:open`. */
14
+ open?: boolean;
15
+ /** Preferred placement of the panel relative to the trigger. */
16
+ position?: CPlacement;
17
+ /**
18
+ * Designated trigger: an element elsewhere in the document that opens the
19
+ * popover — its document ID, or the element itself. The same trigger
20
+ * concept as the `trigger` slot, supplied by reference: the popover wires
21
+ * click-to-toggle, ARIA and focus return onto it and anchors the panel to
22
+ * it. When both routes are supplied, this prop wins over the slot.
23
+ */
24
+ trigger?: HTMLElement | string;
25
+ }
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CPopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CPopoverProps> & Readonly<{}>, {
29
+ heading: string;
30
+ open: boolean;
31
+ distance: number | string;
32
+ position: CPlacement;
33
+ trigger: HTMLElement | string;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
35
+ trigger?: (props: {}) => any;
36
+ } & {
37
+ default?: (props: {}) => any;
38
+ }>;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,32 @@
1
+ export interface CProgressCircleProps {
2
+ /**
3
+ * Diameter of the circle in pixels
4
+ */
5
+ size?: number;
6
+ /**
7
+ * Progress value in percentage (0 to 100)
8
+ */
9
+ value?: number;
10
+ /**
11
+ * Stroke width of the track in pixels; the value arc draws at half this
12
+ * width, inset within the track
13
+ */
14
+ width?: number;
15
+ }
16
+ declare var __VLS_1: {};
17
+ type __VLS_Slots = {} & {
18
+ default?: (props: typeof __VLS_1) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<CProgressCircleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CProgressCircleProps> & Readonly<{}>, {
21
+ value: number;
22
+ width: number;
23
+ size: number;
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ type __VLS_WithSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -1,20 +1,11 @@
1
1
  interface CRadioProps {
2
- /**
3
- * Set option as checked
4
- *
5
- * @seeded from csc-ui — verify
6
- */
7
- checked?: boolean;
8
2
  /**
9
3
  * Disable the radio button
10
- *
11
- * @seeded from csc-ui — verify
12
4
  */
13
5
  disabled?: boolean;
14
6
  /**
15
7
  * Radio button value
16
8
  *
17
- * @seeded from csc-ui — verify
18
9
  * @freeform
19
10
  */
20
11
  value?: string;
@@ -23,10 +14,15 @@ declare var __VLS_1: {};
23
14
  type __VLS_Slots = {} & {
24
15
  default?: (props: typeof __VLS_1) => any;
25
16
  };
26
- declare const __VLS_base: import("vue").DefineComponent<CRadioProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CRadioProps> & Readonly<{}>, {
17
+ declare const __VLS_base: import("vue").DefineComponent<CRadioProps, {
18
+ _syncGroupState: (state: {
19
+ checked: boolean;
20
+ disabled: boolean;
21
+ tabIndex: number;
22
+ }) => void;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CRadioProps> & Readonly<{}>, {
27
24
  value: string;
28
25
  disabled: boolean;
29
- checked: boolean;
30
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
27
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
28
  declare const _default: typeof __VLS_export;
@@ -1,8 +1,6 @@
1
1
  interface CRadioGroupProps {
2
2
  /**
3
3
  * Disable the radio group
4
- *
5
- * @seeded from csc-ui — verify
6
4
  */
7
5
  disabled?: boolean;
8
6
  /**
@@ -13,90 +11,54 @@ interface CRadioGroupProps {
13
11
  errorMessage?: string;
14
12
  /**
15
13
  * Hide the hint and error messages
16
- *
17
- * @seeded from csc-ui — verify
18
14
  */
19
15
  hideDetails?: boolean;
20
16
  /**
21
17
  * Hint text for the input
22
18
  *
23
- * @seeded from csc-ui — verify
24
19
  * @freeform
25
20
  */
26
21
  hint?: string;
27
- /**
28
- * Id of the element
29
- *
30
- * @seeded from csc-ui — verify
31
- * @freeform
32
- */
33
- hostId?: string;
34
22
  /**
35
23
  * Display radio buttons inline
36
- *
37
- * @seeded from csc-ui — verify
38
24
  */
39
25
  inline?: boolean;
40
- /**
41
- * Radio group items
42
- *
43
- * @seeded from csc-ui — verify
44
- */
45
- items?: RadioItem[];
46
26
  /**
47
27
  * Label of the radio group
48
28
  *
49
- * @seeded from csc-ui — verify
50
29
  * @freeform
51
30
  */
52
31
  label?: string;
53
32
  /**
54
33
  * Set as required
55
- *
56
- * @seeded from csc-ui — verify
57
34
  */
58
35
  required?: boolean;
59
- /**
60
- * Return the whole item object
61
- *
62
- * @seeded from csc-ui — verify
63
- */
64
- returnObject?: boolean;
65
36
  /**
66
37
  * Set the validity of the input
67
- *
68
- * @seeded from csc-ui — verify
69
38
  */
70
39
  valid?: boolean;
71
40
  /**
72
- * Value of the radio group
73
- *
74
- * @seeded from csc-ui — verify
41
+ * Value of the radio group; matched against each radio's `value` by strict
42
+ * string equality
75
43
  */
76
- value?: null | number | RadioItem | string;
44
+ value?: null | string;
77
45
  }
78
- interface RadioItem {
79
- disabled?: boolean;
80
- name: string;
81
- value: number | string;
82
- }
83
- declare var __VLS_7: {};
46
+ declare var __VLS_7: {}, __VLS_9: {};
84
47
  type __VLS_Slots = {} & {
85
- default?: (props: typeof __VLS_7) => any;
48
+ label?: (props: typeof __VLS_7) => any;
49
+ } & {
50
+ default?: (props: typeof __VLS_9) => any;
86
51
  };
87
52
  declare const __VLS_base: import("vue").DefineComponent<CRadioGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CRadioGroupProps> & Readonly<{}>, {
88
53
  label: string;
89
- value: null | number | RadioItem | string;
54
+ value: null | string;
55
+ inline: boolean;
56
+ hideDetails: boolean;
90
57
  disabled: boolean;
91
58
  errorMessage: string;
92
- hideDetails: boolean;
93
59
  hint: string;
94
- hostId: string;
95
- items: RadioItem[];
96
60
  required: boolean;
97
- returnObject: boolean;
98
61
  valid: boolean;
99
- inline: boolean;
100
62
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
101
63
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
102
64
  declare const _default: typeof __VLS_export;
@@ -1,5 +1,5 @@
1
1
  import type { CFieldSize, CSelectItem } from '../../types';
2
- interface CSelectProps {
2
+ export interface CSelectProps {
3
3
  /** Make the selected value clearable */
4
4
  clearable?: boolean;
5
5
  /** Disable the input */
@@ -10,7 +10,11 @@ interface CSelectProps {
10
10
  * @freeform
11
11
  */
12
12
  errorMessage?: string;
13
- /** Hide the hint and error messages */
13
+ /**
14
+ * Hide the hint and error messages
15
+ *
16
+ * @defaultable false
17
+ */
14
18
  hideDetails?: boolean;
15
19
  /**
16
20
  * Hint text for the input
@@ -26,7 +30,11 @@ interface CSelectProps {
26
30
  hostId?: string;
27
31
  /** Dropdown items (when not using <c-option> elements) */
28
32
  items?: CSelectItem[];
29
- /** Items per page before adding scroll */
33
+ /**
34
+ * Items per page before adding scroll
35
+ *
36
+ * @defaultable 6
37
+ */
30
38
  itemsPerPage?: number;
31
39
  /**
32
40
  * Element label
@@ -34,10 +42,28 @@ interface CSelectProps {
34
42
  * @freeform
35
43
  */
36
44
  label?: string;
37
- /** Label on top of the input */
45
+ /**
46
+ * Label on top of the input
47
+ *
48
+ * @defaultable false
49
+ */
38
50
  labelOnTop?: boolean;
39
51
  /** Show loading state */
40
52
  loading?: boolean;
53
+ /**
54
+ * In `multiple` mode, show at most this many selected-value tags and fold
55
+ * the rest into one "+N more" tag; `0` shows no tags and reads "N selected"
56
+ * instead; unset shows every tag
57
+ */
58
+ maxTags?: number;
59
+ /**
60
+ * Allow selecting several options: rows toggle and the list stays open,
61
+ * `value` becomes an array of the selected values (items with
62
+ * `return-object`) in the order they were picked, and the picks show as
63
+ * tags inside the field. `option-as-selection` is ignored in this mode.
64
+ * Arrays have no attribute form — bind `value` as a DOM property
65
+ */
66
+ multiple?: boolean;
41
67
  /**
42
68
  * Input field name
43
69
  *
@@ -56,50 +82,112 @@ interface CSelectProps {
56
82
  required?: boolean;
57
83
  /** Return object instead of value */
58
84
  returnObject?: boolean;
59
- /** Shadow variant */
85
+ /**
86
+ * In `multiple` mode, pin a select-all row at the top of the list. Its
87
+ * checkbox shows whether none, some or all enabled options are selected;
88
+ * activating it selects every enabled option — or, when all are selected,
89
+ * unselects them. Ignored in single mode
90
+ */
91
+ selectAll?: boolean;
92
+ /**
93
+ * Shadow variant
94
+ *
95
+ * @defaultable false
96
+ */
60
97
  shadow?: boolean;
61
- /** Field height: the 44px default or the 36px `small` box */
98
+ /**
99
+ * Field height: the 52px default (the shared control height) or the 36px `small` box
100
+ *
101
+ * @defaultable 'default'
102
+ */
62
103
  size?: CFieldSize;
104
+ /**
105
+ * UI text overrides (i18n), merged over the English defaults. Objects have
106
+ * no attribute form — bind as a DOM property (`:texts.prop` in Vue)
107
+ *
108
+ * @defaultable {}
109
+ */
110
+ texts?: CSelectTexts;
63
111
  /** Set the validity of the input */
64
112
  valid?: boolean;
65
- /** Selected value (scalar, or object when return-object is set) */
66
- value?: CSelectItem | null | number | string;
113
+ /**
114
+ * Selected value: the option's value, or the whole item with
115
+ * `return-object`; an array of them in `multiple` mode
116
+ */
117
+ value?: CSelectValue;
67
118
  }
68
- declare var __VLS_19: {}, __VLS_54: {}, __VLS_56: {};
69
- type __VLS_Slots = {} & {
70
- pre?: (props: typeof __VLS_19) => any;
71
- } & {
72
- default?: (props: typeof __VLS_54) => any;
73
- } & {
74
- post?: (props: typeof __VLS_56) => any;
75
- };
76
- declare const __VLS_base: import("vue").DefineComponent<CSelectProps, {
119
+ /**
120
+ * UI texts of `c-select`, shallow-merged over the English defaults. Static
121
+ * labels are strings; count- or label-interpolated ones are functions.
122
+ */
123
+ export interface CSelectTexts {
124
+ /** Accessible label of the clear button. */
125
+ clearSelection?: string;
126
+ /** Accessible label of the close button in the fullscreen panel (narrow viewports). */
127
+ closePanel?: string;
128
+ /**
129
+ * Text of the overflow tag when `max-tags` folds the selection; receives the
130
+ * number of hidden tags.
131
+ */
132
+ more?: (count: number) => string;
133
+ /** Accessible label of a tag's remove button; receives the option label. */
134
+ remove?: (label: string) => string;
135
+ /**
136
+ * Label of the select-all row; receives the number of enabled options
137
+ * listed.
138
+ */
139
+ selectAll?: (count: number) => string;
140
+ /**
141
+ * Field text when `max-tags="0"` shows no tags; receives the selection
142
+ * count.
143
+ */
144
+ selected?: (count: number) => string;
145
+ /** Accessible label of the chevron button that opens and closes the list. */
146
+ toggleOptions?: string;
147
+ }
148
+ /**
149
+ * Selection value of `c-select`: the picked option's value — or the whole
150
+ * `{ name, value }` item with `return-object` — and `null` when nothing is
151
+ * selected. In `multiple` mode an array of them in the order they were
152
+ * picked, `[]` when empty.
153
+ */
154
+ export type CSelectValue = (number | string)[] | CSelectItem | CSelectItem[] | null | number | string;
155
+ declare const _default: typeof __VLS_export;
156
+ export default _default;
157
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CSelectProps, {
77
158
  reset: () => void;
78
159
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CSelectProps> & Readonly<{}>, {
79
160
  label: string;
80
- value: CSelectItem | null | number | string;
161
+ value: CSelectValue;
81
162
  name: string;
163
+ multiple: boolean;
164
+ itemsPerPage: number;
165
+ size: CFieldSize;
166
+ texts: CSelectTexts;
167
+ hideDetails: boolean;
168
+ labelOnTop: boolean;
169
+ shadow: boolean;
82
170
  clearable: boolean;
83
171
  disabled: boolean;
84
172
  errorMessage: string;
85
- hideDetails: boolean;
86
173
  hint: string;
87
174
  hostId: string;
88
175
  items: CSelectItem[];
89
- itemsPerPage: number;
90
- labelOnTop: boolean;
91
176
  loading: boolean;
177
+ maxTags: number;
92
178
  placeholder: string;
93
179
  required: boolean;
94
180
  returnObject: boolean;
95
- shadow: boolean;
96
- size: CFieldSize;
181
+ selectAll: boolean;
97
182
  valid: boolean;
98
183
  optionAsSelection: boolean;
99
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
100
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
101
- declare const _default: typeof __VLS_export;
102
- export default _default;
184
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
185
+ pre?: (props: {}) => any;
186
+ } & {
187
+ default?: (props: {}) => any;
188
+ } & {
189
+ post?: (props: {}) => any;
190
+ }>;
103
191
  type __VLS_WithSlots<T, S> = T & {
104
192
  new (): {
105
193
  $slots: S;
@@ -25,8 +25,8 @@ type __VLS_Slots = {} & {
25
25
  bottom?: (props: typeof __VLS_16) => any;
26
26
  };
27
27
  declare const __VLS_base: import("vue").DefineComponent<CSideNavigationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CSideNavigationProps> & Readonly<{}>, {
28
- mobile: boolean;
29
28
  menuVisible: boolean;
29
+ mobile: boolean;
30
30
  styles: null | Record<string, string>;
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;