@nanahoshi/mona-ui 0.24.10 → 0.25.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.
- package/README.md +9 -0
- package/chart/README.md +223 -77
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -10
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +37 -20
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +239 -47
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +184 -31
- package/fesm2022/nanahoshi-mona-ui-button.mjs +47 -11
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +17 -13
- package/fesm2022/nanahoshi-mona-ui-card.mjs +54 -30
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +1909 -666
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +112 -31
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +131 -89
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +59 -19
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +118 -41
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +243 -212
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +155 -86
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +161 -131
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +12 -11
- package/fesm2022/nanahoshi-mona-ui-common.mjs +18 -1
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +25 -24
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +202 -33
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +31 -10
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs → nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs → nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs} +7 -7
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs} +27 -29
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +146 -5
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +7 -7
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +183 -47
- package/fesm2022/nanahoshi-mona-ui-label.mjs +111 -15
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +111 -5
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +103 -5
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +103 -5
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +100 -6
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +90 -5
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +103 -5
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +90 -5
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +90 -5
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +103 -5
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +105 -5
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +103 -5
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +90 -5
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +90 -5
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +14 -13
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +13 -12
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +192 -56
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +3 -1
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +60 -29
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +334 -37
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +84 -30
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +274 -108
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +127 -37
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +595 -170
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +323 -166
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +167 -82
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +273 -165
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +219 -132
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +84 -32
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +337 -116
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +10 -12
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +21 -8
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +444 -88
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +15 -14
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +17 -3
- package/fesm2022/nanahoshi-mona-ui-window.mjs +1 -1
- package/i18n/catalogs/en-US.messages.json +90 -5
- package/locales/ar-sa/ar-sa.messages.json +90 -5
- package/locales/de-de/de-de.messages.json +90 -5
- package/locales/es-es/es-es.messages.json +90 -5
- package/locales/fr-fr/fr-fr.messages.json +91 -6
- package/locales/id-id/id-id.messages.json +90 -5
- package/locales/it-it/it-it.messages.json +90 -5
- package/locales/ja-jp/ja-jp.messages.json +90 -5
- package/locales/ko-kr/ko-kr.messages.json +90 -5
- package/locales/pt-br/pt-br.messages.json +90 -5
- package/locales/ru-ru/ru-ru.messages.json +90 -5
- package/locales/tr-tr/tr-tr.messages.json +90 -5
- package/locales/zh-cn/zh-cn.messages.json +90 -5
- package/locales/zh-tw/zh-tw.messages.json +90 -5
- package/package.json +2 -1
- package/styles.css +156 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +18 -11
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +62 -14
- package/types/nanahoshi-mona-ui-button-group.d.ts +86 -16
- package/types/nanahoshi-mona-ui-button.d.ts +26 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
- package/types/nanahoshi-mona-ui-card.d.ts +22 -6
- package/types/nanahoshi-mona-ui-chart.d.ts +519 -527
- package/types/nanahoshi-mona-ui-check-box.d.ts +54 -13
- package/types/nanahoshi-mona-ui-chip.d.ts +31 -18
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +21 -5
- package/types/nanahoshi-mona-ui-collapsible.d.ts +20 -11
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +62 -36
- package/types/nanahoshi-mona-ui-color-palette.d.ts +65 -27
- package/types/nanahoshi-mona-ui-color-picker.d.ts +64 -23
- package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-common.d.ts +28 -2
- package/types/nanahoshi-mona-ui-date-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +1 -0
- package/types/nanahoshi-mona-ui-editor.d.ts +1 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +51 -7
- package/types/nanahoshi-mona-ui-fieldset.d.ts +18 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +0 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +130 -3
- package/types/nanahoshi-mona-ui-internal.d.ts +95 -14
- package/types/nanahoshi-mona-ui-label.d.ts +17 -2
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +85 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +85 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +1 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-otp-input.d.ts +49 -12
- package/types/nanahoshi-mona-ui-placeholder.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +21 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +165 -20
- package/types/nanahoshi-mona-ui-rating.d.ts +21 -6
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +59 -27
- package/types/nanahoshi-mona-ui-segmented.d.ts +52 -24
- package/types/nanahoshi-mona-ui-sidebar.d.ts +104 -41
- package/types/nanahoshi-mona-ui-skeleton.d.ts +1 -1
- package/types/nanahoshi-mona-ui-slider.d.ts +99 -35
- package/types/nanahoshi-mona-ui-spinner.d.ts +9 -5
- package/types/nanahoshi-mona-ui-splitter.d.ts +31 -10
- package/types/nanahoshi-mona-ui-stepper.d.ts +58 -12
- package/types/nanahoshi-mona-ui-switch.d.ts +32 -10
- package/types/nanahoshi-mona-ui-tabs.d.ts +75 -20
- package/types/nanahoshi-mona-ui-text-area.d.ts +7 -7
- package/types/nanahoshi-mona-ui-text-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +392 -15
- package/types/nanahoshi-mona-ui-time-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-time-selector.d.ts +1 -0
- package/types/nanahoshi-mona-ui-tooltip.d.ts +7 -1
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
2
2
|
import { MonaI18nService, MonaSliderMessages } from '@nanahoshi/mona-ui/i18n';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { Signal, DestroyRef, TemplateRef, ElementRef, NgZone } from '@angular/core';
|
|
5
5
|
import { FormValueControl } from '@angular/forms/signals';
|
|
6
6
|
import { Orientation } from '@nanahoshi/mona-ui/common';
|
|
7
7
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
8
8
|
import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
9
9
|
import { VariantProps } from 'class-variance-authority';
|
|
10
10
|
|
|
11
|
-
declare class SliderTickDirective {
|
|
12
|
-
readonly host: ElementRef<HTMLSpanElement>;
|
|
13
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SliderTickDirective, never>;
|
|
14
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SliderTickDirective, "span[monaSliderTick]", never, {}, {}, never, never, true, never>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
11
|
interface LabelStyleArgs {
|
|
18
12
|
direction: "ltr" | "rtl";
|
|
19
13
|
labelPosition: "before" | "after";
|
|
@@ -72,29 +66,37 @@ type SliderVariantProps = SliderBaseVariantProps & SliderTrackVariantProps & Sli
|
|
|
72
66
|
type SliderVariantInputs = SliderBaseVariantInputs & SliderTrackVariantInputs & SliderSelectionVariantInputs & SliderTickListVariantInputs & SliderTickVariantInputs & SliderTickLabelListVariantInputs & SliderTickLabelVariantInputs & SliderHandleVariantInputs;
|
|
73
67
|
|
|
74
68
|
declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
69
|
+
#private;
|
|
75
70
|
protected readonly baseClasses: Signal<string>;
|
|
76
71
|
protected readonly destroyRef: DestroyRef;
|
|
72
|
+
protected readonly direction: Signal<_nanahoshi_mona_ui_i18n.MonaTextDirection>;
|
|
77
73
|
protected readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
78
74
|
protected readonly effectiveDisabled: Signal<boolean>;
|
|
75
|
+
protected readonly effectiveMax: Signal<number>;
|
|
76
|
+
protected readonly effectiveMin: Signal<number>;
|
|
79
77
|
protected readonly handleTemplate: Signal<TemplateRef<any> | undefined>;
|
|
80
78
|
protected readonly handleTemplateStyles: Signal<Partial<CSSStyleDeclaration>>;
|
|
81
|
-
protected readonly
|
|
79
|
+
protected readonly horizontalSelectionLeft: Signal<number | undefined>;
|
|
80
|
+
protected readonly horizontalSelectionRight: Signal<number | undefined>;
|
|
82
81
|
protected readonly hostElementRef: ElementRef<HTMLDivElement>;
|
|
83
82
|
protected readonly i18n: MonaI18nService;
|
|
83
|
+
protected readonly interactionDisabled: Signal<boolean>;
|
|
84
|
+
protected readonly invalidState: Signal<boolean>;
|
|
84
85
|
protected readonly isRtl: Signal<boolean>;
|
|
85
86
|
protected readonly labelStyleArgs: Signal<LabelStyleArgs>;
|
|
86
|
-
protected readonly labelTicks: Signal<
|
|
87
|
+
protected readonly labelTicks: Signal<{
|
|
88
|
+
label: string;
|
|
89
|
+
index: number;
|
|
90
|
+
value: number;
|
|
91
|
+
width?: number;
|
|
92
|
+
}[]>;
|
|
93
|
+
protected readonly labelledBy: Signal<string | null>;
|
|
87
94
|
protected readonly renderTicks: Signal<SliderTick[]>;
|
|
88
95
|
protected readonly selectionBackgroundStyle: Signal<Partial<CSSStyleDeclaration>>;
|
|
89
|
-
protected abstract readonly selectionLeft: Signal<number>;
|
|
90
|
-
protected abstract readonly selectionRight: Signal<number>;
|
|
91
|
-
protected readonly horizontalSelectionLeft: Signal<number | undefined>;
|
|
92
|
-
protected readonly horizontalSelectionRight: Signal<number | undefined>;
|
|
93
96
|
protected readonly selectionClasses: Signal<string>;
|
|
94
97
|
protected readonly sliderHandleClasses: Signal<string>;
|
|
95
98
|
protected readonly sliderTrackSize: Signal<string | null>;
|
|
96
99
|
protected readonly tickClasses: Signal<string>;
|
|
97
|
-
protected readonly tickElements: Signal<readonly SliderTickDirective[]>;
|
|
98
100
|
protected readonly tickLabelClasses: Signal<string>;
|
|
99
101
|
protected readonly tickLabelListClasses: Signal<string>;
|
|
100
102
|
protected readonly tickListClasses: Signal<string>;
|
|
@@ -104,6 +106,23 @@ declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
|
104
106
|
protected readonly trackBackgroundStyle: Signal<Partial<CSSStyleDeclaration>>;
|
|
105
107
|
protected readonly trackClasses: Signal<string>;
|
|
106
108
|
protected readonly zone: NgZone;
|
|
109
|
+
/**
|
|
110
|
+
* @description Id of an element that describes the control, such as an error message. On a range slider it describes
|
|
111
|
+
* each handle.
|
|
112
|
+
* @default null
|
|
113
|
+
*/
|
|
114
|
+
readonly ariaDescribedBy: _angular_core.InputSignal<string | null>;
|
|
115
|
+
/**
|
|
116
|
+
* @description Accessible name of the control. On a range slider it names the group holding both handles.
|
|
117
|
+
* @default null
|
|
118
|
+
*/
|
|
119
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
120
|
+
/**
|
|
121
|
+
* @description Id of the element that labels the control. On a range slider each handle reads it before its own
|
|
122
|
+
* name.
|
|
123
|
+
* @default null
|
|
124
|
+
*/
|
|
125
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | null>;
|
|
107
126
|
/**
|
|
108
127
|
* @description Human-readable override for the `aria-valuenow` announcement. Pass a function that receives the current value and returns the string to announce.
|
|
109
128
|
* @default null
|
|
@@ -113,7 +132,7 @@ declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
|
113
132
|
* @description Renders the component with reduced visual emphasis and removes pointer interaction.
|
|
114
133
|
* @default false
|
|
115
134
|
*/
|
|
116
|
-
readonly disabled: _angular_core.
|
|
135
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
117
136
|
/**
|
|
118
137
|
* @description Additional CSS classes to apply to the slider handle.
|
|
119
138
|
* @default []
|
|
@@ -125,10 +144,11 @@ declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
|
125
144
|
*/
|
|
126
145
|
readonly handleStyles: _angular_core.InputSignal<Partial<CSSStyleDeclaration>>;
|
|
127
146
|
/**
|
|
128
|
-
* @description Marks the control as invalid for form validation purposes, reflecting `aria-invalid` on the handle
|
|
147
|
+
* @description Marks the control as invalid for form validation purposes, reflecting `aria-invalid` on the handle
|
|
148
|
+
* element once the control is touched.
|
|
129
149
|
* @default false
|
|
130
150
|
*/
|
|
131
|
-
readonly invalid: _angular_core.
|
|
151
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
132
152
|
/**
|
|
133
153
|
* @description Position of the label relative to the component.
|
|
134
154
|
* @default "after"
|
|
@@ -159,6 +179,12 @@ declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
|
159
179
|
* @default "horizontal"
|
|
160
180
|
*/
|
|
161
181
|
readonly orientation: _angular_core.InputSignal<Orientation>;
|
|
182
|
+
/**
|
|
183
|
+
* @description Prevents value changes while the control stays focusable and readable. When bound to a signal form
|
|
184
|
+
* field via `[formField]`, this is written by the `FormField` directive.
|
|
185
|
+
* @default false
|
|
186
|
+
*/
|
|
187
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
162
188
|
/**
|
|
163
189
|
* @description Border-radius preset applied to the slider handle.
|
|
164
190
|
* @default "full"
|
|
@@ -178,26 +204,33 @@ declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
|
178
204
|
* @description Displays value labels alongside tick marks. Only takes effect when `showTicks` is `true`.
|
|
179
205
|
* @default false
|
|
180
206
|
*/
|
|
181
|
-
readonly showLabels: _angular_core.
|
|
207
|
+
readonly showLabels: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
182
208
|
/**
|
|
183
209
|
* @description Displays tick marks at each step position along the track.
|
|
184
210
|
* @default false
|
|
185
211
|
*/
|
|
186
|
-
readonly showTicks: _angular_core.
|
|
212
|
+
readonly showTicks: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
187
213
|
/**
|
|
188
214
|
* @description Controls how many ticks are visible — only every n<sup>th</sup> tick is rendered.
|
|
189
215
|
* @default 1
|
|
190
216
|
*/
|
|
191
217
|
readonly smallTickStep: _angular_core.InputSignalWithTransform<number, number>;
|
|
192
218
|
/**
|
|
193
|
-
* @description
|
|
219
|
+
* @description Distance between the values the control can take. `maxValue` can always be reached, even when it
|
|
220
|
+
* isn't a whole number of steps from `minValue`.
|
|
194
221
|
* @default 1
|
|
195
222
|
*/
|
|
196
223
|
readonly step: _angular_core.InputSignalWithTransform<number, number>;
|
|
197
224
|
/**
|
|
198
|
-
* @description Emitted when
|
|
225
|
+
* @description Emitted when a handle loses focus. A click on the track moves focus to the handle first.
|
|
199
226
|
*/
|
|
200
227
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
228
|
+
/**
|
|
229
|
+
* @description Marks the slider as touched. Error styling requires both `invalid` and `touched` to be `true`.
|
|
230
|
+
* When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
|
|
231
|
+
* @default false
|
|
232
|
+
*/
|
|
233
|
+
readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
201
234
|
/**
|
|
202
235
|
* @description Background color of the unfilled track portion. Accepts a CSS color string or a `CSSStyleDeclaration` partial.
|
|
203
236
|
* @default null
|
|
@@ -208,22 +241,32 @@ declare abstract class SliderBaseComponent implements SliderVariantInputs {
|
|
|
208
241
|
* @default undefined
|
|
209
242
|
*/
|
|
210
243
|
readonly trackSize: _angular_core.InputSignal<string | number | undefined>;
|
|
244
|
+
protected abstract readonly selectionLeft: Signal<number>;
|
|
245
|
+
protected abstract readonly selectionRight: Signal<number>;
|
|
246
|
+
protected abstract readonly valueIsShown: Signal<boolean>;
|
|
211
247
|
constructor();
|
|
212
248
|
protected calculateNewValue(currentValue: number, event: KeyboardEvent): number;
|
|
213
249
|
protected clampValue(value: number): number;
|
|
214
|
-
protected
|
|
250
|
+
protected getMaxOverride(): number | undefined;
|
|
251
|
+
protected getMinOverride(): number | undefined;
|
|
215
252
|
protected getValueFromPointerEvent(event: PointerEvent): number;
|
|
216
253
|
protected getValueFromPosition(position: number): number;
|
|
217
254
|
protected isNavigationKey(event: KeyboardEvent): boolean;
|
|
218
255
|
protected positionFromValue(value: number): number;
|
|
219
256
|
protected snapValue(value: number): number;
|
|
257
|
+
/**
|
|
258
|
+
* Moves a value while the given handle is dragged with the primary button, one finger or a pen. The pointer is
|
|
259
|
+
* captured, so a release outside the page still ends the drag.
|
|
260
|
+
*/
|
|
261
|
+
protected trackHandleDrag(handle: HTMLElement, startDrag: () => (event: PointerEvent) => void): void;
|
|
220
262
|
protected abstract setSubscriptions(): void;
|
|
263
|
+
abstract focus(options?: FocusOptions): void;
|
|
221
264
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SliderBaseComponent, never>;
|
|
222
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SliderBaseComponent, never, never, { "ariaValueText": { "alias": "ariaValueText"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "handleClasses": { "alias": "handleClasses"; "required": false; "isSignal": true; }; "handleStyles": { "alias": "handleStyles"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "labelStep": { "alias": "labelStep"; "required": false; "isSignal": true; }; "largeTickStep": { "alias": "largeTickStep"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selectionBackground": { "alias": "selectionBackground"; "required": false; "isSignal": true; }; "shiftMultiplier": { "alias": "shiftMultiplier"; "required": false; "isSignal": true; }; "showLabels": { "alias": "showLabels"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "smallTickStep": { "alias": "smallTickStep"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "trackBackground": { "alias": "trackBackground"; "required": false; "isSignal": true; }; "trackSize": { "alias": "trackSize"; "required": false; "isSignal": true; }; }, { "touch": "touch"; }, ["handleTemplate", "tickValueTemplate"], never, true, never>;
|
|
265
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SliderBaseComponent, never, 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; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "handleClasses": { "alias": "handleClasses"; "required": false; "isSignal": true; }; "handleStyles": { "alias": "handleStyles"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "labelStep": { "alias": "labelStep"; "required": false; "isSignal": true; }; "largeTickStep": { "alias": "largeTickStep"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selectionBackground": { "alias": "selectionBackground"; "required": false; "isSignal": true; }; "shiftMultiplier": { "alias": "shiftMultiplier"; "required": false; "isSignal": true; }; "showLabels": { "alias": "showLabels"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "smallTickStep": { "alias": "smallTickStep"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "trackBackground": { "alias": "trackBackground"; "required": false; "isSignal": true; }; "trackSize": { "alias": "trackSize"; "required": false; "isSignal": true; }; }, { "touch": "touch"; }, ["handleTemplate", "tickValueTemplate"], never, true, never>;
|
|
223
266
|
}
|
|
224
267
|
|
|
225
268
|
declare class SliderComponent extends SliderBaseComponent implements FormValueControl<number> {
|
|
226
|
-
protected readonly computedAriaLabel: Signal<string>;
|
|
269
|
+
protected readonly computedAriaLabel: Signal<string | null>;
|
|
227
270
|
protected readonly handleFocused: _angular_core.WritableSignal<boolean>;
|
|
228
271
|
protected readonly handlePosition: Signal<number>;
|
|
229
272
|
protected readonly handleStyle: Signal<Partial<CSSStyleDeclaration>>;
|
|
@@ -232,23 +275,29 @@ declare class SliderComponent extends SliderBaseComponent implements FormValueCo
|
|
|
232
275
|
protected readonly selectionLeft: Signal<number>;
|
|
233
276
|
protected readonly selectionRight: Signal<number>;
|
|
234
277
|
protected readonly sliderHandle: Signal<ElementRef<HTMLDivElement>>;
|
|
278
|
+
protected readonly valueIsShown: Signal<boolean>;
|
|
235
279
|
/**
|
|
236
|
-
* @description
|
|
237
|
-
*
|
|
238
|
-
* @default
|
|
280
|
+
* @description Upper bound that wins over `maxValue`. When bound to a signal form field via `[formField]`, this is
|
|
281
|
+
* written from the field's `max` rule.
|
|
282
|
+
* @default undefined
|
|
239
283
|
*/
|
|
240
|
-
readonly
|
|
284
|
+
readonly max: _angular_core.InputSignal<number | undefined>;
|
|
241
285
|
/**
|
|
242
|
-
* @description
|
|
243
|
-
*
|
|
286
|
+
* @description Lower bound that wins over `minValue`. When bound to a signal form field via `[formField]`, this is
|
|
287
|
+
* written from the field's `min` rule.
|
|
288
|
+
* @default undefined
|
|
244
289
|
*/
|
|
245
|
-
readonly
|
|
290
|
+
readonly min: _angular_core.InputSignal<number | undefined>;
|
|
246
291
|
/**
|
|
247
|
-
* @description Current value.
|
|
292
|
+
* @description Current value. A value out of range or off the step grid is shown at the nearest valid value, and
|
|
293
|
+
* the model keeps its own until the user changes it, so a `maxValue` that loads late can't overwrite saved data. A
|
|
294
|
+
* development warning reports it.
|
|
248
295
|
* @default 0
|
|
249
296
|
*/
|
|
250
297
|
readonly value: _angular_core.ModelSignal<number>;
|
|
251
298
|
focus(options?: FocusOptions): void;
|
|
299
|
+
protected getMaxOverride(): number | undefined;
|
|
300
|
+
protected getMinOverride(): number | undefined;
|
|
252
301
|
protected handleHandleMove(event: PointerEvent): void;
|
|
253
302
|
protected setSubscriptions(): void;
|
|
254
303
|
private setClickSubscription;
|
|
@@ -257,12 +306,14 @@ declare class SliderComponent extends SliderBaseComponent implements FormValueCo
|
|
|
257
306
|
private setPointerMoveSubscription;
|
|
258
307
|
private updateValue;
|
|
259
308
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SliderComponent, never>;
|
|
260
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SliderComponent, "mona-slider", never, { "
|
|
309
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SliderComponent, "mona-slider", never, { "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
261
310
|
}
|
|
262
311
|
|
|
263
312
|
declare class RangeSliderComponent extends SliderBaseComponent implements FormValueControl<[number, number]> {
|
|
264
313
|
protected readonly computedAriaLabelEnd: Signal<string>;
|
|
265
314
|
protected readonly computedAriaLabelStart: Signal<string>;
|
|
315
|
+
protected readonly endHandleId: string;
|
|
316
|
+
protected readonly endLabelledBy: Signal<string | null>;
|
|
266
317
|
protected readonly handlePositions: Signal<[number, number]>;
|
|
267
318
|
protected readonly handlesOverlap: Signal<boolean>;
|
|
268
319
|
protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaSliderMessages>;
|
|
@@ -278,6 +329,9 @@ declare class RangeSliderComponent extends SliderBaseComponent implements FormVa
|
|
|
278
329
|
protected readonly selectionLeft: Signal<number>;
|
|
279
330
|
protected readonly selectionRight: Signal<number>;
|
|
280
331
|
protected readonly sliderHandle: Signal<ElementRef<HTMLDivElement>>;
|
|
332
|
+
protected readonly startHandleId: string;
|
|
333
|
+
protected readonly startLabelledBy: Signal<string | null>;
|
|
334
|
+
protected readonly valueIsShown: Signal<boolean>;
|
|
281
335
|
/**
|
|
282
336
|
* @description Accessible name for the upper-value (secondary) handle.
|
|
283
337
|
* @default null
|
|
@@ -290,7 +344,8 @@ declare class RangeSliderComponent extends SliderBaseComponent implements FormVa
|
|
|
290
344
|
readonly ariaLabelStart: _angular_core.InputSignal<string | null>;
|
|
291
345
|
/**
|
|
292
346
|
* @description Selected range as `[minimum, maximum]`.
|
|
293
|
-
*
|
|
347
|
+
* A value out of range, off the step grid or unsorted is shown at the nearest valid values, and the model keeps its
|
|
348
|
+
* own until the user changes it. A development warning reports it.
|
|
294
349
|
* @default [0, 10]
|
|
295
350
|
*/
|
|
296
351
|
readonly value: _angular_core.ModelSignal<[number, number]>;
|
|
@@ -302,17 +357,26 @@ declare class RangeSliderComponent extends SliderBaseComponent implements FormVa
|
|
|
302
357
|
private setFocusSubscription;
|
|
303
358
|
private setKeydownSubscription;
|
|
304
359
|
private setPointerMoveSubscription;
|
|
360
|
+
private trackRangeHandle;
|
|
305
361
|
private updateRangedValue;
|
|
306
362
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RangeSliderComponent, never>;
|
|
307
363
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RangeSliderComponent, "mona-range-slider", never, { "ariaLabelEnd": { "alias": "aria-label-end"; "required": false; "isSignal": true; }; "ariaLabelStart": { "alias": "aria-label-start"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
308
364
|
}
|
|
309
365
|
|
|
366
|
+
interface SliderHandleTemplateContext {
|
|
367
|
+
readonly $implicit: number;
|
|
368
|
+
}
|
|
310
369
|
declare class SliderHandleTemplateDirective {
|
|
370
|
+
static ngTemplateContextGuard(_directive: SliderHandleTemplateDirective, _context: unknown): _context is SliderHandleTemplateContext;
|
|
311
371
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SliderHandleTemplateDirective, never>;
|
|
312
372
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SliderHandleTemplateDirective, "ng-template[monaSliderHandleTemplate]", never, {}, {}, never, never, true, never>;
|
|
313
373
|
}
|
|
314
374
|
|
|
375
|
+
interface SliderTickValueTemplateContext {
|
|
376
|
+
readonly $implicit: number;
|
|
377
|
+
}
|
|
315
378
|
declare class SliderTickValueTemplateDirective {
|
|
379
|
+
static ngTemplateContextGuard(_directive: SliderTickValueTemplateDirective, _context: unknown): _context is SliderTickValueTemplateContext;
|
|
316
380
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SliderTickValueTemplateDirective, never>;
|
|
317
381
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SliderTickValueTemplateDirective, "ng-template[monaSliderTickValueTemplate]", never, {}, {}, never, never, true, never>;
|
|
318
382
|
}
|
|
@@ -320,4 +384,4 @@ declare class SliderTickValueTemplateDirective {
|
|
|
320
384
|
declare const SLIDER_DEFAULT_MESSAGES: MonaSliderMessages;
|
|
321
385
|
|
|
322
386
|
export { RangeSliderComponent, SLIDER_DEFAULT_MESSAGES, SliderComponent, SliderHandleTemplateDirective, SliderTickValueTemplateDirective };
|
|
323
|
-
export type { SliderVariantProps };
|
|
387
|
+
export type { SliderHandleTemplateContext, SliderLabelPosition, SliderTickValueTemplateContext, SliderVariantProps };
|
|
@@ -26,7 +26,8 @@ type SpinnerVariantInput = VariantInputs<SpinnerVariantProps>;
|
|
|
26
26
|
/**
|
|
27
27
|
* @description
|
|
28
28
|
* An indeterminate loading indicator primitive for communicating ongoing activity.
|
|
29
|
-
* Supports multiple appearances
|
|
29
|
+
* Supports multiple appearances and standard sizes. It's a named image, so it's found when a screen reader reaches it,
|
|
30
|
+
* not announced. To announce loading, use `SpinnerService` or a live region that's already on the page.
|
|
30
31
|
*/
|
|
31
32
|
declare class SpinnerComponent implements SpinnerVariantInput {
|
|
32
33
|
#private;
|
|
@@ -40,17 +41,18 @@ declare class SpinnerComponent implements SpinnerVariantInput {
|
|
|
40
41
|
*/
|
|
41
42
|
readonly appearance: _angular_core.InputSignal<SpinnerAppearance>;
|
|
42
43
|
/**
|
|
43
|
-
* @description Accessible
|
|
44
|
+
* @description Accessible name of the spinner when it is not decorative.
|
|
44
45
|
* When not set, falls back to the localized loading text.
|
|
45
46
|
* @default undefined
|
|
46
47
|
*/
|
|
47
48
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
48
49
|
/**
|
|
49
|
-
* @description When `true`, removes the `
|
|
50
|
-
* Useful when a parent element already manages loading semantics (such as
|
|
50
|
+
* @description When `true`, removes the `img` role and hides the spinner from assistive technology with `aria-hidden="true"`.
|
|
51
|
+
* Useful when visible text says the same thing, or a parent element already manages loading semantics (such as
|
|
52
|
+
* `aria-busy="true"` on a button).
|
|
51
53
|
* @default false
|
|
52
54
|
*/
|
|
53
|
-
readonly decorative: _angular_core.
|
|
55
|
+
readonly decorative: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
54
56
|
/**
|
|
55
57
|
* @description Size preset controlling the dimensions of the indicator.
|
|
56
58
|
* @default "medium"
|
|
@@ -113,6 +115,8 @@ declare class SpinnerService implements OnDestroy {
|
|
|
113
115
|
/**
|
|
114
116
|
* Wraps an Observable operation with a Spinner lifecycle.
|
|
115
117
|
* Shows the spinner on subscription and closes it when the observable completes, errors, or is unsubscribed.
|
|
118
|
+
* Cancelling a `cancellable` spinner completes the returned observable and unsubscribes from the source, which also
|
|
119
|
+
* aborts an HTTP request.
|
|
116
120
|
*/
|
|
117
121
|
track<T>(source: Observable<T>, options?: SpinnerOptions): Observable<T>;
|
|
118
122
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpinnerService, never>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { TemplateRef } from '@angular/core';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
4
|
import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import { MonaSplitterMessages } from '@nanahoshi/mona-ui/i18n';
|
|
7
7
|
|
|
8
8
|
declare const splitterBaseThemeVariants: (props?: ({
|
|
9
9
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
/** The bar's place in the layout. Above the panes, because its hit area and focus outline reach over them. */
|
|
11
12
|
declare const splitterResizerThemeVariants: (props?: ({
|
|
12
13
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
13
|
-
resizing?: boolean | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
/** Sits over the bar without taking its pointer, except for the buttons, which are 24 pixels so a finger can hit them. */
|
|
15
16
|
declare const splitterResizerHandleThemeVariants: (props?: ({
|
|
16
17
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
17
18
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -21,7 +22,7 @@ type SplitterResizerVariantProps = VariantProps<typeof splitterResizerThemeVaria
|
|
|
21
22
|
type SplitterResizerVariantInput = VariantInputs<SplitterResizerVariantProps>;
|
|
22
23
|
type SplitterResizerHandleVariantProps = VariantProps<typeof splitterResizerHandleThemeVariants>;
|
|
23
24
|
type SplitterResizerHandleVariantInput = VariantInputs<SplitterResizerHandleVariantProps>;
|
|
24
|
-
type SplitterVariantInput = SplitterBaseVariantInput &
|
|
25
|
+
type SplitterVariantInput = SplitterBaseVariantInput & SplitterResizerVariantInput & SplitterResizerHandleVariantInput;
|
|
25
26
|
|
|
26
27
|
declare class SplitterPaneComponent {
|
|
27
28
|
/**
|
|
@@ -31,19 +32,28 @@ declare class SplitterPaneComponent {
|
|
|
31
32
|
/**
|
|
32
33
|
* @description Whether the pane is collapsible.
|
|
33
34
|
*/
|
|
34
|
-
readonly collapsible: _angular_core.
|
|
35
|
+
readonly collapsible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* @description Names the separator after this pane, for assistive technology. Without it, the separator has a generic
|
|
38
|
+
* name, which can't tell one from another when a splitter has several.
|
|
39
|
+
* @default ""
|
|
40
|
+
*/
|
|
41
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
35
42
|
/**
|
|
36
|
-
* @description The maximum size of the pane.
|
|
43
|
+
* @description The maximum size of the pane, in pixels. A number or a string like `"200px"`. Percentages aren't
|
|
44
|
+
* supported, and are ignored with a warning in development.
|
|
37
45
|
*/
|
|
38
46
|
readonly max: _angular_core.InputSignal<string | number | null>;
|
|
39
47
|
/**
|
|
40
|
-
* @description The minimum size of the pane.
|
|
48
|
+
* @description The minimum size of the pane, in pixels. A number or a string like `"200px"`. Percentages aren't
|
|
49
|
+
* supported, and are ignored with a warning in development.
|
|
41
50
|
*/
|
|
42
51
|
readonly min: _angular_core.InputSignal<string | number | null>;
|
|
43
52
|
/**
|
|
44
|
-
* @description Whether the pane is resizable.
|
|
53
|
+
* @description Whether the pane is resizable. A separator only moves, by pointer or key, when the panes on both of its
|
|
54
|
+
* sides are.
|
|
45
55
|
*/
|
|
46
|
-
readonly resizable: _angular_core.
|
|
56
|
+
readonly resizable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
47
57
|
/**
|
|
48
58
|
* @description The size of the pane.
|
|
49
59
|
*/
|
|
@@ -51,19 +61,30 @@ declare class SplitterPaneComponent {
|
|
|
51
61
|
readonly template: _angular_core.Signal<TemplateRef<any>>;
|
|
52
62
|
readonly uid: string;
|
|
53
63
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SplitterPaneComponent, never>;
|
|
54
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SplitterPaneComponent, "mona-splitter-pane", never, { "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "collapsed": "collapsedChange"; "size": "sizeChange"; }, never, ["*"], true, never>;
|
|
64
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SplitterPaneComponent, "mona-splitter-pane", never, { "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "collapsed": "collapsedChange"; "size": "sizeChange"; }, never, ["*"], true, never>;
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
declare class SplitterComponent implements SplitterVariantInput {
|
|
58
68
|
protected readonly baseClass: _angular_core.Signal<string>;
|
|
59
69
|
protected readonly paneList: _angular_core.Signal<readonly SplitterPaneComponent[]>;
|
|
70
|
+
/**
|
|
71
|
+
* @description How far an arrow key moves a separator, in pixels.
|
|
72
|
+
* @default 10
|
|
73
|
+
*/
|
|
74
|
+
readonly keyboardStep: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
60
75
|
/**
|
|
61
76
|
* @description The layout direction of the splitter panes.
|
|
62
77
|
* @default "horizontal"
|
|
63
78
|
*/
|
|
64
79
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical" | null | undefined>;
|
|
80
|
+
/**
|
|
81
|
+
* @description Emitted with every pane's `size`, in order, once a drag ends, after each key that resizes, and when the
|
|
82
|
+
* separator collapses or expands a pane. Use it to save a layout: `sizeChange` on a pane fires on every move, and these
|
|
83
|
+
* values can go straight back into `size`.
|
|
84
|
+
*/
|
|
85
|
+
readonly resizeEnd: _angular_core.OutputEmitterRef<readonly (string | number)[]>;
|
|
65
86
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SplitterComponent, never>;
|
|
66
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SplitterComponent, "mona-splitter", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, {}, ["paneList"], never, true, never>;
|
|
87
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SplitterComponent, "mona-splitter", never, { "keyboardStep": { "alias": "keyboardStep"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "resizeEnd": "resizeEnd"; }, ["paneList"], never, true, never>;
|
|
67
88
|
}
|
|
68
89
|
|
|
69
90
|
declare const SPLITTER_DEFAULT_MESSAGES: MonaSplitterMessages;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal, TemplateRef } from '@angular/core';
|
|
3
|
+
import { Signal, TemplateRef, ElementRef } from '@angular/core';
|
|
3
4
|
import * as _mirei_ts_collections from '@mirei/ts-collections';
|
|
4
5
|
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
5
6
|
import { MonaStepperMessages } from '@nanahoshi/mona-ui/i18n';
|
|
@@ -8,13 +9,25 @@ import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
|
8
9
|
import { VariantProps } from 'class-variance-authority';
|
|
9
10
|
|
|
10
11
|
interface StepOptions<T = unknown> {
|
|
12
|
+
/**
|
|
13
|
+
* @description Whether the step is finished. When left unset, the steps before the current one count as completed.
|
|
14
|
+
* Set it when a step can be passed without being finished, or finished ahead of the current one.
|
|
15
|
+
*/
|
|
16
|
+
completed?: boolean;
|
|
11
17
|
/** @description Optional arbitrary data attached to this step. */
|
|
12
18
|
data?: T;
|
|
13
19
|
/** @description When true, the step cannot be activated by click or keyboard regardless of linear mode. */
|
|
14
20
|
disabled?: boolean;
|
|
21
|
+
/** @description When true, the step shows and announces that it has errors. */
|
|
22
|
+
invalid?: boolean;
|
|
15
23
|
/** @description Display label shown beneath the step indicator. */
|
|
16
24
|
label: string;
|
|
17
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Where a step stands. `current` outranks the others, and `disabled` outranks `completed` and `upcoming`. Invalid is
|
|
28
|
+
* separate, because a step of any state can have errors.
|
|
29
|
+
*/
|
|
30
|
+
type StepState = "completed" | "current" | "disabled" | "upcoming";
|
|
18
31
|
interface StepItem<T = unknown> {
|
|
19
32
|
/** @description Zero-based position of the step in the list. */
|
|
20
33
|
readonly index: number;
|
|
@@ -22,6 +35,20 @@ interface StepItem<T = unknown> {
|
|
|
22
35
|
readonly options: StepOptions<T>;
|
|
23
36
|
}
|
|
24
37
|
|
|
38
|
+
/**
|
|
39
|
+
* What `mona-stepper` reports before a click or key changes the step. Call `preventDefault()` to stay on the current step.
|
|
40
|
+
*/
|
|
41
|
+
declare class StepSelectEvent<T = unknown> extends PreventableEvent {
|
|
42
|
+
#private;
|
|
43
|
+
constructor(index: number, previousIndex: number, step: StepOptions<T>, originalEvent?: Event);
|
|
44
|
+
/** Zero-based index of the step being selected. */
|
|
45
|
+
get index(): number;
|
|
46
|
+
/** Zero-based index of the step that is current now. */
|
|
47
|
+
get previousIndex(): number;
|
|
48
|
+
/** The options of the step being selected. */
|
|
49
|
+
get step(): StepOptions<T>;
|
|
50
|
+
}
|
|
51
|
+
|
|
25
52
|
interface StepperTemplateContext<T = unknown> {
|
|
26
53
|
/** @description The step's options object (also available as the implicit binding). */
|
|
27
54
|
$implicit: StepOptions<T>;
|
|
@@ -33,6 +60,10 @@ interface StepperTemplateContext<T = unknown> {
|
|
|
33
60
|
disabled: boolean;
|
|
34
61
|
/** @description Zero-based index of this step. */
|
|
35
62
|
index: number;
|
|
63
|
+
/** @description Whether this step has errors. */
|
|
64
|
+
invalid: boolean;
|
|
65
|
+
/** @description Where this step stands: `current`, `completed`, `upcoming` or `disabled`. */
|
|
66
|
+
state: StepState;
|
|
36
67
|
}
|
|
37
68
|
|
|
38
69
|
/**
|
|
@@ -73,8 +104,8 @@ declare const stepperStepListItemThemeVariants: (props?: ({
|
|
|
73
104
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
74
105
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
75
106
|
declare const stepperStepIndicatorThemeVariants: (props?: ({
|
|
76
|
-
|
|
77
|
-
|
|
107
|
+
invalid?: boolean | null | undefined;
|
|
108
|
+
state?: "completed" | "current" | "disabled" | "upcoming" | null | undefined;
|
|
78
109
|
rounded?: "small" | "medium" | "large" | "full" | "none" | null | undefined;
|
|
79
110
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
80
111
|
declare const stepperTrackThemeVariants: (props?: ({
|
|
@@ -95,7 +126,7 @@ type StepperTrackVariantProps = VariantProps<typeof stepperTrackThemeVariants>;
|
|
|
95
126
|
type StepperTrackVariantInput = VariantInputs<StepperTrackVariantProps>;
|
|
96
127
|
type StepperTrackLineVariantProps = VariantProps<typeof stepperTrackLineThemeVariants>;
|
|
97
128
|
type StepperTrackLineVariantInput = VariantInputs<StepperTrackLineVariantProps>;
|
|
98
|
-
type StepperVariantInput = StepperBaseVariantInput & StepperStepListVariantInput & StepperStepListItemVariantInput & Omit<StepperStepIndicatorVariantInput, "
|
|
129
|
+
type StepperVariantInput = StepperBaseVariantInput & StepperStepListVariantInput & StepperStepListItemVariantInput & Omit<StepperStepIndicatorVariantInput, "invalid" | "state"> & StepperTrackVariantInput & StepperTrackLineVariantInput;
|
|
99
130
|
|
|
100
131
|
declare class StepperComponent implements StepperVariantInput {
|
|
101
132
|
#private;
|
|
@@ -113,6 +144,9 @@ declare class StepperComponent implements StepperVariantInput {
|
|
|
113
144
|
protected readonly listItemClass: Signal<string>;
|
|
114
145
|
protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaStepperMessages>;
|
|
115
146
|
protected readonly progressMax: Signal<number>;
|
|
147
|
+
protected readonly progressText: Signal<string | null>;
|
|
148
|
+
protected readonly stepButtonClass: Signal<string>;
|
|
149
|
+
protected readonly stepButtons: Signal<readonly ElementRef<HTMLButtonElement>[]>;
|
|
116
150
|
protected readonly stepTemplate: Signal<TemplateRef<StepperTemplateContext> | undefined>;
|
|
117
151
|
protected readonly trackClass: Signal<string>;
|
|
118
152
|
protected readonly trackInnerStyles: Signal<{
|
|
@@ -137,7 +171,7 @@ declare class StepperComponent implements StepperVariantInput {
|
|
|
137
171
|
* If set to true, the user will only be able to navigate to the previous or the next step.
|
|
138
172
|
* @default true
|
|
139
173
|
*/
|
|
140
|
-
readonly linear: _angular_core.
|
|
174
|
+
readonly linear: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
141
175
|
/**
|
|
142
176
|
* @description Sets the orientation of the stepper.
|
|
143
177
|
*/
|
|
@@ -155,25 +189,37 @@ declare class StepperComponent implements StepperVariantInput {
|
|
|
155
189
|
* @description Sets the active step of the stepper.
|
|
156
190
|
*/
|
|
157
191
|
readonly step: _angular_core.ModelSignal<number>;
|
|
192
|
+
/**
|
|
193
|
+
* @description Emitted before a click or key changes the step. Call `preventDefault()` to stay on the current step,
|
|
194
|
+
* for example while its form is invalid. It doesn't fire when `step` is written from outside.
|
|
195
|
+
*/
|
|
196
|
+
readonly stepSelect: _angular_core.OutputEmitterRef<StepSelectEvent<unknown>>;
|
|
158
197
|
/**
|
|
159
198
|
* @description Sets the steps of the stepper.
|
|
160
199
|
*/
|
|
161
200
|
readonly steps: _angular_core.InputSignal<Iterable<StepOptions<unknown>>>;
|
|
162
201
|
constructor();
|
|
202
|
+
protected descriptionId(step: StepItem): string;
|
|
163
203
|
protected formatStepNumber(value: number): string;
|
|
164
204
|
protected isStepActive(step: StepItem): boolean;
|
|
165
205
|
protected isStepLocked(step: StepItem): boolean;
|
|
206
|
+
protected labelClass(state: StepState): string;
|
|
166
207
|
protected onIndicatorFocus(step: StepItem): void;
|
|
167
|
-
|
|
168
|
-
|
|
208
|
+
/**
|
|
209
|
+
* Enter and Space aren't here: they reach the step as the click a native button makes of them. Only the step buttons'
|
|
210
|
+
* own keys count, so a control in a template keeps its arrows, and a modified key stays the browser's.
|
|
211
|
+
*/
|
|
212
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
213
|
+
protected onStepClick(step: StepItem, event: MouseEvent): void;
|
|
214
|
+
protected positionText(position: number): string;
|
|
215
|
+
protected stepState(step: StepItem): StepState;
|
|
216
|
+
private normalizeIndex;
|
|
169
217
|
private setActiveStep;
|
|
170
|
-
private setHighlightedStep;
|
|
171
|
-
private setKeyboardEvents;
|
|
172
218
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StepperComponent, never>;
|
|
173
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StepperComponent, "mona-stepper", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "progressAriaLabel": { "alias": "progressAriaLabel"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "steps": { "alias": "steps"; "required": false; "isSignal": true; }; }, { "step": "stepChange"; }, ["indicatorTemplate", "labelTemplate", "stepTemplate"], never, true, never>;
|
|
219
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StepperComponent, "mona-stepper", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "progressAriaLabel": { "alias": "progressAriaLabel"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "steps": { "alias": "steps"; "required": false; "isSignal": true; }; }, { "step": "stepChange"; "stepSelect": "stepSelect"; }, ["indicatorTemplate", "labelTemplate", "stepTemplate"], never, true, never>;
|
|
174
220
|
}
|
|
175
221
|
|
|
176
222
|
declare const STEPPER_DEFAULT_MESSAGES: MonaStepperMessages;
|
|
177
223
|
|
|
178
|
-
export { STEPPER_DEFAULT_MESSAGES, StepperComponent, StepperIndicatorTemplateDirective, StepperLabelTemplateDirective, StepperStepTemplateDirective };
|
|
179
|
-
export type { StepOptions, StepperTemplateContext };
|
|
224
|
+
export { STEPPER_DEFAULT_MESSAGES, StepSelectEvent, StepperComponent, StepperIndicatorTemplateDirective, StepperLabelTemplateDirective, StepperStepTemplateDirective };
|
|
225
|
+
export type { StepOptions, StepState, StepperTemplateContext };
|