@nanahoshi/mona-ui 0.18.5 → 0.19.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 +71 -13
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +122 -48
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +199 -77
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +28 -16
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +74 -51
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-D9AwQFDV.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Byb9iTes.mjs} +21 -17
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CBmdtrXm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs} +90 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +1168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +46 -19
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +32 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +33 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/package.json +5 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +13 -3
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +14 -5
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +33 -8
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +38 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +633 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +19 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +9 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, ElementRef, Directive, Pipe, DestroyRef, signal,
|
|
3
|
+
import { inject, ElementRef, Directive, Pipe, computed, DestroyRef, signal, contentChild, TemplateRef, viewChildren, NgZone, input, output, afterNextRender, viewChild, model, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { fromEvent, tap, filter, switchMap, takeUntil } from 'rxjs';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { injectComponentDirection, MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
7
8
|
import { cva } from 'class-variance-authority';
|
|
8
9
|
import { themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
9
10
|
|
|
@@ -39,14 +40,28 @@ class LabelStylePipe {
|
|
|
39
40
|
const styles = {};
|
|
40
41
|
const { labelPosition, min, max, orientation } = args;
|
|
41
42
|
const valuePosition = valueToPosition(tick.value, min, max);
|
|
43
|
+
const isRtl = args.direction === "rtl";
|
|
42
44
|
if (orientation === "horizontal") {
|
|
43
|
-
|
|
45
|
+
if (isRtl) {
|
|
46
|
+
styles.right = `${valuePosition}%`;
|
|
47
|
+
styles.transform = "translateX(50%)";
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
styles.left = `${valuePosition}%`;
|
|
51
|
+
styles.transform = "translateX(-50%)";
|
|
52
|
+
}
|
|
44
53
|
styles[labelPosition === "before" ? "bottom" : "top"] = "100%";
|
|
45
|
-
styles.transform = "translateX(-50%)";
|
|
46
54
|
}
|
|
47
55
|
else {
|
|
48
56
|
styles.bottom = `${valuePosition}%`;
|
|
49
|
-
|
|
57
|
+
const side = isRtl
|
|
58
|
+
? labelPosition === "before"
|
|
59
|
+
? "left"
|
|
60
|
+
: "right"
|
|
61
|
+
: labelPosition === "before"
|
|
62
|
+
? "right"
|
|
63
|
+
: "left";
|
|
64
|
+
styles[side] = "100%";
|
|
50
65
|
styles.transform = "translateY(50%)";
|
|
51
66
|
}
|
|
52
67
|
return styles;
|
|
@@ -68,11 +83,12 @@ class TickStylePipe {
|
|
|
68
83
|
const height = this.getHeight(tick, smallTickStep, largeTickStep, orientation);
|
|
69
84
|
const width = this.getWidth(tick, smallTickStep, largeTickStep, orientation);
|
|
70
85
|
if (orientation === "horizontal") {
|
|
86
|
+
const isRtl = args.direction === "rtl";
|
|
71
87
|
return {
|
|
72
88
|
position: "absolute",
|
|
73
|
-
left: `${position}
|
|
89
|
+
...(isRtl ? { right: `${position}%` } : { left: `${position}%` }),
|
|
74
90
|
top: "50%",
|
|
75
|
-
transform: "translateX(-50%) translateY(-50%) translateZ(0)
|
|
91
|
+
transform: `${isRtl ? "translateX(50%)" : "translateX(-50%)"} translateY(-50%) translateZ(0)`,
|
|
76
92
|
width: "1px",
|
|
77
93
|
height: `${height}px`,
|
|
78
94
|
backfaceVisibility: "hidden",
|
|
@@ -128,6 +144,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
128
144
|
}]
|
|
129
145
|
}] });
|
|
130
146
|
|
|
147
|
+
const SLIDER_DEFAULT_MESSAGES = {
|
|
148
|
+
maximumValue: "Maximum value",
|
|
149
|
+
minimumValue: "Minimum value",
|
|
150
|
+
sliderValue: "Slider value"
|
|
151
|
+
};
|
|
152
|
+
|
|
131
153
|
class SliderHandleTemplateDirective {
|
|
132
154
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderHandleTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
133
155
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SliderHandleTemplateDirective, isStandalone: true, selector: "ng-template[monaSliderHandleTemplate]", ngImport: i0 }); }
|
|
@@ -194,13 +216,11 @@ const sliderSelectionThemeVariants = cva(`
|
|
|
194
216
|
border-none
|
|
195
217
|
transition duration-(--mona-motion-fast) ease-out
|
|
196
218
|
|
|
197
|
-
data-[orientation="horizontal"]:
|
|
198
|
-
data-[orientation="horizontal"]:bottom-0
|
|
219
|
+
data-[orientation="horizontal"]:inset-y-0
|
|
199
220
|
data-[orientation="horizontal"]:transition-[left,right]
|
|
200
221
|
data-[orientation="horizontal"]:data-[dragging="true"]:transition-none
|
|
201
222
|
|
|
202
|
-
data-[orientation="vertical"]:
|
|
203
|
-
data-[orientation="vertical"]:right-0
|
|
223
|
+
data-[orientation="vertical"]:inset-x-0
|
|
204
224
|
data-[orientation="vertical"]:transition-[top,bottom]
|
|
205
225
|
data-[orientation="vertical"]:data-[dragging="true"]:transition-none
|
|
206
226
|
`);
|
|
@@ -241,8 +261,8 @@ const sliderHandleThemeVariants = cva(`
|
|
|
241
261
|
outline-none
|
|
242
262
|
transition duration-(--mona-motion-fast) ease-out
|
|
243
263
|
|
|
244
|
-
data-[orientation="horizontal"]:translate-x-[-50%]
|
|
245
|
-
data-[orientation="horizontal"]:transition-[left]
|
|
264
|
+
data-[orientation="horizontal"]:translate-x-[-50%] rtl:data-[orientation="horizontal"]:translate-x-[50%]
|
|
265
|
+
data-[orientation="horizontal"]:transition-[left,right]
|
|
246
266
|
data-[orientation="horizontal"]:data-[dragging="true"]:transition-none
|
|
247
267
|
|
|
248
268
|
data-[orientation="vertical"]:translate-y-[50%]
|
|
@@ -271,15 +291,11 @@ const sliderHandleThemeVariants = cva(`
|
|
|
271
291
|
|
|
272
292
|
class SliderBaseComponent {
|
|
273
293
|
constructor() {
|
|
294
|
+
this.baseClasses = computed(() => sliderBaseThemeVariants(), /* @ts-ignore */
|
|
295
|
+
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
274
296
|
this.destroyRef = inject(DestroyRef);
|
|
275
297
|
this.dragging = signal(false, /* @ts-ignore */
|
|
276
298
|
...(ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []));
|
|
277
|
-
this.hostElementRef = inject(ElementRef);
|
|
278
|
-
this.tickElements = viewChildren(SliderTickDirective, /* @ts-ignore */
|
|
279
|
-
...(ngDevMode ? [{ debugName: "tickElements" }] : /* istanbul ignore next */ []));
|
|
280
|
-
this.zone = inject(NgZone);
|
|
281
|
-
this.baseClasses = computed(() => sliderBaseThemeVariants(), /* @ts-ignore */
|
|
282
|
-
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
283
299
|
this.effectiveDisabled = computed(() => this.disabled(), /* @ts-ignore */
|
|
284
300
|
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
285
301
|
this.handleTemplate = contentChild(SliderHandleTemplateDirective, { ...(ngDevMode ? { debugName: "handleTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
@@ -291,13 +307,19 @@ class SliderBaseComponent {
|
|
|
291
307
|
return { background: "transparent", border: "none", boxShadow: "none" };
|
|
292
308
|
}, /* @ts-ignore */
|
|
293
309
|
...(ngDevMode ? [{ debugName: "handleTemplateStyles" }] : /* istanbul ignore next */ []));
|
|
310
|
+
this.direction = injectComponentDirection();
|
|
311
|
+
this.hostElementRef = inject(ElementRef);
|
|
312
|
+
this.i18n = inject(MonaI18nService);
|
|
313
|
+
this.isRtl = computed(() => this.direction() === "rtl", /* @ts-ignore */
|
|
314
|
+
...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
|
|
294
315
|
this.labelStyleArgs = computed(() => {
|
|
316
|
+
const direction = this.direction();
|
|
295
317
|
const labelPosition = this.labelPosition();
|
|
296
318
|
const max = this.maxValue();
|
|
297
319
|
const min = this.minValue();
|
|
298
320
|
const orientation = this.orientation();
|
|
299
321
|
const tickCount = this.labelTicks().length;
|
|
300
|
-
return { labelPosition, max, min, orientation, tickCount };
|
|
322
|
+
return { direction, labelPosition, max, min, orientation, tickCount };
|
|
301
323
|
}, /* @ts-ignore */
|
|
302
324
|
...(ngDevMode ? [{ debugName: "labelStyleArgs" }] : /* istanbul ignore next */ []));
|
|
303
325
|
this.labelTicks = computed(() => {
|
|
@@ -339,6 +361,20 @@ class SliderBaseComponent {
|
|
|
339
361
|
return typeof bg === "string" ? { background: bg } : bg;
|
|
340
362
|
}, /* @ts-ignore */
|
|
341
363
|
...(ngDevMode ? [{ debugName: "selectionBackgroundStyle" }] : /* istanbul ignore next */ []));
|
|
364
|
+
this.horizontalSelectionLeft = computed(() => {
|
|
365
|
+
if (this.orientation() !== "horizontal") {
|
|
366
|
+
return undefined;
|
|
367
|
+
}
|
|
368
|
+
return this.isRtl() ? 100 - this.selectionRight() : this.selectionLeft();
|
|
369
|
+
}, /* @ts-ignore */
|
|
370
|
+
...(ngDevMode ? [{ debugName: "horizontalSelectionLeft" }] : /* istanbul ignore next */ []));
|
|
371
|
+
this.horizontalSelectionRight = computed(() => {
|
|
372
|
+
if (this.orientation() !== "horizontal") {
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
return this.isRtl() ? this.selectionLeft() : 100 - this.selectionRight();
|
|
376
|
+
}, /* @ts-ignore */
|
|
377
|
+
...(ngDevMode ? [{ debugName: "horizontalSelectionRight" }] : /* istanbul ignore next */ []));
|
|
342
378
|
this.selectionClasses = computed(() => sliderSelectionThemeVariants(), /* @ts-ignore */
|
|
343
379
|
...(ngDevMode ? [{ debugName: "selectionClasses" }] : /* istanbul ignore next */ []));
|
|
344
380
|
this.sliderHandleClasses = computed(() => {
|
|
@@ -365,6 +401,8 @@ class SliderBaseComponent {
|
|
|
365
401
|
...(ngDevMode ? [{ debugName: "sliderTrackSize" }] : /* istanbul ignore next */ []));
|
|
366
402
|
this.tickClasses = computed(() => sliderTickThemeVariants(), /* @ts-ignore */
|
|
367
403
|
...(ngDevMode ? [{ debugName: "tickClasses" }] : /* istanbul ignore next */ []));
|
|
404
|
+
this.tickElements = viewChildren(SliderTickDirective, /* @ts-ignore */
|
|
405
|
+
...(ngDevMode ? [{ debugName: "tickElements" }] : /* istanbul ignore next */ []));
|
|
368
406
|
this.tickLabelClasses = computed(() => sliderTickLabelThemeVariants(), /* @ts-ignore */
|
|
369
407
|
...(ngDevMode ? [{ debugName: "tickLabelClasses" }] : /* istanbul ignore next */ []));
|
|
370
408
|
this.tickLabelListClasses = computed(() => sliderTickLabelListThemeVariants(), /* @ts-ignore */
|
|
@@ -372,12 +410,13 @@ class SliderBaseComponent {
|
|
|
372
410
|
this.tickListClasses = computed(() => sliderTickListThemeVariants(), /* @ts-ignore */
|
|
373
411
|
...(ngDevMode ? [{ debugName: "tickListClasses" }] : /* istanbul ignore next */ []));
|
|
374
412
|
this.tickStyleArgs = computed(() => {
|
|
413
|
+
const direction = this.direction();
|
|
375
414
|
const largeTickStep = this.largeTickStep();
|
|
376
415
|
const max = this.maxValue();
|
|
377
416
|
const min = this.minValue();
|
|
378
417
|
const orientation = this.orientation();
|
|
379
418
|
const smallTickStep = this.smallTickStep();
|
|
380
|
-
return { largeTickStep, max, min, orientation, smallTickStep };
|
|
419
|
+
return { direction, largeTickStep, max, min, orientation, smallTickStep };
|
|
381
420
|
}, /* @ts-ignore */
|
|
382
421
|
...(ngDevMode ? [{ debugName: "tickStyleArgs" }] : /* istanbul ignore next */ []));
|
|
383
422
|
this.tickValueTemplate = contentChild(SliderTickValueTemplateDirective, { ...(ngDevMode ? { debugName: "tickValueTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
@@ -410,6 +449,7 @@ class SliderBaseComponent {
|
|
|
410
449
|
return sliderTrackThemeVariants({ rounded });
|
|
411
450
|
}, /* @ts-ignore */
|
|
412
451
|
...(ngDevMode ? [{ debugName: "trackClasses" }] : /* istanbul ignore next */ []));
|
|
452
|
+
this.zone = inject(NgZone);
|
|
413
453
|
/**
|
|
414
454
|
* @description Human-readable override for the `aria-valuenow` announcement. Pass a function that receives the current value and returns the string to announce.
|
|
415
455
|
* @default null
|
|
@@ -540,13 +580,16 @@ class SliderBaseComponent {
|
|
|
540
580
|
const min = this.minValue();
|
|
541
581
|
const max = this.maxValue();
|
|
542
582
|
const step = this.step();
|
|
583
|
+
const isRtl = this.isRtl();
|
|
584
|
+
const decreaseKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
585
|
+
const increaseKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
543
586
|
let newValue = currentValue;
|
|
544
587
|
switch (event.key) {
|
|
545
|
-
case
|
|
588
|
+
case decreaseKey:
|
|
546
589
|
case "ArrowDown":
|
|
547
590
|
newValue = currentValue - (event.shiftKey ? step * this.shiftMultiplier() : step);
|
|
548
591
|
break;
|
|
549
|
-
case
|
|
592
|
+
case increaseKey:
|
|
550
593
|
case "ArrowUp":
|
|
551
594
|
newValue = currentValue + (event.shiftKey ? step * this.shiftMultiplier() : step);
|
|
552
595
|
break;
|
|
@@ -591,7 +634,9 @@ class SliderBaseComponent {
|
|
|
591
634
|
const containerRect = this.hostElementRef.nativeElement.getBoundingClientRect();
|
|
592
635
|
let normalizedHandlePos;
|
|
593
636
|
if (this.orientation() === "horizontal") {
|
|
594
|
-
const handlePos =
|
|
637
|
+
const handlePos = this.isRtl()
|
|
638
|
+
? containerRect.right - event.clientX
|
|
639
|
+
: event.clientX - containerRect.left;
|
|
595
640
|
normalizedHandlePos = (handlePos / containerRect.width) * 100;
|
|
596
641
|
}
|
|
597
642
|
else {
|
|
@@ -632,11 +677,13 @@ class SliderBaseComponent {
|
|
|
632
677
|
}
|
|
633
678
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderBaseComponent, decorators: [{
|
|
634
679
|
type: Directive
|
|
635
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
680
|
+
}], ctorParameters: () => [], propDecorators: { handleTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SliderHandleTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tickElements: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => SliderTickDirective), { isSignal: true }] }], tickValueTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SliderTickValueTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaValueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaValueText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], handleClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleClasses", required: false }] }], handleStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleStyles", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelStep", required: false }] }], largeTickStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "largeTickStep", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], selectionBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionBackground", required: false }] }], shiftMultiplier: [{ type: i0.Input, args: [{ isSignal: true, alias: "shiftMultiplier", required: false }] }], showLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabels", required: false }] }], showTicks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTicks", required: false }] }], smallTickStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "smallTickStep", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], trackBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBackground", required: false }] }], trackSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackSize", required: false }] }] } });
|
|
636
681
|
|
|
637
682
|
class SliderComponent extends SliderBaseComponent {
|
|
638
683
|
constructor() {
|
|
639
684
|
super(...arguments);
|
|
685
|
+
this.computedAriaLabel = computed(() => this.ariaLabel() ?? this.messages().sliderValue, /* @ts-ignore */
|
|
686
|
+
...(ngDevMode ? [{ debugName: "computedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
640
687
|
this.handleFocused = signal(false, /* @ts-ignore */
|
|
641
688
|
...(ngDevMode ? [{ debugName: "handleFocused" }] : /* istanbul ignore next */ []));
|
|
642
689
|
this.handlePosition = computed(() => this.positionFromValue(this.normalizedValue()), /* @ts-ignore */
|
|
@@ -646,6 +693,7 @@ class SliderComponent extends SliderBaseComponent {
|
|
|
646
693
|
...this.handleStyles()
|
|
647
694
|
}), /* @ts-ignore */
|
|
648
695
|
...(ngDevMode ? [{ debugName: "handleStyle" }] : /* istanbul ignore next */ []));
|
|
696
|
+
this.messages = this.i18n.componentMessages("slider", SLIDER_DEFAULT_MESSAGES);
|
|
649
697
|
this.normalizedValue = computed(() => this.snapValue(this.value()), /* @ts-ignore */
|
|
650
698
|
...(ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []));
|
|
651
699
|
this.selectionLeft = computed(() => 0, /* @ts-ignore */
|
|
@@ -657,9 +705,9 @@ class SliderComponent extends SliderBaseComponent {
|
|
|
657
705
|
/**
|
|
658
706
|
* @description Accessible name for the host element. Describe what the component represents.
|
|
659
707
|
* When empty, assistive technology announces the role without a label.
|
|
660
|
-
* @default
|
|
708
|
+
* @default null
|
|
661
709
|
*/
|
|
662
|
-
this.ariaLabel = input(
|
|
710
|
+
this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
663
711
|
/**
|
|
664
712
|
* @description ID of an external element that provides the accessible name for the host element.
|
|
665
713
|
* @default null
|
|
@@ -730,7 +778,7 @@ class SliderComponent extends SliderBaseComponent {
|
|
|
730
778
|
});
|
|
731
779
|
}
|
|
732
780
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
733
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SliderComponent, isStandalone: true, selector: "mona-slider", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focus": "focus()" }, properties: { "class": "baseClasses()", "class.mona-slider": "true", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-orientation": "orientation()" } }, viewQueries: [{ propertyName: "sliderHandle", first: true, predicate: ["sliderHandle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"
|
|
781
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SliderComponent, isStandalone: true, selector: "mona-slider", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focus": "focus()" }, properties: { "class": "baseClasses()", "class.mona-slider": "true", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-orientation": "orientation()" } }, viewQueries: [{ propertyName: "sliderHandle", first: true, predicate: ["sliderHandle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n monaSliderTick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.value }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-focused]=\"handleFocused()\"\n [style]=\"handleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? handlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? handlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? handlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalid() || null\"\n [attr.data-invalid]=\"invalid() || null\"\n [attr.aria-label]=\"computedAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue() }\"></ng-container>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SliderTickDirective, selector: "span[monaSliderTick]" }, { kind: "pipe", type: LabelStylePipe, name: "labelStyle" }, { kind: "pipe", type: TickStylePipe, name: "tickStyle" }] }); }
|
|
734
782
|
}
|
|
735
783
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderComponent, decorators: [{
|
|
736
784
|
type: Component,
|
|
@@ -740,12 +788,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
740
788
|
"[attr.data-disabled]": "effectiveDisabled() || null",
|
|
741
789
|
"[attr.data-orientation]": "orientation()",
|
|
742
790
|
"(focus)": "focus()"
|
|
743
|
-
}, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"
|
|
791
|
+
}, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n monaSliderTick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.value }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-focused]=\"handleFocused()\"\n [style]=\"handleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? handlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? handlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? handlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalid() || null\"\n [attr.data-invalid]=\"invalid() || null\"\n [attr.aria-label]=\"computedAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue() }\"></ng-container>\n }\n</div>\n" }]
|
|
744
792
|
}], propDecorators: { sliderHandle: [{ type: i0.ViewChild, args: ["sliderHandle", { isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
745
793
|
|
|
746
794
|
class RangeSliderComponent extends SliderBaseComponent {
|
|
747
795
|
constructor() {
|
|
748
796
|
super(...arguments);
|
|
797
|
+
this.computedAriaLabelEnd = computed(() => this.ariaLabelEnd() ?? this.messages().maximumValue, /* @ts-ignore */
|
|
798
|
+
...(ngDevMode ? [{ debugName: "computedAriaLabelEnd" }] : /* istanbul ignore next */ []));
|
|
799
|
+
this.computedAriaLabelStart = computed(() => this.ariaLabelStart() ?? this.messages().minimumValue, /* @ts-ignore */
|
|
800
|
+
...(ngDevMode ? [{ debugName: "computedAriaLabelStart" }] : /* istanbul ignore next */ []));
|
|
749
801
|
this.handlePositions = computed(() => [
|
|
750
802
|
this.positionFromValue(this.normalizedValue()[0]),
|
|
751
803
|
this.positionFromValue(this.normalizedValue()[1])
|
|
@@ -756,6 +808,7 @@ class RangeSliderComponent extends SliderBaseComponent {
|
|
|
756
808
|
return values[0] === values[1];
|
|
757
809
|
}, /* @ts-ignore */
|
|
758
810
|
...(ngDevMode ? [{ debugName: "handlesOverlap" }] : /* istanbul ignore next */ []));
|
|
811
|
+
this.messages = this.i18n.componentMessages("slider", SLIDER_DEFAULT_MESSAGES);
|
|
759
812
|
this.normalizedValue = computed(() => {
|
|
760
813
|
const value = this.value();
|
|
761
814
|
const minValue = this.snapValue(value[0]);
|
|
@@ -799,14 +852,14 @@ class RangeSliderComponent extends SliderBaseComponent {
|
|
|
799
852
|
...(ngDevMode ? [{ debugName: "sliderHandle" }] : /* istanbul ignore next */ []));
|
|
800
853
|
/**
|
|
801
854
|
* @description Accessible name for the upper-value (secondary) handle.
|
|
802
|
-
* @default
|
|
855
|
+
* @default null
|
|
803
856
|
*/
|
|
804
|
-
this.ariaLabelEnd = input(
|
|
857
|
+
this.ariaLabelEnd = input(null, { ...(ngDevMode ? { debugName: "ariaLabelEnd" } : /* istanbul ignore next */ {}), alias: "aria-label-end" });
|
|
805
858
|
/**
|
|
806
859
|
* @description Accessible name for the lower-value (primary) handle.
|
|
807
|
-
* @default
|
|
860
|
+
* @default null
|
|
808
861
|
*/
|
|
809
|
-
this.ariaLabelStart = input(
|
|
862
|
+
this.ariaLabelStart = input(null, { ...(ngDevMode ? { debugName: "ariaLabelStart" } : /* istanbul ignore next */ {}), alias: "aria-label-start" });
|
|
810
863
|
/**
|
|
811
864
|
* @description Selected range as `[minimum, maximum]`.
|
|
812
865
|
* Values outside `[minValue, maxValue]` are clamped; the tuple is always sorted, so index 0 ≤ index 1.
|
|
@@ -835,7 +888,9 @@ class RangeSliderComponent extends SliderBaseComponent {
|
|
|
835
888
|
const containerRect = this.hostElementRef.nativeElement.getBoundingClientRect();
|
|
836
889
|
let normalizedClickPos;
|
|
837
890
|
if (this.orientation() === "horizontal") {
|
|
838
|
-
const clickPos =
|
|
891
|
+
const clickPos = this.isRtl()
|
|
892
|
+
? containerRect.right - event.clientX
|
|
893
|
+
: event.clientX - containerRect.left;
|
|
839
894
|
normalizedClickPos = (clickPos / containerRect.width) * 100;
|
|
840
895
|
}
|
|
841
896
|
else {
|
|
@@ -968,7 +1023,7 @@ class RangeSliderComponent extends SliderBaseComponent {
|
|
|
968
1023
|
});
|
|
969
1024
|
}
|
|
970
1025
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RangeSliderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
971
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RangeSliderComponent, isStandalone: true, selector: "mona-range-slider", inputs: { ariaLabelEnd: { classPropertyName: "ariaLabelEnd", publicName: "aria-label-end", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelStart: { classPropertyName: "ariaLabelStart", publicName: "aria-label-start", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focus": "focus()" }, properties: { "class": "baseClasses()", "class.mona-slider": "true", "attr.data-disabled": "effectiveDisabled()", "attr.data-orientation": "orientation()" } }, viewQueries: [{ propertyName: "secondarySliderHandle", first: true, predicate: ["secondarySliderHandle"], descendants: true, isSignal: true }, { propertyName: "sliderHandle", first: true, predicate: ["sliderHandle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"
|
|
1026
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RangeSliderComponent, isStandalone: true, selector: "mona-range-slider", inputs: { ariaLabelEnd: { classPropertyName: "ariaLabelEnd", publicName: "aria-label-end", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelStart: { classPropertyName: "ariaLabelStart", publicName: "aria-label-start", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focus": "focus()" }, properties: { "class": "baseClasses()", "class.mona-slider": "true", "attr.data-disabled": "effectiveDisabled()", "attr.data-orientation": "orientation()" } }, viewQueries: [{ propertyName: "secondarySliderHandle", first: true, predicate: ["secondarySliderHandle"], descendants: true, isSignal: true }, { propertyName: "sliderHandle", first: true, predicate: ["sliderHandle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n monaSliderTick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.value }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-focused]=\"primaryHandleFocused()\"\n [style]=\"primaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? primaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? primaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? primaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"normalizedValue()[0]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[0]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalid() || null\"\n [attr.data-invalid]=\"invalid() || null\"\n [attr.aria-label]=\"computedAriaLabelStart()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[0] }\"></ng-container>\n }\n</div>\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-focused]=\"secondaryHandleFocused()\"\n [style]=\"secondaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? secondaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? secondaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? secondaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"normalizedValue()[1]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[1]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalid() || null\"\n [attr.data-invalid]=\"invalid() || null\"\n [attr.aria-label]=\"computedAriaLabelEnd()\"\n #secondarySliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[1] }\"></ng-container>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SliderTickDirective, selector: "span[monaSliderTick]" }, { kind: "pipe", type: LabelStylePipe, name: "labelStyle" }, { kind: "pipe", type: TickStylePipe, name: "tickStyle" }] }); }
|
|
972
1027
|
}
|
|
973
1028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RangeSliderComponent, decorators: [{
|
|
974
1029
|
type: Component,
|
|
@@ -978,7 +1033,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
978
1033
|
"[attr.data-disabled]": "effectiveDisabled()",
|
|
979
1034
|
"[attr.data-orientation]": "orientation()",
|
|
980
1035
|
"(focus)": "focus()"
|
|
981
|
-
}, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"
|
|
1036
|
+
}, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n monaSliderTick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.value }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-focused]=\"primaryHandleFocused()\"\n [style]=\"primaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? primaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? primaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? primaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"normalizedValue()[0]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[0]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalid() || null\"\n [attr.data-invalid]=\"invalid() || null\"\n [attr.aria-label]=\"computedAriaLabelStart()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[0] }\"></ng-container>\n }\n</div>\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-focused]=\"secondaryHandleFocused()\"\n [style]=\"secondaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? secondaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? secondaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? secondaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"normalizedValue()[1]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[1]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalid() || null\"\n [attr.data-invalid]=\"invalid() || null\"\n [attr.aria-label]=\"computedAriaLabelEnd()\"\n #secondarySliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[1] }\"></ng-container>\n }\n</div>\n" }]
|
|
982
1037
|
}], propDecorators: { secondarySliderHandle: [{ type: i0.ViewChild, args: ["secondarySliderHandle", { isSignal: true }] }], sliderHandle: [{ type: i0.ViewChild, args: ["sliderHandle", { isSignal: true }] }], ariaLabelEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label-end", required: false }] }], ariaLabelStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label-start", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
983
1038
|
|
|
984
1039
|
/*
|
|
@@ -989,5 +1044,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
989
1044
|
* Generated bundle index. Do not edit.
|
|
990
1045
|
*/
|
|
991
1046
|
|
|
992
|
-
export { RangeSliderComponent, SliderComponent, SliderHandleTemplateDirective, SliderTickValueTemplateDirective };
|
|
1047
|
+
export { RangeSliderComponent, SLIDER_DEFAULT_MESSAGES, SliderComponent, SliderHandleTemplateDirective, SliderTickValueTemplateDirective };
|
|
993
1048
|
//# sourceMappingURL=nanahoshi-mona-ui-slider.mjs.map
|