@ngstarter-ui/components 22.2.3 → 22.2.5
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/ai/component-registry.json +97 -8
- package/content-editor/BLOCK_FORMAT.md +182 -0
- package/data-view/API.md +262 -0
- package/fesm2022/ngstarter-ui-components-button.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DZqyCrEK.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DZqyCrEK.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-Jbf8h2yz.mjs → ngstarter-ui-components-content-editor-callout-block-CyVPVMXi.mjs} +3 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-Jbf8h2yz.mjs.map → ngstarter-ui-components-content-editor-callout-block-CyVPVMXi.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BizHRPdC.mjs → ngstarter-ui-components-content-editor-code-block.component-Qzsc08aS.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BizHRPdC.mjs.map → ngstarter-ui-components-content-editor-code-block.component-Qzsc08aS.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BzoaJvai.mjs → ngstarter-ui-components-content-editor-embed-block-9EHRGpW_.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BzoaJvai.mjs.map → ngstarter-ui-components-content-editor-embed-block-9EHRGpW_.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs → ngstarter-ui-components-content-editor-gallery-block-CBuzrmSH.mjs} +16 -39
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-CBuzrmSH.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Cdq_Dcv2.mjs → ngstarter-ui-components-content-editor-grid-block-Sy67i4mg.mjs} +5 -6
- package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Cdq_Dcv2.mjs.map → ngstarter-ui-components-content-editor-grid-block-Sy67i4mg.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-CDSt4rXe.mjs → ngstarter-ui-components-content-editor-heading-block.component-CnDuIpxQ.mjs} +8 -5
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnDuIpxQ.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-CqbgVnDh.mjs +113 -0
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-CqbgVnDh.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs → ngstarter-ui-components-content-editor-list-block.component-CHJr_pFf.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs.map → ngstarter-ui-components-content-editor-list-block.component-CHJr_pFf.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs → ngstarter-ui-components-content-editor-nested-blocks-fPnU42nP.mjs} +4 -4
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-fPnU42nP.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-dGibIV4n.mjs} +2089 -1521
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-dGibIV4n.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-Dd0pQquG.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-CqU1XJTo.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-Dd0pQquG.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-CqU1XJTo.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CUxKoeb_.mjs → ngstarter-ui-components-content-editor-quote-block.component-fAUfABVY.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CUxKoeb_.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-fAUfABVY.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BTExrXy8.mjs → ngstarter-ui-components-content-editor-table-block.component-CqbnMNug.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BTExrXy8.mjs.map → ngstarter-ui-components-content-editor-table-block.component-CqbnMNug.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-B46YeMGQ.mjs → ngstarter-ui-components-content-editor-toggle-block-CHtnu1GQ.mjs} +3 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-B46YeMGQ.mjs.map → ngstarter-ui-components-content-editor-toggle-block-CHtnu1GQ.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +19 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-DKcWb54Z.mjs +134 -0
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-DKcWb54Z.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +46 -1
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +1011 -90
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +45 -19
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +58 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +17 -4
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sort.mjs +9 -2
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +10 -0
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_common.scss +2 -1
- package/styles/_tokens.scss +32 -1
- package/styles/themes/default.scss +1 -1
- package/types/ngstarter-ui-components-content-editor.d.ts +211 -11
- package/types/ngstarter-ui-components-core.d.ts +4 -1
- package/types/ngstarter-ui-components-data-view.d.ts +204 -11
- package/types/ngstarter-ui-components-datepicker.d.ts +3 -1
- package/types/ngstarter-ui-components-headless-editor.d.ts +6 -1
- package/types/ngstarter-ui-components-menu.d.ts +5 -1
- package/types/ngstarter-ui-components-sort.d.ts +1 -0
- package/types/ngstarter-ui-components-table.d.ts +2 -0
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs +0 -54
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs +0 -47
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CDSt4rXe.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-LfKZapgv.mjs +0 -169
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-LfKZapgv.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs +0 -29
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-hBR5AauH.mjs +0 -201
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-hBR5AauH.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import * as _ngstarter_ui_components_data_view from '@ngstarter-ui/components/data-view';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
import { InjectionToken, TemplateRef, OnInit, AfterViewInit, Injector, EnvironmentProviders } from '@angular/core';
|
|
3
4
|
import { TableDataSource, Table } from '@ngstarter-ui/components/table';
|
|
4
5
|
import { CheckboxChange } from '@ngstarter-ui/components/checkbox';
|
|
5
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
6
6
|
import { Paginator, PageEvent } from '@ngstarter-ui/components/paginator';
|
|
7
7
|
import { Sort, SortDirective, SortDirection } from '@ngstarter-ui/components/sort';
|
|
8
8
|
|
|
@@ -11,13 +11,22 @@ interface DataViewInterface<T = any> {
|
|
|
11
11
|
}
|
|
12
12
|
interface DataViewAPI<T = any> {
|
|
13
13
|
search(value: string): void;
|
|
14
|
-
selectAll(): void;
|
|
14
|
+
selectAll(scope?: DataViewSelectionScope): void;
|
|
15
15
|
unselectAll(): void;
|
|
16
16
|
selectOne(row: T): void;
|
|
17
17
|
isSelected(row: T): boolean;
|
|
18
18
|
hasSelected(): boolean;
|
|
19
19
|
refresh(): void;
|
|
20
20
|
getSnapshot(): DataViewState[];
|
|
21
|
+
getSelection(): DataViewSelectionState<T>;
|
|
22
|
+
setColumnFilter(field: string, filter: DataViewColumnFilter | null): void;
|
|
23
|
+
clearFilters(): void;
|
|
24
|
+
getState(): DataViewViewState;
|
|
25
|
+
setState(state: DataViewViewState): void;
|
|
26
|
+
saveView(name: string, id?: string): DataViewSavedView;
|
|
27
|
+
applyView(id: string | null): void;
|
|
28
|
+
renameView(id: string, name: string): void;
|
|
29
|
+
deleteView(id: string): void;
|
|
21
30
|
}
|
|
22
31
|
type DataViewColumnWidth = string | number;
|
|
23
32
|
interface DataViewColumnDef {
|
|
@@ -34,13 +43,26 @@ interface DataViewColumnDef {
|
|
|
34
43
|
sortable?: boolean;
|
|
35
44
|
resizable?: boolean;
|
|
36
45
|
withColumnSettings?: boolean;
|
|
46
|
+
filter?: DataViewColumnFilterConfig;
|
|
37
47
|
minWidth?: string | number;
|
|
38
48
|
maxWidth?: string | number;
|
|
39
49
|
params?: {
|
|
40
50
|
[prop: string]: any;
|
|
41
51
|
};
|
|
42
52
|
}
|
|
43
|
-
type
|
|
53
|
+
type DataViewRowId = string | number;
|
|
54
|
+
type DataViewSelectionScope = 'page' | 'filtered' | 'all';
|
|
55
|
+
interface DataViewSelectionState<T = unknown> {
|
|
56
|
+
scope: DataViewSelectionScope;
|
|
57
|
+
allMatching: boolean;
|
|
58
|
+
rowIds: DataViewRowId[];
|
|
59
|
+
excludedRowIds: DataViewRowId[];
|
|
60
|
+
/** Known selected records; a server-wide selection is represented by query + exclusions. */
|
|
61
|
+
rows: T[];
|
|
62
|
+
search: string;
|
|
63
|
+
columnFilters: DataViewFilterModel;
|
|
64
|
+
}
|
|
65
|
+
type DataViewRowSelectionEventSource = 'checkbox' | 'row' | 'keyboard';
|
|
44
66
|
interface DataViewRowSelectionEvent<T> {
|
|
45
67
|
source: DataViewRowSelectionEventSource;
|
|
46
68
|
checkboxChange?: CheckboxChange;
|
|
@@ -70,11 +92,16 @@ interface DataViewGetRowsParams {
|
|
|
70
92
|
sort: 'asc' | 'desc' | '';
|
|
71
93
|
}[];
|
|
72
94
|
filterModel: string;
|
|
95
|
+
columnFilters: DataViewFilterModel;
|
|
96
|
+
/** Aborted when a newer query replaces this one or the view is destroyed. */
|
|
97
|
+
signal: AbortSignal;
|
|
73
98
|
successCallback(rowsThisBlock: any[], lastRow?: number): void;
|
|
74
|
-
failCallback(): void;
|
|
99
|
+
failCallback(error?: unknown): void;
|
|
75
100
|
}
|
|
76
101
|
interface DataViewDatasource {
|
|
77
|
-
getItems(params: DataViewGetRowsParams): void
|
|
102
|
+
getItems(params: DataViewGetRowsParams): void | (() => void) | {
|
|
103
|
+
unsubscribe(): void;
|
|
104
|
+
};
|
|
78
105
|
}
|
|
79
106
|
type DataViewPinAlign = 'start' | 'end' | undefined;
|
|
80
107
|
interface DataViewState {
|
|
@@ -85,6 +112,73 @@ interface DataViewState {
|
|
|
85
112
|
pinAlign?: DataViewPinAlign;
|
|
86
113
|
}
|
|
87
114
|
declare const DATA_VIEW: InjectionToken<DataViewInterface<any>>;
|
|
115
|
+
type DataViewColumnFilter = {
|
|
116
|
+
type: 'text';
|
|
117
|
+
operator: 'contains' | 'equals' | 'startsWith' | 'endsWith' | 'notContains';
|
|
118
|
+
value: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'number';
|
|
121
|
+
operator: 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'between';
|
|
122
|
+
value?: number;
|
|
123
|
+
to?: number;
|
|
124
|
+
} | {
|
|
125
|
+
type: 'date';
|
|
126
|
+
from?: string;
|
|
127
|
+
to?: string;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'enum';
|
|
130
|
+
values: (string | number)[];
|
|
131
|
+
} | {
|
|
132
|
+
type: 'boolean';
|
|
133
|
+
value: boolean;
|
|
134
|
+
};
|
|
135
|
+
type DataViewFilterModel = Record<string, DataViewColumnFilter>;
|
|
136
|
+
interface DataViewColumnFilterConfig {
|
|
137
|
+
type: DataViewColumnFilter['type'];
|
|
138
|
+
options?: readonly {
|
|
139
|
+
label: string;
|
|
140
|
+
value: string | number;
|
|
141
|
+
}[];
|
|
142
|
+
}
|
|
143
|
+
interface DataViewViewState {
|
|
144
|
+
version: 1;
|
|
145
|
+
columns: DataViewState[];
|
|
146
|
+
sort: {
|
|
147
|
+
active: string;
|
|
148
|
+
direction: 'asc' | 'desc' | '';
|
|
149
|
+
};
|
|
150
|
+
search: string;
|
|
151
|
+
columnFilters: DataViewFilterModel;
|
|
152
|
+
pageSize: number;
|
|
153
|
+
}
|
|
154
|
+
interface DataViewSavedView {
|
|
155
|
+
id: string;
|
|
156
|
+
name: string;
|
|
157
|
+
state: DataViewViewState;
|
|
158
|
+
}
|
|
159
|
+
interface DataViewViewStorage {
|
|
160
|
+
getItem(key: string): string | null;
|
|
161
|
+
setItem(key: string, value: string): void;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Selection retains IDs across immutable reloads and can represent unloaded server records. */
|
|
165
|
+
declare class DataViewSelection<T> {
|
|
166
|
+
private key;
|
|
167
|
+
private records;
|
|
168
|
+
readonly excluded: Set<unknown>;
|
|
169
|
+
allMatching: boolean;
|
|
170
|
+
constructor(key: (row: T) => unknown);
|
|
171
|
+
get selected(): T[];
|
|
172
|
+
get keys(): unknown[];
|
|
173
|
+
hasValue(): boolean;
|
|
174
|
+
isSelected(row: T): boolean;
|
|
175
|
+
select(...rows: T[]): void;
|
|
176
|
+
selectRows(rows: readonly T[]): void;
|
|
177
|
+
deselect(...rows: T[]): void;
|
|
178
|
+
clear(): void;
|
|
179
|
+
selectMatching(rows: T[]): void;
|
|
180
|
+
reconcile(rows: T[], dropMissing: boolean): boolean;
|
|
181
|
+
}
|
|
88
182
|
|
|
89
183
|
declare class DataViewEmptyFilterResultsDirective {
|
|
90
184
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -109,6 +203,17 @@ declare class DataViewActionBar {
|
|
|
109
203
|
}
|
|
110
204
|
|
|
111
205
|
declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T> {
|
|
206
|
+
protected readonly gridId: string;
|
|
207
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
208
|
+
readonly rowActivated: _angular_core.OutputEmitterRef<T>;
|
|
209
|
+
protected activeCell: _angular_core.WritableSignal<{
|
|
210
|
+
row: number;
|
|
211
|
+
column: number;
|
|
212
|
+
}>;
|
|
213
|
+
private _selectionAnchor;
|
|
214
|
+
protected logicalColumns: _angular_core.Signal<string[]>;
|
|
215
|
+
protected activeCellId: _angular_core.Signal<string | null>;
|
|
216
|
+
protected ariaRowCount: _angular_core.Signal<number>;
|
|
112
217
|
private _cdr;
|
|
113
218
|
private _destroyRef;
|
|
114
219
|
private _platformId;
|
|
@@ -120,12 +225,39 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
120
225
|
private _isDestroyed;
|
|
121
226
|
private _requestId;
|
|
122
227
|
private _lastRequestKey;
|
|
228
|
+
private _lastDatasource;
|
|
229
|
+
private _lastRowModelType;
|
|
230
|
+
private _pendingRequestCleanup;
|
|
123
231
|
private _refreshTrigger;
|
|
124
232
|
private _serverSideRowCount;
|
|
233
|
+
private _serverCountKnown;
|
|
125
234
|
private _manualOrder;
|
|
126
235
|
private _manualVisibility;
|
|
127
236
|
private _hasDataOnServer;
|
|
128
237
|
private _internalLoading;
|
|
238
|
+
readonly error: _angular_core.WritableSignal<string | null>;
|
|
239
|
+
readonly refreshing: _angular_core.Signal<boolean>;
|
|
240
|
+
readonly loadStatus: _angular_core.Signal<"error" | "refreshing" | "loading" | "ready" | "idle">;
|
|
241
|
+
readonly loadError: _angular_core.OutputEmitterRef<unknown>;
|
|
242
|
+
protected blockingLoading: _angular_core.Signal<boolean>;
|
|
243
|
+
sortState: _angular_core.ModelSignal<Sort>;
|
|
244
|
+
columnFilters: _angular_core.ModelSignal<DataViewFilterModel>;
|
|
245
|
+
withSavedViews: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
246
|
+
savedViews: _angular_core.ModelSignal<DataViewSavedView[]>;
|
|
247
|
+
viewStorageKey: _angular_core.InputSignal<string | null>;
|
|
248
|
+
private _activeViewId;
|
|
249
|
+
readonly activeViewId: _angular_core.Signal<string | null>;
|
|
250
|
+
readonly viewStorageError: _angular_core.WritableSignal<string | null>;
|
|
251
|
+
readonly stateChanged: _angular_core.OutputEmitterRef<DataViewViewState>;
|
|
252
|
+
readonly viewApplied: _angular_core.OutputEmitterRef<DataViewSavedView | null>;
|
|
253
|
+
private _initialFullState;
|
|
254
|
+
private _storageReady;
|
|
255
|
+
protected dirtyView: _angular_core.Signal<boolean>;
|
|
256
|
+
protected normalizedFilters: _angular_core.Signal<DataViewFilterModel>;
|
|
257
|
+
protected activeFilters: _angular_core.Signal<{
|
|
258
|
+
field: string;
|
|
259
|
+
label: string;
|
|
260
|
+
}[]>;
|
|
129
261
|
protected _isFiltering: _angular_core.WritableSignal<boolean>;
|
|
130
262
|
protected _isSorting: _angular_core.WritableSignal<boolean>;
|
|
131
263
|
private _emptyDataRef;
|
|
@@ -166,6 +298,8 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
166
298
|
withColumnSettings: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
167
299
|
embedded: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
168
300
|
rowSelection: _angular_core.InputSignal<"single" | "multiple">;
|
|
301
|
+
getRowId: _angular_core.InputSignal<((row: T) => DataViewRowId) | null>;
|
|
302
|
+
selectionScope: _angular_core.InputSignal<DataViewSelectionScope>;
|
|
169
303
|
allowSingleRowSelectionByClick: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
170
304
|
selectionWidth: _angular_core.InputSignalWithTransform<number, any>;
|
|
171
305
|
minColumnWidth: _angular_core.InputSignalWithTransform<number, any>;
|
|
@@ -202,6 +336,7 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
202
336
|
sortable?: boolean;
|
|
203
337
|
resizable?: boolean;
|
|
204
338
|
withColumnSettings?: boolean;
|
|
339
|
+
filter?: _ngstarter_ui_components_data_view.DataViewColumnFilterConfig;
|
|
205
340
|
minWidth?: string | number;
|
|
206
341
|
maxWidth?: string | number;
|
|
207
342
|
params?: {
|
|
@@ -223,6 +358,7 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
223
358
|
sortable?: boolean;
|
|
224
359
|
resizable?: boolean;
|
|
225
360
|
withColumnSettings?: boolean;
|
|
361
|
+
filter?: _ngstarter_ui_components_data_view.DataViewColumnFilterConfig;
|
|
226
362
|
minWidth?: string | number;
|
|
227
363
|
maxWidth?: string | number;
|
|
228
364
|
params?: {
|
|
@@ -243,6 +379,7 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
243
379
|
sortable?: boolean;
|
|
244
380
|
resizable?: boolean;
|
|
245
381
|
withColumnSettings?: boolean;
|
|
382
|
+
filter?: _ngstarter_ui_components_data_view.DataViewColumnFilterConfig;
|
|
246
383
|
minWidth?: string | number;
|
|
247
384
|
maxWidth?: string | number;
|
|
248
385
|
params?: {
|
|
@@ -263,6 +400,7 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
263
400
|
sortable?: boolean;
|
|
264
401
|
resizable?: boolean;
|
|
265
402
|
withColumnSettings?: boolean;
|
|
403
|
+
filter?: _ngstarter_ui_components_data_view.DataViewColumnFilterConfig;
|
|
266
404
|
minWidth?: string | number;
|
|
267
405
|
maxWidth?: string | number;
|
|
268
406
|
params?: {
|
|
@@ -290,6 +428,7 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
290
428
|
}>;
|
|
291
429
|
protected visibleRows: _angular_core.Signal<{
|
|
292
430
|
item: T;
|
|
431
|
+
key: DataViewRowId | T;
|
|
293
432
|
index: number;
|
|
294
433
|
top: number;
|
|
295
434
|
isLast: boolean;
|
|
@@ -305,7 +444,7 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
305
444
|
cellRenderers: _angular_core.InputSignal<DataViewCellRendererDef[]>;
|
|
306
445
|
loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
307
446
|
hoverRows: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
308
|
-
search: _angular_core.
|
|
447
|
+
search: _angular_core.ModelSignal<string>;
|
|
309
448
|
private _debouncedSearch;
|
|
310
449
|
private _debounceSearchEffect;
|
|
311
450
|
emptyIcon: _angular_core.InputSignal<string>;
|
|
@@ -316,11 +455,16 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
316
455
|
protected _isLoading: _angular_core.Signal<boolean>;
|
|
317
456
|
protected shouldRenderGrid: _angular_core.Signal<boolean>;
|
|
318
457
|
protected injector: Injector;
|
|
319
|
-
protected selection:
|
|
458
|
+
protected selection: DataViewSelection<T>;
|
|
459
|
+
private _selectionTick;
|
|
460
|
+
private _selectedScope;
|
|
461
|
+
private _selectedSearch;
|
|
462
|
+
private _selectedFilters;
|
|
320
463
|
protected cellRenderersMap: Map<string, any>;
|
|
321
464
|
protected loadingCellRenderers: _angular_core.WritableSignal<boolean>;
|
|
322
465
|
readonly rowSelectionChanged: _angular_core.OutputEmitterRef<DataViewRowSelectionEvent<T>>;
|
|
323
466
|
readonly selectionChanged: _angular_core.OutputEmitterRef<T[]>;
|
|
467
|
+
readonly selectionStateChanged: _angular_core.OutputEmitterRef<DataViewSelectionState<T>>;
|
|
324
468
|
readonly allRowsSelectionChanged: _angular_core.OutputEmitterRef<boolean>;
|
|
325
469
|
readonly sortChange: _angular_core.OutputEmitterRef<Sort>;
|
|
326
470
|
readonly loadEnd: _angular_core.OutputEmitterRef<void>;
|
|
@@ -349,11 +493,15 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
349
493
|
hasCellRenderer(cellRenderer: string): boolean;
|
|
350
494
|
getCellRenderer(cellRenderer: string): any;
|
|
351
495
|
isAllSelected(): boolean;
|
|
496
|
+
protected isPartiallySelected(): boolean;
|
|
352
497
|
toggleAllRows(): void;
|
|
353
498
|
rowSelectionToggle(event: CheckboxChange, row: T): void;
|
|
354
499
|
protected selectRowByClick(event: MouseEvent, row: T): void;
|
|
355
500
|
private _isInteractiveRowClick;
|
|
356
501
|
onPageChange(event: PageEvent): void;
|
|
502
|
+
private resetScroll;
|
|
503
|
+
private cancelPendingRequest;
|
|
504
|
+
private beginRowModel;
|
|
357
505
|
protected sortColumn(col: DataViewColumnDef, direction: SortDirection): void;
|
|
358
506
|
getSnapshot(): DataViewState[];
|
|
359
507
|
applyState(state: DataViewState[]): void;
|
|
@@ -364,13 +512,45 @@ declare class DataView<T> implements OnInit, AfterViewInit, DataViewInterface<T>
|
|
|
364
512
|
protected resetColumns(): void;
|
|
365
513
|
protected openColumnSettingsDialog(): void;
|
|
366
514
|
protected onSortChange(event: Sort): void;
|
|
367
|
-
|
|
515
|
+
private selectionRows;
|
|
516
|
+
selectAll(scope?: DataViewSelectionScope): void;
|
|
368
517
|
unselectAll(): void;
|
|
369
518
|
selectOne(row: T): void;
|
|
370
519
|
isSelected(row: T): boolean;
|
|
371
520
|
hasSelected(): boolean;
|
|
521
|
+
getSelection(): DataViewSelectionState<T>;
|
|
522
|
+
private emitSelection;
|
|
523
|
+
getState(): DataViewViewState;
|
|
524
|
+
setState(value: DataViewViewState): void;
|
|
525
|
+
private validateViewName;
|
|
526
|
+
saveView(name: string, id?: string): DataViewSavedView;
|
|
527
|
+
applyView(id: string | null): void;
|
|
528
|
+
renameView(id: string, name: string): void;
|
|
529
|
+
deleteView(id: string): void;
|
|
530
|
+
protected updateCurrentView(): void;
|
|
531
|
+
protected openSavedViewDialog(rename?: boolean): void;
|
|
532
|
+
private viewStorage;
|
|
533
|
+
protected headerId(field: string): string;
|
|
534
|
+
protected cellId(row: number, field: string): string;
|
|
535
|
+
protected columnIndex(field: string): number;
|
|
536
|
+
protected rowOwnedCells(row: number): string;
|
|
537
|
+
protected headerOwnedCells(): string;
|
|
538
|
+
protected globalRowIndex(row: number): number;
|
|
539
|
+
protected isActiveCell(row: number, field: string): boolean;
|
|
540
|
+
protected activateCell(event: MouseEvent, row: number, field: string): void;
|
|
541
|
+
protected onGridKeydown(event: KeyboardEvent): void;
|
|
542
|
+
private pageRows;
|
|
543
|
+
private selectKeyboardRange;
|
|
544
|
+
private revealActiveCell;
|
|
545
|
+
protected columnPixelWidth(col: DataViewColumnDef): number;
|
|
546
|
+
protected columnMinWidth(col: DataViewColumnDef): number;
|
|
547
|
+
protected columnMaxWidth(col: DataViewColumnDef): number;
|
|
548
|
+
protected resizeColumnWithKeyboard(event: KeyboardEvent, col: DataViewColumnDef): void;
|
|
549
|
+
setColumnFilter(field: string, filter: DataViewColumnFilter | null): void;
|
|
550
|
+
clearFilters(): void;
|
|
551
|
+
protected openColumnFilter(column: DataViewColumnDef): void;
|
|
372
552
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DataView<any>, never>;
|
|
373
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DataView<any>, "ngs-data-view", ["ngsDataView"], { "paginator": { "alias": "paginator"; "required": false; "isSignal": true; }; "columnDefs": { "alias": "columnDefs"; "required": false; "isSignal": true; }; "defaultColDef": { "alias": "defaultColDef"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "datasource": { "alias": "datasource"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "headerHeight": { "alias": "headerHeight"; "required": false; "isSignal": true; }; "bufferRows": { "alias": "bufferRows"; "required": false; "isSignal": true; }; "withSelection": { "alias": "withSelection"; "required": false; "isSignal": true; }; "highlightHeader": { "alias": "highlightHeader"; "required": false; "isSignal": true; }; "rowModelType": { "alias": "rowModelType"; "required": false; "isSignal": true; }; "autoHeight": { "alias": "autoHeight"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "withPagination": { "alias": "withPagination"; "required": false; "isSignal": true; }; "bodyScroll": { "alias": "bodyScroll"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "showFirstLastButtons": { "alias": "showFirstLastButtons"; "required": false; "isSignal": true; }; "paginatorAriaLabel": { "alias": "paginatorAriaLabel"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageIndex": { "alias": "pageIndex"; "required": false; "isSignal": true; }; "snapshot": { "alias": "snapshot"; "required": false; "isSignal": true; }; "withColumnSettings": { "alias": "withColumnSettings"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "rowSelection": { "alias": "rowSelection"; "required": false; "isSignal": true; }; "allowSingleRowSelectionByClick": { "alias": "allowSingleRowSelectionByClick"; "required": false; "isSignal": true; }; "selectionWidth": { "alias": "selectionWidth"; "required": false; "isSignal": true; }; "minColumnWidth": { "alias": "minColumnWidth"; "required": false; "isSignal": true; }; "cellRenderers": { "alias": "cellRenderers"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "hoverRows": { "alias": "hoverRows"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "emptyIcon": { "alias": "emptyIcon"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "emptyFilterResultsIcon": { "alias": "emptyFilterResultsIcon"; "required": false; "isSignal": true; }; "emptyFilterResultsText": { "alias": "emptyFilterResultsText"; "required": false; "isSignal": true; }; }, { "pageSize": "pageSizeChange"; "pageIndex": "pageIndexChange"; "rowSelectionChanged": "rowSelectionChanged"; "selectionChanged": "selectionChanged"; "allRowsSelectionChanged": "allRowsSelectionChanged"; "sortChange": "sortChange"; "loadEnd": "loadEnd"; "refreshEnd": "refreshEnd"; }, ["_emptyDataRef", "_emptyFilterResults", "_actionBarRef", "_actionBarComp"], never, true, never>;
|
|
553
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DataView<any>, "ngs-data-view", ["ngsDataView"], { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "sortState": { "alias": "sortState"; "required": false; "isSignal": true; }; "columnFilters": { "alias": "columnFilters"; "required": false; "isSignal": true; }; "withSavedViews": { "alias": "withSavedViews"; "required": false; "isSignal": true; }; "savedViews": { "alias": "savedViews"; "required": false; "isSignal": true; }; "viewStorageKey": { "alias": "viewStorageKey"; "required": false; "isSignal": true; }; "paginator": { "alias": "paginator"; "required": false; "isSignal": true; }; "columnDefs": { "alias": "columnDefs"; "required": false; "isSignal": true; }; "defaultColDef": { "alias": "defaultColDef"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "datasource": { "alias": "datasource"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "headerHeight": { "alias": "headerHeight"; "required": false; "isSignal": true; }; "bufferRows": { "alias": "bufferRows"; "required": false; "isSignal": true; }; "withSelection": { "alias": "withSelection"; "required": false; "isSignal": true; }; "highlightHeader": { "alias": "highlightHeader"; "required": false; "isSignal": true; }; "rowModelType": { "alias": "rowModelType"; "required": false; "isSignal": true; }; "autoHeight": { "alias": "autoHeight"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "withPagination": { "alias": "withPagination"; "required": false; "isSignal": true; }; "bodyScroll": { "alias": "bodyScroll"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "showFirstLastButtons": { "alias": "showFirstLastButtons"; "required": false; "isSignal": true; }; "paginatorAriaLabel": { "alias": "paginatorAriaLabel"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageIndex": { "alias": "pageIndex"; "required": false; "isSignal": true; }; "snapshot": { "alias": "snapshot"; "required": false; "isSignal": true; }; "withColumnSettings": { "alias": "withColumnSettings"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "rowSelection": { "alias": "rowSelection"; "required": false; "isSignal": true; }; "getRowId": { "alias": "getRowId"; "required": false; "isSignal": true; }; "selectionScope": { "alias": "selectionScope"; "required": false; "isSignal": true; }; "allowSingleRowSelectionByClick": { "alias": "allowSingleRowSelectionByClick"; "required": false; "isSignal": true; }; "selectionWidth": { "alias": "selectionWidth"; "required": false; "isSignal": true; }; "minColumnWidth": { "alias": "minColumnWidth"; "required": false; "isSignal": true; }; "cellRenderers": { "alias": "cellRenderers"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "hoverRows": { "alias": "hoverRows"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "emptyIcon": { "alias": "emptyIcon"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "emptyFilterResultsIcon": { "alias": "emptyFilterResultsIcon"; "required": false; "isSignal": true; }; "emptyFilterResultsText": { "alias": "emptyFilterResultsText"; "required": false; "isSignal": true; }; }, { "rowActivated": "rowActivated"; "loadError": "loadError"; "sortState": "sortStateChange"; "columnFilters": "columnFiltersChange"; "savedViews": "savedViewsChange"; "stateChanged": "stateChanged"; "viewApplied": "viewApplied"; "pageSize": "pageSizeChange"; "pageIndex": "pageIndexChange"; "search": "searchChange"; "rowSelectionChanged": "rowSelectionChanged"; "selectionChanged": "selectionChanged"; "selectionStateChanged": "selectionStateChanged"; "allRowsSelectionChanged": "allRowsSelectionChanged"; "sortChange": "sortChange"; "loadEnd": "loadEnd"; "refreshEnd": "refreshEnd"; }, ["_emptyDataRef", "_emptyFilterResults", "_actionBarRef", "_actionBarComp"], never, true, never>;
|
|
374
554
|
}
|
|
375
555
|
|
|
376
556
|
declare class DataViewEmptyDataDirective {
|
|
@@ -397,9 +577,22 @@ interface DataViewConfig {
|
|
|
397
577
|
minColumnWidth?: number;
|
|
398
578
|
defaultColDef?: Partial<DataViewColumnDef>;
|
|
399
579
|
autoHeight?: boolean;
|
|
580
|
+
withSavedViews?: boolean;
|
|
581
|
+
viewStorage?: DataViewViewStorage;
|
|
400
582
|
}
|
|
401
583
|
declare const DATA_VIEW_CONFIG: InjectionToken<DataViewConfig>;
|
|
402
584
|
declare function provideDataView(config: DataViewConfig): EnvironmentProviders;
|
|
403
585
|
|
|
404
|
-
|
|
405
|
-
|
|
586
|
+
declare function dataViewDateKey(value: unknown): string | undefined;
|
|
587
|
+
/** Empty filters are removed; malformed values are rejected before reaching a datasource. */
|
|
588
|
+
declare function normalizeDataViewFilter(filter: DataViewColumnFilter): DataViewColumnFilter | null;
|
|
589
|
+
declare function matchesDataViewFilter(value: unknown, filter: DataViewColumnFilter): boolean;
|
|
590
|
+
declare function normalizeDataViewFilters(filters: DataViewFilterModel): DataViewFilterModel;
|
|
591
|
+
declare function dataViewFilterLabel(filter: DataViewColumnFilter): string;
|
|
592
|
+
|
|
593
|
+
/** Validates persisted state, removes stale fields and appends newly added columns. */
|
|
594
|
+
declare function normalizeDataViewState(value: unknown, columns: readonly DataViewColumnDef[]): DataViewViewState;
|
|
595
|
+
declare function normalizeDataViewSavedViews(value: unknown, columns: readonly DataViewColumnDef[]): DataViewSavedView[];
|
|
596
|
+
|
|
597
|
+
export { DATA_VIEW, DATA_VIEW_CONFIG, DataView, DataViewActionBar, DataViewActionBarDirective, DataViewEmptyDataDirective, DataViewEmptyFilterResultsDirective, cellRenderer, dataViewDateKey, dataViewFilterLabel, matchesDataViewFilter, normalizeDataViewFilter, normalizeDataViewFilters, normalizeDataViewSavedViews, normalizeDataViewState, provideDataView };
|
|
598
|
+
export type { DataViewAPI, DataViewActionBarAPI, DataViewCellRenderer, DataViewCellRendererDef, DataViewColumnDef, DataViewColumnFilter, DataViewColumnFilterConfig, DataViewColumnWidth, DataViewConfig, DataViewDatasource, DataViewFilterModel, DataViewGetRowsParams, DataViewInterface, DataViewPinAlign, DataViewRowId, DataViewRowModelType, DataViewRowSelectionEvent, DataViewRowSelectionEventSource, DataViewSavedView, DataViewSelectionScope, DataViewSelectionState, DataViewState, DataViewViewState, DataViewViewStorage };
|
|
@@ -145,6 +145,8 @@ declare class DateRangeInput<D> implements OnDestroy, OnInit, FormFieldControl<D
|
|
|
145
145
|
private _formField;
|
|
146
146
|
readonly rangePicker: _angular_core.InputSignal<DateRangePicker<D>>;
|
|
147
147
|
readonly separator: _angular_core.InputSignal<string>;
|
|
148
|
+
/** Calendar range shared by typed inputs and picker selection. */
|
|
149
|
+
readonly range: _angular_core.ModelSignal<DateRange<D> | null>;
|
|
148
150
|
readonly ngControl: NgControl | null;
|
|
149
151
|
_startInput: _angular_core.Signal<StartDate<any> | undefined>;
|
|
150
152
|
_endInput: _angular_core.Signal<EndDate<any> | undefined>;
|
|
@@ -175,7 +177,7 @@ declare class DateRangeInput<D> implements OnDestroy, OnInit, FormFieldControl<D
|
|
|
175
177
|
getConnectedOverlayOrigin(): ElementRef;
|
|
176
178
|
focus(): void;
|
|
177
179
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DateRangeInput<any>, never>;
|
|
178
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DateRangeInput<any>, "ngs-date-range-input", ["ngsDateRangeInput"], { "rangePicker": { "alias": "rangePicker"; "required": true; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; }, {}, ["_startInput", "_endInput"], ["input[ngsStartDate]", "input[ngsEndDate]"], true, never>;
|
|
180
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DateRangeInput<any>, "ngs-date-range-input", ["ngsDateRangeInput"], { "rangePicker": { "alias": "rangePicker"; "required": true; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; }, { "range": "rangeChange"; }, ["_startInput", "_endInput"], ["input[ngsStartDate]", "input[ngsEndDate]"], true, never>;
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
declare class DatepickerToggleIcon {
|
|
@@ -117,6 +117,10 @@ declare class NgsHeadlessEditor {
|
|
|
117
117
|
handleKeydown(event: KeyboardEvent): boolean;
|
|
118
118
|
handlePaste(event: ClipboardEvent): boolean;
|
|
119
119
|
insertText(text: string, origin?: NgsHeadlessEditorChangeOrigin): boolean;
|
|
120
|
+
/** Inserts structured inline runs in one history step, preserving their marks. */
|
|
121
|
+
insertTextContent(content: readonly NgsHeadlessEditorText[], origin?: NgsHeadlessEditorChangeOrigin): boolean;
|
|
122
|
+
/** Word deletion is model-driven on every platform, including Ctrl+Backspace on macOS. */
|
|
123
|
+
deleteWordBackward(): boolean;
|
|
120
124
|
deleteBackward(): boolean;
|
|
121
125
|
deleteForward(): boolean;
|
|
122
126
|
deleteRange(selection: NgsHeadlessEditorSelection, origin: NgsHeadlessEditorChangeOrigin, historyGroup?: string | null): boolean;
|
|
@@ -381,7 +385,8 @@ declare class NgsHeadlessEditorSurface {
|
|
|
381
385
|
/** Deletes the range the browser reports for a word/line deletion. */
|
|
382
386
|
private deleteTargetRange;
|
|
383
387
|
private readTargetRange;
|
|
384
|
-
|
|
388
|
+
/** Synchronizes the DOM range before an application handles a surface event. */
|
|
389
|
+
syncSelectionFromDom(): void;
|
|
385
390
|
private readSelectionFromDom;
|
|
386
391
|
private domPositionToPoint;
|
|
387
392
|
/**
|
|
@@ -37,6 +37,7 @@ declare class MenuTrigger implements OnDestroy {
|
|
|
37
37
|
_clearCloseTimeout(): void;
|
|
38
38
|
_handleClick(event: MouseEvent): void;
|
|
39
39
|
toggleMenu(): void;
|
|
40
|
+
private themeCleanup;
|
|
40
41
|
openMenu(): void;
|
|
41
42
|
closeMenu(reason: MenuCloseReason, force?: boolean): void;
|
|
42
43
|
private _setIsMenuOpen;
|
|
@@ -76,6 +77,8 @@ declare class MenuContent {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
declare class Menu implements OnDestroy {
|
|
80
|
+
/** Optional scope whose tokens should follow this detached overlay. */
|
|
81
|
+
readonly themeSource: _angular_core.InputSignal<HTMLElement | null>;
|
|
79
82
|
readonly role: _angular_core.InputSignal<"menu" | "menubar">;
|
|
80
83
|
readonly classList: _angular_core.InputSignal<string>;
|
|
81
84
|
readonly xPosition: _angular_core.InputSignal<"before" | "after">;
|
|
@@ -90,6 +93,7 @@ declare class Menu implements OnDestroy {
|
|
|
90
93
|
readonly items: _angular_core.Signal<readonly MenuItem[]>;
|
|
91
94
|
protected readonly _isNested: _angular_core.WritableSignal<boolean>;
|
|
92
95
|
protected readonly _context: _angular_core.WritableSignal<any>;
|
|
96
|
+
readonly context: _angular_core.Signal<any>;
|
|
93
97
|
private _parentMenu;
|
|
94
98
|
private _parentMenuTrigger;
|
|
95
99
|
private _itemSubscription;
|
|
@@ -103,7 +107,7 @@ declare class Menu implements OnDestroy {
|
|
|
103
107
|
_triggerClosed(trigger: any): void;
|
|
104
108
|
hasOpenChild(): boolean;
|
|
105
109
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Menu, never>;
|
|
106
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Menu, "ngs-menu", ["ngsMenu"], { "role": { "alias": "role"; "required": false; "isSignal": true; }; "classList": { "alias": "classList"; "required": false; "isSignal": true; }; "xPosition": { "alias": "xPosition"; "required": false; "isSignal": true; }; "yPosition": { "alias": "yPosition"; "required": false; "isSignal": true; }; "pushIntoViewport": { "alias": "pushIntoViewport"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, ["content", "items"], ["ngs-menu-header,[ngs-menu-header]", "*", "ngs-menu-footer,[ngs-menu-footer]"], true, never>;
|
|
110
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Menu, "ngs-menu", ["ngsMenu"], { "themeSource": { "alias": "themeSource"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "classList": { "alias": "classList"; "required": false; "isSignal": true; }; "xPosition": { "alias": "xPosition"; "required": false; "isSignal": true; }; "yPosition": { "alias": "yPosition"; "required": false; "isSignal": true; }; "pushIntoViewport": { "alias": "pushIntoViewport"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, ["content", "items"], ["ngs-menu-header,[ngs-menu-header]", "*", "ngs-menu-footer,[ngs-menu-footer]"], true, never>;
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
declare class MenuDivider {
|
|
@@ -226,6 +226,8 @@ declare class TableDataSource<T> extends DataSource<T> {
|
|
|
226
226
|
* @param data
|
|
227
227
|
* @private
|
|
228
228
|
*/
|
|
229
|
+
/** Call after mutating a row in place; assigning data also invalidates the cache. */
|
|
230
|
+
invalidateFilterCache(row?: T): void;
|
|
229
231
|
private _getQuickFilterString;
|
|
230
232
|
constructor(initialData?: T[]);
|
|
231
233
|
/**
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { UploadArea, UploadTriggerDirective } from '@ngstarter-ui/components/upload';
|
|
4
|
-
import { ProgressBar } from '@ngstarter-ui/components/progress-bar';
|
|
5
|
-
import { Alert } from '@ngstarter-ui/components/alert';
|
|
6
|
-
import { Button } from '@ngstarter-ui/components/button';
|
|
7
|
-
import { Icon } from '@ngstarter-ui/components/icon';
|
|
8
|
-
import { FormField, Label } from '@ngstarter-ui/components/form-field';
|
|
9
|
-
import { Input } from '@ngstarter-ui/components/input';
|
|
10
|
-
import { C as ContentEditorUploadBlockBase } from './ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs';
|
|
11
|
-
import { f as contentEditorFileSize, g as contentEditorResourceUrl, r as readContentEditorFile } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs';
|
|
12
|
-
|
|
13
|
-
class ContentEditorAttachmentBlock extends ContentEditorUploadBlockBase {
|
|
14
|
-
sizeLabel = computed(() => contentEditorFileSize(this.content().size), /* @ts-ignore */
|
|
15
|
-
...(ngDevMode ? [{ debugName: "sizeLabel" }] : /* istanbul ignore next */ []));
|
|
16
|
-
href = computed(() => contentEditorResourceUrl(this.content().url), /* @ts-ignore */
|
|
17
|
-
...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
18
|
-
changeName(event) { this.save({ ...this.latestContent(), name: event.target.value }); }
|
|
19
|
-
async upload(event) {
|
|
20
|
-
const file = event.files[0];
|
|
21
|
-
if (!file)
|
|
22
|
-
return;
|
|
23
|
-
const request = this.beginUpload();
|
|
24
|
-
try {
|
|
25
|
-
const dataUrl = await readContentEditorFile(file);
|
|
26
|
-
if (!this.isCurrentUpload(request))
|
|
27
|
-
return;
|
|
28
|
-
const uploadFn = this.builder.getBlockDefOption('attachment', 'uploadFn');
|
|
29
|
-
const url = await uploadFn(file, dataUrl);
|
|
30
|
-
if (!this.isCurrentUpload(request))
|
|
31
|
-
return;
|
|
32
|
-
if (typeof url !== 'string' || !contentEditorResourceUrl(url))
|
|
33
|
-
throw new Error('Invalid file URL');
|
|
34
|
-
this.save({ url, name: file.name, size: file.size, mimeType: file.type });
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
if (this.isCurrentUpload(request))
|
|
38
|
-
this.error.set('Could not upload the file. Please try again.');
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
if (this.isCurrentUpload(request))
|
|
42
|
-
this.uploading.set(false);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorAttachmentBlock, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ContentEditorAttachmentBlock, isStandalone: true, selector: "ngs-content-editor-attachment-block", usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} \u00B7 {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n", dependencies: [{ kind: "component", type: UploadArea, selector: "ngs-upload-area", inputs: ["accept", "allowHover", "multiple"], outputs: ["fileSelected"], exportAs: ["ngsUploadArea"] }, { kind: "directive", type: UploadTriggerDirective, selector: "[ngsUploadTrigger]", inputs: ["accept", "multiple"], outputs: ["fileSelected"], exportAs: ["ngsUploadTrigger"] }, { kind: "component", type: ProgressBar, selector: "ngs-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["ngsProgressBar"] }, { kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
|
-
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorAttachmentBlock, decorators: [{
|
|
49
|
-
type: Component,
|
|
50
|
-
args: [{ selector: 'ngs-content-editor-attachment-block', imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Label, Input], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} \u00B7 {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n" }]
|
|
51
|
-
}] });
|
|
52
|
-
|
|
53
|
-
export { ContentEditorAttachmentBlock };
|
|
54
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs","sources":["../../../projects/components/content-editor/src/_builder/attachment-block/attachment-block.ts","../../../projects/components/content-editor/src/_builder/attachment-block/attachment-block.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { UploadArea, UploadTriggerDirective, UploadFileSelectedEvent } from '@ngstarter-ui/components/upload';\nimport { ProgressBar } from '@ngstarter-ui/components/progress-bar';\nimport { Alert } from '@ngstarter-ui/components/alert';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { ContentEditorUploadBlockBase } from '../upload-block-base';\nimport { ContentEditorAttachmentContent, ContentEditorUploadFn } from '../../types';\nimport { contentEditorFileSize, contentEditorResourceUrl, readContentEditorFile } from '../../upload';\n\n@Component({\n selector: 'ngs-content-editor-attachment-block',\n imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Label, Input],\n templateUrl: './attachment-block.html', changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ContentEditorAttachmentBlock extends ContentEditorUploadBlockBase<ContentEditorAttachmentContent> {\n readonly sizeLabel = computed(() => contentEditorFileSize(this.content().size));\n readonly href = computed(() => contentEditorResourceUrl(this.content().url));\n changeName(event: Event): void { this.save({ ...this.latestContent(), name: (event.target as HTMLInputElement).value }); }\n async upload(event: UploadFileSelectedEvent): Promise<void> {\n const file = event.files[0];\n if (!file) return;\n const request = this.beginUpload();\n try {\n const dataUrl = await readContentEditorFile(file);\n if (!this.isCurrentUpload(request)) return;\n const uploadFn: ContentEditorUploadFn = this.builder.getBlockDefOption('attachment', 'uploadFn');\n const url = await uploadFn(file, dataUrl);\n if (!this.isCurrentUpload(request)) return;\n if (typeof url !== 'string' || !contentEditorResourceUrl(url)) throw new Error('Invalid file URL');\n this.save({ url, name: file.name, size: file.size, mimeType: file.type });\n } catch {\n if (this.isCurrentUpload(request)) this.error.set('Could not upload the file. Please try again.');\n } finally {\n if (this.isCurrentUpload(request)) this.uploading.set(false);\n }\n }\n}\n","<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} · {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs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A,WAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,MAAM,0SAAE,IAAI,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,SAAS,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,wBAAA,EAAA,oBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,KAAK,sDAAE,KAAK,EAAA,QAAA,EAAA,qCAAA,EAAA,MAAA,EAAA,CAAA,IAAA,EAAA,aAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAG5F,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBALxC,SAAS;+BACE,qCAAqC,EAAA,OAAA,EACtC,CAAC,UAAU,EAAE,sBAAsB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,EAAA,eAAA,EAC/C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sjCAAA,EAAA;;;;;"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, signal, effect, untracked, Directive } from '@angular/core';
|
|
3
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, h as findContentEditorBlock, n as isContentEditorBlockEmpty, l as contentEditorBlockView } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs';
|
|
4
|
-
|
|
5
|
-
/** Shared native inputs and root history for the built-in block editors. */
|
|
6
|
-
class ContentEditorBlockBase {
|
|
7
|
-
store = inject(ContentBuilderStore);
|
|
8
|
-
builder = inject(CONTENT_BUILDER);
|
|
9
|
-
element = inject(ElementRef).nativeElement;
|
|
10
|
-
id = input.required(/* @ts-ignore */
|
|
11
|
-
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
12
|
-
content = input.required(/* @ts-ignore */
|
|
13
|
-
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
14
|
-
settings = input.required(/* @ts-ignore */
|
|
15
|
-
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
16
|
-
index = input(0, /* @ts-ignore */
|
|
17
|
-
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
18
|
-
props = input([], /* @ts-ignore */
|
|
19
|
-
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
20
|
-
initialized = signal(true, /* @ts-ignore */
|
|
21
|
-
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
22
|
-
constructor() {
|
|
23
|
-
effect(() => {
|
|
24
|
-
if (this.store.focusedBlockId() === this.id())
|
|
25
|
-
untracked(() => this.focus());
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
focus() { this.element.querySelector('[contenteditable="true"], input, button')?.focus(); }
|
|
29
|
-
getData() { return { content: this.content(), settings: this.settings(), props: this.props() }; }
|
|
30
|
-
isEmpty() {
|
|
31
|
-
const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());
|
|
32
|
-
return !block || isContentEditorBlockEmpty(block);
|
|
33
|
-
}
|
|
34
|
-
save(content, settings = this.settings()) { this.store.updateBlock(this.id(), { content, settings }); }
|
|
35
|
-
latestContent() {
|
|
36
|
-
const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());
|
|
37
|
-
return block ? contentEditorBlockView(block).content : this.content();
|
|
38
|
-
}
|
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorBlockBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: ContentEditorBlockBase, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
41
|
-
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorBlockBase, decorators: [{
|
|
43
|
-
type: Directive
|
|
44
|
-
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
45
|
-
|
|
46
|
-
export { ContentEditorBlockBase as C };
|
|
47
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs","sources":["../../../projects/components/content-editor/src/_builder/block-base.ts"],"sourcesContent":["import { Directive, ElementRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { ContentBuilderStore } from '../content-builder.store';\nimport { ContentBuilderComponent } from '../content-builder/content-builder.component';\nimport { CONTENT_BUILDER, ContentEditorDataBlock, ContentEditorItemProperty } from '../types';\nimport { contentEditorBlockView, findContentEditorBlock, isContentEditorBlockEmpty } from '../document';\n\n/** Shared native inputs and root history for the built-in block editors. */\n@Directive()\nexport abstract class ContentEditorBlockBase<T, S extends object = Record<string, unknown>> implements ContentEditorDataBlock {\n protected readonly store = inject(ContentBuilderStore);\n protected readonly builder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n protected readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n readonly id = input.required<string>();\n readonly content = input.required<T>();\n readonly settings = input.required<S>();\n readonly index = input(0);\n readonly props = input<ContentEditorItemProperty[]>([]);\n readonly initialized = signal(true);\n\n constructor() {\n effect(() => {\n if (this.store.focusedBlockId() === this.id()) untracked(() => this.focus());\n });\n }\n focus(): void { this.element.querySelector<HTMLElement>('[contenteditable=\"true\"], input, button')?.focus(); }\n getData() { return { content: this.content(), settings: this.settings(), props: this.props() }; }\n isEmpty(): boolean {\n const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());\n return !block || isContentEditorBlockEmpty(block);\n }\n protected save(content: T, settings: S = this.settings()): void { this.store.updateBlock(this.id(), { content, settings }); }\n protected latestContent(): T {\n const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());\n return block ? contentEditorBlockView(block).content : this.content();\n }\n}\n"],"names":[],"mappings":";;;;AAMA;MAEsB,sBAAsB,CAAA;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACnC,IAAA,OAAO,GAAG,MAAM,CAA0B,eAAe,CAAC;AAC1D,IAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;IAC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