@trudb/tru-common-lib 0.0.207 → 0.0.210

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.
Files changed (33) hide show
  1. package/esm2020/lib/base-classes/tru-property-config-base.mjs +10 -10
  2. package/esm2020/lib/classes/tru-property-config-decimal.mjs +5 -5
  3. package/esm2020/lib/classes/tru-property-config-foreign-key.mjs +4 -4
  4. package/esm2020/lib/classes/tru-property-config-integer.mjs +3 -3
  5. package/esm2020/lib/classes/tru-property-config-password.mjs +2 -2
  6. package/esm2020/lib/classes/tru-property-config-percentage.mjs +3 -3
  7. package/esm2020/lib/classes/tru-property-config-scientific.mjs +3 -3
  8. package/esm2020/lib/classes/tru-property-config-text-choices.mjs +2 -2
  9. package/esm2020/lib/classes/tru-property-config-text.mjs +4 -4
  10. package/esm2020/lib/classes/tru-property-config-usa-address.mjs +2 -2
  11. package/esm2020/lib/classes/tru-property-config-zip-code.mjs +2 -2
  12. package/esm2020/lib/components/desktop/services/tru-desktop-manager.mjs +10 -7
  13. package/esm2020/lib/components/desktop/services/tru-desktop-service.mjs +2 -3
  14. package/esm2020/lib/components/desktop/services/tru-window-event-args.mjs +2 -1
  15. package/fesm2015/trudb-tru-common-lib.mjs +66 -64
  16. package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
  17. package/fesm2020/trudb-tru-common-lib.mjs +66 -64
  18. package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
  19. package/lib/base-classes/tru-property-config-base.d.ts +9 -9
  20. package/lib/classes/tru-property-config-decimal.d.ts +4 -4
  21. package/lib/classes/tru-property-config-foreign-key.d.ts +3 -3
  22. package/lib/classes/tru-property-config-integer.d.ts +2 -2
  23. package/lib/classes/tru-property-config-password.d.ts +1 -1
  24. package/lib/classes/tru-property-config-percentage.d.ts +2 -2
  25. package/lib/classes/tru-property-config-scientific.d.ts +2 -2
  26. package/lib/classes/tru-property-config-text-choices.d.ts +1 -1
  27. package/lib/classes/tru-property-config-text.d.ts +3 -3
  28. package/lib/classes/tru-property-config-usa-address.d.ts +1 -1
  29. package/lib/classes/tru-property-config-zip-code.d.ts +1 -1
  30. package/lib/components/desktop/services/tru-desktop-manager.d.ts +4 -2
  31. package/lib/components/desktop/services/tru-desktop-service.d.ts +2 -1
  32. package/lib/components/desktop/services/tru-window-event-args.d.ts +2 -0
  33. package/package.json +1 -1
@@ -50,15 +50,15 @@ class TruEntityBase {
50
50
 
51
51
  class TruPropertyConfigBase {
52
52
  constructor() {
53
- this.IsNullable = false;
54
- this.CanDisplay = false;
55
- this.CanEdit = false;
56
- this.GlobalCache = false;
57
- this.UniqueConstraint = false;
58
- this.TypeName = undefined;
59
- this.FormatterName = undefined;
60
- this.Choices = undefined;
61
- this.Validation = undefined;
53
+ this.isNullable = false;
54
+ this.canDisplay = false;
55
+ this.canEdit = false;
56
+ this.globalCache = false;
57
+ this.uniqueConstraint = false;
58
+ this.typeName = undefined;
59
+ this.formatterName = undefined;
60
+ this.choices = undefined;
61
+ this.validation = undefined;
62
62
  }
63
63
  }
64
64
 
@@ -183,6 +183,7 @@ class TruWindowEventArgs {
183
183
  this.height = '450px';
184
184
  this.width = '900px';
185
185
  this.views = [{}];
186
+ this.contextFilters = [];
186
187
  }
187
188
  }
188
189
  TruWindowEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -194,6 +195,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
194
195
  }]
195
196
  }] });
196
197
 
198
+ class TruContextFilters {
199
+ constructor() {
200
+ this.filters = [];
201
+ this.selectedContextFilterChoices = [];
202
+ this.valueFor = (tableName) => {
203
+ let choice = this.selectedContextFilterChoices.find(f => f.table === tableName);
204
+ if (!choice)
205
+ throw new Error('ContextFilterChoice not found. Possible invalid configuration.');
206
+ return choice.ref;
207
+ };
208
+ this.label = () => {
209
+ let label = '';
210
+ this.selectedContextFilterChoices.forEach((filter) => {
211
+ label += filter.table + ': ' + filter.label + ' ';
212
+ });
213
+ return label;
214
+ };
215
+ }
216
+ }
217
+ TruContextFilters.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruContextFilters, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
218
+ TruContextFilters.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruContextFilters, providedIn: 'root' });
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruContextFilters, decorators: [{
220
+ type: Injectable,
221
+ args: [{
222
+ providedIn: 'root',
223
+ }]
224
+ }], ctorParameters: function () { return []; } });
225
+
197
226
  class TruWindowEventHandler {
198
227
  constructor() {
199
228
  this.open$ = new Subject();
@@ -229,13 +258,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
229
258
  }] });
230
259
 
231
260
  class TruDesktopManager {
232
- constructor(truWindowEventHandler) {
233
- this.truWindowEventHandler = truWindowEventHandler;
261
+ constructor(contextFilters, windowEventHandler) {
262
+ this.contextFilters = contextFilters;
263
+ this.windowEventHandler = windowEventHandler;
234
264
  this.getWindowEvent = (tableName, tablePluralName, tablePluralLabel, componentName, data) => {
235
265
  var windowEvent = new TruWindowEventArgs();
236
266
  windowEvent.tableName = tableName;
237
267
  windowEvent.tablePluralName = tablePluralName;
238
268
  windowEvent.tablePluralLabel = tablePluralLabel;
269
+ windowEvent.contextFilters = this.contextFilters.filters;
239
270
  windowEvent.views = [
240
271
  {
241
272
  active: true,
@@ -258,7 +289,7 @@ class TruDesktopManager {
258
289
  * directive, then shows its window instead of creating a new one.
259
290
  */
260
291
  this.addWindow = (tableName, tablePluralName, tablePluralLabel, componentName, data = null, showNavigation = true, showIfExists) => {
261
- this.truWindowEventHandler.open(this.getWindowEvent(tableName, tablePluralName, tablePluralLabel, componentName, data));
292
+ this.windowEventHandler.open(this.getWindowEvent(tableName, tablePluralName, tablePluralLabel, componentName, data));
262
293
  };
263
294
  this.windowTitlesByBaseText = {};
264
295
  /**
@@ -296,14 +327,14 @@ class TruDesktopManager {
296
327
  };
297
328
  }
298
329
  }
299
- TruDesktopManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, deps: [{ token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Injectable });
330
+ TruDesktopManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, deps: [{ token: TruContextFilters }, { token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Injectable });
300
331
  TruDesktopManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, providedIn: 'root' });
301
332
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, decorators: [{
302
333
  type: Injectable,
303
334
  args: [{
304
335
  providedIn: 'root',
305
336
  }]
306
- }], ctorParameters: function () { return [{ type: TruWindowEventHandler }]; } });
337
+ }], ctorParameters: function () { return [{ type: TruContextFilters }, { type: TruWindowEventHandler }]; } });
307
338
 
308
339
  class TruSearchViewBase {
309
340
  constructor(desktopManager, truWindowEventHandler) {
@@ -654,9 +685,9 @@ class TruPredicate {
654
685
  class TruPropertyConfigForeignKey extends TruPropertyConfigBase {
655
686
  constructor() {
656
687
  super();
657
- this.Table = undefined;
658
- this.ForeignTableName = undefined;
659
- this.ChoicesQuery = undefined;
688
+ this.table = undefined;
689
+ this.foreignTableName = undefined;
690
+ this.choicesQuery = undefined;
660
691
  }
661
692
  }
662
693
 
@@ -667,71 +698,71 @@ class TruPropertyConfigCloudFile extends TruPropertyConfigForeignKey {
667
698
  class TruPropertyConfigDecimal extends TruPropertyConfigBase {
668
699
  constructor() {
669
700
  super();
670
- this.DecimalPlaces = undefined;
671
- this.TotalDigits = undefined;
672
- this.MinimumValue = undefined;
673
- this.MaximumValue = undefined;
701
+ this.decimalPlaces = undefined;
702
+ this.totalDigits = undefined;
703
+ this.minimumValue = undefined;
704
+ this.maximumValue = undefined;
674
705
  }
675
706
  }
676
707
 
677
708
  class TruPropertyConfigInteger extends TruPropertyConfigBase {
678
709
  constructor() {
679
710
  super();
680
- this.MinimumValue = undefined;
681
- this.MaximumValue = undefined;
711
+ this.minimumValue = undefined;
712
+ this.maximumValue = undefined;
682
713
  }
683
714
  }
684
715
 
685
716
  class TruPropertyConfigText extends TruPropertyConfigBase {
686
717
  constructor() {
687
718
  super();
688
- this.MaxLength = undefined;
689
- this.MinLength = undefined;
690
- this.Unbounded = undefined;
719
+ this.maxLength = undefined;
720
+ this.minLength = undefined;
721
+ this.unbounded = undefined;
691
722
  }
692
723
  }
693
724
 
694
725
  class TruPropertyConfigPassword extends TruPropertyConfigText {
695
726
  constructor() {
696
727
  super();
697
- this.EncryptionType = undefined;
728
+ this.encryptionType = undefined;
698
729
  }
699
730
  }
700
731
 
701
732
  class TruPropertyConfigPercentage extends TruPropertyConfigBase {
702
733
  constructor() {
703
734
  super();
704
- this.MinimumValue = undefined;
705
- this.MaximumValue = undefined;
735
+ this.minimumValue = undefined;
736
+ this.maximumValue = undefined;
706
737
  }
707
738
  }
708
739
 
709
740
  class TruPropertyConfigScientific extends TruPropertyConfigBase {
710
741
  constructor() {
711
742
  super();
712
- this.MinimumValue = undefined;
713
- this.MaximumValue = undefined;
743
+ this.minimumValue = undefined;
744
+ this.maximumValue = undefined;
714
745
  }
715
746
  }
716
747
 
717
748
  class TruPropertyConfigTextChoices extends TruPropertyConfigText {
718
749
  constructor() {
719
750
  super();
720
- this.Choices = {};
751
+ this.choices = {};
721
752
  }
722
753
  }
723
754
 
724
755
  class TruPropertyConfigUsaAddress extends TruPropertyConfigBase {
725
756
  constructor() {
726
757
  super();
727
- this.RequireZipPlusFour = undefined;
758
+ this.requireZipPlusFour = undefined;
728
759
  }
729
760
  }
730
761
 
731
762
  class TruPropertyConfigZipCode extends TruPropertyConfigBase {
732
763
  constructor() {
733
764
  super();
734
- this.RequireZipPlusFour = undefined;
765
+ this.requireZipPlusFour = undefined;
735
766
  }
736
767
  }
737
768
 
@@ -2035,34 +2066,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
2035
2066
  }]
2036
2067
  }] });
2037
2068
 
2038
- class TruContextFilters {
2039
- constructor() {
2040
- this.filters = [];
2041
- this.selectedContextFilterChoices = [];
2042
- this.valueFor = (tableName) => {
2043
- let choice = this.selectedContextFilterChoices.find(f => f.table === tableName);
2044
- if (!choice)
2045
- throw new Error('ContextFilterChoice not found. Possible invalid configuration.');
2046
- return choice.ref;
2047
- };
2048
- this.label = () => {
2049
- let label = '';
2050
- this.selectedContextFilterChoices.forEach((filter) => {
2051
- label += filter.table + ': ' + filter.label + ' ';
2052
- });
2053
- return label;
2054
- };
2055
- }
2056
- }
2057
- TruContextFilters.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruContextFilters, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2058
- TruContextFilters.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruContextFilters, providedIn: 'root' });
2059
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruContextFilters, decorators: [{
2060
- type: Injectable,
2061
- args: [{
2062
- providedIn: 'root',
2063
- }]
2064
- }], ctorParameters: function () { return []; } });
2065
-
2066
2069
  class TruToolbarContextFilter {
2067
2070
  constructor(truContextFilters) {
2068
2071
  this.truContextFilters = truContextFilters;
@@ -2391,14 +2394,13 @@ class WindowConfig {
2391
2394
  this.width = '400px';
2392
2395
  this.views = Array();
2393
2396
  this.zIndex = -1;
2394
- this.context = undefined;
2395
2397
  this.isReadOnly = false;
2396
2398
  this.unsubscribes = [];
2397
2399
  this.wasReadOnly = false;
2400
+ this.contextFilters = [];
2398
2401
  this.destroy = () => {
2399
2402
  while (this.unsubscribes.length)
2400
2403
  this?.unsubscribes?.shift()?.call();
2401
- this.context = undefined;
2402
2404
  };
2403
2405
  }
2404
2406
  }