@trudb/tru-common-lib 0.0.187 → 0.0.189
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/esm2020/lib/base-views/detail/tru-detail-view-base-module.mjs +19 -0
- package/esm2020/lib/base-views/detail/tru-detail-view-base.mjs +12 -0
- package/esm2020/lib/base-views/search/services/tru-search-view-event-handler.mjs +41 -0
- package/esm2020/lib/base-views/search/tru-search-view-base-module.mjs +19 -0
- package/esm2020/lib/base-views/search/tru-search-view-base.mjs +65 -0
- package/esm2020/lib/components/data-grid/tru-data-grid.mjs +2 -2
- package/esm2020/lib/services/tru-entity-accessor.mjs +2 -5
- package/esm2020/public-api.mjs +9 -7
- package/fesm2015/trudb-tru-common-lib.mjs +301 -221
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +301 -221
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/base-views/detail/tru-detail-view-base-module.d.ts +9 -0
- package/lib/base-views/detail/tru-detail-view-base.d.ts +6 -0
- package/lib/{event-handlers → base-views/search/services}/tru-search-view-event-handler.d.ts +11 -1
- package/lib/base-views/search/tru-search-view-base-module.d.ts +9 -0
- package/lib/base-views/search/tru-search-view-base.d.ts +35 -0
- package/lib/components/data-grid/tru-data-grid.d.ts +1 -1
- package/lib/services/tru-entity-accessor.d.ts +0 -1
- package/package.json +1 -1
- package/public-api.d.ts +5 -3
- package/esm2020/lib/event-handlers/tru-search-group-event-handler.mjs +0 -41
- package/esm2020/lib/event-handlers/tru-search-view-event-handler.mjs +0 -20
- package/lib/event-handlers/tru-search-group-event-handler.d.ts +0 -19
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { EntityAspect, BinaryPredicate, AndOrPredicate, breeze, MetadataStore, DataService, EntityManager, EntityQuery, FetchStrategy, EntityState } from 'breeze-client';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, Input, Component,
|
|
4
|
-
import * as _ from 'underscore';
|
|
5
|
-
import * as moment from 'moment';
|
|
6
|
-
import * as i1 from '@angular/material/dialog';
|
|
7
|
-
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
3
|
+
import { Directive, Input, Component, NgModule, Injectable, Inject, HostListener, EventEmitter, ViewEncapsulation, Output, APP_INITIALIZER } from '@angular/core';
|
|
8
4
|
import * as i1$3 from '@angular/common';
|
|
9
5
|
import { CommonModule } from '@angular/common';
|
|
10
6
|
import * as i2 from '@angular/forms';
|
|
11
7
|
import { FormsModule } from '@angular/forms';
|
|
12
|
-
import { BehaviorSubject, defer, from, of, skip, forkJoin
|
|
8
|
+
import { Subject, BehaviorSubject, defer, from, of, skip, forkJoin } from 'rxjs';
|
|
9
|
+
import * as _ from 'underscore';
|
|
10
|
+
import * as moment from 'moment';
|
|
11
|
+
import * as i1 from '@angular/material/dialog';
|
|
12
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
13
13
|
import * as i1$2 from '@angular/common/http';
|
|
14
14
|
import { HttpClientModule } from '@angular/common/http';
|
|
15
15
|
import * as i3 from '@angular/material/checkbox';
|
|
@@ -127,6 +127,296 @@ class TruTableConfigBase {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
class TruDetailViewBase {
|
|
131
|
+
constructor() { }
|
|
132
|
+
}
|
|
133
|
+
TruDetailViewBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDetailViewBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
134
|
+
TruDetailViewBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.2", type: TruDetailViewBase, selector: "tru-detail-view-base", ngImport: i0, template: "", styles: [""] });
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDetailViewBase, decorators: [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{ selector: 'tru-detail-view-base', template: "" }]
|
|
138
|
+
}], ctorParameters: function () { return []; } });
|
|
139
|
+
|
|
140
|
+
class DetailViewModule {
|
|
141
|
+
}
|
|
142
|
+
DetailViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: DetailViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
143
|
+
DetailViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.2", ngImport: i0, type: DetailViewModule, declarations: [TruDetailViewBase], imports: [CommonModule, FormsModule], exports: [TruDetailViewBase] });
|
|
144
|
+
DetailViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: DetailViewModule, imports: [CommonModule, FormsModule] });
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: DetailViewModule, decorators: [{
|
|
146
|
+
type: NgModule,
|
|
147
|
+
args: [{
|
|
148
|
+
declarations: [TruDetailViewBase],
|
|
149
|
+
imports: [CommonModule, FormsModule],
|
|
150
|
+
exports: [TruDetailViewBase]
|
|
151
|
+
}]
|
|
152
|
+
}] });
|
|
153
|
+
|
|
154
|
+
class TruWindowAddViewEventArgs {
|
|
155
|
+
constructor() {
|
|
156
|
+
this.active = null;
|
|
157
|
+
this.entities = null;
|
|
158
|
+
this.entityIndex = 0;
|
|
159
|
+
this.isDirty = false;
|
|
160
|
+
this.isEditing = false;
|
|
161
|
+
this.isInvalid = false;
|
|
162
|
+
this.componentName = '';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
TruWindowAddViewEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowAddViewEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
166
|
+
TruWindowAddViewEventArgs.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowAddViewEventArgs, providedIn: 'root' });
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowAddViewEventArgs, decorators: [{
|
|
168
|
+
type: Injectable,
|
|
169
|
+
args: [{
|
|
170
|
+
providedIn: 'root'
|
|
171
|
+
}]
|
|
172
|
+
}] });
|
|
173
|
+
|
|
174
|
+
class TruWindowEventArgs {
|
|
175
|
+
constructor() {
|
|
176
|
+
this.title = '';
|
|
177
|
+
this.tableName = '';
|
|
178
|
+
this.tablePluralName = '';
|
|
179
|
+
this.tablePluralLabel = '';
|
|
180
|
+
this.context = {};
|
|
181
|
+
this.contentBottom = '23px';
|
|
182
|
+
this.statusbarDirective = 'tru-statusbar';
|
|
183
|
+
this.height = '450px';
|
|
184
|
+
this.width = '900px';
|
|
185
|
+
this.views = [{}];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
TruWindowEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
189
|
+
TruWindowEventArgs.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, providedIn: 'root' });
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, decorators: [{
|
|
191
|
+
type: Injectable,
|
|
192
|
+
args: [{
|
|
193
|
+
providedIn: 'root'
|
|
194
|
+
}]
|
|
195
|
+
}] });
|
|
196
|
+
|
|
197
|
+
class TruWindowEventHandler {
|
|
198
|
+
constructor() {
|
|
199
|
+
this.open$ = new Subject();
|
|
200
|
+
this.addView$ = new Subject();
|
|
201
|
+
this.removeForwadViews$ = new Subject();
|
|
202
|
+
}
|
|
203
|
+
onOpen() {
|
|
204
|
+
return this.open$;
|
|
205
|
+
}
|
|
206
|
+
open(windowEvent) {
|
|
207
|
+
this.open$.next(windowEvent);
|
|
208
|
+
}
|
|
209
|
+
onAddView() {
|
|
210
|
+
return this.addView$;
|
|
211
|
+
}
|
|
212
|
+
addView(windowAddViewEvent) {
|
|
213
|
+
this.addView$.next(windowAddViewEvent);
|
|
214
|
+
}
|
|
215
|
+
onRemoveForwardViews() {
|
|
216
|
+
return this.removeForwadViews$;
|
|
217
|
+
}
|
|
218
|
+
removeForwardViews() {
|
|
219
|
+
this.removeForwadViews$.next(null);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
TruWindowEventHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
223
|
+
TruWindowEventHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventHandler, providedIn: 'root' });
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventHandler, decorators: [{
|
|
225
|
+
type: Injectable,
|
|
226
|
+
args: [{
|
|
227
|
+
providedIn: 'root'
|
|
228
|
+
}]
|
|
229
|
+
}] });
|
|
230
|
+
|
|
231
|
+
class TruDesktopManager {
|
|
232
|
+
constructor(truWindowEventHandler) {
|
|
233
|
+
this.truWindowEventHandler = truWindowEventHandler;
|
|
234
|
+
this.getWindowEvent = (tableName, tablePluralName, tablePluralLabel, componentName, data) => {
|
|
235
|
+
var windowEvent = new TruWindowEventArgs();
|
|
236
|
+
windowEvent.tableName = tableName;
|
|
237
|
+
windowEvent.tablePluralName = tablePluralName;
|
|
238
|
+
windowEvent.tablePluralLabel = tablePluralLabel;
|
|
239
|
+
windowEvent.views = [
|
|
240
|
+
{
|
|
241
|
+
active: true,
|
|
242
|
+
entities: undefined,
|
|
243
|
+
entityIndex: 0,
|
|
244
|
+
isDirty: false,
|
|
245
|
+
isEditing: false,
|
|
246
|
+
isInvalid: false,
|
|
247
|
+
data: data,
|
|
248
|
+
componentName: componentName
|
|
249
|
+
}
|
|
250
|
+
];
|
|
251
|
+
return windowEvent;
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Opens a window for a directive.
|
|
255
|
+
* @param {string} directiveName - name of the view directive.
|
|
256
|
+
* @param {object} data - values to pass to the view.
|
|
257
|
+
* @param {optional bool} showIfExists - if true and a view already exists for the
|
|
258
|
+
* directive, then shows its window instead of creating a new one.
|
|
259
|
+
*/
|
|
260
|
+
this.addWindow = (tableName, tablePluralName, tablePluralLabel, componentName, data = null, showNavigation = true, showIfExists) => {
|
|
261
|
+
this.truWindowEventHandler.open(this.getWindowEvent(tableName, tablePluralName, tablePluralLabel, componentName, data));
|
|
262
|
+
};
|
|
263
|
+
this.windowTitlesByBaseText = {};
|
|
264
|
+
/**
|
|
265
|
+
* Returns a unique string for the base name of a window. At first, returns the input.
|
|
266
|
+
* For second call with same base name, returns the name plus ' - 2' and so on. When
|
|
267
|
+
* all of the titles for the base name are released, then the next title will have no
|
|
268
|
+
* suffix.
|
|
269
|
+
* @param {string} text - base name of a window.
|
|
270
|
+
* @returns {object} - text: the unique text and release(): releases the name for
|
|
271
|
+
* future windows.
|
|
272
|
+
*/
|
|
273
|
+
this.getUniqueTitle = (text) => {
|
|
274
|
+
var baseText = text;
|
|
275
|
+
var titles = this.windowTitlesByBaseText[baseText];
|
|
276
|
+
if (!titles) {
|
|
277
|
+
this.windowTitlesByBaseText[baseText] = titles = {
|
|
278
|
+
dispensedCount: 1,
|
|
279
|
+
activeCount: 1
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
++titles.activeCount;
|
|
284
|
+
text += ' - ' + (++titles.dispensedCount);
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
text: text,
|
|
288
|
+
release: () => {
|
|
289
|
+
if (titles.activeCount === 1)
|
|
290
|
+
delete this.windowTitlesByBaseText[baseText];
|
|
291
|
+
else {
|
|
292
|
+
--titles.activeCount;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
TruDesktopManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, deps: [{ token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
300
|
+
TruDesktopManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, providedIn: 'root' });
|
|
301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, decorators: [{
|
|
302
|
+
type: Injectable,
|
|
303
|
+
args: [{
|
|
304
|
+
providedIn: 'root',
|
|
305
|
+
}]
|
|
306
|
+
}], ctorParameters: function () { return [{ type: TruWindowEventHandler }]; } });
|
|
307
|
+
|
|
308
|
+
class TruSearchViewBase {
|
|
309
|
+
constructor(desktopManager, truWindowEventHandler) {
|
|
310
|
+
this.desktopManager = desktopManager;
|
|
311
|
+
this.truWindowEventHandler = truWindowEventHandler;
|
|
312
|
+
this.tableName = '';
|
|
313
|
+
this.tablePluralName = '';
|
|
314
|
+
this.tablePluralLabel = '';
|
|
315
|
+
this.pkeyName = '';
|
|
316
|
+
this.windowTitle = {};
|
|
317
|
+
this.unsubscribes = [];
|
|
318
|
+
this.expands = [];
|
|
319
|
+
this.isSearching = false;
|
|
320
|
+
this.entities = [];
|
|
321
|
+
this.hasDetailView = true;
|
|
322
|
+
this.searchPanelConfig = {
|
|
323
|
+
side: 'right',
|
|
324
|
+
active: true,
|
|
325
|
+
open: true,
|
|
326
|
+
modKeyLabel: '',
|
|
327
|
+
size: 500,
|
|
328
|
+
pinned: false
|
|
329
|
+
};
|
|
330
|
+
this.setWindowTitle = () => {
|
|
331
|
+
if (this.view.active)
|
|
332
|
+
this.windowConfig.title = this.windowTitle.text;
|
|
333
|
+
};
|
|
334
|
+
this.onPkeyCellDoubleClicked = (gridConfig) => {
|
|
335
|
+
if (this.hasDetailView) {
|
|
336
|
+
var truWindowAddViewEventArgs = new TruWindowAddViewEventArgs();
|
|
337
|
+
truWindowAddViewEventArgs.active = true;
|
|
338
|
+
truWindowAddViewEventArgs.entities = gridConfig.api.getRenderedNodes().map((rowNode) => rowNode.data.$entity);
|
|
339
|
+
truWindowAddViewEventArgs.entityIndex = gridConfig.rowIndex;
|
|
340
|
+
truWindowAddViewEventArgs.componentName = this.tableName + 'DetailView';
|
|
341
|
+
this.truWindowEventHandler.addView(truWindowAddViewEventArgs);
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
alert(this.tablePluralLabel + ' does not have a detail view.');
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
ngOnInit() {
|
|
349
|
+
this.tableName = this.view.window.tableName;
|
|
350
|
+
this.tablePluralName = this.view.window.tablePluralName;
|
|
351
|
+
this.tablePluralLabel = this.view.window.tablePluralLabel;
|
|
352
|
+
this.pkeyName = this.tableName + 'Ref';
|
|
353
|
+
this.windowTitle = this.desktopManager.getUniqueTitle(this.tablePluralLabel);
|
|
354
|
+
this.windowConfig = this.view.window;
|
|
355
|
+
this.contextFilters = this.view.window.globals;
|
|
356
|
+
this.setWindowTitle();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
TruSearchViewBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewBase, deps: [{ token: TruDesktopManager }, { token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Component });
|
|
360
|
+
TruSearchViewBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.2", type: TruSearchViewBase, selector: "tru-search-view-base", inputs: { view: "view" }, ngImport: i0, template: "", styles: [""] });
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewBase, decorators: [{
|
|
362
|
+
type: Component,
|
|
363
|
+
args: [{ selector: 'tru-search-view-base', template: "" }]
|
|
364
|
+
}], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruWindowEventHandler }]; }, propDecorators: { view: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}] } });
|
|
367
|
+
|
|
368
|
+
class TruSearchViewBaseModule {
|
|
369
|
+
}
|
|
370
|
+
TruSearchViewBaseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewBaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
371
|
+
TruSearchViewBaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewBaseModule, declarations: [TruSearchViewBase], imports: [CommonModule, FormsModule], exports: [TruSearchViewBase] });
|
|
372
|
+
TruSearchViewBaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewBaseModule, imports: [CommonModule, FormsModule] });
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewBaseModule, decorators: [{
|
|
374
|
+
type: NgModule,
|
|
375
|
+
args: [{
|
|
376
|
+
declarations: [TruSearchViewBase],
|
|
377
|
+
imports: [CommonModule, FormsModule],
|
|
378
|
+
exports: [TruSearchViewBase]
|
|
379
|
+
}]
|
|
380
|
+
}] });
|
|
381
|
+
|
|
382
|
+
class TruSearchViewEventHandler {
|
|
383
|
+
constructor() {
|
|
384
|
+
this.search$ = new BehaviorSubject(null);
|
|
385
|
+
this.filter$ = new BehaviorSubject(null);
|
|
386
|
+
this.clear$ = new BehaviorSubject(null);
|
|
387
|
+
this.default$ = new BehaviorSubject(null);
|
|
388
|
+
}
|
|
389
|
+
onSearch() {
|
|
390
|
+
return this.search$.asObservable();
|
|
391
|
+
}
|
|
392
|
+
onFilter() {
|
|
393
|
+
return this.filter$;
|
|
394
|
+
}
|
|
395
|
+
onClearValues() {
|
|
396
|
+
return this.clear$;
|
|
397
|
+
}
|
|
398
|
+
onSetDefaults() {
|
|
399
|
+
return this.default$;
|
|
400
|
+
}
|
|
401
|
+
search(query) {
|
|
402
|
+
this.search$.next(query);
|
|
403
|
+
}
|
|
404
|
+
filter(query) {
|
|
405
|
+
this.search$.next(query);
|
|
406
|
+
}
|
|
407
|
+
clearValues() {
|
|
408
|
+
this.clear$.next(null);
|
|
409
|
+
}
|
|
410
|
+
setDefaults() {
|
|
411
|
+
this.default$.next(null);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
TruSearchViewEventHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewEventHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
415
|
+
TruSearchViewEventHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewEventHandler });
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewEventHandler, decorators: [{
|
|
417
|
+
type: Injectable
|
|
418
|
+
}] });
|
|
419
|
+
|
|
130
420
|
class TruFormulaEval {
|
|
131
421
|
static isString(s) {
|
|
132
422
|
return typeof s === 'string';
|
|
@@ -827,7 +1117,7 @@ class TruEntityAccessor {
|
|
|
827
1117
|
return 'Query' + entity.name;
|
|
828
1118
|
};
|
|
829
1119
|
this.warnIfMaxRecords = (entities, entityName) => {
|
|
830
|
-
if (entities.length >= this.
|
|
1120
|
+
if (entities.length >= this._maxRecordCount)
|
|
831
1121
|
this.uiNotification.warning('[' + entityName + '] has more records available than supported');
|
|
832
1122
|
};
|
|
833
1123
|
this.formatQueryChoices = (query, entities, pKeyName, hid = null) => {
|
|
@@ -990,9 +1280,6 @@ class TruEntityAccessor {
|
|
|
990
1280
|
this._breezeContext = dataContext.breezeContext;
|
|
991
1281
|
this._entityManager = dataContext.entityManager;
|
|
992
1282
|
}
|
|
993
|
-
set maxRecordCount(maxRecordCount) {
|
|
994
|
-
this.maxRecordCount = maxRecordCount;
|
|
995
|
-
}
|
|
996
1283
|
}
|
|
997
1284
|
TruEntityAccessor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruEntityAccessor, deps: [{ token: i1$2.HttpClient }, { token: TruAppEnvironment }, { token: TruUiNotification }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
998
1285
|
TruEntityAccessor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruEntityAccessor });
|
|
@@ -1200,23 +1487,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
1200
1487
|
type: Injectable
|
|
1201
1488
|
}], ctorParameters: function () { return [{ type: TruBreezeContextFactory }, { type: TruAppEnvironment }, { type: TruEntityAccessor }, { type: TruUiNotification }]; } });
|
|
1202
1489
|
|
|
1203
|
-
class TruSearchViewEventHandler {
|
|
1204
|
-
constructor() {
|
|
1205
|
-
this.search$ = new BehaviorSubject(null);
|
|
1206
|
-
}
|
|
1207
|
-
search(query) {
|
|
1208
|
-
this.search$.next(query);
|
|
1209
|
-
}
|
|
1210
|
-
onSearch() {
|
|
1211
|
-
return this.search$.asObservable();
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
TruSearchViewEventHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewEventHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1215
|
-
TruSearchViewEventHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewEventHandler });
|
|
1216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchViewEventHandler, decorators: [{
|
|
1217
|
-
type: Injectable
|
|
1218
|
-
}] });
|
|
1219
|
-
|
|
1220
1490
|
class TruToolbar {
|
|
1221
1491
|
constructor() {
|
|
1222
1492
|
this.config = null;
|
|
@@ -2096,40 +2366,6 @@ class ViewConfig {
|
|
|
2096
2366
|
}
|
|
2097
2367
|
;
|
|
2098
2368
|
|
|
2099
|
-
class TruWindowEventHandler {
|
|
2100
|
-
constructor() {
|
|
2101
|
-
this.open$ = new Subject();
|
|
2102
|
-
this.addView$ = new Subject();
|
|
2103
|
-
this.removeForwadViews$ = new Subject();
|
|
2104
|
-
}
|
|
2105
|
-
onOpen() {
|
|
2106
|
-
return this.open$;
|
|
2107
|
-
}
|
|
2108
|
-
open(windowEvent) {
|
|
2109
|
-
this.open$.next(windowEvent);
|
|
2110
|
-
}
|
|
2111
|
-
onAddView() {
|
|
2112
|
-
return this.addView$;
|
|
2113
|
-
}
|
|
2114
|
-
addView(windowAddViewEvent) {
|
|
2115
|
-
this.addView$.next(windowAddViewEvent);
|
|
2116
|
-
}
|
|
2117
|
-
onRemoveForwardViews() {
|
|
2118
|
-
return this.removeForwadViews$;
|
|
2119
|
-
}
|
|
2120
|
-
removeForwardViews() {
|
|
2121
|
-
this.removeForwadViews$.next(null);
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
TruWindowEventHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2125
|
-
TruWindowEventHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventHandler, providedIn: 'root' });
|
|
2126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventHandler, decorators: [{
|
|
2127
|
-
type: Injectable,
|
|
2128
|
-
args: [{
|
|
2129
|
-
providedIn: 'root'
|
|
2130
|
-
}]
|
|
2131
|
-
}] });
|
|
2132
|
-
|
|
2133
2369
|
class TruDesktopMenubar {
|
|
2134
2370
|
constructor() {
|
|
2135
2371
|
this.options = null;
|
|
@@ -3771,106 +4007,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
3771
4007
|
}]
|
|
3772
4008
|
}] });
|
|
3773
4009
|
|
|
3774
|
-
class TruWindowEventArgs {
|
|
3775
|
-
constructor() {
|
|
3776
|
-
this.title = '';
|
|
3777
|
-
this.tableName = '';
|
|
3778
|
-
this.tablePluralName = '';
|
|
3779
|
-
this.tablePluralLabel = '';
|
|
3780
|
-
this.context = {};
|
|
3781
|
-
this.contentBottom = '23px';
|
|
3782
|
-
this.statusbarDirective = 'tru-statusbar';
|
|
3783
|
-
this.height = '450px';
|
|
3784
|
-
this.width = '900px';
|
|
3785
|
-
this.views = [{}];
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
TruWindowEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3789
|
-
TruWindowEventArgs.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, providedIn: 'root' });
|
|
3790
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, decorators: [{
|
|
3791
|
-
type: Injectable,
|
|
3792
|
-
args: [{
|
|
3793
|
-
providedIn: 'root'
|
|
3794
|
-
}]
|
|
3795
|
-
}] });
|
|
3796
|
-
|
|
3797
|
-
class TruDesktopManager {
|
|
3798
|
-
constructor(truWindowEventHandler) {
|
|
3799
|
-
this.truWindowEventHandler = truWindowEventHandler;
|
|
3800
|
-
this.getWindowEvent = (tableName, tablePluralName, tablePluralLabel, componentName, data) => {
|
|
3801
|
-
var windowEvent = new TruWindowEventArgs();
|
|
3802
|
-
windowEvent.tableName = tableName;
|
|
3803
|
-
windowEvent.tablePluralName = tablePluralName;
|
|
3804
|
-
windowEvent.tablePluralLabel = tablePluralLabel;
|
|
3805
|
-
windowEvent.views = [
|
|
3806
|
-
{
|
|
3807
|
-
active: true,
|
|
3808
|
-
entities: undefined,
|
|
3809
|
-
entityIndex: 0,
|
|
3810
|
-
isDirty: false,
|
|
3811
|
-
isEditing: false,
|
|
3812
|
-
isInvalid: false,
|
|
3813
|
-
data: data,
|
|
3814
|
-
componentName: componentName
|
|
3815
|
-
}
|
|
3816
|
-
];
|
|
3817
|
-
return windowEvent;
|
|
3818
|
-
};
|
|
3819
|
-
/**
|
|
3820
|
-
* Opens a window for a directive.
|
|
3821
|
-
* @param {string} directiveName - name of the view directive.
|
|
3822
|
-
* @param {object} data - values to pass to the view.
|
|
3823
|
-
* @param {optional bool} showIfExists - if true and a view already exists for the
|
|
3824
|
-
* directive, then shows its window instead of creating a new one.
|
|
3825
|
-
*/
|
|
3826
|
-
this.addWindow = (tableName, tablePluralName, tablePluralLabel, componentName, data = null, showNavigation = true, showIfExists) => {
|
|
3827
|
-
this.truWindowEventHandler.open(this.getWindowEvent(tableName, tablePluralName, tablePluralLabel, componentName, data));
|
|
3828
|
-
};
|
|
3829
|
-
this.windowTitlesByBaseText = {};
|
|
3830
|
-
/**
|
|
3831
|
-
* Returns a unique string for the base name of a window. At first, returns the input.
|
|
3832
|
-
* For second call with same base name, returns the name plus ' - 2' and so on. When
|
|
3833
|
-
* all of the titles for the base name are released, then the next title will have no
|
|
3834
|
-
* suffix.
|
|
3835
|
-
* @param {string} text - base name of a window.
|
|
3836
|
-
* @returns {object} - text: the unique text and release(): releases the name for
|
|
3837
|
-
* future windows.
|
|
3838
|
-
*/
|
|
3839
|
-
this.getUniqueTitle = (text) => {
|
|
3840
|
-
var baseText = text;
|
|
3841
|
-
var titles = this.windowTitlesByBaseText[baseText];
|
|
3842
|
-
if (!titles) {
|
|
3843
|
-
this.windowTitlesByBaseText[baseText] = titles = {
|
|
3844
|
-
dispensedCount: 1,
|
|
3845
|
-
activeCount: 1
|
|
3846
|
-
};
|
|
3847
|
-
}
|
|
3848
|
-
else {
|
|
3849
|
-
++titles.activeCount;
|
|
3850
|
-
text += ' - ' + (++titles.dispensedCount);
|
|
3851
|
-
}
|
|
3852
|
-
return {
|
|
3853
|
-
text: text,
|
|
3854
|
-
release: () => {
|
|
3855
|
-
if (titles.activeCount === 1)
|
|
3856
|
-
delete this.windowTitlesByBaseText[baseText];
|
|
3857
|
-
else {
|
|
3858
|
-
--titles.activeCount;
|
|
3859
|
-
}
|
|
3860
|
-
}
|
|
3861
|
-
};
|
|
3862
|
-
};
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
|
-
TruDesktopManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, deps: [{ token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3866
|
-
TruDesktopManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, providedIn: 'root' });
|
|
3867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, decorators: [{
|
|
3868
|
-
type: Injectable,
|
|
3869
|
-
args: [{
|
|
3870
|
-
providedIn: 'root',
|
|
3871
|
-
}]
|
|
3872
|
-
}], ctorParameters: function () { return [{ type: TruWindowEventHandler }]; } });
|
|
3873
|
-
|
|
3874
4010
|
class TruWindowActionEventHandler {
|
|
3875
4011
|
constructor() {
|
|
3876
4012
|
this.save$ = new Subject();
|
|
@@ -3895,26 +4031,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
3895
4031
|
type: Injectable
|
|
3896
4032
|
}] });
|
|
3897
4033
|
|
|
3898
|
-
class TruWindowAddViewEventArgs {
|
|
3899
|
-
constructor() {
|
|
3900
|
-
this.active = null;
|
|
3901
|
-
this.entities = null;
|
|
3902
|
-
this.entityIndex = 0;
|
|
3903
|
-
this.isDirty = false;
|
|
3904
|
-
this.isEditing = false;
|
|
3905
|
-
this.isInvalid = false;
|
|
3906
|
-
this.componentName = '';
|
|
3907
|
-
}
|
|
3908
|
-
}
|
|
3909
|
-
TruWindowAddViewEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowAddViewEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3910
|
-
TruWindowAddViewEventArgs.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowAddViewEventArgs, providedIn: 'root' });
|
|
3911
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowAddViewEventArgs, decorators: [{
|
|
3912
|
-
type: Injectable,
|
|
3913
|
-
args: [{
|
|
3914
|
-
providedIn: 'root'
|
|
3915
|
-
}]
|
|
3916
|
-
}] });
|
|
3917
|
-
|
|
3918
4034
|
class TruExportDialogModule {
|
|
3919
4035
|
}
|
|
3920
4036
|
TruExportDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruExportDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -4203,44 +4319,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
4203
4319
|
}]
|
|
4204
4320
|
}] });
|
|
4205
4321
|
|
|
4206
|
-
class TruSearchGroupEventHandler {
|
|
4207
|
-
constructor() {
|
|
4208
|
-
this.search$ = new EventEmitter();
|
|
4209
|
-
this.filter$ = new EventEmitter();
|
|
4210
|
-
this.clear$ = new BehaviorSubject(null);
|
|
4211
|
-
this.default$ = new BehaviorSubject(null);
|
|
4212
|
-
}
|
|
4213
|
-
onSearch() {
|
|
4214
|
-
return this.search$;
|
|
4215
|
-
}
|
|
4216
|
-
onFilter() {
|
|
4217
|
-
return this.filter$;
|
|
4218
|
-
}
|
|
4219
|
-
onClearValues() {
|
|
4220
|
-
return this.clear$;
|
|
4221
|
-
}
|
|
4222
|
-
onSetDefaults() {
|
|
4223
|
-
return this.default$;
|
|
4224
|
-
}
|
|
4225
|
-
search(entityQuery) {
|
|
4226
|
-
this.search$.emit(entityQuery);
|
|
4227
|
-
}
|
|
4228
|
-
filter(entityQuery) {
|
|
4229
|
-
this.filter$.emit(entityQuery);
|
|
4230
|
-
}
|
|
4231
|
-
clearValues() {
|
|
4232
|
-
this.clear$.next(null);
|
|
4233
|
-
}
|
|
4234
|
-
setDefaults() {
|
|
4235
|
-
this.default$.next(null);
|
|
4236
|
-
}
|
|
4237
|
-
}
|
|
4238
|
-
TruSearchGroupEventHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchGroupEventHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4239
|
-
TruSearchGroupEventHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchGroupEventHandler });
|
|
4240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruSearchGroupEventHandler, decorators: [{
|
|
4241
|
-
type: Injectable
|
|
4242
|
-
}] });
|
|
4243
|
-
|
|
4244
4322
|
class TruPredicateMap {
|
|
4245
4323
|
constructor() { }
|
|
4246
4324
|
}
|
|
@@ -4603,11 +4681,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
4603
4681
|
}]
|
|
4604
4682
|
}] });
|
|
4605
4683
|
|
|
4606
|
-
|
|
4684
|
+
/*
|
|
4685
|
+
* Public API Surface of tru-common-lib
|
|
4686
|
+
*/
|
|
4607
4687
|
|
|
4608
4688
|
/**
|
|
4609
4689
|
* Generated bundle index. Do not edit.
|
|
4610
4690
|
*/
|
|
4611
4691
|
|
|
4612
|
-
export { TruAppEnvironment, TruBreezeContext, TruBreezeContextFactory, TruBreezeMetadataProvider, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruControlComponentConfigBase, TruDataContext, TruDataGrid, TruDataGridModule, TruDataGridTypes, TruDesktop, TruDesktopManager, TruDesktopModule, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGroupBox, TruGroupBoxModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDecimal, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchComponentBase, TruSearchComponentConfigBase, TruSearchConfigBase,
|
|
4692
|
+
export { DetailViewModule, TruAppEnvironment, TruBreezeContext, TruBreezeContextFactory, TruBreezeMetadataProvider, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruControlComponentConfigBase, TruDataContext, TruDataGrid, TruDataGridModule, TruDataGridTypes, TruDesktop, TruDesktopManager, TruDesktopModule, TruDetailViewBase, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGroupBox, TruGroupBoxModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDecimal, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchComponentBase, TruSearchComponentConfigBase, TruSearchConfigBase, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchViewBase, TruSearchViewBaseModule, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruUiNotification, TruUser, TruWindowActionEventHandler, TruWindowAddViewEventArgs, TruWindowEventArgs, TruWindowEventHandler };
|
|
4613
4693
|
//# sourceMappingURL=trudb-tru-common-lib.mjs.map
|