@magmonium/one 0.4.101 → 0.4.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{magmonium-one-attribute-value-BXEWw7xP.mjs → magmonium-one-attribute-value-D3-h8ve6.mjs} +3 -3
- package/fesm2022/{magmonium-one-attribute-value-BXEWw7xP.mjs.map → magmonium-one-attribute-value-D3-h8ve6.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-base-checkbox-CIUMxkzu.mjs → magmonium-one-base-checkbox-Bwl2LUSC.mjs} +2 -2
- package/fesm2022/{magmonium-one-base-checkbox-CIUMxkzu.mjs.map → magmonium-one-base-checkbox-Bwl2LUSC.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-base-dropdown-BMsV5USo.mjs → magmonium-one-base-dropdown-Cw6z6tBU.mjs} +10 -10
- package/fesm2022/magmonium-one-base-dropdown-Cw6z6tBU.mjs.map +1 -0
- package/fesm2022/{magmonium-one-base-input-BeyBAbV4.mjs → magmonium-one-base-input-BP-CVJlM.mjs} +2 -1
- package/fesm2022/{magmonium-one-base-input-BeyBAbV4.mjs.map → magmonium-one-base-input-BP-CVJlM.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-base-text-BBeMl8XM.mjs → magmonium-one-base-text-D6Ep6NEn.mjs} +2 -2
- package/fesm2022/{magmonium-one-base-text-BBeMl8XM.mjs.map → magmonium-one-base-text-D6Ep6NEn.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-button-DC_fLy-J.mjs → magmonium-one-button-CJG1vPHS.mjs} +7 -7
- package/fesm2022/{magmonium-one-button-DC_fLy-J.mjs.map → magmonium-one-button-CJG1vPHS.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-checkbox-C85FEuTs.mjs → magmonium-one-checkbox-ZM0KfqIQ.mjs} +7 -7
- package/fesm2022/magmonium-one-checkbox-ZM0KfqIQ.mjs.map +1 -0
- package/fesm2022/{magmonium-one-color-utl-DMLkkE-z.mjs → magmonium-one-color-utl-Bo4uumN1.mjs} +2 -2
- package/fesm2022/{magmonium-one-color-utl-DMLkkE-z.mjs.map → magmonium-one-color-utl-Bo4uumN1.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-directives-CJK7xDPK.mjs → magmonium-one-directives-BxxQs2S4.mjs} +4 -4
- package/fesm2022/{magmonium-one-directives-CJK7xDPK.mjs.map → magmonium-one-directives-BxxQs2S4.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-group-qu3xLiI8.mjs → magmonium-one-group-D5QIFnbR.mjs} +7 -7
- package/fesm2022/{magmonium-one-group-qu3xLiI8.mjs.map → magmonium-one-group-D5QIFnbR.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-header-BC-74GOn.mjs → magmonium-one-header-BGTP8_Uw.mjs} +4 -4
- package/fesm2022/{magmonium-one-header-BC-74GOn.mjs.map → magmonium-one-header-BGTP8_Uw.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-icon-CXFTG4mD.mjs → magmonium-one-icon-C8FRmxpW.mjs} +4 -4
- package/fesm2022/{magmonium-one-icon-CXFTG4mD.mjs.map → magmonium-one-icon-C8FRmxpW.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-image-editor-BAF7cdC2.mjs → magmonium-one-image-editor-C4l92aUj.mjs} +4 -4
- package/fesm2022/{magmonium-one-image-editor-BAF7cdC2.mjs.map → magmonium-one-image-editor-C4l92aUj.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-label-BNxbDSwc.mjs → magmonium-one-label-mLyqV5U_.mjs} +2 -2
- package/fesm2022/{magmonium-one-label-BNxbDSwc.mjs.map → magmonium-one-label-mLyqV5U_.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-m-ref-CoK96ogW.mjs → magmonium-one-m-ref-DQLJ12Cj.mjs} +2 -2
- package/fesm2022/{magmonium-one-m-ref-CoK96ogW.mjs.map → magmonium-one-m-ref-DQLJ12Cj.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-menu-D_HAqfel.mjs → magmonium-one-menu-BqT-XVvZ.mjs} +6 -6
- package/fesm2022/{magmonium-one-menu-D_HAqfel.mjs.map → magmonium-one-menu-BqT-XVvZ.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-multi-range-DqtW4U_x.mjs → magmonium-one-multi-range-BMn1iVZ4.mjs} +5 -4
- package/fesm2022/magmonium-one-multi-range-BMn1iVZ4.mjs.map +1 -0
- package/fesm2022/{magmonium-one-options-asset-DWjdYQe0.mjs → magmonium-one-options-asset-iITooSr4.mjs} +2 -2
- package/fesm2022/{magmonium-one-options-asset-DWjdYQe0.mjs.map → magmonium-one-options-asset-iITooSr4.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-otp-DOPvjYJz.mjs → magmonium-one-otp-xQgDDbDC.mjs} +7 -7
- package/fesm2022/magmonium-one-otp-xQgDDbDC.mjs.map +1 -0
- package/fesm2022/{magmonium-one-password-BqdyEDF6.mjs → magmonium-one-password-lZ5OEevh.mjs} +8 -8
- package/fesm2022/magmonium-one-password-lZ5OEevh.mjs.map +1 -0
- package/fesm2022/{magmonium-one-radio-DGTbRRXb.mjs → magmonium-one-radio-bTivHHZH.mjs} +3 -3
- package/fesm2022/{magmonium-one-radio-DGTbRRXb.mjs.map → magmonium-one-radio-bTivHHZH.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-range-Dw4YACtP.mjs → magmonium-one-range-8y-IUMjf.mjs} +4 -4
- package/fesm2022/{magmonium-one-range-Dw4YACtP.mjs.map → magmonium-one-range-8y-IUMjf.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-selector-QB49Ju9l.mjs → magmonium-one-selector-x0wB0KrY.mjs} +4 -4
- package/fesm2022/{magmonium-one-selector-QB49Ju9l.mjs.map → magmonium-one-selector-x0wB0KrY.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-text-CMULvvAr.mjs → magmonium-one-text-BTAJl4eW.mjs} +8 -8
- package/fesm2022/magmonium-one-text-BTAJl4eW.mjs.map +1 -0
- package/fesm2022/{magmonium-one-text-output-DiA4R1pw.mjs → magmonium-one-text-output-DP06NTMe.mjs} +4 -4
- package/fesm2022/{magmonium-one-text-output-DiA4R1pw.mjs.map → magmonium-one-text-output-DP06NTMe.mjs.map} +1 -1
- package/fesm2022/magmonium-one-theme-LIc0f731.mjs +1 -0
- package/fesm2022/{magmonium-one-toggle-sUSXzxMl.mjs → magmonium-one-toggle-CqEqyEtf.mjs} +2 -2
- package/fesm2022/{magmonium-one-toggle-sUSXzxMl.mjs.map → magmonium-one-toggle-CqEqyEtf.mjs.map} +1 -1
- package/fesm2022/magmonium-one.mjs +60 -60
- package/fesm2022/magmonium-one.mjs.map +1 -1
- package/package.json +1 -1
- package/types/magmonium-one.d.ts +37 -35
- package/fesm2022/magmonium-one-base-dropdown-BMsV5USo.mjs.map +0 -1
- package/fesm2022/magmonium-one-checkbox-C85FEuTs.mjs.map +0 -1
- package/fesm2022/magmonium-one-multi-range-DqtW4U_x.mjs.map +0 -1
- package/fesm2022/magmonium-one-otp-DOPvjYJz.mjs.map +0 -1
- package/fesm2022/magmonium-one-password-BqdyEDF6.mjs.map +0 -1
- package/fesm2022/magmonium-one-text-CMULvvAr.mjs.map +0 -1
- package/fesm2022/magmonium-one-theme-DEgFM1wD.mjs +0 -1
package/package.json
CHANGED
package/types/magmonium-one.d.ts
CHANGED
|
@@ -1622,7 +1622,7 @@ export declare class DraggableDirective {
|
|
|
1622
1622
|
readonly max: import("@angular/core").InputSignal<Position | undefined>;
|
|
1623
1623
|
readonly dragStart: import("@angular/core").OutputEmitterRef<void>;
|
|
1624
1624
|
readonly dragEnd: import("@angular/core").OutputEmitterRef<void>;
|
|
1625
|
-
protected readonly cursor: import("@angular/core").Signal<"
|
|
1625
|
+
protected readonly cursor: import("@angular/core").Signal<"ew-resize" | "ns-resize" | "move">;
|
|
1626
1626
|
protected state: DraggableState;
|
|
1627
1627
|
set pos(position: Position);
|
|
1628
1628
|
/**
|
|
@@ -2925,7 +2925,7 @@ export declare class ButtonComponent extends ReactiveElementComponent<Button> {
|
|
|
2925
2925
|
navParams: import("@angular/core").InputSignal<Record<string, string | number> | undefined>;
|
|
2926
2926
|
href: import("@angular/core").InputSignal<string | undefined>;
|
|
2927
2927
|
disabled: import("@angular/core").InputSignal<boolean | undefined>;
|
|
2928
|
-
variant: import("@angular/core").InputSignal<"
|
|
2928
|
+
variant: import("@angular/core").InputSignal<"primary" | "ghost" | "secondary" | "tab" | undefined>;
|
|
2929
2929
|
name: import("@angular/core").InputSignal<string | undefined>;
|
|
2930
2930
|
baseUrl: import("@angular/core").InputSignal<string | undefined>;
|
|
2931
2931
|
one: import("@angular/core").InputSignal<boolean | undefined>;
|
|
@@ -2938,7 +2938,7 @@ export declare class ButtonComponent extends ReactiveElementComponent<Button> {
|
|
|
2938
2938
|
icon: import("@angular/core").InputSignal<string | undefined>;
|
|
2939
2939
|
isRightIcon: import("@angular/core").InputSignal<string | boolean | undefined>;
|
|
2940
2940
|
iconOnly: import("@angular/core").InputSignal<string | boolean | undefined>;
|
|
2941
|
-
size: import("@angular/core").InputSignal<
|
|
2941
|
+
size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | Size | undefined>;
|
|
2942
2942
|
stacked: import("@angular/core").InputSignal<string | boolean | undefined>;
|
|
2943
2943
|
imgSrc: import("@angular/core").InputSignal<string | undefined>;
|
|
2944
2944
|
nonClickable: import("@angular/core").InputSignal<string | boolean | undefined>;
|
|
@@ -3555,7 +3555,7 @@ export declare class ButtonGroupComponent extends ConfigComponent<ButtonGroup> {
|
|
|
3555
3555
|
color?: string | keyof import("dist/libs/cli/src").ThemeColor;
|
|
3556
3556
|
align?: ConfigAlign;
|
|
3557
3557
|
isLoading?: boolean;
|
|
3558
|
-
variant?: "
|
|
3558
|
+
variant?: "primary" | "ghost" | "secondary" | "tab" | undefined;
|
|
3559
3559
|
label?: string;
|
|
3560
3560
|
noTranslate?: boolean;
|
|
3561
3561
|
params?: Record<string, string>;
|
|
@@ -4313,6 +4313,7 @@ declare class BaseInputComponent<T extends Input = Input> {
|
|
|
4313
4313
|
protected readonly elementRef: ElementRef<any>;
|
|
4314
4314
|
private readonly applyConfigSize;
|
|
4315
4315
|
showErrors: import("@angular/core").Signal<boolean>;
|
|
4316
|
+
shownError: import("@angular/core").Signal<WithOptionalFieldTree<ValidationError>>;
|
|
4316
4317
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseInputComponent<any>, never>;
|
|
4317
4318
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseInputComponent<any>, never, never, {
|
|
4318
4319
|
"focused": {
|
|
@@ -4372,7 +4373,7 @@ declare class BaseTextInputComponent<T extends Input = TextInput> extends BaseIn
|
|
|
4372
4373
|
private autofocused;
|
|
4373
4374
|
constructor();
|
|
4374
4375
|
readonly isFocused: import("@angular/core").WritableSignal<boolean>;
|
|
4375
|
-
readonly iconColor: import("@angular/core").Signal<"error" | "
|
|
4376
|
+
readonly iconColor: import("@angular/core").Signal<"error" | "border" | "focus">;
|
|
4376
4377
|
protected readonly setValue: (value: string) => void;
|
|
4377
4378
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseTextInputComponent<any>, never>;
|
|
4378
4379
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTextInputComponent<any>, never, never, {
|
|
@@ -4993,7 +4994,7 @@ export declare class SectionFilterGroupComponent {
|
|
|
4993
4994
|
readonly paddingX: import("@angular/core").InputSignal<boolean | undefined>;
|
|
4994
4995
|
readonly paddingY: import("@angular/core").InputSignal<boolean | undefined>;
|
|
4995
4996
|
readonly maxWidth: import("@angular/core").InputSignal<string | undefined>;
|
|
4996
|
-
readonly align: import("@angular/core").InputSignal<"
|
|
4997
|
+
readonly align: import("@angular/core").InputSignal<"center" | "left" | "right" | undefined>;
|
|
4997
4998
|
readonly config: import("@angular/core").InputSignal<SectionFilterGroupConfig | undefined>;
|
|
4998
4999
|
/**
|
|
4999
5000
|
* The whole group's selection, keyed by each Filter's `name` — one key per
|
|
@@ -5011,7 +5012,7 @@ export declare class SectionFilterGroupComponent {
|
|
|
5011
5012
|
protected readonly resolvedPadding: import("@angular/core").Signal<boolean>;
|
|
5012
5013
|
protected readonly resolvedPaddingX: import("@angular/core").Signal<boolean>;
|
|
5013
5014
|
protected readonly resolvedPaddingY: import("@angular/core").Signal<boolean>;
|
|
5014
|
-
protected readonly resolvedAlign: import("@angular/core").Signal<"
|
|
5015
|
+
protected readonly resolvedAlign: import("@angular/core").Signal<"center" | "left" | "right">;
|
|
5015
5016
|
protected readonly resolvedMaxWidth: import("@angular/core").Signal<string | undefined>;
|
|
5016
5017
|
protected readonly noBorder: import("@angular/core").Signal<boolean>;
|
|
5017
5018
|
/**
|
|
@@ -5116,7 +5117,7 @@ export declare class SectionStepperComponent implements OnDestroy {
|
|
|
5116
5117
|
readonly lg: import("@angular/core").InputSignal<number | undefined>;
|
|
5117
5118
|
readonly xl: import("@angular/core").InputSignal<number | undefined>;
|
|
5118
5119
|
readonly xxl: import("@angular/core").InputSignal<number | undefined>;
|
|
5119
|
-
readonly orientation: import("@angular/core").InputSignal<"
|
|
5120
|
+
readonly orientation: import("@angular/core").InputSignal<"vertical" | "horizontal" | undefined>;
|
|
5120
5121
|
readonly stepChange: import("@angular/core").OutputEmitterRef<number>;
|
|
5121
5122
|
private readonly isCompact;
|
|
5122
5123
|
private readonly mediaMatched;
|
|
@@ -5190,7 +5191,7 @@ export declare class SectionStepperComponent implements OnDestroy {
|
|
|
5190
5191
|
export declare class SectionBadgesComponent {
|
|
5191
5192
|
readonly wrap: import("@angular/core").InputSignal<boolean>;
|
|
5192
5193
|
readonly border: import("@angular/core").InputSignal<boolean>;
|
|
5193
|
-
readonly align: import("@angular/core").InputSignal<"
|
|
5194
|
+
readonly align: import("@angular/core").InputSignal<"center" | "left" | "right">;
|
|
5194
5195
|
private readonly sectionContext;
|
|
5195
5196
|
protected readonly hasBorder: import("@angular/core").Signal<boolean>;
|
|
5196
5197
|
static ɵfac: i0.ɵɵFactoryDeclaration<SectionBadgesComponent, never>;
|
|
@@ -5338,7 +5339,7 @@ export declare class SectionPaginationComponent {
|
|
|
5338
5339
|
* Entries that are not positive numbers drop rather than throw.
|
|
5339
5340
|
*/
|
|
5340
5341
|
readonly perPageOptions: import("@angular/core").InputSignal<string | undefined>;
|
|
5341
|
-
readonly align: import("@angular/core").InputSignal<"
|
|
5342
|
+
readonly align: import("@angular/core").InputSignal<"center" | "left" | "right">;
|
|
5342
5343
|
readonly showPerPage: import("@angular/core").InputSignal<boolean>;
|
|
5343
5344
|
/** Hides the band outright once everything fits one page. */
|
|
5344
5345
|
readonly hideOnSinglePage: import("@angular/core").InputSignal<boolean>;
|
|
@@ -5676,7 +5677,7 @@ export declare class SectionComponent extends ConfigComponent<SectionConfig> {
|
|
|
5676
5677
|
readonly align: import("@angular/core").InputSignal<SectionAlign | undefined>;
|
|
5677
5678
|
readonly alignX: import("@angular/core").InputSignal<GridAlignX | undefined>;
|
|
5678
5679
|
readonly alignY: import("@angular/core").InputSignal<GridAlignY | undefined>;
|
|
5679
|
-
readonly size: import("@angular/core").InputSignal<
|
|
5680
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | Size | undefined>;
|
|
5680
5681
|
private readonly parentSize;
|
|
5681
5682
|
readonly resolvedSize: import("@angular/core").Signal<Size>;
|
|
5682
5683
|
protected readonly sizeLength: import("@angular/core").Signal<string>;
|
|
@@ -5847,8 +5848,8 @@ export declare class SectionHeaderComponent {
|
|
|
5847
5848
|
readonly visibilityRule: import("@angular/core").InputSignal<((key: string, data?: unknown) => boolean) | undefined>;
|
|
5848
5849
|
readonly disableRule: import("@angular/core").InputSignal<((key: string, data?: unknown) => boolean) | undefined>;
|
|
5849
5850
|
readonly extraData: import("@angular/core").InputSignal<unknown>;
|
|
5850
|
-
readonly align: import("@angular/core").InputSignal<"
|
|
5851
|
-
readonly alignment: import("@angular/core").Signal<"
|
|
5851
|
+
readonly align: import("@angular/core").InputSignal<"center" | "left" | "right" | undefined>;
|
|
5852
|
+
readonly alignment: import("@angular/core").Signal<"center" | "left" | "right">;
|
|
5852
5853
|
readonly badge: import("@angular/core").InputSignal<BadgeCount | undefined>;
|
|
5853
5854
|
readonly showBack: import("@angular/core").InputSignal<boolean>;
|
|
5854
5855
|
readonly actionButton: import("@angular/core").InputSignal<string | undefined>;
|
|
@@ -5867,7 +5868,7 @@ export declare class SectionHeaderComponent {
|
|
|
5867
5868
|
protected readonly sidepanel: import("@angular/core").Signal<boolean>;
|
|
5868
5869
|
protected readonly noBorder: import("@angular/core").Signal<boolean>;
|
|
5869
5870
|
protected readonly resolvedMaxWidth: import("@angular/core").Signal<string | undefined>;
|
|
5870
|
-
protected readonly boxAlign: import("@angular/core").Signal<"
|
|
5871
|
+
protected readonly boxAlign: import("@angular/core").Signal<"center" | "left" | "right">;
|
|
5871
5872
|
protected readonly iconBox: import("@angular/core").Signal<string>;
|
|
5872
5873
|
protected readonly stickyOn: import("@angular/core").Signal<boolean>;
|
|
5873
5874
|
protected readonly isSticky: import("@angular/core").Signal<boolean>;
|
|
@@ -6015,7 +6016,7 @@ export declare class SectionButtonGroupComponent extends ConfigComponent<Section
|
|
|
6015
6016
|
readonly vertical: import("@angular/core").InputSignal<boolean | undefined>;
|
|
6016
6017
|
readonly align: import("@angular/core").InputSignal<ConfigAlign>;
|
|
6017
6018
|
readonly variant: import("@angular/core").InputSignal<"spaced" | "joined" | undefined>;
|
|
6018
|
-
readonly size: import("@angular/core").InputSignal<
|
|
6019
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | Size | undefined>;
|
|
6019
6020
|
readonly fullWidth: import("@angular/core").InputSignal<boolean | undefined>;
|
|
6020
6021
|
private readonly parentSize;
|
|
6021
6022
|
readonly resolvedSize: import("@angular/core").Signal<Size>;
|
|
@@ -6023,7 +6024,7 @@ export declare class SectionButtonGroupComponent extends ConfigComponent<Section
|
|
|
6023
6024
|
protected readonly resolvedFullWidth: import("@angular/core").Signal<boolean>;
|
|
6024
6025
|
protected readonly resolvedVertical: import("@angular/core").Signal<boolean>;
|
|
6025
6026
|
protected readonly resolvedVariant: import("@angular/core").Signal<"spaced" | "joined">;
|
|
6026
|
-
protected readonly resolvedAlign: import("@angular/core").Signal<"
|
|
6027
|
+
protected readonly resolvedAlign: import("@angular/core").Signal<"center" | "left" | "right" | "bottom" | "top">;
|
|
6027
6028
|
static ɵfac: i0.ɵɵFactoryDeclaration<SectionButtonGroupComponent, never>;
|
|
6028
6029
|
static ɵcmp: i0.ɵɵComponentDeclaration<SectionButtonGroupComponent, "m-section-button-group", never, {
|
|
6029
6030
|
"vertical": {
|
|
@@ -6055,7 +6056,7 @@ export declare class SectionButtonGroupComponent extends ConfigComponent<Section
|
|
|
6055
6056
|
}
|
|
6056
6057
|
export declare class SectionFooterComponent {
|
|
6057
6058
|
readonly sticky: import("@angular/core").InputSignal<boolean>;
|
|
6058
|
-
readonly align: import("@angular/core").InputSignal<"
|
|
6059
|
+
readonly align: import("@angular/core").InputSignal<"center" | "left" | "right">;
|
|
6059
6060
|
readonly maxWidth: import("@angular/core").InputSignal<string | undefined>;
|
|
6060
6061
|
readonly fullWidth: import("@angular/core").InputSignal<boolean>;
|
|
6061
6062
|
private readonly isDesignMode;
|
|
@@ -6066,7 +6067,7 @@ export declare class SectionFooterComponent {
|
|
|
6066
6067
|
protected readonly sidepanel: import("@angular/core").Signal<boolean>;
|
|
6067
6068
|
protected readonly noBorder: import("@angular/core").Signal<boolean>;
|
|
6068
6069
|
protected readonly resolvedMaxWidth: import("@angular/core").Signal<string | undefined>;
|
|
6069
|
-
protected readonly boxAlign: import("@angular/core").Signal<"
|
|
6070
|
+
protected readonly boxAlign: import("@angular/core").Signal<"center" | "left" | "right">;
|
|
6070
6071
|
static ɵfac: i0.ɵɵFactoryDeclaration<SectionFooterComponent, never>;
|
|
6071
6072
|
static ɵcmp: i0.ɵɵComponentDeclaration<SectionFooterComponent, "m-section-footer", never, {
|
|
6072
6073
|
"sticky": {
|
|
@@ -8433,8 +8434,8 @@ declare class DropdownBoxComponent {
|
|
|
8433
8434
|
}, never, never, true, never>;
|
|
8434
8435
|
}
|
|
8435
8436
|
/** The trigger both option Fields draw: a searchable text input and a chevron. */
|
|
8436
|
-
declare const DROPDOWN_TEMPLATE = "\n @if (config(); as dropdown) {\n @if (dropdown.label) {\n <m-label\n [for]=\"dropdown.name ?? ''\"\n [placeholder]=\"dropdown.label\"\n [params]=\"dropdown.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div\n class=\"trigger-wrap\"\n #wrapper\n [mSelector]=\"selectorConfig()\"\n [disabled]=\"disabled() || readonly() || !!config()?.readonly\"\n (opened)=\"onOpened()\"\n (closed)=\"onClosed()\"\n (focusin)=\"isFocused.set(true)\"\n (focusout)=\"isFocused.set(false)\"\n >\n <m-text-input\n [config]=\"triggerInputConfig()\"\n [value]=\"displayValue()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [hideErrors]=\"true\"\n [(touched)]=\"touched\"\n [focused]=\"focused()\"\n (valueChange)=\"onInput($event)\"\n (click)=\"preventToggleWhenOpen($event)\"\n (keydown.space)=\"$event.stopPropagation()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.arrowdown)=\"onArrow($event, 1)\"\n (keydown.arrowup)=\"onArrow($event, -1)\"\n (keydown.tab)=\"$event.stopPropagation()\"\n />\n <m-button [disabled]=\"disabled()\" [config]=\"chevron()\" />\n </div>\n @if (showErrors()) {\n @
|
|
8437
|
-
declare const DROPDOWN_IMPORTS: (typeof
|
|
8437
|
+
declare const DROPDOWN_TEMPLATE = "\n @if (config(); as dropdown) {\n @if (dropdown.label) {\n <m-label\n [for]=\"dropdown.name ?? ''\"\n [placeholder]=\"dropdown.label\"\n [params]=\"dropdown.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div\n class=\"trigger-wrap\"\n #wrapper\n [mSelector]=\"selectorConfig()\"\n [disabled]=\"disabled() || readonly() || !!config()?.readonly\"\n (opened)=\"onOpened()\"\n (closed)=\"onClosed()\"\n (focusin)=\"isFocused.set(true)\"\n (focusout)=\"isFocused.set(false)\"\n >\n <m-text-input\n [config]=\"triggerInputConfig()\"\n [value]=\"displayValue()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [hideErrors]=\"true\"\n [(touched)]=\"touched\"\n [focused]=\"focused()\"\n (valueChange)=\"onInput($event)\"\n (click)=\"preventToggleWhenOpen($event)\"\n (keydown.space)=\"$event.stopPropagation()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.arrowdown)=\"onArrow($event, 1)\"\n (keydown.arrowup)=\"onArrow($event, -1)\"\n (keydown.tab)=\"$event.stopPropagation()\"\n />\n <m-button [disabled]=\"disabled()\" [config]=\"chevron()\" />\n </div>\n @if (showErrors()) {\n @if (shownError(); as error) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n";
|
|
8438
|
+
declare const DROPDOWN_IMPORTS: (typeof ButtonComponent | typeof LabelComponent | typeof SelectorDirective | typeof TextOutputComponent | typeof TextInputComponent)[];
|
|
8438
8439
|
/**
|
|
8439
8440
|
* Everything a Dropdown and a Multiselect share: the options, the search, the
|
|
8440
8441
|
* keyboard walk and the panel. What differs is only what the Field holds — one
|
|
@@ -8617,7 +8618,7 @@ declare class ColorPickerBoxComponent implements AfterViewInit, OnDestroy {
|
|
|
8617
8618
|
protected readonly _eyedropperConfig: import("@magmonium/one").Button;
|
|
8618
8619
|
protected readonly _headerContextMenu: ContextMenu;
|
|
8619
8620
|
protected readonly themeSwatches: import("@angular/core").Signal<{
|
|
8620
|
-
key: "
|
|
8621
|
+
key: "text" | "error" | "focus" | "mm" | "mmLite" | "mmDark" | "background" | "border" | "textSecondary" | "errorLight" | "warning" | "successLite" | "success" | "highlight" | "wealth";
|
|
8621
8622
|
color: string;
|
|
8622
8623
|
}[]>;
|
|
8623
8624
|
hue: import("@angular/core").WritableSignal<number>;
|
|
@@ -8991,6 +8992,7 @@ export declare class BaseArrayInputComponent implements FormValueControl<number[
|
|
|
8991
8992
|
touched: import("@angular/core").ModelSignal<boolean>;
|
|
8992
8993
|
protected readonly elementRef: ElementRef<any>;
|
|
8993
8994
|
showErrors: import("@angular/core").Signal<boolean>;
|
|
8995
|
+
shownError: import("@angular/core").Signal<WithOptionalFieldTree<ValidationError>>;
|
|
8994
8996
|
protected readonly setValue: (value: number[]) => void;
|
|
8995
8997
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseArrayInputComponent, never>;
|
|
8996
8998
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaseArrayInputComponent, "m-base-array-input", never, {
|
|
@@ -9361,7 +9363,7 @@ export declare class FileUploadInputComponent extends BaseInputComponent<FileUpl
|
|
|
9361
9363
|
private readonly editorSize;
|
|
9362
9364
|
private readonly maxSize;
|
|
9363
9365
|
protected readonly isLocked: import("@angular/core").Signal<boolean>;
|
|
9364
|
-
protected readonly dropZoneIconColor: import("@angular/core").Signal<"error" | "
|
|
9366
|
+
protected readonly dropZoneIconColor: import("@angular/core").Signal<"error" | "border" | "focus">;
|
|
9365
9367
|
/** Object URLs of the previews on show, keyed by what the value holds. */
|
|
9366
9368
|
private readonly previews;
|
|
9367
9369
|
protected readonly heldFiles: import("@angular/core").Signal<HeldFile[]>;
|
|
@@ -9815,17 +9817,17 @@ export declare class SectionFormComponent<T extends object = Record<string, unkn
|
|
|
9815
9817
|
protected readonly resolvesConfigAsset = false;
|
|
9816
9818
|
readonly variant: import("@angular/core").InputSignal<string | undefined>;
|
|
9817
9819
|
readonly maxWidth: import("@angular/core").InputSignal<string | undefined>;
|
|
9818
|
-
readonly heightMode: import("@angular/core").InputSignal<"
|
|
9820
|
+
readonly heightMode: import("@angular/core").InputSignal<"fixed" | "full" | undefined>;
|
|
9819
9821
|
readonly maxHeight: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9820
9822
|
readonly height: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9821
|
-
readonly align: import("@angular/core").InputSignal<"
|
|
9823
|
+
readonly align: import("@angular/core").InputSignal<"center" | "left" | "right" | undefined>;
|
|
9822
9824
|
readonly padding: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9823
9825
|
readonly paddingX: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9824
9826
|
readonly paddingY: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9825
9827
|
readonly margin: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9826
9828
|
readonly marginX: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9827
9829
|
readonly marginY: import("@angular/core").InputSignal<string | number | undefined>;
|
|
9828
|
-
readonly size: import("@angular/core").InputSignal<
|
|
9830
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | Size | undefined>;
|
|
9829
9831
|
readonly autofocus: import("@angular/core").InputSignal<boolean>;
|
|
9830
9832
|
data: import("@angular/core").InputSignal<T | undefined>;
|
|
9831
9833
|
readonly dataChange: import("@angular/core").OutputEmitterRef<T>;
|
|
@@ -9870,7 +9872,7 @@ export declare class SectionFormComponent<T extends object = Record<string, unkn
|
|
|
9870
9872
|
protected readonly handleSubmit: (event: Event) => void;
|
|
9871
9873
|
readonly resolvedSize: import("@angular/core").Signal<Size>;
|
|
9872
9874
|
protected readonly sizeLength: import("@angular/core").Signal<string | null>;
|
|
9873
|
-
readonly resolvedAlign: import("@angular/core").Signal<"
|
|
9875
|
+
readonly resolvedAlign: import("@angular/core").Signal<"center" | "left" | "right">;
|
|
9874
9876
|
readonly resolvedVariant: import("@angular/core").Signal<string | undefined>;
|
|
9875
9877
|
readonly resolvedMaxWidth: import("@angular/core").Signal<string | number | undefined>;
|
|
9876
9878
|
private readonly resolvedPadding;
|
|
@@ -9882,7 +9884,7 @@ export declare class SectionFormComponent<T extends object = Record<string, unkn
|
|
|
9882
9884
|
readonly resolvedMinHeight: import("@angular/core").Signal<string | undefined>;
|
|
9883
9885
|
readonly resolvedMinWidth: import("@angular/core").Signal<string | undefined>;
|
|
9884
9886
|
readonly resolvedMaxHeight: import("@angular/core").Signal<string | number | undefined>;
|
|
9885
|
-
readonly resolvedHeightMode: import("@angular/core").Signal<"
|
|
9887
|
+
readonly resolvedHeightMode: import("@angular/core").Signal<"fixed" | "full" | undefined>;
|
|
9886
9888
|
readonly isFullHeight: import("@angular/core").Signal<boolean>;
|
|
9887
9889
|
readonly cssMaxHeight: import("@angular/core").Signal<string | undefined>;
|
|
9888
9890
|
constructor();
|
|
@@ -10552,7 +10554,7 @@ export declare class StepperComponent extends ConfigComponent<Stepper> {
|
|
|
10552
10554
|
constructor();
|
|
10553
10555
|
protected readonly isReadonly: import("@angular/core").Signal<boolean>;
|
|
10554
10556
|
protected readonly stepperDisabled: import("@angular/core").Signal<boolean>;
|
|
10555
|
-
protected readonly orientation: import("@angular/core").Signal<"
|
|
10557
|
+
protected readonly orientation: import("@angular/core").Signal<"compact" | "vertical">;
|
|
10556
10558
|
protected readonly currentStepLabel: import("@angular/core").Signal<string>;
|
|
10557
10559
|
protected readonly nextStepLabel: import("@angular/core").Signal<string>;
|
|
10558
10560
|
protected readonly isLastStep: import("@angular/core").Signal<boolean>;
|
|
@@ -10736,7 +10738,7 @@ export declare class ComponentStepperComponent {
|
|
|
10736
10738
|
components: import("@angular/core").InputSignal<Type<unknown>[]>;
|
|
10737
10739
|
labels: import("@angular/core").InputSignal<string[] | undefined>;
|
|
10738
10740
|
currentIndex: import("@angular/core").InputSignal<number>;
|
|
10739
|
-
variant: import("@angular/core").InputSignal<"
|
|
10741
|
+
variant: import("@angular/core").InputSignal<"vertical" | "horizontal">;
|
|
10740
10742
|
context: import("@angular/core").InputSignal<Record<string, unknown> | undefined>;
|
|
10741
10743
|
readonly stepChange: import("@angular/core").OutputEmitterRef<number>;
|
|
10742
10744
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComponentStepperComponent, never>;
|
|
@@ -12161,7 +12163,7 @@ export declare class ScoreSetItemComponent {
|
|
|
12161
12163
|
private readonly themeStore;
|
|
12162
12164
|
protected readonly tipId: string;
|
|
12163
12165
|
protected readonly tipDismissed: import("@angular/core").WritableSignal<boolean>;
|
|
12164
|
-
protected readonly shape: import("@angular/core").Signal<"
|
|
12166
|
+
protected readonly shape: import("@angular/core").Signal<"none" | "row" | "primary">;
|
|
12165
12167
|
protected readonly tone: import("@angular/core").Signal<string | null>;
|
|
12166
12168
|
protected readonly model: import("@angular/core").Signal<{
|
|
12167
12169
|
value: number | null;
|
|
@@ -12475,7 +12477,7 @@ export declare class PriceLadderComponent {
|
|
|
12475
12477
|
protected readonly current: import("@angular/core").Signal<number | null>;
|
|
12476
12478
|
/** The forecast point: a `forecast` mark, else the `target` input. */
|
|
12477
12479
|
private readonly targetPoint;
|
|
12478
|
-
protected readonly shownAs: import("@angular/core").Signal<"
|
|
12480
|
+
protected readonly shownAs: import("@angular/core").Signal<"line" | "list">;
|
|
12479
12481
|
/** Every drawable mark, the `current` and `forecast` stand-ins included. */
|
|
12480
12482
|
private readonly everyMark;
|
|
12481
12483
|
/** The reference levels drawn as ticks and labels. */
|
|
@@ -12818,7 +12820,7 @@ export declare class ScaleComponent {
|
|
|
12818
12820
|
private readonly formatter;
|
|
12819
12821
|
/** A value as text: a `percent` value is already in percent (12.5 → 12.5%). */
|
|
12820
12822
|
readonly formatValue: (v: number) => string;
|
|
12821
|
-
protected readonly shownAs: import("@angular/core").Signal<"
|
|
12823
|
+
protected readonly shownAs: import("@angular/core").Signal<"vertical" | "horizontal">;
|
|
12822
12824
|
private readonly marks;
|
|
12823
12825
|
protected readonly primary: import("@angular/core").Signal<Mark | null>;
|
|
12824
12826
|
private readonly relations;
|
|
@@ -13569,7 +13571,7 @@ export type DocAiPhase = 'idle' | 'asking' | 'question' | 'outline' | 'writing'
|
|
|
13569
13571
|
*/
|
|
13570
13572
|
export declare class DocEditorComponent implements ControlValueAccessor {
|
|
13571
13573
|
protected readonly groups: readonly import("@magmonium/one").DocToolbarGroup[];
|
|
13572
|
-
protected readonly icons: Record<"
|
|
13574
|
+
protected readonly icons: Record<"code" | "link" | "table" | "strike" | "list" | "bold" | "heading" | "italic" | "quote", string>;
|
|
13573
13575
|
protected readonly docActionKey: typeof docActionKey;
|
|
13574
13576
|
private readonly translate;
|
|
13575
13577
|
protected readonly value: import("@angular/core").WritableSignal<string>;
|
|
@@ -15578,7 +15580,7 @@ export declare class ConfirmComponent {
|
|
|
15578
15580
|
* every confirmation drawn before this.
|
|
15579
15581
|
*/
|
|
15580
15582
|
params: import("@angular/core").InputSignal<Record<string, string>>;
|
|
15581
|
-
type: import("@angular/core").InputSignal<"warning" | "success" | "
|
|
15583
|
+
type: import("@angular/core").InputSignal<"warning" | "success" | "info" | "danger">;
|
|
15582
15584
|
/**
|
|
15583
15585
|
* Whether the question can be refused. `yes` is an acknowledgement — the one
|
|
15584
15586
|
* button commits and there is nothing else to press — and stays the default,
|
|
@@ -15595,7 +15597,7 @@ export declare class ConfirmComponent {
|
|
|
15595
15597
|
cancelLabel: import("@angular/core").InputSignal<string>;
|
|
15596
15598
|
protected readonly confirmText: import("@angular/core").Signal<string>;
|
|
15597
15599
|
protected readonly cancelText: import("@angular/core").Signal<string>;
|
|
15598
|
-
protected readonly accent: import("@angular/core").Signal<"error" | "
|
|
15600
|
+
protected readonly accent: import("@angular/core").Signal<"error" | "mm" | "success" | "warning">;
|
|
15599
15601
|
protected readonly iconName: import("@angular/core").Signal<"exclamation-triangle" | "info" | "trash" | "check-circle">;
|
|
15600
15602
|
protected accept(): void;
|
|
15601
15603
|
protected decline(): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-base-dropdown-BMsV5USo.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/dropdown/dropdown-box.ts","../../../../libs/one/src/lib/shared/ui/input/ui/dropdown/base-dropdown.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslatePipe } from '../../../../pipe/translate';\nimport { DropdownOption, DropdownValue } from '../../model/input';\n\n@Component({\n selector: 'm-dropdown-box',\n imports: [TranslatePipe],\n template: `\n <ul class=\"dropdown-box\" role=\"listbox\">\n @for (option of options(); track option.value; let i = $index) {\n @let selectedState = isSelected(option.value);\n <li\n class=\"dropdown-box__option\"\n [class.dropdown-box__option--selected]=\"selectedState\"\n [class.dropdown-box__option--disabled]=\"option.disabled\"\n [class.dropdown-box__option--active]=\"i === activeIndex()\"\n [style.--m-dropdown-option-depth]=\"option.depth\"\n role=\"option\"\n [attr.aria-selected]=\"selectedState\"\n [attr.data-value]=\"option.value\"\n (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\"\n tabindex=\"0\"\n >\n <!-- A group header is a row, never a choice: no box to tick. -->\n @if (multiple() && !option.disabled) {\n <input\n type=\"checkbox\"\n class=\"dropdown-box__checkbox\"\n [checked]=\"selectedState\"\n tabindex=\"-1\"\n (click)=\"$event.preventDefault()\"\n />\n }\n @if (option.noTranslate) {\n {{ option.label }}\n } @else {\n {{ option.label | translate }}\n }\n </li>\n } @empty {\n <li class=\"dropdown-box__empty\">\n {{ 'no-results-found' | translate }}\n </li>\n }\n </ul>\n `,\n styleUrl: './dropdown-box.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DropdownBoxComponent {\n readonly options = input<DropdownOption<DropdownValue>[]>([]);\n /** The values ticked, as a list whichever Field drew the panel. */\n readonly selected = input<readonly DropdownValue[]>([]);\n readonly multiple = input<boolean>(false);\n readonly activeIndex = input<number>(-1);\n readonly action = output<DropdownOption<DropdownValue>>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n // Keep the keyboard-active option in view as ↑/↓ walk a scrolled list.\n constructor() {\n effect(() => {\n const index = this.activeIndex();\n if (index < 0) return;\n this.host.nativeElement\n .querySelectorAll('.dropdown-box__option')\n [index]?.scrollIntoView?.({ block: 'nearest' });\n });\n }\n\n protected readonly isSelected = (value: DropdownValue): boolean =>\n this.selected().includes(value);\n\n // Only emit a selection event for enabled options.\n protected readonly selectOption = (\n option: DropdownOption<DropdownValue>\n ): void => {\n if (option.disabled) return;\n this.action.emit(option);\n };\n}\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n inputBinding,\n linkedSignal,\n model,\n outputBinding,\n Signal,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseInputComponent } from '../../lib/base-input';\nimport { Button } from '../../../button/type/button';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { TranslateService } from '../../../../services';\nimport { SelectorConfig, SelectorDirective } from '../../../../directives';\nimport { Direction } from '../../../../directives/selector/selector-type';\nimport { DropdownBoxComponent } from './dropdown-box';\nimport {\n DropdownInput,\n DropdownOption,\n DropdownValue,\n TextInput,\n} from '../../model/input';\nimport { TextInputComponent } from '../text/text';\nimport { assetOptions } from '../../lib/options-asset';\n\n/** The trigger both option Fields draw: a searchable text input and a chevron. */\nexport const DROPDOWN_TEMPLATE = `\n @if (config(); as dropdown) {\n @if (dropdown.label) {\n <m-label\n [for]=\"dropdown.name ?? ''\"\n [placeholder]=\"dropdown.label\"\n [params]=\"dropdown.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div\n class=\"trigger-wrap\"\n #wrapper\n [mSelector]=\"selectorConfig()\"\n [disabled]=\"disabled() || readonly() || !!config()?.readonly\"\n (opened)=\"onOpened()\"\n (closed)=\"onClosed()\"\n (focusin)=\"isFocused.set(true)\"\n (focusout)=\"isFocused.set(false)\"\n >\n <m-text-input\n [config]=\"triggerInputConfig()\"\n [value]=\"displayValue()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [hideErrors]=\"true\"\n [(touched)]=\"touched\"\n [focused]=\"focused()\"\n (valueChange)=\"onInput($event)\"\n (click)=\"preventToggleWhenOpen($event)\"\n (keydown.space)=\"$event.stopPropagation()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.arrowdown)=\"onArrow($event, 1)\"\n (keydown.arrowup)=\"onArrow($event, -1)\"\n (keydown.tab)=\"$event.stopPropagation()\"\n />\n <m-button [disabled]=\"disabled()\" [config]=\"chevron()\" />\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n`;\n\nexport const DROPDOWN_IMPORTS = [\n LabelComponent,\n TextOutputComponent,\n TextInputComponent,\n ButtonComponent,\n SelectorDirective,\n];\n\n/**\n * Everything a Dropdown and a Multiselect share: the options, the search, the\n * keyboard walk and the panel. What differs is only what the Field holds — one\n * value or a list — so a subclass says which values are selected and what a\n * pick does to them.\n */\n@Directive()\nexport abstract class BaseDropdownComponent extends BaseInputComponent<DropdownInput> {\n public override config = input<Partial<DropdownInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n\n readonly options = input<\n DropdownOption<DropdownValue>[] | Signal<DropdownOption<DropdownValue>[]>\n >();\n readonly dir = input<Direction>();\n readonly toggle = model(false);\n readonly searchTerm = signal('');\n readonly isFocused = signal(false);\n readonly chevron = computed(\n () =>\n <Button>{\n icon: this.toggle() ? 'chevron-up' : 'chevron-down',\n one: true,\n variant: 'ghost',\n // In-Field control, never the form's submit — without this the Button\n // reads as the submit control and greys out while the form is invalid.\n type: 'button',\n // Chevron tracks the trigger's border like the text input's own icon:\n // red while the Field shows errors, focus tint while focused, border at rest.\n color: this.showErrors()\n ? 'error'\n : this.isFocused()\n ? 'focus'\n : 'border',\n // The trigger input is the Field's tab stop; the chevron only repeats\n // what clicking that input already does, so Tab walks past it.\n tabindex: -1,\n }\n );\n\n /** The values the Field holds now, as a list whichever kind it is. */\n protected abstract readonly selectedValues: Signal<readonly DropdownValue[]>;\n /** Whether the panel ticks rows and stays open across picks. */\n protected abstract readonly multiple: boolean;\n /** What picking `option` does to the Field's value. */\n protected abstract selectOption(option: DropdownOption<DropdownValue>): void;\n\n protected readonly triggerInputConfig = computed(() => {\n const dropdown = this.config() as DropdownInput | undefined;\n return <Partial<TextInput>>{\n name: dropdown?.name,\n icon: dropdown?.icon,\n one: dropdown?.one,\n placeholder: this.placeholderText(),\n readonly: this.readonly() || !!dropdown?.readonly,\n };\n });\n\n protected readonly dropdownOptions = computed(\n (): DropdownOption<DropdownValue>[] => {\n const runtimeOptions = this.options();\n const source =\n runtimeOptions ?? (this.config() as DropdownInput | undefined)?.options;\n if (typeof source === 'function') return source();\n if (source?.length) return source;\n return this.assetOptions();\n }\n );\n\n private readonly translateService = inject(TranslateService);\n\n protected readonly assetOptions = assetOptions(\n () => (this.config() as DropdownInput | undefined)?.optionsAsset\n );\n\n /** An option's text: authored as it stands, a key translated. */\n private readonly optionLabel = (\n option?: DropdownOption<DropdownValue>\n ): string => {\n if (!option?.label) return '';\n return option.noTranslate\n ? option.label\n : this.translateService.translate(option.label);\n };\n\n protected readonly filteredOptions = computed(\n (): DropdownOption<DropdownValue>[] => {\n const search = this.searchTerm().toLowerCase();\n if (!search) return this.dropdownOptions();\n return this.dropdownOptions().filter((o) => {\n const label = this.optionLabel(o).toLowerCase();\n return (\n label.includes(search) ||\n String(o.value).toLowerCase().includes(search)\n );\n });\n }\n );\n\n /** The option ↑/↓ point at while the panel is open; -1 is none. Reset as the search narrows the list. */\n protected readonly activeIndex = linkedSignal<\n DropdownOption<DropdownValue>[],\n number\n >({\n source: this.filteredOptions,\n computation: (options) =>\n this.searchTerm() ? this.nextEnabled(options, -1, 1) : -1,\n });\n\n /** The enabled option `step` rows past `from`, wrapping; `from` itself when none. */\n private readonly nextEnabled = (\n options: DropdownOption<DropdownValue>[],\n from: number,\n step: 1 | -1\n ): number => {\n for (let i = 1; i <= options.length; i++) {\n const index =\n (((from + step * i) % options.length) + options.length) %\n options.length;\n if (!options[index].disabled) return index;\n }\n return from;\n };\n\n /** One pick reads as its option's label, several as a count. */\n private readonly selectionLabel = computed((): string => {\n const values = this.selectedValues();\n if (values.length === 0) return '';\n if (values.length === 1) {\n return this.optionLabel(\n this.dropdownOptions().find((o) => o.value === values[0])\n );\n }\n const translation = this.translateService.translate(\n `selected?count=${values.length}`\n );\n return translation.includes('selected')\n ? `${values.length} Selected`\n : translation;\n });\n\n protected readonly displayValue = computed((): string =>\n this.toggle() ? this.searchTerm() : this.selectionLabel()\n );\n\n protected readonly placeholderText = computed((): string => {\n if (this.toggle()) {\n const label = this.selectionLabel();\n if (label) return label;\n }\n const placeholder = (this.config() as DropdownInput | undefined)\n ?.placeholder;\n return placeholder ? this.translateService.translate(placeholder) : '';\n });\n\n private readonly wrapperRef =\n viewChild<ElementRef<HTMLDivElement>>('wrapper');\n\n protected readonly selectorConfig = computed<\n SelectorConfig<DropdownBoxComponent>\n >(() => ({\n component: DropdownBoxComponent,\n base: 'm-dropdown-input',\n matchTriggerWidth: true,\n toggle: true,\n dir: this.dir(),\n bindings: [\n inputBinding('options', this.filteredOptions),\n inputBinding('selected', this.selectedValues),\n inputBinding('multiple', () => this.multiple),\n inputBinding('activeIndex', this.activeIndex),\n outputBinding<DropdownOption<DropdownValue>>('action', (option) =>\n this.selectOption(option)\n ),\n ],\n }));\n\n /** Shuts the panel after a pick, the way a click on the trigger would. */\n protected readonly closePanel = (): void => {\n this.toggle.set(false);\n this.searchTerm.set('');\n setTimeout(() => this.wrapperRef()?.nativeElement.click(), 0);\n };\n\n protected readonly onOpened = (): void => {\n this.toggle.set(true);\n this.searchTerm.set('');\n const current = this.selectedValues()[0];\n this.activeIndex.set(\n this.filteredOptions().findIndex((o) => o.value === current)\n );\n };\n\n // Focus stays in the trigger input (it is the search box), so ↑/↓ move the\n // active option rather than DOM focus. Closed, ArrowDown bubbles on to\n // SelectorDirective, which opens the panel.\n protected readonly onArrow = (event: Event, step: 1 | -1): void => {\n if (!this.toggle()) return;\n event.preventDefault();\n this.activeIndex.update((index) =>\n this.nextEnabled(this.filteredOptions(), index, step)\n );\n };\n\n // Enter never reaches SelectorDirective (it would toggle the panel); open,\n // it picks the active option.\n protected readonly onEnter = (event: Event): void => {\n event.stopPropagation();\n if (!this.toggle()) return;\n event.preventDefault();\n const option = this.filteredOptions()[this.activeIndex()];\n if (option && !option.disabled) this.selectOption(option);\n };\n\n protected readonly onClosed = (): void => {\n this.toggle.set(false);\n this.searchTerm.set('');\n };\n\n protected readonly onInput = (value: string): void => {\n this.searchTerm.set(value);\n };\n\n protected readonly preventToggleWhenOpen = (event: Event): void => {\n if (this.toggle() || this.readonly() || this.config()?.readonly) {\n event.stopPropagation();\n }\n };\n}\n"],"mappings":";;;;;;;;;;AA0DA,IAAa,uBAAb,MAAa,qBAAoB;CACtB,UAAU,MAAuC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEpD,WAAW,MAAgC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,OAAM;CAEP,OAAO,OAAgC,UAAU;CAGlE,cAAA;EACE,aAAY;GACV,MAAM,QAAQ,KAAK,YAAW;GAC9B,IAAI,QAAQ,GAAG;GACf,KAAK,KAAK,cACP,iBAAiB,uBAAuB,CAAC,CACzC,MAAM,EAAE,iBAAiB,EAAE,OAAO,UAAS,CAAE;EAClD,CAAC;CACH;CAEmB,cAAc,UAC/B,KAAK,SAAQ,CAAE,CAAC,SAAS,KAAK;CAGb,gBACjB,WACQ;EACR,IAAI,O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A;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAS,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-checkbox-C85FEuTs.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/lib/placed-checkbox.token.ts","../../../../libs/one/src/lib/shared/ui/input/ui/checkbox/checkbox.ts"],"sourcesContent":["import { InjectionToken, Signal } from '@angular/core';\nimport { DropdownOption } from '../model/input';\n\n/**\n * An `m-checkbox` placed between a SectionFormItem's tags as one option of its\n * CheckboxGroup (libs/one ADR 0039). Provided by the checkbox itself so the\n * item can collect its children without importing the checkbox chunk it only\n * lazy-loads. `undefined` until the checkbox names a `value`.\n */\nexport type PlacedCheckbox = {\n readonly option: Signal<DropdownOption | undefined>;\n};\n\nexport const PLACED_CHECKBOX = new InjectionToken<PlacedCheckbox>(\n 'PLACED_CHECKBOX'\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n ModelSignal,\n} from '@angular/core';\nimport { BaseCheckboxInputComponent } from './base-checkbox';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { DropdownOption, Input } from '../../model/input';\nimport {\n PLACED_CHECKBOX,\n PlacedCheckbox,\n} from '../../lib/placed-checkbox.token';\nimport { toAttrBool } from '../../../../functions/config/attribute-value';\n\n@Component({\n selector: 'm-checkbox',\n template: `\n @if (config(); as checkbox) {\n <div class=\"checkbox\">\n <input\n [checked]=\"checked()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n type=\"checkbox\"\n [id]=\"checkbox.name\"\n />\n @if (labelText(); as text) {\n <m-label\n [for]=\"checkbox.name\"\n [placeholder]=\"text\"\n [params]=\"checkbox.params\"\n [noTranslate]=\"isNoTranslate()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent],\n styleUrl: './checkbox.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: PLACED_CHECKBOX, useExisting: CheckboxInputComponent },\n ],\n})\nexport class CheckboxInputComponent\n extends BaseCheckboxInputComponent\n implements PlacedCheckbox\n{\n public override value = undefined;\n public override checked = model<boolean>(false) as ModelSignal<boolean>;\n public override config = input<Partial<Input> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n\n // What a checkbox placed inside a CheckboxGroup's SectionFormItem says about\n // the option it stands for, written on its own tag (ADR 0010, ADR 0039).\n // `value` is the attribute because it is the option's value; the member is\n // named apart because FormCheckboxControl pins `value` itself to undefined —\n // a checkbox control's value is `checked`.\n /* eslint-disable @angular-eslint/no-input-rename */\n public readonly optionValue = input<string | undefined>(undefined, {\n alias: 'value',\n });\n /* eslint-enable @angular-eslint/no-input-rename */\n public readonly label = input<string | undefined>();\n public readonly noTranslate = input<boolean | string | undefined>();\n\n protected readonly labelText = computed(\n () => this.label() ?? this.config()?.label\n );\n protected readonly isNoTranslate = computed(\n () => toAttrBool(this.noTranslate()) === true\n );\n\n public readonly option = computed((): DropdownOption | undefined => {\n const value = this.optionValue();\n if (!value) return undefined;\n return {\n value,\n label: this.label() ?? value,\n disabled: this.disabled() || undefined,\n noTranslate: this.isNoTranslate() || undefined,\n };\n });\n\n protected onChange(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.checked ?? false);\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAa,kBAAkB,IAAI,eACjC,iBAAiB;;ACgDnB,IAAa,yBAAb,MAAa,+BACH,2BAA0B;CAGlB,QAAQ;CACR,UAAU,MAAe,KAAK;CAC9B,SAAS,MAAmC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,MACvB,CAAA,GACD,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAQe,cAAc,MAA0B,QAAS;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAC/D,OAAO;CAAO,CAAA;CAGA,QAAQ,MAA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A,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA3ClC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,UACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCT,SACQ,CAAC,gBAAgB,mBAAmB;GAAC,iBAE7B,wBAAwB;GAAM,WACpC,CACT;IAAE,SAAS;IAAiB,aAAW;GAAwB,CAChE;GAAA,QAAA,CAAA,oljBAAA;EAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-multi-range-DqtW4U_x.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/base-array.ts","../../../../libs/one/src/lib/shared/ui/input/ui/range/multi-range.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n ElementRef,\n inject,\n} from '@angular/core';\nimport {\n FormValueControl,\n ValidationError,\n WithOptionalFieldTree,\n} from '@angular/forms/signals';\nimport { Input } from '../../model/input';\nimport { isFilledValue } from '../../lib/base-input';\n\n@Component({\n selector: 'm-base-array-input',\n template: ``,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BaseArrayInputComponent implements FormValueControl<number[]> {\n value = model<number[]>([]);\n readonly focused = input<boolean>(false);\n readonly errors = input<readonly WithOptionalFieldTree<ValidationError>[]>([]);\n readonly config = input<Input>();\n readonly required = input<boolean>(false);\n readonly disabled = input<boolean>(false);\n readonly invalid = input<boolean>(false);\n touched = model<boolean>(false);\n\n protected readonly elementRef = inject(ElementRef);\n\n // Same rule as BaseInputComponent: a prefilled value shows a broken rule at once.\n showErrors = computed(\n () => this.invalid() && (this.touched() || isFilledValue(this.value()))\n );\n\n protected readonly setValue = (value: number[]): void => {\n this.value.set(value);\n this.touched.set(true);\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n HostListener,\n linkedSignal,\n signal,\n viewChild,\n} from '@angular/core';\nimport { BaseArrayInputComponent } from '../text/base-array';\nimport { DraggableDirective, Draggable } from '../../../../directives';\nimport { LabelComponent } from '../label';\nimport { MultiRangeInput } from '../../model/input';\nimport { Direction } from '../../../../type';\n\n@Component({\n selector: 'm-multi-range',\n imports: [DraggableDirective, LabelComponent],\n template: `\n @if (config(); as range) {\n <div class=\"m-range m-range--multi\">\n <m-label\n class=\"m-range__label\"\n [placeholder]=\"range.label\"\n [params]=\"range.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"m-range__control\">\n <div class=\"m-range__track\" #track>\n <div\n class=\"m-range__fill\"\n [style.left.px]=\"minThumb().position.x\"\n [style.width.px]=\"fillWidth()\"\n ></div>\n <div\n class=\"m-range__thumb\"\n [(mDraggable)]=\"minThumb\"\n [min]=\"{ x: 0, y: _TRACK_HALF_H }\"\n [max]=\"{ x: maxThumb().position.x, y: _TRACK_HALF_H }\"\n ></div>\n <div\n class=\"m-range__thumb\"\n [(mDraggable)]=\"maxThumb\"\n [min]=\"{ x: minThumb().position.x, y: _TRACK_HALF_H }\"\n [max]=\"{ x: _trackWidth(), y: _TRACK_HALF_H }\"\n ></div>\n </div>\n </div>\n <span class=\"m-range__value\"\n >{{ _displayMin() }}–{{ _displayMax() }}</span\n >\n </div>\n }\n `,\n styleUrl: './range.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MultiRangeInputComponent extends BaseArrayInputComponent {\n private readonly _track = viewChild<ElementRef<HTMLDivElement>>('track');\n protected readonly _trackWidth = signal(0);\n protected readonly _TRACK_HALF_H = 3;\n\n /**\n * Measured live rather than once. The track fills its row and opens inside\n * panels that animate in, and a width read mid\n * animation is the scaled one — `getBoundingClientRect` counts transforms\n * where a ResizeObserver's box does not. A stale width is a thumb that stops\n * short of the track's end or, before the bounds became inputs on the\n * Draggable, ran clean past it.\n */\n private readonly _measure = effect((onCleanup) => {\n const track = this._track();\n if (!track) return;\n\n const el = track.nativeElement;\n this._trackWidth.set(el.getBoundingClientRect().width);\n\n // Absent under jsdom, where the window resize below is the only signal.\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(([entry]) =>\n this._trackWidth.set(entry.contentRect.width)\n );\n observer.observe(el);\n onCleanup(() => observer.disconnect());\n });\n\n readonly minThumb = linkedSignal({\n source: () => ({\n val: this.value()[0],\n tw: this._trackWidth(),\n cfg: this.config(),\n }),\n computation: ({ val, tw, cfg }): Draggable => {\n const c = cfg as MultiRangeInput | undefined;\n const min = c?.min ?? 0;\n const max = c?.max ?? 100;\n const numVal = val ?? min;\n const x = tw > 0 ? (tw * (numVal - min)) / (max - min) : 0;\n return {\n direction: 'x' as Direction,\n position: { x, y: this._TRACK_HALF_H },\n };\n },\n });\n\n readonly maxThumb = linkedSignal({\n source: () => ({\n val: this.value()[1],\n tw: this._trackWidth(),\n cfg: this.config(),\n }),\n computation: ({ val, tw, cfg }): Draggable => {\n const c = cfg as MultiRangeInput | undefined;\n const min = c?.min ?? 0;\n const max = c?.max ?? 100;\n const numVal = val ?? max;\n const x = tw > 0 ? (tw * (numVal - min)) / (max - min) : tw;\n return {\n direction: 'x' as Direction,\n position: { x, y: this._TRACK_HALF_H },\n };\n },\n });\n\n readonly fillWidth = computed(() =>\n Math.max(\n 0,\n (this.maxThumb().position.x ?? 0) - (this.minThumb().position.x ?? 0)\n )\n );\n\n readonly _displayMin = computed(() => {\n const c = this.config() as MultiRangeInput | undefined;\n const min = c?.min ?? 0;\n const max = c?.max ?? 100;\n const tw = this._trackWidth();\n if (tw === 0) return this.value()[0] ?? min;\n return Math.round(\n min + ((max - min) * (this.minThumb().position.x ?? 0)) / tw\n );\n });\n\n readonly _displayMax = computed(() => {\n const c = this.config() as MultiRangeInput | undefined;\n const min = c?.min ?? 0;\n const max = c?.max ?? 100;\n const tw = this._trackWidth();\n if (tw === 0) return this.value()[1] ?? max;\n return Math.round(\n min + ((max - min) * (this.maxThumb().position.x ?? 0)) / tw\n );\n });\n\n constructor() {\n super();\n\n effect(() => {\n const pos = this.minThumb().position;\n const c = this.config() as MultiRangeInput | undefined;\n const min = c?.min ?? 0;\n const max = c?.max ?? 100;\n const tw = this._trackWidth();\n if (tw === 0) return;\n const currentVal = this.value()[0] ?? min;\n const expectedX = (tw * (currentVal - min)) / (max - min);\n if (pos.x !== expectedX) {\n const newMin = Math.round(min + ((max - min) * (pos.x ?? 0)) / tw);\n const currentMax = this.value()[1] ?? max;\n this.setValue([newMin, currentMax]);\n }\n });\n\n effect(() => {\n const pos = this.maxThumb().position;\n const c = this.config() as MultiRangeInput | undefined;\n const min = c?.min ?? 0;\n const max = c?.max ?? 100;\n const tw = this._trackWidth();\n if (tw === 0) return;\n const currentVal = this.value()[1] ?? max;\n const expectedX = tw > 0 ? (tw * (currentVal - min)) / (max - min) : tw;\n if (pos.x !== expectedX) {\n const newMax = Math.round(min + ((max - min) * (pos.x ?? 0)) / tw);\n const currentMin = this.value()[0] ?? min;\n this.setValue([currentMin, newMax]);\n }\n });\n }\n\n @HostListener('window:resize')\n protected _onResize(): void {\n const track = this._track();\n if (track) {\n this._trackWidth.set(track.nativeElement.getBoundingClientRect().width);\n }\n }\n}\n"],"mappings":";;;;;;AAsBA,IAAa,0BAAb,MAAa,wBAAuB;CAClC,QAAQ,MAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAClB,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,MAAyD,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACrE,SAAS,MAAc,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAe,OAAM,GAA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BAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAwB,YAAA,CAAA;EA3CpC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,SAChB,CAAC,oBAAoB,cAAc;GAAC,UACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCT,iBAEgB,wBAAwB;GAAM,QAAA,CAAA,soFAAA;EAAA,CAAA;CAGiB,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAmItE,MAAA;GAAa,MAAA,CAAA,eAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-otp-DOPvjYJz.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/otp.ts"],"sourcesContent":["import {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { CommonModule } from '@angular/common';\nimport { OtpInput } from '../../model/input';\nimport { IS_DESIGN_MODE } from '../../../../config/tokens';\n\n@Component({\n selector: 'm-otp-input',\n template: `\n @if (otpConfig(); as otp) {\n <m-label\n [for]=\"otp.name\"\n [placeholder]=\"otp.label\"\n [params]=\"otp.params\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n />\n <div class=\"otp-container\">\n @for (item of otpArray(); track $index) {\n <input\n [id]=\"$index === 0 ? (otp.name ?? '') : ''\"\n #otpInput\n type=\"text\"\n maxlength=\"1\"\n [class.error]=\"showErrors()\"\n [disabled]=\"isDisabled()\"\n [value]=\"otpValues()[$index] || ''\"\n (input)=\"onInput($event, $index)\"\n (keydown)=\"onKeyDown($event, $index)\"\n (paste)=\"onPaste($event)\"\n />\n }\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n styleUrl: './otp.sass',\n imports: [LabelComponent, TextOutputComponent, CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OtpInputComponent extends BaseTextInputComponent<OtpInput> {\n otpValues = signal<string[]>([]);\n otpInputs = viewChildren<ElementRef<HTMLInputElement>>('otpInput');\n protected readonly otpConfig = computed(() => this.config() as OtpInput);\n otpArray = computed(() => {\n const length = this.otpConfig()?.length || 6;\n return Array(length).fill(0);\n });\n\n // Inert on the Canvas — other inputs stay idle because they never autofocus;\n // OTP used to steal focus and look live while composing (DesignMode).\n private readonly isDesignMode = !!inject(IS_DESIGN_MODE, { optional: true });\n protected readonly isDisabled = computed(\n () => this.isDesignMode || this.disabled()\n );\n\n // BaseText answers `focused` by focusing its `#inputElement`, and an OTP has\n // none — it has a row of boxes. Without this the caret never lands on an OTP\n // field, so the form that opens on one (login's verification step) reads as\n // dead until the User clicks it.\n private hasAutofocused = false;\n\n constructor() {\n super();\n effect(() => {\n const length = this.otpConfig()?.length || 6;\n this.otpValues.set(Array(length).fill(''));\n });\n\n afterRenderEffect(() => {\n const inputs = this.otpInputs();\n if (!this.focused() || !inputs.length || this.hasAutofocused) return;\n this.hasAutofocused = true;\n untracked(() => this.focusInput(0));\n });\n }\n\n onInput = (event: Event, index: number): void => {\n if (this.isDisabled()) return;\n const input = event.target as HTMLInputElement;\n let value = input.value;\n\n value = value.replace(/[^a-zA-Z0-9]/g, '');\n\n if (value.length > 1) {\n value = value.slice(-1);\n }\n\n input.value = value.toUpperCase();\n\n const newValues = [...this.otpValues()];\n newValues[index] = value.toUpperCase();\n this.otpValues.set(newValues);\n\n const length = this.otpConfig()?.length || 6;\n if (value && index < length - 1) {\n this.focusInput(index + 1);\n }\n this.updateValue();\n };\n\n onKeyDown = (event: KeyboardEvent, index: number): void => {\n if (this.isDisabled()) return;\n const input = event.target as HTMLInputElement;\n const length = this.otpConfig()?.length || 6;\n\n const isAlphaNumeric = /^[a-zA-Z0-9]$/.test(event.key);\n const isControlKey = [\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Tab',\n ].includes(event.key);\n\n if (!isAlphaNumeric && !isControlKey) {\n event.preventDefault();\n return;\n }\n\n if (event.key === 'Backspace') {\n if (!input.value && index > 0) {\n this.focusInput(index - 1);\n }\n }\n if (event.key === 'ArrowLeft' && index > 0) {\n event.preventDefault();\n this.focusInput(index - 1);\n }\n if (event.key === 'ArrowRight' && index < length - 1) {\n event.preventDefault();\n this.focusInput(index + 1);\n }\n };\n\n onPaste = (event: ClipboardEvent): void => {\n if (this.isDisabled()) return;\n event.preventDefault();\n event.stopPropagation();\n\n const length = this.otpConfig()?.length || 6;\n const pastedData = event.clipboardData?.getData('text') || '';\n\n const alphanumeric = pastedData\n .replace(/[^a-zA-Z0-9]/g, '')\n .slice(0, length);\n\n if (alphanumeric.length > 0) {\n const newValues = Array(length).fill('');\n alphanumeric.split('').forEach((char, index) => {\n if (index < length) {\n newValues[index] = char.toUpperCase();\n }\n });\n\n this.otpValues.set(newValues);\n this.updateValue();\n\n const focusIndex = Math.min(alphanumeric.length, length - 1);\n setTimeout(() => this.focusInput(focusIndex), 0);\n }\n };\n\n private focusInput(index: number): void {\n if (this.isDisabled()) return;\n const inputs = this.otpInputs();\n if (inputs[index]) {\n inputs[index].nativeElement.focus();\n }\n }\n\n private updateValue(): void {\n const otpValue = this.otpValues().join('');\n this.setValue(otpValue);\n }\n}\n"],"mappings":";;;;;;;AA6DA,IAAa,oBAAb,MAAa,0BAA0B,uBAAgC;CACrE,YAAY,OAAiB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,YAAY,aAA2C,YAAW,GAAA,YAAA,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A,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA1C7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,UACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCT,SAEQ;IAAC;IAAgB;IAAqB;GAAY;GAAC,iBAC3C,wBAAwB;GAAM,QAAA,CAAA,+qEAAA;EAAA,CAAA;CAIQ,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA,EAAA,WAAA,CAAA;EAAA,MAAA,GAAA;EAAA,MAAA,CAAA,YAAU,EAAA,UAAA,KAAA,CAAA;CAAA,CAAA,EAAA;AAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-password-BqdyEDF6.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/password.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n signal,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { TranslatePipe } from '../../../../pipe';\n\n@Component({\n selector: 'm-password-input',\n template: `\n @if (config(); as text) {\n <m-label\n [for]=\"text.name\"\n [placeholder]=\"text.label\"\n [params]=\"text.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"input-wrapper\">\n <input\n [id]=\"text.name ?? ''\"\n [attr.data-testid]=\"text.testid ?? (text.name ? text.name + '-input' : null)\"\n [value]=\"value()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"(text.placeholder ?? '') | translate: text.params\"\n (input)=\"onInput($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false); touched.set(true)\"\n [type]=\"type()\"\n />\n <m-one-button\n type=\"button\"\n [disabled]=\"disabled()\"\n [name]=\"button()\"\n [color]=\"iconColor()\"\n (clicked)=\"toggleType()\"\n />\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent, ButtonComponent, TranslatePipe],\n styleUrl: './password.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PasswordInputComponent extends BaseTextInputComponent {\n isPassword = signal<boolean>(true);\n type = computed(() => (this.isPassword() ? 'password' : 'text'));\n button = computed(() => (!this.isPassword() ? 'eye' : 'eye_close'));\n\n protected toggleType() {\n this.isPassword.update((now) => !now);\n }\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.value ?? '');\n }\n}\n"],"mappings":";;;;;;;AA4DA,IAAa,yBAAb,MAAa,+BAA+B,uBAAsB;CAChE,aAAa,OAAgB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,OAAO,eAAgB,KAAK,WAAU,IAAK,aAAa,QAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAChE,SAAS,eAAgB,CAAC,KAAK,WAAU,IAAK,QAAQ,aAAa,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,aAAU;EAClB,KAAK,WAAW,QAAQ,QAAQ,CAAC,GAAG;CACtC;CAEU,QAAQ,OAAY;EAC5B,MAAM,SAAS,MAAM;EACrB,KAAK,SAAS,QAAQ,SAAS,EAAE;CACnC;CAZW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAsB,cAAA;EAAA,UAAA;EAAA,iBAAA;EAAA,UAAA;EAAA,UA9CvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCT,UAAA;EAAA,QAAA,CAAA,s8HAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MACS;IAAc,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAmB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,gBAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAe,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,gBAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAa,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAIlE,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAhDlC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAkB,UAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCT,SACQ;IAAC;IAAgB;IAAqB;IAAiB;GAAa;GAAC,iBAE7D,wBAAwB;GAAM,QAAA,CAAA,s8HAAA;EAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-text-CMULvvAr.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/text.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { IconComponent } from '../../../icon';\nimport { TranslatePipe } from '../../../../pipe';\nimport { Input, InputType, NumberInput } from '../../model/input';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\n\n/**\n * What this one component draws: a line of text, or the same line typed\n * `number`. WrapperInputComponent has no case for a `number` Field, so it\n * lands here — and the figures a NumberInput carries have to be readable off\n * the config the template already holds.\n */\nexport type TextOrNumberInput = Omit<Input, 'type'> &\n Pick<NumberInput, 'min' | 'max' | 'step'> & {\n type: InputType.TEXT | InputType.NUMBER;\n };\n\n@Component({\n selector: 'm-text-input',\n template: `\n @if (config(); as text) {\n @if (text.label) {\n <m-label\n [for]=\"text.name ?? ''\"\n [placeholder]=\"text.label\"\n [params]=\"text.params\"\n [noTranslate]=\"text.noTranslate\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div class=\"input-wrapper\">\n @if (text.icon) {\n <m-icon\n [name]=\"text.icon\"\n [color]=\"iconColor()\"\n [one]=\"text.one\"\n />\n }\n @if (text.prefix) {\n <span class=\"input-prefix\">{{ text.prefix }}</span>\n }\n <input\n [id]=\"text.name ?? ''\"\n [attr.data-testid]=\"text.testid ?? (text.name ? text.name + '-input' : null)\"\n [value]=\"value()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [class.has-icon]=\"!!text.icon\"\n [class.has-prefix]=\"!!text.prefix\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly() || config()?.readonly\"\n [placeholder]=\"text.placeholder ?? '' | translate: text.params\"\n (input)=\"onInput($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false); touched.set(true)\"\n [type]=\"isNumber() ? 'number' : 'text'\"\n [attr.min]=\"isNumber() ? text.min ?? null : null\"\n [attr.max]=\"isNumber() ? text.max ?? null : null\"\n [attr.step]=\"isNumber() ? text.step ?? null : null\"\n />\n @if (config()?.status; as status) {\n <div class=\"input-indicator\" [class]=\"'input-indicator--' + status\">\n @if (status === 'checking') {\n <span class=\"spinner\"></span>\n } @else if (status === 'available') {\n <m-icon name=\"check\" color=\"success\" />\n }\n </div>\n }\n @if (text.suffix) {\n <span class=\"input-suffix\">{{ text.suffix }}</span>\n }\n </div>\n @if (showErrors() && !hideErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent, IconComponent, TranslatePipe],\n styleUrl: './text.sass',\n host: {\n '[class]': \"config()?.variant ? 'm-input--' + config()?.variant : ''\",\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TextInputComponent extends BaseTextInputComponent<TextOrNumberInput> {\n public override value = model<string>('');\n public override config = input<Partial<TextOrNumberInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n readonly hideErrors = input<boolean>(false);\n\n // A `number` Field draws this same component (WrapperInputComponent has no\n // case of its own for it), so the type it declares decides the element it\n // draws. What *leaves* the field is coerced a level up, in the wrapper: an\n // `<input>` reads its value as text whatever its type, and every other\n // component on this base is a string field.\n protected readonly isNumber = computed(() => {\n const config = this.config();\n return !!config && config.type === InputType.NUMBER;\n });\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.value ?? '');\n }\n}\n"],"mappings":";;;;;;;;;;AAqGA,IAAa,qBAAb,MAAa,2BAA2B,uBAAyC;CAC/D,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,SAAS,MAA+C,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,C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