@nexterajs/ui 0.0.1
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/LICENSE +202 -0
- package/NOTICE +16 -0
- package/README.md +64 -0
- package/fesm2022/nexterajs-ui-animations.mjs +184 -0
- package/fesm2022/nexterajs-ui-animations.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-core.mjs +326 -0
- package/fesm2022/nexterajs-ui-core.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-dropdowns.mjs +953 -0
- package/fesm2022/nexterajs-ui-dropdowns.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-excel.mjs +779 -0
- package/fesm2022/nexterajs-ui-excel.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-file-uploader.mjs +125 -0
- package/fesm2022/nexterajs-ui-file-uploader.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-forms.mjs +1113 -0
- package/fesm2022/nexterajs-ui-forms.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-grid.mjs +4145 -0
- package/fesm2022/nexterajs-ui-grid.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-intl.mjs +377 -0
- package/fesm2022/nexterajs-ui-intl.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-pivot.mjs +4739 -0
- package/fesm2022/nexterajs-ui-pivot.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-styling.mjs +59 -0
- package/fesm2022/nexterajs-ui-styling.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-tree-view.mjs +202 -0
- package/fesm2022/nexterajs-ui-tree-view.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-validation.mjs +269 -0
- package/fesm2022/nexterajs-ui-validation.mjs.map +1 -0
- package/fesm2022/nexterajs-ui.mjs +23 -0
- package/fesm2022/nexterajs-ui.mjs.map +1 -0
- package/package.json +100 -0
- package/styles/_button-directives.scss +39 -0
- package/styles/_dropdown.scss +113 -0
- package/styles/_editor.scss +146 -0
- package/styles/_mixins.scss +2 -0
- package/styles/_tokens.scss +77 -0
- package/styles/_widget.scss +58 -0
- package/styles/index.scss +83 -0
- package/types/nexterajs-ui-animations.d.ts +22 -0
- package/types/nexterajs-ui-core.d.ts +328 -0
- package/types/nexterajs-ui-dropdowns.d.ts +334 -0
- package/types/nexterajs-ui-excel.d.ts +159 -0
- package/types/nexterajs-ui-file-uploader.d.ts +47 -0
- package/types/nexterajs-ui-forms.d.ts +296 -0
- package/types/nexterajs-ui-grid.d.ts +1485 -0
- package/types/nexterajs-ui-intl.d.ts +125 -0
- package/types/nexterajs-ui-pivot.d.ts +1470 -0
- package/types/nexterajs-ui-styling.d.ts +40 -0
- package/types/nexterajs-ui-tree-view.d.ts +69 -0
- package/types/nexterajs-ui-validation.d.ts +102 -0
- package/types/nexterajs-ui.d.ts +12 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// @nexterajs/ui — global stylesheet.
|
|
2
|
+
// Registered as the LAST entry in angular.json `styles` so library tokens/coexistence rules
|
|
3
|
+
// resolve after the legacy DevExtreme/Material CSS during the incremental migration.
|
|
4
|
+
//
|
|
5
|
+
// Component look-and-feel lives in each component's colocated .scss (encapsulated). This file
|
|
6
|
+
// holds only design tokens and cross-cutting rules that must be global.
|
|
7
|
+
|
|
8
|
+
@use 'tokens';
|
|
9
|
+
@use 'widget';
|
|
10
|
+
@use 'editor';
|
|
11
|
+
@use 'dropdown';
|
|
12
|
+
@use 'button-directives';
|
|
13
|
+
|
|
14
|
+
// The widget base (font family/size/weight/line-height). Must come before the component chrome
|
|
15
|
+
// below so those can override it, and it is what carries the contract across a CDK portal.
|
|
16
|
+
@include widget.nxe-widget;
|
|
17
|
+
|
|
18
|
+
@include button-directives.nxe-button-directives;
|
|
19
|
+
|
|
20
|
+
// Shared text-editor chrome (text-box, text-area, number-box, date-box).
|
|
21
|
+
@include editor.nxe-editor-chrome;
|
|
22
|
+
|
|
23
|
+
// Shared select-family dropdown panel (select-box, tag-box).
|
|
24
|
+
@include dropdown.nxe-dropdown;
|
|
25
|
+
|
|
26
|
+
// Pointer-drag chrome for NxeDragGesture, shared by the data grid's column/group drags and the
|
|
27
|
+
// pivot's field-panel/chooser chip drags. Global because a page can render a pivot and NO data
|
|
28
|
+
// grid (an ANALYTIC report is exactly that), and component styles only ship while an instance of
|
|
29
|
+
// their component exists — the suppression below is what stops a chip drag selecting page text.
|
|
30
|
+
.nxe-grid-drag-ghost {
|
|
31
|
+
position: fixed;
|
|
32
|
+
z-index: 10000;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
box-sizing: content-box;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
body.nxe-grid-dragging {
|
|
39
|
+
user-select: none;
|
|
40
|
+
-webkit-user-select: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// nxe-badge (directive — needs global, non-encapsulated styles).
|
|
44
|
+
.nxe-badge-host {
|
|
45
|
+
position: relative;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.nxe-badge-content {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: -6px;
|
|
51
|
+
right: -6px;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
min-width: 18px;
|
|
57
|
+
height: 18px;
|
|
58
|
+
padding: 0 4px;
|
|
59
|
+
border-radius: 9px;
|
|
60
|
+
background: #30374c;
|
|
61
|
+
color: #fff;
|
|
62
|
+
font-size: 10px;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
line-height: 1;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
z-index: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.nxe-badge-content.nxe-badge-small {
|
|
70
|
+
top: -4px;
|
|
71
|
+
right: -4px;
|
|
72
|
+
min-width: 14px;
|
|
73
|
+
height: 14px;
|
|
74
|
+
border-radius: 7px;
|
|
75
|
+
font-size: 9px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.nxe-badge-content.nxe-badge-large {
|
|
79
|
+
min-width: 22px;
|
|
80
|
+
height: 22px;
|
|
81
|
+
border-radius: 11px;
|
|
82
|
+
font-size: 12px;
|
|
83
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as _angular_animations from '@angular/animations';
|
|
2
|
+
|
|
3
|
+
declare class NxeAnimationCurves {
|
|
4
|
+
static standard: string;
|
|
5
|
+
static deceleration: string;
|
|
6
|
+
static acceleration: string;
|
|
7
|
+
static sharp: string;
|
|
8
|
+
}
|
|
9
|
+
declare class NxeAnimationDurations {
|
|
10
|
+
static complex: string;
|
|
11
|
+
static entering: string;
|
|
12
|
+
static exiting: string;
|
|
13
|
+
}
|
|
14
|
+
declare const expandCollapse: _angular_animations.AnimationTriggerMetadata;
|
|
15
|
+
declare const fadeIn: _angular_animations.AnimationTriggerMetadata;
|
|
16
|
+
declare const fadeOut: _angular_animations.AnimationTriggerMetadata;
|
|
17
|
+
declare const shake: _angular_animations.AnimationTriggerMetadata;
|
|
18
|
+
declare const slideInTop: _angular_animations.AnimationTriggerMetadata;
|
|
19
|
+
declare const slideOutTop: _angular_animations.AnimationTriggerMetadata;
|
|
20
|
+
declare const nxeAnimations: _angular_animations.AnimationTriggerMetadata[];
|
|
21
|
+
|
|
22
|
+
export { NxeAnimationCurves, NxeAnimationDurations, expandCollapse, fadeIn, fadeOut, nxeAnimations, shake, slideInTop, slideOutTop };
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, ElementRef, NgZone, TemplateRef } from '@angular/core';
|
|
3
|
+
import * as _nexterajs_ui_core from '@nexterajs/ui/core';
|
|
4
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DevExtreme-compatible value-change event payload.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors the shape DevExtreme editors emit from `onValueChanged`
|
|
10
|
+
* (`{ value, previousValue, event, component, element }`) so existing handlers that read
|
|
11
|
+
* `e.value` / `e.previousValue` / `e.event` keep working after a tag rename.
|
|
12
|
+
*/
|
|
13
|
+
interface NxeValueChangedEvent<T> {
|
|
14
|
+
/** The new value. */
|
|
15
|
+
value: T | null;
|
|
16
|
+
/** The value before this change. */
|
|
17
|
+
previousValue: T | null;
|
|
18
|
+
/** The originating DOM event, when the change came from user interaction (else null). */
|
|
19
|
+
event: Event | null;
|
|
20
|
+
/** The emitting component instance (DevExtreme `component`). */
|
|
21
|
+
component: unknown;
|
|
22
|
+
/** The component host element (DevExtreme `element`). */
|
|
23
|
+
element: HTMLElement;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A single failed validation rule. */
|
|
27
|
+
interface NxeBrokenRule {
|
|
28
|
+
type: string;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Result of validating a control or a validation group — shaped to match
|
|
33
|
+
* DevExtreme's `ValidationGroup.validate()` / `dxValidator.validate()` return value so existing
|
|
34
|
+
* handlers (`const r = event.validationGroup.validate(); if (r.isValid) {...}`) work unchanged.
|
|
35
|
+
*/
|
|
36
|
+
interface NxeValidationResult {
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
brokenRules: NxeBrokenRule[];
|
|
39
|
+
status: 'valid' | 'invalid' | 'pending';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Contract an editor exposes (via {@link NXE_VALIDATION_TARGET}) to the `nxe-validator` nested
|
|
43
|
+
* inside it: read the current value, the editor's validation group, and push the invalid
|
|
44
|
+
* message back so the editor can render it.
|
|
45
|
+
*/
|
|
46
|
+
interface NxeValidationTarget {
|
|
47
|
+
getValue(): unknown;
|
|
48
|
+
validationGroup(): string | undefined;
|
|
49
|
+
setValidationError(message: string | null): void;
|
|
50
|
+
}
|
|
51
|
+
/** DI token the editor provides so its nested `nxe-validator` can adapt it. */
|
|
52
|
+
declare const NXE_VALIDATION_TARGET: InjectionToken<NxeValidationTarget>;
|
|
53
|
+
/** A member registered in a validation group (an `nxe-validator`). */
|
|
54
|
+
interface NxeValidationGroupMember {
|
|
55
|
+
validate(): NxeValidationResult;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Signal-based `ControlValueAccessor` base for every nxe form editor
|
|
60
|
+
* (`nxe-text-box`, `nxe-number-box`, `nxe-date-box`, `nxe-check-box`, `nxe-text-area`,
|
|
61
|
+
* `nxe-select-box`, `nxe-tag-box`, `nxe-radio`, ...).
|
|
62
|
+
*
|
|
63
|
+
* It supports BOTH template-driven (`[(ngModel)]`) and reactive (`formControlName`) forms
|
|
64
|
+
* transparently, as well as DevExtreme-style `[value]` / `[(value)]` two-way binding, and
|
|
65
|
+
* emits the DevExtreme-shaped {@link NxeValueChangedEvent} from `onValueChanged`.
|
|
66
|
+
*
|
|
67
|
+
* Concrete components MUST register themselves as the value accessor, e.g.:
|
|
68
|
+
* ```ts
|
|
69
|
+
* @Component({
|
|
70
|
+
* selector: 'nxe-text-box',
|
|
71
|
+
* providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NxeTextBoxComponent), multi: true }],
|
|
72
|
+
* ...
|
|
73
|
+
* })
|
|
74
|
+
* export class NxeTextBoxComponent extends NxeFormControlBase<string> { ... }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* Subclasses call {@link commitValue} on user interaction and {@link markAsTouched} on blur.
|
|
78
|
+
*/
|
|
79
|
+
declare abstract class NxeFormControlBase<T> implements ControlValueAccessor, NxeValidationTarget {
|
|
80
|
+
protected readonly elementRef: ElementRef<HTMLElement>;
|
|
81
|
+
/**
|
|
82
|
+
* The app is zone-based (`provideZoneChangeDetection()`); writing back to Angular forms
|
|
83
|
+
* from a signal context must run inside the zone or reactive forms lag a tick.
|
|
84
|
+
*/
|
|
85
|
+
protected readonly ngZone: NgZone;
|
|
86
|
+
/** Application-wide defaults; each editor resolves `binding ?? this ?? literal`. */
|
|
87
|
+
protected readonly nxeDefaults: _nexterajs_ui_core.NxeDefaultOptions;
|
|
88
|
+
/**
|
|
89
|
+
* The current value — single source of truth. Two-way bindable as `[(value)]` (DevExtreme
|
|
90
|
+
* parity) and also driven by `writeValue` for `ngModel`/`formControlName`.
|
|
91
|
+
*/
|
|
92
|
+
readonly value: _angular_core.ModelSignal<T>;
|
|
93
|
+
/** Disabled via the `[disabled]` input (DevExtreme parity); OR-combined with forms disabled. */
|
|
94
|
+
readonly disabledInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
95
|
+
private readonly disabledByForm;
|
|
96
|
+
/** Effective disabled state (input OR reactive-forms `setDisabledState`). */
|
|
97
|
+
readonly disabled: _angular_core.Signal<boolean>;
|
|
98
|
+
/** Read-only state (DevExtreme `[readOnly]`). */
|
|
99
|
+
readonly readOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
100
|
+
/** Validation group this editor belongs to (its nested `nxe-validator` registers here). */
|
|
101
|
+
readonly validationGroupInput: _angular_core.InputSignal<string>;
|
|
102
|
+
/** The current validation error message (set by a nested `nxe-validator`), or null. */
|
|
103
|
+
readonly validationError: _angular_core.WritableSignal<string>;
|
|
104
|
+
/** Whether the control has been blurred at least once. */
|
|
105
|
+
readonly touched: _angular_core.WritableSignal<boolean>;
|
|
106
|
+
/** Whether the value has been changed by the user at least once. */
|
|
107
|
+
readonly dirty: _angular_core.WritableSignal<boolean>;
|
|
108
|
+
/** DevExtreme-compatible value-change event. */
|
|
109
|
+
readonly onValueChanged: _angular_core.OutputEmitterRef<NxeValueChangedEvent<T>>;
|
|
110
|
+
private _onChange;
|
|
111
|
+
private _onTouched;
|
|
112
|
+
/** Host element (the DevExtreme event payload `element`). */
|
|
113
|
+
get element(): HTMLElement;
|
|
114
|
+
getValue(): unknown;
|
|
115
|
+
validationGroup(): string | undefined;
|
|
116
|
+
setValidationError(message: string | null): void;
|
|
117
|
+
writeValue(value: T | null): void;
|
|
118
|
+
registerOnChange(fn: (value: T | null) => void): void;
|
|
119
|
+
registerOnTouched(fn: () => void): void;
|
|
120
|
+
setDisabledState(isDisabled: boolean): void;
|
|
121
|
+
/**
|
|
122
|
+
* Commit a user-initiated value change: update the value, notify Angular forms (inside
|
|
123
|
+
* `NgZone.run` so reactive forms detect it in this zone-based app), and emit the
|
|
124
|
+
* DevExtreme-shaped `onValueChanged`. No-op when the value is unchanged.
|
|
125
|
+
*/
|
|
126
|
+
protected commitValue(next: T | null, event?: Event | null): void;
|
|
127
|
+
/** Mark the control as touched (e.g. on blur), notifying Angular forms exactly once. */
|
|
128
|
+
protected markAsTouched(): void;
|
|
129
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeFormControlBase<any>, never>;
|
|
130
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NxeFormControlBase<any>, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "validationGroupInput": { "alias": "validationGroup"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChanged": "onValueChanged"; }, never, never, true, never>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Contract implemented by every flat `nxe-` nested-option component
|
|
135
|
+
* (`nxe-column`, `nxe-selection`, `nxe-paging`, `nxe-summary`, `nxe-validation-rule`, ...).
|
|
136
|
+
*
|
|
137
|
+
* Nested options carry no template; they exist purely to declare configuration. Each one
|
|
138
|
+
* exposes its current config as a signal-readable function and a `role` discriminator, so a
|
|
139
|
+
* parent (`nxe-data-grid`, `nxe-select-box`, ...) can collect them via `contentChildren` and
|
|
140
|
+
* derive a reactive config model — the mechanism that lets
|
|
141
|
+
* `<nxe-data-grid><nxe-column/></nxe-data-grid>` mirror `<dx-data-grid><dxi-column/>`.
|
|
142
|
+
*/
|
|
143
|
+
interface NxeConfigOption<TConfig = unknown> {
|
|
144
|
+
/** Discriminator identifying the option kind, e.g. `'column'`, `'selection'`, `'paging'`. */
|
|
145
|
+
readonly nxeRole: string;
|
|
146
|
+
/** Returns the option's current configuration (reads signals; recomputes reactively). */
|
|
147
|
+
nxeConfig(): TConfig;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* DI token every nested-option component provides (`multi: true`) so parents can query all
|
|
151
|
+
* options with `contentChildren(NXE_OPTION)` without importing the concrete option classes.
|
|
152
|
+
*/
|
|
153
|
+
declare const NXE_OPTION: InjectionToken<NxeConfigOption<unknown>>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Base for no-template nested-option components (see {@link NxeConfigOption}).
|
|
157
|
+
*
|
|
158
|
+
* Concrete options extend this, declare their inputs as signals, implement {@link nxeConfig}
|
|
159
|
+
* (typically returning a `computed()` of those inputs), and register the {@link NXE_OPTION}
|
|
160
|
+
* token so the parent can collect them:
|
|
161
|
+
* ```ts
|
|
162
|
+
* @Component({
|
|
163
|
+
* selector: 'nxe-selection',
|
|
164
|
+
* template: '',
|
|
165
|
+
* providers: [{ provide: NXE_OPTION, useExisting: forwardRef(() => NxeSelectionComponent), multi: true }],
|
|
166
|
+
* })
|
|
167
|
+
* export class NxeSelectionComponent extends NxeConfigOptionBase<SelectionConfig> {
|
|
168
|
+
* readonly nxeRole = 'selection';
|
|
169
|
+
* readonly mode = input<'single' | 'multiple'>('single');
|
|
170
|
+
* nxeConfig() { return { mode: this.mode() }; }
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
declare abstract class NxeConfigOptionBase<TConfig> implements NxeConfigOption<TConfig> {
|
|
175
|
+
abstract readonly nxeRole: string;
|
|
176
|
+
abstract nxeConfig(): TConfig;
|
|
177
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeConfigOptionBase<any>, never>;
|
|
178
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NxeConfigOptionBase<any>, never, never, {}, {}, never, never, true, never>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Per-widget defaults, mirroring DevExtreme's `Widget.defaultOptions({ options: {...} })`.
|
|
183
|
+
*
|
|
184
|
+
* Every field is optional and every consumer resolves it as `binding ?? token ?? literal`, so
|
|
185
|
+
* an application that provides nothing keeps the behaviour it has today.
|
|
186
|
+
*
|
|
187
|
+
* Only options that an application genuinely sets once and globally belong here. This is not a
|
|
188
|
+
* second way to configure a component — a binding on the element always wins.
|
|
189
|
+
*/
|
|
190
|
+
interface NxeGridDefaultOptions {
|
|
191
|
+
hoverStateEnabled?: boolean;
|
|
192
|
+
columnAutoWidth?: boolean;
|
|
193
|
+
rowAlternationEnabled?: boolean;
|
|
194
|
+
showColumnLines?: boolean;
|
|
195
|
+
showRowLines?: boolean;
|
|
196
|
+
showBorders?: boolean;
|
|
197
|
+
wordWrapEnabled?: boolean;
|
|
198
|
+
noDataText?: string;
|
|
199
|
+
}
|
|
200
|
+
interface NxePickerDefaultOptions {
|
|
201
|
+
displayExpr?: string;
|
|
202
|
+
valueExpr?: string;
|
|
203
|
+
searchExpr?: string;
|
|
204
|
+
searchEnabled?: boolean;
|
|
205
|
+
showClearButton?: boolean;
|
|
206
|
+
showDropDownButton?: boolean;
|
|
207
|
+
placeholder?: string;
|
|
208
|
+
}
|
|
209
|
+
interface NxeDefaultOptions {
|
|
210
|
+
readonly dataGrid?: NxeGridDefaultOptions;
|
|
211
|
+
/** `nxe-tree-list` resolves against this slice instead of `dataGrid`, as dx does. */
|
|
212
|
+
readonly treeList?: NxeGridDefaultOptions;
|
|
213
|
+
readonly selectBox?: NxePickerDefaultOptions;
|
|
214
|
+
readonly tagBox?: NxePickerDefaultOptions & {
|
|
215
|
+
showSelectionControls?: boolean;
|
|
216
|
+
};
|
|
217
|
+
/** Narrower than the other pickers: this one has no built-in search or drop-down button. */
|
|
218
|
+
readonly dropDownBox?: Pick<NxePickerDefaultOptions, 'displayExpr' | 'valueExpr' | 'placeholder' | 'showClearButton'>;
|
|
219
|
+
readonly dateBox?: {
|
|
220
|
+
displayFormat?: string;
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
};
|
|
223
|
+
readonly textBox?: {
|
|
224
|
+
placeholder?: string;
|
|
225
|
+
hoverStateEnabled?: boolean;
|
|
226
|
+
};
|
|
227
|
+
readonly textArea?: {
|
|
228
|
+
placeholder?: string;
|
|
229
|
+
height?: number | string;
|
|
230
|
+
};
|
|
231
|
+
readonly numberBox?: {
|
|
232
|
+
format?: string;
|
|
233
|
+
};
|
|
234
|
+
readonly button?: {
|
|
235
|
+
focusStateEnabled?: boolean;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Application-wide component defaults.
|
|
240
|
+
*
|
|
241
|
+
* DevExtreme applications configure a great deal through `defaultOptions` and then never write
|
|
242
|
+
* those attributes again — so the templates carry no evidence that the option was ever set.
|
|
243
|
+
* Without an equivalent here, a migrated application silently gets the library's literals: an
|
|
244
|
+
* app that set `columnAutoWidth: true` once at bootstrap would find every grid laying its
|
|
245
|
+
* columns out differently, with nothing in the markup to explain why.
|
|
246
|
+
*
|
|
247
|
+
* ```ts
|
|
248
|
+
* providers: [
|
|
249
|
+
* {
|
|
250
|
+
* provide: NXE_DEFAULT_OPTIONS,
|
|
251
|
+
* useValue: {
|
|
252
|
+
* dataGrid: { columnAutoWidth: true, hoverStateEnabled: true },
|
|
253
|
+
* treeList: { columnAutoWidth: true, hoverStateEnabled: true },
|
|
254
|
+
* textArea: { height: 80 },
|
|
255
|
+
* } satisfies NxeDefaultOptions,
|
|
256
|
+
* },
|
|
257
|
+
* ]
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
declare const NXE_DEFAULT_OPTIONS: InjectionToken<NxeDefaultOptions>;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* `nxeTemplate` — drop-in replacement for DevExtreme's `*dxTemplate`.
|
|
264
|
+
*
|
|
265
|
+
* Captures a named `ng-template` so a parent container (select-box item template, grid
|
|
266
|
+
* cell/header/edit templates, list item template, ...) can look it up by name and render it
|
|
267
|
+
* with a context object. BOTH authoring forms resolve to the same {@link name}:
|
|
268
|
+
*
|
|
269
|
+
* - attribute form: `<ng-template nxeTemplate="cellContent" let-data>` (psak-web style)
|
|
270
|
+
* - dx microsyntax: `<div *nxeTemplate="let data of 'cellContent'">` — desugars the name into
|
|
271
|
+
* an `nxeTemplateOf` binding (orbit's mechanically-migrated `*dxTemplate` templates)
|
|
272
|
+
*
|
|
273
|
+
* Parents collect these via `contentChildren(NxeTemplateDirective)` and match on {@link name},
|
|
274
|
+
* rendering with `ngTemplateOutlet` + an `ngTemplateOutletContext` of `{ $implicit: data, ... }`.
|
|
275
|
+
*/
|
|
276
|
+
declare class NxeTemplateDirective {
|
|
277
|
+
/** Attribute-form name (`nxeTemplate="name"`); empty in microsyntax usage. */
|
|
278
|
+
readonly attrName: _angular_core.InputSignal<string>;
|
|
279
|
+
/** Microsyntax-form name (`*nxeTemplate="let x of 'name'"` binds `nxeTemplateOf`). */
|
|
280
|
+
readonly ofName: _angular_core.InputSignal<string>;
|
|
281
|
+
/** The template's lookup name, whichever form supplied it. */
|
|
282
|
+
readonly name: _angular_core.Signal<string>;
|
|
283
|
+
readonly templateRef: TemplateRef<unknown>;
|
|
284
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeTemplateDirective, never>;
|
|
285
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NxeTemplateDirective, "[nxeTemplate]", never, { "attrName": { "alias": "nxeTemplate"; "required": false; "isSignal": true; }; "ofName": { "alias": "nxeTemplateOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Wrap a value in an array if it is not already one (null/undefined -> empty array).
|
|
290
|
+
*
|
|
291
|
+
* Mirrors `@angular/cdk/coercion`'s `coerceArray` so nxe components don't import CDK coercion
|
|
292
|
+
* directly. (For boolean/number coercion use `booleanAttribute` / `numberAttribute` from
|
|
293
|
+
* `@angular/core` directly on `input(...)`.)
|
|
294
|
+
*/
|
|
295
|
+
declare function coerceArray<T>(value: T | readonly T[] | null | undefined): T[];
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* `booleanAttribute` that preserves "unset".
|
|
299
|
+
*
|
|
300
|
+
* An input resolved as `binding ?? token ?? literal` needs three states, but
|
|
301
|
+
* `booleanAttribute` has two: it maps `undefined` to `false`, which makes "nobody bound this"
|
|
302
|
+
* indistinguishable from "someone bound false" and silently removes the token rung.
|
|
303
|
+
*
|
|
304
|
+
* This keeps the attribute-form coercion (`showClearButton="false"` is `false`, not the truthy
|
|
305
|
+
* string) and passes `undefined` straight through.
|
|
306
|
+
*/
|
|
307
|
+
declare function nxeOptionalBoolean(value: unknown): boolean | undefined;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Root registry mapping a `validationGroup` string to the `nxe-validator`s in it, mirroring
|
|
311
|
+
* DevExtreme's global ValidationEngine.
|
|
312
|
+
*
|
|
313
|
+
* `nxe-button[validationGroup]` (and any caller) triggers {@link validate} for a group, which
|
|
314
|
+
* runs every member validator and aggregates the result into the DevExtreme-shaped
|
|
315
|
+
* {@link NxeValidationResult}.
|
|
316
|
+
*/
|
|
317
|
+
declare class NxeValidationGroupRegistry {
|
|
318
|
+
private readonly groups;
|
|
319
|
+
register(group: string, member: NxeValidationGroupMember): void;
|
|
320
|
+
unregister(group: string, member: NxeValidationGroupMember): void;
|
|
321
|
+
/** Validate every member of the group; valid (and empty) groups return `isValid: true`. */
|
|
322
|
+
validate(group: string): NxeValidationResult;
|
|
323
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeValidationGroupRegistry, never>;
|
|
324
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NxeValidationGroupRegistry>;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export { NXE_DEFAULT_OPTIONS, NXE_OPTION, NXE_VALIDATION_TARGET, NxeConfigOptionBase, NxeFormControlBase, NxeTemplateDirective, NxeValidationGroupRegistry, coerceArray, nxeOptionalBoolean };
|
|
328
|
+
export type { NxeBrokenRule, NxeConfigOption, NxeDefaultOptions, NxeGridDefaultOptions, NxePickerDefaultOptions, NxeValidationGroupMember, NxeValidationResult, NxeValidationTarget, NxeValueChangedEvent };
|