mn-angular-lib 2.0.34 → 2.0.36
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/fesm2022/mn-angular-lib-alert.mjs +515 -527
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +264 -357
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-button.mjs +819 -382
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar-core.mjs +240 -365
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar.mjs +1691 -1545
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +2367 -2796
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-core.mjs +693 -1241
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-display.mjs +679 -712
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +3671 -4647
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-keyboard.mjs +221 -190
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-core.mjs +711 -896
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2089 -2035
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal.mjs +76 -121
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +289 -277
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-segmented.mjs +189 -241
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tab.mjs +409 -642
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -1
- package/fesm2022/mn-angular-lib.mjs +16 -29
- package/package.json +1 -1
- package/types/mn-angular-lib-alert.d.ts +239 -241
- package/types/mn-angular-lib-bottom-sheet.d.ts +190 -150
- package/types/mn-angular-lib-button.d.ts +319 -317
- package/types/mn-angular-lib-calendar-core.d.ts +199 -209
- package/types/mn-angular-lib-calendar.d.ts +656 -511
- package/types/mn-angular-lib-collection.d.ts +1649 -1585
- package/types/mn-angular-lib-core.d.ts +524 -535
- package/types/mn-angular-lib-display.d.ts +946 -886
- package/types/mn-angular-lib-forms.d.ts +3012 -3013
- package/types/mn-angular-lib-keyboard.d.ts +125 -85
- package/types/mn-angular-lib-modal-core.d.ts +978 -994
- package/types/mn-angular-lib-modal-ui.d.ts +541 -493
- package/types/mn-angular-lib-modal.d.ts +24 -27
- package/types/mn-angular-lib-rich-text-editor.d.ts +131 -98
- package/types/mn-angular-lib-segmented.d.ts +354 -341
- package/types/mn-angular-lib-tab.d.ts +345 -336
- package/types/mn-angular-lib.d.ts +16 -16
- package/fesm2022/mn-angular-lib.mjs.map +0 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { MnButtonTypes } from 'mn-angular-lib/button';
|
|
7
|
-
import { MnActionIcon } from 'mn-angular-lib/forms';
|
|
8
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EventEmitter, TemplateRef } from "@angular/core";
|
|
3
|
+
import { MnButtonTypes } from "mn-angular-lib/button";
|
|
4
|
+
import { MnActionIcon } from "mn-angular-lib/forms";
|
|
5
|
+
import { VariantProps } from "tailwind-variants";
|
|
9
6
|
/**
|
|
10
7
|
* Styling for {@link MnSegmented}, expressed as tailwind-variants slots so the
|
|
11
8
|
* template pulls one class string per role.
|
|
@@ -19,244 +16,243 @@ import { MnActionIcon } from 'mn-angular-lib/forms';
|
|
|
19
16
|
* disabled look; the `segment` slot adds only what the button does not know
|
|
20
17
|
* about — how it sits inside the track.
|
|
21
18
|
*/
|
|
22
|
-
declare const mnSegmentedVariants:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
xs: {
|
|
35
|
-
root: string;
|
|
36
|
-
};
|
|
37
|
-
sm: {
|
|
38
|
-
root: string;
|
|
39
|
-
};
|
|
40
|
-
md: {
|
|
41
|
-
root: string;
|
|
42
|
-
};
|
|
43
|
-
lg: {
|
|
44
|
-
root: string;
|
|
45
|
-
};
|
|
46
|
-
xl: {
|
|
47
|
-
root: string;
|
|
48
|
-
};
|
|
49
|
-
two_xl: {
|
|
50
|
-
root: string;
|
|
51
|
-
};
|
|
52
|
-
three_xl: {
|
|
53
|
-
root: string;
|
|
54
|
-
};
|
|
55
|
-
four_xl: {
|
|
56
|
-
root: string;
|
|
57
|
-
};
|
|
58
|
-
full: {
|
|
59
|
-
root: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Stretch the track and share its width evenly between the segments.
|
|
64
|
-
*
|
|
65
|
-
* The segments grow from a zero basis but keep their automatic minimum, so a
|
|
66
|
-
* justified control inside an auto-width parent still asks for the room its
|
|
67
|
-
* labels need. Letting them shrink below their content (`min-w-0`) made the
|
|
68
|
-
* parent resolve to a narrower box and truncated the labels instead.
|
|
69
|
-
*/
|
|
70
|
-
justified: {
|
|
71
|
-
true: {
|
|
72
|
-
root: string;
|
|
73
|
-
segment: string;
|
|
74
|
-
};
|
|
75
|
-
false: {};
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Whether the segment is the picked one. The colours come from the button
|
|
79
|
-
* itself (a filled primary button when active, a ghost one otherwise); this
|
|
80
|
-
* only keeps an inactive segment's box the same size as an active one, whose
|
|
81
|
-
* fill variant carries a real border.
|
|
82
|
-
*/
|
|
83
|
-
active: {
|
|
84
|
-
true: {};
|
|
85
|
-
false: {
|
|
86
|
-
segment: string;
|
|
87
|
-
};
|
|
19
|
+
export declare const mnSegmentedVariants: import("tailwind-variants").TVReturnType<{
|
|
20
|
+
/**
|
|
21
|
+
* Corner rounding of the track. The segments are rounded one step tighter
|
|
22
|
+
* (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
|
|
23
|
+
* the track's own corner instead of poking out of it. Token names match
|
|
24
|
+
* mn-button's; `full` makes a pill, where track and segment share the same
|
|
25
|
+
* fully-rounded ends.
|
|
26
|
+
*/
|
|
27
|
+
borderRadius: {
|
|
28
|
+
none: {
|
|
29
|
+
root: string;
|
|
88
30
|
};
|
|
31
|
+
xs: {
|
|
32
|
+
root: string;
|
|
33
|
+
};
|
|
34
|
+
sm: {
|
|
35
|
+
root: string;
|
|
36
|
+
};
|
|
37
|
+
md: {
|
|
38
|
+
root: string;
|
|
39
|
+
};
|
|
40
|
+
lg: {
|
|
41
|
+
root: string;
|
|
42
|
+
};
|
|
43
|
+
xl: {
|
|
44
|
+
root: string;
|
|
45
|
+
};
|
|
46
|
+
two_xl: {
|
|
47
|
+
root: string;
|
|
48
|
+
};
|
|
49
|
+
three_xl: {
|
|
50
|
+
root: string;
|
|
51
|
+
};
|
|
52
|
+
four_xl: {
|
|
53
|
+
root: string;
|
|
54
|
+
};
|
|
55
|
+
full: {
|
|
56
|
+
root: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Stretch the track and share its width evenly between the segments.
|
|
61
|
+
*
|
|
62
|
+
* The segments grow from a zero basis but keep their automatic minimum, so a
|
|
63
|
+
* justified control inside an auto-width parent still asks for the room its
|
|
64
|
+
* labels need. Letting them shrink below their content (`min-w-0`) made the
|
|
65
|
+
* parent resolve to a narrower box and truncated the labels instead.
|
|
66
|
+
*/
|
|
67
|
+
justified: {
|
|
68
|
+
true: {
|
|
69
|
+
root: string;
|
|
70
|
+
segment: string;
|
|
71
|
+
};
|
|
72
|
+
false: {};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Whether the segment is the picked one. The colours come from the button
|
|
76
|
+
* itself (a filled primary button when active, a ghost one otherwise); this
|
|
77
|
+
* only keeps an inactive segment's box the same size as an active one, whose
|
|
78
|
+
* fill variant carries a real border.
|
|
79
|
+
*/
|
|
80
|
+
active: {
|
|
81
|
+
true: {};
|
|
82
|
+
false: {
|
|
83
|
+
segment: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
89
86
|
}, {
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
root: string;
|
|
88
|
+
segment: string;
|
|
92
89
|
}, undefined, {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
};
|
|
125
|
-
four_xl: {
|
|
126
|
-
root: string;
|
|
127
|
-
};
|
|
128
|
-
full: {
|
|
129
|
-
root: string;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Stretch the track and share its width evenly between the segments.
|
|
134
|
-
*
|
|
135
|
-
* The segments grow from a zero basis but keep their automatic minimum, so a
|
|
136
|
-
* justified control inside an auto-width parent still asks for the room its
|
|
137
|
-
* labels need. Letting them shrink below their content (`min-w-0`) made the
|
|
138
|
-
* parent resolve to a narrower box and truncated the labels instead.
|
|
139
|
-
*/
|
|
140
|
-
justified: {
|
|
141
|
-
true: {
|
|
142
|
-
root: string;
|
|
143
|
-
segment: string;
|
|
144
|
-
};
|
|
145
|
-
false: {};
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Whether the segment is the picked one. The colours come from the button
|
|
149
|
-
* itself (a filled primary button when active, a ghost one otherwise); this
|
|
150
|
-
* only keeps an inactive segment's box the same size as an active one, whose
|
|
151
|
-
* fill variant carries a real border.
|
|
152
|
-
*/
|
|
153
|
-
active: {
|
|
154
|
-
true: {};
|
|
155
|
-
false: {
|
|
156
|
-
segment: string;
|
|
157
|
-
};
|
|
90
|
+
/**
|
|
91
|
+
* Corner rounding of the track. The segments are rounded one step tighter
|
|
92
|
+
* (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
|
|
93
|
+
* the track's own corner instead of poking out of it. Token names match
|
|
94
|
+
* mn-button's; `full` makes a pill, where track and segment share the same
|
|
95
|
+
* fully-rounded ends.
|
|
96
|
+
*/
|
|
97
|
+
borderRadius: {
|
|
98
|
+
none: {
|
|
99
|
+
root: string;
|
|
100
|
+
};
|
|
101
|
+
xs: {
|
|
102
|
+
root: string;
|
|
103
|
+
};
|
|
104
|
+
sm: {
|
|
105
|
+
root: string;
|
|
106
|
+
};
|
|
107
|
+
md: {
|
|
108
|
+
root: string;
|
|
109
|
+
};
|
|
110
|
+
lg: {
|
|
111
|
+
root: string;
|
|
112
|
+
};
|
|
113
|
+
xl: {
|
|
114
|
+
root: string;
|
|
115
|
+
};
|
|
116
|
+
two_xl: {
|
|
117
|
+
root: string;
|
|
118
|
+
};
|
|
119
|
+
three_xl: {
|
|
120
|
+
root: string;
|
|
158
121
|
};
|
|
122
|
+
four_xl: {
|
|
123
|
+
root: string;
|
|
124
|
+
};
|
|
125
|
+
full: {
|
|
126
|
+
root: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Stretch the track and share its width evenly between the segments.
|
|
131
|
+
*
|
|
132
|
+
* The segments grow from a zero basis but keep their automatic minimum, so a
|
|
133
|
+
* justified control inside an auto-width parent still asks for the room its
|
|
134
|
+
* labels need. Letting them shrink below their content (`min-w-0`) made the
|
|
135
|
+
* parent resolve to a narrower box and truncated the labels instead.
|
|
136
|
+
*/
|
|
137
|
+
justified: {
|
|
138
|
+
true: {
|
|
139
|
+
root: string;
|
|
140
|
+
segment: string;
|
|
141
|
+
};
|
|
142
|
+
false: {};
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Whether the segment is the picked one. The colours come from the button
|
|
146
|
+
* itself (a filled primary button when active, a ghost one otherwise); this
|
|
147
|
+
* only keeps an inactive segment's box the same size as an active one, whose
|
|
148
|
+
* fill variant carries a real border.
|
|
149
|
+
*/
|
|
150
|
+
active: {
|
|
151
|
+
true: {};
|
|
152
|
+
false: {
|
|
153
|
+
segment: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
159
156
|
}, {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
};
|
|
189
|
-
two_xl: {
|
|
190
|
-
root: string;
|
|
191
|
-
};
|
|
192
|
-
three_xl: {
|
|
193
|
-
root: string;
|
|
194
|
-
};
|
|
195
|
-
four_xl: {
|
|
196
|
-
root: string;
|
|
197
|
-
};
|
|
198
|
-
full: {
|
|
199
|
-
root: string;
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* Stretch the track and share its width evenly between the segments.
|
|
204
|
-
*
|
|
205
|
-
* The segments grow from a zero basis but keep their automatic minimum, so a
|
|
206
|
-
* justified control inside an auto-width parent still asks for the room its
|
|
207
|
-
* labels need. Letting them shrink below their content (`min-w-0`) made the
|
|
208
|
-
* parent resolve to a narrower box and truncated the labels instead.
|
|
209
|
-
*/
|
|
210
|
-
justified: {
|
|
211
|
-
true: {
|
|
212
|
-
root: string;
|
|
213
|
-
segment: string;
|
|
214
|
-
};
|
|
215
|
-
false: {};
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* Whether the segment is the picked one. The colours come from the button
|
|
219
|
-
* itself (a filled primary button when active, a ghost one otherwise); this
|
|
220
|
-
* only keeps an inactive segment's box the same size as an active one, whose
|
|
221
|
-
* fill variant carries a real border.
|
|
222
|
-
*/
|
|
223
|
-
active: {
|
|
224
|
-
true: {};
|
|
225
|
-
false: {
|
|
226
|
-
segment: string;
|
|
227
|
-
};
|
|
157
|
+
root: string;
|
|
158
|
+
segment: string;
|
|
159
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
160
|
+
/**
|
|
161
|
+
* Corner rounding of the track. The segments are rounded one step tighter
|
|
162
|
+
* (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
|
|
163
|
+
* the track's own corner instead of poking out of it. Token names match
|
|
164
|
+
* mn-button's; `full` makes a pill, where track and segment share the same
|
|
165
|
+
* fully-rounded ends.
|
|
166
|
+
*/
|
|
167
|
+
borderRadius: {
|
|
168
|
+
none: {
|
|
169
|
+
root: string;
|
|
170
|
+
};
|
|
171
|
+
xs: {
|
|
172
|
+
root: string;
|
|
173
|
+
};
|
|
174
|
+
sm: {
|
|
175
|
+
root: string;
|
|
176
|
+
};
|
|
177
|
+
md: {
|
|
178
|
+
root: string;
|
|
179
|
+
};
|
|
180
|
+
lg: {
|
|
181
|
+
root: string;
|
|
182
|
+
};
|
|
183
|
+
xl: {
|
|
184
|
+
root: string;
|
|
228
185
|
};
|
|
186
|
+
two_xl: {
|
|
187
|
+
root: string;
|
|
188
|
+
};
|
|
189
|
+
three_xl: {
|
|
190
|
+
root: string;
|
|
191
|
+
};
|
|
192
|
+
four_xl: {
|
|
193
|
+
root: string;
|
|
194
|
+
};
|
|
195
|
+
full: {
|
|
196
|
+
root: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Stretch the track and share its width evenly between the segments.
|
|
201
|
+
*
|
|
202
|
+
* The segments grow from a zero basis but keep their automatic minimum, so a
|
|
203
|
+
* justified control inside an auto-width parent still asks for the room its
|
|
204
|
+
* labels need. Letting them shrink below their content (`min-w-0`) made the
|
|
205
|
+
* parent resolve to a narrower box and truncated the labels instead.
|
|
206
|
+
*/
|
|
207
|
+
justified: {
|
|
208
|
+
true: {
|
|
209
|
+
root: string;
|
|
210
|
+
segment: string;
|
|
211
|
+
};
|
|
212
|
+
false: {};
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Whether the segment is the picked one. The colours come from the button
|
|
216
|
+
* itself (a filled primary button when active, a ghost one otherwise); this
|
|
217
|
+
* only keeps an inactive segment's box the same size as an active one, whose
|
|
218
|
+
* fill variant carries a real border.
|
|
219
|
+
*/
|
|
220
|
+
active: {
|
|
221
|
+
true: {};
|
|
222
|
+
false: {
|
|
223
|
+
segment: string;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
229
226
|
}, {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
type MnSegmentedVariants = VariantProps<typeof mnSegmentedVariants>;
|
|
234
|
-
|
|
227
|
+
root: string;
|
|
228
|
+
segment: string;
|
|
229
|
+
}>>;
|
|
230
|
+
export type MnSegmentedVariants = VariantProps<typeof mnSegmentedVariants>;
|
|
235
231
|
/**
|
|
236
232
|
* One choice in a {@link MnSegmented} control.
|
|
237
233
|
*
|
|
238
234
|
* A segment is a label, an icon, or both. Icon-only segments carry no visible
|
|
239
235
|
* text, so they need an {@link ariaLabel} to stay reachable by name.
|
|
240
236
|
*/
|
|
241
|
-
type MnSegmentedItem = {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
237
|
+
export type MnSegmentedItem = {
|
|
238
|
+
/** Value emitted when this segment is picked; also identifies the active one. */
|
|
239
|
+
value: string;
|
|
240
|
+
/** Translation key or literal label. Omit for an icon-only segment. */
|
|
241
|
+
label?: string;
|
|
242
|
+
/**
|
|
243
|
+
* Optional leading icon: a `TemplateRef` (full control over the icon set — an
|
|
244
|
+
* `<mn-icon>`, an emoji, a bespoke `<svg>`) or lucide icon *data* such as
|
|
245
|
+
* `LucideList.icon`. The same convention the dropdown's actions use; see
|
|
246
|
+
* {@link MnActionIcon}.
|
|
247
|
+
*/
|
|
248
|
+
icon?: MnActionIcon;
|
|
249
|
+
/**
|
|
250
|
+
* Accessible name of the segment. Required when {@link label} is omitted,
|
|
251
|
+
* since an icon alone names nothing; ignored otherwise — the label is the name.
|
|
252
|
+
*/
|
|
253
|
+
ariaLabel?: string;
|
|
254
|
+
/** Whether this choice cannot be picked. Defaults to false. */
|
|
255
|
+
disabled?: boolean;
|
|
260
256
|
};
|
|
261
257
|
/**
|
|
262
258
|
* Data source for {@link MnSegmented}.
|
|
@@ -265,24 +261,23 @@ type MnSegmentedItem = {
|
|
|
265
261
|
* at a time, and which one is decided by the consumer through
|
|
266
262
|
* {@link MnSegmented.value} rather than by the control itself.
|
|
267
263
|
*/
|
|
268
|
-
type MnSegmentedDataSource = {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
264
|
+
export type MnSegmentedDataSource = {
|
|
265
|
+
/** The choices, in the order they are shown. Two or three read best. */
|
|
266
|
+
items: MnSegmentedItem[];
|
|
267
|
+
/** Visual scale. Defaults to `'md'`. */
|
|
268
|
+
size?: 'sm' | 'md';
|
|
269
|
+
/**
|
|
270
|
+
* Corner rounding, in mn-button's radius tokens plus `'full'` for a pill.
|
|
271
|
+
* Defaults to `'lg'`. The segments follow the track one step tighter, so the
|
|
272
|
+
* active segment stays nested inside the track's corner.
|
|
273
|
+
*/
|
|
274
|
+
borderRadius?: MnSegmentedVariants['borderRadius'];
|
|
275
|
+
/**
|
|
276
|
+
* Translation key or literal naming what the group switches, e.g. "View".
|
|
277
|
+
* Without it the group is an unnamed set of buttons to a screen reader.
|
|
278
|
+
*/
|
|
279
|
+
ariaLabel?: string;
|
|
284
280
|
};
|
|
285
|
-
|
|
286
281
|
/**
|
|
287
282
|
* A segmented control: two or three mutually exclusive choices sharing one
|
|
288
283
|
* track, of which exactly one is active — a view switch (list ⇄ calendar), a
|
|
@@ -302,94 +297,112 @@ type MnSegmentedDataSource = {
|
|
|
302
297
|
* For switching between panes of a page, reach for `mn-tab`; this is for
|
|
303
298
|
* switching how one pane is rendered.
|
|
304
299
|
*/
|
|
305
|
-
declare class MnSegmented {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
300
|
+
export declare class MnSegmented {
|
|
301
|
+
/** The choices and how the group is labelled and scaled. */
|
|
302
|
+
dataSource: MnSegmentedDataSource;
|
|
303
|
+
/**
|
|
304
|
+
* Value of the active segment. No value (or one naming no segment) leaves the
|
|
305
|
+
* control with nothing active, which is what an unresolved selection should
|
|
306
|
+
* look like — the component never picks one on the consumer's behalf.
|
|
307
|
+
*/
|
|
308
|
+
value?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Whether the segments stretch to fill the available width. Defaults to false,
|
|
311
|
+
* so the control hugs its content and can be parked at the end of a row; turn
|
|
312
|
+
* it on where it should span its container, typically on a narrow screen.
|
|
313
|
+
*/
|
|
314
|
+
justified: boolean;
|
|
315
|
+
/** Emits the picked segment's value. The consumer decides what to do with it. */
|
|
316
|
+
valueChange: EventEmitter<string>;
|
|
317
|
+
/** Resolves this control's own accessible names against the app's bundle. */
|
|
318
|
+
private readonly lang;
|
|
319
|
+
/** Resolved slot classes for the current rounding and layout. */
|
|
320
|
+
get styles(): {
|
|
321
|
+
root: (slotProps?: ({
|
|
322
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
|
|
323
|
+
justified?: boolean | undefined;
|
|
324
|
+
active?: boolean | undefined;
|
|
325
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
326
|
+
segment: (slotProps?: ({
|
|
327
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
|
|
328
|
+
justified?: boolean | undefined;
|
|
329
|
+
active?: boolean | undefined;
|
|
330
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
331
|
+
} & {
|
|
332
|
+
root: (slotProps?: ({
|
|
333
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
|
|
334
|
+
justified?: boolean | undefined;
|
|
335
|
+
active?: boolean | undefined;
|
|
336
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
337
|
+
segment: (slotProps?: ({
|
|
338
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
|
|
339
|
+
justified?: boolean | undefined;
|
|
340
|
+
active?: boolean | undefined;
|
|
341
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
342
|
+
} & {
|
|
343
|
+
base: (slotProps?: ({
|
|
344
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
|
|
345
|
+
justified?: boolean | undefined;
|
|
346
|
+
active?: boolean | undefined;
|
|
347
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
348
|
+
};
|
|
349
|
+
/** Icon edge length matching the control's text size. */
|
|
350
|
+
get iconSize(): number;
|
|
351
|
+
/** Accessible name of the group, or null when the consumer named nothing. */
|
|
352
|
+
get groupLabel(): string | null;
|
|
353
|
+
/**
|
|
354
|
+
* Whether `item` is the active choice.
|
|
355
|
+
* @param item - The segment to test.
|
|
356
|
+
*/
|
|
357
|
+
isActive(item: MnSegmentedItem): boolean;
|
|
358
|
+
/**
|
|
359
|
+
* Layout classes for one segment — how it sits in the track. Its size, colour,
|
|
360
|
+
* radius and disabled look come from the button itself; see
|
|
361
|
+
* {@link segmentButton}.
|
|
362
|
+
* @param item - The segment to style.
|
|
363
|
+
*/
|
|
364
|
+
segmentClass(item: MnSegmentedItem): string;
|
|
365
|
+
/**
|
|
366
|
+
* The `mnButton` configuration of one segment: a filled primary button when it
|
|
367
|
+
* is the active choice, a ghost button otherwise, at the control's size and one
|
|
368
|
+
* radius step inside the track. The active segment has no hover — re-picking it
|
|
369
|
+
* does nothing, so nothing should invite the click.
|
|
370
|
+
* @param item - The segment to configure.
|
|
371
|
+
*/
|
|
372
|
+
segmentButton(item: MnSegmentedItem): Partial<MnButtonTypes>;
|
|
373
|
+
/**
|
|
374
|
+
* Accessible name for an icon-only segment, or null when the segment shows a
|
|
375
|
+
* label — that label already names it, and a second name would only compete.
|
|
376
|
+
* @param item - The segment to name.
|
|
377
|
+
*/
|
|
378
|
+
segmentLabel(item: MnSegmentedItem): string | null;
|
|
379
|
+
/**
|
|
380
|
+
* Whether an icon was supplied as a `TemplateRef` rather than lucide icon data.
|
|
381
|
+
* @param value - The icon to test.
|
|
382
|
+
*/
|
|
383
|
+
isTemplateRef(value: unknown): value is TemplateRef<unknown>;
|
|
384
|
+
/**
|
|
385
|
+
* Announces a click. Re-picking the active segment is silent: it is not a
|
|
386
|
+
* change, and a consumer that reloads on every emission would refetch for
|
|
387
|
+
* nothing.
|
|
388
|
+
* @param item - The segment that was clicked.
|
|
389
|
+
*/
|
|
390
|
+
select(item: MnSegmentedItem): void;
|
|
391
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnSegmented, never>;
|
|
392
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnSegmented, "mn-segmented", never, {
|
|
393
|
+
"dataSource": {
|
|
394
|
+
"alias": "dataSource";
|
|
395
|
+
"required": true;
|
|
396
|
+
};
|
|
397
|
+
"value": {
|
|
398
|
+
"alias": "value";
|
|
399
|
+
"required": false;
|
|
400
|
+
};
|
|
401
|
+
"justified": {
|
|
402
|
+
"alias": "justified";
|
|
403
|
+
"required": false;
|
|
404
|
+
};
|
|
405
|
+
}, {
|
|
406
|
+
"valueChange": "valueChange";
|
|
407
|
+
}, never, never, true, never>;
|
|
408
|
+
}
|