@radix-ng/primitives 0.22.0 → 0.23.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/accordion/src/accordion-item.directive.d.ts +22 -13
- package/accordion/src/accordion-root.directive.d.ts +22 -3
- package/aspect-ratio/src/aspect-ratio.directive.d.ts +5 -3
- package/avatar/index.d.ts +9 -0
- package/avatar/src/avatar-fallback.directive.d.ts +9 -0
- package/avatar/src/avatar-image.directive.d.ts +12 -0
- package/collapsible/src/collapsible-content.directive.d.ts +0 -3
- package/collapsible/src/collapsible-root.directive.d.ts +11 -4
- package/compodoc/documentation.json +1742 -2807
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +30 -3
- package/esm2022/accordion/src/accordion-item.directive.mjs +23 -14
- package/esm2022/accordion/src/accordion-root.directive.mjs +19 -3
- package/esm2022/aspect-ratio/src/aspect-ratio.directive.mjs +4 -2
- package/esm2022/avatar/index.mjs +27 -1
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +10 -1
- package/esm2022/avatar/src/avatar-image.directive.mjs +13 -1
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +1 -4
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +17 -8
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +35 -4
- package/esm2022/label/src/label.directive.mjs +6 -8
- package/esm2022/popover/src/popover.utils.mjs +17 -23
- package/esm2022/progress/src/progress-indicator.directive.mjs +1 -2
- package/esm2022/progress/src/progress-root.directive.mjs +8 -3
- package/esm2022/separator/src/separator.directive.mjs +9 -2
- package/esm2022/switch/src/switch-input.directive.mjs +4 -1
- package/esm2022/switch/src/switch-root.directive.mjs +28 -3
- package/esm2022/switch/src/switch-thumb.directive.mjs +4 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +40 -15
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +3 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +45 -2
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +16 -10
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +34 -3
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +5 -7
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +16 -22
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +7 -3
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +8 -1
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +33 -2
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/label/src/label.directive.d.ts +5 -7
- package/package.json +1 -1
- package/progress/src/progress-indicator.directive.d.ts +0 -1
- package/progress/src/progress-root.directive.d.ts +7 -2
- package/separator/src/separator.directive.d.ts +8 -1
- package/switch/src/switch-input.directive.d.ts +3 -0
- package/switch/src/switch-root.directive.d.ts +27 -2
- package/switch/src/switch-thumb.directive.d.ts +3 -0
@@ -12,6 +12,9 @@ const SWITCH_VALUE_ACCESSOR = {
|
|
12
12
|
multi: true
|
13
13
|
};
|
14
14
|
let idIterator = 0;
|
15
|
+
/**
|
16
|
+
* @group Components
|
17
|
+
*/
|
15
18
|
class RdxSwitchRootDirective {
|
16
19
|
constructor() {
|
17
20
|
this.id = input(`rdx-switch-${idIterator++}`);
|
@@ -19,20 +22,37 @@ class RdxSwitchRootDirective {
|
|
19
22
|
this.inputId = input(null);
|
20
23
|
/**
|
21
24
|
* When true, indicates that the user must check the switch before the owning form can be submitted.
|
25
|
+
*
|
26
|
+
* @default false
|
27
|
+
* @group Props
|
22
28
|
*/
|
23
29
|
this.required = input(false, {
|
24
30
|
transform: booleanAttribute
|
25
31
|
});
|
26
|
-
|
32
|
+
/**
|
33
|
+
* @default null
|
34
|
+
* @group Props
|
35
|
+
*/
|
36
|
+
this.ariaLabelledBy = input(undefined, {
|
27
37
|
alias: 'aria-labelledby'
|
28
38
|
});
|
29
|
-
|
39
|
+
/**
|
40
|
+
* @default null
|
41
|
+
* @group Props
|
42
|
+
*/
|
43
|
+
this.ariaLabel = input(undefined, {
|
30
44
|
alias: 'aria-label'
|
31
45
|
});
|
32
46
|
/**
|
33
47
|
* The controlled state of the switch. Must be used in conjunction with onCheckedChange.
|
48
|
+
* @defaultValue false
|
49
|
+
* @group Props
|
34
50
|
*/
|
35
51
|
this.checked = model(false);
|
52
|
+
/**
|
53
|
+
* @default false
|
54
|
+
* @group Props
|
55
|
+
*/
|
36
56
|
this.defaultChecked = input(false, { transform: booleanAttribute });
|
37
57
|
/**
|
38
58
|
* The state of the switch.
|
@@ -42,6 +62,8 @@ class RdxSwitchRootDirective {
|
|
42
62
|
this.checkedState = computed(() => this.checked());
|
43
63
|
/**
|
44
64
|
* When true, prevents the user from interacting with the switch.
|
65
|
+
* @default false
|
66
|
+
* @group Props
|
45
67
|
*/
|
46
68
|
this.disabled = input(false, {
|
47
69
|
transform: booleanAttribute
|
@@ -50,6 +72,9 @@ class RdxSwitchRootDirective {
|
|
50
72
|
this.disabledState = computed(() => this.disabled() || this.accessorDisabled());
|
51
73
|
/**
|
52
74
|
* Event handler called when the state of the switch changes.
|
75
|
+
*
|
76
|
+
* @param {boolean} value - Boolean value indicates that the option is changed.
|
77
|
+
* @group Emits
|
53
78
|
*/
|
54
79
|
this.onCheckedChange = output();
|
55
80
|
this.defaultCheckedUsed = computed(() => this.defaultChecked());
|
@@ -119,6 +144,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
119
144
|
}]
|
120
145
|
}], ctorParameters: () => [] });
|
121
146
|
|
147
|
+
/**
|
148
|
+
* @group Components
|
149
|
+
*/
|
122
150
|
class RdxSwitchInputDirective {
|
123
151
|
constructor() {
|
124
152
|
this.switchRoot = injectSwitch();
|
@@ -157,6 +185,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
157
185
|
}]
|
158
186
|
}] });
|
159
187
|
|
188
|
+
/**
|
189
|
+
* @group Components
|
190
|
+
*/
|
160
191
|
class RdxSwitchThumbDirective {
|
161
192
|
constructor() {
|
162
193
|
this.switchRoot = injectSwitch();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-root.directive.ts","../../../packages/primitives/switch/src/switch-input.directive.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n forwardRef,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport const SWITCH_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxSwitchRootDirective),\n multi: true\n};\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: InputSignalWithTransform<boolean, BooleanInput>;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: OutputEmitterRef<boolean>;\n}\n\nlet idIterator = 0;\n\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective },\n SWITCH_VALUE_ACCESSOR\n ],\n host: {\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required()',\n '[attr.data-state]': 'checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {\n readonly id = input<string | null>(`rdx-switch-${idIterator++}`);\n\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n readonly inputId = input<string | null>(null);\n\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n readonly ariaLabelledBy = input<string | null>(null, {\n alias: 'aria-labelledby'\n });\n\n readonly ariaLabel = input<string | null>(null, {\n alias: 'aria-label'\n });\n\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n */\n readonly checked = model<boolean>(false);\n\n readonly defaultChecked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The state of the switch.\n * If `defaultChecked` is provided, it takes precedence over the `checked` state.\n * @ignore\n */\n readonly checkedState = computed(() => this.checked());\n\n /**\n * When true, prevents the user from interacting with the switch.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n /**\n * Event handler called when the state of the switch changes.\n */\n readonly onCheckedChange = output<boolean>();\n\n private readonly defaultCheckedUsed = computed(() => this.defaultChecked());\n\n constructor() {\n effect(\n () => {\n if (this.defaultCheckedUsed()) {\n this.checked.set(this.defaultChecked());\n }\n },\n { allowSignalWrites: true }\n );\n }\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n * @ignore\n */\n toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n\n this.onChange(this.checked());\n this.onCheckedChange.emit(this.checked());\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.checked.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n standalone: true,\n host: {\n type: 'checkbox',\n role: 'switch',\n tabindex: '-1',\n '[attr.id]': 'switchRoot.inputId()',\n '[attr.defaultChecked]': 'switchRoot.checkedState()',\n '[attr.aria-checked]': 'switchRoot.checkedState()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-label]': 'switchRoot.ariaLabel()',\n '[attr.aria-labelledby]': 'switchRoot.ariaLabelledBy()',\n '[attr.aria-required]': 'switchRoot.required()',\n '[attr.data-state]': 'switchRoot.checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',\n '[attr.value]': 'switchRoot.checkedState() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;',\n\n '(blur)': 'onBlur()'\n }\n})\nexport class RdxSwitchInputDirective {\n protected readonly switchRoot = injectSwitch();\n\n /** @ignore */\n protected onBlur() {\n this.switchRoot.onTouched?.();\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n standalone: true,\n host: {\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.data-state]': 'switchRoot.checkedState() ? \"checked\" : \"unchecked\"'\n }\n})\nexport class RdxSwitchThumbDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInputDirective } from './src/switch-input.directive';\nimport { RdxSwitchRootDirective } from './src/switch-root.directive';\nimport { RdxSwitchThumbDirective } from './src/switch-thumb.directive';\n\nexport * from './src/switch-input.directive';\nexport * from './src/switch-root.directive';\nexport * from './src/switch-thumb.directive';\n\nexport type { SwitchProps } from './src/switch-root.directive';\n\nconst switchImports = [\n RdxSwitchRootDirective,\n RdxSwitchInputDirective,\n RdxSwitchThumbDirective\n];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,cAAc,GAAG,IAAI,cAAc,CAAyB,gBAAgB;SAEzE,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC;AACjC;AAEa,MAAA,qBAAqB,GAAQ;AACtC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAsB,CAAC;AACrD,IAAA,KAAK,EAAE;;AAUX,IAAI,UAAU,GAAG,CAAC;MAsBL,sBAAsB,CAAA;AAqD/B,IAAA,WAAA,GAAA;QApDS,IAAE,CAAA,EAAA,GAAG,KAAK,CAAgB,CAAA,WAAA,EAAc,UAAU,EAAE,CAAA,CAAE,CAAC;QAE7C,IAAS,CAAA,SAAA,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC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AAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YATxB,sBAAsB;YACtB,uBAAuB;AACvB,YAAA,uBAAuB,aAFvB,sBAAsB;YACtB,uBAAuB;YACvB,uBAAuB,CAAA,EAAA,CAAA,CAAA;gHAOd,eAAe,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACpBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-root.directive.ts","../../../packages/primitives/switch/src/switch-input.directive.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n forwardRef,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport const SWITCH_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxSwitchRootDirective),\n multi: true\n};\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: InputSignalWithTransform<boolean, BooleanInput>;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: OutputEmitterRef<boolean>;\n}\n\nlet idIterator = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective },\n SWITCH_VALUE_ACCESSOR\n ],\n host: {\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required()',\n '[attr.data-state]': 'checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {\n readonly id = input<string | null>(`rdx-switch-${idIterator++}`);\n\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n readonly inputId = input<string | null>(null);\n\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n *\n * @default false\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /**\n * @default null\n * @group Props\n */\n readonly ariaLabelledBy = input<string | undefined>(undefined, {\n alias: 'aria-labelledby'\n });\n\n /**\n * @default null\n * @group Props\n */\n readonly ariaLabel = input<string | undefined>(undefined, {\n alias: 'aria-label'\n });\n\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n * @defaultValue false\n * @group Props\n */\n readonly checked = model<boolean>(false);\n\n /**\n * @default false\n * @group Props\n */\n readonly defaultChecked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The state of the switch.\n * If `defaultChecked` is provided, it takes precedence over the `checked` state.\n * @ignore\n */\n readonly checkedState = computed(() => this.checked());\n\n /**\n * When true, prevents the user from interacting with the switch.\n * @default false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n /**\n * Event handler called when the state of the switch changes.\n *\n * @param {boolean} value - Boolean value indicates that the option is changed.\n * @group Emits\n */\n readonly onCheckedChange = output<boolean>();\n\n private readonly defaultCheckedUsed = computed(() => this.defaultChecked());\n\n constructor() {\n effect(\n () => {\n if (this.defaultCheckedUsed()) {\n this.checked.set(this.defaultChecked());\n }\n },\n { allowSignalWrites: true }\n );\n }\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n * @ignore\n */\n toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n\n this.onChange(this.checked());\n this.onCheckedChange.emit(this.checked());\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.checked.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n standalone: true,\n host: {\n type: 'checkbox',\n role: 'switch',\n tabindex: '-1',\n '[attr.id]': 'switchRoot.inputId()',\n '[attr.defaultChecked]': 'switchRoot.checkedState()',\n '[attr.aria-checked]': 'switchRoot.checkedState()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-label]': 'switchRoot.ariaLabel()',\n '[attr.aria-labelledby]': 'switchRoot.ariaLabelledBy()',\n '[attr.aria-required]': 'switchRoot.required()',\n '[attr.data-state]': 'switchRoot.checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',\n '[attr.value]': 'switchRoot.checkedState() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;',\n\n '(blur)': 'onBlur()'\n }\n})\nexport class RdxSwitchInputDirective {\n protected readonly switchRoot = injectSwitch();\n\n /** @ignore */\n protected onBlur() {\n this.switchRoot.onTouched?.();\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n standalone: true,\n host: {\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.data-state]': 'switchRoot.checkedState() ? \"checked\" : \"unchecked\"'\n }\n})\nexport class RdxSwitchThumbDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInputDirective } from './src/switch-input.directive';\nimport { RdxSwitchRootDirective } from './src/switch-root.directive';\nimport { RdxSwitchThumbDirective } from './src/switch-thumb.directive';\n\nexport * from './src/switch-input.directive';\nexport * from './src/switch-root.directive';\nexport * from './src/switch-thumb.directive';\n\nexport type { SwitchProps } from './src/switch-root.directive';\n\nconst switchImports = [\n RdxSwitchRootDirective,\n RdxSwitchInputDirective,\n RdxSwitchThumbDirective\n];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,cAAc,GAAG,IAAI,cAAc,CAAyB,gBAAgB;SAEzE,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC;AACjC;AAEa,MAAA,qBAAqB,GAAQ;AACtC,IAAA,OAAO,EAAE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AA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,sBAAsB,EAAE,4CAA4C;AACpE,wBAAA,mBAAmB,EAAE;AACxB;AACJ,iBAAA;;;ACHD,MAAM,aAAa,GAAG;IAClB,sBAAsB;IACtB,uBAAuB;IACvB;CACH;MAMY,eAAe,CAAA;+GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YATxB,sBAAsB;YACtB,uBAAuB;AACvB,YAAA,uBAAuB,aAFvB,sBAAsB;YACtB,uBAAuB;YACvB,uBAAuB,CAAA,EAAA,CAAA,CAAA;gHAOd,eAAe,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACpBD;;AAEG;;;;"}
|
@@ -1,24 +1,22 @@
|
|
1
1
|
import { InputSignal } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
+
/**
|
4
|
+
* @group Components
|
5
|
+
*/
|
3
6
|
export declare class RdxLabelDirective {
|
4
7
|
/**
|
5
8
|
* @type string
|
6
9
|
* @default 'rdx-label-{idIterator}'
|
7
10
|
*/
|
8
11
|
readonly id: InputSignal<string>;
|
9
|
-
/**
|
10
|
-
* @ignore
|
11
|
-
*/
|
12
12
|
protected readonly elementId: import("@angular/core").Signal<string | null>;
|
13
13
|
/**
|
14
14
|
* The id of the element the label is associated with.
|
15
|
+
* @group Props
|
15
16
|
* @type string
|
16
|
-
* @
|
17
|
+
* @defaultValue false
|
17
18
|
*/
|
18
19
|
readonly htmlFor: InputSignal<string>;
|
19
|
-
/**
|
20
|
-
* @ignore
|
21
|
-
*/
|
22
20
|
private readonly elementRef;
|
23
21
|
/**
|
24
22
|
* @ignore
|
package/package.json
CHANGED
@@ -7,7 +7,6 @@ import * as i0 from "@angular/core";
|
|
7
7
|
*/
|
8
8
|
export declare class RdxProgressIndicatorDirective {
|
9
9
|
/**
|
10
|
-
*
|
11
10
|
* This allows the directive to access the progress bar state and values.
|
12
11
|
*/
|
13
12
|
protected readonly progress: import("./progress-root.directive").RdxProgressRootDirective;
|
@@ -16,6 +16,8 @@ export interface ProgressProps {
|
|
16
16
|
*
|
17
17
|
* This directive provides a way to create a progress bar with customizable value and max attributes.
|
18
18
|
* It handles aria attributes for accessibility and provides different states like 'indeterminate', 'complete', and 'loading'.
|
19
|
+
*
|
20
|
+
* @group Components
|
19
21
|
*/
|
20
22
|
export declare class RdxProgressRootDirective implements ProgressProps, OnChanges {
|
21
23
|
/**
|
@@ -25,16 +27,19 @@ export declare class RdxProgressRootDirective implements ProgressProps, OnChange
|
|
25
27
|
id: string;
|
26
28
|
/**
|
27
29
|
* The current value of the progress bar.
|
28
|
-
* @
|
30
|
+
* @group Props
|
31
|
+
* @defaultValue 0
|
29
32
|
*/
|
30
33
|
value: number;
|
31
34
|
/**
|
32
35
|
* The maximum value of the progress bar.
|
33
|
-
* @
|
36
|
+
* @defaultValue 100
|
37
|
+
* @group Props
|
34
38
|
*/
|
35
39
|
max: number;
|
36
40
|
/**
|
37
41
|
* Function to generate the value label.
|
42
|
+
* @group Props
|
38
43
|
*/
|
39
44
|
valueLabel: (value: number, max: number) => string;
|
40
45
|
/**
|
@@ -17,16 +17,23 @@ export interface SeparatorProps {
|
|
17
17
|
* Directive that adds accessible and configurable separator element to the DOM.
|
18
18
|
* This can be either horizontal or vertical and optionally decorative (which removes
|
19
19
|
* it from the accessibility tree).
|
20
|
+
*
|
21
|
+
* @group Components
|
20
22
|
*/
|
21
23
|
export declare class RdxSeparatorRootDirective {
|
22
24
|
/**
|
23
25
|
* Orientation of the separator, can be either 'horizontal' or 'vertical'.
|
24
|
-
*
|
26
|
+
*
|
27
|
+
* @defaultValue 'horizontal'
|
28
|
+
* @group Props
|
25
29
|
*/
|
26
30
|
readonly orientation: import("@angular/core").InputSignal<"horizontal" | "vertical">;
|
27
31
|
/**
|
28
32
|
* If true, the separator will be considered decorative and removed from
|
29
33
|
* the accessibility tree. Defaults to false.
|
34
|
+
*
|
35
|
+
* @defaultValue false
|
36
|
+
* @group Props
|
30
37
|
*/
|
31
38
|
readonly decorative: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
32
39
|
/**
|
@@ -11,20 +11,40 @@ export interface SwitchProps {
|
|
11
11
|
required?: InputSignalWithTransform<boolean, BooleanInput>;
|
12
12
|
onCheckedChange?: OutputEmitterRef<boolean>;
|
13
13
|
}
|
14
|
+
/**
|
15
|
+
* @group Components
|
16
|
+
*/
|
14
17
|
export declare class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {
|
15
18
|
readonly id: import("@angular/core").InputSignal<string | null>;
|
16
19
|
protected readonly elementId: import("@angular/core").Signal<string | null>;
|
17
20
|
readonly inputId: import("@angular/core").InputSignal<string | null>;
|
18
21
|
/**
|
19
22
|
* When true, indicates that the user must check the switch before the owning form can be submitted.
|
23
|
+
*
|
24
|
+
* @default false
|
25
|
+
* @group Props
|
20
26
|
*/
|
21
27
|
readonly required: InputSignalWithTransform<boolean, BooleanInput>;
|
22
|
-
|
23
|
-
|
28
|
+
/**
|
29
|
+
* @default null
|
30
|
+
* @group Props
|
31
|
+
*/
|
32
|
+
readonly ariaLabelledBy: import("@angular/core").InputSignal<string | undefined>;
|
33
|
+
/**
|
34
|
+
* @default null
|
35
|
+
* @group Props
|
36
|
+
*/
|
37
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
24
38
|
/**
|
25
39
|
* The controlled state of the switch. Must be used in conjunction with onCheckedChange.
|
40
|
+
* @defaultValue false
|
41
|
+
* @group Props
|
26
42
|
*/
|
27
43
|
readonly checked: ModelSignal<boolean>;
|
44
|
+
/**
|
45
|
+
* @default false
|
46
|
+
* @group Props
|
47
|
+
*/
|
28
48
|
readonly defaultChecked: InputSignalWithTransform<boolean, BooleanInput>;
|
29
49
|
/**
|
30
50
|
* The state of the switch.
|
@@ -34,12 +54,17 @@ export declare class RdxSwitchRootDirective implements SwitchProps, ControlValue
|
|
34
54
|
readonly checkedState: import("@angular/core").Signal<boolean>;
|
35
55
|
/**
|
36
56
|
* When true, prevents the user from interacting with the switch.
|
57
|
+
* @default false
|
58
|
+
* @group Props
|
37
59
|
*/
|
38
60
|
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
39
61
|
/** @ignore */
|
40
62
|
readonly disabledState: import("@angular/core").Signal<boolean>;
|
41
63
|
/**
|
42
64
|
* Event handler called when the state of the switch changes.
|
65
|
+
*
|
66
|
+
* @param {boolean} value - Boolean value indicates that the option is changed.
|
67
|
+
* @group Emits
|
43
68
|
*/
|
44
69
|
readonly onCheckedChange: OutputEmitterRef<boolean>;
|
45
70
|
private readonly defaultCheckedUsed;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
|
+
/**
|
3
|
+
* @group Components
|
4
|
+
*/
|
2
5
|
export declare class RdxSwitchThumbDirective {
|
3
6
|
protected readonly switchRoot: import("./switch-root.directive").RdxSwitchRootDirective;
|
4
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchThumbDirective, never>;
|