@nanahoshi/mona-ui 0.11.3 → 0.12.0

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.
@@ -29,6 +29,7 @@ interface ColumnConfig {
29
29
  readonly editTemplate: TemplateRef<unknown> | null;
30
30
  readonly editable: boolean;
31
31
  readonly field: string;
32
+ readonly filterable: boolean;
32
33
  readonly format: ColumnFormat | null;
33
34
  readonly footerTemplate: TemplateRef<unknown> | null;
34
35
  readonly groupFooterTemplate: TemplateRef<unknown> | null;
@@ -771,6 +772,10 @@ declare class GridColumnComponent implements GridColumnDefinition {
771
772
  * @description The field name of the data property to display in this column.
772
773
  */
773
774
  readonly field: _angular_core.InputSignal<string>;
775
+ /**
776
+ * @description Whether this column can be filtered when grid filtering is enabled. Has no effect if filtering is disabled on the grid.
777
+ */
778
+ readonly filterable: _angular_core.InputSignal<boolean>;
774
779
  /**
775
780
  * @description Formats the displayed cell value. String formats apply to date, datetime, and time columns; formatter functions replace the cell text.
776
781
  */
@@ -813,7 +818,7 @@ declare class GridColumnComponent implements GridColumnDefinition {
813
818
  readonly width: _angular_core.InputSignal<number | null | undefined>;
814
819
  getColumn(): Column;
815
820
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridColumnComponent, never>;
816
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<GridColumnComponent, "mona-grid-column", never, { "aggregate": { "alias": "aggregate"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "field": { "alias": "field"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "lockedPosition": { "alias": "lockedPosition"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "stateKey": { "alias": "stateKey"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, {}, ["cellTemplate", "editTemplate", "footerTemplate", "groupFooterTemplate", "headerTemplate", "titleTemplate"], never, true, never>;
821
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<GridColumnComponent, "mona-grid-column", never, { "aggregate": { "alias": "aggregate"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "field": { "alias": "field"; "required": false; "isSignal": true; }; "filterable": { "alias": "filterable"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "lockedPosition": { "alias": "lockedPosition"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "stateKey": { "alias": "stateKey"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, {}, ["cellTemplate", "editTemplate", "footerTemplate", "groupFooterTemplate", "headerTemplate", "titleTemplate"], never, true, never>;
817
822
  }
818
823
 
819
824
  interface ColumnFilterState {
@@ -0,0 +1,295 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef, TemplateRef } from '@angular/core';
3
+ import { FormValueControl } from '@angular/forms/signals';
4
+ import { LucideCircle, LucideDiamond, LucideFlame, LucideHeart, LucideStar } from '@lucide/angular';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps } from 'class-variance-authority';
7
+ import { VariantInputs } from '@nanahoshi/mona-ui/internal';
8
+
9
+ /**
10
+ * @description Rendering context passed to the default, selected, and hovered item templates.
11
+ */
12
+ interface RatingItemTemplateContext {
13
+ /**
14
+ * Zero-based item index.
15
+ */
16
+ readonly $implicit: number;
17
+ /**
18
+ * Zero-based item index.
19
+ */
20
+ readonly index: number;
21
+ /**
22
+ * One-based value represented by this item.
23
+ */
24
+ readonly itemValue: number;
25
+ /**
26
+ * Visible fill amount between 0 and 1.
27
+ */
28
+ readonly fill: number;
29
+ /**
30
+ * Whether the visible state comes from the committed value.
31
+ */
32
+ readonly selected: boolean;
33
+ /**
34
+ * Whether the visible state comes from pointer preview.
35
+ */
36
+ readonly hovered: boolean;
37
+ }
38
+
39
+ /**
40
+ * @description Built-in icon names available for the default rating visuals.
41
+ */
42
+ type RatingIconName = "circle" | "diamond" | "flame" | "heart" | "star";
43
+
44
+ /**
45
+ * @description Position of the visible label relative to the rating items.
46
+ * @default "after"
47
+ */
48
+ type RatingLabelPosition = "before" | "after";
49
+
50
+ /**
51
+ * @description Selection granularity of the rating. `"item"` selects whole items, `"half"` selects
52
+ * half-item increments.
53
+ * @default "item"
54
+ */
55
+ type RatingPrecision = "item" | "half";
56
+
57
+ /**
58
+ * @description How the selected value is visualized across the items. `"continuous"` fills every
59
+ * item up to the selected value, `"single"` fills only the item representing the selected value.
60
+ * @default "continuous"
61
+ */
62
+ type RatingSelectionMode = "continuous" | "single";
63
+
64
+ declare const ratingContainerThemeVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
65
+ declare const ratingControlThemeVariants: (props?: ({
66
+ size?: "small" | "medium" | "large" | null | undefined;
67
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
68
+ declare const ratingItemThemeVariants: (props?: ({
69
+ size?: "small" | "medium" | "large" | null | undefined;
70
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
71
+ declare const ratingIconThemeVariants: (props?: ({
72
+ size?: "small" | "medium" | "large" | null | undefined;
73
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
74
+ declare const ratingOverlayClipThemeVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
75
+ declare const ratingOverlayContentThemeVariants: (props?: ({
76
+ size?: "small" | "medium" | "large" | null | undefined;
77
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
78
+ declare const ratingLabelThemeVariants: (props?: ({
79
+ size?: "small" | "medium" | "large" | null | undefined;
80
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
81
+ type RatingContainerVariantProps = VariantProps<typeof ratingContainerThemeVariants>;
82
+ type RatingContainerVariantInput = VariantInputs<RatingContainerVariantProps>;
83
+ type RatingControlVariantProps = VariantProps<typeof ratingControlThemeVariants>;
84
+ type RatingControlVariantInput = VariantInputs<RatingControlVariantProps>;
85
+ type RatingItemVariantProps = VariantProps<typeof ratingItemThemeVariants>;
86
+ type RatingItemVariantInput = VariantInputs<RatingItemVariantProps>;
87
+ type RatingIconVariantProps = VariantProps<typeof ratingIconThemeVariants>;
88
+ type RatingIconVariantInput = VariantInputs<RatingIconVariantProps>;
89
+ type RatingOverlayClipVariantProps = VariantProps<typeof ratingOverlayClipThemeVariants>;
90
+ type RatingOverlayClipVariantInput = VariantInputs<RatingOverlayClipVariantProps>;
91
+ type RatingOverlayContentVariantProps = VariantProps<typeof ratingOverlayContentThemeVariants>;
92
+ type RatingOverlayContentVariantInput = VariantInputs<RatingOverlayContentVariantProps>;
93
+ type RatingLabelVariantProps = VariantProps<typeof ratingLabelThemeVariants>;
94
+ type RatingLabelVariantInput = VariantInputs<RatingLabelVariantProps>;
95
+ type RatingVariantProps = RatingContainerVariantProps & RatingControlVariantProps & RatingItemVariantProps & RatingIconVariantProps & RatingOverlayClipVariantProps & RatingOverlayContentVariantProps & RatingLabelVariantProps;
96
+ type RatingVariantInput = RatingContainerVariantInput & RatingControlVariantInput & RatingItemVariantInput & RatingIconVariantInput & RatingOverlayClipVariantInput & RatingOverlayContentVariantInput & RatingLabelVariantInput;
97
+
98
+ interface RatingItemDescriptor {
99
+ readonly index: number;
100
+ readonly itemValue: number;
101
+ }
102
+ declare class RatingComponent implements RatingVariantInput, FormValueControl<number> {
103
+ protected readonly activeState: _angular_core.Signal<"hovered" | "selected">;
104
+ protected readonly containerClasses: _angular_core.Signal<string>;
105
+ protected readonly controlClasses: _angular_core.Signal<string>;
106
+ protected readonly controlElement: _angular_core.Signal<ElementRef<HTMLElement>>;
107
+ protected readonly displayValue: _angular_core.Signal<number>;
108
+ protected readonly effectiveAriaLabelledBy: _angular_core.Signal<string | null>;
109
+ protected readonly effectiveAriaValueText: _angular_core.Signal<string>;
110
+ protected readonly effectiveTabIndex: _angular_core.Signal<number>;
111
+ protected readonly hoveredTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
112
+ protected readonly iconClasses: _angular_core.Signal<string>;
113
+ protected readonly iconToRender: _angular_core.Signal<typeof LucideCircle | typeof LucideDiamond | typeof LucideFlame | typeof LucideHeart | typeof LucideStar>;
114
+ protected readonly interactionDisabled: _angular_core.Signal<boolean>;
115
+ protected readonly interactionStep: _angular_core.Signal<number>;
116
+ protected readonly invalidState: _angular_core.Signal<boolean>;
117
+ protected readonly itemClasses: _angular_core.Signal<string>;
118
+ protected readonly itemTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
119
+ protected readonly items: _angular_core.Signal<readonly RatingItemDescriptor[]>;
120
+ protected readonly labelClasses: _angular_core.Signal<string>;
121
+ protected readonly labelId: string;
122
+ protected readonly normalizedValue: _angular_core.Signal<number>;
123
+ protected readonly overlayClipClasses: _angular_core.Signal<string>;
124
+ protected readonly overlayColor: _angular_core.Signal<string>;
125
+ protected readonly overlayContentClasses: _angular_core.Signal<string>;
126
+ protected readonly overlayIconClasses: _angular_core.Signal<string>;
127
+ protected readonly overlayTemplate: _angular_core.Signal<TemplateRef<RatingItemTemplateContext> | undefined>;
128
+ protected readonly previewActive: _angular_core.Signal<boolean>;
129
+ protected readonly previewValue: _angular_core.WritableSignal<number | null>;
130
+ protected readonly selectedTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
131
+ /**
132
+ * @description Associates help text or an error description with the focusable rating control.
133
+ * @default null
134
+ */
135
+ readonly ariaDescribedBy: _angular_core.InputSignal<string | null>;
136
+ /**
137
+ * @description Explicit accessible name for the rating control. Provide `aria-label`,
138
+ * `aria-labelledby`, or `label` so assistive technology can announce the control.
139
+ * @default null
140
+ */
141
+ readonly ariaLabel: _angular_core.InputSignal<string | null>;
142
+ /**
143
+ * @description IDs of external elements providing the accessible name for the rating control.
144
+ * @default null
145
+ */
146
+ readonly ariaLabelledBy: _angular_core.InputSignal<string | null>;
147
+ /**
148
+ * @description Custom screen-reader value announcement. Receives the normalized value and the
149
+ * item count and returns the string to expose through `aria-valuetext`.
150
+ * @default null
151
+ */
152
+ readonly ariaValueText: _angular_core.InputSignal<((value: number, maximum: number) => string) | null>;
153
+ /**
154
+ * @description CSS color for selected and hovered rating visuals. Empty, `null`, and `undefined` values use the
155
+ * primary theme color.
156
+ * @default undefined
157
+ */
158
+ readonly color: _angular_core.InputSignal<string | null | undefined>;
159
+ /**
160
+ * @description Disables pointer and keyboard interaction and removes the control from the tab
161
+ * sequence. When bound to a signal form field via `[formField]`, this is written by the signal
162
+ * forms `Field` directive.
163
+ * @default false
164
+ */
165
+ readonly disabled: _angular_core.InputSignal<boolean>;
166
+ /**
167
+ * @description Built-in icon used for the default rating visuals. Choose `star`, `heart`,
168
+ * `circle`, `diamond`, or `flame`; use item templates to supply a custom icon.
169
+ * @default "star"
170
+ */
171
+ readonly icon: _angular_core.InputSignal<RatingIconName>;
172
+ /**
173
+ * @description Marks the component as invalid. Error styling requires both `invalid` and
174
+ * `touched` to be `true`. When bound to a signal form field via `[formField]`, this is written
175
+ * by the signal forms `Field` directive.
176
+ * @default false
177
+ */
178
+ readonly invalid: _angular_core.InputSignal<boolean>;
179
+ /**
180
+ * @description Number of rating items. Fractional values are floored and values below one are
181
+ * raised to one.
182
+ * @default 5
183
+ */
184
+ readonly itemsCount: _angular_core.InputSignalWithTransform<number, number>;
185
+ /**
186
+ * @description Optional visible label rendered before or after the rating items. When no
187
+ * explicit `aria-label` or `aria-labelledby` is supplied, the label provides the accessible
188
+ * name.
189
+ * @default null
190
+ */
191
+ readonly label: _angular_core.InputSignal<string | null>;
192
+ /**
193
+ * @description Places the visible label before or after the item group.
194
+ * @default "after"
195
+ */
196
+ readonly labelPosition: _angular_core.InputSignal<RatingLabelPosition>;
197
+ /**
198
+ * @description Selection granularity of the rating.
199
+ * @default "item"
200
+ */
201
+ readonly precision: _angular_core.InputSignal<RatingPrecision>;
202
+ /**
203
+ * @description Prevents value changes while preserving focusability and normal visual emphasis.
204
+ * @default false
205
+ */
206
+ readonly readonly: _angular_core.InputSignal<boolean>;
207
+ /**
208
+ * @description Controls cumulative or single-item filling.
209
+ * @default "continuous"
210
+ */
211
+ readonly selection: _angular_core.InputSignal<RatingSelectionMode>;
212
+ /**
213
+ * @description Size preset controlling the icon dimensions, item hitboxes, spacing, and label
214
+ * typography.
215
+ * @default "medium"
216
+ */
217
+ readonly size: _angular_core.InputSignal<"small" | "medium" | "large" | null | undefined>;
218
+ /**
219
+ * @description Tab index applied to the focusable rating control when not disabled. Accepts a
220
+ * numeric string and converts it to a number.
221
+ * @default 0
222
+ */
223
+ readonly tabindex: _angular_core.InputSignalWithTransform<number, string | number>;
224
+ /**
225
+ * @description Emitted when the user interacts with the control, marking the field as touched.
226
+ */
227
+ readonly touch: _angular_core.OutputEmitterRef<void>;
228
+ /**
229
+ * @description Marks the component as touched. When bound to a signal form field via
230
+ * `[formField]`, this is written by the signal forms `Field` directive.
231
+ * @default false
232
+ */
233
+ readonly touched: _angular_core.InputSignal<boolean>;
234
+ /**
235
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
236
+ * @default ""
237
+ */
238
+ readonly userClass: _angular_core.InputSignal<string>;
239
+ /**
240
+ * @description Current rating value. `0` represents an unrated state. Values are normalized
241
+ * for rendering but are not rewritten until the user interacts with the component.
242
+ * @default 0
243
+ */
244
+ readonly value: _angular_core.ModelSignal<number>;
245
+ blur(): void;
246
+ focus(options?: FocusOptions): void;
247
+ protected createItemContext(item: RatingItemDescriptor): RatingItemTemplateContext;
248
+ protected getItemFill(itemValue: number): number;
249
+ protected onBlur(): void;
250
+ protected onClick(event: MouseEvent): void;
251
+ protected onKeydown(event: KeyboardEvent): void;
252
+ protected onPointerLeave(): void;
253
+ protected onPointerMove(event: PointerEvent): void;
254
+ private getCandidateFromPointerEvent;
255
+ private getKeyAction;
256
+ private normalizeCandidate;
257
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RatingComponent, never>;
258
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RatingComponent, "mona-rating", never, { "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaValueText": { "alias": "ariaValueText"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "itemsCount": { "alias": "itemsCount"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "precision": { "alias": "precision"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "touch": "touch"; "value": "valueChange"; }, ["hoveredTemplate", "itemTemplate", "selectedTemplate"], never, true, never>;
259
+ }
260
+
261
+ /**
262
+ * @description Renders the pointer-preview visual for rating items. Overrides the default preset
263
+ * overlay whenever the visible state comes from pointer preview.
264
+ */
265
+ declare class RatingHoveredItemTemplateDirective {
266
+ readonly templateRef: TemplateRef<RatingItemTemplateContext>;
267
+ static ngTemplateContextGuard(_directive: RatingHoveredItemTemplateDirective, context: unknown): context is RatingItemTemplateContext;
268
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RatingHoveredItemTemplateDirective, never>;
269
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RatingHoveredItemTemplateDirective, "ng-template[monaRatingHoveredItemTemplate]", never, {}, {}, never, never, true, never>;
270
+ }
271
+
272
+ /**
273
+ * @description Renders the default (unselected) visual for every rating item. Overrides the
274
+ * default preset icon for the base layer of each item.
275
+ */
276
+ declare class RatingItemTemplateDirective {
277
+ readonly templateRef: TemplateRef<RatingItemTemplateContext>;
278
+ static ngTemplateContextGuard(_directive: RatingItemTemplateDirective, context: unknown): context is RatingItemTemplateContext;
279
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RatingItemTemplateDirective, never>;
280
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RatingItemTemplateDirective, "ng-template[monaRatingItemTemplate]", never, {}, {}, never, never, true, never>;
281
+ }
282
+
283
+ /**
284
+ * @description Renders the committed selected visual for rating items. Overrides the default
285
+ * preset overlay whenever the visible state comes from the committed value.
286
+ */
287
+ declare class RatingSelectedItemTemplateDirective {
288
+ readonly templateRef: TemplateRef<RatingItemTemplateContext>;
289
+ static ngTemplateContextGuard(_directive: RatingSelectedItemTemplateDirective, context: unknown): context is RatingItemTemplateContext;
290
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RatingSelectedItemTemplateDirective, never>;
291
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RatingSelectedItemTemplateDirective, "ng-template[monaRatingSelectedItemTemplate]", never, {}, {}, never, never, true, never>;
292
+ }
293
+
294
+ export { RatingComponent, RatingHoveredItemTemplateDirective, RatingItemTemplateDirective, RatingSelectedItemTemplateDirective };
295
+ export type { RatingIconName, RatingItemTemplateContext, RatingLabelPosition, RatingPrecision, RatingSelectionMode, RatingVariantProps };
@@ -59,7 +59,7 @@ declare class SegmentedComponent<T extends SegmentedValue = SegmentedValue> impl
59
59
  readonly options: _angular_core.InputSignal<readonly SegmentedOption<T>[]>;
60
60
  /**
61
61
  * @description Border-radius preset applied to the segmented container and its options.
62
- * @default "large"
62
+ * @default "medium"
63
63
  */
64
64
  readonly rounded: _angular_core.InputSignal<"none" | "small" | "medium" | "large" | "full" | null | undefined>;
65
65
  /**