@absoluteui/angular 0.0.0-stage → 0.13.2
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 +201 -0
- package/NOTICE +5 -0
- package/README.md +196 -2
- package/SECURITY.md +102 -0
- package/dist/a11y/index.d.ts +85 -0
- package/dist/a11y/index.js +2 -0
- package/dist/accordion/index.d.ts +28 -0
- package/dist/accordion/index.js +2 -0
- package/dist/alert/index.d.ts +27 -0
- package/dist/alert/index.js +2 -0
- package/dist/avatar/index.d.ts +20 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar-group/index.d.ts +18 -0
- package/dist/avatar-group/index.js +2 -0
- package/dist/badge/index.d.ts +18 -0
- package/dist/badge/index.js +2 -0
- package/dist/bar-chart/index.d.ts +45 -0
- package/dist/bar-chart/index.js +2 -0
- package/dist/bottom-sheet/index.d.ts +35 -0
- package/dist/bottom-sheet/index.js +2 -0
- package/dist/box-plot/index.d.ts +40 -0
- package/dist/box-plot/index.js +2 -0
- package/dist/breadcrumb/index.d.ts +22 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/bullet-chart/index.d.ts +37 -0
- package/dist/bullet-chart/index.js +2 -0
- package/dist/business-calendar/index.d.ts +36 -0
- package/dist/business-calendar/index.js +2 -0
- package/dist/button/index.d.ts +53 -0
- package/dist/button/index.js +2 -0
- package/dist/button-group/index.d.ts +18 -0
- package/dist/button-group/index.js +2 -0
- package/dist/calendar/index.d.ts +44 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar-heatmap/index.d.ts +42 -0
- package/dist/calendar-heatmap/index.js +2 -0
- package/dist/candlestick-chart/index.d.ts +45 -0
- package/dist/candlestick-chart/index.js +2 -0
- package/dist/card/index.d.ts +27 -0
- package/dist/card/index.js +2 -0
- package/dist/card/parts.d.ts +13 -0
- package/dist/card/parts.js +2 -0
- package/dist/carousel/index.d.ts +26 -0
- package/dist/carousel/index.js +2 -0
- package/dist/cascader/index.d.ts +53 -0
- package/dist/cascader/index.js +2 -0
- package/dist/chart-export/index.d.ts +15 -0
- package/dist/chart-export/index.js +2 -0
- package/dist/chat/index.d.ts +54 -0
- package/dist/chat/index.js +2 -0
- package/dist/checkbox/index.d.ts +38 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-group/index.d.ts +40 -0
- package/dist/checkbox-group/index.js +2 -0
- package/dist/code-viewer/index.d.ts +35 -0
- package/dist/code-viewer/index.js +2 -0
- package/dist/collapsible/index.d.ts +26 -0
- package/dist/collapsible/index.js +2 -0
- package/dist/color-picker/index.d.ts +50 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/combo-chart/index.d.ts +45 -0
- package/dist/combo-chart/index.js +2 -0
- package/dist/combobox/index.d.ts +57 -0
- package/dist/combobox/index.js +2 -0
- package/dist/command-palette/index.d.ts +36 -0
- package/dist/command-palette/index.js +2 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.js +2 -0
- package/dist/context-menu/index.d.ts +37 -0
- package/dist/context-menu/index.js +2 -0
- package/dist/dashboard/controller.d.ts +19 -0
- package/dist/dashboard/controller.js +2 -0
- package/dist/dashboard/index.d.ts +72 -0
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard-grid/catalog.d.ts +30 -0
- package/dist/dashboard-grid/catalog.js +2 -0
- package/dist/dashboard-grid/index.d.ts +41 -0
- package/dist/dashboard-grid/index.js +2 -0
- package/dist/dashboard-widget/index.d.ts +31 -0
- package/dist/dashboard-widget/index.js +2 -0
- package/dist/data-grid/index.d.ts +251 -0
- package/dist/data-grid/index.js +2 -0
- package/dist/data-table/column-chooser.d.ts +23 -0
- package/dist/data-table/column-chooser.js +2 -0
- package/dist/data-table/column.d.ts +82 -0
- package/dist/data-table/column.js +2 -0
- package/dist/data-table/index.d.ts +97 -0
- package/dist/data-table/index.js +2 -0
- package/dist/date-input/index.d.ts +42 -0
- package/dist/date-input/index.js +2 -0
- package/dist/date-picker/index.d.ts +53 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-range-picker/index.d.ts +61 -0
- package/dist/date-range-picker/index.js +2 -0
- package/dist/date-time-picker/index.d.ts +56 -0
- package/dist/date-time-picker/index.js +2 -0
- package/dist/diagram/index.d.ts +72 -0
- package/dist/diagram/index.js +2 -0
- package/dist/dialog/index.d.ts +31 -0
- package/dist/dialog/index.js +2 -0
- package/dist/discussion/index.d.ts +65 -0
- package/dist/discussion/index.js +2 -0
- package/dist/drawer/index.d.ts +32 -0
- package/dist/drawer/index.js +2 -0
- package/dist/duration-picker/index.d.ts +43 -0
- package/dist/duration-picker/index.js +2 -0
- package/dist/empty-state/index.d.ts +22 -0
- package/dist/empty-state/index.js +2 -0
- package/dist/error-summary/index.d.ts +25 -0
- package/dist/error-summary/index.js +2 -0
- package/dist/fieldset/index.d.ts +21 -0
- package/dist/fieldset/index.js +2 -0
- package/dist/file-manager/index.d.ts +44 -0
- package/dist/file-manager/index.js +2 -0
- package/dist/file-upload/index.d.ts +52 -0
- package/dist/file-upload/index.js +2 -0
- package/dist/form/index.d.ts +43 -0
- package/dist/form/index.js +2 -0
- package/dist/form-builder/index.d.ts +32 -0
- package/dist/form-builder/index.js +2 -0
- package/dist/form-field/index.d.ts +37 -0
- package/dist/form-field/index.js +2 -0
- package/dist/forms/index.d.ts +9 -0
- package/dist/forms/index.js +2 -0
- package/dist/funnel-chart/index.d.ts +36 -0
- package/dist/funnel-chart/index.js +2 -0
- package/dist/gantt/index.d.ts +65 -0
- package/dist/gantt/index.js +2 -0
- package/dist/gauge/index.d.ts +28 -0
- package/dist/gauge/index.js +2 -0
- package/dist/heatmap/index.d.ts +40 -0
- package/dist/heatmap/index.js +2 -0
- package/dist/histogram/index.d.ts +42 -0
- package/dist/histogram/index.js +2 -0
- package/dist/hover-card/index.d.ts +30 -0
- package/dist/hover-card/index.js +2 -0
- package/dist/icon/index.d.ts +58 -0
- package/dist/icon/index.js +2 -0
- package/dist/image-viewer/index.d.ts +64 -0
- package/dist/image-viewer/index.js +2 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +2 -0
- package/dist/inline-message/index.d.ts +17 -0
- package/dist/inline-message/index.js +2 -0
- package/dist/internal/bridge.d.ts +214 -0
- package/dist/internal/bridge.js +2 -0
- package/dist/internal/config-keys.d.ts +2 -0
- package/dist/internal/config-keys.js +2 -0
- package/dist/internal/diagnostics.d.ts +26 -0
- package/dist/internal/diagnostics.js +2 -0
- package/dist/internal/form-errors.d.ts +17 -0
- package/dist/internal/form-errors.js +2 -0
- package/dist/internal/modal.d.ts +29 -0
- package/dist/internal/modal.js +2 -0
- package/dist/internal/overlay.d.ts +12 -0
- package/dist/internal/overlay.js +2 -0
- package/dist/internal/render.d.ts +19 -0
- package/dist/internal/render.js +2 -0
- package/dist/internal/server-dom.d.ts +11 -0
- package/dist/internal/server-dom.js +2 -0
- package/dist/internal/style-sheets.d.ts +57 -0
- package/dist/internal/style-sheets.js +2 -0
- package/dist/internal/styles.d.ts +17 -0
- package/dist/internal/styles.js +2 -0
- package/dist/kanban/index.d.ts +55 -0
- package/dist/kanban/index.js +2 -0
- package/dist/kbd/index.d.ts +16 -0
- package/dist/kbd/index.js +2 -0
- package/dist/layout/index.d.ts +39 -0
- package/dist/layout/index.js +2 -0
- package/dist/line-chart/index.d.ts +49 -0
- package/dist/line-chart/index.js +2 -0
- package/dist/masked-input/index.d.ts +50 -0
- package/dist/masked-input/index.js +2 -0
- package/dist/mention-input/index.d.ts +47 -0
- package/dist/mention-input/index.js +2 -0
- package/dist/menu/index.d.ts +30 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu-bar/index.d.ts +25 -0
- package/dist/menu-bar/index.js +2 -0
- package/dist/month-picker/index.d.ts +53 -0
- package/dist/month-picker/index.js +2 -0
- package/dist/multi-select/index.d.ts +59 -0
- package/dist/multi-select/index.js +2 -0
- package/dist/network-graph/index.d.ts +51 -0
- package/dist/network-graph/index.js +2 -0
- package/dist/number-input/index.d.ts +44 -0
- package/dist/number-input/index.js +2 -0
- package/dist/org-chart/index.d.ts +76 -0
- package/dist/org-chart/index.js +2 -0
- package/dist/otp-input/index.d.ts +49 -0
- package/dist/otp-input/index.js +2 -0
- package/dist/overlay/index.d.ts +66 -0
- package/dist/overlay/index.js +2 -0
- package/dist/pagination/index.d.ts +29 -0
- package/dist/pagination/index.js +2 -0
- package/dist/password-input/index.d.ts +51 -0
- package/dist/password-input/index.js +2 -0
- package/dist/password-strength-meter/index.d.ts +26 -0
- package/dist/password-strength-meter/index.js +2 -0
- package/dist/pie-chart/index.d.ts +39 -0
- package/dist/pie-chart/index.js +2 -0
- package/dist/pivot-field-list/index.d.ts +27 -0
- package/dist/pivot-field-list/index.js +2 -0
- package/dist/pivot-grid/index.d.ts +54 -0
- package/dist/pivot-grid/index.js +2 -0
- package/dist/popover/index.d.ts +38 -0
- package/dist/popover/index.js +2 -0
- package/dist/progress-bar/index.d.ts +23 -0
- package/dist/progress-bar/index.js +2 -0
- package/dist/prompt-input/index.d.ts +65 -0
- package/dist/prompt-input/index.js +2 -0
- package/dist/quarter-picker/index.d.ts +53 -0
- package/dist/quarter-picker/index.js +2 -0
- package/dist/radar-chart/index.d.ts +38 -0
- package/dist/radar-chart/index.js +2 -0
- package/dist/radio-group/index.d.ts +38 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/rating/index.d.ts +43 -0
- package/dist/rating/index.js +2 -0
- package/dist/recurrence-picker/index.d.ts +46 -0
- package/dist/recurrence-picker/index.js +2 -0
- package/dist/rich-text-editor/index.d.ts +75 -0
- package/dist/rich-text-editor/index.js +2 -0
- package/dist/router/index.d.ts +43 -0
- package/dist/router/index.js +2 -0
- package/dist/scatter-chart/index.d.ts +46 -0
- package/dist/scatter-chart/index.js +2 -0
- package/dist/schedule-picker/index.d.ts +44 -0
- package/dist/schedule-picker/index.js +2 -0
- package/dist/scheduler/index.d.ts +77 -0
- package/dist/scheduler/index.js +2 -0
- package/dist/schema-form/index.d.ts +39 -0
- package/dist/schema-form/index.js +2 -0
- package/dist/scroll-area/index.d.ts +18 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/select/index.d.ts +54 -0
- package/dist/select/index.js +2 -0
- package/dist/services.d.ts +70 -0
- package/dist/services.js +2 -0
- package/dist/session-warning-dialog/index.d.ts +36 -0
- package/dist/session-warning-dialog/index.js +2 -0
- package/dist/sidebar/index.d.ts +38 -0
- package/dist/sidebar/index.js +2 -0
- package/dist/signature-pad/index.d.ts +51 -0
- package/dist/signature-pad/index.js +2 -0
- package/dist/skeleton/index.d.ts +17 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/slider/index.d.ts +39 -0
- package/dist/slider/index.js +2 -0
- package/dist/sortable-list/index.d.ts +22 -0
- package/dist/sortable-list/index.js +2 -0
- package/dist/sparkline/index.d.ts +25 -0
- package/dist/sparkline/index.js +2 -0
- package/dist/spinner/index.d.ts +18 -0
- package/dist/spinner/index.js +2 -0
- package/dist/splitter/index.d.ts +25 -0
- package/dist/splitter/index.js +2 -0
- package/dist/stat-card/index.d.ts +30 -0
- package/dist/stat-card/index.js +2 -0
- package/dist/stepper/index.d.ts +28 -0
- package/dist/stepper/index.js +2 -0
- package/dist/switch/index.d.ts +35 -0
- package/dist/switch/index.js +2 -0
- package/dist/tabs/index.d.ts +24 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tag-group/index.d.ts +26 -0
- package/dist/tag-group/index.js +2 -0
- package/dist/templates/index.d.ts +160 -0
- package/dist/templates/index.js +2 -0
- package/dist/testing/index.d.ts +411 -0
- package/dist/testing/index.js +2 -0
- package/dist/text-input/index.d.ts +51 -0
- package/dist/text-input/index.js +2 -0
- package/dist/textarea/index.d.ts +47 -0
- package/dist/textarea/index.js +2 -0
- package/dist/time-picker/index.d.ts +52 -0
- package/dist/time-picker/index.js +2 -0
- package/dist/timeline/index.d.ts +37 -0
- package/dist/timeline/index.js +2 -0
- package/dist/toast/index.d.ts +23 -0
- package/dist/toast/index.js +2 -0
- package/dist/toggle-group/index.d.ts +26 -0
- package/dist/toggle-group/index.js +2 -0
- package/dist/tooltip/index.d.ts +22 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tour/index.d.ts +39 -0
- package/dist/tour/index.js +2 -0
- package/dist/transfer-list/index.d.ts +44 -0
- package/dist/transfer-list/index.js +2 -0
- package/dist/tree-select/index.d.ts +56 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/tree-view/index.d.ts +68 -0
- package/dist/tree-view/index.js +2 -0
- package/dist/treemap/index.d.ts +43 -0
- package/dist/treemap/index.js +2 -0
- package/dist/typography/index.d.ts +40 -0
- package/dist/typography/index.js +2 -0
- package/dist/upload-queue/index.d.ts +44 -0
- package/dist/upload-queue/index.js +2 -0
- package/dist/validation-message/index.d.ts +20 -0
- package/dist/validation-message/index.js +2 -0
- package/dist/virtual-list/index.d.ts +42 -0
- package/dist/virtual-list/index.js +2 -0
- package/dist/waterfall-chart/index.d.ts +40 -0
- package/dist/waterfall-chart/index.js +2 -0
- package/dist/year-picker/index.d.ts +52 -0
- package/dist/year-picker/index.js +2 -0
- package/package.json +586 -4
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { type ModelSignal, type OutputEmitterRef, type Signal, type TemplateRef } from '@angular/core';
|
|
2
|
+
import { type ControlValueAccessor, type ValidationErrors, type Validator } from '@angular/forms';
|
|
3
|
+
/** Minimal controller shape shared by every AbsoluteUI component. */
|
|
4
|
+
export interface Controller<O> {
|
|
5
|
+
update(options: Partial<O>): void;
|
|
6
|
+
destroy(): void;
|
|
7
|
+
}
|
|
8
|
+
/** Validity shape exposed by AbsoluteUI form controls. */
|
|
9
|
+
export interface ControlValidityLike {
|
|
10
|
+
readonly valid: boolean;
|
|
11
|
+
readonly error?: string | null;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Drop `undefined` entries so unset Angular inputs never override configuration
|
|
16
|
+
* (SPEC section 6.3) and satisfy `exactOptionalPropertyTypes`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function defined<T extends object>(values: {
|
|
19
|
+
[K in keyof T]-?: T[K] | undefined;
|
|
20
|
+
}): T;
|
|
21
|
+
/** Boolean input transform: a bare attribute means true; unset stays unset (configuration applies). */
|
|
22
|
+
export declare function booleanInput(value: unknown): boolean | undefined;
|
|
23
|
+
/** Read `detail` from an AbsoluteUI CustomEvent (the one DOM typing boundary). */
|
|
24
|
+
export declare function detailOf(event: Event): unknown;
|
|
25
|
+
/** Forward an event detail to an output (payload shapes are the documented component contracts). */
|
|
26
|
+
export declare function emitTo<T>(ref: OutputEmitterRef<T>): (detail: unknown) => void;
|
|
27
|
+
/** The parts of a Data Table column the template helpers use. */
|
|
28
|
+
export interface TableColumnLike {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly header: string;
|
|
31
|
+
readonly render?: ((row: never, doc: Document) => Node | string) | undefined;
|
|
32
|
+
readonly renderHeader?: ((column: never, doc: Document) => Node) | undefined;
|
|
33
|
+
readonly renderEditor?: ((context: never, doc: Document) => Node) | undefined;
|
|
34
|
+
}
|
|
35
|
+
/** The editor context the table passes to `renderEditor`. */
|
|
36
|
+
export interface EditorContextLike {
|
|
37
|
+
readonly row: unknown;
|
|
38
|
+
readonly column: string;
|
|
39
|
+
readonly value: unknown;
|
|
40
|
+
readonly error: string | null;
|
|
41
|
+
commit(value: unknown): void;
|
|
42
|
+
cancel(): void;
|
|
43
|
+
}
|
|
44
|
+
/** Context the `auiEditor` template receives. */
|
|
45
|
+
export interface EditorTemplateContext {
|
|
46
|
+
readonly $implicit: unknown;
|
|
47
|
+
readonly value: unknown;
|
|
48
|
+
readonly row: unknown;
|
|
49
|
+
readonly column: string;
|
|
50
|
+
readonly error: string | null;
|
|
51
|
+
readonly commit: (value: unknown) => void;
|
|
52
|
+
readonly cancel: () => void;
|
|
53
|
+
}
|
|
54
|
+
/** A template directive bound to a column id (`auiCell`, `auiHeader`). */
|
|
55
|
+
export interface SlotTemplateLike<Ctx> {
|
|
56
|
+
column(): string;
|
|
57
|
+
readonly template: TemplateRef<Ctx>;
|
|
58
|
+
/** The array bound with `[auiCellOf]` (typing only), when the directive has one. */
|
|
59
|
+
of?(): readonly unknown[] | null | undefined;
|
|
60
|
+
}
|
|
61
|
+
/** An `<aui-column>` child. */
|
|
62
|
+
export interface DeclaredColumnLike {
|
|
63
|
+
definition(): unknown;
|
|
64
|
+
cellTemplate(): {
|
|
65
|
+
readonly template: TemplateRef<{
|
|
66
|
+
$implicit: unknown;
|
|
67
|
+
row: unknown;
|
|
68
|
+
column: string;
|
|
69
|
+
}>;
|
|
70
|
+
} | undefined;
|
|
71
|
+
headerTemplate(): {
|
|
72
|
+
readonly template: TemplateRef<{
|
|
73
|
+
$implicit: string;
|
|
74
|
+
column: string;
|
|
75
|
+
header: string;
|
|
76
|
+
}>;
|
|
77
|
+
} | undefined;
|
|
78
|
+
editorTemplate(): {
|
|
79
|
+
readonly template: TemplateRef<EditorTemplateContext>;
|
|
80
|
+
} | undefined;
|
|
81
|
+
}
|
|
82
|
+
export interface BridgeConfig<C extends Controller<O>, O> {
|
|
83
|
+
create: (host: HTMLElement, options: O) => C;
|
|
84
|
+
/** Bound inputs and models (undefined entries removed). */
|
|
85
|
+
options: () => O;
|
|
86
|
+
/** Component configuration name (api.json `configKey`): scope settings are merged under the inputs. */
|
|
87
|
+
configKey?: string;
|
|
88
|
+
/** DOM event name -> handler. Only events dispatched on `eventTarget` are forwarded. */
|
|
89
|
+
events?: Readonly<Record<string, (detail: unknown) => void>>;
|
|
90
|
+
/** Element the controller dispatches its events on. Default: the host. */
|
|
91
|
+
eventTarget?: (controller: C, host: HTMLElement) => EventTarget;
|
|
92
|
+
/** Called once after creation in the browser. */
|
|
93
|
+
created?: (controller: C) => void;
|
|
94
|
+
/** Called once after a server render (D3): state that only browser hooks apply otherwise. */
|
|
95
|
+
serverCreated?: (controller: C) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Host attributes removed after creation: a static binding such as `title="..."`
|
|
98
|
+
* also leaves a native attribute (tooltip, role) on the host that must not leak.
|
|
99
|
+
*/
|
|
100
|
+
strip?: readonly string[];
|
|
101
|
+
}
|
|
102
|
+
/** @internal Rewrites effective options before they reach the controller (companion directives such as auiRouterNav). */
|
|
103
|
+
export type OptionsTransform = (options: Readonly<Record<string, unknown>>) => Record<string, unknown>;
|
|
104
|
+
/** @internal The controller of an AbsoluteUI component (null before the first browser render). For companion directives only. */
|
|
105
|
+
export declare function controllerOf<C extends Controller<O>, O>(bridge: ComponentBridge<C, O>): Signal<C | null>;
|
|
106
|
+
/**
|
|
107
|
+
* @internal Install an options transform on the component of `host` (one per component; call it
|
|
108
|
+
* from a companion directive's constructor so creation already sees it). The transform may
|
|
109
|
+
* read signals; options are re-sent when they change. False when `host` has no component.
|
|
110
|
+
*/
|
|
111
|
+
export declare function transformOptionsOf(host: HTMLElement, transform: OptionsTransform): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Base class for AbsoluteUI components. Subclasses declare signal inputs, models,
|
|
114
|
+
* and outputs and pass a `BridgeConfig` to `init()` from their constructor.
|
|
115
|
+
*/
|
|
116
|
+
export declare abstract class ComponentBridge<C extends Controller<O>, O> {
|
|
117
|
+
#private;
|
|
118
|
+
protected readonly host: HTMLElement;
|
|
119
|
+
/** The controller, available after the first browser render. */
|
|
120
|
+
protected get controller(): C | null;
|
|
121
|
+
protected init(config: BridgeConfig<C, O>): void;
|
|
122
|
+
/**
|
|
123
|
+
* A render hook backed by an Angular template (D8), or undefined without a template.
|
|
124
|
+
* The same function is returned for the same template, so options stay unchanged.
|
|
125
|
+
*/
|
|
126
|
+
protected templateHook<A extends unknown[], C>(template: TemplateRef<C> | undefined, context: (...args: A) => C): ((...args: A) => Node) | undefined;
|
|
127
|
+
/** The default projected content as one node, or undefined when nothing (but whitespace) is projected. */
|
|
128
|
+
protected projectedContent(template: TemplateRef<unknown> | undefined): Node | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Data Table columns (M5): the bound `columns`, or the `<aui-column>` children. A column's
|
|
131
|
+
* own `auiCell`/`auiHeader` template (or a table-level one matching its id) renders its
|
|
132
|
+
* cells/header unless the column has `render`/`renderHeader` of its own.
|
|
133
|
+
*/
|
|
134
|
+
protected tableColumns<C extends TableColumnLike>(bound: readonly C[] | undefined, declared: readonly DeclaredColumnLike[], cells: readonly SlotTemplateLike<{
|
|
135
|
+
$implicit: unknown;
|
|
136
|
+
row: unknown;
|
|
137
|
+
column: string;
|
|
138
|
+
}>[], headers: readonly SlotTemplateLike<{
|
|
139
|
+
$implicit: string;
|
|
140
|
+
column: string;
|
|
141
|
+
header: string;
|
|
142
|
+
}>[], editors?: readonly SlotTemplateLike<EditorTemplateContext>[], rows?: () => readonly unknown[] | undefined): readonly C[];
|
|
143
|
+
/**
|
|
144
|
+
* A read-only signal of component state (D25), read from the controller after creation,
|
|
145
|
+
* after every component event, after option updates, and after typed methods; `initial`
|
|
146
|
+
* before the component exists (and on the server until it renders).
|
|
147
|
+
*/
|
|
148
|
+
protected stateSignal<T>(read: (controller: C) => T, initial: T): Signal<T>;
|
|
149
|
+
/**
|
|
150
|
+
* Keep a model in line with the component when a typed method changes the state without
|
|
151
|
+
* an event (D26): after the method, the model takes the component's value.
|
|
152
|
+
*/
|
|
153
|
+
protected trackModel<T>(model: ModelSignal<T | undefined>, option: string, read: (controller: C) => T | null | undefined): void;
|
|
154
|
+
/** Re-read state signals (and, after a typed method, models) from the component. */
|
|
155
|
+
protected afterChange(models?: boolean): void;
|
|
156
|
+
/**
|
|
157
|
+
* Update a model from a component event. The value is recorded as applied, so the
|
|
158
|
+
* resulting input change is not sent back to the component (it already has it).
|
|
159
|
+
*/
|
|
160
|
+
protected syncModel<T>(model: ModelSignal<T>, option: string, value: T): void;
|
|
161
|
+
/** Hook for subclasses after options were applied to an existing controller. */
|
|
162
|
+
protected optionsApplied(): void;
|
|
163
|
+
}
|
|
164
|
+
export interface ValueAdapter<C, V> {
|
|
165
|
+
read: (controller: C) => V;
|
|
166
|
+
write: (controller: C, value: V | null) => void;
|
|
167
|
+
/** DOM event that signals a user value change (propagated to the model and the Angular form). */
|
|
168
|
+
event: string;
|
|
169
|
+
validity: (controller: C) => ControlValidityLike;
|
|
170
|
+
/** The value model (`value`, or `checked` for Checkbox and Switch). */
|
|
171
|
+
model: ModelSignal<V | undefined>;
|
|
172
|
+
/** Clear touched/submitted state and messages in the component (form reset). */
|
|
173
|
+
reset?: (controller: C) => void;
|
|
174
|
+
/** Show the component's messages now (form submitted, or touched by the application). */
|
|
175
|
+
report?: (controller: C) => void;
|
|
176
|
+
/** Show an external error message in the component, or clear it with null. */
|
|
177
|
+
customError?: (controller: C, message: string | null) => void;
|
|
178
|
+
}
|
|
179
|
+
/** Angular form state of a control, as signals (all false without a form binding). */
|
|
180
|
+
export interface AuiControlState {
|
|
181
|
+
readonly touched: Signal<boolean>;
|
|
182
|
+
readonly dirty: Signal<boolean>;
|
|
183
|
+
/** An async validator is running. */
|
|
184
|
+
readonly pending: Signal<boolean>;
|
|
185
|
+
/** The enclosing form was submitted (until it is reset). */
|
|
186
|
+
readonly submitted: Signal<boolean>;
|
|
187
|
+
/** Invalid and touched or submitted: the state in which errors are shown. */
|
|
188
|
+
readonly errorState: Signal<boolean>;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Base class for form controls (docs/PLAN-R9-ANGULAR.md M2): a ControlValueAccessor and
|
|
192
|
+
* Validator backed by the component's own value and validity (Angular forms see exactly
|
|
193
|
+
* what the user sees), plus a value model for `[(value)]` without forms. Use one of the
|
|
194
|
+
* two per control. With a form binding, the component also follows the form: submission
|
|
195
|
+
* and `markAllAsTouched()` show messages, reset clears them, `Validators.required` marks
|
|
196
|
+
* the field required, and errors of Angular validators are shown in the component.
|
|
197
|
+
*/
|
|
198
|
+
export declare abstract class ControlBridge<C extends Controller<O>, O, V> extends ComponentBridge<C, O> implements ControlValueAccessor, Validator {
|
|
199
|
+
#private;
|
|
200
|
+
/** Disabled by the Angular form; subclasses OR it into the `disabled` option. */
|
|
201
|
+
protected readonly formDisabled: import("@angular/core").WritableSignal<boolean>;
|
|
202
|
+
/** `Validators.required` (or `requiredTrue`) on the bound control; subclasses OR it into `required`. */
|
|
203
|
+
protected readonly formRequired: import("@angular/core").WritableSignal<boolean>;
|
|
204
|
+
/** Angular form state of this control. */
|
|
205
|
+
readonly formState: AuiControlState;
|
|
206
|
+
protected initControl(config: BridgeConfig<C, O>, adapter: ValueAdapter<C, V>): void;
|
|
207
|
+
protected optionsApplied(): void;
|
|
208
|
+
writeValue(value: V | null): void;
|
|
209
|
+
registerOnChange(fn: (value: V) => void): void;
|
|
210
|
+
registerOnTouched(fn: () => void): void;
|
|
211
|
+
setDisabledState(disabled: boolean): void;
|
|
212
|
+
validate(): ValidationErrors | null;
|
|
213
|
+
registerOnValidatorChange(fn: () => void): void;
|
|
214
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
import{isPlatformBrowser as $}from"@angular/common";import{afterNextRender as x,ApplicationRef as R,booleanAttribute as U,computed as D,DestroyRef as N,effect as A,ElementRef as q,inject as p,Injector as T,PLATFORM_ID as B,signal as m,untracked as c,ViewContainerRef as O}from"@angular/core";import{FormGroupDirective as G,FormResetEvent as P,FormSubmittedEvent as W,NgControl as S,NgForm as z,TouchedChangeEvent as K,Validators as L}from"@angular/forms";import{AuiConfig as X}from"../config.js";import{AuiLocale as J}from"../services.js";import{AUI_FORM_ERRORS as Q,errorMessage as Y}from"./form-errors.js";import{createTemplateView as Z,renderTemplateNode as ee,TemplateStyles as _}from"./render.js";import{completeServerDom as te}from"./server-dom.js";import{devWarn as w}from"./diagnostics.js";import{AuiStyleLoader as j}from"./styles.js";function be(l){const e={};for(const[t,s]of Object.entries(l))s!==void 0&&(e[t]=s);return e}function ye(l){return l===void 0?void 0:U(l)}function se(l){return l.detail}function Ae(l){return e=>{l.emit(e)}}const M="data-aui-ssr";function oe(l){const e=l.getAttribute(M);if(e===null)return;const[t="",s=""]=e.split("|");for(const o of t.split(" "))o&&l.removeAttribute(o);for(const o of s.split(" "))o&&l.classList.remove(o);l.classList.length===0&&l.removeAttribute("class"),l.removeAttribute(M),l.replaceChildren()}function re(l,e,t,s){const o=new Set(e.map(n=>n.id)),r=s?c(s):void 0;for(const n of t){const i=c(()=>n.column());i!==""&&!o.has(i)&&w("AUI_NG_TEMPLATE_COLUMN",l,'a column template names column "'.concat(i,'", which the table does not have (template ignored).'));const a=n.of?c(()=>n.of?.()):void 0;a&&r&&a!==r&&w("AUI_NG_TEMPLATE_OF",l,"a template's [auiCellOf] is bound to a different array than [rows]; it only types the template, so bind the same array.")}}function k(l,e){return Object.is(l,e)?!0:!Array.isArray(l)||!Array.isArray(e)||l.length!==e.length?!1:l.every((t,s)=>Object.is(t,e[s]))}function ne(l,e){let t=null;for(const[s,o]of Object.entries(e))Object.is(l[s],o)||((t??={})[s]=o);return t}let V,F;function we(l){return V(l)}const H=new WeakMap;function Ce(l,e){const t=H.get(l);return t?(F(t,e),!0):!1}class ie{static{V=e=>e.#e.asReadonly(),F=(e,t)=>{e.#t.set(t)}}host=p(q).nativeElement;#e=m(null,...ngDevMode?[{debugName:"#controller"}]:[]);#t=m(null,...ngDevMode?[{debugName:"#transform"}]:[]);#s=p(X);#h=p(N);#o=p(T);#i=$(p(B));#l=new WeakMap;#f=!1;#n={};#r=[];#a=[];get controller(){return this.#e()}init(e){H.set(this.host,this);const t=D(()=>{const s={...this.#s.optionsFor(e.configKey),...e.options()},o=this.#t();return o?o(s):s},...ngDevMode?[{debugName:"effective"}]:[]);if(A(()=>{const s=t();c(()=>{const o=this.#e();if(!o)return;const r=ne(this.#n,s);this.#n=s,r&&(o.update(r),this.optionsApplied(),this.afterChange())})}),!this.#i&&this.host.hasAttribute("ngSkipHydration")){let s=!1;A(()=>{const o=t();s||(s=!0,c(()=>{this.#d(e,o)}))})}x(()=>{oe(this.host);const s=c(t),o=e.create(this.host,s);this.#n=s,this.#e.set(o);const r=e.eventTarget?.(o,this.host)??this.host,n=Object.entries(e.events??{}).map(([i,a])=>[i,d=>{d.target===r&&!this.#f&&(a(se(d)),this.afterChange())}]);for(const[i,a]of n)r.addEventListener(i,a);this.#h.onDestroy(()=>{for(const[i,a]of n)r.removeEventListener(i,a)});for(const i of e.strip??[])this.host.removeAttribute(i);e.created?.(o),this.afterChange()}),this.#h.onDestroy(()=>{this.#f=!0,this.#e()?.destroy(),this.#e.set(null)})}#d(e,t){const s=this.host,o=new Set(s.getAttributeNames()),r=new Set(Array.from(s.classList));let n;try{te(s.ownerDocument),n=e.create(s,t)}catch(d){for(const f of s.getAttributeNames())!o.has(f)&&f!=="class"&&s.removeAttribute(f);for(const f of Array.from(s.classList))r.has(f)||s.classList.remove(f);s.replaceChildren(),(typeof ngDevMode>"u"||ngDevMode)&&w("AUI_NG_SERVER_FALLBACK",s.localName,"renders in the browser only (server render failed: ".concat(d instanceof Error?"".concat(d.name,": ").concat(d.message):"unknown error",")."));return}for(const d of e.strip??[])s.removeAttribute(d);this.#n=t,this.#e.set(n),e.serverCreated?.(n),this.afterChange();const i=s.getAttributeNames().filter(d=>!o.has(d)&&d!=="class"),a=Array.from(s.classList).filter(d=>!r.has(d));s.setAttribute(M,"".concat(i.join(" "),"|").concat(a.join(" ")))}templateHook(e,t){if(!e)return;const s=this.#l.get(e);if(s)return s;this.#o.get(j).load(_);const o=this.#o.get(O),r=this.#i?null:this.#o.get(R),n=(...i)=>ee(o,e,t(...i),this.host.ownerDocument,r);return this.#l.set(e,n),n}#u=null;projectedContent(e){if(e){if(this.#u?.template!==e){this.#o.get(j).load(_);const t=Z(this.#o.get(O),e,void 0,this.#i?null:this.#o.get(R));t.detectChanges();const s=t.rootNodes,o=s.some(n=>n.nodeType!==Node.TEXT_NODE||(n.textContent??"").trim()!=="");let r;if(o){const n=this.host.ownerDocument.createElement("span");n.className="aui-template",n.append(...s),r=n}this.#u={template:e,node:r}}return this.#u.node}}tableColumns(e,t,s,o,r=[],n){const i=e??t.map(u=>u.definition());(typeof ngDevMode>"u"||ngDevMode)&&re(this.host.localName,i,[...s,...o,...r],n);const a=new Map,d=new Map,f=new Map;return e||t.forEach((u,C)=>{const g=i[C]?.id;if(g===void 0)return;const v=u.cellTemplate()?.template,b=u.headerTemplate()?.template;v&&a.set(g,v),b&&d.set(g,b);const y=u.editorTemplate()?.template;y&&f.set(g,y)}),s.length===0&&o.length===0&&r.length===0&&a.size===0&&d.size===0&&f.size===0?i:i.map(u=>{const C=a.get(u.id)??s.find(h=>h.column()===u.id)?.template,g=d.get(u.id)??o.find(h=>h.column()===u.id)?.template,v=u.render?void 0:this.templateHook(C,h=>({$implicit:h,row:h,column:u.id})),b=u.renderHeader?void 0:this.templateHook(g,()=>({$implicit:u.header,column:u.id,header:u.header})),y=f.get(u.id)??r.find(h=>h.column()===u.id)?.template,E=u.renderEditor?void 0:this.templateHook(y,h=>({$implicit:h.value,value:h.value,row:h.row,column:h.column,error:h.error,commit:I=>{h.commit(I)},cancel:()=>{h.cancel()}}));return!v&&!b&&!E?u:{...u,...v?{render:v}:{},...b?{renderHeader:b}:{},...E?{renderEditor:E}:{}}})}stateSignal(e,t){const s=m(t,{...ngDevMode?{debugName:"value"}:{},equal:k});return this.#r.push(o=>{s.set(e(o))}),s.asReadonly()}trackModel(e,t,s){this.#a.push(o=>{const r=s(o)??void 0;k(c(e),r)||this.syncModel(e,t,r)})}afterChange(e=!1){const t=c(()=>this.#e());!t||this.#f||c(()=>{for(const s of this.#r)s(t);if(e)for(const s of this.#a)s(t)})}syncModel(e,t,s){this.#n={...this.#n,[t]:s},e.set(s)}optionsApplied(){}}const le={};class Ee extends ie{#e=null;#t=null;#s=null;#h=()=>{};#o=()=>{};#i=()=>{};#l=p(T);#f=p(Q);#n=p(J);#r=null;#a=!1;#d=m(!1,...ngDevMode?[{debugName:"#touched"}]:[]);#u=m(!1,...ngDevMode?[{debugName:"#dirty"}]:[]);#m=m(!1,...ngDevMode?[{debugName:"#pendingState"}]:[]);#c=m(!1,...ngDevMode?[{debugName:"#submitted"}]:[]);#p=m(!1,...ngDevMode?[{debugName:"#invalid"}]:[]);formDisabled=m(!1,...ngDevMode?[{debugName:"formDisabled"}]:[]);formRequired=m(!1,...ngDevMode?[{debugName:"formRequired"}]:[]);formState={touched:this.#d.asReadonly(),dirty:this.#u.asReadonly(),pending:this.#m.asReadonly(),submitted:this.#c.asReadonly(),errorState:D(()=>this.#p()&&(this.#d()||this.#c()))};initControl(e,t){this.#e=t;const s=e.created,o=p(N);A(()=>{const r=t.model();c(()=>{if(r===void 0||this.#s&&Object.is(this.#s.value,r))return;const n=this.controller;n&&(this.#s={value:r},t.write(n,r))})}),A(()=>{this.#m()?this.host.setAttribute("aria-busy","true"):this.host.removeAttribute("aria-busy")}),this.init({...e,create:(r,n)=>{const i=e.create(r,n),a=c(t.model);return a!==void 0&&(t.write(i,a),this.#s={value:a}),i},events:{...e.events,[t.event]:r=>{const n=this.controller;if(n){const i=t.read(n);this.#s={value:i},this.#r=null,t.model.set(i),this.#h(i)}e.events?.[t.event]?.(r)}},serverCreated:r=>{this.#t&&t.write(r,this.#t.value)},created:r=>{this.#t&&(t.write(r,this.#t.value),this.#s=this.#t),this.#t=null;const n=i=>{const a=i.relatedTarget;a instanceof Node&&this.host.contains(a)||(this.#a=!0,this.#o(),this.#a=!1)};this.host.addEventListener("focusout",n),o.onDestroy(()=>{this.host.removeEventListener("focusout",n)}),this.#v(r,t,o),(typeof ngDevMode>"u"||ngDevMode)&&this.#l.get(S,null,{self:!0,optional:!0})!==null&&c(t.model)!==void 0&&w("AUI_NG_VALUE_WITH_FORM",this.host.localName,"has both a value binding and a form directive (formControl, formControlName, or ngModel); use one. The form directive wins."),s?.(r),this.#i()}})}#v(e,t,s){const o=this.#l.get(S,null,{self:!0,optional:!0})?.control??null;if(!o)return;const r=this.#l.get(G,null,{optional:!0})??this.#l.get(z,null,{optional:!0});let n=o.touched;const i=()=>{this.#d.set(o.touched),this.#u.set(o.dirty),this.#m.set(o.pending),this.#p.set(o.invalid),this.#c.set(r?.submitted??!1),this.formRequired.set(o.hasValidator(L.required)||o.hasValidator(L.requiredTrue)),this.#b(e,t,o.errors??le)},a=o.events.subscribe(f=>{f instanceof K&&o.touched!==n&&(o.touched&&!this.#a?t.report?.(e):o.touched||this.#g(e,t,o.value)),n=o.touched,i()}),d=r?.form.events.subscribe(f=>{if(f instanceof W)t.report?.(e);else if(f instanceof P)this.#g(e,t,o.value);else return;i()});s.onDestroy(()=>{a.unsubscribe(),d?.unsubscribe()}),i()}#g(e,t,s){t.reset&&(t.reset(e),this.#r=null,t.write(e,s),this.#s={value:s})}#b(e,t,s){if(!t.customError)return;const o=Object.fromEntries(Object.entries(s).filter(([d])=>d!=="aui")),r=this.#d()||this.#c(),n=t.validity(e),i=!n.valid&&!(n.error==="custom"&&n.message===this.#r),a=r&&!i?Y(o,this.#f,c(this.#n.locale)):null;a!==this.#r&&(this.#r=a,t.customError(e,a))}optionsApplied(){this.#i()}writeValue(e){const t=this.controller;t&&this.#e?(this.#e.write(t,e),this.#s={value:e}):this.#t={value:e}}registerOnChange(e){this.#h=e}registerOnTouched(e){this.#o=e}setDisabledState(e){this.formDisabled.set(e)}validate(){const e=this.controller;if(!e||!this.#e)return null;const t=this.#e.validity(e);return t.valid||t.error==="custom"&&t.message===this.#r?null:{aui:{error:t.error??"custom",message:t.message}}}registerOnValidatorChange(e){this.#i=e}}export{ie as ComponentBridge,Ee as ControlBridge,ye as booleanInput,we as controllerOf,be as defined,se as detailOf,Ae as emitTo,Ce as transformOptionsOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
const e=new Set(["accordion","alert","avatar","avatarGroup","badge","barChart","bottomSheet","boxPlot","breadcrumb","bulletChart","businessCalendar","button","buttonGroup","calendar","calendarHeatmap","candlestickChart","card","carousel","cascader","chat","checkbox","checkboxGroup","codeViewer","collapsible","colorPicker","comboChart","combobox","commandPalette","contextMenu","dashboard","dashboardGrid","dashboardWidget","dataGrid","dataTable","dateInput","datePicker","dateRangePicker","dateTimePicker","diagram","dialog","discussion","drawer","durationPicker","emptyState","errorSummary","fieldset","fileManager","fileUpload","form","formBuilder","formField","funnelChart","gantt","gauge","heatmap","histogram","hoverCard","imageViewer","inlineMessage","kanban","kbd","layout","lineChart","maskedInput","mentionInput","menu","menuBar","monthPicker","multiSelect","networkGraph","numberInput","orgChart","otpInput","pagination","passwordInput","passwordStrengthMeter","pieChart","pivotGrid","popover","progressBar","promptInput","quarterPicker","radarChart","radioGroup","rating","recurrencePicker","richTextEditor","scatterChart","schedulePicker","scheduler","schemaForm","scrollArea","select","sessionWarningDialog","sidebar","signaturePad","skeleton","slider","sortableList","sparkline","spinner","splitter","statCard","stepper","switch","tabs","tagGroup","textInput","textarea","timePicker","timeline","toast","toggleGroup","tooltip","tour","transferList","treeSelect","treeView","treemap","typography","uploadQueue","validationMessage","virtualList","waterfallChart","yearPicker"]);export{e as COMPONENT_CONFIG_KEYS};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development diagnostics (brief section 29, docs/PLAN-R9-ANGULAR.md D27). Call sites guard
|
|
3
|
+
* every call with `typeof ngDevMode === 'undefined' || ngDevMode` so production builds (where
|
|
4
|
+
* the Angular CLI defines `ngDevMode` as false) remove both the check and its strings.
|
|
5
|
+
* Messages name the component and the problem, never option or form values. Each code is
|
|
6
|
+
* reported once per component kind.
|
|
7
|
+
*/
|
|
8
|
+
/** Development diagnostic codes. */
|
|
9
|
+
export type DiagnosticCode =
|
|
10
|
+
/** `[(value)]` (or `[value]`) together with a form directive on one control. */
|
|
11
|
+
'AUI_NG_VALUE_WITH_FORM'
|
|
12
|
+
/** `auiRouterNav` while `value` is bound: the router owns the selection. */
|
|
13
|
+
| 'AUI_NG_ROUTER_VALUE'
|
|
14
|
+
/** A table-level column template whose column id matches no column. */
|
|
15
|
+
| 'AUI_NG_TEMPLATE_COLUMN'
|
|
16
|
+
/** `[auiCellOf]` (and similar) bound to a different array than the component's rows. */
|
|
17
|
+
| 'AUI_NG_TEMPLATE_OF'
|
|
18
|
+
/** A `components` configuration key that names no AbsoluteUI component. */
|
|
19
|
+
| 'AUI_NG_CONFIG_KEY'
|
|
20
|
+
/** A component could not render on the server and renders in the browser only. */
|
|
21
|
+
| 'AUI_NG_SERVER_FALLBACK';
|
|
22
|
+
/** True in development mode (also when Angular's flag is not defined, as in tests). */
|
|
23
|
+
export declare function devMode(): boolean;
|
|
24
|
+
export declare function devWarn(code: DiagnosticCode, component: string, message: string): void;
|
|
25
|
+
/** Test helper: forget what was reported. */
|
|
26
|
+
export declare function resetDiagnostics(): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
const e=new Set;function d(){return typeof ngDevMode>"u"||ngDevMode}function s(n,t,r){const o="".concat(n,"|").concat(t);e.has(o)||(e.add(o),console.warn("AbsoluteUI ".concat(n,": <").concat(t,"> ").concat(r)))}function i(){e.clear()}export{d as devMode,s as devWarn,i as resetDiagnostics};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messages for Angular validator errors shown inside AbsoluteUI form controls
|
|
3
|
+
* (docs/PLAN-R9-ANGULAR.md M2). English defaults are registered with the core i18n
|
|
4
|
+
* catalog (`angularForms`), so applications translate them like component messages;
|
|
5
|
+
* `provideAuiFormErrors` overrides individual keys.
|
|
6
|
+
*/
|
|
7
|
+
import { InjectionToken, type Provider } from '@angular/core';
|
|
8
|
+
/** Message per validator error key: text, or a function of the error value. */
|
|
9
|
+
export type AuiFormErrorMessages = Readonly<Record<string, string | ((error: unknown) => string)>>;
|
|
10
|
+
export declare const AUI_FORM_ERRORS: InjectionToken<Readonly<Record<string, string | ((error: unknown) => string)>>>;
|
|
11
|
+
/**
|
|
12
|
+
* Messages for your own validators (or overrides of the defaults):
|
|
13
|
+
* `provideAuiFormErrors({ forbiddenName: 'This name is taken.', minlength: (e) => ... })`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function provideAuiFormErrors(messages: AuiFormErrorMessages): Provider;
|
|
16
|
+
/** The message for the first error, or null. Error values are never logged. */
|
|
17
|
+
export declare function errorMessage(errors: Readonly<Record<string, unknown>>, custom: AuiFormErrorMessages, locale: string): string | null;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
import{InjectionToken as i}from"@angular/core";import{getMessage as o,registerMessages as s}from"@absoluteui/core";s("angularForms","en",{required:"This field is required.",email:"Enter a valid email address.",minlength:"Enter at least {requiredLength} characters.",maxlength:"Enter no more than {requiredLength} characters.",min:"Enter a value of at least {min}.",max:"Enter a value of at most {max}.",pattern:"Enter a value in the expected format.",invalid:"This value is not valid."});const u=new i("AUI_FORM_ERRORS",{factory:()=>({})});function d(t){return{provide:u,useValue:t}}const m=new Set(["required","email","minlength","maxlength","min","max","pattern"]);function f(t){const n={};if(t&&typeof t=="object")for(const[a,e]of Object.entries(t))(typeof e=="string"||typeof e=="number")&&(n[a]=e);return n}function p(t,n,a){const e=Object.keys(t)[0];if(e===void 0)return null;const r=n[e];return typeof r=="string"?r:typeof r=="function"?r(t[e]):o("angularForms",m.has(e)?e:"invalid",f(t[e]),a)}export{u as AUI_FORM_ERRORS,p as errorMessage,d as provideAuiFormErrors};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared glue for modal overlays (Dialog, Drawer, Bottom Sheet, Session Warning Dialog):
|
|
3
|
+
* `<aui-dialog title="..." [(open)]="confirming">...projected body...</aui-dialog>`.
|
|
4
|
+
* The component is created after the first render (browser only); the projected content
|
|
5
|
+
* is rendered as an embedded view and becomes the body; the `open` model drives
|
|
6
|
+
* open()/close() and follows user dismissals.
|
|
7
|
+
*/
|
|
8
|
+
import { type ModelSignal, type Signal, type TemplateRef } from '@angular/core';
|
|
9
|
+
export interface ModalController<O> {
|
|
10
|
+
readonly element: HTMLElement;
|
|
11
|
+
readonly isOpen: boolean;
|
|
12
|
+
open(): void;
|
|
13
|
+
close(returnValue?: string): void;
|
|
14
|
+
update(options: Partial<O>): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface ModalConfig<C extends ModalController<O>, O> {
|
|
18
|
+
create: (options: O & {
|
|
19
|
+
content: Node;
|
|
20
|
+
}, doc: Document) => C;
|
|
21
|
+
options: () => O;
|
|
22
|
+
configKey: string;
|
|
23
|
+
body: Signal<TemplateRef<unknown>>;
|
|
24
|
+
open: ModelSignal<boolean>;
|
|
25
|
+
events: Readonly<Record<string, (detail: unknown) => void>>;
|
|
26
|
+
}
|
|
27
|
+
export declare function bindModal<C extends ModalController<O>, O>(config: ModalConfig<C, O>): {
|
|
28
|
+
readonly controller: () => C | null;
|
|
29
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
import{afterNextRender as y,computed as D,DestroyRef as b,effect as w,inject as c,untracked as d,ViewContainerRef as O}from"@angular/core";import{AuiConfig as h}from"../config.js";import{detailOf as N}from"./bridge.js";import{renderTemplate as R}from"./overlay.js";function M(e){const i=c(O),m=c(h),p=D(()=>({...m.optionsFor(e.configKey),...e.options()}),...ngDevMode?[{debugName:"effective"}]:[]);let t=null,l=null,a=!1;return w(()=>{const o=p(),n=e.open();d(()=>{t&&(t.update(o),n&&!t.isOpen?t.open():!n&&t.isOpen&&t.close())})}),y(()=>{const o=i.element.nativeElement,n=o instanceof Node&&o.ownerDocument?o.ownerDocument:document;l=R(i,e.body(),n);const s=e.create({...d(p),content:l.fragment},n);t=s;const f={...e.events,"aui-open":r=>{e.open.set(!0),e.events["aui-open"]?.(r)},"aui-close":r=>{e.open.set(!1),e.events["aui-close"]?.(r)}};for(const[r,v]of Object.entries(f))s.element.addEventListener(r,u=>{u.target===s.element&&!a&&v(N(u))});d(e.open)&&s.open()}),c(b).onDestroy(()=>{a=!0,t?.destroy(),t=null,l?.view.destroy()}),{controller:()=>t}}export{M as bindModal};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template content for AbsoluteUI overlays. The template is rendered as an
|
|
3
|
+
* Angular embedded view (bindings and change detection keep working) and its
|
|
4
|
+
* root nodes are handed to the component as a DocumentFragment, the same
|
|
5
|
+
* technique the Angular CDK uses for portals.
|
|
6
|
+
*/
|
|
7
|
+
import type { EmbeddedViewRef, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
8
|
+
export interface RenderedTemplate {
|
|
9
|
+
readonly fragment: DocumentFragment;
|
|
10
|
+
readonly view: EmbeddedViewRef<unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare function renderTemplate(vcr: ViewContainerRef, template: TemplateRef<unknown>, doc: Document): RenderedTemplate;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
function d(n,o,r){const e=n.createEmbeddedView(o);e.detectChanges();const t=r.createDocumentFragment();for(const c of e.rootNodes)t.append(c);return{fragment:t,view:e}}export{d as renderTemplate};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Templates as render-slot nodes (docs/PLAN-R9-ANGULAR.md D8). A template is rendered
|
|
3
|
+
* as an embedded view in the owning component's view container (so it lives in the
|
|
4
|
+
* consumer's DI and change detection), its root nodes are wrapped in one element the
|
|
5
|
+
* component can hold, and the view is destroyed when the component releases the node.
|
|
6
|
+
* On the server (D3) the view is attached to the application instead: its nodes end up
|
|
7
|
+
* inside a host that skips hydration, so it must not be serialized as a view of the
|
|
8
|
+
* container (the browser would look for its nodes next to the host).
|
|
9
|
+
*/
|
|
10
|
+
import { type ApplicationRef, type EmbeddedViewRef, type TemplateRef, type ViewContainerRef } from '@angular/core';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
/** The wrapper does not take part in layout. */
|
|
13
|
+
export declare class TemplateStyles {
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TemplateStyles, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TemplateStyles, "aui-styles-template", never, {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
/** An embedded view in `vcr` in the browser; on the server (`app` given), attached to the application. */
|
|
18
|
+
export declare function createTemplateView<C>(vcr: ViewContainerRef, template: TemplateRef<C>, context: C, app: ApplicationRef | null): EmbeddedViewRef<C>;
|
|
19
|
+
export declare function renderTemplateNode<C>(vcr: ViewContainerRef, template: TemplateRef<C>, context: C, doc: Document, app?: ApplicationRef | null): HTMLElement;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
import{ChangeDetectionStrategy as l,Component as m,ViewEncapsulation as d}from"@angular/core";import{onNodeRelease as u}from"@absoluteui/core";import*as e from"@angular/core";class s{static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:s,deps:[],target:e.ɵɵFactoryTarget.Component});static ɵcmp=e.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"22.3.0",type:s,isStandalone:!0,selector:"aui-styles-template",ngImport:e,template:"",isInline:!0,styles:["@layer aui.base{.aui-template{display:contents}}"],changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:s,decorators:[{type:m,args:[{selector:"aui-styles-template",template:"",encapsulation:d.None,changeDetection:l.OnPush,styles:["@layer aui.base{.aui-template{display:contents}}"]}]}]});function y(i,t,n,a){if(!a)return i.createEmbeddedView(t,n);const o=t.createEmbeddedView(n);return a.attachView(o),o}function w(i,t,n,a,o=null){const r=y(i,t,n,o);r.detectChanges();const c=a.createElement("span");c.className="aui-template";for(const p of r.rootNodes)c.append(p);return u(c,()=>{r.destroyed||r.destroy()})}export{s as TemplateStyles,y as createTemplateView,w as renderTemplateNode};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server DOM completion (docs/PLAN-R9-ANGULAR.md M6, D3/D20). Angular renders on the server
|
|
3
|
+
* with a bundled DOM implementation that lacks a few standard members the components use.
|
|
4
|
+
* Before the first server render, the missing members are added to that implementation's
|
|
5
|
+
* prototypes with their standard behavior (layout and focus members are inert, as nothing is
|
|
6
|
+
* laid out on the server). Working members are never replaced (only missing ones and ones that
|
|
7
|
+
* throw "not implemented"), and the browser is never
|
|
8
|
+
* touched: this only runs from server-side code paths.
|
|
9
|
+
*/
|
|
10
|
+
/** Add the missing standard members to the DOM implementation behind `doc` (idempotent). */
|
|
11
|
+
export declare function completeServerDom(doc: Document): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
const m=new WeakSet;function a(t,r){let e=Object.getPrototypeOf(t);for(;e&&typeof e=="object";){if(Object.prototype.hasOwnProperty.call(e,r))return e;e=Object.getPrototypeOf(e)}return null}function f(t,r,e){!t||r in t||Object.defineProperty(t,r,{configurable:!0,...e})}function s(t,r,e){f(t,r,{writable:!0,value:e})}function b(t){try{return t(),!0}catch{return!1}}function g(t,r){return typeof r=="string"?t.createTextNode(r):r}const l=t=>"data-".concat(t.replace(/[A-Z]/g,r=>"-".concat(r.toLowerCase()))),w=t=>t.slice(5).replace(/-([a-z])/g,(r,e)=>e.toUpperCase());function v(t){const r={};return new Proxy(r,{get:(e,o)=>typeof o=="string"?t.getAttribute(l(o))??void 0:void 0,set:(e,o,h)=>typeof o!="string"?!1:(t.setAttribute(l(o),String(h)),!0),deleteProperty:(e,o)=>(typeof o=="string"&&t.removeAttribute(l(o)),!0),has:(e,o)=>typeof o=="string"&&t.hasAttribute(l(o)),ownKeys:()=>t.getAttributeNames().filter(e=>e.startsWith("data-")).map(w),getOwnPropertyDescriptor:(e,o)=>{if(!(typeof o!="string"||!t.hasAttribute(l(o))))return{configurable:!0,enumerable:!0,writable:!0,value:t.getAttribute(l(o))??""}}})}const d=new WeakMap;function O(t){const r=t.createElement("div"),e=a(r,"getAttribute");if(!e||m.has(e))return;m.add(e);const o=[e,a(t,"getElementById"),a(t.createDocumentFragment(),"querySelector")??Object.getPrototypeOf(t.createDocumentFragment())];for(const n of o)s(n,"append",function(...i){for(const u of i)this.appendChild(g(this.ownerDocument??t,u))}),s(n,"prepend",function(...i){const u=this.firstChild;for(const c of i)this.insertBefore(g(this.ownerDocument??t,c),u)}),s(n,"replaceChildren",function(...i){for(;this.firstChild;)this.removeChild(this.firstChild);for(const u of i)this.appendChild(g(this.ownerDocument??t,u))});const h=a(r,"appendChild");if(!b(()=>r.baseURI))for(const n of[e,a(t,"getElementById")])!n||Object.prototype.hasOwnProperty.call(n,"baseURI")||Object.defineProperty(n,"baseURI",{configurable:!0,get(){const i=this.ownerDocument??t,u=b(()=>i.documentURI)?i.documentURI:"about:blank",c=i.querySelector("base[href]")?.getAttribute("href");if(c==null)return u;try{return new URL(c,u).href}catch{return u}}});s(h,"getRootNode",function(){let n=this.parentNode??this;for(;n.parentNode;)n=n.parentNode;return n}),f(e,"dataset",{get(){return v(this)}}),f(e,"inert",{get(){return this.hasAttribute("inert")},set(n){this.toggleAttribute("inert",!!n)}}),s(e,"getBoundingClientRect",()=>({x:0,y:0,top:0,left:0,right:0,bottom:0,width:0,height:0,toJSON:()=>({})})),s(e,"scrollIntoView",()=>{}),s(e,"animate",()=>({cancel:()=>{},finish:()=>{},finished:Promise.resolve(),onfinish:null}));const p=a(t.createElement("input"),"value"),y=[p,a(t.createElement("textarea"),"value"),a(t.createElement("select"),"value"),a(t.createElement("button"),"type")];for(const n of y)s(n,"setCustomValidity",function(i){d.set(this,{message:i})}),f(n,"validationMessage",{get(){return d.get(this)?.message??""}}),f(n,"validity",{get(){const i=(d.get(this)?.message??"")!=="";return{valid:!i,customError:i,valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1}}}),s(n,"checkValidity",function(){return(d.get(this)?.message??"")===""}),s(n,"reportValidity",function(){return(d.get(this)?.message??"")===""}),f(n,"labels",{get(){return[]}});for(const n of[p,a(t.createElement("textarea"),"value")])s(n,"select",()=>{}),s(n,"setSelectionRange",()=>{}),f(n,"selectionStart",{get(){return this.value.length},set:()=>{}}),f(n,"selectionEnd",{get(){return this.value.length},set:()=>{}})}export{O as completeServerDom};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class ButtonStyles {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonStyles, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonStyles, "aui-styles-button", never, {}, {}, never, never, true, never>;
|
|
5
|
+
}
|
|
6
|
+
export declare class FormStyles {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormStyles, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormStyles, "aui-styles-form", never, {}, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
10
|
+
export declare class MenuStyles {
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuStyles, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuStyles, "aui-styles-menu", never, {}, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
14
|
+
export declare class ContextMenuStyles {
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuStyles, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ContextMenuStyles, "aui-styles-context-menu", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
18
|
+
export declare class TooltipStyles {
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipStyles, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TooltipStyles, "aui-styles-tooltip", never, {}, {}, never, never, true, never>;
|
|
21
|
+
}
|
|
22
|
+
export declare class PopoverStyles {
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PopoverStyles, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PopoverStyles, "aui-styles-popover", never, {}, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
26
|
+
export declare class HoverCardStyles {
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HoverCardStyles, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HoverCardStyles, "aui-styles-hover-card", never, {}, {}, never, never, true, never>;
|
|
29
|
+
}
|
|
30
|
+
export declare class LayoutStyles {
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutStyles, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LayoutStyles, "aui-styles-layout", never, {}, {}, never, never, true, never>;
|
|
33
|
+
}
|
|
34
|
+
export declare class ToastStyles {
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastStyles, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToastStyles, "aui-styles-toast", never, {}, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
export declare class DialogStyles {
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogStyles, never>;
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DialogStyles, "aui-styles-dialog", never, {}, {}, never, never, true, never>;
|
|
41
|
+
}
|
|
42
|
+
export declare class DrawerStyles {
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DrawerStyles, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DrawerStyles, "aui-styles-drawer", never, {}, {}, never, never, true, never>;
|
|
45
|
+
}
|
|
46
|
+
export declare class TypographyStyles {
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TypographyStyles, never>;
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TypographyStyles, "aui-styles-typography", never, {}, {}, never, never, true, never>;
|
|
49
|
+
}
|
|
50
|
+
export declare class FieldsetStyles {
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldsetStyles, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldsetStyles, "aui-styles-fieldset", never, {}, {}, never, never, true, never>;
|
|
53
|
+
}
|
|
54
|
+
export declare class ScrollAreaStyles {
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScrollAreaStyles, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ScrollAreaStyles, "aui-styles-scroll-area", never, {}, {}, never, never, true, never>;
|
|
57
|
+
}
|