@coolon/angular-ui-powerups 16.1.0-alpha.222 → 16.1.0-alpha.224
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/esm2022/lib/components/cards/abstract-card-container.component.mjs +1 -1
- package/esm2022/lib/components/commands/command/command.component.mjs +1 -1
- package/esm2022/lib/components/commands/group/popup-aware.component.mjs +1 -1
- package/esm2022/lib/components/commands/group/popup-container.mjs +1 -1
- package/esm2022/lib/components/commands/group/popup-menu/abstract-popup-menu.component.mjs +1 -1
- package/esm2022/lib/components/commands/group/popup-menu/more-menu.component.mjs +1 -1
- package/esm2022/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.mjs +1 -1
- package/esm2022/lib/components/commands/group/popup-menu/popup-menu.component.mjs +1 -1
- package/esm2022/lib/components/commands/separator.component.mjs +1 -1
- package/esm2022/lib/components/components.module.mjs +3 -3
- package/esm2022/lib/components/file/file-download/file-download.component.mjs +1 -1
- package/esm2022/lib/components/forms/abstract-input.component.mjs +1 -1
- package/esm2022/lib/components/forms/string-input/string-input.component.mjs +1 -1
- package/esm2022/lib/components/loadable-component.mjs +1 -1
- package/esm2022/lib/components/resize-aware.component.mjs +1 -1
- package/esm2022/lib/components/tables/abstract-table-model.mjs +1 -1
- package/esm2022/lib/components/tables/abstract-table.component.mjs +1 -1
- package/esm2022/lib/components/tables/column/column-manager.mjs +1 -1
- package/esm2022/lib/components/tables/column/column-model.mjs +1 -1
- package/esm2022/lib/components/tables/column/column-order-manager.mjs +1 -1
- package/esm2022/lib/components/tables/column/custom-template-column-model.mjs +1 -1
- package/esm2022/lib/components/tables/column/custom-value-column-model.mjs +1 -1
- package/esm2022/lib/components/tables/column/list-propery-column-model.mjs +1 -1
- package/esm2022/lib/components/tables/column/property-column-model.mjs +1 -1
- package/esm2022/lib/components/tables/column/selection-column-model.mjs +1 -1
- package/esm2022/lib/components/tables/filter/enable-cell-text-search.decorator.mjs +1 -1
- package/esm2022/lib/components/tables/filter/table-filter-model.mjs +1 -1
- package/esm2022/lib/components/tables/footer/footer-row-model.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/abstract-cell-renderer.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/cell-portal-ref.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/default-cell-renderer/default-cell-renderer.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/editable-cell-renderer.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/select-header-cell/selection-header-cell.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-action-column/menu-builder.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-action-column/table-action-column.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-body/table-body.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-cell/table-cell.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-custom-more-menu/table-custom-more-menu-popup.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-custom-more-menu/table-custom-more-menu.component.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-footer-row/table-footer-row.component.mjs +1 -1
- package/esm2022/lib/components/tables/table/table-model.mjs +1 -1
- package/esm2022/lib/components/tables/table/table.component.mjs +1 -1
- package/esm2022/lib/components/tables/tree-table/flattened-tree-list-model.mjs +1 -1
- package/esm2022/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.mjs +1 -2
- package/esm2022/lib/components/tables/tree-table/tree-label-column-model.mjs +1 -1
- package/esm2022/lib/components/tables/tree-table/tree-table-component.mjs +1 -1
- package/esm2022/lib/components/tables/tree-table/tree-table-model.mjs +1 -1
- package/esm2022/lib/directives/directives.module.mjs +1 -1
- package/esm2022/lib/directives/highlight.pipe.mjs +1 -1
- package/esm2022/lib/directives/resize-observer.directive.mjs +1 -1
- package/esm2022/lib/interaction/abstract-interaction-context.mjs +1 -1
- package/esm2022/lib/interaction/activity-context.mjs +1 -1
- package/esm2022/lib/interaction/activity-ref.mjs +1 -1
- package/esm2022/lib/interaction/activity.mjs +1 -1
- package/esm2022/lib/interaction/components/abstract-confirm-dialog.component.mjs +1 -1
- package/esm2022/lib/interaction/components/abstract-dialog.component.mjs +1 -1
- package/esm2022/lib/interaction/components/activity-container/activity-container.component.mjs +1 -1
- package/esm2022/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.mjs +1 -1
- package/esm2022/lib/interaction/components/activity-triggers/abstract-activity-trigger.component.mjs +1 -1
- package/esm2022/lib/interaction/components/activity-triggers/inline-activity-trigger/inline-activity-trigger.component.mjs +1 -1
- package/esm2022/lib/interaction/components/activity-triggers/modal-activity-trigger/modal-activity-trigger.component.mjs +1 -1
- package/esm2022/lib/interaction/components/activity-triggers/popup-activity-trigger/popup-activity-trigger.component.mjs +1 -1
- package/esm2022/lib/interaction/components/add-card-activity/add-card-activity.component.mjs +1 -1
- package/esm2022/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.mjs +1 -1
- package/esm2022/lib/interaction/components/alert-dialog/alert-dialog.component.mjs +1 -1
- package/esm2022/lib/interaction/components/alert-renderer/alert-renderer.component.mjs +1 -1
- package/esm2022/lib/interaction/components/confirm-renderer/confirm-renderer.component.mjs +1 -1
- package/esm2022/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.mjs +1 -1
- package/esm2022/lib/interaction/components/confirm-then-execute-dialog/confirm-then-execute-dialog.component.mjs +1 -1
- package/esm2022/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.mjs +1 -1
- package/esm2022/lib/interaction/components/editors/inline-string-editor/inline-editor-model.mjs +1 -1
- package/esm2022/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.mjs +1 -1
- package/esm2022/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.mjs +1 -1
- package/esm2022/lib/interaction/components/input-activities/input-activity.mjs +1 -1
- package/esm2022/lib/interaction/components/input-activities/select-input-activity.mjs +1 -1
- package/esm2022/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.mjs +1 -1
- package/esm2022/lib/interaction/components/slide-down-interaction-context/slide-down-interaction-context.component.mjs +1 -1
- package/esm2022/lib/interaction/directives/interaction-context-trigger-for.directive.mjs +1 -1
- package/esm2022/lib/interaction/in-place-interaction-context.mjs +1 -1
- package/esm2022/lib/interaction/interaction-context-provider.mjs +1 -1
- package/esm2022/lib/interaction/interaction-context.mjs +1 -1
- package/esm2022/lib/interaction/interaction.module.mjs +2 -2
- package/esm2022/lib/interaction/route-synchronisation-adapter.mjs +1 -1
- package/esm2022/lib/interaction/services/interaction-service-routing-adapter.mjs +1 -1
- package/esm2022/lib/interaction/services/interaction.service.mjs +1 -1
- package/esm2022/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.mjs +1 -1
- package/esm2022/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.mjs +1 -1
- package/esm2022/lib/interaction/services/modal-interaction-context.factory.mjs +1 -1
- package/esm2022/lib/place/components/abstract-place-navigation.component.mjs +1 -1
- package/esm2022/lib/place/components/place-outlet/place-outlet.component.mjs +1 -1
- package/esm2022/lib/place/guards/place.guard.mjs +1 -1
- package/esm2022/lib/place/navigation/place-component-deactivation-handler.mjs +1 -1
- package/esm2022/lib/place/navigation/session/abstract-pop-state-navigation.mjs +1 -1
- package/esm2022/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.mjs +1 -1
- package/esm2022/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-navigation-interaction-cancelation-type-determined.mjs +1 -1
- package/esm2022/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.mjs +1 -1
- package/esm2022/lib/place/navigation/session/interactions/navigating-during-interaction.mjs +1 -1
- package/esm2022/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.mjs +1 -1
- package/esm2022/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.mjs +1 -1
- package/esm2022/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.mjs +1 -1
- package/esm2022/lib/place/navigation/session/navigating.mjs +1 -1
- package/esm2022/lib/place/navigation/session/navigation-context.mjs +1 -1
- package/esm2022/lib/place/navigation/session/navigation-session.mjs +10 -1
- package/esm2022/lib/place/navigation/session/pop-state-navigation.mjs +1 -1
- package/esm2022/lib/place/place-access-guard.mjs +1 -1
- package/esm2022/lib/place/place-auth-service.mjs +3 -3
- package/esm2022/lib/place/place-component.mjs +22 -20
- package/esm2022/lib/place/place-definition.mjs +1 -1
- package/esm2022/lib/place/place-history.mjs +1 -1
- package/esm2022/lib/place/place-metadata.mjs +16 -0
- package/esm2022/lib/place/place-router.mjs +92 -17
- package/esm2022/lib/place/place.module.mjs +2 -2
- package/esm2022/lib/place/route/parameter-decorators.mjs +2 -2
- package/esm2022/lib/place/route/parameter-definition.mjs +1 -1
- package/esm2022/lib/place/route/parameter-sanitiser.mjs +1 -1
- package/esm2022/lib/place/route/parameter-snapshot.mjs +1 -1
- package/esm2022/lib/place/route/visit-segment-sanitiser.mjs +1 -1
- package/esm2022/lib/place/url-service.mjs +1 -1
- package/esm2022/lib/place/url-snapshot.mjs +1 -1
- package/esm2022/lib/place/visit-segment.mjs +1 -1
- package/esm2022/lib/place/visit.mjs +4 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +508 -409
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/commands/group/popup-aware.component.d.ts +1 -1
- package/lib/components/commands/group/popup-container.d.ts +1 -1
- package/lib/components/commands/group/popup-menu/abstract-popup-menu.component.d.ts +1 -1
- package/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.d.ts +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +1 -1
- package/lib/components/resize-aware.component.d.ts +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +7 -7
- package/lib/components/tables/abstract-table.component.d.ts +2 -2
- package/lib/components/tables/column/column-manager.d.ts +1 -1
- package/lib/components/tables/column/column-model.d.ts +5 -5
- package/lib/components/tables/column/column-order-manager.d.ts +1 -1
- package/lib/components/tables/column/custom-template-column-model.d.ts +1 -1
- package/lib/components/tables/column/custom-value-column-model.d.ts +2 -2
- package/lib/components/tables/column/list-propery-column-model.d.ts +2 -2
- package/lib/components/tables/column/property-column-model.d.ts +4 -4
- package/lib/components/tables/column/selection-column-model.d.ts +1 -1
- package/lib/components/tables/filter/enable-cell-text-search.decorator.d.ts +1 -1
- package/lib/components/tables/filter/table-filter-model.d.ts +1 -1
- package/lib/components/tables/renderer/abstract-cell-renderer.d.ts +1 -1
- package/lib/components/tables/renderer/cell-portal-ref.d.ts +3 -3
- package/lib/components/tables/renderer/default-cell-renderer/default-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/renderer/editable-cell-renderer.d.ts +1 -1
- package/lib/components/tables/renderer/table-action-column/menu-builder.d.ts +1 -1
- package/lib/components/tables/renderer/table-action-column/table-action-column.component.d.ts +4 -4
- package/lib/components/tables/renderer/table-body/table-body.component.d.ts +1 -1
- package/lib/components/tables/renderer/table-cell/table-cell.component.d.ts +1 -1
- package/lib/components/tables/renderer/table-custom-more-menu/table-custom-more-menu-popup.component.d.ts +2 -2
- package/lib/components/tables/renderer/table-custom-more-menu/table-custom-more-menu.component.d.ts +2 -2
- package/lib/components/tables/table/table.component.d.ts +1 -1
- package/lib/components/tables/tree-table/flattened-tree-list-model.d.ts +1 -1
- package/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +2 -2
- package/lib/components/tables/tree-table/tree-label-column-model.d.ts +2 -2
- package/lib/components/tables/tree-table/tree-table-component.d.ts +2 -2
- package/lib/components/tables/tree-table/tree-table-model.d.ts +1 -1
- package/lib/interaction/abstract-interaction-context.d.ts +4 -4
- package/lib/interaction/activity-context.d.ts +1 -1
- package/lib/interaction/activity-ref.d.ts +2 -2
- package/lib/interaction/activity.d.ts +1 -1
- package/lib/interaction/components/abstract-confirm-dialog.component.d.ts +1 -1
- package/lib/interaction/components/abstract-dialog.component.d.ts +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +3 -3
- package/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.d.ts +2 -2
- package/lib/interaction/components/activity-triggers/abstract-activity-trigger.component.d.ts +2 -2
- package/lib/interaction/components/activity-triggers/inline-activity-trigger/inline-activity-trigger.component.d.ts +1 -1
- package/lib/interaction/components/activity-triggers/modal-activity-trigger/modal-activity-trigger.component.d.ts +1 -1
- package/lib/interaction/components/activity-triggers/popup-activity-trigger/popup-activity-trigger.component.d.ts +1 -1
- package/lib/interaction/components/add-card-activity/add-card-activity.component.d.ts +2 -2
- package/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.d.ts +1 -1
- package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +1 -1
- package/lib/interaction/components/alert-renderer/alert-renderer.component.d.ts +1 -1
- package/lib/interaction/components/confirm-renderer/confirm-renderer.component.d.ts +1 -1
- package/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.d.ts +2 -2
- package/lib/interaction/components/confirm-then-execute-dialog/confirm-then-execute-dialog.component.d.ts +2 -2
- package/lib/interaction/components/editors/inline-string-editor/inline-editor-model.d.ts +1 -1
- package/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.d.ts +1 -1
- package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +5 -5
- package/lib/interaction/components/input-activities/input-activity.d.ts +1 -1
- package/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.d.ts +1 -1
- package/lib/interaction/components/slide-down-interaction-context/slide-down-interaction-context.component.d.ts +5 -5
- package/lib/interaction/directives/interaction-context-trigger-for.directive.d.ts +2 -2
- package/lib/interaction/in-place-interaction-context.d.ts +2 -2
- package/lib/interaction/interaction-context-provider.d.ts +2 -2
- package/lib/interaction/interaction-context.d.ts +3 -3
- package/lib/interaction/route-synchronisation-adapter.d.ts +2 -2
- package/lib/interaction/services/interaction-service-routing-adapter.d.ts +2 -2
- package/lib/interaction/services/interaction.service.d.ts +3 -3
- package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +2 -2
- package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.d.ts +3 -3
- package/lib/interaction/services/modal-interaction-context.factory.d.ts +2 -2
- package/lib/place/components/abstract-place-navigation.component.d.ts +2 -2
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +3 -3
- package/lib/place/guards/place.guard.d.ts +1 -1
- package/lib/place/navigation/place-component-deactivation-handler.d.ts +4 -4
- package/lib/place/navigation/session/abstract-pop-state-navigation.d.ts +1 -1
- package/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.d.ts +3 -3
- package/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-navigation-interaction-cancelation-type-determined.d.ts +3 -3
- package/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.d.ts +3 -3
- package/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.d.ts +1 -1
- package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +1 -1
- package/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.d.ts +1 -1
- package/lib/place/navigation/session/navigation-context.d.ts +5 -5
- package/lib/place/navigation/session/navigation-session.d.ts +15 -8
- package/lib/place/place-access-guard.d.ts +1 -1
- package/lib/place/place-auth-service.d.ts +3 -3
- package/lib/place/place-component.d.ts +5 -6
- package/lib/place/place-definition.d.ts +2 -2
- package/lib/place/place-history.d.ts +3 -3
- package/lib/place/place-metadata.d.ts +8 -0
- package/lib/place/place-router.d.ts +21 -4
- package/lib/place/route/parameter-decorators.d.ts +2 -2
- package/lib/place/route/parameter-definition.d.ts +3 -3
- package/lib/place/route/parameter-sanitiser.d.ts +1 -1
- package/lib/place/route/parameter-snapshot.d.ts +1 -1
- package/lib/place/route/visit-segment-sanitiser.d.ts +3 -3
- package/lib/place/url-service.d.ts +1 -1
- package/lib/place/url-snapshot.d.ts +1 -1
- package/lib/place/visit-segment.d.ts +2 -2
- package/lib/place/visit.d.ts +2 -2
- package/package.json +3 -3
|
@@ -58,7 +58,7 @@ import { A11yModule } from '@angular/cdk/a11y';
|
|
|
58
58
|
import * as i1$7 from '@angular/material/dialog';
|
|
59
59
|
import { MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
60
60
|
import * as i1$5 from '@angular/router';
|
|
61
|
-
import {
|
|
61
|
+
import { UrlSegment, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterModule, ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router';
|
|
62
62
|
import 'reflect-metadata';
|
|
63
63
|
import * as i1$6 from '@angular/cdk/overlay';
|
|
64
64
|
import { style, trigger, transition, animate, group, query } from '@angular/animations';
|
|
@@ -5843,145 +5843,6 @@ var DecoratedTreeNode;
|
|
|
5843
5843
|
DecoratedTreeNode.Decorator = Decorator;
|
|
5844
5844
|
})(DecoratedTreeNode || (DecoratedTreeNode = {}));
|
|
5845
5845
|
|
|
5846
|
-
class TreeLabelColumnModel extends ColumnModel {
|
|
5847
|
-
expansionModel;
|
|
5848
|
-
labelFactory = () => undefined;
|
|
5849
|
-
iconFactory;
|
|
5850
|
-
constructor(columnId, order, textPropertiesProvider, expansionModel) {
|
|
5851
|
-
super(columnId, order, textPropertiesProvider);
|
|
5852
|
-
this.expansionModel = expansionModel;
|
|
5853
|
-
this.cellRenderer(TreeLabelCellRendererComponent);
|
|
5854
|
-
}
|
|
5855
|
-
pluck(property) {
|
|
5856
|
-
this.useLabel(row => row[property]);
|
|
5857
|
-
}
|
|
5858
|
-
useLabel(factory) {
|
|
5859
|
-
this.labelFactory = factory;
|
|
5860
|
-
}
|
|
5861
|
-
/**
|
|
5862
|
-
* @deprecated use #useIcon instead.
|
|
5863
|
-
* @param factory
|
|
5864
|
-
*/
|
|
5865
|
-
addIcon(factory) {
|
|
5866
|
-
this.useIcon(factory);
|
|
5867
|
-
}
|
|
5868
|
-
useIcon(factory) {
|
|
5869
|
-
this.iconFactory = factory;
|
|
5870
|
-
}
|
|
5871
|
-
cellRenderer(componentType) {
|
|
5872
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
5873
|
-
if (firstTime) {
|
|
5874
|
-
component.treeTableModel = this.expansionModel;
|
|
5875
|
-
}
|
|
5876
|
-
component.value = rowData.row;
|
|
5877
|
-
component.label = this.labelFactory(rowData.row);
|
|
5878
|
-
component.iconFactory = this.iconFactory;
|
|
5879
|
-
}));
|
|
5880
|
-
return this;
|
|
5881
|
-
}
|
|
5882
|
-
}
|
|
5883
|
-
|
|
5884
|
-
// TODO:
|
|
5885
|
-
// Selection Models:
|
|
5886
|
-
// - as simple navigation tree
|
|
5887
|
-
// - as editable grid (selecte all, even hidden etc?)
|
|
5888
|
-
// - fixing selection on underlying model changes.
|
|
5889
|
-
// - rendering selection: row highlighting, checkboxes (in the tree renderer or in separate column), both.
|
|
5890
|
-
// Expansion Models:
|
|
5891
|
-
// - Add ability to auto show to depth
|
|
5892
|
-
// - Add a predicate to check default expansion (i.e. has children of a certain type)
|
|
5893
|
-
//
|
|
5894
|
-
class TreeTableModel extends AbstractTableModel {
|
|
5895
|
-
treeExpansionModel;
|
|
5896
|
-
flattenedDataSource;
|
|
5897
|
-
childExtractor;
|
|
5898
|
-
_isExpandedPredicate$ = this.registerDisposable(new DelegatingValueModel());
|
|
5899
|
-
constructor(source$, childAccessor, builder) {
|
|
5900
|
-
super();
|
|
5901
|
-
if (builder)
|
|
5902
|
-
builder(this);
|
|
5903
|
-
this.childExtractor = isFunction(childAccessor) ? childAccessor : row => row[childAccessor];
|
|
5904
|
-
this.addRowClass('aup-node-collapsed', row => this.isCollapsed(row));
|
|
5905
|
-
this.setDataSource(source$);
|
|
5906
|
-
}
|
|
5907
|
-
get isExpandedPredicate$() {
|
|
5908
|
-
return this._isExpandedPredicate$.readonly$;
|
|
5909
|
-
}
|
|
5910
|
-
bindToTable(expansionModel, filteredRows$, visibleRows$, cdr) {
|
|
5911
|
-
this.treeExpansionModel = expansionModel;
|
|
5912
|
-
// TODO: Move all the expansion model stuff out of here and have things use the expansion model directly
|
|
5913
|
-
this._isExpandedPredicate$.setDelegate(this.treeExpansionModel.isExpandedPredicate$);
|
|
5914
|
-
this._filteredRows$.setDelegate(filteredRows$);
|
|
5915
|
-
this._visibleRows$.setDelegate(visibleRows$);
|
|
5916
|
-
}
|
|
5917
|
-
treeControlColumn(builder) {
|
|
5918
|
-
const columnId = 'tree-label';
|
|
5919
|
-
const column = new TreeLabelColumnModel(columnId, this.columnManager, () => this.getColumnTextProperties(columnId), this);
|
|
5920
|
-
builder(column);
|
|
5921
|
-
this.addColumn(column);
|
|
5922
|
-
}
|
|
5923
|
-
expand(node) {
|
|
5924
|
-
this.treeExpansionModel.expand(node);
|
|
5925
|
-
}
|
|
5926
|
-
collapse(node) {
|
|
5927
|
-
this.treeExpansionModel.collapse(node);
|
|
5928
|
-
}
|
|
5929
|
-
isCollapsed(node) {
|
|
5930
|
-
return this.treeExpansionModel.isCollapsed(node);
|
|
5931
|
-
}
|
|
5932
|
-
ensureAncestorsAndSelfVisible(node) {
|
|
5933
|
-
this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);
|
|
5934
|
-
}
|
|
5935
|
-
isExpanded(row) {
|
|
5936
|
-
return this.treeExpansionModel.isExpanded(row);
|
|
5937
|
-
}
|
|
5938
|
-
}
|
|
5939
|
-
// export class FlattenStrategy<T extends VisitableTree<any>> extends SelfAndDescendantsVisitor<T> {
|
|
5940
|
-
//
|
|
5941
|
-
// private _areas: T[] = [];
|
|
5942
|
-
// private _collapsed: Set<T>;
|
|
5943
|
-
//
|
|
5944
|
-
// constructor(private collapsedIds: T[]) {
|
|
5945
|
-
// super();
|
|
5946
|
-
// this._collapsed = new Set<T>(collapsedIds);
|
|
5947
|
-
// }
|
|
5948
|
-
//
|
|
5949
|
-
// protected onVisit(it: T) {
|
|
5950
|
-
// this._areas.push(it);
|
|
5951
|
-
// }
|
|
5952
|
-
//
|
|
5953
|
-
// protected shouldVisitChildrenOf(it: T): boolean {
|
|
5954
|
-
// return !this._collapsed.has(it);
|
|
5955
|
-
// }
|
|
5956
|
-
//
|
|
5957
|
-
// get flattenedAreas(): T[] {
|
|
5958
|
-
// return this._areas;
|
|
5959
|
-
// }
|
|
5960
|
-
//
|
|
5961
|
-
// }
|
|
5962
|
-
// class DecoratorCache {
|
|
5963
|
-
//
|
|
5964
|
-
// private map = new Map<number, T>();
|
|
5965
|
-
//
|
|
5966
|
-
// get(area:T): T {
|
|
5967
|
-
//
|
|
5968
|
-
// if (!area) return null;
|
|
5969
|
-
//
|
|
5970
|
-
// let decoratedArea = this.map.get(area.id);
|
|
5971
|
-
// if (!decoratedArea) {
|
|
5972
|
-
// decoratedArea = TreeModel.AreaDecorator.decorate(area);
|
|
5973
|
-
// this.map.set(area.id, decoratedArea);
|
|
5974
|
-
// }
|
|
5975
|
-
// return decoratedArea;
|
|
5976
|
-
// }
|
|
5977
|
-
//
|
|
5978
|
-
// clear() {
|
|
5979
|
-
// this.map.clear();
|
|
5980
|
-
// }
|
|
5981
|
-
//
|
|
5982
|
-
//
|
|
5983
|
-
// }
|
|
5984
|
-
|
|
5985
5846
|
class TreeLabelCellRendererComponent extends DisposableComponent {
|
|
5986
5847
|
node$ = new MutableValueModel();
|
|
5987
5848
|
#value_accessor_storage;
|
|
@@ -6172,6 +6033,145 @@ class TreeExpansionModel extends GarbageCollector {
|
|
|
6172
6033
|
}
|
|
6173
6034
|
ProxyRegistry.registerOneTimeBinding(TreeExpansionModel);
|
|
6174
6035
|
|
|
6036
|
+
class TreeLabelColumnModel extends ColumnModel {
|
|
6037
|
+
expansionModel;
|
|
6038
|
+
labelFactory = () => undefined;
|
|
6039
|
+
iconFactory;
|
|
6040
|
+
constructor(columnId, order, textPropertiesProvider, expansionModel) {
|
|
6041
|
+
super(columnId, order, textPropertiesProvider);
|
|
6042
|
+
this.expansionModel = expansionModel;
|
|
6043
|
+
this.cellRenderer(TreeLabelCellRendererComponent);
|
|
6044
|
+
}
|
|
6045
|
+
pluck(property) {
|
|
6046
|
+
this.useLabel(row => row[property]);
|
|
6047
|
+
}
|
|
6048
|
+
useLabel(factory) {
|
|
6049
|
+
this.labelFactory = factory;
|
|
6050
|
+
}
|
|
6051
|
+
/**
|
|
6052
|
+
* @deprecated use #useIcon instead.
|
|
6053
|
+
* @param factory
|
|
6054
|
+
*/
|
|
6055
|
+
addIcon(factory) {
|
|
6056
|
+
this.useIcon(factory);
|
|
6057
|
+
}
|
|
6058
|
+
useIcon(factory) {
|
|
6059
|
+
this.iconFactory = factory;
|
|
6060
|
+
}
|
|
6061
|
+
cellRenderer(componentType) {
|
|
6062
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
6063
|
+
if (firstTime) {
|
|
6064
|
+
component.treeTableModel = this.expansionModel;
|
|
6065
|
+
}
|
|
6066
|
+
component.value = rowData.row;
|
|
6067
|
+
component.label = this.labelFactory(rowData.row);
|
|
6068
|
+
component.iconFactory = this.iconFactory;
|
|
6069
|
+
}));
|
|
6070
|
+
return this;
|
|
6071
|
+
}
|
|
6072
|
+
}
|
|
6073
|
+
|
|
6074
|
+
// TODO:
|
|
6075
|
+
// Selection Models:
|
|
6076
|
+
// - as simple navigation tree
|
|
6077
|
+
// - as editable grid (selecte all, even hidden etc?)
|
|
6078
|
+
// - fixing selection on underlying model changes.
|
|
6079
|
+
// - rendering selection: row highlighting, checkboxes (in the tree renderer or in separate column), both.
|
|
6080
|
+
// Expansion Models:
|
|
6081
|
+
// - Add ability to auto show to depth
|
|
6082
|
+
// - Add a predicate to check default expansion (i.e. has children of a certain type)
|
|
6083
|
+
//
|
|
6084
|
+
class TreeTableModel extends AbstractTableModel {
|
|
6085
|
+
treeExpansionModel;
|
|
6086
|
+
flattenedDataSource;
|
|
6087
|
+
childExtractor;
|
|
6088
|
+
_isExpandedPredicate$ = this.registerDisposable(new DelegatingValueModel());
|
|
6089
|
+
constructor(source$, childAccessor, builder) {
|
|
6090
|
+
super();
|
|
6091
|
+
if (builder)
|
|
6092
|
+
builder(this);
|
|
6093
|
+
this.childExtractor = isFunction(childAccessor) ? childAccessor : row => row[childAccessor];
|
|
6094
|
+
this.addRowClass('aup-node-collapsed', row => this.isCollapsed(row));
|
|
6095
|
+
this.setDataSource(source$);
|
|
6096
|
+
}
|
|
6097
|
+
get isExpandedPredicate$() {
|
|
6098
|
+
return this._isExpandedPredicate$.readonly$;
|
|
6099
|
+
}
|
|
6100
|
+
bindToTable(expansionModel, filteredRows$, visibleRows$, cdr) {
|
|
6101
|
+
this.treeExpansionModel = expansionModel;
|
|
6102
|
+
// TODO: Move all the expansion model stuff out of here and have things use the expansion model directly
|
|
6103
|
+
this._isExpandedPredicate$.setDelegate(this.treeExpansionModel.isExpandedPredicate$);
|
|
6104
|
+
this._filteredRows$.setDelegate(filteredRows$);
|
|
6105
|
+
this._visibleRows$.setDelegate(visibleRows$);
|
|
6106
|
+
}
|
|
6107
|
+
treeControlColumn(builder) {
|
|
6108
|
+
const columnId = 'tree-label';
|
|
6109
|
+
const column = new TreeLabelColumnModel(columnId, this.columnManager, () => this.getColumnTextProperties(columnId), this);
|
|
6110
|
+
builder(column);
|
|
6111
|
+
this.addColumn(column);
|
|
6112
|
+
}
|
|
6113
|
+
expand(node) {
|
|
6114
|
+
this.treeExpansionModel.expand(node);
|
|
6115
|
+
}
|
|
6116
|
+
collapse(node) {
|
|
6117
|
+
this.treeExpansionModel.collapse(node);
|
|
6118
|
+
}
|
|
6119
|
+
isCollapsed(node) {
|
|
6120
|
+
return this.treeExpansionModel.isCollapsed(node);
|
|
6121
|
+
}
|
|
6122
|
+
ensureAncestorsAndSelfVisible(node) {
|
|
6123
|
+
this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);
|
|
6124
|
+
}
|
|
6125
|
+
isExpanded(row) {
|
|
6126
|
+
return this.treeExpansionModel.isExpanded(row);
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
// export class FlattenStrategy<T extends VisitableTree<any>> extends SelfAndDescendantsVisitor<T> {
|
|
6130
|
+
//
|
|
6131
|
+
// private _areas: T[] = [];
|
|
6132
|
+
// private _collapsed: Set<T>;
|
|
6133
|
+
//
|
|
6134
|
+
// constructor(private collapsedIds: T[]) {
|
|
6135
|
+
// super();
|
|
6136
|
+
// this._collapsed = new Set<T>(collapsedIds);
|
|
6137
|
+
// }
|
|
6138
|
+
//
|
|
6139
|
+
// protected onVisit(it: T) {
|
|
6140
|
+
// this._areas.push(it);
|
|
6141
|
+
// }
|
|
6142
|
+
//
|
|
6143
|
+
// protected shouldVisitChildrenOf(it: T): boolean {
|
|
6144
|
+
// return !this._collapsed.has(it);
|
|
6145
|
+
// }
|
|
6146
|
+
//
|
|
6147
|
+
// get flattenedAreas(): T[] {
|
|
6148
|
+
// return this._areas;
|
|
6149
|
+
// }
|
|
6150
|
+
//
|
|
6151
|
+
// }
|
|
6152
|
+
// class DecoratorCache {
|
|
6153
|
+
//
|
|
6154
|
+
// private map = new Map<number, T>();
|
|
6155
|
+
//
|
|
6156
|
+
// get(area:T): T {
|
|
6157
|
+
//
|
|
6158
|
+
// if (!area) return null;
|
|
6159
|
+
//
|
|
6160
|
+
// let decoratedArea = this.map.get(area.id);
|
|
6161
|
+
// if (!decoratedArea) {
|
|
6162
|
+
// decoratedArea = TreeModel.AreaDecorator.decorate(area);
|
|
6163
|
+
// this.map.set(area.id, decoratedArea);
|
|
6164
|
+
// }
|
|
6165
|
+
// return decoratedArea;
|
|
6166
|
+
// }
|
|
6167
|
+
//
|
|
6168
|
+
// clear() {
|
|
6169
|
+
// this.map.clear();
|
|
6170
|
+
// }
|
|
6171
|
+
//
|
|
6172
|
+
//
|
|
6173
|
+
// }
|
|
6174
|
+
|
|
6175
6175
|
/**
|
|
6176
6176
|
* Create your model:
|
|
6177
6177
|
* @example
|
|
@@ -6724,33 +6724,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
6724
6724
|
}]
|
|
6725
6725
|
}] });
|
|
6726
6726
|
|
|
6727
|
-
class TextSearchContext {
|
|
6728
|
-
row;
|
|
6729
|
-
searchText;
|
|
6730
|
-
searchRegex;
|
|
6731
|
-
constructor(row, searchText, searchRegex) {
|
|
6732
|
-
this.row = row;
|
|
6733
|
-
this.searchText = searchText;
|
|
6734
|
-
this.searchRegex = searchRegex;
|
|
6735
|
-
}
|
|
6736
|
-
getOrCreate(type, create) {
|
|
6737
|
-
// TODO: stub awaiting per-context cache implementation
|
|
6738
|
-
}
|
|
6739
|
-
matchesText(text) {
|
|
6740
|
-
return this.searchRegex.test(text);
|
|
6741
|
-
}
|
|
6742
|
-
}
|
|
6743
|
-
|
|
6744
|
-
class AbstractCellRenderer extends LoadableComponent {
|
|
6745
|
-
constructor() {
|
|
6746
|
-
super();
|
|
6747
|
-
}
|
|
6748
|
-
}
|
|
6749
|
-
|
|
6750
|
-
/**
|
|
6751
|
-
* @file Automatically generated by barrelsby.
|
|
6752
|
-
*/
|
|
6753
|
-
|
|
6754
6727
|
const ACTIVITY_DATA = new InjectionToken("InteractionActivityData");
|
|
6755
6728
|
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
6756
6729
|
class Activity extends LoadableComponent {
|
|
@@ -7334,6 +7307,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
7334
7307
|
InteractionService.ApiAdapter = ApiAdapter;
|
|
7335
7308
|
})(InteractionService || (InteractionService = {}));
|
|
7336
7309
|
|
|
7310
|
+
// Raw place metadata access, split out of place-component.ts so collaborators that
|
|
7311
|
+
// PlaceComponent itself depends on (visit, place-router, place-auth-service) can read
|
|
7312
|
+
// definitions without a value-level import cycle. Use PlaceComponent.getDefinition /
|
|
7313
|
+
// injectDefinition unless importing place-component.ts would create a cycle.
|
|
7314
|
+
// RAKE: making this Symbol(...) broke things.
|
|
7315
|
+
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
7316
|
+
// this one seems ok.
|
|
7317
|
+
const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
7318
|
+
function getPlaceDefinition(placeComponent) {
|
|
7319
|
+
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, placeComponent);
|
|
7320
|
+
}
|
|
7321
|
+
function setPlaceDefinition(placeComponent, definition) {
|
|
7322
|
+
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, placeComponent);
|
|
7323
|
+
}
|
|
7324
|
+
|
|
7337
7325
|
var ParameterSanitiser;
|
|
7338
7326
|
(function (ParameterSanitiser) {
|
|
7339
7327
|
class Factory {
|
|
@@ -7657,231 +7645,28 @@ __decorate([
|
|
|
7657
7645
|
__metadata("design:returntype", Array)
|
|
7658
7646
|
], PlaceDefinition.prototype, "ancestorsAndSelf", null);
|
|
7659
7647
|
__decorate([
|
|
7660
|
-
Memoize(),
|
|
7661
|
-
__metadata("design:type", String),
|
|
7662
|
-
__metadata("design:paramtypes", [])
|
|
7663
|
-
], PlaceDefinition.prototype, "placeId", null);
|
|
7664
|
-
__decorate([
|
|
7665
|
-
Memoize(),
|
|
7666
|
-
__metadata("design:type", Function),
|
|
7667
|
-
__metadata("design:paramtypes", []),
|
|
7668
|
-
__metadata("design:returntype", ParameterDefinition)
|
|
7669
|
-
], PlaceDefinition.prototype, "getRouteIdParameterDef", null);
|
|
7670
|
-
__decorate([
|
|
7671
|
-
Memoize(),
|
|
7672
|
-
__metadata("design:type", Function),
|
|
7673
|
-
__metadata("design:paramtypes", [Object]),
|
|
7674
|
-
__metadata("design:returntype", Array)
|
|
7675
|
-
], PlaceDefinition.prototype, "getRouteParameterDefs", null);
|
|
7676
|
-
__decorate([
|
|
7677
|
-
Memoize(),
|
|
7678
|
-
__metadata("design:type", Function),
|
|
7679
|
-
__metadata("design:paramtypes", [Object]),
|
|
7680
|
-
__metadata("design:returntype", Array)
|
|
7681
|
-
], PlaceDefinition.prototype, "getVisitParameterDefs", null);
|
|
7682
|
-
|
|
7683
|
-
// RAKE: making this Symbol(...) broke things.
|
|
7684
|
-
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
7685
|
-
// this one seems ok.
|
|
7686
|
-
const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
7687
|
-
// class ParameterChangeInterceptor<T> {
|
|
7688
|
-
// constructor(parameterDef: ParameterDefinition<T>, model: ValueModel<T>, callback: PlaceComponent.InterceptCallback<T>, options: PlaceComponent.InterceptOptions) {
|
|
7689
|
-
// }
|
|
7690
|
-
//
|
|
7691
|
-
// async canProceed(nextState: VisitSegment, interactionContext: InteractionContext) {
|
|
7692
|
-
// return true;
|
|
7693
|
-
// }
|
|
7694
|
-
// }
|
|
7695
|
-
class PlaceComponent extends LoadableComponent {
|
|
7696
|
-
_placeReadyCallbacks = [];
|
|
7697
|
-
visit$ = new MutableValueModel();
|
|
7698
|
-
_inVisitUpdate = new Guard();
|
|
7699
|
-
_active = new MutableValueModel(false);
|
|
7700
|
-
interactionContext;
|
|
7701
|
-
childPlaces$;
|
|
7702
|
-
// private readonly _parameterChangeInterceptors: ParameterChangeInterceptor<any>[] = [];
|
|
7703
|
-
placeId;
|
|
7704
|
-
placeRouter = inject(PlaceRouter);
|
|
7705
|
-
activatedRoute = inject(ActivatedRoute);
|
|
7706
|
-
constructor() {
|
|
7707
|
-
super();
|
|
7708
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
7709
|
-
when(this._active).becomesTruthy(() => this._notifyPlaceReady());
|
|
7710
|
-
this.childPlaces$ = ListModel.constant(this.placeDefinition.children.map(d => d.component));
|
|
7711
|
-
this.placeId = this.placeDefinition.placeId;
|
|
7712
|
-
if (isEmpty(this.placeId)) {
|
|
7713
|
-
lang.illegalState("placeId property is missing from the route data parameters");
|
|
7714
|
-
}
|
|
7715
|
-
}
|
|
7716
|
-
initialiseVisit(visit, notifyVisitChanged) {
|
|
7717
|
-
assert.isNil(this.visit$.value);
|
|
7718
|
-
const { when } = Dsl.disposeWith(this);
|
|
7719
|
-
this.visit$.value = visit;
|
|
7720
|
-
DebugContext.getOrCreate(this.visit$).tag(`${this.placeDefinition.component.name}.visit$`);
|
|
7721
|
-
// we track if the any of the bindings updated the route. If so we remember it and update the
|
|
7722
|
-
// route in one go at the end.
|
|
7723
|
-
this.placeDefinition
|
|
7724
|
-
.getVisitParameterDefs()
|
|
7725
|
-
.forEach(parameterDef => this.installAndInitialiseBinding(visit, parameterDef));
|
|
7726
|
-
when(this.visit$).changes((current, previous) => {
|
|
7727
|
-
notifyVisitChanged(current, previous);
|
|
7728
|
-
}, { unless: this._inVisitUpdate });
|
|
7729
|
-
// TODO: this needs to do a replace url option so that the new url isn't put in the history.... for
|
|
7730
|
-
// now we're not doing it as it's a fair bit of effort and will only affect people if they're
|
|
7731
|
-
// cutting and pasting urls to each other.
|
|
7732
|
-
// // the binding process can update the visit (e.g. if a selection model has already selected during
|
|
7733
|
-
// // component construction) and there was no value specified in the route
|
|
7734
|
-
// if (visit.hasRoutingChangedFrom(this.visitModel.value)) {
|
|
7735
|
-
// notifyVisitChanged(this.visitModel.value, visit)
|
|
7736
|
-
// }
|
|
7737
|
-
}
|
|
7738
|
-
get childPlaces() {
|
|
7739
|
-
return this.childPlaces$.value;
|
|
7740
|
-
}
|
|
7741
|
-
updateVisit(visit) {
|
|
7742
|
-
assert.isTruthy(this.isInitialised());
|
|
7743
|
-
assert.notNil(visit);
|
|
7744
|
-
this._inVisitUpdate.whileTrue(() => {
|
|
7745
|
-
this.visit$.value = visit;
|
|
7746
|
-
});
|
|
7747
|
-
}
|
|
7748
|
-
isInitialised() {
|
|
7749
|
-
return !!this.visit$.value;
|
|
7750
|
-
}
|
|
7751
|
-
// @Trace()
|
|
7752
|
-
/**
|
|
7753
|
-
* Initialised the component bindings. If any binding has an initial model value (e.g. a selection model
|
|
7754
|
-
* initialised during the constructor) and the route has nothing, then the visit will be udpated and this
|
|
7755
|
-
* method will return ture to nofiy the the visit has changed.
|
|
7756
|
-
*/
|
|
7757
|
-
installAndInitialiseBinding(initialVisit, parameterDef) {
|
|
7758
|
-
const model = this[parameterDef.propertyName];
|
|
7759
|
-
assert.notNil(model);
|
|
7760
|
-
DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);
|
|
7761
|
-
const binding = this.registerDisposable(new Binding(this.visit$, model, {
|
|
7762
|
-
toRight(visit) {
|
|
7763
|
-
const value = visit.getParameterValue(parameterDef);
|
|
7764
|
-
// console.log('push to component', { name: parameterDef.name, value, visit });
|
|
7765
|
-
return value;
|
|
7766
|
-
},
|
|
7767
|
-
toLeft(value, currentVisit) {
|
|
7768
|
-
// console.log('push to route', { name: parameterDef.name, value, currentVisit });
|
|
7769
|
-
return currentVisit.replace(parameterDef, value);
|
|
7770
|
-
}
|
|
7771
|
-
}));
|
|
7772
|
-
// Now we need to initialise the binding direction. If we have a value in the Url then we should always push
|
|
7773
|
-
// that to the view. If we don't and the view already has a value (e.g. a selection model has already initialised in the
|
|
7774
|
-
// component constructor) then we should push that to the route.
|
|
7775
|
-
const isInVisit = !isNil(initialVisit.getParameterValue(parameterDef));
|
|
7776
|
-
const isInModel = !isNil(model.value);
|
|
7777
|
-
if (!isInVisit && isInModel) {
|
|
7778
|
-
binding.writeLeft(); // push it to the route
|
|
7779
|
-
}
|
|
7780
|
-
else {
|
|
7781
|
-
binding.writeRight(); // push it to the model
|
|
7782
|
-
}
|
|
7783
|
-
}
|
|
7784
|
-
get placeDefinition() {
|
|
7785
|
-
const definition = PlaceComponent.getDefinition(this.constructor);
|
|
7786
|
-
if (!definition) {
|
|
7787
|
-
lang.illegalState(`${this.constructor.name} extends PlaceComponent but doesn't have @Place({..}) decorator.`);
|
|
7788
|
-
}
|
|
7789
|
-
return definition;
|
|
7790
|
-
}
|
|
7791
|
-
get active() {
|
|
7792
|
-
return this._active.readonly$;
|
|
7793
|
-
}
|
|
7794
|
-
/**
|
|
7795
|
-
* Called by the router to see if this component can deactivate. This isn't called for route parameter changes.
|
|
7796
|
-
* @param interactionContext
|
|
7797
|
-
*/
|
|
7798
|
-
async _canLeavePlace(interactionContext) {
|
|
7799
|
-
return this.canDeactivate ? this.canDeactivate(interactionContext) : true;
|
|
7800
|
-
}
|
|
7801
|
-
/**
|
|
7802
|
-
* Called by the router to see if this component can deactivate. This isn't called for route parameter changes.
|
|
7803
|
-
* @param interactionContext
|
|
7804
|
-
* @param nextState
|
|
7805
|
-
*/
|
|
7806
|
-
async _canChangeRouteParameters(interactionContext, nextState) {
|
|
7807
|
-
// if (this._parameterChangeInterceptors.length > 0) {
|
|
7808
|
-
// const visit = nextState.createVisitSegmentFor(this.placeDefinition);
|
|
7809
|
-
// for (let i = 0; i < this._parameterChangeInterceptors.length; i++) {
|
|
7810
|
-
// const interceptor = this._parameterChangeInterceptors[i];
|
|
7811
|
-
// const keepGoing = await interceptor.canProceed(visit, interactionContext);
|
|
7812
|
-
// if (!keepGoing) {
|
|
7813
|
-
// return false;
|
|
7814
|
-
// }
|
|
7815
|
-
// }
|
|
7816
|
-
// }
|
|
7817
|
-
return true;
|
|
7818
|
-
}
|
|
7819
|
-
/**
|
|
7820
|
-
* Called by the router when the place is ready to interact after any animations have run.
|
|
7821
|
-
*/
|
|
7822
|
-
_notifyActive(active) {
|
|
7823
|
-
this._active.value = active;
|
|
7824
|
-
}
|
|
7825
|
-
/**
|
|
7826
|
-
* Called by the router when the place is ready to interact after any animations have run.
|
|
7827
|
-
*/
|
|
7828
|
-
_notifyPlaceReady() {
|
|
7829
|
-
if (this.onPlaceReady.length === 1) {
|
|
7830
|
-
this._placeReadyCallbacks.forEach(callback => callback());
|
|
7831
|
-
}
|
|
7832
|
-
else {
|
|
7833
|
-
console.warn('Overriding PlaceComponent.onPlaceReady has been deprecated. Use PlaceComponent.onPlaceReady(() => {... do stuff...}) instead.');
|
|
7834
|
-
this.onPlaceReady(undefined);
|
|
7835
|
-
}
|
|
7836
|
-
}
|
|
7837
|
-
onPlaceReady(callback) {
|
|
7838
|
-
this._placeReadyCallbacks.push(callback);
|
|
7839
|
-
}
|
|
7840
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: PlaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7841
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.9", type: PlaceComponent, host: { properties: { "attr.place-id": "this.placeId" } }, usesInheritance: true, ngImport: i0 });
|
|
7842
|
-
}
|
|
7843
|
-
__decorate([
|
|
7844
|
-
MemoizeGet(),
|
|
7845
|
-
__metadata("design:type", PlaceDefinition),
|
|
7846
|
-
__metadata("design:paramtypes", [])
|
|
7847
|
-
], PlaceComponent.prototype, "placeDefinition", null);
|
|
7848
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: PlaceComponent, decorators: [{
|
|
7849
|
-
type: Directive
|
|
7850
|
-
}], ctorParameters: function () { return []; }, propDecorators: { placeId: [{
|
|
7851
|
-
type: HostBinding,
|
|
7852
|
-
args: ["attr.place-id"]
|
|
7853
|
-
}], placeDefinition: [] } });
|
|
7854
|
-
(function (PlaceComponent) {
|
|
7855
|
-
function isPlaceComponentConstructor(target) {
|
|
7856
|
-
return lang.constructorChain(target).includes(PlaceComponent);
|
|
7857
|
-
}
|
|
7858
|
-
PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
|
|
7859
|
-
function getRouteParameters(klass) {
|
|
7860
|
-
return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
7861
|
-
}
|
|
7862
|
-
PlaceComponent.getRouteParameters = getRouteParameters;
|
|
7863
|
-
function getDefinition(snapshotOrConstructor) {
|
|
7864
|
-
if (snapshotOrConstructor instanceof ActivatedRouteSnapshot) {
|
|
7865
|
-
const component = snapshotOrConstructor.component;
|
|
7866
|
-
if (!isPlaceComponentConstructor(component)) {
|
|
7867
|
-
throw new Error(`ActivatedRouteSnapshot component is not a PlaceComponent, got ${component}`);
|
|
7868
|
-
}
|
|
7869
|
-
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, component);
|
|
7870
|
-
}
|
|
7871
|
-
else {
|
|
7872
|
-
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, snapshotOrConstructor);
|
|
7873
|
-
}
|
|
7874
|
-
}
|
|
7875
|
-
PlaceComponent.getDefinition = getDefinition;
|
|
7876
|
-
function injectDefinition(klass, definition) {
|
|
7877
|
-
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
|
|
7878
|
-
}
|
|
7879
|
-
PlaceComponent.injectDefinition = injectDefinition;
|
|
7880
|
-
// export type InterceptCallback<T> = (is: T, was: T, interactionContext: InteractionContext) => boolean | Promise<boolean>;
|
|
7881
|
-
// export interface InterceptOptions {
|
|
7882
|
-
// initialValue: 'evaluationUnlessNil' | 'evaluate'
|
|
7883
|
-
// }
|
|
7884
|
-
})(PlaceComponent || (PlaceComponent = {}));
|
|
7648
|
+
Memoize(),
|
|
7649
|
+
__metadata("design:type", String),
|
|
7650
|
+
__metadata("design:paramtypes", [])
|
|
7651
|
+
], PlaceDefinition.prototype, "placeId", null);
|
|
7652
|
+
__decorate([
|
|
7653
|
+
Memoize(),
|
|
7654
|
+
__metadata("design:type", Function),
|
|
7655
|
+
__metadata("design:paramtypes", []),
|
|
7656
|
+
__metadata("design:returntype", ParameterDefinition)
|
|
7657
|
+
], PlaceDefinition.prototype, "getRouteIdParameterDef", null);
|
|
7658
|
+
__decorate([
|
|
7659
|
+
Memoize(),
|
|
7660
|
+
__metadata("design:type", Function),
|
|
7661
|
+
__metadata("design:paramtypes", [Object]),
|
|
7662
|
+
__metadata("design:returntype", Array)
|
|
7663
|
+
], PlaceDefinition.prototype, "getRouteParameterDefs", null);
|
|
7664
|
+
__decorate([
|
|
7665
|
+
Memoize(),
|
|
7666
|
+
__metadata("design:type", Function),
|
|
7667
|
+
__metadata("design:paramtypes", [Object]),
|
|
7668
|
+
__metadata("design:returntype", Array)
|
|
7669
|
+
], PlaceDefinition.prototype, "getVisitParameterDefs", null);
|
|
7885
7670
|
|
|
7886
7671
|
/* eslint-disable @typescript-eslint/no-explicit-any -- visit segments carry arbitrary route params */
|
|
7887
7672
|
class VisitSegment {
|
|
@@ -7976,7 +7761,7 @@ class Visit {
|
|
|
7976
7761
|
destinationSegment;
|
|
7977
7762
|
destinationPlaceDef;
|
|
7978
7763
|
static goto(placeComponent, visitParameters) {
|
|
7979
|
-
return new Visit([new VisitSegment(
|
|
7764
|
+
return new Visit([new VisitSegment(getPlaceDefinition(placeComponent), visitParameters)]);
|
|
7980
7765
|
}
|
|
7981
7766
|
static fromSegments(segments) {
|
|
7982
7767
|
return new Visit(segments);
|
|
@@ -7997,7 +7782,7 @@ class Visit {
|
|
|
7997
7782
|
if (!this.destinationPlaceDef.hasAncestor(placeComponent)) {
|
|
7998
7783
|
throw new Error(`Place ${placeComponent.name} is not an ancestor of ${this.destinationPlaceDef.component.name}`);
|
|
7999
7784
|
}
|
|
8000
|
-
this.segmentsByPlaceComponent.set(placeComponent, new VisitSegment(
|
|
7785
|
+
this.segmentsByPlaceComponent.set(placeComponent, new VisitSegment(getPlaceDefinition(placeComponent), parameters));
|
|
8001
7786
|
return this;
|
|
8002
7787
|
}
|
|
8003
7788
|
get segments() {
|
|
@@ -8176,6 +7961,15 @@ class NavigationSession extends GarbageCollector {
|
|
|
8176
7961
|
get isInteractionSync() {
|
|
8177
7962
|
return false;
|
|
8178
7963
|
}
|
|
7964
|
+
/**
|
|
7965
|
+
* Interruptible sessions are internal housekeeping navigations (e.g. interaction-id
|
|
7966
|
+
* synchronisation) that a real user- or model-driven navigation is allowed to queue behind
|
|
7967
|
+
* and supersede, rather than being rejected. Real navigations (Navigating, PopState) are not
|
|
7968
|
+
* interruptible.
|
|
7969
|
+
*/
|
|
7970
|
+
get isInterruptible() {
|
|
7971
|
+
return this.isInteractionSync;
|
|
7972
|
+
}
|
|
8179
7973
|
get name() {
|
|
8180
7974
|
return this.constructor.name;
|
|
8181
7975
|
}
|
|
@@ -8963,7 +8757,7 @@ class PlaceAuthService extends GarbageCollector {
|
|
|
8963
8757
|
const { chain } = Dsl.disposeWith(this);
|
|
8964
8758
|
const when$ = options.when$ ? options.when$ : chain(options.unless$).isFalsey();
|
|
8965
8759
|
// NOTE: we're wrapping the when$ so callers can pass in the same model multiple times (pectin doesn't support depending on multiples of the same model yet)
|
|
8966
|
-
this.enabledPlaceChecker.enableWhen(
|
|
8760
|
+
this.enabledPlaceChecker.enableWhen(getPlaceDefinition(placeDefinition), chain(when$).isTruthy(), options);
|
|
8967
8761
|
}
|
|
8968
8762
|
async waitUntilAuthenticationReady() {
|
|
8969
8763
|
await toPromise(this, this._authNReady$);
|
|
@@ -9397,6 +9191,11 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9397
9191
|
_activeVisit$ = new MutableValueModel();
|
|
9398
9192
|
routerInteractionAdapter;
|
|
9399
9193
|
sessionFinishedJobs = [];
|
|
9194
|
+
// A navigation triggered while an interruptible session is in flight is parked here and run when
|
|
9195
|
+
// that session finishes. Only the most recent pending navigation is retained (coalescing).
|
|
9196
|
+
pendingNavigation;
|
|
9197
|
+
queuedNavigationDepth = 0;
|
|
9198
|
+
static MAX_QUEUED_NAVIGATION_DEPTH = 5;
|
|
9400
9199
|
authService = new PlaceAuthService();
|
|
9401
9200
|
_ready$ = this.registerDisposable(new DelegatingValueModel().withDefault(true));
|
|
9402
9201
|
ready$ = this._ready$.readonly$;
|
|
@@ -9560,17 +9359,11 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9560
9359
|
// @Trace()
|
|
9561
9360
|
async doNavigation(visit, runNavigationCommands) {
|
|
9562
9361
|
if (this.navigationInProgress$.value) {
|
|
9563
|
-
|
|
9564
|
-
visit: visit,
|
|
9565
|
-
session: this.navigationSession,
|
|
9566
|
-
});
|
|
9567
|
-
lang.illegalState('Navigation already in progress');
|
|
9568
|
-
}
|
|
9569
|
-
else {
|
|
9570
|
-
const navigation = this.createNavigationSession(this.urlService.getCurrentRouterUrl());
|
|
9571
|
-
navigation.initialiseVisitSegments(visit);
|
|
9572
|
-
this.transitionTo(navigation);
|
|
9362
|
+
return this.handleOverlappingNavigation(visit, runNavigationCommands);
|
|
9573
9363
|
}
|
|
9364
|
+
const navigation = this.createNavigationSession(this.urlService.getCurrentRouterUrl());
|
|
9365
|
+
navigation.initialiseVisitSegments(visit);
|
|
9366
|
+
this.transitionTo(navigation);
|
|
9574
9367
|
try {
|
|
9575
9368
|
await runNavigationCommands(this.angularRouter);
|
|
9576
9369
|
}
|
|
@@ -9582,6 +9375,80 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9582
9375
|
}
|
|
9583
9376
|
}
|
|
9584
9377
|
}
|
|
9378
|
+
/**
|
|
9379
|
+
* Handles a navigation triggered while another is already in flight.
|
|
9380
|
+
*
|
|
9381
|
+
* This used to throw `illegalState('Navigation already in progress')`, which killed the
|
|
9382
|
+
* triggering action - occasionally seen in production when a user click collided with an
|
|
9383
|
+
* in-flight interaction-id sync. Instead we warn with diagnostic context and decide based on the
|
|
9384
|
+
* in-progress session:
|
|
9385
|
+
* - interruptible session in progress (internal housekeeping, e.g. interaction-id sync) -> queue
|
|
9386
|
+
* the incoming navigation and run it once the current session finishes (coalescing to latest).
|
|
9387
|
+
* - real navigation in progress -> keep it and drop the incoming one (logging full context).
|
|
9388
|
+
*/
|
|
9389
|
+
handleOverlappingNavigation(visit, runNavigationCommands) {
|
|
9390
|
+
const current = this.navigationSession;
|
|
9391
|
+
const debug = {
|
|
9392
|
+
inProgress: {
|
|
9393
|
+
session: current?.name,
|
|
9394
|
+
state: current?.toString(),
|
|
9395
|
+
isInteractionSync: current?.isInteractionSync,
|
|
9396
|
+
isInterruptible: current?.isInterruptible,
|
|
9397
|
+
isPopState: current?.isPopState,
|
|
9398
|
+
segments: current?.getVisitSegments().map(s => s.toDebugString()),
|
|
9399
|
+
},
|
|
9400
|
+
incoming: visit?.toDebugString(),
|
|
9401
|
+
currentUrl: this.urlService.getCurrentRouterUrl(),
|
|
9402
|
+
};
|
|
9403
|
+
if (current?.isInterruptible) {
|
|
9404
|
+
Logger.get(this).warn(`Navigation triggered while interruptible session '${current.name}' is in progress; ` +
|
|
9405
|
+
`queueing the incoming navigation to run once it finishes.`, debug);
|
|
9406
|
+
return this.queueNavigation(visit, runNavigationCommands);
|
|
9407
|
+
}
|
|
9408
|
+
// NOTE (interim policy): when a *real* navigation is already in progress we keep the first and
|
|
9409
|
+
// drop the incoming one, logging full context so we can see what actually collides in
|
|
9410
|
+
// production. We deliberately do NOT queue+coalesce here yet - once production logs show which
|
|
9411
|
+
// real-vs-real collisions occur we can decide whether "latest wins (queued)" is the better
|
|
9412
|
+
// behaviour. See the implementation plan for the queue+coalesce alternative.
|
|
9413
|
+
Logger.get(this).warn(`Navigation already in progress ('${current?.name}'); ignoring the incoming navigation. ` +
|
|
9414
|
+
`Review this if it occurs in production - it may need to be queued instead.`, debug);
|
|
9415
|
+
return Promise.resolve();
|
|
9416
|
+
}
|
|
9417
|
+
queueNavigation(visit, runNavigationCommands) {
|
|
9418
|
+
const flushAlreadyScheduled = !!this.pendingNavigation;
|
|
9419
|
+
if (this.pendingNavigation) {
|
|
9420
|
+
// Coalesce: supersede the previously queued navigation so only the most recent target runs.
|
|
9421
|
+
this.pendingNavigation.resolve();
|
|
9422
|
+
}
|
|
9423
|
+
return new Promise((resolve, reject) => {
|
|
9424
|
+
this.pendingNavigation = { visit, runNavigationCommands, resolve, reject };
|
|
9425
|
+
if (!flushAlreadyScheduled) {
|
|
9426
|
+
this.runAfterRoutingSessionFinishes(() => this.flushPendingNavigation());
|
|
9427
|
+
}
|
|
9428
|
+
});
|
|
9429
|
+
}
|
|
9430
|
+
flushPendingNavigation() {
|
|
9431
|
+
const pending = this.pendingNavigation;
|
|
9432
|
+
if (!pending) {
|
|
9433
|
+
return;
|
|
9434
|
+
}
|
|
9435
|
+
this.pendingNavigation = undefined;
|
|
9436
|
+
if (this.queuedNavigationDepth >= PlaceRouter.MAX_QUEUED_NAVIGATION_DEPTH) {
|
|
9437
|
+
Logger.get(this).warn(`Dropping queued navigation after ${this.queuedNavigationDepth} consecutive deferrals to ` +
|
|
9438
|
+
`avoid a navigation loop.`, { visit: pending.visit?.toDebugString() });
|
|
9439
|
+
this.queuedNavigationDepth = 0;
|
|
9440
|
+
pending.resolve();
|
|
9441
|
+
return;
|
|
9442
|
+
}
|
|
9443
|
+
this.queuedNavigationDepth++;
|
|
9444
|
+
this.doNavigation(pending.visit, pending.runNavigationCommands).then(() => {
|
|
9445
|
+
this.queuedNavigationDepth = 0;
|
|
9446
|
+
pending.resolve();
|
|
9447
|
+
}, (error) => {
|
|
9448
|
+
this.queuedNavigationDepth = 0;
|
|
9449
|
+
pending.reject(error);
|
|
9450
|
+
});
|
|
9451
|
+
}
|
|
9585
9452
|
navigateByUrl(urlSnapshot, navigationExtras) {
|
|
9586
9453
|
// console.log(`### navigationByUrl -> ${urlSnapshot.urlTree.toString()}`);
|
|
9587
9454
|
return this.angularRouter.navigateByUrl(urlSnapshot.urlTree, navigationExtras);
|
|
@@ -9591,7 +9458,7 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9591
9458
|
}
|
|
9592
9459
|
filterAuthorizedPlaces(places, options) {
|
|
9593
9460
|
const { chain } = Dsl.disposeWith(options.disposedWith);
|
|
9594
|
-
return chain(this.authService.accessGuard$).mapToList((g) => places.filter((p) => g.isAuthorised(
|
|
9461
|
+
return chain(this.authService.accessGuard$).mapToList((g) => places.filter((p) => g.isAuthorised(getPlaceDefinition(p))));
|
|
9595
9462
|
}
|
|
9596
9463
|
async notifyVisitSegmentChanged(is, was) {
|
|
9597
9464
|
// console.log("PlaceRouter.notifyVisitSegmentChanged", is.toDebugString(), was.toDebugString());
|
|
@@ -9599,13 +9466,15 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9599
9466
|
// FIXME: no route id -> route id duplicates route parameters
|
|
9600
9467
|
const visit = this.activeVisit$.value.copyAndReplaceSegment(is);
|
|
9601
9468
|
if (is.hasRoutingChangedFrom(was)) {
|
|
9602
|
-
//
|
|
9603
|
-
//
|
|
9469
|
+
// An in-place parameter change (model -> route) is a refinement of the current view rather
|
|
9470
|
+
// than a new destination - e.g. a selection model writing its selected id, including the
|
|
9471
|
+
// auto-select-first / select-nearest corrections. We update the URL with replaceUrl so the
|
|
9472
|
+
// selection never accrues spurious back-stack entries.
|
|
9604
9473
|
await this.doNavigation(visit, () => {
|
|
9605
9474
|
const urlSnapshot = this.urlService
|
|
9606
9475
|
.parseUrl(this.angularRouter.routerState.snapshot.url)
|
|
9607
9476
|
.updateVisitSegment(is);
|
|
9608
|
-
return this.navigateByUrl(urlSnapshot);
|
|
9477
|
+
return this.navigateByUrl(urlSnapshot, { replaceUrl: true });
|
|
9609
9478
|
});
|
|
9610
9479
|
}
|
|
9611
9480
|
}
|
|
@@ -11792,6 +11661,209 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
11792
11661
|
}]
|
|
11793
11662
|
}] });
|
|
11794
11663
|
|
|
11664
|
+
// class ParameterChangeInterceptor<T> {
|
|
11665
|
+
// constructor(parameterDef: ParameterDefinition<T>, model: ValueModel<T>, callback: PlaceComponent.InterceptCallback<T>, options: PlaceComponent.InterceptOptions) {
|
|
11666
|
+
// }
|
|
11667
|
+
//
|
|
11668
|
+
// async canProceed(nextState: VisitSegment, interactionContext: InteractionContext) {
|
|
11669
|
+
// return true;
|
|
11670
|
+
// }
|
|
11671
|
+
// }
|
|
11672
|
+
class PlaceComponent extends LoadableComponent {
|
|
11673
|
+
_placeReadyCallbacks = [];
|
|
11674
|
+
visit$ = new MutableValueModel();
|
|
11675
|
+
_inVisitUpdate = new Guard();
|
|
11676
|
+
_active = new MutableValueModel(false);
|
|
11677
|
+
interactionContext;
|
|
11678
|
+
childPlaces$;
|
|
11679
|
+
// private readonly _parameterChangeInterceptors: ParameterChangeInterceptor<any>[] = [];
|
|
11680
|
+
placeId;
|
|
11681
|
+
placeRouter = inject(PlaceRouter);
|
|
11682
|
+
activatedRoute = inject(ActivatedRoute);
|
|
11683
|
+
constructor() {
|
|
11684
|
+
super();
|
|
11685
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
11686
|
+
when(this._active).becomesTruthy(() => this._notifyPlaceReady());
|
|
11687
|
+
this.childPlaces$ = ListModel.constant(this.placeDefinition.children.map(d => d.component));
|
|
11688
|
+
this.placeId = this.placeDefinition.placeId;
|
|
11689
|
+
if (isEmpty(this.placeId)) {
|
|
11690
|
+
lang.illegalState("placeId property is missing from the route data parameters");
|
|
11691
|
+
}
|
|
11692
|
+
}
|
|
11693
|
+
initialiseVisit(visit, notifyVisitChanged) {
|
|
11694
|
+
assert.isNil(this.visit$.value);
|
|
11695
|
+
const { when } = Dsl.disposeWith(this);
|
|
11696
|
+
this.visit$.value = visit;
|
|
11697
|
+
DebugContext.getOrCreate(this.visit$).tag(`${this.placeDefinition.component.name}.visit$`);
|
|
11698
|
+
// we track if any of the bindings updated the route (e.g. a selection model that auto-selected
|
|
11699
|
+
// the first item during construction while the route had no value). If so we update the route
|
|
11700
|
+
// once, after wiring up the change listener below.
|
|
11701
|
+
const routeUpdatedByBinding = this.placeDefinition
|
|
11702
|
+
.getVisitParameterDefs()
|
|
11703
|
+
.map(parameterDef => this.installAndInitialiseBinding(visit, parameterDef))
|
|
11704
|
+
.some(Boolean);
|
|
11705
|
+
when(this.visit$).changes((current, previous) => {
|
|
11706
|
+
notifyVisitChanged(current, previous);
|
|
11707
|
+
}, { unless: this._inVisitUpdate });
|
|
11708
|
+
// The binding process can update the visit when the route had no value (e.g. a selection model
|
|
11709
|
+
// with autoSelectFirstItemOnLoad that already selected during component construction). Propagate
|
|
11710
|
+
// that to the router now so the URL reflects the selection. PlaceRouter applies in-place
|
|
11711
|
+
// parameter updates with replaceUrl (see PlaceRouter.notifyVisitSegmentChanged), so the
|
|
11712
|
+
// auto-selected value doesn't create a spurious history entry.
|
|
11713
|
+
if (routeUpdatedByBinding && this.visit$.value.hasRoutingChangedFrom(visit)) {
|
|
11714
|
+
notifyVisitChanged(this.visit$.value, visit);
|
|
11715
|
+
}
|
|
11716
|
+
}
|
|
11717
|
+
get childPlaces() {
|
|
11718
|
+
return this.childPlaces$.value;
|
|
11719
|
+
}
|
|
11720
|
+
updateVisit(visit) {
|
|
11721
|
+
assert.isTruthy(this.isInitialised());
|
|
11722
|
+
assert.notNil(visit);
|
|
11723
|
+
this._inVisitUpdate.whileTrue(() => {
|
|
11724
|
+
this.visit$.value = visit;
|
|
11725
|
+
});
|
|
11726
|
+
}
|
|
11727
|
+
isInitialised() {
|
|
11728
|
+
return !!this.visit$.value;
|
|
11729
|
+
}
|
|
11730
|
+
// @Trace()
|
|
11731
|
+
/**
|
|
11732
|
+
* Initialised the component bindings. If any binding has an initial model value (e.g. a selection model
|
|
11733
|
+
* initialised during the constructor) and the route has nothing, then the visit will be udpated and this
|
|
11734
|
+
* method will return ture to nofiy the the visit has changed.
|
|
11735
|
+
*/
|
|
11736
|
+
installAndInitialiseBinding(initialVisit, parameterDef) {
|
|
11737
|
+
const model = this[parameterDef.propertyName];
|
|
11738
|
+
assert.notNil(model);
|
|
11739
|
+
DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);
|
|
11740
|
+
const binding = this.registerDisposable(new Binding(this.visit$, model, {
|
|
11741
|
+
toRight(visit) {
|
|
11742
|
+
const value = visit.getParameterValue(parameterDef);
|
|
11743
|
+
// console.log('push to component', { name: parameterDef.name, value, visit });
|
|
11744
|
+
return value;
|
|
11745
|
+
},
|
|
11746
|
+
toLeft(value, currentVisit) {
|
|
11747
|
+
// console.log('push to route', { name: parameterDef.name, value, currentVisit });
|
|
11748
|
+
return currentVisit.replace(parameterDef, value);
|
|
11749
|
+
}
|
|
11750
|
+
}));
|
|
11751
|
+
// Now we need to initialise the binding direction. If we have a value in the Url then we should always push
|
|
11752
|
+
// that to the view. If we don't and the view already has a value (e.g. a selection model has already initialised in the
|
|
11753
|
+
// component constructor) then we should push that to the route.
|
|
11754
|
+
const isInVisit = !isNil(initialVisit.getParameterValue(parameterDef));
|
|
11755
|
+
const isInModel = !isNil(model.value);
|
|
11756
|
+
if (!isInVisit && isInModel) {
|
|
11757
|
+
binding.writeLeft(); // push it to the route
|
|
11758
|
+
return true; // the model (e.g. an auto-selected selection) updated the route
|
|
11759
|
+
}
|
|
11760
|
+
else {
|
|
11761
|
+
binding.writeRight(); // push it to the model
|
|
11762
|
+
return false;
|
|
11763
|
+
}
|
|
11764
|
+
}
|
|
11765
|
+
get placeDefinition() {
|
|
11766
|
+
const definition = PlaceComponent.getDefinition(this.constructor);
|
|
11767
|
+
if (!definition) {
|
|
11768
|
+
lang.illegalState(`${this.constructor.name} extends PlaceComponent but doesn't have @Place({..}) decorator.`);
|
|
11769
|
+
}
|
|
11770
|
+
return definition;
|
|
11771
|
+
}
|
|
11772
|
+
get active() {
|
|
11773
|
+
return this._active.readonly$;
|
|
11774
|
+
}
|
|
11775
|
+
/**
|
|
11776
|
+
* Called by the router to see if this component can deactivate. This isn't called for route parameter changes.
|
|
11777
|
+
* @param interactionContext
|
|
11778
|
+
*/
|
|
11779
|
+
async _canLeavePlace(interactionContext) {
|
|
11780
|
+
return this.canDeactivate ? this.canDeactivate(interactionContext) : true;
|
|
11781
|
+
}
|
|
11782
|
+
/**
|
|
11783
|
+
* Called by the router to see if this component can deactivate. This isn't called for route parameter changes.
|
|
11784
|
+
* @param interactionContext
|
|
11785
|
+
* @param nextState
|
|
11786
|
+
*/
|
|
11787
|
+
async _canChangeRouteParameters(interactionContext, nextState) {
|
|
11788
|
+
// if (this._parameterChangeInterceptors.length > 0) {
|
|
11789
|
+
// const visit = nextState.createVisitSegmentFor(this.placeDefinition);
|
|
11790
|
+
// for (let i = 0; i < this._parameterChangeInterceptors.length; i++) {
|
|
11791
|
+
// const interceptor = this._parameterChangeInterceptors[i];
|
|
11792
|
+
// const keepGoing = await interceptor.canProceed(visit, interactionContext);
|
|
11793
|
+
// if (!keepGoing) {
|
|
11794
|
+
// return false;
|
|
11795
|
+
// }
|
|
11796
|
+
// }
|
|
11797
|
+
// }
|
|
11798
|
+
return true;
|
|
11799
|
+
}
|
|
11800
|
+
/**
|
|
11801
|
+
* Called by the router when the place is ready to interact after any animations have run.
|
|
11802
|
+
*/
|
|
11803
|
+
_notifyActive(active) {
|
|
11804
|
+
this._active.value = active;
|
|
11805
|
+
}
|
|
11806
|
+
/**
|
|
11807
|
+
* Called by the router when the place is ready to interact after any animations have run.
|
|
11808
|
+
*/
|
|
11809
|
+
_notifyPlaceReady() {
|
|
11810
|
+
if (this.onPlaceReady.length === 1) {
|
|
11811
|
+
this._placeReadyCallbacks.forEach(callback => callback());
|
|
11812
|
+
}
|
|
11813
|
+
else {
|
|
11814
|
+
console.warn('Overriding PlaceComponent.onPlaceReady has been deprecated. Use PlaceComponent.onPlaceReady(() => {... do stuff...}) instead.');
|
|
11815
|
+
this.onPlaceReady(undefined);
|
|
11816
|
+
}
|
|
11817
|
+
}
|
|
11818
|
+
onPlaceReady(callback) {
|
|
11819
|
+
this._placeReadyCallbacks.push(callback);
|
|
11820
|
+
}
|
|
11821
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: PlaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
11822
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.9", type: PlaceComponent, host: { properties: { "attr.place-id": "this.placeId" } }, usesInheritance: true, ngImport: i0 });
|
|
11823
|
+
}
|
|
11824
|
+
__decorate([
|
|
11825
|
+
MemoizeGet(),
|
|
11826
|
+
__metadata("design:type", PlaceDefinition),
|
|
11827
|
+
__metadata("design:paramtypes", [])
|
|
11828
|
+
], PlaceComponent.prototype, "placeDefinition", null);
|
|
11829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: PlaceComponent, decorators: [{
|
|
11830
|
+
type: Directive
|
|
11831
|
+
}], ctorParameters: function () { return []; }, propDecorators: { placeId: [{
|
|
11832
|
+
type: HostBinding,
|
|
11833
|
+
args: ["attr.place-id"]
|
|
11834
|
+
}], placeDefinition: [] } });
|
|
11835
|
+
(function (PlaceComponent) {
|
|
11836
|
+
function isPlaceComponentConstructor(target) {
|
|
11837
|
+
return lang.constructorChain(target).includes(PlaceComponent);
|
|
11838
|
+
}
|
|
11839
|
+
PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
|
|
11840
|
+
function getRouteParameters(klass) {
|
|
11841
|
+
return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
11842
|
+
}
|
|
11843
|
+
PlaceComponent.getRouteParameters = getRouteParameters;
|
|
11844
|
+
function getDefinition(snapshotOrConstructor) {
|
|
11845
|
+
if (snapshotOrConstructor instanceof ActivatedRouteSnapshot) {
|
|
11846
|
+
const component = snapshotOrConstructor.component;
|
|
11847
|
+
if (!isPlaceComponentConstructor(component)) {
|
|
11848
|
+
throw new Error(`ActivatedRouteSnapshot component is not a PlaceComponent, got ${component}`);
|
|
11849
|
+
}
|
|
11850
|
+
return getPlaceDefinition(component);
|
|
11851
|
+
}
|
|
11852
|
+
else {
|
|
11853
|
+
return getPlaceDefinition(snapshotOrConstructor);
|
|
11854
|
+
}
|
|
11855
|
+
}
|
|
11856
|
+
PlaceComponent.getDefinition = getDefinition;
|
|
11857
|
+
function injectDefinition(klass, definition) {
|
|
11858
|
+
setPlaceDefinition(klass, definition);
|
|
11859
|
+
}
|
|
11860
|
+
PlaceComponent.injectDefinition = injectDefinition;
|
|
11861
|
+
// export type InterceptCallback<T> = (is: T, was: T, interactionContext: InteractionContext) => boolean | Promise<boolean>;
|
|
11862
|
+
// export interface InterceptOptions {
|
|
11863
|
+
// initialValue: 'evaluationUnlessNil' | 'evaluate'
|
|
11864
|
+
// }
|
|
11865
|
+
})(PlaceComponent || (PlaceComponent = {}));
|
|
11866
|
+
|
|
11795
11867
|
const AUP_PLACE_CONFIG = new InjectionToken('AUP_PLACE_CONFIG');
|
|
11796
11868
|
|
|
11797
11869
|
class NotAuthorisedNoticeComponent {
|
|
@@ -12480,6 +12552,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
12480
12552
|
}]
|
|
12481
12553
|
}] });
|
|
12482
12554
|
|
|
12555
|
+
/**
|
|
12556
|
+
* @file Automatically generated by barrelsby.
|
|
12557
|
+
*/
|
|
12558
|
+
|
|
12559
|
+
class TextSearchContext {
|
|
12560
|
+
row;
|
|
12561
|
+
searchText;
|
|
12562
|
+
searchRegex;
|
|
12563
|
+
constructor(row, searchText, searchRegex) {
|
|
12564
|
+
this.row = row;
|
|
12565
|
+
this.searchText = searchText;
|
|
12566
|
+
this.searchRegex = searchRegex;
|
|
12567
|
+
}
|
|
12568
|
+
getOrCreate(type, create) {
|
|
12569
|
+
// TODO: stub awaiting per-context cache implementation
|
|
12570
|
+
}
|
|
12571
|
+
matchesText(text) {
|
|
12572
|
+
return this.searchRegex.test(text);
|
|
12573
|
+
}
|
|
12574
|
+
}
|
|
12575
|
+
|
|
12576
|
+
class AbstractCellRenderer extends LoadableComponent {
|
|
12577
|
+
constructor() {
|
|
12578
|
+
super();
|
|
12579
|
+
}
|
|
12580
|
+
}
|
|
12581
|
+
|
|
12483
12582
|
/**
|
|
12484
12583
|
* @file Automatically generated by barrelsby.
|
|
12485
12584
|
*/
|