@radix-ng/primitives 0.50.0 → 1.0.0-beta.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/collection/README.md +1 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +134 -66
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +224 -132
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +26 -10
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +6 -6
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +68 -75
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +123 -0
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +104 -103
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +414 -80
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +193 -92
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +72 -0
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-config.mjs +5 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +143 -427
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +757 -757
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +55 -53
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +93 -86
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +658 -330
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +98 -76
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-editable.mjs +20 -20
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +363 -0
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
- package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +29 -14
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +172 -0
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +11 -11
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +1484 -353
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1060 -1553
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -366
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +51 -51
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +980 -995
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +137 -82
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +40 -16
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +231 -92
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +211 -70
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +127 -77
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +791 -511
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +16 -45
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +976 -720
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +69 -71
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +128 -124
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +388 -115
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +111 -117
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +122 -248
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +99 -62
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +307 -94
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1079
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +46 -87
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives.mjs.map +1 -1
- package/meter/README.md +3 -0
- package/navigation-menu/README.md +2 -1
- package/package.json +85 -63
- package/portal/README.md +2 -0
- package/preview-card/README.md +3 -0
- package/schematics/collection.json +1 -0
- package/schematics/ng-add/index.d.ts +3 -2
- package/schematics/ng-add/index.js +62 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/package-config.d.ts +4 -2
- package/schematics/ng-add/package-config.js +10 -2
- package/schematics/ng-add/package-config.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +3 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +14 -0
- package/select/README.md +2 -0
- package/{accordion/index.d.ts → types/radix-ng-primitives-accordion.d.ts} +102 -67
- package/types/radix-ng-primitives-alert-dialog.d.ts +114 -0
- package/{arrow/index.d.ts → types/radix-ng-primitives-arrow.d.ts} +1 -1
- package/{aspect-ratio/index.d.ts → types/radix-ng-primitives-aspect-ratio.d.ts} +1 -1
- package/{avatar/index.d.ts → types/radix-ng-primitives-avatar.d.ts} +7 -11
- package/types/radix-ng-primitives-button.d.ts +73 -0
- package/{calendar/index.d.ts → types/radix-ng-primitives-calendar.d.ts} +2 -3
- package/types/radix-ng-primitives-checkbox.d.ts +337 -0
- package/types/radix-ng-primitives-collapsible.d.ts +159 -0
- package/types/radix-ng-primitives-collection.d.ts +44 -0
- package/{config/index.d.ts → types/radix-ng-primitives-config.d.ts} +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +73 -0
- package/{core/index.d.ts → types/radix-ng-primitives-core.d.ts} +311 -236
- package/{cropper/index.d.ts → types/radix-ng-primitives-cropper.d.ts} +6 -5
- package/{date-field/index.d.ts → types/radix-ng-primitives-date-field.d.ts} +42 -27
- package/types/radix-ng-primitives-dialog.d.ts +323 -0
- package/{dismissable-layer/index.d.ts → types/radix-ng-primitives-dismissable-layer.d.ts} +15 -7
- package/types/radix-ng-primitives-drawer.d.ts +448 -0
- package/{editable/index.d.ts → types/radix-ng-primitives-editable.d.ts} +1 -1
- package/types/radix-ng-primitives-field.d.ts +373 -0
- package/types/radix-ng-primitives-fieldset.d.ts +48 -0
- package/{focus-scope/index.d.ts → types/radix-ng-primitives-focus-scope.d.ts} +13 -5
- package/types/radix-ng-primitives-input.d.ts +87 -0
- package/{label/index.d.ts → types/radix-ng-primitives-label.d.ts} +0 -1
- package/types/radix-ng-primitives-menu.d.ts +612 -0
- package/types/radix-ng-primitives-menubar.d.ts +66 -0
- package/types/radix-ng-primitives-meter.d.ts +193 -0
- package/types/radix-ng-primitives-navigation-menu.d.ts +488 -0
- package/types/radix-ng-primitives-number-field.d.ts +464 -0
- package/{pagination/index.d.ts → types/radix-ng-primitives-pagination.d.ts} +2 -2
- package/types/radix-ng-primitives-popover.d.ts +416 -0
- package/{popper/index.d.ts → types/radix-ng-primitives-popper.d.ts} +50 -9
- package/types/radix-ng-primitives-portal.d.ts +30 -0
- package/types/radix-ng-primitives-presence.d.ts +55 -0
- package/types/radix-ng-primitives-preview-card.d.ts +359 -0
- package/types/radix-ng-primitives-progress.d.ts +206 -0
- package/{radio/index.d.ts → types/radix-ng-primitives-radio.d.ts} +56 -26
- package/{roving-focus/index.d.ts → types/radix-ng-primitives-roving-focus.d.ts} +38 -27
- package/types/radix-ng-primitives-select.d.ts +512 -0
- package/types/radix-ng-primitives-separator.d.ts +38 -0
- package/types/radix-ng-primitives-slider.d.ts +377 -0
- package/{stepper/index.d.ts → types/radix-ng-primitives-stepper.d.ts} +21 -22
- package/types/radix-ng-primitives-switch.d.ts +121 -0
- package/types/radix-ng-primitives-tabs.d.ts +247 -0
- package/{time-field/index.d.ts → types/radix-ng-primitives-time-field.d.ts} +46 -31
- package/types/radix-ng-primitives-toggle-group.d.ts +116 -0
- package/types/radix-ng-primitives-toggle.d.ts +65 -0
- package/types/radix-ng-primitives-toolbar.d.ts +180 -0
- package/types/radix-ng-primitives-tooltip.d.ts +395 -0
- package/{visually-hidden/index.d.ts → types/radix-ng-primitives-visually-hidden.d.ts} +19 -19
- package/alert-dialog/index.d.ts +0 -57
- package/checkbox/index.d.ts +0 -164
- package/collapsible/index.d.ts +0 -85
- package/context-menu/index.d.ts +0 -129
- package/dialog/index.d.ts +0 -205
- package/dropdown-menu/README.md +0 -1
- package/dropdown-menu/index.d.ts +0 -171
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -583
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1246
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -740
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
- package/hover-card/README.md +0 -3
- package/hover-card/index.d.ts +0 -472
- package/menu/index.d.ts +0 -139
- package/menubar/index.d.ts +0 -56
- package/navigation-menu/index.d.ts +0 -405
- package/number-field/index.d.ts +0 -203
- package/popover/index.d.ts +0 -403
- package/portal/index.d.ts +0 -22
- package/presence/index.d.ts +0 -103
- package/progress/index.d.ts +0 -79
- package/select/index.d.ts +0 -214
- package/separator/index.d.ts +0 -63
- package/slider/index.d.ts +0 -263
- package/switch/index.d.ts +0 -105
- package/tabs/index.d.ts +0 -112
- package/toggle/index.d.ts +0 -75
- package/toggle-group/index.d.ts +0 -194
- package/toolbar/index.d.ts +0 -55
- package/tooltip/index.d.ts +0 -433
- package/tooltip2/README.md +0 -3
- package/tooltip2/index.d.ts +0 -325
- /package/{focus-guards/index.d.ts → types/radix-ng-primitives-focus-guards.d.ts} +0 -0
- /package/{index.d.ts → types/radix-ng-primitives.d.ts} +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, signal, computed, Directive, inject, ElementRef, effect, afterNextRender } from '@angular/core';
|
|
3
|
+
import { createContext } from '@radix-ng/primitives/core';
|
|
4
|
+
|
|
5
|
+
let fieldId = 0;
|
|
6
|
+
const attr$4 = (value) => (value ? '' : undefined);
|
|
7
|
+
const addId = (ids, id) => (ids.includes(id) ? ids : [...ids, id]);
|
|
8
|
+
const removeId = (ids, id) => ids.filter((item) => item !== id);
|
|
9
|
+
const fieldRootContext = () => {
|
|
10
|
+
const root = injectFieldRoot();
|
|
11
|
+
return {
|
|
12
|
+
controlId: root.controlId,
|
|
13
|
+
descriptionIds: root.descriptionIds,
|
|
14
|
+
errorIds: root.errorIds,
|
|
15
|
+
invalidState: root.invalidState,
|
|
16
|
+
disabledState: root.disabledState,
|
|
17
|
+
requiredState: root.requiredState,
|
|
18
|
+
dirtyState: root.dirtyState,
|
|
19
|
+
touchedState: root.touchedState,
|
|
20
|
+
filledState: root.filledState,
|
|
21
|
+
focusedState: root.focusedState,
|
|
22
|
+
setControlId: (id) => root.controlId.set(id),
|
|
23
|
+
addDescriptionId: (id) => root.descriptionIds.update((ids) => addId(ids, id)),
|
|
24
|
+
removeDescriptionId: (id) => root.descriptionIds.update((ids) => removeId(ids, id)),
|
|
25
|
+
addErrorId: (id) => root.errorIds.update((ids) => addId(ids, id)),
|
|
26
|
+
removeErrorId: (id) => root.errorIds.update((ids) => removeId(ids, id)),
|
|
27
|
+
setFocused: (value) => root.focusedValue.set(value),
|
|
28
|
+
setFilled: (value) => root.filledValue.set(value),
|
|
29
|
+
setDirty: (value) => root.dirtyValue.set(value),
|
|
30
|
+
setTouched: (value) => root.touchedValue.set(value),
|
|
31
|
+
/**
|
|
32
|
+
* Register (or clear with `null`) an external owner of field state.
|
|
33
|
+
* While a provider is registered, any state it exposes takes precedence
|
|
34
|
+
* over the root inputs and the DOM-derived values. Returns the previous
|
|
35
|
+
* provider so adapters can restore it on teardown.
|
|
36
|
+
*/
|
|
37
|
+
setStateProvider: (provider) => root.setStateProvider(provider),
|
|
38
|
+
hasStateProvider: root.hasStateProvider
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const [injectFieldRootContext, provideFieldRootContext] = createContext('RdxFieldRoot');
|
|
42
|
+
/**
|
|
43
|
+
* Groups a form control with its label, description, error message, and field state.
|
|
44
|
+
*
|
|
45
|
+
* @group Components
|
|
46
|
+
*/
|
|
47
|
+
class RdxFieldRoot {
|
|
48
|
+
constructor() {
|
|
49
|
+
/**
|
|
50
|
+
* Whether the field is invalid.
|
|
51
|
+
*
|
|
52
|
+
* @group Props
|
|
53
|
+
* @defaultValue false
|
|
54
|
+
*/
|
|
55
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
56
|
+
/**
|
|
57
|
+
* Whether the field is disabled.
|
|
58
|
+
*
|
|
59
|
+
* @group Props
|
|
60
|
+
* @defaultValue false
|
|
61
|
+
*/
|
|
62
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
63
|
+
/**
|
|
64
|
+
* Whether the field is required.
|
|
65
|
+
*
|
|
66
|
+
* @group Props
|
|
67
|
+
* @defaultValue false
|
|
68
|
+
*/
|
|
69
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
70
|
+
/**
|
|
71
|
+
* Whether the field value has changed from its initial value.
|
|
72
|
+
*
|
|
73
|
+
* @group Props
|
|
74
|
+
* @defaultValue false
|
|
75
|
+
*/
|
|
76
|
+
this.dirty = input(false, { ...(ngDevMode ? { debugName: "dirty" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
77
|
+
/**
|
|
78
|
+
* Whether the field has been blurred after receiving focus.
|
|
79
|
+
*
|
|
80
|
+
* @group Props
|
|
81
|
+
* @defaultValue false
|
|
82
|
+
*/
|
|
83
|
+
this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
84
|
+
/**
|
|
85
|
+
* Overrides whether the control has a non-empty value.
|
|
86
|
+
*
|
|
87
|
+
* @group Props
|
|
88
|
+
*/
|
|
89
|
+
this.filled = input(...(ngDevMode ? [undefined, { debugName: "filled" }] : /* istanbul ignore next */ []));
|
|
90
|
+
/**
|
|
91
|
+
* Overrides whether the control is focused.
|
|
92
|
+
*
|
|
93
|
+
* @group Props
|
|
94
|
+
*/
|
|
95
|
+
this.focused = input(...(ngDevMode ? [undefined, { debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
96
|
+
this.controlId = signal(`rdx-field-control-${fieldId++}`, ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
97
|
+
this.descriptionIds = signal([], ...(ngDevMode ? [{ debugName: "descriptionIds" }] : /* istanbul ignore next */ []));
|
|
98
|
+
this.errorIds = signal([], ...(ngDevMode ? [{ debugName: "errorIds" }] : /* istanbul ignore next */ []));
|
|
99
|
+
this.focusedValue = signal(false, ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
|
|
100
|
+
this.filledValue = signal(false, ...(ngDevMode ? [{ debugName: "filledValue" }] : /* istanbul ignore next */ []));
|
|
101
|
+
this.dirtyValue = signal(false, ...(ngDevMode ? [{ debugName: "dirtyValue" }] : /* istanbul ignore next */ []));
|
|
102
|
+
this.touchedValue = signal(false, ...(ngDevMode ? [{ debugName: "touchedValue" }] : /* istanbul ignore next */ []));
|
|
103
|
+
/** External state owner registered through the context; `null` when Field self-computes. */
|
|
104
|
+
this.stateProvider = signal(null, ...(ngDevMode ? [{ debugName: "stateProvider" }] : /* istanbul ignore next */ []));
|
|
105
|
+
/** Whether an external adapter currently owns field state. */
|
|
106
|
+
this.hasStateProvider = computed(() => this.stateProvider() !== null, ...(ngDevMode ? [{ debugName: "hasStateProvider" }] : /* istanbul ignore next */ []));
|
|
107
|
+
this.invalidState = computed(() => this.resolve('invalid', () => this.invalid()), ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
108
|
+
this.disabledState = computed(() => this.resolve('disabled', () => this.disabled()), ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
109
|
+
this.requiredState = computed(() => this.resolve('required', () => this.required()), ...(ngDevMode ? [{ debugName: "requiredState" }] : /* istanbul ignore next */ []));
|
|
110
|
+
this.dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()), ...(ngDevMode ? [{ debugName: "dirtyState" }] : /* istanbul ignore next */ []));
|
|
111
|
+
this.touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()), ...(ngDevMode ? [{ debugName: "touchedState" }] : /* istanbul ignore next */ []));
|
|
112
|
+
this.filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()), ...(ngDevMode ? [{ debugName: "filledState" }] : /* istanbul ignore next */ []));
|
|
113
|
+
this.focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()), ...(ngDevMode ? [{ debugName: "focusedState" }] : /* istanbul ignore next */ []));
|
|
114
|
+
this.dataAttr = attr$4;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Register an external owner of field state, returning the previous one.
|
|
118
|
+
* @ignore
|
|
119
|
+
*/
|
|
120
|
+
setStateProvider(provider) {
|
|
121
|
+
const previous = this.stateProvider();
|
|
122
|
+
this.stateProvider.set(provider);
|
|
123
|
+
return previous;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Prefer the registered provider's value for `key` when it exposes one,
|
|
127
|
+
* otherwise fall back to the root inputs / DOM-derived signals.
|
|
128
|
+
*/
|
|
129
|
+
resolve(key, fallback) {
|
|
130
|
+
const accessor = this.stateProvider()?.[key];
|
|
131
|
+
return accessor ? accessor() : fallback();
|
|
132
|
+
}
|
|
133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
134
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFieldRoot, isStandalone: true, selector: "[rdxFieldRoot]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, filled: { classPropertyName: "filled", publicName: "filled", isSignal: true, isRequired: false, transformFunction: null }, focused: { classPropertyName: "focused", publicName: "focused", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-invalid": "dataAttr(invalidState())", "attr.data-valid": "dataAttr(!invalidState())", "attr.data-disabled": "dataAttr(disabledState())", "attr.data-required": "dataAttr(requiredState())", "attr.data-dirty": "dataAttr(dirtyState())", "attr.data-touched": "dataAttr(touchedState())", "attr.data-filled": "dataAttr(filledState())", "attr.data-focused": "dataAttr(focusedState())" } }, providers: [provideFieldRootContext(fieldRootContext)], exportAs: ["rdxFieldRoot"], ngImport: i0 }); }
|
|
135
|
+
}
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldRoot, decorators: [{
|
|
137
|
+
type: Directive,
|
|
138
|
+
args: [{
|
|
139
|
+
selector: '[rdxFieldRoot]',
|
|
140
|
+
exportAs: 'rdxFieldRoot',
|
|
141
|
+
providers: [provideFieldRootContext(fieldRootContext)],
|
|
142
|
+
host: {
|
|
143
|
+
'[attr.data-invalid]': 'dataAttr(invalidState())',
|
|
144
|
+
'[attr.data-valid]': 'dataAttr(!invalidState())',
|
|
145
|
+
'[attr.data-disabled]': 'dataAttr(disabledState())',
|
|
146
|
+
'[attr.data-required]': 'dataAttr(requiredState())',
|
|
147
|
+
'[attr.data-dirty]': 'dataAttr(dirtyState())',
|
|
148
|
+
'[attr.data-touched]': 'dataAttr(touchedState())',
|
|
149
|
+
'[attr.data-filled]': 'dataAttr(filledState())',
|
|
150
|
+
'[attr.data-focused]': 'dataAttr(focusedState())'
|
|
151
|
+
}
|
|
152
|
+
}]
|
|
153
|
+
}], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], filled: [{ type: i0.Input, args: [{ isSignal: true, alias: "filled", required: false }] }], focused: [{ type: i0.Input, args: [{ isSignal: true, alias: "focused", required: false }] }] } });
|
|
154
|
+
function injectFieldRoot() {
|
|
155
|
+
return inject(RdxFieldRoot);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let controlId = 0;
|
|
159
|
+
const attr$3 = (value) => (value ? '' : undefined);
|
|
160
|
+
/**
|
|
161
|
+
* Connects a form control to the field label, description, error, and state.
|
|
162
|
+
*
|
|
163
|
+
* @group Components
|
|
164
|
+
*/
|
|
165
|
+
class RdxFieldControl {
|
|
166
|
+
constructor() {
|
|
167
|
+
this.rootContext = injectFieldRootContext();
|
|
168
|
+
this.elementRef = inject(ElementRef);
|
|
169
|
+
this.initialValue = '';
|
|
170
|
+
/**
|
|
171
|
+
* Control id. Labels and descriptions use this value for accessible relationships.
|
|
172
|
+
*
|
|
173
|
+
* @group Props
|
|
174
|
+
*/
|
|
175
|
+
this.id = input(`rdx-field-control-${controlId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
176
|
+
this.describedBy = computed(() => {
|
|
177
|
+
const ids = [
|
|
178
|
+
...this.rootContext.descriptionIds(),
|
|
179
|
+
...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])
|
|
180
|
+
];
|
|
181
|
+
return ids.length ? ids.join(' ') : undefined;
|
|
182
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
183
|
+
this.dataAttr = attr$3;
|
|
184
|
+
effect(() => {
|
|
185
|
+
this.rootContext.setControlId(this.id());
|
|
186
|
+
});
|
|
187
|
+
afterNextRender(() => {
|
|
188
|
+
this.initialValue = this.currentValue();
|
|
189
|
+
this.syncFilled();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
onFocus() {
|
|
193
|
+
this.rootContext.setFocused(true);
|
|
194
|
+
}
|
|
195
|
+
onBlur() {
|
|
196
|
+
this.rootContext.setFocused(false);
|
|
197
|
+
this.rootContext.setTouched(true);
|
|
198
|
+
}
|
|
199
|
+
syncFilled() {
|
|
200
|
+
const value = this.currentValue();
|
|
201
|
+
this.rootContext.setFilled(Array.isArray(value) ? value.length > 0 : value != null && value !== '');
|
|
202
|
+
this.rootContext.setDirty(value !== this.initialValue);
|
|
203
|
+
}
|
|
204
|
+
isNativeFormControl() {
|
|
205
|
+
return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.elementRef.nativeElement.tagName);
|
|
206
|
+
}
|
|
207
|
+
currentValue() {
|
|
208
|
+
const element = this.elementRef.nativeElement;
|
|
209
|
+
return element.value ?? '';
|
|
210
|
+
}
|
|
211
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
212
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFieldControl, isStandalone: true, selector: "[rdxFieldControl]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "input": "syncFilled()", "change": "syncFilled()" }, properties: { "attr.id": "id()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "rootContext.invalidState() ? \"true\" : undefined", "attr.aria-required": "rootContext.requiredState() ? \"true\" : undefined", "attr.aria-disabled": "rootContext.disabledState() ? \"true\" : undefined", "attr.disabled": "isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined", "attr.required": "isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-valid": "dataAttr(!rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())", "attr.data-required": "dataAttr(rootContext.requiredState())", "attr.data-filled": "dataAttr(rootContext.filledState())", "attr.data-focused": "dataAttr(rootContext.focusedState())" } }, exportAs: ["rdxFieldControl"], ngImport: i0 }); }
|
|
213
|
+
}
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldControl, decorators: [{
|
|
215
|
+
type: Directive,
|
|
216
|
+
args: [{
|
|
217
|
+
selector: '[rdxFieldControl]',
|
|
218
|
+
exportAs: 'rdxFieldControl',
|
|
219
|
+
host: {
|
|
220
|
+
'[attr.id]': 'id()',
|
|
221
|
+
'[attr.aria-describedby]': 'describedBy()',
|
|
222
|
+
'[attr.aria-invalid]': 'rootContext.invalidState() ? "true" : undefined',
|
|
223
|
+
'[attr.aria-required]': 'rootContext.requiredState() ? "true" : undefined',
|
|
224
|
+
'[attr.aria-disabled]': 'rootContext.disabledState() ? "true" : undefined',
|
|
225
|
+
'[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? "" : undefined',
|
|
226
|
+
'[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? "" : undefined',
|
|
227
|
+
'[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',
|
|
228
|
+
'[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',
|
|
229
|
+
'[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',
|
|
230
|
+
'[attr.data-required]': 'dataAttr(rootContext.requiredState())',
|
|
231
|
+
'[attr.data-filled]': 'dataAttr(rootContext.filledState())',
|
|
232
|
+
'[attr.data-focused]': 'dataAttr(rootContext.focusedState())',
|
|
233
|
+
'(focus)': 'onFocus()',
|
|
234
|
+
'(blur)': 'onBlur()',
|
|
235
|
+
'(input)': 'syncFilled()',
|
|
236
|
+
'(change)': 'syncFilled()'
|
|
237
|
+
}
|
|
238
|
+
}]
|
|
239
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
240
|
+
|
|
241
|
+
let descriptionId = 0;
|
|
242
|
+
const attr$2 = (value) => (value ? '' : undefined);
|
|
243
|
+
/**
|
|
244
|
+
* Describes the field control.
|
|
245
|
+
*
|
|
246
|
+
* @group Components
|
|
247
|
+
*/
|
|
248
|
+
class RdxFieldDescription {
|
|
249
|
+
constructor() {
|
|
250
|
+
this.rootContext = injectFieldRootContext();
|
|
251
|
+
/**
|
|
252
|
+
* Description id.
|
|
253
|
+
*
|
|
254
|
+
* @group Props
|
|
255
|
+
*/
|
|
256
|
+
this.id = input(`rdx-field-description-${descriptionId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
257
|
+
this.dataAttr = attr$2;
|
|
258
|
+
effect((onCleanup) => {
|
|
259
|
+
const id = this.id();
|
|
260
|
+
this.rootContext.addDescriptionId(id);
|
|
261
|
+
onCleanup(() => this.rootContext.removeDescriptionId(id));
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
265
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFieldDescription, isStandalone: true, selector: "[rdxFieldDescription]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())" } }, exportAs: ["rdxFieldDescription"], ngImport: i0 }); }
|
|
266
|
+
}
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldDescription, decorators: [{
|
|
268
|
+
type: Directive,
|
|
269
|
+
args: [{
|
|
270
|
+
selector: '[rdxFieldDescription]',
|
|
271
|
+
exportAs: 'rdxFieldDescription',
|
|
272
|
+
host: {
|
|
273
|
+
'[attr.id]': 'id()',
|
|
274
|
+
'[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',
|
|
275
|
+
'[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'
|
|
276
|
+
}
|
|
277
|
+
}]
|
|
278
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
279
|
+
|
|
280
|
+
let errorId = 0;
|
|
281
|
+
const attr$1 = (value) => (value ? '' : undefined);
|
|
282
|
+
/**
|
|
283
|
+
* Describes an invalid field control.
|
|
284
|
+
*
|
|
285
|
+
* @group Components
|
|
286
|
+
*/
|
|
287
|
+
class RdxFieldError {
|
|
288
|
+
constructor() {
|
|
289
|
+
this.rootContext = injectFieldRootContext();
|
|
290
|
+
/**
|
|
291
|
+
* Error message id.
|
|
292
|
+
*
|
|
293
|
+
* @group Props
|
|
294
|
+
*/
|
|
295
|
+
this.id = input(`rdx-field-error-${errorId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
296
|
+
this.dataAttr = attr$1;
|
|
297
|
+
effect((onCleanup) => {
|
|
298
|
+
const id = this.id();
|
|
299
|
+
this.rootContext.addErrorId(id);
|
|
300
|
+
onCleanup(() => this.rootContext.removeErrorId(id));
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldError, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
304
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFieldError, isStandalone: true, selector: "[rdxFieldError]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.hidden": "rootContext.invalidState() ? undefined : \"\"", "attr.aria-live": "\"polite\"", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())" } }, exportAs: ["rdxFieldError"], ngImport: i0 }); }
|
|
305
|
+
}
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldError, decorators: [{
|
|
307
|
+
type: Directive,
|
|
308
|
+
args: [{
|
|
309
|
+
selector: '[rdxFieldError]',
|
|
310
|
+
exportAs: 'rdxFieldError',
|
|
311
|
+
host: {
|
|
312
|
+
'[attr.id]': 'id()',
|
|
313
|
+
'[attr.hidden]': 'rootContext.invalidState() ? undefined : ""',
|
|
314
|
+
'[attr.aria-live]': '"polite"',
|
|
315
|
+
'[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',
|
|
316
|
+
'[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'
|
|
317
|
+
}
|
|
318
|
+
}]
|
|
319
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
320
|
+
|
|
321
|
+
let labelId = 0;
|
|
322
|
+
const attr = (value) => (value ? '' : undefined);
|
|
323
|
+
/**
|
|
324
|
+
* Labels the field control.
|
|
325
|
+
*
|
|
326
|
+
* @group Components
|
|
327
|
+
*/
|
|
328
|
+
class RdxFieldLabel {
|
|
329
|
+
constructor() {
|
|
330
|
+
this.rootContext = injectFieldRootContext();
|
|
331
|
+
/**
|
|
332
|
+
* Label id.
|
|
333
|
+
*
|
|
334
|
+
* @group Props
|
|
335
|
+
*/
|
|
336
|
+
this.id = input(`rdx-field-label-${labelId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
337
|
+
this.htmlFor = () => this.rootContext.controlId();
|
|
338
|
+
this.dataAttr = attr;
|
|
339
|
+
}
|
|
340
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
341
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFieldLabel, isStandalone: true, selector: "[rdxFieldLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.for": "htmlFor()", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())", "attr.data-required": "dataAttr(rootContext.requiredState())" } }, exportAs: ["rdxFieldLabel"], ngImport: i0 }); }
|
|
342
|
+
}
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldLabel, decorators: [{
|
|
344
|
+
type: Directive,
|
|
345
|
+
args: [{
|
|
346
|
+
selector: '[rdxFieldLabel]',
|
|
347
|
+
exportAs: 'rdxFieldLabel',
|
|
348
|
+
host: {
|
|
349
|
+
'[attr.id]': 'id()',
|
|
350
|
+
'[attr.for]': 'htmlFor()',
|
|
351
|
+
'[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',
|
|
352
|
+
'[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',
|
|
353
|
+
'[attr.data-required]': 'dataAttr(rootContext.requiredState())'
|
|
354
|
+
}
|
|
355
|
+
}]
|
|
356
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Generated bundle index. Do not edit.
|
|
360
|
+
*/
|
|
361
|
+
|
|
362
|
+
export { RdxFieldControl, RdxFieldDescription, RdxFieldError, RdxFieldLabel, RdxFieldRoot, injectFieldRootContext, provideFieldRootContext };
|
|
363
|
+
//# sourceMappingURL=radix-ng-primitives-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-field.mjs","sources":["../../../packages/primitives/field/src/field-root.ts","../../../packages/primitives/field/src/field-control.ts","../../../packages/primitives/field/src/field-description.ts","../../../packages/primitives/field/src/field-error.ts","../../../packages/primitives/field/src/field-label.ts","../../../packages/primitives/field/radix-ng-primitives-field.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, inject, input, signal } from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\n\nlet fieldId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * External owner of field state. An adapter (e.g. a future Signal Forms\n * `[rdxSignalField]` directive, or a Reactive Forms bridge) registers one via\n * `setStateProvider` so Field reads authoritative form state instead of\n * self-computing it from the DOM. Each member is an optional signal-like\n * accessor; only the states the adapter owns need to be provided — the rest\n * fall back to the root's inputs / DOM heuristic. Keeping these as plain\n * `() => boolean` accessors keeps Field framework-agnostic (no dependency on\n * `@angular/forms/signals`).\n *\n * See ADR 0004 and `signal-forms-readiness.md` (prep #4).\n */\nexport interface RdxFieldState {\n invalid?: () => boolean;\n disabled?: () => boolean;\n required?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n filled?: () => boolean;\n focused?: () => boolean;\n}\n\nconst addId = (ids: string[], id: string) => (ids.includes(id) ? ids : [...ids, id]);\nconst removeId = (ids: string[], id: string) => ids.filter((item) => item !== id);\n\nconst fieldRootContext = () => {\n const root = injectFieldRoot();\n\n return {\n controlId: root.controlId,\n descriptionIds: root.descriptionIds,\n errorIds: root.errorIds,\n invalidState: root.invalidState,\n disabledState: root.disabledState,\n requiredState: root.requiredState,\n dirtyState: root.dirtyState,\n touchedState: root.touchedState,\n filledState: root.filledState,\n focusedState: root.focusedState,\n setControlId: (id: string) => root.controlId.set(id),\n addDescriptionId: (id: string) => root.descriptionIds.update((ids) => addId(ids, id)),\n removeDescriptionId: (id: string) => root.descriptionIds.update((ids) => removeId(ids, id)),\n addErrorId: (id: string) => root.errorIds.update((ids) => addId(ids, id)),\n removeErrorId: (id: string) => root.errorIds.update((ids) => removeId(ids, id)),\n setFocused: (value: boolean) => root.focusedValue.set(value),\n setFilled: (value: boolean) => root.filledValue.set(value),\n setDirty: (value: boolean) => root.dirtyValue.set(value),\n setTouched: (value: boolean) => root.touchedValue.set(value),\n /**\n * Register (or clear with `null`) an external owner of field state.\n * While a provider is registered, any state it exposes takes precedence\n * over the root inputs and the DOM-derived values. Returns the previous\n * provider so adapters can restore it on teardown.\n */\n setStateProvider: (provider: RdxFieldState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport type RdxFieldRootContext = ReturnType<typeof fieldRootContext>;\n\nexport const [injectFieldRootContext, provideFieldRootContext] = createContext<RdxFieldRootContext>('RdxFieldRoot');\n\n/**\n * Groups a form control with its label, description, error message, and field state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldRoot]',\n exportAs: 'rdxFieldRoot',\n providers: [provideFieldRootContext(fieldRootContext)],\n host: {\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())'\n }\n})\nexport class RdxFieldRoot {\n /**\n * Whether the field is invalid.\n *\n * @group Props\n * @defaultValue false\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is required.\n *\n * @group Props\n * @defaultValue false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field value has changed from its initial value.\n *\n * @group Props\n * @defaultValue false\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field has been blurred after receiving focus.\n *\n * @group Props\n * @defaultValue false\n */\n readonly touched = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Overrides whether the control has a non-empty value.\n *\n * @group Props\n */\n readonly filled = input<boolean>();\n\n /**\n * Overrides whether the control is focused.\n *\n * @group Props\n */\n readonly focused = input<boolean>();\n\n readonly controlId = signal(`rdx-field-control-${fieldId++}`);\n readonly descriptionIds = signal<string[]>([]);\n readonly errorIds = signal<string[]>([]);\n\n readonly focusedValue = signal(false);\n readonly filledValue = signal(false);\n readonly dirtyValue = signal(false);\n readonly touchedValue = signal(false);\n\n /** External state owner registered through the context; `null` when Field self-computes. */\n private readonly stateProvider = signal<RdxFieldState | null>(null);\n\n /** Whether an external adapter currently owns field state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n readonly invalidState = computed(() => this.resolve('invalid', () => this.invalid()));\n readonly disabledState = computed(() => this.resolve('disabled', () => this.disabled()));\n readonly requiredState = computed(() => this.resolve('required', () => this.required()));\n readonly dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()));\n readonly touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()));\n readonly filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()));\n readonly focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()));\n\n protected readonly dataAttr = attr;\n\n /**\n * Register an external owner of field state, returning the previous one.\n * @ignore\n */\n setStateProvider(provider: RdxFieldState | null): RdxFieldState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n /**\n * Prefer the registered provider's value for `key` when it exposes one,\n * otherwise fall back to the root inputs / DOM-derived signals.\n */\n private resolve(key: keyof RdxFieldState, fallback: () => boolean): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : fallback();\n }\n}\n\nfunction injectFieldRoot(): RdxFieldRoot {\n return inject(RdxFieldRoot);\n}\n","import { afterNextRender, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet controlId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Connects a form control to the field label, description, error, and state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldControl]',\n exportAs: 'rdxFieldControl',\n host: {\n '[attr.id]': 'id()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'rootContext.invalidState() ? \"true\" : undefined',\n '[attr.aria-required]': 'rootContext.requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'rootContext.disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined',\n '[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())',\n '[attr.data-filled]': 'dataAttr(rootContext.filledState())',\n '[attr.data-focused]': 'dataAttr(rootContext.focusedState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'syncFilled()',\n '(change)': 'syncFilled()'\n }\n})\nexport class RdxFieldControl {\n protected readonly rootContext = injectFieldRootContext()!;\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private initialValue = '';\n\n /**\n * Control id. Labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-control-${controlId++}`);\n\n protected readonly describedBy = computed(() => {\n const ids = [\n ...this.rootContext.descriptionIds(),\n ...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n this.rootContext.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.currentValue();\n this.syncFilled();\n });\n }\n\n onFocus(): void {\n this.rootContext.setFocused(true);\n }\n\n onBlur(): void {\n this.rootContext.setFocused(false);\n this.rootContext.setTouched(true);\n }\n\n syncFilled(): void {\n const value = this.currentValue();\n\n this.rootContext.setFilled(Array.isArray(value) ? value.length > 0 : value != null && value !== '');\n this.rootContext.setDirty(value !== this.initialValue);\n }\n\n protected isNativeFormControl(): boolean {\n return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.elementRef.nativeElement.tagName);\n }\n\n protected readonly dataAttr = attr;\n\n private currentValue(): string {\n const element = this.elementRef.nativeElement as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n return element.value ?? '';\n }\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet descriptionId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldDescription]',\n exportAs: 'rdxFieldDescription',\n host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldDescription {\n protected readonly rootContext = injectFieldRootContext()!;\n\n /**\n * Description id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-description-${descriptionId++}`);\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addDescriptionId(id);\n onCleanup(() => this.rootContext.removeDescriptionId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet errorId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes an invalid field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldError]',\n exportAs: 'rdxFieldError',\n host: {\n '[attr.id]': 'id()',\n '[attr.hidden]': 'rootContext.invalidState() ? undefined : \"\"',\n '[attr.aria-live]': '\"polite\"',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldError {\n protected readonly rootContext = injectFieldRootContext()!;\n\n /**\n * Error message id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-error-${errorId++}`);\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addErrorId(id);\n onCleanup(() => this.rootContext.removeErrorId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet labelId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldLabel]',\n exportAs: 'rdxFieldLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())'\n }\n})\nexport class RdxFieldLabel {\n protected readonly rootContext = injectFieldRootContext()!;\n\n /**\n * Label id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-label-${labelId++}`);\n\n readonly htmlFor = () => this.rootContext.controlId();\n\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;AAGA,IAAI,OAAO,GAAG,CAAC;AAEf,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AAwBzD,MAAM,KAAK,GAAG,CAAC,GAAa,EAAE,EAAU,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACpF,MAAM,QAAQ,GAAG,CAAC,GAAa,EAAE,EAAU,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;AAEjF,MAAM,gBAAgB,GAAG,MAAK;AAC1B,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE;IAE9B,OAAO;QACH,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,QAAQ,EAAE,IAAI,CAAC,QA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A,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,sCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAXzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,WAAW;AACzB,wBAAA,qBAAqB,EAAE,sCAAsC;AAC7D,wBAAA,sBAAsB,EAAE,uCAAuC;AAC/D,wBAAA,sBAAsB,EAAE;AAC3B;AACJ,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, computed, Directive, inject } from '@angular/core';
|
|
3
|
+
import { createContext } from '@radix-ng/primitives/core';
|
|
4
|
+
|
|
5
|
+
const attr$1 = (value) => (value ? '' : undefined);
|
|
6
|
+
const fieldsetRootContext = () => {
|
|
7
|
+
const root = injectFieldsetRoot();
|
|
8
|
+
return {
|
|
9
|
+
disabledState: root.disabledState
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const [injectFieldsetRootContext, provideFieldsetRootContext] = createContext('RdxFieldsetRoot');
|
|
13
|
+
/**
|
|
14
|
+
* Groups related form controls and disables them as a set.
|
|
15
|
+
*
|
|
16
|
+
* @group Components
|
|
17
|
+
*/
|
|
18
|
+
class RdxFieldsetRoot {
|
|
19
|
+
constructor() {
|
|
20
|
+
/**
|
|
21
|
+
* Whether all controls in the fieldset are disabled.
|
|
22
|
+
*
|
|
23
|
+
* @group Props
|
|
24
|
+
* @defaultValue false
|
|
25
|
+
*/
|
|
26
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
27
|
+
this.disabledState = computed(() => this.disabled(), ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.dataAttr = attr$1;
|
|
29
|
+
}
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldsetRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
31
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFieldsetRoot, isStandalone: true, selector: "fieldset[rdxFieldsetRoot]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.disabled": "disabledState() ? \"\" : undefined", "attr.data-disabled": "dataAttr(disabledState())" } }, providers: [provideFieldsetRootContext(fieldsetRootContext)], exportAs: ["rdxFieldsetRoot"], ngImport: i0 }); }
|
|
32
|
+
}
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldsetRoot, decorators: [{
|
|
34
|
+
type: Directive,
|
|
35
|
+
args: [{
|
|
36
|
+
selector: 'fieldset[rdxFieldsetRoot]',
|
|
37
|
+
exportAs: 'rdxFieldsetRoot',
|
|
38
|
+
providers: [provideFieldsetRootContext(fieldsetRootContext)],
|
|
39
|
+
host: {
|
|
40
|
+
'[attr.disabled]': 'disabledState() ? "" : undefined',
|
|
41
|
+
'[attr.data-disabled]': 'dataAttr(disabledState())'
|
|
42
|
+
}
|
|
43
|
+
}]
|
|
44
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
45
|
+
function injectFieldsetRoot() {
|
|
46
|
+
return inject(RdxFieldsetRoot);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const attr = (value) => (value ? '' : undefined);
|
|
50
|
+
/**
|
|
51
|
+
* Labels the fieldset.
|
|
52
|
+
*
|
|
53
|
+
* @group Components
|
|
54
|
+
*/
|
|
55
|
+
class RdxFieldsetLegend {
|
|
56
|
+
constructor() {
|
|
57
|
+
this.rootContext = injectFieldsetRootContext();
|
|
58
|
+
this.dataAttr = attr;
|
|
59
|
+
}
|
|
60
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldsetLegend, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
61
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxFieldsetLegend, isStandalone: true, selector: "legend[rdxFieldsetLegend]", host: { properties: { "attr.data-disabled": "dataAttr(rootContext.disabledState())" } }, exportAs: ["rdxFieldsetLegend"], ngImport: i0 }); }
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFieldsetLegend, decorators: [{
|
|
64
|
+
type: Directive,
|
|
65
|
+
args: [{
|
|
66
|
+
selector: 'legend[rdxFieldsetLegend]',
|
|
67
|
+
exportAs: 'rdxFieldsetLegend',
|
|
68
|
+
host: {
|
|
69
|
+
'[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'
|
|
70
|
+
}
|
|
71
|
+
}]
|
|
72
|
+
}] });
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Generated bundle index. Do not edit.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
export { RdxFieldsetLegend, RdxFieldsetRoot, injectFieldsetRootContext, provideFieldsetRootContext };
|
|
79
|
+
//# sourceMappingURL=radix-ng-primitives-fieldset.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-fieldset.mjs","sources":["../../../packages/primitives/fieldset/src/fieldset-root.ts","../../../packages/primitives/fieldset/src/fieldset-legend.ts","../../../packages/primitives/fieldset/radix-ng-primitives-fieldset.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\nconst fieldsetRootContext = () => {\n const root = injectFieldsetRoot();\n\n return {\n disabledState: root.disabledState\n };\n};\n\nexport type RdxFieldsetRootContext = ReturnType<typeof fieldsetRootContext>;\n\nexport const [injectFieldsetRootContext, provideFieldsetRootContext] =\n createContext<RdxFieldsetRootContext>('RdxFieldsetRoot');\n\n/**\n * Groups related form controls and disables them as a set.\n *\n * @group Components\n */\n@Directive({\n selector: 'fieldset[rdxFieldsetRoot]',\n exportAs: 'rdxFieldsetRoot',\n providers: [provideFieldsetRootContext(fieldsetRootContext)],\n host: {\n '[attr.disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.data-disabled]': 'dataAttr(disabledState())'\n }\n})\nexport class RdxFieldsetRoot {\n /**\n * Whether all controls in the fieldset are disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabledState = computed(() => this.disabled());\n\n protected readonly dataAttr = attr;\n}\n\nfunction injectFieldsetRoot(): RdxFieldsetRoot {\n return inject(RdxFieldsetRoot);\n}\n","import { Directive } from '@angular/core';\nimport { injectFieldsetRootContext } from './fieldset-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the fieldset.\n *\n * @group Components\n */\n@Directive({\n selector: 'legend[rdxFieldsetLegend]',\n exportAs: 'rdxFieldsetLegend',\n host: {\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldsetLegend {\n protected readonly rootContext = injectFieldsetRootContext()!;\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;AAGA,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AAEzD,MAAM,mBAAmB,GAAG,MAAK;AAC7B,IAAA,MAAM,IAAI,GAAG,kBAAkB,EAAE;IAEjC,OAAO;QACH,aAAa,EAAE,IAAI,CAAC;KACvB;AACL,CAAC;AAIM,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAChE,aAAa,CAAyB,iBAAiB;AAE3D;;;;AAIG;MAUU,eAAe,CAAA;AAT5B,IAAA,WAAA,GAAA;AAUI;;;;;AAKG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;QAE/E,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;QAErC,IAAA,CAAA,QAAQ,GAAGA,MAAI;AACrC,IAAA;8GAZY,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,yVANb,CAAC,0BAA0B,CAAC,mBAAmB,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FA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+35,10 @@ class RdxFocusGuards {
|
|
|
35
35
|
element.style.pointerEvents = 'none';
|
|
36
36
|
return element;
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFocusGuards, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxFocusGuards, isStandalone: true, selector: "[rdxFocusGuards]", ngImport: i0 }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFocusGuards, decorators: [{
|
|
42
42
|
type: Directive,
|
|
43
43
|
args: [{
|
|
44
44
|
selector: '[rdxFocusGuards]'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-focus-guards.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-focus-guards.mjs","sources":["../../../packages/primitives/focus-guards/src/focus-guards.ts","../../../packages/primitives/focus-guards/radix-ng-primitives-focus-guards.ts"],"sourcesContent":["import { afterNextRender, Directive, effect, inject, Injector } from '@angular/core';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\n@Directive({\n selector: '[rdxFocusGuards]'\n})\nexport class RdxFocusGuards {\n private readonly injector = inject(Injector);\n\n constructor() {\n afterNextRender(() => {\n effect(\n (onCleanup) => {\n const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n\n document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? this.createFocusGuard());\n\n document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? this.createFocusGuard());\n\n count++;\n\n onCleanup(() => {\n if (count === 1) {\n document.querySelectorAll('[data-radix-focus-guard]').forEach((node) => node.remove());\n }\n\n count--;\n });\n },\n { injector: this.injector }\n );\n });\n }\n\n createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.outline = 'none';\n element.style.opacity = '0';\n element.style.position = 'fixed';\n element.style.pointerEvents = 'none';\n return element;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;AACA,IAAI,KAAK,GAAG,CAAC;AAEb;;;AAGG;MAIU,cAAc,CAAA;AAGvB,IAAA,WAAA,GAAA;AAFiB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAGxC,eAAe,CAAC,MAAK;AACjB,YAAA,MAAM,CACF,CAAC,SAAS,KAAI;gBACV,MAAM,UAAU,GAAG,QAAQ,CAAC,gBAAgB,CAAC,0BAA0B,CAAC;AAExE,gBAAA,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;AAE3F,gBAAA,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;AAE1F,gBAAA,KAAK,EAAE;gBAEP,SAAS,CAAC,MAAK;AACX,oBAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACb,wBAAA,QAAQ,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;oBAC1F;AAEA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