@radix-ng/primitives 0.14.0 → 0.15.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/alert-dialog/index.d.ts +11 -0
- package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +3 -3
- package/alert-dialog/src/alert-dialog-content.directive.d.ts +3 -3
- package/alert-dialog/src/alert-dialog-root.directive.d.ts +3 -3
- package/alert-dialog/src/alert-dialog-title.directive.d.ts +3 -3
- package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +3 -3
- package/alert-dialog/src/alert-dialog.service.d.ts +3 -3
- package/aspect-ratio/README.md +1 -0
- package/aspect-ratio/index.d.ts +1 -0
- package/aspect-ratio/src/aspect-ratio.directive.d.ts +28 -0
- package/compodoc/documentation.json +878 -292
- package/core/index.d.ts +6 -0
- package/core/src/accessor/provide-value-accessor.d.ts +12 -0
- package/core/src/auto-focus.directive.d.ts +14 -0
- package/core/src/document.d.ts +1 -0
- package/core/src/inject-ng-control.d.ts +8 -0
- package/core/src/is-client.d.ts +1 -0
- package/core/src/window.d.ts +3 -0
- package/esm2022/alert-dialog/index.mjs +35 -1
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +7 -7
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +7 -7
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +7 -7
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +5 -5
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +7 -7
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +5 -5
- package/esm2022/aspect-ratio/index.mjs +2 -0
- package/esm2022/aspect-ratio/radix-ng-primitives-aspect-ratio.mjs +5 -0
- package/esm2022/aspect-ratio/src/aspect-ratio.directive.mjs +53 -0
- package/esm2022/core/index.mjs +7 -0
- package/esm2022/core/radix-ng-primitives-core.mjs +5 -0
- package/esm2022/core/src/accessor/provide-value-accessor.mjs +19 -0
- package/esm2022/core/src/auto-focus.directive.mjs +80 -0
- package/esm2022/core/src/document.mjs +6 -0
- package/esm2022/core/src/inject-ng-control.mjs +17 -0
- package/esm2022/core/src/is-client.mjs +6 -0
- package/esm2022/core/src/window.mjs +15 -0
- package/esm2022/separator/src/separator.directive.mjs +33 -15
- package/esm2022/visually-hidden/index.mjs +4 -0
- package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +5 -0
- package/esm2022/visually-hidden/src/visually-hidden-input-bubble.directive.mjs +74 -0
- package/esm2022/visually-hidden/src/visually-hidden-input.directive.mjs +74 -0
- package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +42 -0
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +59 -31
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +60 -0
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-core.mjs +144 -0
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-separator.mjs +32 -14
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +189 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -0
- package/package.json +19 -1
- package/separator/src/separator.directive.d.ts +29 -5
- package/visually-hidden/README.md +3 -0
- package/visually-hidden/index.d.ts +3 -0
- package/visually-hidden/src/visually-hidden-input-bubble.directive.d.ts +21 -0
- package/visually-hidden/src/visually-hidden-input.directive.d.ts +19 -0
- package/visually-hidden/src/visually-hidden.directive.d.ts +15 -0
@@ -0,0 +1,60 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { inject, ElementRef, Renderer2, input, numberAttribute, computed, Directive } from '@angular/core';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Directive to maintain an aspect ratio for an element.
|
6
|
+
* The element will have its `padding-bottom` dynamically calculated
|
7
|
+
* based on the provided aspect ratio to maintain the desired ratio.
|
8
|
+
* The content inside the element will be positioned absolutely.
|
9
|
+
*/
|
10
|
+
class RdxAspectRatioDirective {
|
11
|
+
constructor() {
|
12
|
+
this.element = inject(ElementRef);
|
13
|
+
this.renderer = inject(Renderer2);
|
14
|
+
/**
|
15
|
+
* The desired aspect ratio (e.g., 16/9).
|
16
|
+
* By default, it is set to 1 (which results in a square, 1:1).
|
17
|
+
*/
|
18
|
+
this.ratio = input(1, { transform: numberAttribute });
|
19
|
+
/**
|
20
|
+
* Dynamically computed `padding-bottom` style for the element.
|
21
|
+
* This value is calculated based on the inverse of the aspect ratio.
|
22
|
+
*
|
23
|
+
* If the ratio is zero, it defaults to `0%` to avoid division by zero.
|
24
|
+
*/
|
25
|
+
this.paddingBottom = computed(() => {
|
26
|
+
const ratioValue = this.ratio();
|
27
|
+
return `${ratioValue !== 0 ? (1 / ratioValue) * 100 : 0}%`;
|
28
|
+
});
|
29
|
+
}
|
30
|
+
ngAfterViewInit() {
|
31
|
+
const content = this.element.nativeElement.firstElementChild;
|
32
|
+
if (content) {
|
33
|
+
// Set the content to cover the entire element with absolute positioning
|
34
|
+
this.renderer.setStyle(content, 'position', 'absolute');
|
35
|
+
this.renderer.setStyle(content, 'inset', '0');
|
36
|
+
}
|
37
|
+
}
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAspectRatioDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxAspectRatioDirective, isStandalone: true, selector: "[rdxAspectRatio]", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.position": "'relative'", "style.width": "'100%'", "style.padding-bottom": "paddingBottom()" } }, exportAs: ["rdxAspectRatio"], ngImport: i0 }); }
|
40
|
+
}
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAspectRatioDirective, decorators: [{
|
42
|
+
type: Directive,
|
43
|
+
args: [{
|
44
|
+
selector: '[rdxAspectRatio]',
|
45
|
+
exportAs: 'rdxAspectRatio',
|
46
|
+
standalone: true,
|
47
|
+
host: {
|
48
|
+
'[style.position]': `'relative'`,
|
49
|
+
'[style.width]': `'100%'`,
|
50
|
+
'[style.padding-bottom]': 'paddingBottom()'
|
51
|
+
}
|
52
|
+
}]
|
53
|
+
}] });
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Generated bundle index. Do not edit.
|
57
|
+
*/
|
58
|
+
|
59
|
+
export { RdxAspectRatioDirective };
|
60
|
+
//# sourceMappingURL=radix-ng-primitives-aspect-ratio.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-aspect-ratio.mjs","sources":["../../../packages/primitives/aspect-ratio/src/aspect-ratio.directive.ts","../../../packages/primitives/aspect-ratio/radix-ng-primitives-aspect-ratio.ts"],"sourcesContent":["import { NumberInput } from '@angular/cdk/coercion';\nimport {\n AfterViewInit,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n numberAttribute,\n Renderer2\n} from '@angular/core';\n\n/**\n * Directive to maintain an aspect ratio for an element.\n * The element will have its `padding-bottom` dynamically calculated\n * based on the provided aspect ratio to maintain the desired ratio.\n * The content inside the element will be positioned absolutely.\n */\n@Directive({\n selector: '[rdxAspectRatio]',\n exportAs: 'rdxAspectRatio',\n standalone: true,\n host: {\n '[style.position]': `'relative'`,\n '[style.width]': `'100%'`,\n '[style.padding-bottom]': 'paddingBottom()'\n }\n})\nexport class RdxAspectRatioDirective implements AfterViewInit {\n private element = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n /**\n * The desired aspect ratio (e.g., 16/9).\n * By default, it is set to 1 (which results in a square, 1:1).\n */\n readonly ratio = input<number, NumberInput>(1, { transform: numberAttribute });\n\n /**\n * Dynamically computed `padding-bottom` style for the element.\n * This value is calculated based on the inverse of the aspect ratio.\n *\n * If the ratio is zero, it defaults to `0%` to avoid division by zero.\n */\n protected readonly paddingBottom = computed(() => {\n const ratioValue = this.ratio();\n return `${ratioValue !== 0 ? (1 / ratioValue) * 100 : 0}%`;\n });\n\n ngAfterViewInit() {\n const content = this.element.nativeElement.firstElementChild;\n if (content) {\n // Set the content to cover the entire element with absolute positioning\n this.renderer.setStyle(content, 'position', 'absolute');\n this.renderer.setStyle(content, 'inset', '0');\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAYA;;;;;AAKG;MAWU,uBAAuB,CAAA;AAVpC,IAAA,WAAA,GAAA;AAWY,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAC7B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAErC;;;AAGG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,CAAsB,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;AAE/E;;;;;AAKG;AACgB,QAAA,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC7C,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;AAChC,YAAA,OAAO,GAAG,UAAU,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC;AAC/D,SAAC,CAAC,CAAC;AAUN,KAAA;IARG,eAAe,GAAA;QACX,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC;QAC7D,IAAI,OAAO,EAAE;;YAET,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;YACxD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;SACjD;KACJ;8GA5BQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,aAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,kBAAkB,EAAE,CAAY,UAAA,CAAA;AAChC,wBAAA,eAAe,EAAE,CAAQ,MAAA,CAAA;AACzB,wBAAA,wBAAwB,EAAE,iBAAiB;AAC9C,qBAAA;AACJ,iBAAA,CAAA;;;AC3BD;;AAEG;;;;"}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import { NG_VALUE_ACCESSOR, NgControl, FormControlDirective, FormControlName, NgModel } from '@angular/forms';
|
2
|
+
import * as i0 from '@angular/core';
|
3
|
+
import { inject, ElementRef, NgZone, booleanAttribute, Directive, Input, InjectionToken } from '@angular/core';
|
4
|
+
import { DOCUMENT } from '@angular/common';
|
5
|
+
import { Platform } from '@angular/cdk/platform';
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Include in the providers section of a component which utilizes ControlValueAccessor to redundant code.
|
9
|
+
*
|
10
|
+
* ```ts
|
11
|
+
* @Directive({
|
12
|
+
* providers: [provideValueAccessor(ExampleDirective)]
|
13
|
+
*}
|
14
|
+
* export class ExampleDirective{}
|
15
|
+
* ```
|
16
|
+
*/
|
17
|
+
function provideValueAccessor(type) {
|
18
|
+
return {
|
19
|
+
provide: NG_VALUE_ACCESSOR,
|
20
|
+
useExisting: type,
|
21
|
+
multi: true
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
/*
|
26
|
+
* <div [rdxAutoFocus]="true"></div>
|
27
|
+
*/
|
28
|
+
class RdxAutoFocusDirective {
|
29
|
+
constructor() {
|
30
|
+
this.#elementRef = inject(ElementRef);
|
31
|
+
this.#ngZone = inject(NgZone);
|
32
|
+
this._autoSelect = false;
|
33
|
+
}
|
34
|
+
#elementRef;
|
35
|
+
#ngZone;
|
36
|
+
/**
|
37
|
+
* @default false
|
38
|
+
*/
|
39
|
+
set autoFocus(value) {
|
40
|
+
if (value) {
|
41
|
+
// Note: Running this outside Angular's zone because `element.focus()` does not trigger change detection.
|
42
|
+
this.#ngZone.runOutsideAngular(() =>
|
43
|
+
// Note: `element.focus()` causes re-layout which might lead to frame drops on slower devices.
|
44
|
+
// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#setting-focus
|
45
|
+
// `setTimeout` is a macrotask executed within the current rendering frame.
|
46
|
+
// Animation tasks are executed in the next rendering frame.
|
47
|
+
reqAnimationFrame(() => {
|
48
|
+
this.#elementRef.nativeElement.focus();
|
49
|
+
if (this._autoSelect && this.#elementRef.nativeElement.select) {
|
50
|
+
this.#elementRef.nativeElement.select();
|
51
|
+
}
|
52
|
+
}));
|
53
|
+
}
|
54
|
+
}
|
55
|
+
// Setter for autoSelect attribute to enable text selection when autoFocus is true.
|
56
|
+
set autoSelect(value) {
|
57
|
+
this._autoSelect = value;
|
58
|
+
}
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAutoFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
60
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxAutoFocusDirective, isStandalone: true, selector: "[rdxAutoFocus]", inputs: { autoFocus: ["rdxAutoFocus", "autoFocus", booleanAttribute], autoSelect: ["autoSelect", "autoSelect", booleanAttribute] }, ngImport: i0 }); }
|
61
|
+
}
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAutoFocusDirective, decorators: [{
|
63
|
+
type: Directive,
|
64
|
+
args: [{
|
65
|
+
selector: '[rdxAutoFocus]',
|
66
|
+
standalone: true
|
67
|
+
}]
|
68
|
+
}], propDecorators: { autoFocus: [{
|
69
|
+
type: Input,
|
70
|
+
args: [{ alias: 'rdxAutoFocus', transform: booleanAttribute }]
|
71
|
+
}], autoSelect: [{
|
72
|
+
type: Input,
|
73
|
+
args: [{ transform: booleanAttribute }]
|
74
|
+
}] } });
|
75
|
+
const availablePrefixes = ['moz', 'ms', 'webkit'];
|
76
|
+
function requestAnimationFramePolyfill() {
|
77
|
+
let lastTime = 0;
|
78
|
+
return function (callback) {
|
79
|
+
const currTime = new Date().getTime();
|
80
|
+
const timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
81
|
+
const id = setTimeout(() => {
|
82
|
+
callback(currTime + timeToCall);
|
83
|
+
}, timeToCall);
|
84
|
+
lastTime = currTime + timeToCall;
|
85
|
+
return id;
|
86
|
+
};
|
87
|
+
}
|
88
|
+
// Function to get the appropriate requestAnimationFrame method with fallback to polyfill.
|
89
|
+
function getRequestAnimationFrame() {
|
90
|
+
if (typeof window === 'undefined') {
|
91
|
+
return () => 0;
|
92
|
+
}
|
93
|
+
if (window.requestAnimationFrame) {
|
94
|
+
// https://github.com/vuejs/vue/issues/4465
|
95
|
+
return window.requestAnimationFrame.bind(window);
|
96
|
+
}
|
97
|
+
const prefix = availablePrefixes.filter((key) => `${key}RequestAnimationFrame` in window)[0];
|
98
|
+
return prefix ? window[`${prefix}RequestAnimationFrame`] : requestAnimationFramePolyfill();
|
99
|
+
}
|
100
|
+
// Get the requestAnimationFrame function or its polyfill.
|
101
|
+
const reqAnimationFrame = getRequestAnimationFrame();
|
102
|
+
|
103
|
+
function injectDocument() {
|
104
|
+
return inject(DOCUMENT);
|
105
|
+
}
|
106
|
+
|
107
|
+
function injectNgControl(params) {
|
108
|
+
const ngControl = inject(NgControl, { self: true, optional: true });
|
109
|
+
if (!params?.optional && !ngControl)
|
110
|
+
throw new Error('NgControl not found');
|
111
|
+
if (ngControl instanceof FormControlDirective ||
|
112
|
+
ngControl instanceof FormControlName ||
|
113
|
+
ngControl instanceof NgModel) {
|
114
|
+
return ngControl;
|
115
|
+
}
|
116
|
+
if (params?.optional) {
|
117
|
+
return undefined;
|
118
|
+
}
|
119
|
+
throw new Error('NgControl is not an instance of FormControlDirective, FormControlName or NgModel');
|
120
|
+
}
|
121
|
+
|
122
|
+
function injectIsClient() {
|
123
|
+
return inject(Platform).isBrowser;
|
124
|
+
}
|
125
|
+
|
126
|
+
const WINDOW = new InjectionToken('An abstraction over global window object', {
|
127
|
+
factory: () => {
|
128
|
+
const { defaultView } = injectDocument();
|
129
|
+
if (!defaultView) {
|
130
|
+
throw new Error('Window is not available');
|
131
|
+
}
|
132
|
+
return defaultView;
|
133
|
+
}
|
134
|
+
});
|
135
|
+
function injectWindow() {
|
136
|
+
return inject(WINDOW);
|
137
|
+
}
|
138
|
+
|
139
|
+
/**
|
140
|
+
* Generated bundle index. Do not edit.
|
141
|
+
*/
|
142
|
+
|
143
|
+
export { RdxAutoFocusDirective, WINDOW, injectDocument, injectIsClient, injectNgControl, injectWindow, provideValueAccessor };
|
144
|
+
//# sourceMappingURL=radix-ng-primitives-core.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-core.mjs","sources":["../../../packages/primitives/core/src/accessor/provide-value-accessor.ts","../../../packages/primitives/core/src/auto-focus.directive.ts","../../../packages/primitives/core/src/document.ts","../../../packages/primitives/core/src/inject-ng-control.ts","../../../packages/primitives/core/src/is-client.ts","../../../packages/primitives/core/src/window.ts","../../../packages/primitives/core/radix-ng-primitives-core.ts"],"sourcesContent":["import { Provider, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * Include in the providers section of a component which utilizes ControlValueAccessor to redundant code.\n *\n * ```ts\n * @Directive({\n * providers: [provideValueAccessor(ExampleDirective)]\n *}\n * export class ExampleDirective{}\n * ```\n */\nexport function provideValueAccessor(type: Type<never>): Provider {\n return {\n provide: NG_VALUE_ACCESSOR,\n useExisting: type,\n multi: true\n };\n}\n","import { booleanAttribute, Directive, ElementRef, inject, Input, NgZone } from '@angular/core';\n\n/*\n * <div [rdxAutoFocus]=\"true\"></div>\n */\n\n@Directive({\n selector: '[rdxAutoFocus]',\n standalone: true\n})\nexport class RdxAutoFocusDirective {\n #elementRef = inject(ElementRef);\n #ngZone = inject(NgZone);\n\n private _autoSelect = false;\n\n /**\n * @default false\n */\n @Input({ alias: 'rdxAutoFocus', transform: booleanAttribute })\n set autoFocus(value: boolean) {\n if (value) {\n // Note: Running this outside Angular's zone because `element.focus()` does not trigger change detection.\n this.#ngZone.runOutsideAngular(() =>\n // Note: `element.focus()` causes re-layout which might lead to frame drops on slower devices.\n // https://gist.github.com/paulirish/5d52fb081b3570c81e3a#setting-focus\n // `setTimeout` is a macrotask executed within the current rendering frame.\n // Animation tasks are executed in the next rendering frame.\n reqAnimationFrame(() => {\n this.#elementRef.nativeElement.focus();\n if (this._autoSelect && this.#elementRef.nativeElement.select) {\n this.#elementRef.nativeElement.select();\n }\n })\n );\n }\n }\n\n // Setter for autoSelect attribute to enable text selection when autoFocus is true.\n @Input({ transform: booleanAttribute })\n set autoSelect(value: boolean) {\n this._autoSelect = value;\n }\n}\n\nconst availablePrefixes = ['moz', 'ms', 'webkit'];\n\nfunction requestAnimationFramePolyfill(): typeof requestAnimationFrame {\n let lastTime = 0;\n\n return function (callback: FrameRequestCallback): number {\n const currTime = new Date().getTime();\n const timeToCall = Math.max(0, 16 - (currTime - lastTime));\n\n const id = setTimeout(() => {\n callback(currTime + timeToCall);\n }, timeToCall) as any;\n\n lastTime = currTime + timeToCall;\n\n return id;\n };\n}\n\n// Function to get the appropriate requestAnimationFrame method with fallback to polyfill.\nfunction getRequestAnimationFrame(): typeof requestAnimationFrame {\n if (typeof window === 'undefined') {\n return () => 0;\n }\n if (window.requestAnimationFrame) {\n // https://github.com/vuejs/vue/issues/4465\n return window.requestAnimationFrame.bind(window);\n }\n\n const prefix = availablePrefixes.filter((key) => `${key}RequestAnimationFrame` in window)[0];\n\n return prefix ? (window as any)[`${prefix}RequestAnimationFrame`] : requestAnimationFramePolyfill();\n}\n\n// Get the requestAnimationFrame function or its polyfill.\nconst reqAnimationFrame = getRequestAnimationFrame();\n","import { DOCUMENT } from '@angular/common';\nimport { inject } from '@angular/core';\n\nexport function injectDocument(): Document {\n return inject(DOCUMENT);\n}\n","import { inject } from '@angular/core';\nimport { FormControlDirective, FormControlName, NgControl, NgModel } from '@angular/forms';\n\nexport function injectNgControl(params: {\n optional: true;\n}): FormControlDirective | FormControlName | NgModel | undefined;\nexport function injectNgControl(params: { optional: false }): FormControlDirective | FormControlName | NgModel;\nexport function injectNgControl(): FormControlDirective | FormControlName | NgModel;\n\nexport function injectNgControl(params?: { optional: true } | { optional: false }) {\n const ngControl = inject(NgControl, { self: true, optional: true });\n\n if (!params?.optional && !ngControl) throw new Error('NgControl not found');\n\n if (\n ngControl instanceof FormControlDirective ||\n ngControl instanceof FormControlName ||\n ngControl instanceof NgModel\n ) {\n return ngControl;\n }\n\n if (params?.optional) {\n return undefined;\n }\n\n throw new Error('NgControl is not an instance of FormControlDirective, FormControlName or NgModel');\n}\n","import { Platform } from '@angular/cdk/platform';\nimport { inject } from '@angular/core';\n\nexport function injectIsClient() {\n return inject(Platform).isBrowser;\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport { injectDocument } from './document';\n\nexport const WINDOW = new InjectionToken<Window & typeof globalThis>('An abstraction over global window object', {\n factory: () => {\n const { defaultView } = injectDocument();\n if (!defaultView) {\n throw new Error('Window is not available');\n }\n return defaultView;\n }\n});\n\nexport function injectWindow(): Window & typeof globalThis {\n return inject(WINDOW);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGA;;;;;;;;;AASG;AACG,SAAU,oBAAoB,CAAC,IAAiB,EAAA;IAClD,OAAO;AACH,QAAA,OAAO,EAAE,iBAAiB;AAC1B,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,KAAK,EAAE,IAAI;KACd,CAAC;AACN;;ACjBA;;AAEG;MAMU,qBAAqB,CAAA;AAJlC,IAAA,WAAA,GAAA;AAKI,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACjC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAEjB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AA6B/B,KAAA;AAhCG,IAAA,WAAW,CAAsB;AACjC,IAAA,OAAO,CAAkB;AAIzB;;AAEG;IACH,IACI,SAAS,CAAC,KAAc,EAAA;QACxB,IAAI,KAAK,EAAE;;AAEP,YAAA,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;;;;;YAK3B,iBAAiB,CAAC,MAAK;AACnB,gBAAA,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACvC,gBAAA,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,CA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,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAE5E,IACI,SAAS,YAAY,oBAAoB;AACzC,QAAA,SAAS,YAAY,eAAe;QACpC,SAAS,YAAY,OAAO,EAC9B;AACE,QAAA,OAAO,SAAS,CAAC;KACpB;AAED,IAAA,IAAI,MAAM,EAAE,QAAQ,EAAE;AAClB,QAAA,OAAO,SAAS,CAAC;KACpB;AAED,IAAA,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;AACxG;;SCxBgB,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC;AACtC;;MCFa,MAAM,GAAG,IAAI,cAAc,CAA6B,0CAA0C,EAAE;IAC7G,OAAO,EAAE,MAAK;AACV,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC9C;AACD,QAAA,OAAO,WAAW,CAAC;KACtB;AACJ,CAAA,EAAE;SAEa,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1B;;ACfA;;AAEG;;;;"}
|
@@ -1,16 +1,40 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { booleanAttribute,
|
2
|
+
import { input, booleanAttribute, computed, Directive } from '@angular/core';
|
3
3
|
|
4
4
|
const DEFAULT_ORIENTATION = 'horizontal';
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
6
6
|
const ORIENTATIONS = ['horizontal', 'vertical'];
|
7
|
+
/**
|
8
|
+
* Directive that adds accessible and configurable separator element to the DOM.
|
9
|
+
* This can be either horizontal or vertical and optionally decorative (which removes
|
10
|
+
* it from the accessibility tree).
|
11
|
+
*/
|
7
12
|
class RdxSeparatorRootDirective {
|
8
13
|
constructor() {
|
9
|
-
|
10
|
-
|
14
|
+
/**
|
15
|
+
* Orientation of the separator, can be either 'horizontal' or 'vertical'.
|
16
|
+
* Defaults to 'horizontal'.
|
17
|
+
*/
|
18
|
+
this.orientation = input(DEFAULT_ORIENTATION);
|
19
|
+
/**
|
20
|
+
* If true, the separator will be considered decorative and removed from
|
21
|
+
* the accessibility tree. Defaults to false.
|
22
|
+
*/
|
23
|
+
this.decorative = input(false, { transform: booleanAttribute });
|
24
|
+
/**
|
25
|
+
* Computes the `role` attribute for the separator. If `decorative` is true,
|
26
|
+
* the role is set to "none", otherwise it is "separator".
|
27
|
+
*/
|
28
|
+
this.computedRole = computed(() => (this.decorative() ? 'none' : 'separator'));
|
29
|
+
/**
|
30
|
+
* Computes the `aria-orientation` attribute. It is set to "vertical" only if
|
31
|
+
* the separator is not decorative and the orientation is set to "vertical".
|
32
|
+
* For horizontal orientation, the attribute is omitted.
|
33
|
+
*/
|
34
|
+
this.computedAriaOrientation = computed(() => !this.decorative() && this.orientation() === 'vertical' ? 'vertical' : null);
|
11
35
|
}
|
12
36
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSeparatorRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
13
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
37
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxSeparatorRootDirective, isStandalone: true, selector: "div[rdxSeparatorRoot]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "computedRole()", "attr.aria-orientation": "computedAriaOrientation()", "attr.data-orientation": "orientation()" } }, ngImport: i0 }); }
|
14
38
|
}
|
15
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSeparatorRootDirective, decorators: [{
|
16
40
|
type: Directive,
|
@@ -18,18 +42,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImpor
|
|
18
42
|
selector: 'div[rdxSeparatorRoot]',
|
19
43
|
standalone: true,
|
20
44
|
host: {
|
21
|
-
'[attr.role]': '
|
22
|
-
|
23
|
-
'[attr.
|
24
|
-
'[attr.data-orientation]': 'orientation'
|
45
|
+
'[attr.role]': 'computedRole()',
|
46
|
+
'[attr.aria-orientation]': 'computedAriaOrientation()',
|
47
|
+
'[attr.data-orientation]': 'orientation()'
|
25
48
|
}
|
26
49
|
}]
|
27
|
-
}]
|
28
|
-
type: Input
|
29
|
-
}], decorative: [{
|
30
|
-
type: Input,
|
31
|
-
args: [{ transform: booleanAttribute }]
|
32
|
-
}] } });
|
50
|
+
}] });
|
33
51
|
|
34
52
|
/**
|
35
53
|
* Generated bundle index. Do not edit.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-separator.mjs","sources":["../../../packages/primitives/separator/src/separator.directive.ts","../../../packages/primitives/separator/radix-ng-primitives-separator.ts"],"sourcesContent":["import { booleanAttribute, Directive,
|
1
|
+
{"version":3,"file":"radix-ng-primitives-separator.mjs","sources":["../../../packages/primitives/separator/src/separator.directive.ts","../../../packages/primitives/separator/radix-ng-primitives-separator.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input } from '@angular/core';\n\nconst DEFAULT_ORIENTATION = 'horizontal';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport type Orientation = (typeof ORIENTATIONS)[number];\n\nexport interface SeparatorProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether the component is purely decorative. When true, accessibility-related attributes\n * are updated so that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\n/**\n * Directive that adds accessible and configurable separator element to the DOM.\n * This can be either horizontal or vertical and optionally decorative (which removes\n * it from the accessibility tree).\n */\n@Directive({\n selector: 'div[rdxSeparatorRoot]',\n standalone: true,\n host: {\n '[attr.role]': 'computedRole()',\n '[attr.aria-orientation]': 'computedAriaOrientation()',\n\n '[attr.data-orientation]': 'orientation()'\n }\n})\nexport class RdxSeparatorRootDirective {\n /**\n * Orientation of the separator, can be either 'horizontal' or 'vertical'.\n * Defaults to 'horizontal'.\n */\n readonly orientation = input<Orientation>(DEFAULT_ORIENTATION);\n\n /**\n * If true, the separator will be considered decorative and removed from\n * the accessibility tree. Defaults to false.\n */\n readonly decorative = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Computes the `role` attribute for the separator. If `decorative` is true,\n * the role is set to \"none\", otherwise it is \"separator\".\n */\n protected readonly computedRole = computed(() => (this.decorative() ? 'none' : 'separator'));\n\n /**\n * Computes the `aria-orientation` attribute. It is set to \"vertical\" only if\n * the separator is not decorative and the orientation is set to \"vertical\".\n * For horizontal orientation, the attribute is omitted.\n */\n protected readonly computedAriaOrientation = computed(() =>\n !this.decorative() && this.orientation() === 'vertical' ? 'vertical' : null\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAEzC;AACA,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,UAAU,CAAU,CAAC;AAgBzD;;;;AAIG;MAWU,yBAAyB,CAAA;AAVtC,IAAA,WAAA,GAAA;AAWI;;;AAGG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAc,mBAAmB,CAAC,CAAC;AAE/D;;;AAGG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,CAAwB,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAE3F;;;AAGG;QACgB,IAAY,CAAA,YAAA,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AAC7C,qBAAA;AACJ,iBAAA,CAAA;;;ACpCD;;AAEG;;;;"}
|
@@ -0,0 +1,189 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { input, Directive, inject, ElementRef, effect, computed } from '@angular/core';
|
3
|
+
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
* <span rdxVisuallyHidden [feature]="'fully-hidden'">
|
7
|
+
* <ng-content></ng-content>
|
8
|
+
* </span>
|
9
|
+
*
|
10
|
+
* <button (click)="directiveInstance.feature.set('focusable')">Make Focusable</button>
|
11
|
+
* <button (click)="directiveInstance.feature.set('fully-hidden')">Hide</button>
|
12
|
+
*/
|
13
|
+
class RdxVisuallyHiddenDirective {
|
14
|
+
constructor() {
|
15
|
+
this.feature = input('focusable');
|
16
|
+
}
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
18
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxVisuallyHiddenDirective, isStandalone: true, selector: "[rdxVisuallyHidden]", inputs: { feature: { classPropertyName: "feature", publicName: "feature", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-hidden": "feature() === \"focusable\" ? \"true\" : null", "hidden": "feature() === \"fully-hidden\" ? true : null", "attr.tabindex": "feature() === \"fully-hidden\" ? \"-1\" : null", "style.position": "\"absolute\"", "style.border": "\"0\"", "style.width": "\"1px\"", "style.display": "feature() === \"focusable\" ? \"inline-block\" : \"none\"", "style.height": "\"1px\"", "style.padding": "\"0\"", "style.margin": "\"-1px\"", "style.overflow": "\"hidden\"", "style.clip": "\"rect(0, 0, 0, 0)\"", "style.white-space": "\"nowrap\"", "style.word-wrap": "\"normal\"" } }, ngImport: i0 }); }
|
19
|
+
}
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenDirective, decorators: [{
|
21
|
+
type: Directive,
|
22
|
+
args: [{
|
23
|
+
selector: '[rdxVisuallyHidden]',
|
24
|
+
standalone: true,
|
25
|
+
host: {
|
26
|
+
'[attr.aria-hidden]': 'feature() === "focusable" ? "true" : null',
|
27
|
+
'[hidden]': 'feature() === "fully-hidden" ? true : null',
|
28
|
+
'[attr.tabindex]': 'feature() === "fully-hidden" ? "-1" : null',
|
29
|
+
'[style.position]': '"absolute"',
|
30
|
+
'[style.border]': '"0"',
|
31
|
+
'[style.width]': '"1px"',
|
32
|
+
'[style.display]': 'feature() === "focusable" ? "inline-block" : "none"',
|
33
|
+
'[style.height]': '"1px"',
|
34
|
+
'[style.padding]': '"0"',
|
35
|
+
'[style.margin]': '"-1px"',
|
36
|
+
'[style.overflow]': '"hidden"',
|
37
|
+
'[style.clip]': '"rect(0, 0, 0, 0)"',
|
38
|
+
'[style.white-space]': '"nowrap"',
|
39
|
+
'[style.word-wrap]': '"normal"'
|
40
|
+
}
|
41
|
+
}]
|
42
|
+
}] });
|
43
|
+
|
44
|
+
/**
|
45
|
+
*
|
46
|
+
*/
|
47
|
+
class RdxVisuallyHiddenInputBubbleDirective {
|
48
|
+
constructor() {
|
49
|
+
this.elementRef = inject(ElementRef);
|
50
|
+
this.name = input('');
|
51
|
+
this.value = input(null);
|
52
|
+
this.checked = input(undefined);
|
53
|
+
this.required = input(undefined);
|
54
|
+
this.disabled = input(undefined);
|
55
|
+
this.feature = input('fully-hidden');
|
56
|
+
effect(() => {
|
57
|
+
this.updateInputValue();
|
58
|
+
});
|
59
|
+
}
|
60
|
+
onChange() {
|
61
|
+
this.updateInputValue();
|
62
|
+
}
|
63
|
+
updateInputValue() {
|
64
|
+
let valueChanged = false;
|
65
|
+
let checkedChanged = false;
|
66
|
+
// Check if the value has changed before applying the update
|
67
|
+
const currentValue = this.inputElement.value;
|
68
|
+
const newValue = String(this.value());
|
69
|
+
if (currentValue !== newValue) {
|
70
|
+
this.inputElement.value = newValue;
|
71
|
+
valueChanged = true;
|
72
|
+
}
|
73
|
+
if (this.inputElement.type === 'checkbox' || this.inputElement.type === 'radio') {
|
74
|
+
const currentChecked = this.inputElement.checked;
|
75
|
+
const newChecked = !!this.checked();
|
76
|
+
if (currentChecked !== newChecked) {
|
77
|
+
this.inputElement.checked = newChecked;
|
78
|
+
checkedChanged = true;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
if (valueChanged || checkedChanged) {
|
82
|
+
this.dispatchInputEvents();
|
83
|
+
}
|
84
|
+
}
|
85
|
+
get inputElement() {
|
86
|
+
return this.elementRef.nativeElement;
|
87
|
+
}
|
88
|
+
dispatchInputEvents() {
|
89
|
+
const inputEvent = new Event('input', { bubbles: true });
|
90
|
+
const changeEvent = new Event('change', { bubbles: true });
|
91
|
+
this.inputElement.dispatchEvent(inputEvent);
|
92
|
+
this.inputElement.dispatchEvent(changeEvent);
|
93
|
+
}
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputBubbleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
95
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxVisuallyHiddenInputBubbleDirective, isStandalone: true, selector: "[rdxVisuallyHiddenInputBubble]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, feature: { classPropertyName: "feature", publicName: "feature", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "change": "onChange()" }, properties: { "attr.name": "name()", "attr.required": "required()", "attr.disabled": "disabled()", "attr.checked": "checked()", "value": "value()" } }, hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ["feature", "feature"] }], ngImport: i0 }); }
|
96
|
+
}
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputBubbleDirective, decorators: [{
|
98
|
+
type: Directive,
|
99
|
+
args: [{
|
100
|
+
selector: '[rdxVisuallyHiddenInputBubble]',
|
101
|
+
standalone: true,
|
102
|
+
hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature: feature'] }],
|
103
|
+
host: {
|
104
|
+
'[attr.name]': 'name()',
|
105
|
+
'[attr.required]': 'required()',
|
106
|
+
'[attr.disabled]': 'disabled()',
|
107
|
+
'[attr.checked]': 'checked()',
|
108
|
+
'[value]': 'value()',
|
109
|
+
'(change)': 'onChange()'
|
110
|
+
}
|
111
|
+
}]
|
112
|
+
}], ctorParameters: () => [] });
|
113
|
+
|
114
|
+
// Implementation from https://github.com/unovue/radix-vue
|
115
|
+
class RdxVisuallyHiddenInputDirective {
|
116
|
+
constructor() {
|
117
|
+
this.elementRef = inject(ElementRef);
|
118
|
+
this.name = input('');
|
119
|
+
this.value = input(null);
|
120
|
+
this.checked = input(undefined);
|
121
|
+
this.required = input(undefined);
|
122
|
+
this.disabled = input(undefined);
|
123
|
+
this.feature = input('fully-hidden');
|
124
|
+
this.parsedValue = computed(() => {
|
125
|
+
const value = this.value();
|
126
|
+
const name = this.name();
|
127
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
128
|
+
return [{ name, value }];
|
129
|
+
}
|
130
|
+
if (Array.isArray(value)) {
|
131
|
+
return value.flatMap((obj, index) => {
|
132
|
+
if (typeof obj === 'object') {
|
133
|
+
return Object.entries(obj).map(([key, val]) => ({
|
134
|
+
name: `[${name}][${index}][${key}]`,
|
135
|
+
value: val
|
136
|
+
}));
|
137
|
+
}
|
138
|
+
else {
|
139
|
+
return { name: `[${name}][${index}]`, value: obj };
|
140
|
+
}
|
141
|
+
});
|
142
|
+
}
|
143
|
+
if (value !== null && typeof value === 'object') {
|
144
|
+
return Object.entries(value).map(([key, val]) => ({
|
145
|
+
name: `[${name}][${key}]`,
|
146
|
+
value: val
|
147
|
+
}));
|
148
|
+
}
|
149
|
+
return [];
|
150
|
+
});
|
151
|
+
}
|
152
|
+
ngOnInit() {
|
153
|
+
const parsedValues = this.parsedValue();
|
154
|
+
parsedValues.forEach((parsed) => {
|
155
|
+
const inputElement = this.elementRef.nativeElement;
|
156
|
+
inputElement.setAttribute('name', parsed.name);
|
157
|
+
inputElement.setAttribute('value', parsed.value);
|
158
|
+
});
|
159
|
+
}
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
161
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxVisuallyHiddenInputDirective, isStandalone: true, selector: "[rdxVisuallyHiddenInput]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, feature: { classPropertyName: "feature", publicName: "feature", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: RdxVisuallyHiddenInputBubbleDirective, inputs: ["feature", "feature", "name", "name", "value", "value", "checked", "checked", "disabled", "disabled", "required", "required"] }], ngImport: i0 }); }
|
162
|
+
}
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputDirective, decorators: [{
|
164
|
+
type: Directive,
|
165
|
+
args: [{
|
166
|
+
selector: '[rdxVisuallyHiddenInput]',
|
167
|
+
standalone: true,
|
168
|
+
hostDirectives: [
|
169
|
+
{
|
170
|
+
directive: RdxVisuallyHiddenInputBubbleDirective,
|
171
|
+
inputs: [
|
172
|
+
'feature: feature',
|
173
|
+
'name: name ',
|
174
|
+
'value: value',
|
175
|
+
'checked: checked',
|
176
|
+
'disabled: disabled',
|
177
|
+
'required: required'
|
178
|
+
]
|
179
|
+
}
|
180
|
+
]
|
181
|
+
}]
|
182
|
+
}] });
|
183
|
+
|
184
|
+
/**
|
185
|
+
* Generated bundle index. Do not edit.
|
186
|
+
*/
|
187
|
+
|
188
|
+
export { RdxVisuallyHiddenDirective, RdxVisuallyHiddenInputBubbleDirective, RdxVisuallyHiddenInputDirective };
|
189
|
+
//# sourceMappingURL=radix-ng-primitives-visually-hidden.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-visually-hidden.mjs","sources":["../../../packages/primitives/visually-hidden/src/visually-hidden.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input-bubble.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input.directive.ts","../../../packages/primitives/visually-hidden/radix-ng-primitives-visually-hidden.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n *\n * <span rdxVisuallyHidden [feature]=\"'fully-hidden'\">\n * <ng-content></ng-content>\n * </span>\n *\n * <button (click)=\"directiveInstance.feature.set('focusable')\">Make Focusable</button>\n * <button (click)=\"directiveInstance.feature.set('fully-hidden')\">Hide</button>\n */\n@Directive({\n selector: '[rdxVisuallyHidden]',\n standalone: true,\n host: {\n '[attr.aria-hidden]': 'feature() === \"focusable\" ? \"true\" : null',\n '[hidden]': 'feature() === \"fully-hidden\" ? true : null',\n '[attr.tabindex]': 'feature() === \"fully-hidden\" ? \"-1\" : null',\n '[style.position]': '\"absolute\"',\n '[style.border]': '\"0\"',\n '[style.width]': '\"1px\"',\n '[style.display]': 'feature() === \"focusable\" ? \"inline-block\" : \"none\"',\n '[style.height]': '\"1px\"',\n '[style.padding]': '\"0\"',\n '[style.margin]': '\"-1px\"',\n '[style.overflow]': '\"hidden\"',\n '[style.clip]': '\"rect(0, 0, 0, 0)\"',\n '[style.white-space]': '\"nowrap\"',\n '[style.word-wrap]': '\"normal\"'\n }\n})\nexport class RdxVisuallyHiddenDirective {\n readonly feature = input<'focusable' | 'fully-hidden'>('focusable');\n}\n","import { Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from './visually-hidden.directive';\n\n/**\n *\n */\n@Directive({\n selector: '[rdxVisuallyHiddenInputBubble]',\n standalone: true,\n hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature: feature'] }],\n host: {\n '[attr.name]': 'name()',\n '[attr.required]': 'required()',\n '[attr.disabled]': 'disabled()',\n '[attr.checked]': 'checked()',\n '[value]': 'value()',\n '(change)': 'onChange()'\n }\n})\nexport class RdxVisuallyHiddenInputBubbleDirective<T> {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | null>(null);\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<string>('fully-hidden');\n\n constructor() {\n effect(() => {\n this.updateInputValue();\n });\n }\n\n protected onChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n let valueChanged = false;\n let checkedChanged = false;\n\n // Check if the value has changed before applying the update\n const currentValue = this.inputElement.value;\n const newValue = String(this.value());\n\n if (currentValue !== newValue) {\n this.inputElement.value = newValue;\n valueChanged = true;\n }\n\n if (this.inputElement.type === 'checkbox' || this.inputElement.type === 'radio') {\n const currentChecked = this.inputElement.checked;\n const newChecked = !!this.checked();\n\n if (currentChecked !== newChecked) {\n this.inputElement.checked = newChecked;\n checkedChanged = true;\n }\n }\n\n if (valueChanged || checkedChanged) {\n this.dispatchInputEvents();\n }\n }\n\n private get inputElement() {\n return this.elementRef.nativeElement;\n }\n\n private dispatchInputEvents() {\n const inputEvent = new Event('input', { bubbles: true });\n const changeEvent = new Event('change', { bubbles: true });\n\n this.inputElement.dispatchEvent(inputEvent);\n this.inputElement.dispatchEvent(changeEvent);\n }\n}\n","// Implementation from https://github.com/unovue/radix-vue\n\nimport { Directive, ElementRef, OnInit, computed, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from './visually-hidden-input-bubble.directive';\n\n@Directive({\n selector: '[rdxVisuallyHiddenInput]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: [\n 'feature: feature',\n 'name: name ',\n 'value: value',\n 'checked: checked',\n 'disabled: disabled',\n 'required: required'\n ]\n }\n ]\n})\nexport class RdxVisuallyHiddenInputDirective<T> implements OnInit {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | null>(null);\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<'focusable' | 'fully-hidden'>('fully-hidden');\n\n readonly parsedValue = computed<{ name: string; value: any }[]>(() => {\n const value = this.value();\n const name = this.name();\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return [{ name, value }];\n }\n\n if (Array.isArray(value)) {\n return value.flatMap((obj, index) => {\n if (typeof obj === 'object') {\n return Object.entries(obj).map(([key, val]) => ({\n name: `[${name}][${index}][${key}]`,\n value: val\n }));\n } else {\n return { name: `[${name}][${index}]`, value: obj };\n }\n });\n }\n\n if (value !== null && typeof value === 'object') {\n return Object.entries(value).map(([key, val]) => ({\n name: `[${name}][${key}]`,\n value: val\n }));\n }\n\n return [];\n });\n\n ngOnInit() {\n const parsedValues = this.parsedValue();\n\n parsedValues.forEach((parsed) => {\n const inputElement = this.elementRef.nativeElement;\n inputElement.setAttribute('name', parsed.name);\n inputElement.setAttribute('value', parsed.value);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.RdxVisuallyHiddenDirective","i1.RdxVisuallyHiddenInputBubbleDirective"],"mappings":";;;AAEA;;;;;;;;AAQG;MAqBU,0BAA0B,CAAA;AApBvC,IAAA,WAAA,GAAA;AAqBa,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA+B,WAAW,CAAC,CAAC;AACvE,KAAA;8GAFY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,+CAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,eAAA,EAAA,gDAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,cAAA,EAAA,OAAA,EAAA,aAAA,EAAA,SAAA,EAAA,eAAA,EAAA,2DAAA,EAAA,cAAA,EAAA,SAAA,EAAA,eAAA,EAAA,OAAA,EAAA,cAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,sBAAA,EAAA,mBAAA,EAAA,YAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA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AkB;gCAClB,oBAAoB;gCACpB,oBAAoB;AACvB,6BAAA;AACJ,yBAAA;AACJ,qBAAA;AACJ,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@radix-ng/primitives",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.15.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -49,6 +49,12 @@
|
|
49
49
|
"esm": "./esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs",
|
50
50
|
"default": "./fesm2022/radix-ng-primitives-alert-dialog.mjs"
|
51
51
|
},
|
52
|
+
"./aspect-ratio": {
|
53
|
+
"types": "./aspect-ratio/index.d.ts",
|
54
|
+
"esm2022": "./esm2022/aspect-ratio/radix-ng-primitives-aspect-ratio.mjs",
|
55
|
+
"esm": "./esm2022/aspect-ratio/radix-ng-primitives-aspect-ratio.mjs",
|
56
|
+
"default": "./fesm2022/radix-ng-primitives-aspect-ratio.mjs"
|
57
|
+
},
|
52
58
|
"./avatar": {
|
53
59
|
"types": "./avatar/index.d.ts",
|
54
60
|
"esm2022": "./esm2022/avatar/radix-ng-primitives-avatar.mjs",
|
@@ -73,6 +79,12 @@
|
|
73
79
|
"esm": "./esm2022/context-menu/radix-ng-primitives-context-menu.mjs",
|
74
80
|
"default": "./fesm2022/radix-ng-primitives-context-menu.mjs"
|
75
81
|
},
|
82
|
+
"./core": {
|
83
|
+
"types": "./core/index.d.ts",
|
84
|
+
"esm2022": "./esm2022/core/radix-ng-primitives-core.mjs",
|
85
|
+
"esm": "./esm2022/core/radix-ng-primitives-core.mjs",
|
86
|
+
"default": "./fesm2022/radix-ng-primitives-core.mjs"
|
87
|
+
},
|
76
88
|
"./dialog": {
|
77
89
|
"types": "./dialog/index.d.ts",
|
78
90
|
"esm2022": "./esm2022/dialog/radix-ng-primitives-dialog.mjs",
|
@@ -144,6 +156,12 @@
|
|
144
156
|
"esm2022": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
|
145
157
|
"esm": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
|
146
158
|
"default": "./fesm2022/radix-ng-primitives-toggle-group.mjs"
|
159
|
+
},
|
160
|
+
"./visually-hidden": {
|
161
|
+
"types": "./visually-hidden/index.d.ts",
|
162
|
+
"esm2022": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
|
163
|
+
"esm": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
|
164
|
+
"default": "./fesm2022/radix-ng-primitives-visually-hidden.mjs"
|
147
165
|
}
|
148
166
|
}
|
149
167
|
}
|