@ts-core/angular 13.1.20 → 13.1.21

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component, ViewContainerRef, Injectable, Directive, Input, Pipe, NgModule, PLATFORM_ID, Inject, InjectionToken, EventEmitter, Output, HostListener, Optional, RendererStyleFlags2, APP_INITIALIZER, RendererFactory2, NgModuleFactory } from '@angular/core';
3
- import { DestroyableContainer, PromiseHandler, ExtendedError, LoadableEvent, Destroyable, IDestroyable, DateUtil, ObservableData, ObjectUtil, ArrayUtil, RemoveFilterableCondition, GetFilterableCondition, Logger, LoggerLevel, DataSourceMapCollectionEvent, FilterableDataSourceMapCollection, PaginableDataSourceMapCollection, PaginableBookmarkDataSourceMapCollection, Loadable, LoadableStatus, TransportTimeoutError, TransportNoConnectionError, FilterableMapCollection, MapCollection, TransportEvent, TransportLocal } from '@ts-core/common';
3
+ import { DestroyableContainer, PromiseHandler, LoadableEvent, Destroyable, ExtendedError, IDestroyable, DateUtil, ObservableData, ObjectUtil, ArrayUtil, RemoveFilterableCondition, GetFilterableCondition, Logger, LoggerLevel, DataSourceMapCollectionEvent, FilterableDataSourceMapCollection, PaginableDataSourceMapCollection, PaginableBookmarkDataSourceMapCollection, Loadable, LoadableStatus, TransportTimeoutError, TransportNoConnectionError, FilterableMapCollection, MapCollection, TransportEvent, TransportLocal } from '@ts-core/common';
4
4
  import * as _ from 'lodash';
5
5
  import * as i1$1 from '@ts-core/frontend';
6
6
  import { Assets, AssetUrlProvider, NativeWindowService, LanguageService, ThemeService, ThemeAssetService, LoadingService, ICookieOptions, DefaultLogger } from '@ts-core/frontend';
@@ -128,6 +128,241 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
128
128
  args: [{ template: '' }]
129
129
  }], ctorParameters: function () { return []; } });
130
130
 
131
+ class ApplicationComponent extends ApplicationBaseComponent {
132
+ // --------------------------------------------------------------------------
133
+ //
134
+ // Private Methods
135
+ //
136
+ // --------------------------------------------------------------------------
137
+ initialize() {
138
+ this.initializeAssets();
139
+ this.initializeTheme();
140
+ this.initializeLanguage();
141
+ }
142
+ initializeAssets() {
143
+ Assets.provider = new AssetUrlProvider(this.settings.assetsUrl);
144
+ }
145
+ initializeTheme() {
146
+ this.theme.initialize(this.settings.themes);
147
+ }
148
+ initializeLanguage() {
149
+ this.language.initialize(`${this.settings.assetsUrl}language/`, this.settings.languages);
150
+ this.language.events.pipe(takeUntil(this.destroyed)).subscribe(data => {
151
+ switch (data.type) {
152
+ case LoadableEvent.COMPLETE:
153
+ this.languageLoadingComplete(data.data);
154
+ break;
155
+ case LoadableEvent.ERROR:
156
+ this.languageLoadingError(data.data, data.error);
157
+ break;
158
+ }
159
+ });
160
+ }
161
+ isReady() {
162
+ return super.isReady() && this.isLanguageLoaded;
163
+ }
164
+ // --------------------------------------------------------------------------
165
+ //
166
+ // Event Handlers
167
+ //
168
+ // --------------------------------------------------------------------------
169
+ languageLoadingComplete(item) {
170
+ this.isLanguageLoaded = true;
171
+ this.setLocale(item);
172
+ this.checkReady();
173
+ }
174
+ viewReadyHandler() {
175
+ this.initialize();
176
+ }
177
+ setLocale(item) {
178
+ moment.locale(item.locale);
179
+ numeral.locale(item.locale);
180
+ }
181
+ }
182
+
183
+ class MessageBaseComponent extends DestroyableContainer {
184
+ // --------------------------------------------------------------------------
185
+ //
186
+ // Constructor
187
+ //
188
+ // --------------------------------------------------------------------------
189
+ constructor(route, language) {
190
+ super();
191
+ this.route = route;
192
+ this.language = language;
193
+ this.refreshText = 'Refresh';
194
+ // this.login.isAutoLogin = true
195
+ this.text = this.getText();
196
+ if (this.language.isLoaded) {
197
+ this.commitLanguageProperties();
198
+ }
199
+ language.completed.pipe(takeUntil(this.destroyed)).subscribe(() => this.commitLanguageProperties());
200
+ }
201
+ // --------------------------------------------------------------------------
202
+ //
203
+ // Private Methods
204
+ //
205
+ // --------------------------------------------------------------------------
206
+ commitLanguageProperties() {
207
+ if (this.language.isHasTranslation('general.refresh')) {
208
+ this.refreshText = this.language.translate('general.refresh');
209
+ }
210
+ }
211
+ getText() {
212
+ let value = this.getValue(this.route.snapshot.queryParams);
213
+ if (_.isNil(value)) {
214
+ value = this.getValue(this.route.snapshot.params);
215
+ }
216
+ return value;
217
+ }
218
+ getValue(data) {
219
+ for (let item of this.getMessageFields()) {
220
+ let value = data[item];
221
+ if (!_.isEmpty(value)) {
222
+ return value;
223
+ }
224
+ }
225
+ return null;
226
+ }
227
+ getMessageFields() {
228
+ return ['text', 'message', 'error'];
229
+ }
230
+ }
231
+
232
+ var QuestionMode;
233
+ (function (QuestionMode) {
234
+ QuestionMode["INFO"] = "INFO";
235
+ QuestionMode["QUESTION"] = "QUESTION";
236
+ })(QuestionMode || (QuestionMode = {}));
237
+ var QuestionEvent;
238
+ (function (QuestionEvent) {
239
+ QuestionEvent["YES"] = "YES";
240
+ QuestionEvent["NOT"] = "NOT";
241
+ QuestionEvent["CLOSE"] = "CLOSE";
242
+ QuestionEvent["CHECK"] = "CHECK";
243
+ QuestionEvent["UNCHECK"] = "UNCHECK";
244
+ })(QuestionEvent || (QuestionEvent = {}));
245
+
246
+ class QuestionManager extends Destroyable {
247
+ // --------------------------------------------------------------------------
248
+ //
249
+ // Constructor
250
+ //
251
+ // --------------------------------------------------------------------------
252
+ constructor(options) {
253
+ super();
254
+ this._isChecked = false;
255
+ this._closePromise = PromiseHandler.create();
256
+ this._yesNotPromise = PromiseHandler.create();
257
+ this.yesText = 'Yes';
258
+ this.notText = 'Not';
259
+ this.closeText = 'Close';
260
+ this.checkText = 'Check';
261
+ this.options = _.assign({
262
+ mode: QuestionMode.INFO,
263
+ isChecked: false,
264
+ yesTextId: 'general.yes',
265
+ notTextId: 'general.not',
266
+ closeTextId: 'general.close'
267
+ }, options);
268
+ this.text = this.options.text;
269
+ this.mode = this.options.mode;
270
+ }
271
+ // --------------------------------------------------------------------------
272
+ //
273
+ // Event Handlers
274
+ //
275
+ // --------------------------------------------------------------------------
276
+ closeClickHandler() {
277
+ this._closePromise.resolve();
278
+ }
279
+ yesClickHandler() {
280
+ this._yesNotPromise.resolve();
281
+ this.closeClickHandler();
282
+ }
283
+ notClickHandler() {
284
+ this._yesNotPromise.reject();
285
+ this.closeClickHandler();
286
+ }
287
+ // --------------------------------------------------------------------------
288
+ //
289
+ // Public Methods
290
+ //
291
+ // --------------------------------------------------------------------------
292
+ destroy() {
293
+ if (this.isDestroyed) {
294
+ return;
295
+ }
296
+ super.destroy();
297
+ this.notClickHandler();
298
+ this._yesNotPromise = null;
299
+ this._closePromise = null;
300
+ }
301
+ // --------------------------------------------------------------------------
302
+ //
303
+ // Interface Properties
304
+ //
305
+ // --------------------------------------------------------------------------
306
+ get yesNotPromise() {
307
+ return this._yesNotPromise.promise;
308
+ }
309
+ get closePromise() {
310
+ return this._closePromise.promise;
311
+ }
312
+ // --------------------------------------------------------------------------
313
+ //
314
+ // Public Properties
315
+ //
316
+ // --------------------------------------------------------------------------
317
+ get isInfo() {
318
+ return this.mode === QuestionMode.INFO;
319
+ }
320
+ get isQuestion() {
321
+ return this.mode === QuestionMode.QUESTION;
322
+ }
323
+ get isChecked() {
324
+ return this._isChecked;
325
+ }
326
+ set isChecked(value) {
327
+ if (value === this._isChecked) {
328
+ return;
329
+ }
330
+ this._isChecked = value;
331
+ // this.content.emit(value ? QuestionEvent.CHECK : QuestionEvent.UNCHECK);
332
+ }
333
+ }
334
+
335
+ class IWindow extends Destroyable {
336
+ constructor() {
337
+ // --------------------------------------------------------------------------
338
+ //
339
+ // Public Methods
340
+ //
341
+ // --------------------------------------------------------------------------
342
+ super(...arguments);
343
+ // --------------------------------------------------------------------------
344
+ //
345
+ // Public Properties
346
+ //
347
+ // --------------------------------------------------------------------------
348
+ this.isOnTop = false;
349
+ this.isDisabled = false;
350
+ this.isMinimized = false;
351
+ }
352
+ }
353
+ var WindowEvent;
354
+ (function (WindowEvent) {
355
+ WindowEvent["OPENED"] = "OPENED";
356
+ WindowEvent["CLOSED"] = "CLOSED";
357
+ WindowEvent["CONTENT_READY"] = "CONTENT_READY";
358
+ WindowEvent["MOVED"] = "EVENT_MOVED";
359
+ WindowEvent["RESIZED"] = "RESIZED";
360
+ WindowEvent["DISABLED_CHANGED"] = "DISABLED_CHANGED";
361
+ WindowEvent["MINIMIZED_CHANGED"] = "MINIMIZED_CHANGED";
362
+ WindowEvent["EXPAND"] = "EXPAND";
363
+ WindowEvent["SET_ON_TOP"] = "SET_ON_TOP";
364
+ })(WindowEvent || (WindowEvent = {}));
365
+
131
366
  class ViewUtil {
132
367
  static get renderer() {
133
368
  if (_.isNil(ViewUtil._renderer)) {
@@ -675,242 +910,6 @@ class ViewUtil {
675
910
  ViewUtil._renderer = null;
676
911
  ViewUtil._document = null;
677
912
 
678
- class ApplicationComponent extends ApplicationBaseComponent {
679
- // --------------------------------------------------------------------------
680
- //
681
- // Private Methods
682
- //
683
- // --------------------------------------------------------------------------
684
- initialize() {
685
- ViewUtil.renderer = this.renderer;
686
- this.initializeAssets();
687
- this.initializeTheme();
688
- this.initializeLanguage();
689
- }
690
- initializeAssets() {
691
- Assets.provider = new AssetUrlProvider(this.settings.assetsUrl);
692
- }
693
- initializeTheme() {
694
- this.theme.initialize(this.settings.themes);
695
- }
696
- initializeLanguage() {
697
- this.language.initialize(`${this.settings.assetsUrl}language/`, this.settings.languages);
698
- this.language.events.pipe(takeUntil(this.destroyed)).subscribe(data => {
699
- switch (data.type) {
700
- case LoadableEvent.COMPLETE:
701
- this.languageLoadingComplete(data.data);
702
- break;
703
- case LoadableEvent.ERROR:
704
- this.languageLoadingError(data.data, data.error);
705
- break;
706
- }
707
- });
708
- }
709
- isReady() {
710
- return super.isReady() && this.isLanguageLoaded;
711
- }
712
- // --------------------------------------------------------------------------
713
- //
714
- // Event Handlers
715
- //
716
- // --------------------------------------------------------------------------
717
- languageLoadingComplete(item) {
718
- this.isLanguageLoaded = true;
719
- this.setLocale(item);
720
- this.checkReady();
721
- }
722
- viewReadyHandler() {
723
- this.initialize();
724
- }
725
- setLocale(item) {
726
- moment.locale(item.locale);
727
- numeral.locale(item.locale);
728
- }
729
- }
730
-
731
- class MessageBaseComponent extends DestroyableContainer {
732
- // --------------------------------------------------------------------------
733
- //
734
- // Constructor
735
- //
736
- // --------------------------------------------------------------------------
737
- constructor(route, language) {
738
- super();
739
- this.route = route;
740
- this.language = language;
741
- this.refreshText = 'Refresh';
742
- // this.login.isAutoLogin = true
743
- this.text = this.getText();
744
- if (this.language.isLoaded) {
745
- this.commitLanguageProperties();
746
- }
747
- language.completed.pipe(takeUntil(this.destroyed)).subscribe(() => this.commitLanguageProperties());
748
- }
749
- // --------------------------------------------------------------------------
750
- //
751
- // Private Methods
752
- //
753
- // --------------------------------------------------------------------------
754
- commitLanguageProperties() {
755
- if (this.language.isHasTranslation('general.refresh')) {
756
- this.refreshText = this.language.translate('general.refresh');
757
- }
758
- }
759
- getText() {
760
- let value = this.getValue(this.route.snapshot.queryParams);
761
- if (_.isNil(value)) {
762
- value = this.getValue(this.route.snapshot.params);
763
- }
764
- return value;
765
- }
766
- getValue(data) {
767
- for (let item of this.getMessageFields()) {
768
- let value = data[item];
769
- if (!_.isEmpty(value)) {
770
- return value;
771
- }
772
- }
773
- return null;
774
- }
775
- getMessageFields() {
776
- return ['text', 'message', 'error'];
777
- }
778
- }
779
-
780
- var QuestionMode;
781
- (function (QuestionMode) {
782
- QuestionMode["INFO"] = "INFO";
783
- QuestionMode["QUESTION"] = "QUESTION";
784
- })(QuestionMode || (QuestionMode = {}));
785
- var QuestionEvent;
786
- (function (QuestionEvent) {
787
- QuestionEvent["YES"] = "YES";
788
- QuestionEvent["NOT"] = "NOT";
789
- QuestionEvent["CLOSE"] = "CLOSE";
790
- QuestionEvent["CHECK"] = "CHECK";
791
- QuestionEvent["UNCHECK"] = "UNCHECK";
792
- })(QuestionEvent || (QuestionEvent = {}));
793
-
794
- class QuestionManager extends Destroyable {
795
- // --------------------------------------------------------------------------
796
- //
797
- // Constructor
798
- //
799
- // --------------------------------------------------------------------------
800
- constructor(options) {
801
- super();
802
- this._isChecked = false;
803
- this._closePromise = PromiseHandler.create();
804
- this._yesNotPromise = PromiseHandler.create();
805
- this.yesText = 'Yes';
806
- this.notText = 'Not';
807
- this.closeText = 'Close';
808
- this.checkText = 'Check';
809
- this.options = _.assign({
810
- mode: QuestionMode.INFO,
811
- isChecked: false,
812
- yesTextId: 'general.yes',
813
- notTextId: 'general.not',
814
- closeTextId: 'general.close'
815
- }, options);
816
- this.text = this.options.text;
817
- this.mode = this.options.mode;
818
- }
819
- // --------------------------------------------------------------------------
820
- //
821
- // Event Handlers
822
- //
823
- // --------------------------------------------------------------------------
824
- closeClickHandler() {
825
- this._closePromise.resolve();
826
- }
827
- yesClickHandler() {
828
- this._yesNotPromise.resolve();
829
- this.closeClickHandler();
830
- }
831
- notClickHandler() {
832
- this._yesNotPromise.reject();
833
- this.closeClickHandler();
834
- }
835
- // --------------------------------------------------------------------------
836
- //
837
- // Public Methods
838
- //
839
- // --------------------------------------------------------------------------
840
- destroy() {
841
- if (this.isDestroyed) {
842
- return;
843
- }
844
- super.destroy();
845
- this.notClickHandler();
846
- this._yesNotPromise = null;
847
- this._closePromise = null;
848
- }
849
- // --------------------------------------------------------------------------
850
- //
851
- // Interface Properties
852
- //
853
- // --------------------------------------------------------------------------
854
- get yesNotPromise() {
855
- return this._yesNotPromise.promise;
856
- }
857
- get closePromise() {
858
- return this._closePromise.promise;
859
- }
860
- // --------------------------------------------------------------------------
861
- //
862
- // Public Properties
863
- //
864
- // --------------------------------------------------------------------------
865
- get isInfo() {
866
- return this.mode === QuestionMode.INFO;
867
- }
868
- get isQuestion() {
869
- return this.mode === QuestionMode.QUESTION;
870
- }
871
- get isChecked() {
872
- return this._isChecked;
873
- }
874
- set isChecked(value) {
875
- if (value === this._isChecked) {
876
- return;
877
- }
878
- this._isChecked = value;
879
- // this.content.emit(value ? QuestionEvent.CHECK : QuestionEvent.UNCHECK);
880
- }
881
- }
882
-
883
- class IWindow extends Destroyable {
884
- constructor() {
885
- // --------------------------------------------------------------------------
886
- //
887
- // Public Methods
888
- //
889
- // --------------------------------------------------------------------------
890
- super(...arguments);
891
- // --------------------------------------------------------------------------
892
- //
893
- // Public Properties
894
- //
895
- // --------------------------------------------------------------------------
896
- this.isOnTop = false;
897
- this.isDisabled = false;
898
- this.isMinimized = false;
899
- }
900
- }
901
- var WindowEvent;
902
- (function (WindowEvent) {
903
- WindowEvent["OPENED"] = "OPENED";
904
- WindowEvent["CLOSED"] = "CLOSED";
905
- WindowEvent["CONTENT_READY"] = "CONTENT_READY";
906
- WindowEvent["MOVED"] = "EVENT_MOVED";
907
- WindowEvent["RESIZED"] = "RESIZED";
908
- WindowEvent["DISABLED_CHANGED"] = "DISABLED_CHANGED";
909
- WindowEvent["MINIMIZED_CHANGED"] = "MINIMIZED_CHANGED";
910
- WindowEvent["EXPAND"] = "EXPAND";
911
- WindowEvent["SET_ON_TOP"] = "SET_ON_TOP";
912
- })(WindowEvent || (WindowEvent = {}));
913
-
914
913
  class WindowConfig extends MatDialogConfig {
915
914
  // --------------------------------------------------------------------------
916
915
  //
@@ -7227,7 +7226,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7227
7226
  class IVICommonOptions extends ICookieOptions {
7228
7227
  }
7229
7228
  function initializerFactory(nativeWindow, rendererFactory2) {
7230
- console.log('initializerFactory called');
7231
7229
  ViewUtil.renderer = rendererFactory2.createRenderer(null, null);
7232
7230
  ViewUtil.document = nativeWindow.document;
7233
7231
  return () => Promise.resolve();