angular-toolbox 0.9.4 → 0.10.0

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 (29) hide show
  1. package/README.md +2 -6
  2. package/esm2022/lib/collection/array-list-event-type.enum.mjs +30 -0
  3. package/esm2022/lib/collection/array-list.event.mjs +23 -0
  4. package/esm2022/lib/collection/array-list.mjs +158 -0
  5. package/esm2022/lib/collection/index.mjs +11 -0
  6. package/esm2022/lib/model/business/index.mjs +2 -1
  7. package/esm2022/lib/model/business/navigator/connection-type.mjs +9 -0
  8. package/esm2022/lib/model/business/navigator/effective-connection-type.mjs +9 -0
  9. package/esm2022/lib/model/business/navigator/index.mjs +4 -0
  10. package/esm2022/lib/model/business/navigator/network-information.mjs +9 -0
  11. package/esm2022/lib/model/service/index.mjs +2 -2
  12. package/esm2022/lib/model/service/version/angular-toolbox-version.service.mjs +4 -4
  13. package/esm2022/lib/model/service/version/index.mjs +3 -0
  14. package/esm2022/public-api.mjs +2 -1
  15. package/fesm2022/angular-toolbox.mjs +244 -5
  16. package/fesm2022/angular-toolbox.mjs.map +1 -1
  17. package/lib/collection/array-list-event-type.enum.d.ts +28 -0
  18. package/lib/collection/array-list.d.ts +111 -0
  19. package/lib/collection/array-list.event.d.ts +29 -0
  20. package/lib/collection/index.d.ts +10 -0
  21. package/lib/model/business/index.d.ts +1 -0
  22. package/lib/model/business/navigator/connection-type.d.ts +11 -0
  23. package/lib/model/business/navigator/effective-connection-type.d.ts +11 -0
  24. package/lib/model/business/navigator/index.d.ts +3 -0
  25. package/lib/model/business/navigator/network-information.d.ts +48 -0
  26. package/lib/model/service/index.d.ts +1 -1
  27. package/lib/model/service/version/index.d.ts +2 -0
  28. package/package.json +1 -1
  29. package/public-api.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, NgModule, Component, EventEmitter, Directive, Output, Input, HostListener, Inject, inject, Pipe } from '@angular/core';
2
+ import { Injectable, NgModule, EventEmitter, Component, Directive, Output, Input, HostListener, Inject, inject, Pipe } from '@angular/core';
3
3
  import * as i1 from '@angular/router';
4
4
  import { RouterModule } from '@angular/router';
5
5
  import { DOCUMENT, XhrFactory } from '@angular/common';
@@ -542,9 +542,9 @@ class AbstractVersionManager {
542
542
  */
543
543
  const LAYERS_VERSION_CONFIG = {
544
544
  major: 0,
545
- minor: 9,
546
- patch: 4,
547
- buildTimestamp: 1720937502057,
545
+ minor: 10,
546
+ patch: 0,
547
+ buildTimestamp: 1721217723149,
548
548
  metadata: "beta"
549
549
  };
550
550
  /**
@@ -586,6 +586,221 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
586
586
  }]
587
587
  }] });
588
588
 
589
+ /**
590
+ * @license
591
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
592
+ *
593
+ * Use of this source code is governed by an MIT-style license that can be
594
+ * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
595
+ */
596
+ /**
597
+ * The `ArrayListEvent` class represents an event that is dispatched when the associated collection changes.
598
+ */
599
+ class ArrayListEvent {
600
+ /**
601
+ * Represents events dispatched by the `ArrayList` class.
602
+ *
603
+ * @param type The type of the event.
604
+ * @param list The reference to the `ArrayList` instance that dispatches this event.
605
+ */
606
+ constructor(type, list) {
607
+ this.type = type;
608
+ this.list = list;
609
+ }
610
+ }
611
+
612
+ /**
613
+ * @license
614
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
615
+ *
616
+ * Use of this source code is governed by an MIT-style license that can be
617
+ * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
618
+ */
619
+ /**
620
+ * The `ArrayListEventType` class the type of events on an `ArrayListEvent` object.
621
+ */
622
+ var ArrayListEventType;
623
+ (function (ArrayListEventType) {
624
+ /**
625
+ * The type of event associated with the `ArrayList.addAll` action.
626
+ */
627
+ ArrayListEventType["ADD_ALL"] = "addAll";
628
+ /**
629
+ * The type of event associated with the `ArrayList.addItem`, or `ArrayList.addItemAt` actions.
630
+ */
631
+ ArrayListEventType["ADD"] = "add";
632
+ /**
633
+ * The type of event associated with the `ArrayList.removeAll` action.
634
+ */
635
+ ArrayListEventType["REMOVE_ALL"] = "removeAll";
636
+ /**
637
+ * The type of event associated with the `ArrayList.remove`, or `ArrayList.removeAt` actions.
638
+ */
639
+ ArrayListEventType["REMOVE"] = "remove";
640
+ })(ArrayListEventType || (ArrayListEventType = {}));
641
+
642
+ /**
643
+ * @license
644
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
645
+ *
646
+ * Use of this source code is governed by an MIT-style license that can be
647
+ * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
648
+ */
649
+ /**
650
+ * The `ArrayList` class uses a backing `Array` as the source of the data collection. Items in the backing
651
+ * `Array` can be accessed and manipulated using the methods and properties of the `ArrayList` instance.
652
+ * Operations on an `ArrayList` instance modify the data source.
653
+ *
654
+ * You typically use the `ArrayList` class as base class for services that persist data in the User Interface.
655
+ */
656
+ class ArrayList extends IdentifiableComponent {
657
+ /**
658
+ * Gets the number of items in the list.
659
+ */
660
+ get length() {
661
+ return this.__list__.length;
662
+ }
663
+ /**
664
+ * @private
665
+ */
666
+ constructor(classRef = undefined) {
667
+ super(classRef || "ArrayList");
668
+ /**
669
+ * Dispatches events each time this `ArrayList` is modified.
670
+ */
671
+ this.change = new EventEmitter();
672
+ /**
673
+ * @private
674
+ * The array used as a source for the `ArrayList`.
675
+ */
676
+ this.__list__ = [];
677
+ }
678
+ /**
679
+ * Adds a list of items to the current `ArrayList` instance, placing them at the end of the
680
+ * list in the order they are passed.
681
+ *
682
+ * @param addList The list of items to add to this current `ArrayList` instance.
683
+ *
684
+ * @return A reference to this `ArrayList` instance.
685
+ */
686
+ addAll(addList) {
687
+ this.__list__.push(...addList);
688
+ this.dispatchEvent(ArrayListEventType.ADD_ALL);
689
+ return this;
690
+ }
691
+ /**
692
+ * Adds the specified item to the end of the list.
693
+ *
694
+ * @param item The item to add.
695
+ *
696
+ * @return A reference to this `ArrayList` instance.
697
+ */
698
+ addItem(item) {
699
+ this.__list__.push(item);
700
+ this.dispatchEvent(ArrayListEventType.ADD);
701
+ return this;
702
+ }
703
+ /**
704
+ * Adds the item at the specified index.
705
+ *
706
+ * @param item The item to place at the index.
707
+ * @param index The index at which to place the item.
708
+ *
709
+ * @return A reference to this `ArrayList` instance.
710
+ */
711
+ addItemAt(item, index) {
712
+ if (index < 0)
713
+ throw new RangeError("index must be greater that 0");
714
+ const len = this.__list__.length;
715
+ if (index > len)
716
+ throw new RangeError(`index exceeds the number of list elements. Index must not exceed ${len}.`);
717
+ this.__list__.splice(index, 0, item);
718
+ this.dispatchEvent(ArrayListEventType.ADD);
719
+ return this;
720
+ }
721
+ /**
722
+ * Gets the item at the specified index.
723
+ *
724
+ * @param index The index in the list from which to retrieve the item.
725
+ *
726
+ * @returns The item at that index, `undefined` if there is none.
727
+ */
728
+ getItemAt(index) {
729
+ return this.__list__[index];
730
+ }
731
+ /**
732
+ * Returns the index of the item if it is in the list.
733
+ *
734
+ * @param item The item to find.
735
+ *
736
+ * @returns The index of the item, `-1` if the item is not in the list.
737
+ */
738
+ getItemIndex(item) {
739
+ return this.__list__.findIndex(elm => elm === item);
740
+ }
741
+ /**
742
+ * Removes all items from the list.
743
+ *
744
+ * @return A reference to this `ArrayList` instance.
745
+ */
746
+ removeAll() {
747
+ this.__list__.length = 0;
748
+ this.dispatchEvent(ArrayListEventType.REMOVE_ALL);
749
+ return this;
750
+ }
751
+ /**
752
+ * Removes the specified item from this list.
753
+ *
754
+ * @param item Reference to the item that should be removed.
755
+ *
756
+ * @returns `true` whether if the item was removed; `false` otherwise.
757
+ */
758
+ removeItem(item) {
759
+ const idx = this.getItemIndex(item);
760
+ if (idx === -1)
761
+ return false;
762
+ this.__list__.splice(idx, 1);
763
+ this.dispatchEvent(ArrayListEventType.REMOVE);
764
+ return true;
765
+ }
766
+ /**
767
+ * Removes the item at the specified index and returns it.
768
+ * Any items that were after this index are now one index earlier.
769
+ *
770
+ * @param index The index from which to remove the item.
771
+
772
+ * @returns The item that was removed.
773
+ */
774
+ removeItemAt(index) {
775
+ const result = this.__list__.splice(index, 1)[0];
776
+ this.dispatchEvent(ArrayListEventType.REMOVE);
777
+ return result;
778
+ }
779
+ /**
780
+ * Returns an array that is populated in the same order as this `ArrayList` instance.
781
+ *
782
+ * @returns An array that is populated in the same order as this `ArrayList` instance.
783
+ */
784
+ toArray() {
785
+ return this.__list__.slice(0);
786
+ }
787
+ /**
788
+ * @private
789
+ */
790
+ dispatchEvent(type) {
791
+ const event = new ArrayListEvent(type, this);
792
+ this.change.emit(event);
793
+ }
794
+ }
795
+
796
+ /**
797
+ * @license
798
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
799
+ *
800
+ * Use of this source code is governed by an MIT-style license that can be
801
+ * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
802
+ */
803
+
589
804
  /**
590
805
  * @license
591
806
  * Copyright Pascal ECHEMANN. All Rights Reserved.
@@ -1146,6 +1361,30 @@ const DARK_MODE_CONFIG = {
1146
1361
  * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
1147
1362
  */
1148
1363
 
1364
+ /**
1365
+ * @license
1366
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
1367
+ *
1368
+ * Use of this source code is governed by an MIT-style license that can be found in
1369
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
1370
+ */
1371
+
1372
+ /**
1373
+ * @license
1374
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
1375
+ *
1376
+ * Use of this source code is governed by an MIT-style license that can be found in
1377
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
1378
+ */
1379
+
1380
+ /**
1381
+ * @license
1382
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
1383
+ *
1384
+ * Use of this source code is governed by an MIT-style license that can be found in
1385
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
1386
+ */
1387
+
1149
1388
  /**
1150
1389
  * @license
1151
1390
  * Copyright Pascal ECHEMANN. All Rights Reserved.
@@ -3841,5 +4080,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
3841
4080
  * Generated bundle index. Do not edit.
3842
4081
  */
3843
4082
 
3844
- export { APP_PRIDGE_REF, AbstractSubscriptionManager, AbstractVersionManager, AnchorLinklDirective, AngularToolboxLogoComponent, AngularToolboxModule, AppBridgeError, AppBrigeService, BIGINT, BOOLEAN, BUTTON_ROLE, ButtonRoleDirective, CSS_PROP, ContentRendererDirective, DARK_MODE_CONFIG, DarkModeService, EMPTY_STRING, FUNCTION, HTTP_MOCK_SERVICE, HttpHeadersMockBuilder, HttpMock, HttpMockService, HttpMockServiceError, HttpResponseMockBuilder, IdentifiableComponent, IntegrityError, LINK_ROLE, NUMBER, NavigateToUrlDirective, OBJECT, STORAGE_KEY, STRING, SYMBOL, SafeHtmlPipe, ScrollService, SubscriptionError, SubscriptionService, UNDEFINED, Uuid, VERSION_CONFIG, VersionService, httpHeadersMock, httpMockFactory, httpResponseMock };
4083
+ export { APP_PRIDGE_REF, AbstractSubscriptionManager, AbstractVersionManager, AnchorLinklDirective, AngularToolboxLogoComponent, AngularToolboxModule, AngularToolboxVersionService, AppBridgeError, AppBrigeService, ArrayList, ArrayListEvent, ArrayListEventType, BIGINT, BOOLEAN, BUTTON_ROLE, ButtonRoleDirective, CSS_PROP, ContentRendererDirective, DARK_MODE_CONFIG, DarkModeService, EMPTY_STRING, FUNCTION, HTTP_MOCK_SERVICE, HttpHeadersMockBuilder, HttpMock, HttpMockService, HttpMockServiceError, HttpResponseMockBuilder, IdentifiableComponent, IntegrityError, LINK_ROLE, NUMBER, NavigateToUrlDirective, OBJECT, STORAGE_KEY, STRING, SYMBOL, SafeHtmlPipe, ScrollService, SubscriptionError, SubscriptionService, UNDEFINED, Uuid, VERSION_CONFIG, VersionService, httpHeadersMock, httpMockFactory, httpResponseMock };
3845
4084
  //# sourceMappingURL=angular-toolbox.mjs.map