@coolon/angular-ui-powerups 3.8.0 → 3.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.
- package/CHANGELOG.md +14 -0
- package/assets/activities.scss +9 -0
- package/assets/styles.scss +2 -0
- package/assets/table.scss +18 -0
- package/assets/typography.scss +5 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +1219 -502
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/card-container/card-container.component.js +1 -1
- package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.js +13 -5
- package/esm2015/lib/components/components.module.js.map +1 -1
- package/esm2015/lib/components/components.module.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/exports.js +11 -0
- package/esm2015/lib/components/exports.js.map +1 -1
- package/esm2015/lib/components/exports.metadata.json +1 -1
- package/esm2015/lib/components/table/abstract-table-model.js +173 -0
- package/esm2015/lib/components/table/abstract-table-model.js.map +1 -0
- package/esm2015/lib/components/table/abstract-table-model.metadata.json +1 -0
- package/esm2015/lib/components/table/column-model.js +6 -3
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table-model.js +7 -171
- package/esm2015/lib/components/table/table-model.js.map +1 -1
- package/esm2015/lib/components/table/table-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.js +3 -3
- package/esm2015/lib/components/table/table.component.js.map +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/esm2015/lib/components/tree-table/decorated-tree-node.js +169 -0
- package/esm2015/lib/components/tree-table/decorated-tree-node.js.map +1 -0
- package/esm2015/lib/components/tree-table/decorated-tree-node.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-expansion-model.js +48 -0
- package/esm2015/lib/components/tree-table/tree-expansion-model.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-expansion-model.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.js +68 -0
- package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js +71 -0
- package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-label-column-model.js +33 -0
- package/esm2015/lib/components/tree-table/tree-label-column-model.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-label-column-model.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-node.js +2 -0
- package/esm2015/lib/components/tree-table/tree-node.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-node.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-table-component.js +63 -0
- package/esm2015/lib/components/tree-table/tree-table-component.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-table-component.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-table-component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-table-model.js +90 -0
- package/esm2015/lib/components/tree-table/tree-table-model.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-table-model.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/tree-table.component.scss.ngstyle.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-to-list-model.js +25 -0
- package/esm2015/lib/components/tree-table/tree-to-list-model.js.map +1 -0
- package/esm2015/lib/components/tree-table/tree-to-list-model.metadata.json +1 -0
- package/esm2015/lib/components/tree-table/visitable.class.js +26 -0
- package/esm2015/lib/components/tree-table/visitable.class.js.map +1 -0
- package/esm2015/lib/components/tree-table/visitable.class.metadata.json +1 -0
- package/esm2015/lib/interaction/components/activity-title/activity-title.component.js +26 -0
- package/esm2015/lib/interaction/components/activity-title/activity-title.component.js.map +1 -0
- package/esm2015/lib/interaction/components/activity-title/activity-title.component.metadata.json +1 -0
- package/esm2015/lib/interaction/components/activity-title/activity-title.component.ngfactory.js.map +1 -0
- package/esm2015/lib/interaction/components/activity-title/activity-title.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/interaction/exports.js +1 -0
- package/esm2015/lib/interaction/exports.js.map +1 -1
- package/esm2015/lib/interaction/exports.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.js +4 -1
- package/esm2015/lib/interaction/interaction.module.js.map +1 -1
- package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +981 -380
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/exports.d.ts +11 -0
- package/lib/components/table/abstract-table-model.d.ts +61 -0
- package/lib/components/table/column-model.d.ts +11 -12
- package/lib/components/table/table-model.d.ts +4 -59
- package/lib/components/table/table.component.d.ts +2 -2
- package/lib/components/tree-table/decorated-tree-node.d.ts +43 -0
- package/lib/components/tree-table/tree-expansion-model.d.ts +18 -0
- package/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.d.ts +28 -0
- package/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +25 -0
- package/lib/components/tree-table/tree-label-column-model.d.ts +20 -0
- package/lib/components/tree-table/tree-node.d.ts +3 -0
- package/lib/components/tree-table/tree-table-component.d.ts +7 -0
- package/lib/components/tree-table/tree-table-model.d.ts +32 -0
- package/lib/components/tree-table/tree-to-list-model.d.ts +12 -0
- package/lib/components/tree-table/visitable.class.d.ts +22 -0
- package/lib/interaction/components/activity-title/activity-title.component.d.ts +5 -0
- package/lib/interaction/exports.d.ts +1 -0
- package/package.json +1 -1
- package/schematics/place-routes/place-builder.js +1 -1
- package/schematics/place-routes/place-builder.js.map +1 -1
- package/schematics/utils/build-context.js +0 -2
- package/schematics/utils/build-context.js.map +1 -1
- package/schematics/utils/schematic-tree-file-system.js +6 -2
- package/schematics/utils/schematic-tree-file-system.js.map +1 -1
|
@@ -699,7 +699,7 @@
|
|
|
699
699
|
{ type: i0.Component, args: [{
|
|
700
700
|
selector: 'aup-card-container',
|
|
701
701
|
template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <aup-command-face *ngIf=\"addCardFace\" [faces]=\"[addCardFace]\"></aup-command-face>\n <aup-icon *ngIf=\"!addCardFace\" icon=\"mat:add\"></aup-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
|
|
702
|
-
styles: [":root{--aup-default-background:#fff;--aup-default-padding:var(--default-padding,18px)}.router-outlet-container>*{bottom:0;left:0;position:absolute;right:0;top:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context,.dialog-interaction-context mat-dialog-container{max-height:95vh!important;max-width:95vw!important}.dialog-interaction-context mat-dialog-container{padding:0}.activity-outlet-wrapper{align-items:stretch;display:flex;flex-direction:column}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}.aup-input-component.dense mat-form-field .mat-form-field-infix{border-top:none}.aup-input-component.dense mat-form-field .mat-form-field-flex{padding-top:0}.aup-input-component.dense mat-form-field .mat-form-field-wrapper{border-bottom:0;padding-bottom:0}.aup-input-component.dense mat-form-field .mat-form-field-underline{bottom:0}.aup-input-component.dense mat-form-field.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label-wrapper{display:none}.aup-input-component.dense mat-form-field.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(0)}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap,24px);--resolved-row-hover-background-color:var(--row-hover-background-color,rgba(0,0,0,0.05))}aup-table .mat-table td.mat-cell:first-of-type,aup-table .mat-table td.mat-footer-cell:first-of-type,aup-table .mat-table th.mat-header-cell:first-of-type{padding-left:0}aup-table .mat-table tr.enable-hover:hover{background-color:var(--resolved-row-hover-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table aup-table-cell-renderer,aup-table aup-table-header-cell-renderer{align-items:stretch;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:47px}aup-table aup-table-cell-renderer.first-column,aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer.first-column,aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}aup-table aup-table-cell-renderer.fillCell{justify-content:stretch;padding-left:0!important}aup-table aup-table-cell-renderer.padChild>:first-child{flex:1;padding-left:var(--default-column-gap)}:root{--aup-command-face-icon-gap:8px;--aup-fa-icon-width:18px;--aup-icon-width:24px}aup-icon{--fa-icon-offset:calc((var(--aup-icon-width) - var(--aup-fa-icon-width))/2);position:relative}aup-icon fa-icon .svg-inline--fa{height:var(--aup-fa-icon-width)!important;left:var(--fa-icon-offset);position:absolute;top:var(--fa-icon-offset);width:var(--aup-fa-icon-width)!important}.mat-menu-panel aup-icon .svg-inline--fa{opacity:.54}:host{--resolved-card-background:var(--card-background,#fcfcfb);--resolved-card-gap:var(--card-gap,16px);--resolved-card-height:var(--card-height,auto);--resolved-card-min-height:var(--card-min-height,auto);--resolved-card-width:var(--card-width,300px);background:var(--resolved-card-background);display:block;flex:1}.card-container{box-sizing:border-box;display:-ms-grid;display:grid;grid-gap:var(--resolved-card-gap);grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(var(--resolved-card-min-height),var(--resolved-card-height)));max-width:100%;min-height:calc(var(--resolved-card-height) + 2*var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2*var(--resolved-card-gap));padding:var(--resolved-card-gap);width:calc((var(--resolved-card-width) + var(--resolved-card-gap))*2 + var(--grid-gap))}.add-card-container{align-items:center;background-color:hsla(0,0%,100%,.8);border:2px dashed rgba(0,0,0,.1);border-radius:6px;box-sizing:border-box;color:rgba(0,0,0,.54);cursor:pointer;display:flex;flex-direction:column;font-weight:300;height:var(--resolved-card-height);justify-content:center;min-height:var(--resolved-card-min-height);transition:all .28s cubic-bezier(.4,0,.2,1);width:var(--resolved-card-width)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{background-color:#fff;border-color:transparent;color:rgba(0,0,0,.54);transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:all .28s cubic-bezier(.4,0,.2,1)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{align-items:stretch;display:flex;flex-direction:column;height:var(--resolved-card-height);justify-content:stretch;width:var(--resolved-card-width)}"]
|
|
702
|
+
styles: [":root{--aup-default-background:#fff;--aup-default-padding:var(--default-padding,18px)}aup-activity-title{font-family:Roboto,Helvetica Neue,sans-serif;font-size:20px;letter-spacing:normal;line-height:32px;margin-bottom:var(--default-padding)}.router-outlet-container>*{bottom:0;left:0;position:absolute;right:0;top:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context,.dialog-interaction-context mat-dialog-container{max-height:95vh!important;max-width:95vw!important}.dialog-interaction-context mat-dialog-container{padding:0}.activity-outlet-wrapper{align-items:stretch;display:flex;flex-direction:column}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}.aup-input-component.dense mat-form-field .mat-form-field-infix{border-top:none}.aup-input-component.dense mat-form-field .mat-form-field-flex{padding-top:0}.aup-input-component.dense mat-form-field .mat-form-field-wrapper{border-bottom:0;padding-bottom:0}.aup-input-component.dense mat-form-field .mat-form-field-underline{bottom:0}.aup-input-component.dense mat-form-field.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label-wrapper{display:none}.aup-input-component.dense mat-form-field.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(0)}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap,24px);--resolved-row-hover-background-color:var(--row-hover-background-color,rgba(0,0,0,0.05))}aup-table .mat-table td.mat-cell:first-of-type,aup-table .mat-table td.mat-footer-cell:first-of-type,aup-table .mat-table th.mat-header-cell:first-of-type{padding-left:0}aup-table .mat-table tr.enable-hover:hover{background-color:var(--resolved-row-hover-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table aup-table-cell-renderer,aup-table aup-table-header-cell-renderer{align-items:stretch;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:47px}aup-table aup-table-cell-renderer.first-column,aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer.first-column,aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}aup-table aup-table-cell-renderer.fillCell{justify-content:stretch;padding-left:0!important}aup-table aup-table-cell-renderer.padChild>:first-child{flex:1;padding-left:var(--default-column-gap)}:root{--aup-command-face-icon-gap:8px;--aup-fa-icon-width:18px;--aup-icon-width:24px}aup-icon{--fa-icon-offset:calc((var(--aup-icon-width) - var(--aup-fa-icon-width))/2);position:relative}aup-icon fa-icon .svg-inline--fa{height:var(--aup-fa-icon-width)!important;left:var(--fa-icon-offset);position:absolute;top:var(--fa-icon-offset);width:var(--aup-fa-icon-width)!important}.mat-menu-panel aup-icon .svg-inline--fa{opacity:.54}:host{--resolved-card-background:var(--card-background,#fcfcfb);--resolved-card-gap:var(--card-gap,16px);--resolved-card-height:var(--card-height,auto);--resolved-card-min-height:var(--card-min-height,auto);--resolved-card-width:var(--card-width,300px);background:var(--resolved-card-background);display:block;flex:1}.card-container{box-sizing:border-box;display:-ms-grid;display:grid;grid-gap:var(--resolved-card-gap);grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(var(--resolved-card-min-height),var(--resolved-card-height)));max-width:100%;min-height:calc(var(--resolved-card-height) + 2*var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2*var(--resolved-card-gap));padding:var(--resolved-card-gap);width:calc((var(--resolved-card-width) + var(--resolved-card-gap))*2 + var(--grid-gap))}.add-card-container{align-items:center;background-color:hsla(0,0%,100%,.8);border:2px dashed rgba(0,0,0,.1);border-radius:6px;box-sizing:border-box;color:rgba(0,0,0,.54);cursor:pointer;display:flex;flex-direction:column;font-weight:300;height:var(--resolved-card-height);justify-content:center;min-height:var(--resolved-card-min-height);transition:all .28s cubic-bezier(.4,0,.2,1);width:var(--resolved-card-width)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{background-color:#fff;border-color:transparent;color:rgba(0,0,0,.54);transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:all .28s cubic-bezier(.4,0,.2,1)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{align-items:stretch;display:flex;flex-direction:column;height:var(--resolved-card-height);justify-content:stretch;width:var(--resolved-card-width)}"]
|
|
703
703
|
},] }
|
|
704
704
|
];
|
|
705
705
|
CardContainerComponent.ctorParameters = function () { return []; };
|
|
@@ -713,10 +713,6 @@
|
|
|
713
713
|
__metadata("design:type", pectin.Command)
|
|
714
714
|
], CardContainerComponent.prototype, "addCardCommand", void 0);
|
|
715
715
|
|
|
716
|
-
(function (TrackBy) {
|
|
717
|
-
TrackBy.byIndex = function (data, index) { return index; };
|
|
718
|
-
})(exports.TrackBy || (exports.TrackBy = {}));
|
|
719
|
-
|
|
720
716
|
(function (CommandFace) {
|
|
721
717
|
var Position;
|
|
722
718
|
(function (Position) {
|
|
@@ -857,6 +853,80 @@
|
|
|
857
853
|
CommandFace.Adapter = Adapter;
|
|
858
854
|
})(exports.CommandFace || (exports.CommandFace = {}));
|
|
859
855
|
|
|
856
|
+
/**
|
|
857
|
+
* Custom CSS:
|
|
858
|
+
* @example
|
|
859
|
+
* root: { // globally
|
|
860
|
+
* --aup-command-face-icon-gap: 8px;
|
|
861
|
+
* }
|
|
862
|
+
* aup-command-face { // per instance
|
|
863
|
+
* --icon-gap: 4px;
|
|
864
|
+
* }
|
|
865
|
+
*/
|
|
866
|
+
var CommandFaceComponent = /** @class */ (function (_super) {
|
|
867
|
+
__extends(CommandFaceComponent, _super);
|
|
868
|
+
function CommandFaceComponent() {
|
|
869
|
+
var _this = _super.call(this) || this;
|
|
870
|
+
_this.facesModel = new pectin.MutableListModel();
|
|
871
|
+
_this.ignoreIcon = false;
|
|
872
|
+
_this.ignoreText = false;
|
|
873
|
+
_this.includeMissingIconInLayout = false;
|
|
874
|
+
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
875
|
+
_this.faceAdapters = chain(_this.facesModel).map(function (face) { return new exports.CommandFace.Adapter(face); });
|
|
876
|
+
var activeFace = _this.faceAdapters.first();
|
|
877
|
+
_this.activeIcon = activeFace.pluck("icon");
|
|
878
|
+
_this.activeColor = activeFace.pluck("color");
|
|
879
|
+
return _this;
|
|
880
|
+
}
|
|
881
|
+
Object.defineProperty(CommandFaceComponent.prototype, "requiresMissingIconInLayout", {
|
|
882
|
+
get: function () {
|
|
883
|
+
return this.includeMissingIconInLayout && !this.activeIcon.value;
|
|
884
|
+
},
|
|
885
|
+
enumerable: false,
|
|
886
|
+
configurable: true
|
|
887
|
+
});
|
|
888
|
+
CommandFaceComponent.prototype.ngOnInit = function () {
|
|
889
|
+
};
|
|
890
|
+
CommandFaceComponent.prototype.shouldIncludeIcon = function (face) {
|
|
891
|
+
return (!this.ignoreIcon && face.icon) || this.includeMissingIconInLayout;
|
|
892
|
+
};
|
|
893
|
+
CommandFaceComponent.prototype.hasIconStart = function (face) {
|
|
894
|
+
return this.shouldIncludeIcon(face) && (!face.iconPosition || face.iconPosition === exports.CommandFace.Position.START);
|
|
895
|
+
};
|
|
896
|
+
CommandFaceComponent.prototype.hasIconEnd = function (face) {
|
|
897
|
+
return this.shouldIncludeIcon(face) && face.iconPosition === exports.CommandFace.Position.END;
|
|
898
|
+
};
|
|
899
|
+
Object.defineProperty(CommandFaceComponent.prototype, "color", {
|
|
900
|
+
get: function () {
|
|
901
|
+
return this.activeColor.value;
|
|
902
|
+
},
|
|
903
|
+
enumerable: false,
|
|
904
|
+
configurable: true
|
|
905
|
+
});
|
|
906
|
+
return CommandFaceComponent;
|
|
907
|
+
}(DisposableComponent));
|
|
908
|
+
CommandFaceComponent.decorators = [
|
|
909
|
+
{ type: i0.Component, args: [{
|
|
910
|
+
selector: 'aup-command-face',
|
|
911
|
+
template: "<div class=\"face-container\" *ngFor=\"let face of faceAdapters.value\">\n <aup-icon *ngIf=\"hasIconStart(face)\" [icon]=\"face.icon\"></aup-icon>\n <span *ngIf=\"face.text\">{{face.text}}</span>\n <aup-icon *ngIf=\"hasIconEnd(face)\" [icon]=\"face.icon\"></aup-icon>\n</div>\n",
|
|
912
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
913
|
+
styles: ["aup-command-face{--icon-gap:var(--aup-command-face-icon-gap);display:-ms-inline-grid;display:inline-grid}aup-command-face>.face-container{-ms-grid-column:1;-ms-grid-row:1;align-items:center;display:inline-flex;flex-direction:row;grid-column:1;grid-row:1}aup-command-face>.face-container:not(:first-child){visibility:hidden}aup-command-face>.face-container *+*{margin-left:var(--icon-gap)}aup-command-face.hide-icon aup-icon{visibility:hidden}aup-command-face.centered{justify-items:center}"]
|
|
914
|
+
},] }
|
|
915
|
+
];
|
|
916
|
+
CommandFaceComponent.ctorParameters = function () { return []; };
|
|
917
|
+
CommandFaceComponent.propDecorators = {
|
|
918
|
+
_rawFaces: [{ type: i0.Input, args: ['faces',] }],
|
|
919
|
+
ignoreIcon: [{ type: i0.Input }],
|
|
920
|
+
ignoreText: [{ type: i0.Input }],
|
|
921
|
+
includeMissingIconInLayout: [{ type: i0.Input }],
|
|
922
|
+
requiresMissingIconInLayout: [{ type: i0.HostBinding, args: ['class.hide-icon',] }],
|
|
923
|
+
color: [{ type: i0.HostBinding, args: ['attr.color',] }]
|
|
924
|
+
};
|
|
925
|
+
__decorate([
|
|
926
|
+
pectin.StoreInListModel('facesModel'),
|
|
927
|
+
__metadata("design:type", Array)
|
|
928
|
+
], CommandFaceComponent.prototype, "_rawFaces", void 0);
|
|
929
|
+
|
|
860
930
|
var PopupAwareComponent = /** @class */ (function (_super) {
|
|
861
931
|
__extends(PopupAwareComponent, _super);
|
|
862
932
|
function PopupAwareComponent(element, parent) {
|
|
@@ -963,6 +1033,150 @@
|
|
|
963
1033
|
__metadata("design:type", Object)
|
|
964
1034
|
], CommandComponent.prototype, "busyFace", void 0);
|
|
965
1035
|
|
|
1036
|
+
/**
|
|
1037
|
+
*
|
|
1038
|
+
*/
|
|
1039
|
+
var FlexComponent = /** @class */ (function (_super) {
|
|
1040
|
+
__extends(FlexComponent, _super);
|
|
1041
|
+
function FlexComponent() {
|
|
1042
|
+
return _super.call(this) || this;
|
|
1043
|
+
}
|
|
1044
|
+
FlexComponent.prototype.ngOnInit = function () {
|
|
1045
|
+
};
|
|
1046
|
+
return FlexComponent;
|
|
1047
|
+
}(DisposableComponent));
|
|
1048
|
+
FlexComponent.decorators = [
|
|
1049
|
+
{ type: i0.Component, args: [{
|
|
1050
|
+
selector: 'aup-flex',
|
|
1051
|
+
template: ""
|
|
1052
|
+
},] }
|
|
1053
|
+
];
|
|
1054
|
+
FlexComponent.ctorParameters = function () { return []; };
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
*
|
|
1058
|
+
*/
|
|
1059
|
+
var AbstractPopupMenuComponent = /** @class */ (function (_super) {
|
|
1060
|
+
__extends(AbstractPopupMenuComponent, _super);
|
|
1061
|
+
function AbstractPopupMenuComponent(element, parent) {
|
|
1062
|
+
var _this = _super.call(this, element, parent) || this;
|
|
1063
|
+
_this._unorderedChildren = new pectin.MutableListModel();
|
|
1064
|
+
_this.faceModelDelegate = new pectin.DelegatingValueModel();
|
|
1065
|
+
_this.xPosition = 'after';
|
|
1066
|
+
_this.yPosition = 'below';
|
|
1067
|
+
var _c = pectin.Dsl.disposeWith(_this), chain = _c.chain, valueOf = _c.valueOf, before = _c.before, when = _c.when, after = _c.after, observe = _c.observe, switchOn = _c.switchOn;
|
|
1068
|
+
// group.faceListModel = chain(this.faceModel).mapToList(face => [face]);
|
|
1069
|
+
_this.faceAdapterModel = chain(_this.faceModelDelegate).map(function (f) { return new exports.CommandFace.Adapter(f); });
|
|
1070
|
+
_this.children = chain(_this._unorderedChildren).sortBy('componentIndex');
|
|
1071
|
+
return _this;
|
|
1072
|
+
}
|
|
1073
|
+
AbstractPopupMenuComponent.prototype.ngAfterContentChecked = function () {
|
|
1074
|
+
// force the list to re-order as the child indicies may have changed.
|
|
1075
|
+
this._unorderedChildren.value = __spread(this._unorderedChildren.value);
|
|
1076
|
+
};
|
|
1077
|
+
Object.defineProperty(AbstractPopupMenuComponent.prototype, "faceAdapter", {
|
|
1078
|
+
get: function () {
|
|
1079
|
+
var _a, _b;
|
|
1080
|
+
if (!this.faceAdapterModel) {
|
|
1081
|
+
console.error("Somehow faceAdapterModel is nil -- set a break point here and let me know what's going on");
|
|
1082
|
+
}
|
|
1083
|
+
return (_b = (_a = this.faceAdapterModel) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : new exports.CommandFace.Adapter(undefined);
|
|
1084
|
+
},
|
|
1085
|
+
enumerable: false,
|
|
1086
|
+
configurable: true
|
|
1087
|
+
});
|
|
1088
|
+
AbstractPopupMenuComponent.prototype.isRoot = function () {
|
|
1089
|
+
return !this.parent;
|
|
1090
|
+
};
|
|
1091
|
+
// @Trace()
|
|
1092
|
+
AbstractPopupMenuComponent.prototype.register = function (component) {
|
|
1093
|
+
var _this = this;
|
|
1094
|
+
this._unorderedChildren.push(component);
|
|
1095
|
+
return pectin.Disposable.disposableThatRuns(function () {
|
|
1096
|
+
_this._unorderedChildren.remove(component);
|
|
1097
|
+
});
|
|
1098
|
+
};
|
|
1099
|
+
AbstractPopupMenuComponent.prototype.onCommandFired = function () {
|
|
1100
|
+
this.triggers.forEach(function (trigger) {
|
|
1101
|
+
if (trigger.menuOpen) {
|
|
1102
|
+
trigger.closeMenu();
|
|
1103
|
+
}
|
|
1104
|
+
});
|
|
1105
|
+
};
|
|
1106
|
+
AbstractPopupMenuComponent.prototype.getFace = function () {
|
|
1107
|
+
return this.faceAdapter.face;
|
|
1108
|
+
};
|
|
1109
|
+
return AbstractPopupMenuComponent;
|
|
1110
|
+
}(PopupAwareComponent));
|
|
1111
|
+
AbstractPopupMenuComponent.decorators = [
|
|
1112
|
+
{ type: i0.Component, args: [{
|
|
1113
|
+
selector: 'aup-abstract-popup-menu',
|
|
1114
|
+
template: ''
|
|
1115
|
+
},] }
|
|
1116
|
+
];
|
|
1117
|
+
AbstractPopupMenuComponent.ctorParameters = function () { return [
|
|
1118
|
+
{ type: i0.ElementRef },
|
|
1119
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [POPUP_CONTAINER,] }] }
|
|
1120
|
+
]; };
|
|
1121
|
+
AbstractPopupMenuComponent.propDecorators = {
|
|
1122
|
+
xPosition: [{ type: i0.Input }],
|
|
1123
|
+
yPosition: [{ type: i0.Input }],
|
|
1124
|
+
triggers: [{ type: i0.ViewChildren, args: [menu.MatMenuTrigger,] }]
|
|
1125
|
+
};
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
*
|
|
1129
|
+
*/
|
|
1130
|
+
var MoreMenuComponent = /** @class */ (function (_super) {
|
|
1131
|
+
__extends(MoreMenuComponent, _super);
|
|
1132
|
+
function MoreMenuComponent(element, parent) {
|
|
1133
|
+
var _this = _super.call(this, element, parent) || this;
|
|
1134
|
+
_this.tooltipModel = new pectin.MutableValueModel();
|
|
1135
|
+
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1136
|
+
_this.faceModelDelegate.setDelegate(chain(_this.tooltipModel).map(function (tooltip) {
|
|
1137
|
+
return {
|
|
1138
|
+
icon: function () { return 'mat:more_vert'; },
|
|
1139
|
+
tooltip: function () {
|
|
1140
|
+
return tooltip;
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
}, { allowNil: true }));
|
|
1144
|
+
return _this;
|
|
1145
|
+
}
|
|
1146
|
+
Object.defineProperty(MoreMenuComponent.prototype, "face", {
|
|
1147
|
+
get: function () {
|
|
1148
|
+
return this.faceModelDelegate.value;
|
|
1149
|
+
},
|
|
1150
|
+
enumerable: false,
|
|
1151
|
+
configurable: true
|
|
1152
|
+
});
|
|
1153
|
+
return MoreMenuComponent;
|
|
1154
|
+
}(AbstractPopupMenuComponent));
|
|
1155
|
+
MoreMenuComponent.decorators = [
|
|
1156
|
+
{ type: i0.Component, args: [{
|
|
1157
|
+
selector: 'aup-more-menu',
|
|
1158
|
+
template: "<div class=\"content\" style=\"display: none\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"isRoot()\">\n <ng-container *ngIf=\"faceAdapter.text\" [ngSwitch]=\"faceAdapter.style\">\n <ng-container *ngSwitchCase=\"'stroked'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-stroked-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'raised'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-raised-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu [parent]=\"this\" (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!faceAdapter.text\">\n <button matMenuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n >\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n</ng-container>\n",
|
|
1159
|
+
providers: [
|
|
1160
|
+
{ provide: POPUP_CONTAINER, useExisting: MoreMenuComponent }
|
|
1161
|
+
]
|
|
1162
|
+
},] }
|
|
1163
|
+
];
|
|
1164
|
+
MoreMenuComponent.ctorParameters = function () { return [
|
|
1165
|
+
{ type: i0.ElementRef },
|
|
1166
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [POPUP_CONTAINER,] }, { type: i0.Optional }, { type: i0.SkipSelf }] }
|
|
1167
|
+
]; };
|
|
1168
|
+
MoreMenuComponent.propDecorators = {
|
|
1169
|
+
tooltip: [{ type: i0.Input }]
|
|
1170
|
+
};
|
|
1171
|
+
__decorate([
|
|
1172
|
+
pectin.StoreInValueModel('tooltipModel'),
|
|
1173
|
+
__metadata("design:type", String)
|
|
1174
|
+
], MoreMenuComponent.prototype, "tooltip", void 0);
|
|
1175
|
+
|
|
1176
|
+
(function (TrackBy) {
|
|
1177
|
+
TrackBy.byIndex = function (data, index) { return index; };
|
|
1178
|
+
})(exports.TrackBy || (exports.TrackBy = {}));
|
|
1179
|
+
|
|
966
1180
|
exports.CommandContainer = /** @class */ (function (_super) {
|
|
967
1181
|
__extends(CommandContainer, _super);
|
|
968
1182
|
function CommandContainer(parent) {
|
|
@@ -1064,94 +1278,23 @@
|
|
|
1064
1278
|
isHorizontalContainer: [{ type: i0.HostBinding, args: ['class.horizontal-container',] }]
|
|
1065
1279
|
};
|
|
1066
1280
|
|
|
1067
|
-
/**
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
_this.
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
_this.
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
AbstractPopupMenuComponent.prototype.ngAfterContentChecked = function () {
|
|
1085
|
-
// force the list to re-order as the child indicies may have changed.
|
|
1086
|
-
this._unorderedChildren.value = __spread(this._unorderedChildren.value);
|
|
1087
|
-
};
|
|
1088
|
-
Object.defineProperty(AbstractPopupMenuComponent.prototype, "faceAdapter", {
|
|
1089
|
-
get: function () {
|
|
1090
|
-
var _a, _b;
|
|
1091
|
-
if (!this.faceAdapterModel) {
|
|
1092
|
-
console.error("Somehow faceAdapterModel is nil -- set a break point here and let me know what's going on");
|
|
1093
|
-
}
|
|
1094
|
-
return (_b = (_a = this.faceAdapterModel) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : new exports.CommandFace.Adapter(undefined);
|
|
1095
|
-
},
|
|
1096
|
-
enumerable: false,
|
|
1097
|
-
configurable: true
|
|
1098
|
-
});
|
|
1099
|
-
AbstractPopupMenuComponent.prototype.isRoot = function () {
|
|
1100
|
-
return !this.parent;
|
|
1101
|
-
};
|
|
1102
|
-
// @Trace()
|
|
1103
|
-
AbstractPopupMenuComponent.prototype.register = function (component) {
|
|
1104
|
-
var _this = this;
|
|
1105
|
-
this._unorderedChildren.push(component);
|
|
1106
|
-
return pectin.Disposable.disposableThatRuns(function () {
|
|
1107
|
-
_this._unorderedChildren.remove(component);
|
|
1108
|
-
});
|
|
1109
|
-
};
|
|
1110
|
-
AbstractPopupMenuComponent.prototype.onCommandFired = function () {
|
|
1111
|
-
this.triggers.forEach(function (trigger) {
|
|
1112
|
-
if (trigger.menuOpen) {
|
|
1113
|
-
trigger.closeMenu();
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
};
|
|
1117
|
-
AbstractPopupMenuComponent.prototype.getFace = function () {
|
|
1118
|
-
return this.faceAdapter.face;
|
|
1119
|
-
};
|
|
1120
|
-
return AbstractPopupMenuComponent;
|
|
1121
|
-
}(PopupAwareComponent));
|
|
1122
|
-
AbstractPopupMenuComponent.decorators = [
|
|
1123
|
-
{ type: i0.Component, args: [{
|
|
1124
|
-
selector: 'aup-abstract-popup-menu',
|
|
1125
|
-
template: ''
|
|
1126
|
-
},] }
|
|
1127
|
-
];
|
|
1128
|
-
AbstractPopupMenuComponent.ctorParameters = function () { return [
|
|
1129
|
-
{ type: i0.ElementRef },
|
|
1130
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [POPUP_CONTAINER,] }] }
|
|
1131
|
-
]; };
|
|
1132
|
-
AbstractPopupMenuComponent.propDecorators = {
|
|
1133
|
-
xPosition: [{ type: i0.Input }],
|
|
1134
|
-
yPosition: [{ type: i0.Input }],
|
|
1135
|
-
triggers: [{ type: i0.ViewChildren, args: [menu.MatMenuTrigger,] }]
|
|
1136
|
-
};
|
|
1137
|
-
|
|
1138
|
-
var PopupMenuRendererComponent = /** @class */ (function (_super) {
|
|
1139
|
-
__extends(PopupMenuRendererComponent, _super);
|
|
1140
|
-
function PopupMenuRendererComponent() {
|
|
1141
|
-
var _this = _super.call(this) || this;
|
|
1142
|
-
_this._childList = new pectin.DelegatingListModel();
|
|
1143
|
-
_this.commandFired = new i0.EventEmitter();
|
|
1144
|
-
_this.TrackBy = exports.TrackBy;
|
|
1145
|
-
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1146
|
-
// this.children = chain(this.groupViewDataModel).pluckList('children');
|
|
1147
|
-
// this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');
|
|
1148
|
-
var faces = chain(_this._childList).map(function (child) {
|
|
1149
|
-
return child.getFace();
|
|
1150
|
-
}).rejectNil();
|
|
1151
|
-
var icons = faces.select(function (face) { return !!exports.CommandFace.getIconOf(face); });
|
|
1152
|
-
var iconCount = icons.count();
|
|
1153
|
-
var totalFaces = faces.count();
|
|
1154
|
-
_this.hasMixedIcons = valueOf.all(iconCount.isGreaterThan(0), totalFaces.doesNotEqual(iconCount)).areTruthy();
|
|
1281
|
+
var PopupMenuRendererComponent = /** @class */ (function (_super) {
|
|
1282
|
+
__extends(PopupMenuRendererComponent, _super);
|
|
1283
|
+
function PopupMenuRendererComponent() {
|
|
1284
|
+
var _this = _super.call(this) || this;
|
|
1285
|
+
_this._childList = new pectin.DelegatingListModel();
|
|
1286
|
+
_this.commandFired = new i0.EventEmitter();
|
|
1287
|
+
_this.TrackBy = exports.TrackBy;
|
|
1288
|
+
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1289
|
+
// this.children = chain(this.groupViewDataModel).pluckList('children');
|
|
1290
|
+
// this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');
|
|
1291
|
+
var faces = chain(_this._childList).map(function (child) {
|
|
1292
|
+
return child.getFace();
|
|
1293
|
+
}).rejectNil();
|
|
1294
|
+
var icons = faces.select(function (face) { return !!exports.CommandFace.getIconOf(face); });
|
|
1295
|
+
var iconCount = icons.count();
|
|
1296
|
+
var totalFaces = faces.count();
|
|
1297
|
+
_this.hasMixedIcons = valueOf.all(iconCount.isGreaterThan(0), totalFaces.doesNotEqual(iconCount)).areTruthy();
|
|
1155
1298
|
return _this;
|
|
1156
1299
|
}
|
|
1157
1300
|
Object.defineProperty(PopupMenuRendererComponent.prototype, "parent", {
|
|
@@ -1227,149 +1370,6 @@
|
|
|
1227
1370
|
triggers: [{ type: i0.ViewChildren, args: [menu.MatMenuTrigger,] }]
|
|
1228
1371
|
};
|
|
1229
1372
|
|
|
1230
|
-
/**
|
|
1231
|
-
* Custom CSS:
|
|
1232
|
-
* @example
|
|
1233
|
-
* root: { // globally
|
|
1234
|
-
* --aup-command-face-icon-gap: 8px;
|
|
1235
|
-
* }
|
|
1236
|
-
* aup-command-face { // per instance
|
|
1237
|
-
* --icon-gap: 4px;
|
|
1238
|
-
* }
|
|
1239
|
-
*/
|
|
1240
|
-
var CommandFaceComponent = /** @class */ (function (_super) {
|
|
1241
|
-
__extends(CommandFaceComponent, _super);
|
|
1242
|
-
function CommandFaceComponent() {
|
|
1243
|
-
var _this = _super.call(this) || this;
|
|
1244
|
-
_this.facesModel = new pectin.MutableListModel();
|
|
1245
|
-
_this.ignoreIcon = false;
|
|
1246
|
-
_this.ignoreText = false;
|
|
1247
|
-
_this.includeMissingIconInLayout = false;
|
|
1248
|
-
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1249
|
-
_this.faceAdapters = chain(_this.facesModel).map(function (face) { return new exports.CommandFace.Adapter(face); });
|
|
1250
|
-
var activeFace = _this.faceAdapters.first();
|
|
1251
|
-
_this.activeIcon = activeFace.pluck("icon");
|
|
1252
|
-
_this.activeColor = activeFace.pluck("color");
|
|
1253
|
-
return _this;
|
|
1254
|
-
}
|
|
1255
|
-
Object.defineProperty(CommandFaceComponent.prototype, "requiresMissingIconInLayout", {
|
|
1256
|
-
get: function () {
|
|
1257
|
-
return this.includeMissingIconInLayout && !this.activeIcon.value;
|
|
1258
|
-
},
|
|
1259
|
-
enumerable: false,
|
|
1260
|
-
configurable: true
|
|
1261
|
-
});
|
|
1262
|
-
CommandFaceComponent.prototype.ngOnInit = function () {
|
|
1263
|
-
};
|
|
1264
|
-
CommandFaceComponent.prototype.shouldIncludeIcon = function (face) {
|
|
1265
|
-
return (!this.ignoreIcon && face.icon) || this.includeMissingIconInLayout;
|
|
1266
|
-
};
|
|
1267
|
-
CommandFaceComponent.prototype.hasIconStart = function (face) {
|
|
1268
|
-
return this.shouldIncludeIcon(face) && (!face.iconPosition || face.iconPosition === exports.CommandFace.Position.START);
|
|
1269
|
-
};
|
|
1270
|
-
CommandFaceComponent.prototype.hasIconEnd = function (face) {
|
|
1271
|
-
return this.shouldIncludeIcon(face) && face.iconPosition === exports.CommandFace.Position.END;
|
|
1272
|
-
};
|
|
1273
|
-
Object.defineProperty(CommandFaceComponent.prototype, "color", {
|
|
1274
|
-
get: function () {
|
|
1275
|
-
return this.activeColor.value;
|
|
1276
|
-
},
|
|
1277
|
-
enumerable: false,
|
|
1278
|
-
configurable: true
|
|
1279
|
-
});
|
|
1280
|
-
return CommandFaceComponent;
|
|
1281
|
-
}(DisposableComponent));
|
|
1282
|
-
CommandFaceComponent.decorators = [
|
|
1283
|
-
{ type: i0.Component, args: [{
|
|
1284
|
-
selector: 'aup-command-face',
|
|
1285
|
-
template: "<div class=\"face-container\" *ngFor=\"let face of faceAdapters.value\">\n <aup-icon *ngIf=\"hasIconStart(face)\" [icon]=\"face.icon\"></aup-icon>\n <span *ngIf=\"face.text\">{{face.text}}</span>\n <aup-icon *ngIf=\"hasIconEnd(face)\" [icon]=\"face.icon\"></aup-icon>\n</div>\n",
|
|
1286
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
1287
|
-
styles: ["aup-command-face{--icon-gap:var(--aup-command-face-icon-gap);display:-ms-inline-grid;display:inline-grid}aup-command-face>.face-container{-ms-grid-column:1;-ms-grid-row:1;align-items:center;display:inline-flex;flex-direction:row;grid-column:1;grid-row:1}aup-command-face>.face-container:not(:first-child){visibility:hidden}aup-command-face>.face-container *+*{margin-left:var(--icon-gap)}aup-command-face.hide-icon aup-icon{visibility:hidden}aup-command-face.centered{justify-items:center}"]
|
|
1288
|
-
},] }
|
|
1289
|
-
];
|
|
1290
|
-
CommandFaceComponent.ctorParameters = function () { return []; };
|
|
1291
|
-
CommandFaceComponent.propDecorators = {
|
|
1292
|
-
_rawFaces: [{ type: i0.Input, args: ['faces',] }],
|
|
1293
|
-
ignoreIcon: [{ type: i0.Input }],
|
|
1294
|
-
ignoreText: [{ type: i0.Input }],
|
|
1295
|
-
includeMissingIconInLayout: [{ type: i0.Input }],
|
|
1296
|
-
requiresMissingIconInLayout: [{ type: i0.HostBinding, args: ['class.hide-icon',] }],
|
|
1297
|
-
color: [{ type: i0.HostBinding, args: ['attr.color',] }]
|
|
1298
|
-
};
|
|
1299
|
-
__decorate([
|
|
1300
|
-
pectin.StoreInListModel('facesModel'),
|
|
1301
|
-
__metadata("design:type", Array)
|
|
1302
|
-
], CommandFaceComponent.prototype, "_rawFaces", void 0);
|
|
1303
|
-
|
|
1304
|
-
/**
|
|
1305
|
-
*
|
|
1306
|
-
*/
|
|
1307
|
-
var FlexComponent = /** @class */ (function (_super) {
|
|
1308
|
-
__extends(FlexComponent, _super);
|
|
1309
|
-
function FlexComponent() {
|
|
1310
|
-
return _super.call(this) || this;
|
|
1311
|
-
}
|
|
1312
|
-
FlexComponent.prototype.ngOnInit = function () {
|
|
1313
|
-
};
|
|
1314
|
-
return FlexComponent;
|
|
1315
|
-
}(DisposableComponent));
|
|
1316
|
-
FlexComponent.decorators = [
|
|
1317
|
-
{ type: i0.Component, args: [{
|
|
1318
|
-
selector: 'aup-flex',
|
|
1319
|
-
template: ""
|
|
1320
|
-
},] }
|
|
1321
|
-
];
|
|
1322
|
-
FlexComponent.ctorParameters = function () { return []; };
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
*
|
|
1326
|
-
*/
|
|
1327
|
-
var MoreMenuComponent = /** @class */ (function (_super) {
|
|
1328
|
-
__extends(MoreMenuComponent, _super);
|
|
1329
|
-
function MoreMenuComponent(element, parent) {
|
|
1330
|
-
var _this = _super.call(this, element, parent) || this;
|
|
1331
|
-
_this.tooltipModel = new pectin.MutableValueModel();
|
|
1332
|
-
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1333
|
-
_this.faceModelDelegate.setDelegate(chain(_this.tooltipModel).map(function (tooltip) {
|
|
1334
|
-
return {
|
|
1335
|
-
icon: function () { return 'mat:more_vert'; },
|
|
1336
|
-
tooltip: function () {
|
|
1337
|
-
return tooltip;
|
|
1338
|
-
}
|
|
1339
|
-
};
|
|
1340
|
-
}, { allowNil: true }));
|
|
1341
|
-
return _this;
|
|
1342
|
-
}
|
|
1343
|
-
Object.defineProperty(MoreMenuComponent.prototype, "face", {
|
|
1344
|
-
get: function () {
|
|
1345
|
-
return this.faceModelDelegate.value;
|
|
1346
|
-
},
|
|
1347
|
-
enumerable: false,
|
|
1348
|
-
configurable: true
|
|
1349
|
-
});
|
|
1350
|
-
return MoreMenuComponent;
|
|
1351
|
-
}(AbstractPopupMenuComponent));
|
|
1352
|
-
MoreMenuComponent.decorators = [
|
|
1353
|
-
{ type: i0.Component, args: [{
|
|
1354
|
-
selector: 'aup-more-menu',
|
|
1355
|
-
template: "<div class=\"content\" style=\"display: none\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"isRoot()\">\n <ng-container *ngIf=\"faceAdapter.text\" [ngSwitch]=\"faceAdapter.style\">\n <ng-container *ngSwitchCase=\"'stroked'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-stroked-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'raised'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-raised-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu [parent]=\"this\" (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!faceAdapter.text\">\n <button matMenuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n >\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n</ng-container>\n",
|
|
1356
|
-
providers: [
|
|
1357
|
-
{ provide: POPUP_CONTAINER, useExisting: MoreMenuComponent }
|
|
1358
|
-
]
|
|
1359
|
-
},] }
|
|
1360
|
-
];
|
|
1361
|
-
MoreMenuComponent.ctorParameters = function () { return [
|
|
1362
|
-
{ type: i0.ElementRef },
|
|
1363
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [POPUP_CONTAINER,] }, { type: i0.Optional }, { type: i0.SkipSelf }] }
|
|
1364
|
-
]; };
|
|
1365
|
-
MoreMenuComponent.propDecorators = {
|
|
1366
|
-
tooltip: [{ type: i0.Input }]
|
|
1367
|
-
};
|
|
1368
|
-
__decorate([
|
|
1369
|
-
pectin.StoreInValueModel('tooltipModel'),
|
|
1370
|
-
__metadata("design:type", String)
|
|
1371
|
-
], MoreMenuComponent.prototype, "tooltip", void 0);
|
|
1372
|
-
|
|
1373
1373
|
/**
|
|
1374
1374
|
*
|
|
1375
1375
|
*/
|
|
@@ -2538,14 +2538,17 @@
|
|
|
2538
2538
|
var ɵ0 = noop;
|
|
2539
2539
|
var CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol("aup-cell-renderer:row-data-cache");
|
|
2540
2540
|
var ColumnModel = /** @class */ (function () {
|
|
2541
|
-
function ColumnModel(columnId,
|
|
2541
|
+
function ColumnModel(columnId, textPropertiesProvider) {
|
|
2542
2542
|
this.columnId = columnId;
|
|
2543
|
-
this.
|
|
2543
|
+
this.textPropertiesProvider = textPropertiesProvider;
|
|
2544
2544
|
this._selectRowOnClick = undefined;
|
|
2545
|
+
this.installHeaderRenderer();
|
|
2546
|
+
}
|
|
2547
|
+
ColumnModel.prototype.installHeaderRenderer = function () {
|
|
2545
2548
|
this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, function (component, column) {
|
|
2546
2549
|
component.headerText = column.getHeaderText();
|
|
2547
2550
|
});
|
|
2548
|
-
}
|
|
2551
|
+
};
|
|
2549
2552
|
ColumnModel.prototype.getHeaderText = function () {
|
|
2550
2553
|
var _a;
|
|
2551
2554
|
return ((_a = this.getColumnTextProperties()) === null || _a === void 0 ? void 0 : _a.headerText()) || this.getDefaultHeaderText();
|
|
@@ -2554,7 +2557,7 @@
|
|
|
2554
2557
|
return this.columnId;
|
|
2555
2558
|
};
|
|
2556
2559
|
ColumnModel.prototype.getColumnTextProperties = function () {
|
|
2557
|
-
return this._columnTextProperties || this.
|
|
2560
|
+
return this._columnTextProperties || this.textPropertiesProvider();
|
|
2558
2561
|
};
|
|
2559
2562
|
ColumnModel.prototype.textProperties = function (columnTextProperties) {
|
|
2560
2563
|
this._columnTextProperties = columnTextProperties;
|
|
@@ -2892,7 +2895,6 @@
|
|
|
2892
2895
|
return EditSession;
|
|
2893
2896
|
}(pectin.GarbageCollector));
|
|
2894
2897
|
|
|
2895
|
-
var TableModel_1;
|
|
2896
2898
|
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
2897
2899
|
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
2898
2900
|
var RowClass = /** @class */ (function () {
|
|
@@ -2902,148 +2904,85 @@
|
|
|
2902
2904
|
}
|
|
2903
2905
|
return RowClass;
|
|
2904
2906
|
}());
|
|
2905
|
-
/**
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
2917
|
-
* if (form.validate()) {
|
|
2918
|
-
* // normal form save stuff
|
|
2919
|
-
* return true; // finish editing
|
|
2920
|
-
* }
|
|
2921
|
-
* return false; // continue editiing
|
|
2922
|
-
* }
|
|
2923
|
-
* const colorsNames: ListModel<string> = ...;
|
|
2924
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2925
|
-
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
2926
|
-
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
2927
|
-
* validators: [Validator.present("We need a last name")]
|
|
2928
|
-
* });
|
|
2929
|
-
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
2930
|
-
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
2931
|
-
* initialiseComponent(component: SelectInputComponent) {
|
|
2932
|
-
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
2933
|
-
* }
|
|
2934
|
-
* });
|
|
2935
|
-
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
2936
|
-
* });
|
|
2937
|
-
*
|
|
2938
|
-
* Selection models
|
|
2939
|
-
* @example
|
|
2940
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2941
|
-
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
2942
|
-
* table.pluck("firstName");
|
|
2943
|
-
* table.pluck("lastName");
|
|
2944
|
-
* });
|
|
2945
|
-
*
|
|
2946
|
-
* Custom cell renderers and editors
|
|
2947
|
-
* @example
|
|
2948
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2949
|
-
* table.pluck("favoriteColor")
|
|
2950
|
-
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
2951
|
-
* // configure your component with what ever you need.
|
|
2952
|
-
* });
|
|
2953
|
-
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
2954
|
-
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
2955
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2956
|
-
* });
|
|
2957
|
-
*
|
|
2958
|
-
* I18n
|
|
2959
|
-
* @example
|
|
2960
|
-
* [table.yml]
|
|
2961
|
-
* table:
|
|
2962
|
-
* columns(ColumnTextProperties[]):
|
|
2963
|
-
* firstName:
|
|
2964
|
-
* headerText: "First Name"
|
|
2965
|
-
* fullName:
|
|
2966
|
-
* headerText: "Full Name"
|
|
2967
|
-
*
|
|
2968
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2969
|
-
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
2970
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2971
|
-
*
|
|
2972
|
-
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
2973
|
-
* });
|
|
2974
|
-
*/
|
|
2975
|
-
exports.TableModel = TableModel_1 = /** @class */ (function () {
|
|
2976
|
-
function TableModel(sourceOfTruth) {
|
|
2977
|
-
var _this = this;
|
|
2978
|
-
this.sourceOfTruth = sourceOfTruth;
|
|
2979
|
-
this._garbage = new pectin.GarbageCollector();
|
|
2980
|
-
this._columns = new pectin.MutableListModel();
|
|
2981
|
-
this._editorSessions = new pectin.MutableListModel();
|
|
2982
|
-
this.rowClassNamePredicates = [];
|
|
2983
|
-
this.rowClickListeners = new pectin.EventListenerList();
|
|
2984
|
-
this._createForm = function (row) { return new pectin.DirtyTrackingForm(); };
|
|
2985
|
-
this.trackBy = function (index, item) {
|
|
2907
|
+
exports.AbstractTableModel = /** @class */ (function (_super) {
|
|
2908
|
+
__extends(AbstractTableModel, _super);
|
|
2909
|
+
function AbstractTableModel(sourceOfTruth) {
|
|
2910
|
+
var _this = _super.call(this) || this;
|
|
2911
|
+
_this.sourceOfTruth = sourceOfTruth;
|
|
2912
|
+
_this._columns = new pectin.MutableListModel();
|
|
2913
|
+
_this._editorSessions = new pectin.MutableListModel();
|
|
2914
|
+
_this.rowClassNamePredicates = [];
|
|
2915
|
+
_this.rowClickListeners = new pectin.EventListenerList();
|
|
2916
|
+
_this._createForm = function (row) { return new pectin.DirtyTrackingForm(); };
|
|
2917
|
+
_this.trackBy = function (index, item) {
|
|
2986
2918
|
return _this.identityOf ? _this.identityOf(item) : index;
|
|
2987
2919
|
};
|
|
2988
|
-
|
|
2989
|
-
var _b = pectin.Dsl.disposeWith(
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
identifiedWith:
|
|
2920
|
+
_this.identityOf = sourceOfTruth.identityOf;
|
|
2921
|
+
var _b = pectin.Dsl.disposeWith(_this), chain = _b.chain, valueOf = _b.valueOf, before = _b.before, when = _b.when, after = _b.after, observe = _b.observe, switchOn = _b.switchOn;
|
|
2922
|
+
_this._columnsById = chain(_this._columns).indexBy('columnId');
|
|
2923
|
+
_this._rowsBeingEdited = new pectin.MutableListModel([], {
|
|
2924
|
+
identifiedWith: _this.identityOf
|
|
2993
2925
|
});
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2926
|
+
_this._editorSessionByRowId = chain(_this._editorSessions).indexBy('rowId');
|
|
2927
|
+
_this.editing = chain(_this._editorSessions).count().isGreaterThan(0);
|
|
2928
|
+
_this.dataSource = chain(_this.sourceOfTruth).replaceAll(_this.rowsBeingEdited);
|
|
2929
|
+
_this.firstEditableColumn = chain(_this.columns).select(function (c) { return c.hasEditorPortal(); }).first();
|
|
2930
|
+
_this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(_this._columns).findIndex(function (column) { return column.isRowSelectionExplicitlyEnabled(); }).isGreaterThanOrEqualTo(0);
|
|
2931
|
+
return _this;
|
|
2999
2932
|
}
|
|
3000
|
-
|
|
3001
|
-
var model = new TableModel_1(sourceOfTruth);
|
|
3002
|
-
builder(model);
|
|
3003
|
-
return model;
|
|
3004
|
-
};
|
|
3005
|
-
Object.defineProperty(TableModel.prototype, "rowsBeingEdited", {
|
|
2933
|
+
Object.defineProperty(AbstractTableModel.prototype, "rowsBeingEdited", {
|
|
3006
2934
|
get: function () {
|
|
3007
2935
|
return this._rowsBeingEdited.readonly;
|
|
3008
2936
|
},
|
|
3009
2937
|
enumerable: false,
|
|
3010
2938
|
configurable: true
|
|
3011
2939
|
});
|
|
3012
|
-
Object.defineProperty(
|
|
2940
|
+
Object.defineProperty(AbstractTableModel.prototype, "columns", {
|
|
3013
2941
|
get: function () {
|
|
3014
2942
|
return this._columns.readonly;
|
|
3015
2943
|
},
|
|
3016
2944
|
enumerable: false,
|
|
3017
2945
|
configurable: true
|
|
3018
2946
|
});
|
|
3019
|
-
|
|
3020
|
-
|
|
2947
|
+
AbstractTableModel.prototype.pluck = function (property, options) {
|
|
2948
|
+
var _this = this;
|
|
2949
|
+
var columnId = (options === null || options === void 0 ? void 0 : options.columnId) || property.toString();
|
|
2950
|
+
return this.addColumn(new PropertyColumnModel(columnId, property, function () { return _this.getColumnTextProperties(columnId); }));
|
|
3021
2951
|
};
|
|
3022
|
-
|
|
3023
|
-
|
|
2952
|
+
AbstractTableModel.prototype.pluckList = function (property, options) {
|
|
2953
|
+
var _this = this;
|
|
2954
|
+
var columnId = (options === null || options === void 0 ? void 0 : options.columnId) || property.toString();
|
|
2955
|
+
return this.addColumn(new ListPropertyColumnModel(columnId, property, function () { return _this.getColumnTextProperties(columnId); }));
|
|
3024
2956
|
};
|
|
3025
|
-
|
|
2957
|
+
AbstractTableModel.prototype._addSelectionColumn = function (selectionModel) {
|
|
2958
|
+
var _this = this;
|
|
3026
2959
|
pectin.assert.isNil(this.selectionColumnModel);
|
|
3027
|
-
|
|
2960
|
+
var columnId = 'selection-column';
|
|
2961
|
+
this.selectionColumnModel = new SelectionColumnModel(columnId, function () { return _this.getColumnTextProperties(columnId); }, selectionModel);
|
|
3028
2962
|
return this.addColumn(this.selectionColumnModel);
|
|
3029
2963
|
};
|
|
3030
|
-
|
|
2964
|
+
AbstractTableModel.prototype.addEditControls = function (saveCommand) {
|
|
2965
|
+
var _this = this;
|
|
3031
2966
|
this.saveCommand = saveCommand;
|
|
3032
|
-
|
|
2967
|
+
var columnId = 'editControls';
|
|
2968
|
+
return this.addColumn(new EditorControlColumnModel(columnId, saveCommand, function () { return _this.getColumnTextProperties(columnId); }));
|
|
3033
2969
|
};
|
|
3034
|
-
|
|
3035
|
-
|
|
2970
|
+
AbstractTableModel.prototype.addCustomColumn = function (columnId, dataAccessor) {
|
|
2971
|
+
var _this = this;
|
|
2972
|
+
return this.addColumn(new CustomValueColumnModel(columnId, function () { return _this.getColumnTextProperties(columnId); }, dataAccessor));
|
|
3036
2973
|
};
|
|
3037
|
-
|
|
3038
|
-
|
|
2974
|
+
AbstractTableModel.prototype.addComponentColumn = function (columnId, component, onComponentInitOrOptions) {
|
|
2975
|
+
var _this = this;
|
|
2976
|
+
return this.addColumn(new CustomValueColumnModel(columnId, function () { return _this.getColumnTextProperties(columnId); }, function (row) { return row; })).cellRenderer(component, onComponentInitOrOptions);
|
|
3039
2977
|
};
|
|
3040
|
-
|
|
3041
|
-
|
|
2978
|
+
AbstractTableModel.prototype.addTemplateColumn = function (columnId) {
|
|
2979
|
+
var _this = this;
|
|
2980
|
+
return this.addColumn(new CustomTemplateColumnModel(columnId, function () { return _this.getColumnTextProperties(columnId); }));
|
|
3042
2981
|
};
|
|
3043
|
-
|
|
2982
|
+
AbstractTableModel.prototype.addRowClass = function (className, predicate) {
|
|
3044
2983
|
this.rowClassNamePredicates.push(new RowClass(className, predicate));
|
|
3045
2984
|
};
|
|
3046
|
-
|
|
2985
|
+
AbstractTableModel.prototype.getRowClasses = function (row) {
|
|
3047
2986
|
var classNames = [];
|
|
3048
2987
|
this.rowClassNamePredicates.forEach(function (i) {
|
|
3049
2988
|
if (i.matches(row)) {
|
|
@@ -3052,11 +2991,11 @@
|
|
|
3052
2991
|
});
|
|
3053
2992
|
return classNames;
|
|
3054
2993
|
};
|
|
3055
|
-
|
|
2994
|
+
AbstractTableModel.prototype.useFormFactory = function (factory) {
|
|
3056
2995
|
this._createForm = factory;
|
|
3057
2996
|
return this;
|
|
3058
2997
|
};
|
|
3059
|
-
|
|
2998
|
+
AbstractTableModel.prototype.addColumn = function (column) {
|
|
3060
2999
|
if (this._columnsById.get(column.columnId)) {
|
|
3061
3000
|
pectin.lang.illegalState("Column with id=" + column.columnId + " already exists");
|
|
3062
3001
|
}
|
|
@@ -3065,16 +3004,24 @@
|
|
|
3065
3004
|
}
|
|
3066
3005
|
return column;
|
|
3067
3006
|
};
|
|
3007
|
+
Object.defineProperty(AbstractTableModel.prototype, "selectionModel", {
|
|
3008
|
+
get: function () {
|
|
3009
|
+
var _a;
|
|
3010
|
+
return (_a = this.selectionColumnModel) === null || _a === void 0 ? void 0 : _a.selectionModel;
|
|
3011
|
+
},
|
|
3012
|
+
enumerable: false,
|
|
3013
|
+
configurable: true
|
|
3014
|
+
});
|
|
3068
3015
|
// removeColumn(column: ColumnModel<Row>) {
|
|
3069
3016
|
//
|
|
3070
3017
|
// }
|
|
3071
|
-
|
|
3018
|
+
AbstractTableModel.prototype.columnTextProperties = function (columnTextProperties) {
|
|
3072
3019
|
this._columnTextPropertiesLookup = columnTextProperties;
|
|
3073
3020
|
};
|
|
3074
|
-
|
|
3075
|
-
return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[
|
|
3021
|
+
AbstractTableModel.prototype.getColumnTextProperties = function (columnId) {
|
|
3022
|
+
return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[columnId] : undefined;
|
|
3076
3023
|
};
|
|
3077
|
-
|
|
3024
|
+
AbstractTableModel.prototype.startEditSession = function (row) {
|
|
3078
3025
|
var _this = this;
|
|
3079
3026
|
var rowId = this.identityOf(row);
|
|
3080
3027
|
if (this._rowsBeingEdited.query().indexOf(row) > -1) {
|
|
@@ -3094,10 +3041,10 @@
|
|
|
3094
3041
|
return editSession_1;
|
|
3095
3042
|
}
|
|
3096
3043
|
};
|
|
3097
|
-
|
|
3044
|
+
AbstractTableModel.prototype.getEditSessionFor = function (row) {
|
|
3098
3045
|
return this._editorSessionByRowId.get(this.identityOf(row));
|
|
3099
3046
|
};
|
|
3100
|
-
|
|
3047
|
+
AbstractTableModel.prototype.cancelAllEditorSessions = function () {
|
|
3101
3048
|
var _this = this;
|
|
3102
3049
|
this._editorSessions.runInTransaction(function (draft) {
|
|
3103
3050
|
_this._rowsBeingEdited.runInTransaction(function () {
|
|
@@ -3105,47 +3052,41 @@
|
|
|
3105
3052
|
});
|
|
3106
3053
|
});
|
|
3107
3054
|
};
|
|
3108
|
-
|
|
3055
|
+
AbstractTableModel.prototype.isRowSelectionEnabledFor = function (column) {
|
|
3109
3056
|
var _a;
|
|
3110
3057
|
return this.selectionColumnModel && ((_a = column.isRowSelectionEnabled()) !== null && _a !== void 0 ? _a : this.isRowSelectionEnabledByDefault());
|
|
3111
3058
|
};
|
|
3112
|
-
|
|
3059
|
+
AbstractTableModel.prototype.isRowSelectionEnabledByDefault = function () {
|
|
3113
3060
|
return this.selectionColumnModel && this.selectionColumnModel.isRowSelectionEnabledByDefault();
|
|
3114
3061
|
};
|
|
3115
|
-
|
|
3062
|
+
AbstractTableModel.prototype.isRowSelectionEnabled = function () {
|
|
3116
3063
|
return this.hasColumnsWithRowSelectionExplicitlyEnabled.value || this.isRowSelectionEnabledByDefault();
|
|
3117
3064
|
};
|
|
3118
|
-
|
|
3065
|
+
AbstractTableModel.prototype.isHoverEnabled = function () {
|
|
3119
3066
|
return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;
|
|
3120
3067
|
};
|
|
3121
|
-
|
|
3122
|
-
// console.log({
|
|
3123
|
-
// column: column.columnId,
|
|
3124
|
-
// rowSelectionEnabled: this.isRowSelectionEnabledFor(column),
|
|
3125
|
-
// hasRowListeners: this.rowClickListeners.listenerCount > 0
|
|
3126
|
-
// });
|
|
3068
|
+
AbstractTableModel.prototype.isCursorEnabled = function (column) {
|
|
3127
3069
|
return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;
|
|
3128
3070
|
};
|
|
3129
|
-
|
|
3071
|
+
AbstractTableModel.prototype.selectRow = function (row) {
|
|
3130
3072
|
var _a;
|
|
3131
3073
|
(_a = this.selectionColumnModel) === null || _a === void 0 ? void 0 : _a.selectRow(row);
|
|
3132
3074
|
};
|
|
3133
|
-
|
|
3075
|
+
AbstractTableModel.prototype.onRowClicked = function (callback) {
|
|
3134
3076
|
return this.rowClickListeners.add(callback);
|
|
3135
3077
|
};
|
|
3136
|
-
|
|
3137
|
-
TableModel.prototype._notifyCellClicked = function (columnModel, row) {
|
|
3078
|
+
AbstractTableModel.prototype._notifyCellClicked = function (columnModel, row) {
|
|
3138
3079
|
if (this.isRowSelectionEnabledFor(columnModel)) {
|
|
3139
3080
|
this.selectRow(row);
|
|
3140
3081
|
}
|
|
3141
3082
|
this.rowClickListeners.fire(function (l) { return l(row); });
|
|
3142
3083
|
};
|
|
3143
|
-
return
|
|
3144
|
-
}());
|
|
3145
|
-
exports.
|
|
3084
|
+
return AbstractTableModel;
|
|
3085
|
+
}(pectin.GarbageCollector));
|
|
3086
|
+
exports.AbstractTableModel = __decorate([
|
|
3146
3087
|
pectin.TrackExternal.Strategy(new pectin.TrackExternal.OneTimeBinding()),
|
|
3147
3088
|
__metadata("design:paramtypes", [pectin.ListModel])
|
|
3148
|
-
], exports.
|
|
3089
|
+
], exports.AbstractTableModel);
|
|
3149
3090
|
|
|
3150
3091
|
/**
|
|
3151
3092
|
* Create your model:
|
|
@@ -3203,7 +3144,7 @@
|
|
|
3203
3144
|
{ type: i0.Component, args: [{
|
|
3204
3145
|
selector: 'aup-table',
|
|
3205
3146
|
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
|
|
3206
|
-
styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}"]
|
|
3147
|
+
styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}"]
|
|
3207
3148
|
},] }
|
|
3208
3149
|
];
|
|
3209
3150
|
TableComponent.ctorParameters = function () { return []; };
|
|
@@ -3212,7 +3153,7 @@
|
|
|
3212
3153
|
};
|
|
3213
3154
|
__decorate([
|
|
3214
3155
|
pectin.TrackExternal(),
|
|
3215
|
-
__metadata("design:type", exports.
|
|
3156
|
+
__metadata("design:type", exports.AbstractTableModel)
|
|
3216
3157
|
], TableComponent.prototype, "tableModel", void 0);
|
|
3217
3158
|
|
|
3218
3159
|
var ColumnTemplateDirective = /** @class */ (function () {
|
|
@@ -3264,148 +3205,792 @@
|
|
|
3264
3205
|
this.firstEditableColumn = chain(this.tableModel.firstEditableColumn).equals(this.column); // this would break if the column changed.
|
|
3265
3206
|
this.column.attachCell(this);
|
|
3266
3207
|
};
|
|
3267
|
-
TableCellRendererComponent.prototype.hasActiveEditor = function () {
|
|
3268
|
-
return !!this.editSession && !!this.column.hasEditorPortal();
|
|
3208
|
+
TableCellRendererComponent.prototype.hasActiveEditor = function () {
|
|
3209
|
+
return !!this.editSession && !!this.column.hasEditorPortal();
|
|
3210
|
+
};
|
|
3211
|
+
TableCellRendererComponent.prototype.initialiseRenderer = function (instance) {
|
|
3212
|
+
this.column.onRendererAttached(this, instance);
|
|
3213
|
+
};
|
|
3214
|
+
TableCellRendererComponent.prototype.initialiseEditor = function (instance) {
|
|
3215
|
+
var _this = this;
|
|
3216
|
+
this.column.onEditorAttached(this, instance);
|
|
3217
|
+
if (this.firstEditableColumn.value) {
|
|
3218
|
+
// @see https://github.com/angular/components/issues/12070
|
|
3219
|
+
setTimeout(function () { return _this.tryAndFocusEditor(instance); });
|
|
3220
|
+
}
|
|
3221
|
+
};
|
|
3222
|
+
TableCellRendererComponent.prototype.tryAndFocusEditor = function (editor) {
|
|
3223
|
+
var _a;
|
|
3224
|
+
if (editor.requestFocus) {
|
|
3225
|
+
editor.requestFocus();
|
|
3226
|
+
}
|
|
3227
|
+
else {
|
|
3228
|
+
var model = (editor['valueModel'] || editor['listModel']);
|
|
3229
|
+
(_a = model === null || model === void 0 ? void 0 : model.focusContext) === null || _a === void 0 ? void 0 : _a.requestFocus();
|
|
3230
|
+
}
|
|
3231
|
+
};
|
|
3232
|
+
// @Trace()
|
|
3233
|
+
TableCellRendererComponent.prototype.ngOnChanges = function (changes) {
|
|
3234
|
+
this.column.updatePortalContent(this);
|
|
3235
|
+
};
|
|
3236
|
+
TableCellRendererComponent.prototype.getRendererPortal = function () {
|
|
3237
|
+
return this[CELL_RENDERER_PORTAL];
|
|
3238
|
+
};
|
|
3239
|
+
TableCellRendererComponent.prototype.getEditorPortal = function () {
|
|
3240
|
+
return this[CELL_EDITOR_PORTAL];
|
|
3241
|
+
};
|
|
3242
|
+
TableCellRendererComponent.prototype.getRowData = function () {
|
|
3243
|
+
return {
|
|
3244
|
+
row: this.row,
|
|
3245
|
+
editSession: this.editSession,
|
|
3246
|
+
editRowCommand: this.editRowCommand
|
|
3247
|
+
};
|
|
3248
|
+
};
|
|
3249
|
+
return TableCellRendererComponent;
|
|
3250
|
+
}(DisposableComponent));
|
|
3251
|
+
TableCellRendererComponent.decorators = [
|
|
3252
|
+
{ type: i0.Component, args: [{
|
|
3253
|
+
selector: 'aup-table-cell-renderer',
|
|
3254
|
+
template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event.instance)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event.instance)\"></ng-container>\n",
|
|
3255
|
+
styles: [""]
|
|
3256
|
+
},] }
|
|
3257
|
+
];
|
|
3258
|
+
TableCellRendererComponent.ctorParameters = function () { return []; };
|
|
3259
|
+
TableCellRendererComponent.propDecorators = {
|
|
3260
|
+
row: [{ type: i0.Input }],
|
|
3261
|
+
column: [{ type: i0.Input }],
|
|
3262
|
+
editSession: [{ type: i0.Input }],
|
|
3263
|
+
tableModel: [{ type: i0.Input }],
|
|
3264
|
+
defaultClassNames: [{ type: i0.HostBinding, args: ['class',] }],
|
|
3265
|
+
fillCell: [{ type: i0.HostBinding, args: ['class.fillCell',] }],
|
|
3266
|
+
padChild: [{ type: i0.HostBinding, args: ['class.padChild',] }]
|
|
3267
|
+
};
|
|
3268
|
+
|
|
3269
|
+
var TableHeaderCellRendererComponent = /** @class */ (function () {
|
|
3270
|
+
function TableHeaderCellRendererComponent() {
|
|
3271
|
+
this.defaultClassNames = 'aup-header-cell-renderer';
|
|
3272
|
+
}
|
|
3273
|
+
TableHeaderCellRendererComponent.prototype.ngOnInit = function () {
|
|
3274
|
+
this.column.attachHeaderCell(this);
|
|
3275
|
+
};
|
|
3276
|
+
// @Trace()
|
|
3277
|
+
TableHeaderCellRendererComponent.prototype.initialiseHeader = function (instance) {
|
|
3278
|
+
this.column.onHeaderAttached(this, instance);
|
|
3279
|
+
};
|
|
3280
|
+
TableHeaderCellRendererComponent.prototype.getPortal = function () {
|
|
3281
|
+
return this[HEADER_CELL_RENDERER_PORTAL];
|
|
3282
|
+
};
|
|
3283
|
+
return TableHeaderCellRendererComponent;
|
|
3284
|
+
}());
|
|
3285
|
+
TableHeaderCellRendererComponent.decorators = [
|
|
3286
|
+
{ type: i0.Component, args: [{
|
|
3287
|
+
selector: 'aup-table-header-cell-renderer',
|
|
3288
|
+
template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event.instance)\"></ng-container>\n",
|
|
3289
|
+
styles: [":host{align-items:stretch;display:flex;flex-direction:column;height:100%;justify-content:center}"]
|
|
3290
|
+
},] }
|
|
3291
|
+
];
|
|
3292
|
+
TableHeaderCellRendererComponent.ctorParameters = function () { return []; };
|
|
3293
|
+
TableHeaderCellRendererComponent.propDecorators = {
|
|
3294
|
+
column: [{ type: i0.Input }],
|
|
3295
|
+
defaultClassNames: [{ type: i0.HostBinding, args: ['class',] }]
|
|
3296
|
+
};
|
|
3297
|
+
|
|
3298
|
+
var MenuItemData = /** @class */ (function () {
|
|
3299
|
+
function MenuItemData(factory, face) {
|
|
3300
|
+
this.factory = factory;
|
|
3301
|
+
this.face = face;
|
|
3302
|
+
}
|
|
3303
|
+
return MenuItemData;
|
|
3304
|
+
}());
|
|
3305
|
+
/**
|
|
3306
|
+
*
|
|
3307
|
+
*/
|
|
3308
|
+
var TableRowMenuComponent = /** @class */ (function (_super) {
|
|
3309
|
+
__extends(TableRowMenuComponent, _super);
|
|
3310
|
+
function TableRowMenuComponent() {
|
|
3311
|
+
var _this = _super.call(this) || this;
|
|
3312
|
+
_this.actions = [];
|
|
3313
|
+
_this.moreActions = [];
|
|
3314
|
+
return _this;
|
|
3315
|
+
}
|
|
3316
|
+
TableRowMenuComponent.prototype.registerAction = function (commandFactory, properties) {
|
|
3317
|
+
this.actions.push(new MenuItemData(commandFactory, properties));
|
|
3318
|
+
};
|
|
3319
|
+
TableRowMenuComponent.prototype.registerMoreAction = function (commandFactory, properties) {
|
|
3320
|
+
this.moreActions.push(new MenuItemData(commandFactory, properties));
|
|
3321
|
+
};
|
|
3322
|
+
TableRowMenuComponent.prototype.ngOnInit = function () {
|
|
3323
|
+
};
|
|
3324
|
+
TableRowMenuComponent.prototype.createMoreMenuCommand = function (item, value) {
|
|
3325
|
+
var _this = this;
|
|
3326
|
+
var when = pectin.Dsl.disposeWith(this).when;
|
|
3327
|
+
var command = item.factory.create(value);
|
|
3328
|
+
when(command.busy).becomesFalsey(function () {
|
|
3329
|
+
_this.closeMoreMenu();
|
|
3330
|
+
});
|
|
3331
|
+
return command;
|
|
3332
|
+
};
|
|
3333
|
+
TableRowMenuComponent.prototype.closeMoreMenu = function () {
|
|
3334
|
+
this.menu.closeMenu();
|
|
3335
|
+
};
|
|
3336
|
+
return TableRowMenuComponent;
|
|
3337
|
+
}(DisposableComponent));
|
|
3338
|
+
TableRowMenuComponent.decorators = [
|
|
3339
|
+
{ type: i0.Component, args: [{
|
|
3340
|
+
selector: 'aup-table-row-menu',
|
|
3341
|
+
template: "\n <aup-tool-bar>\n <aup-command *ngFor=\"let action of actions\" [command]=\"action.factory.create(value)\"\n [face]=\"action.face\"></aup-command>\n </aup-tool-bar>\n <ng-container *ngIf=\"moreActions.length > 0\">\n <aup-more-menu>\n <aup-command *ngFor=\"let action of moreActions\" [command]=\"action.factory.create(value)\"\n [face]=\"action.face\"></aup-command>\n </aup-more-menu>\n </ng-container>\n ",
|
|
3342
|
+
styles: [":host {\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n }"]
|
|
3343
|
+
},] }
|
|
3344
|
+
];
|
|
3345
|
+
TableRowMenuComponent.ctorParameters = function () { return []; };
|
|
3346
|
+
TableRowMenuComponent.propDecorators = {
|
|
3347
|
+
value: [{ type: i0.Input }],
|
|
3348
|
+
menu: [{ type: i0.ViewChild, args: [menu.MatMenuTrigger,] }]
|
|
3349
|
+
};
|
|
3350
|
+
|
|
3351
|
+
var SVG_HEIGHT = 60;
|
|
3352
|
+
exports.TreeInheritanceIconComponent = /** @class */ (function () {
|
|
3353
|
+
function TreeInheritanceIconComponent() {
|
|
3354
|
+
this.pixelWidth = 24;
|
|
3355
|
+
this.pixelHeight = 48;
|
|
3356
|
+
}
|
|
3357
|
+
Object.defineProperty(TreeInheritanceIconComponent.prototype, "heightOffset", {
|
|
3358
|
+
get: function () {
|
|
3359
|
+
return SVG_HEIGHT - this.pixelHeight;
|
|
3360
|
+
},
|
|
3361
|
+
enumerable: false,
|
|
3362
|
+
configurable: true
|
|
3363
|
+
});
|
|
3364
|
+
Object.defineProperty(TreeInheritanceIconComponent.prototype, "viewBox", {
|
|
3365
|
+
get: function () {
|
|
3366
|
+
return 0 + " " + this.heightOffset + " " + this.pixelWidth + " " + (this.pixelHeight - this.heightOffset);
|
|
3367
|
+
},
|
|
3368
|
+
enumerable: false,
|
|
3369
|
+
configurable: true
|
|
3370
|
+
});
|
|
3371
|
+
TreeInheritanceIconComponent.prototype.hasHead = function () {
|
|
3372
|
+
return TreeInheritanceIconComponent.HAS_HEAD.includes(this.type);
|
|
3373
|
+
};
|
|
3374
|
+
TreeInheritanceIconComponent.prototype.hasTerminal = function () {
|
|
3375
|
+
return TreeInheritanceIconComponent.HAS_TERMINAL.includes(this.type);
|
|
3376
|
+
};
|
|
3377
|
+
TreeInheritanceIconComponent.prototype.hasLeadIn = function () {
|
|
3378
|
+
return TreeInheritanceIconComponent.HAS_LEAD_IN.includes(this.type);
|
|
3379
|
+
};
|
|
3380
|
+
TreeInheritanceIconComponent.prototype.hasTail = function () {
|
|
3381
|
+
return TreeInheritanceIconComponent.HAS_TAIL.includes(this.type);
|
|
3382
|
+
};
|
|
3383
|
+
return TreeInheritanceIconComponent;
|
|
3384
|
+
}());
|
|
3385
|
+
exports.TreeInheritanceIconComponent.decorators = [
|
|
3386
|
+
{ type: i0.Component, args: [{
|
|
3387
|
+
selector: 'aup-tree-inheritance-icon',
|
|
3388
|
+
template: "<svg xmlns=\"http://www.w3.org/2000/svg\" [attr.width]=\"pixelWidth\" [attr.height]=\"pixelHeight\" [attr.viewBox]=\"viewBox\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <rect *ngIf=\"hasHead()\" width=\"1\" height=\"32.5\" x=\"11.5\" fill=\"currentColor\"/>\n <rect *ngIf=\"hasTail()\" width=\"1\" height=\"32.5\" x=\"11.5\" y=\"31.5\" fill=\"currentColor\"/>\n\n <rect *ngIf=\"hasLeadIn()\" width=\"12\" height=\"1\" y=\"31.5\" fill=\"currentColor\"/>\n <rect *ngIf=\"hasTerminal()\" width=\"12\" height=\"1\" x=\"12\" y=\"31.5\" fill=\"currentColor\"/>\n </g>\n</svg>\n",
|
|
3389
|
+
styles: [":host{color:inherit;position:relative}svg{color:var(--line-color);display:block}"]
|
|
3390
|
+
},] }
|
|
3391
|
+
];
|
|
3392
|
+
exports.TreeInheritanceIconComponent.ctorParameters = function () { return []; };
|
|
3393
|
+
exports.TreeInheritanceIconComponent.propDecorators = {
|
|
3394
|
+
type: [{ type: i0.Input }, { type: i0.HostBinding, args: ["class",] }],
|
|
3395
|
+
pixelWidth: [{ type: i0.Input }],
|
|
3396
|
+
pixelHeight: [{ type: i0.Input }]
|
|
3397
|
+
};
|
|
3398
|
+
(function (TreeInheritanceIconComponent) {
|
|
3399
|
+
TreeInheritanceIconComponent.Type = typescriptStringEnums.Enum({
|
|
3400
|
+
ICON_BLANK: 'blank',
|
|
3401
|
+
ICON_PARENT: 'parent',
|
|
3402
|
+
ICON_INHERITED_TERMINAL: 'inherited_terminal',
|
|
3403
|
+
ICON_INHERITED_THROUGH_TERMINAL: 'inherited_through_terminal',
|
|
3404
|
+
ICON_THROUGH: 'through' // |
|
|
3405
|
+
});
|
|
3406
|
+
TreeInheritanceIconComponent.HAS_LEAD_IN = [
|
|
3407
|
+
TreeInheritanceIconComponent.Type.ICON_PARENT
|
|
3408
|
+
];
|
|
3409
|
+
TreeInheritanceIconComponent.HAS_TERMINAL = [
|
|
3410
|
+
TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL,
|
|
3411
|
+
TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL,
|
|
3412
|
+
TreeInheritanceIconComponent.Type.ICON_PARENT
|
|
3413
|
+
];
|
|
3414
|
+
TreeInheritanceIconComponent.HAS_HEAD = [
|
|
3415
|
+
TreeInheritanceIconComponent.Type.ICON_THROUGH,
|
|
3416
|
+
TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL,
|
|
3417
|
+
TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL
|
|
3418
|
+
];
|
|
3419
|
+
TreeInheritanceIconComponent.HAS_TAIL = [
|
|
3420
|
+
TreeInheritanceIconComponent.Type.ICON_PARENT,
|
|
3421
|
+
TreeInheritanceIconComponent.Type.ICON_THROUGH,
|
|
3422
|
+
TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL
|
|
3423
|
+
];
|
|
3424
|
+
})(exports.TreeInheritanceIconComponent || (exports.TreeInheritanceIconComponent = {}));
|
|
3425
|
+
|
|
3426
|
+
var TreeLabelCellRendererComponent = /** @class */ (function (_super) {
|
|
3427
|
+
__extends(TreeLabelCellRendererComponent, _super);
|
|
3428
|
+
function TreeLabelCellRendererComponent() {
|
|
3429
|
+
var _this = _super.call(this) || this;
|
|
3430
|
+
_this.iconTypes = [];
|
|
3431
|
+
_this.nodeModel = new pectin.MutableValueModel();
|
|
3432
|
+
var chain = pectin.Dsl.disposeWith(_this).chain;
|
|
3433
|
+
_this.iconList = chain(_this.nodeModel).mapToList(function (node) {
|
|
3434
|
+
var icons = node.ancestors().slice(1).map(function (ancestor) {
|
|
3435
|
+
return ancestor.isLastChild() ? exports.TreeInheritanceIconComponent.Type.ICON_BLANK : exports.TreeInheritanceIconComponent.Type.ICON_THROUGH;
|
|
3436
|
+
});
|
|
3437
|
+
if (!node.isRoot()) {
|
|
3438
|
+
icons.push(node.isLastChild() ? exports.TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL : exports.TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL);
|
|
3439
|
+
}
|
|
3440
|
+
return icons;
|
|
3441
|
+
});
|
|
3442
|
+
return _this;
|
|
3443
|
+
}
|
|
3444
|
+
TreeLabelCellRendererComponent.prototype.ngOnInit = function () {
|
|
3445
|
+
var _this = this;
|
|
3446
|
+
var chain = pectin.Dsl.disposeWith(this).chain;
|
|
3447
|
+
this.canExpand = chain(this.nodeModel).map(function (node) {
|
|
3448
|
+
return node.hasChildren() && _this.expansionModel.isCollapsed(node);
|
|
3449
|
+
}, { dependsOn: this.expansionModel.isExpandedPredicate });
|
|
3450
|
+
this.canCollapse = chain(this.nodeModel).map(function (node) {
|
|
3451
|
+
return node.hasChildren() && !_this.expansionModel.isCollapsed(node);
|
|
3452
|
+
}, { dependsOn: this.expansionModel.isExpandedPredicate });
|
|
3453
|
+
this.iconModel = chain(this.nodeModel).map(function (node) {
|
|
3454
|
+
return _this.node.isLeaf() ? undefined : _this.iconFactory(node, _this.expansionModel.isExpanded(_this.node));
|
|
3455
|
+
}, { dependsOn: this.expansionModel.isExpandedPredicate });
|
|
3456
|
+
};
|
|
3457
|
+
Object.defineProperty(TreeLabelCellRendererComponent.prototype, "isRoot", {
|
|
3458
|
+
get: function () {
|
|
3459
|
+
return this.node.isRoot();
|
|
3460
|
+
},
|
|
3461
|
+
enumerable: false,
|
|
3462
|
+
configurable: true
|
|
3463
|
+
});
|
|
3464
|
+
Object.defineProperty(TreeLabelCellRendererComponent.prototype, "isLeaf", {
|
|
3465
|
+
get: function () {
|
|
3466
|
+
return this.node.isLeaf();
|
|
3467
|
+
},
|
|
3468
|
+
enumerable: false,
|
|
3469
|
+
configurable: true
|
|
3470
|
+
});
|
|
3471
|
+
Object.defineProperty(TreeLabelCellRendererComponent.prototype, "node", {
|
|
3472
|
+
get: function () {
|
|
3473
|
+
return this.nodeModel.value;
|
|
3474
|
+
},
|
|
3475
|
+
enumerable: false,
|
|
3476
|
+
configurable: true
|
|
3477
|
+
});
|
|
3478
|
+
// @Trace()
|
|
3479
|
+
TreeLabelCellRendererComponent.prototype.expandOrCollapse = function (node) {
|
|
3480
|
+
this.expansionModel.isCollapsed(node) ? this.expansionModel.expand(node) : this.expansionModel.collapse(node);
|
|
3481
|
+
};
|
|
3482
|
+
return TreeLabelCellRendererComponent;
|
|
3483
|
+
}(DisposableComponent));
|
|
3484
|
+
TreeLabelCellRendererComponent.decorators = [
|
|
3485
|
+
{ type: i0.Component, args: [{
|
|
3486
|
+
selector: 'aup-tree-label-cell-renderer',
|
|
3487
|
+
template: "<div class=\"tree-icons\">\n <aup-tree-inheritance-icon *ngFor=\"let iconClass of iconList.value\" [type]=\"iconClass\"></aup-tree-inheritance-icon>\n <aup-icon *ngIf=\"iconModel.value\"\n [icon]=\"iconModel.value\"\n [class.clickable]=\"canExpand.value || canCollapse.value\"\n (click)=\"expandOrCollapse(node)\" ></aup-icon>\n</div>\n<div class=\"label\">{{label}}</div>\n",
|
|
3488
|
+
styles: [":host{--line-color:#ddd;--node-color:#999;align-items:stretch;display:inline-flex;flex-direction:row}:host div.label{align-items:center;display:flex;flex-direction:row;padding-left:6px;white-space:nowrap}:host div.tree-icons{-ms-grid-rows:1fr;align-items:stretch;display:-ms-grid;display:grid;grid-auto-columns:auto;grid-auto-flow:column;grid-template-rows:1fr;justify-content:stretch}:host div.tree-icons aup-icon{-ms-grid-row-align:center;align-self:center;color:var(--node-color)}:host div.tree-icons aup-icon.clickable{cursor:pointer}:host div.tree-icons aup-icon,:host div.tree-icons aup-tree-inheritance-icon{margin-left:4px}"]
|
|
3489
|
+
},] }
|
|
3490
|
+
];
|
|
3491
|
+
TreeLabelCellRendererComponent.ctorParameters = function () { return []; };
|
|
3492
|
+
TreeLabelCellRendererComponent.propDecorators = {
|
|
3493
|
+
value: [{ type: i0.Input }],
|
|
3494
|
+
label: [{ type: i0.Input }],
|
|
3495
|
+
iconFactory: [{ type: i0.Input }],
|
|
3496
|
+
expansionModel: [{ type: i0.Input }],
|
|
3497
|
+
isRoot: [{ type: i0.HostBinding, args: ['class.root',] }],
|
|
3498
|
+
isLeaf: [{ type: i0.HostBinding, args: ['class.leaf',] }]
|
|
3499
|
+
};
|
|
3500
|
+
__decorate([
|
|
3501
|
+
pectin.StoreInValueModel('nodeModel'),
|
|
3502
|
+
__metadata("design:type", Object)
|
|
3503
|
+
], TreeLabelCellRendererComponent.prototype, "value", void 0);
|
|
3504
|
+
|
|
3505
|
+
var TreeExpansionModel = /** @class */ (function () {
|
|
3506
|
+
function TreeExpansionModel(identityOf) {
|
|
3507
|
+
this.identityOf = identityOf;
|
|
3508
|
+
this.collapsedIds = new Set();
|
|
3509
|
+
this._isExpandedPredicate = new pectin.MutableValueModel(function () { return true; });
|
|
3510
|
+
this.updatePredicate();
|
|
3511
|
+
}
|
|
3512
|
+
Object.defineProperty(TreeExpansionModel.prototype, "isExpandedPredicate", {
|
|
3513
|
+
get: function () {
|
|
3514
|
+
return this._isExpandedPredicate.readonly;
|
|
3515
|
+
},
|
|
3516
|
+
enumerable: false,
|
|
3517
|
+
configurable: true
|
|
3518
|
+
});
|
|
3519
|
+
// @Trace()
|
|
3520
|
+
TreeExpansionModel.prototype.expand = function (node) {
|
|
3521
|
+
if (this.isCollapsed(node)) {
|
|
3522
|
+
this.collapsedIds.delete(this.identityOf(node.node));
|
|
3523
|
+
this.updatePredicate();
|
|
3524
|
+
}
|
|
3525
|
+
};
|
|
3526
|
+
// @Trace()
|
|
3527
|
+
TreeExpansionModel.prototype.collapse = function (node) {
|
|
3528
|
+
if (!this.isCollapsed(node)) {
|
|
3529
|
+
this.collapsedIds.add(this.identityOf(node.node));
|
|
3530
|
+
this.updatePredicate();
|
|
3531
|
+
}
|
|
3532
|
+
};
|
|
3533
|
+
TreeExpansionModel.prototype.canExpand = function (node) {
|
|
3534
|
+
return node.hasChildren() && this.isCollapsed(node);
|
|
3535
|
+
};
|
|
3536
|
+
TreeExpansionModel.prototype.canCollapse = function (node) {
|
|
3537
|
+
return node.hasChildren() && !this.isCollapsed(node);
|
|
3538
|
+
};
|
|
3539
|
+
TreeExpansionModel.prototype.isCollapsed = function (node) {
|
|
3540
|
+
return this.collapsedIds.has(this.identityOf(node.node));
|
|
3541
|
+
};
|
|
3542
|
+
TreeExpansionModel.prototype.isExpanded = function (node) {
|
|
3543
|
+
return !this.isCollapsed(node);
|
|
3544
|
+
};
|
|
3545
|
+
TreeExpansionModel.prototype.ensureAncestorsAndSelfVisible = function (node) {
|
|
3546
|
+
var _this = this;
|
|
3547
|
+
node.ancestors()
|
|
3548
|
+
.map(function (a) { return _this.identityOf(node.node); })
|
|
3549
|
+
.forEach(function (id) { return _this.collapsedIds.delete(id); });
|
|
3550
|
+
this.updatePredicate();
|
|
3551
|
+
};
|
|
3552
|
+
TreeExpansionModel.prototype.updatePredicate = function () {
|
|
3553
|
+
var _this = this;
|
|
3554
|
+
this._isExpandedPredicate.value = function (node) { return !_this.collapsedIds.has(_this.identityOf(node.node)); };
|
|
3555
|
+
};
|
|
3556
|
+
return TreeExpansionModel;
|
|
3557
|
+
}());
|
|
3558
|
+
|
|
3559
|
+
var TreeLabelColumnModel = /** @class */ (function (_super) {
|
|
3560
|
+
__extends(TreeLabelColumnModel, _super);
|
|
3561
|
+
function TreeLabelColumnModel(columnId, textPropertiesProvider, expansionModel) {
|
|
3562
|
+
var _this = _super.call(this, columnId, textPropertiesProvider) || this;
|
|
3563
|
+
_this.expansionModel = expansionModel;
|
|
3564
|
+
_this.iconFactory = function (node, expanded) { return expanded ? 'mat:folder_open' : 'mat:folder'; };
|
|
3565
|
+
_this.cellRenderer(TreeLabelCellRendererComponent);
|
|
3566
|
+
return _this;
|
|
3567
|
+
}
|
|
3568
|
+
TreeLabelColumnModel.prototype.pluck = function (property) {
|
|
3569
|
+
this.labelProperty = property;
|
|
3570
|
+
};
|
|
3571
|
+
TreeLabelColumnModel.prototype.addIcon = function (factory) {
|
|
3572
|
+
this.iconFactory = factory;
|
|
3573
|
+
};
|
|
3574
|
+
TreeLabelColumnModel.prototype.cellRenderer = function (componentType) {
|
|
3575
|
+
var _this = this;
|
|
3576
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData, firstTime) {
|
|
3577
|
+
if (firstTime) {
|
|
3578
|
+
component.expansionModel = _this.expansionModel;
|
|
3579
|
+
}
|
|
3580
|
+
component.value = rowData.row;
|
|
3581
|
+
component.label = ___default['default'].isNil(_this.labelProperty) ? undefined : rowData.row[_this.labelProperty];
|
|
3582
|
+
component.iconFactory = _this.iconFactory;
|
|
3583
|
+
}));
|
|
3584
|
+
return this;
|
|
3585
|
+
};
|
|
3586
|
+
TreeLabelColumnModel.prototype.selectRowOnClick = function (selectOnRowClick) {
|
|
3587
|
+
return _super.prototype.selectRowOnClick.call(this, selectOnRowClick);
|
|
3588
|
+
};
|
|
3589
|
+
return TreeLabelColumnModel;
|
|
3590
|
+
}(ColumnModel));
|
|
3591
|
+
|
|
3592
|
+
exports.SelfAndDescendantsVisitor = /** @class */ (function () {
|
|
3593
|
+
function SelfAndDescendantsVisitor() {
|
|
3594
|
+
}
|
|
3595
|
+
SelfAndDescendantsVisitor.prototype.visit = function (it) {
|
|
3596
|
+
this.onVisit(it);
|
|
3597
|
+
if (this.shouldVisitChildrenOf(it)) {
|
|
3598
|
+
it.visitChildren(this);
|
|
3599
|
+
}
|
|
3600
|
+
};
|
|
3601
|
+
SelfAndDescendantsVisitor.prototype.shouldVisitChildrenOf = function (it) {
|
|
3602
|
+
return true;
|
|
3603
|
+
};
|
|
3604
|
+
return SelfAndDescendantsVisitor;
|
|
3605
|
+
}());
|
|
3606
|
+
(function (SelfAndDescendantsVisitor) {
|
|
3607
|
+
var Each = /** @class */ (function (_super) {
|
|
3608
|
+
__extends(Each, _super);
|
|
3609
|
+
function Each(callback) {
|
|
3610
|
+
var _this = _super.call(this) || this;
|
|
3611
|
+
_this.callback = callback;
|
|
3612
|
+
return _this;
|
|
3613
|
+
}
|
|
3614
|
+
Each.prototype.onVisit = function (it) {
|
|
3615
|
+
this.callback(it);
|
|
3616
|
+
};
|
|
3617
|
+
return Each;
|
|
3618
|
+
}(SelfAndDescendantsVisitor));
|
|
3619
|
+
SelfAndDescendantsVisitor.Each = Each;
|
|
3620
|
+
})(exports.SelfAndDescendantsVisitor || (exports.SelfAndDescendantsVisitor = {}));
|
|
3621
|
+
|
|
3622
|
+
var DecoratedTreeNodeMixin = /** @class */ (function () {
|
|
3623
|
+
function DecoratedTreeNodeMixin(parent, node) {
|
|
3624
|
+
this.parent = parent;
|
|
3625
|
+
this.node = node;
|
|
3626
|
+
}
|
|
3627
|
+
Object.defineProperty(DecoratedTreeNodeMixin.prototype, "decoratedSelf", {
|
|
3628
|
+
get: function () {
|
|
3629
|
+
var _this = this;
|
|
3630
|
+
return this.memoize("decoratedSelf", function () {
|
|
3631
|
+
return _this.parent ? _this.parent.children.find(function (child) { return child.node === _this.node; }) : exports.DecoratedTreeNode.createRoot(_this.node);
|
|
3632
|
+
});
|
|
3633
|
+
},
|
|
3634
|
+
enumerable: false,
|
|
3635
|
+
configurable: true
|
|
3636
|
+
});
|
|
3637
|
+
Object.defineProperty(DecoratedTreeNodeMixin.prototype, "children", {
|
|
3638
|
+
get: function () {
|
|
3639
|
+
var _this = this;
|
|
3640
|
+
return this.memoize("children", function () {
|
|
3641
|
+
return _this.node.children ? _this.node.children.map(function (child) {
|
|
3642
|
+
return typescriptUtilities.Mixin.createProxy(child, new DecoratedTreeNodeMixin(_this.decoratedSelf, child));
|
|
3643
|
+
}) : [];
|
|
3644
|
+
});
|
|
3645
|
+
},
|
|
3646
|
+
enumerable: false,
|
|
3647
|
+
configurable: true
|
|
3648
|
+
});
|
|
3649
|
+
DecoratedTreeNodeMixin.prototype.descendants = function () {
|
|
3650
|
+
var _this = this;
|
|
3651
|
+
return this.memoize("descendants", function () {
|
|
3652
|
+
var result = [];
|
|
3653
|
+
_this.visitDescendants(function (child) { return result.push(child); });
|
|
3654
|
+
return result;
|
|
3655
|
+
});
|
|
3656
|
+
};
|
|
3657
|
+
DecoratedTreeNodeMixin.prototype.selfAndDescendants = function () {
|
|
3658
|
+
var _this = this;
|
|
3659
|
+
return this.memoize("selfAndDescendants", function () {
|
|
3660
|
+
var result = [];
|
|
3661
|
+
_this.visitSelfAndDescendants(function (child) { return result.push(child); });
|
|
3662
|
+
return result;
|
|
3663
|
+
});
|
|
3664
|
+
};
|
|
3665
|
+
DecoratedTreeNodeMixin.prototype.siblingsBefore = function () {
|
|
3666
|
+
var _this = this;
|
|
3667
|
+
return this.memoize('siblingsBefore', function () {
|
|
3668
|
+
if (_this.parent) {
|
|
3669
|
+
return _this.parent.children.slice(0, _this.myIndex());
|
|
3670
|
+
}
|
|
3671
|
+
else {
|
|
3672
|
+
return [];
|
|
3673
|
+
}
|
|
3674
|
+
});
|
|
3675
|
+
};
|
|
3676
|
+
DecoratedTreeNodeMixin.prototype.siblingsAfter = function () {
|
|
3677
|
+
var _this = this;
|
|
3678
|
+
return this.memoize('siblingsAfter', function () {
|
|
3679
|
+
if (_this.parent) {
|
|
3680
|
+
return _this.parent.children.slice(1 + _this.myIndex());
|
|
3681
|
+
}
|
|
3682
|
+
else {
|
|
3683
|
+
return [];
|
|
3684
|
+
}
|
|
3685
|
+
});
|
|
3686
|
+
};
|
|
3687
|
+
DecoratedTreeNodeMixin.prototype.siblings = function () {
|
|
3688
|
+
var _this = this;
|
|
3689
|
+
return this.memoize('siblings', function () { return [].concat(_this.siblingsBefore(), _this.siblingsAfter()); });
|
|
3690
|
+
};
|
|
3691
|
+
DecoratedTreeNodeMixin.prototype.isFirstChild = function () {
|
|
3692
|
+
var _this = this;
|
|
3693
|
+
return this.memoize('isFirstChild', function () { return _this.parent ? _this.myIndex() === 0 : false; });
|
|
3694
|
+
};
|
|
3695
|
+
DecoratedTreeNodeMixin.prototype.myIndex = function () {
|
|
3696
|
+
var _this = this;
|
|
3697
|
+
return this.memoize('myIndex', function () {
|
|
3698
|
+
var myIndex = _this.parent.children.findIndex(function (child) { return child.node === _this.node; });
|
|
3699
|
+
pectin.assert.isTruthy(myIndex >= 0, 'illegal state, expected index to be >= 0');
|
|
3700
|
+
return myIndex;
|
|
3701
|
+
});
|
|
3702
|
+
};
|
|
3703
|
+
DecoratedTreeNodeMixin.prototype.isLastChild = function () {
|
|
3704
|
+
var _this = this;
|
|
3705
|
+
return this.memoize('isLastChild', function () {
|
|
3706
|
+
return _this.parent ? _this.myIndex() === _this.parent.children.length - 1 : false;
|
|
3707
|
+
});
|
|
3708
|
+
};
|
|
3709
|
+
DecoratedTreeNodeMixin.prototype.hasSiblings = function () {
|
|
3710
|
+
return this.parent ? this.node.children.length > 1 : false;
|
|
3711
|
+
};
|
|
3712
|
+
DecoratedTreeNodeMixin.prototype.find = function (predicate) {
|
|
3713
|
+
return _.find(this.descendants(), predicate);
|
|
3714
|
+
};
|
|
3715
|
+
DecoratedTreeNodeMixin.prototype.select = function (predicate) {
|
|
3716
|
+
return _.filter(this.descendants(), predicate);
|
|
3717
|
+
};
|
|
3718
|
+
DecoratedTreeNodeMixin.prototype.flattenInto = function (array) {
|
|
3719
|
+
this.visitSelfAndDescendants(function (child) { return array.push(child); });
|
|
3720
|
+
return array;
|
|
3721
|
+
};
|
|
3722
|
+
DecoratedTreeNodeMixin.prototype.ancestors = function () {
|
|
3723
|
+
var _this = this;
|
|
3724
|
+
return this.memoize('ancestors', function () {
|
|
3725
|
+
return _this.parent ? _this.parent.ancestors().concat([_this.parent]) : [];
|
|
3726
|
+
});
|
|
3727
|
+
};
|
|
3728
|
+
DecoratedTreeNodeMixin.prototype.ancestorsAndSelf = function () {
|
|
3729
|
+
var _this = this;
|
|
3730
|
+
return this.memoize("ancestorsAndSelf", function () {
|
|
3731
|
+
return _this.ancestors().concat([(_this.decoratedSelf)]);
|
|
3732
|
+
});
|
|
3733
|
+
};
|
|
3734
|
+
DecoratedTreeNodeMixin.prototype.pathToParent = function (parent) {
|
|
3735
|
+
var _this = this;
|
|
3736
|
+
return this.memoize("pathToParent", function () {
|
|
3737
|
+
if (_this.node === parent.node) {
|
|
3738
|
+
return [];
|
|
3739
|
+
}
|
|
3740
|
+
else if (_this.parent) {
|
|
3741
|
+
return _this.parent.pathToParent(parent).concat([_this.parent]);
|
|
3742
|
+
}
|
|
3743
|
+
else {
|
|
3744
|
+
throw new Error('parent is not an ancestor');
|
|
3745
|
+
}
|
|
3746
|
+
});
|
|
3747
|
+
};
|
|
3748
|
+
DecoratedTreeNodeMixin.prototype.pathToParentAndSelf = function (parent) {
|
|
3749
|
+
var _this = this;
|
|
3750
|
+
return this.memoize("pathToParentAndSelf", function () {
|
|
3751
|
+
return _this.pathToParent(parent).concat([_this.decoratedSelf]);
|
|
3752
|
+
});
|
|
3753
|
+
};
|
|
3754
|
+
DecoratedTreeNodeMixin.prototype.isRoot = function () {
|
|
3755
|
+
return !this.parent;
|
|
3756
|
+
};
|
|
3757
|
+
Object.defineProperty(DecoratedTreeNodeMixin.prototype, "depth", {
|
|
3758
|
+
get: function () {
|
|
3759
|
+
return this.isRoot() ? 0 : this.parent.depth + 1;
|
|
3760
|
+
},
|
|
3761
|
+
enumerable: false,
|
|
3762
|
+
configurable: true
|
|
3763
|
+
});
|
|
3764
|
+
DecoratedTreeNodeMixin.prototype.isLeaf = function () {
|
|
3765
|
+
return !this.isRoot() && this.node.children.length < 1;
|
|
3766
|
+
};
|
|
3767
|
+
DecoratedTreeNodeMixin.prototype.hasChildren = function () {
|
|
3768
|
+
return this.node.children.length > 0;
|
|
3269
3769
|
};
|
|
3270
|
-
|
|
3271
|
-
this.
|
|
3770
|
+
DecoratedTreeNodeMixin.prototype.depthFromParent = function (parent) {
|
|
3771
|
+
return this.pathToParent(parent).length;
|
|
3272
3772
|
};
|
|
3273
|
-
|
|
3773
|
+
DecoratedTreeNodeMixin.prototype.treeDepth = function () {
|
|
3274
3774
|
var _this = this;
|
|
3275
|
-
this.
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
setTimeout(function () { return _this.tryAndFocusEditor(instance); });
|
|
3279
|
-
}
|
|
3775
|
+
return this.memoize("treeDepth", function () {
|
|
3776
|
+
return 1 + _this.descendants().map(function (child) { return child.depthFromParent(_this); }).reduce(function (prev, current) { return Math.max(prev, current); });
|
|
3777
|
+
});
|
|
3280
3778
|
};
|
|
3281
|
-
|
|
3282
|
-
var
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
}
|
|
3286
|
-
else {
|
|
3287
|
-
var model = (editor['valueModel'] || editor['listModel']);
|
|
3288
|
-
(_a = model === null || model === void 0 ? void 0 : model.focusContext) === null || _a === void 0 ? void 0 : _a.requestFocus();
|
|
3289
|
-
}
|
|
3779
|
+
DecoratedTreeNodeMixin.prototype.flatten = function () {
|
|
3780
|
+
var _this = this;
|
|
3781
|
+
return this.memoize("flatten", function () {
|
|
3782
|
+
return _this.flattenInto([]);
|
|
3783
|
+
});
|
|
3290
3784
|
};
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3785
|
+
DecoratedTreeNodeMixin.prototype.visit = function (visitor) {
|
|
3786
|
+
visitor.visit(this);
|
|
3787
|
+
return visitor;
|
|
3294
3788
|
};
|
|
3295
|
-
|
|
3296
|
-
return
|
|
3789
|
+
DecoratedTreeNodeMixin.prototype.visitChildren = function (visitor) {
|
|
3790
|
+
_.each(this.children, function (child) { return child.visit(visitor); });
|
|
3791
|
+
return visitor;
|
|
3297
3792
|
};
|
|
3298
|
-
|
|
3299
|
-
|
|
3793
|
+
DecoratedTreeNodeMixin.prototype.visitSelfAndDescendants = function (callback) {
|
|
3794
|
+
this.visit(new exports.SelfAndDescendantsVisitor.Each(callback));
|
|
3300
3795
|
};
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
row: this.row,
|
|
3304
|
-
editSession: this.editSession,
|
|
3305
|
-
editRowCommand: this.editRowCommand
|
|
3306
|
-
};
|
|
3796
|
+
DecoratedTreeNodeMixin.prototype.visitDescendants = function (callback) {
|
|
3797
|
+
this.visitChildren(new exports.SelfAndDescendantsVisitor.Each(callback));
|
|
3307
3798
|
};
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3799
|
+
DecoratedTreeNodeMixin.prototype.memoize = function (property, factory) {
|
|
3800
|
+
var key = "__" + property;
|
|
3801
|
+
if (_.isNil(this[key])) {
|
|
3802
|
+
this[key] = factory();
|
|
3803
|
+
}
|
|
3804
|
+
return this[key];
|
|
3805
|
+
};
|
|
3806
|
+
return DecoratedTreeNodeMixin;
|
|
3807
|
+
}());
|
|
3808
|
+
(function (DecoratedTreeNode) {
|
|
3809
|
+
function createRoot(node) {
|
|
3810
|
+
return typescriptUtilities.Mixin.createProxy(node, new DecoratedTreeNodeMixin(undefined, node));
|
|
3811
|
+
}
|
|
3812
|
+
DecoratedTreeNode.createRoot = createRoot;
|
|
3813
|
+
})(exports.DecoratedTreeNode || (exports.DecoratedTreeNode = {}));
|
|
3814
|
+
|
|
3815
|
+
var TreeToListModel = /** @class */ (function (_super) {
|
|
3816
|
+
__extends(TreeToListModel, _super);
|
|
3817
|
+
function TreeToListModel(source, expansionModel) {
|
|
3818
|
+
var _this = _super.call(this, source) || this;
|
|
3819
|
+
_this.source = source;
|
|
3820
|
+
_this.expansionModel = expansionModel;
|
|
3821
|
+
_this.trackSource(_this.expansionModel.isExpandedPredicate);
|
|
3822
|
+
return _this;
|
|
3331
3823
|
}
|
|
3332
|
-
|
|
3333
|
-
this.
|
|
3824
|
+
TreeToListModel.prototype.getIdentityOf = function (item) {
|
|
3825
|
+
return this.source.identityOf(item.node);
|
|
3334
3826
|
};
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3827
|
+
TreeToListModel.prototype.compute = function (values) {
|
|
3828
|
+
var _this = this;
|
|
3829
|
+
var result = [];
|
|
3830
|
+
values.forEach(function (value) { return _this.addNodeAndVisibleChildren(exports.DecoratedTreeNode.createRoot(value), result); });
|
|
3831
|
+
return result;
|
|
3338
3832
|
};
|
|
3339
|
-
|
|
3340
|
-
|
|
3833
|
+
TreeToListModel.prototype.addNodeAndVisibleChildren = function (node, result) {
|
|
3834
|
+
var _this = this;
|
|
3835
|
+
result.push(node);
|
|
3836
|
+
if (node.hasChildren() && !this.expansionModel.isCollapsed(node)) {
|
|
3837
|
+
node.children.forEach(function (child) { return _this.addNodeAndVisibleChildren(child, result); });
|
|
3838
|
+
}
|
|
3341
3839
|
};
|
|
3342
|
-
return
|
|
3343
|
-
}());
|
|
3344
|
-
TableHeaderCellRendererComponent.decorators = [
|
|
3345
|
-
{ type: i0.Component, args: [{
|
|
3346
|
-
selector: 'aup-table-header-cell-renderer',
|
|
3347
|
-
template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event.instance)\"></ng-container>\n",
|
|
3348
|
-
styles: [":host{align-items:stretch;display:flex;flex-direction:column;height:100%;justify-content:center}"]
|
|
3349
|
-
},] }
|
|
3350
|
-
];
|
|
3351
|
-
TableHeaderCellRendererComponent.ctorParameters = function () { return []; };
|
|
3352
|
-
TableHeaderCellRendererComponent.propDecorators = {
|
|
3353
|
-
column: [{ type: i0.Input }],
|
|
3354
|
-
defaultClassNames: [{ type: i0.HostBinding, args: ['class',] }]
|
|
3355
|
-
};
|
|
3840
|
+
return TreeToListModel;
|
|
3841
|
+
}(pectin.ComputedListModel));
|
|
3356
3842
|
|
|
3357
|
-
var
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
return MenuItemData;
|
|
3363
|
-
}());
|
|
3364
|
-
/**
|
|
3365
|
-
*
|
|
3366
|
-
*/
|
|
3367
|
-
var TableRowMenuComponent = /** @class */ (function (_super) {
|
|
3368
|
-
__extends(TableRowMenuComponent, _super);
|
|
3369
|
-
function TableRowMenuComponent() {
|
|
3370
|
-
var _this = _super.call(this) || this;
|
|
3371
|
-
_this.actions = [];
|
|
3372
|
-
_this.moreActions = [];
|
|
3843
|
+
var TreeTableModel = /** @class */ (function (_super) {
|
|
3844
|
+
__extends(TreeTableModel, _super);
|
|
3845
|
+
function TreeTableModel(source, treeExpansionModel) {
|
|
3846
|
+
var _this = _super.call(this, source) || this;
|
|
3847
|
+
_this.treeExpansionModel = treeExpansionModel;
|
|
3373
3848
|
return _this;
|
|
3374
3849
|
}
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
this.
|
|
3850
|
+
TreeTableModel.fromChildrenOf = function (sourceOfTruth, builder) {
|
|
3851
|
+
var garbage = new pectin.GarbageCollector();
|
|
3852
|
+
var _a = pectin.Dsl.disposeWith(garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
3853
|
+
var children = chain(sourceOfTruth).mapToList(function (root) { return root.children; }); // for some reason pluck list can't see 'children'
|
|
3854
|
+
var model = this.fromList(children, builder);
|
|
3855
|
+
model.registerDisposable(garbage);
|
|
3856
|
+
return model;
|
|
3380
3857
|
};
|
|
3381
|
-
|
|
3858
|
+
TreeTableModel.fromList = function (sourceOfTruth, builder) {
|
|
3859
|
+
var treeExpansionModel = new TreeExpansionModel(sourceOfTruth.identityOf);
|
|
3860
|
+
var nodes = new TreeToListModel(sourceOfTruth, treeExpansionModel);
|
|
3861
|
+
var model = new TreeTableModel(nodes, treeExpansionModel);
|
|
3862
|
+
model.registerDisposable(nodes);
|
|
3863
|
+
if (builder)
|
|
3864
|
+
builder(model);
|
|
3865
|
+
return model;
|
|
3382
3866
|
};
|
|
3383
|
-
|
|
3867
|
+
TreeTableModel.prototype.treeControlColumn = function (builder) {
|
|
3384
3868
|
var _this = this;
|
|
3385
|
-
var
|
|
3386
|
-
var
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
});
|
|
3390
|
-
return command;
|
|
3869
|
+
var columnId = 'tree-label';
|
|
3870
|
+
var column = new TreeLabelColumnModel(columnId, function () { return _this.getColumnTextProperties(columnId); }, this.treeExpansionModel);
|
|
3871
|
+
builder(column);
|
|
3872
|
+
this.addColumn(column);
|
|
3391
3873
|
};
|
|
3392
|
-
|
|
3393
|
-
this.
|
|
3874
|
+
TreeTableModel.prototype.expand = function (node) {
|
|
3875
|
+
this.treeExpansionModel.expand(node);
|
|
3394
3876
|
};
|
|
3395
|
-
|
|
3877
|
+
TreeTableModel.prototype.collapse = function (node) {
|
|
3878
|
+
this.treeExpansionModel.expand(node);
|
|
3879
|
+
};
|
|
3880
|
+
TreeTableModel.prototype.isCollapsed = function (node) {
|
|
3881
|
+
return this.treeExpansionModel.isCollapsed(node);
|
|
3882
|
+
};
|
|
3883
|
+
TreeTableModel.prototype.ensureAncestorsAndSelfVisible = function (node) {
|
|
3884
|
+
this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);
|
|
3885
|
+
};
|
|
3886
|
+
return TreeTableModel;
|
|
3887
|
+
}(exports.AbstractTableModel));
|
|
3888
|
+
var FlattenStrategy = /** @class */ (function (_super) {
|
|
3889
|
+
__extends(FlattenStrategy, _super);
|
|
3890
|
+
function FlattenStrategy(collapsedIds) {
|
|
3891
|
+
var _this = _super.call(this) || this;
|
|
3892
|
+
_this.collapsedIds = collapsedIds;
|
|
3893
|
+
_this._areas = [];
|
|
3894
|
+
_this._collapsed = new Set(collapsedIds);
|
|
3895
|
+
return _this;
|
|
3896
|
+
}
|
|
3897
|
+
FlattenStrategy.prototype.onVisit = function (it) {
|
|
3898
|
+
this._areas.push(it);
|
|
3899
|
+
};
|
|
3900
|
+
FlattenStrategy.prototype.shouldVisitChildrenOf = function (it) {
|
|
3901
|
+
return !this._collapsed.has(it);
|
|
3902
|
+
};
|
|
3903
|
+
Object.defineProperty(FlattenStrategy.prototype, "flattenedAreas", {
|
|
3904
|
+
get: function () {
|
|
3905
|
+
return this._areas;
|
|
3906
|
+
},
|
|
3907
|
+
enumerable: false,
|
|
3908
|
+
configurable: true
|
|
3909
|
+
});
|
|
3910
|
+
return FlattenStrategy;
|
|
3911
|
+
}(exports.SelfAndDescendantsVisitor));
|
|
3912
|
+
// class DecoratorCache {
|
|
3913
|
+
//
|
|
3914
|
+
// private map = new Map<number, T>();
|
|
3915
|
+
//
|
|
3916
|
+
// get(area:T): T {
|
|
3917
|
+
//
|
|
3918
|
+
// if (!area) return null;
|
|
3919
|
+
//
|
|
3920
|
+
// let decoratedArea = this.map.get(area.id);
|
|
3921
|
+
// if (!decoratedArea) {
|
|
3922
|
+
// decoratedArea = TreeModel.AreaDecorator.decorate(area);
|
|
3923
|
+
// this.map.set(area.id, decoratedArea);
|
|
3924
|
+
// }
|
|
3925
|
+
// return decoratedArea;
|
|
3926
|
+
// }
|
|
3927
|
+
//
|
|
3928
|
+
// clear() {
|
|
3929
|
+
// this.map.clear();
|
|
3930
|
+
// }
|
|
3931
|
+
//
|
|
3932
|
+
//
|
|
3933
|
+
// }
|
|
3934
|
+
|
|
3935
|
+
//
|
|
3936
|
+
// const template = `
|
|
3937
|
+
// <table-component list-model="zoneTreeController.visibleAreas"
|
|
3938
|
+
// selection-model="zoneTreeController.selectionModel"
|
|
3939
|
+
// selection-command="zoneTreeController.selectionCommand"
|
|
3940
|
+
// hover-model="zoneTreeController.decoratedHoverModel"
|
|
3941
|
+
// no-hover="zoneTreeController.noHover"
|
|
3942
|
+
// no-lines="true" no-scroll>
|
|
3943
|
+
//
|
|
3944
|
+
// <row-attr name="parent-id" value="{{item.parent.id}}"></row-attr>
|
|
3945
|
+
// <row-attr name="area-id" value="{{item.id}}"></row-attr>
|
|
3946
|
+
// <row-attr name="area-name" value="{{item.name}}"></row-attr>
|
|
3947
|
+
// <row-attr name="area-depth" value="{{item.depthFromZone()}}"></row-attr>
|
|
3948
|
+
// <row-attr name="collapsed" value="{{zoneTreeController.isCollapsed(item)}}"></row-attr>
|
|
3949
|
+
//
|
|
3950
|
+
// <column class="area" ng-class="{root: item.isZone(), parent: item.isGroup()}" class="allow-squish">
|
|
3951
|
+
// <!--<label>Rooms in {{zoneTreeController.zoneModel.value.name}}</label>-->
|
|
3952
|
+
// <label>Rooms</label>
|
|
3953
|
+
// <div layout="row" layout-align="start center">
|
|
3954
|
+
// <tree-icons tree-item="item"></tree-icons>
|
|
3955
|
+
// <area-icon area="item"></area-icon>
|
|
3956
|
+
// <span ng-if="item.isZone()">Zone ({{item.name}})</span>
|
|
3957
|
+
// <span ng-if="!item.isZone()">{{item.name}}</span>
|
|
3958
|
+
// </div>
|
|
3959
|
+
// </column>
|
|
3960
|
+
// <column class="expand-collapse" ng-class="{collapsed: zoneTreeController.isCollapsed(item)}">
|
|
3961
|
+
// <md-button class="md-icon-button"
|
|
3962
|
+
// ng-if="zoneTreeController.canCollapse(item)"
|
|
3963
|
+
// ng-click="zoneTreeController.toggleCollapse(item)">
|
|
3964
|
+
// <md-icon>keyboard_arrow_up</md-icon>
|
|
3965
|
+
// </md-button>
|
|
3966
|
+
// </column>
|
|
3967
|
+
//
|
|
3968
|
+
// </table-component>
|
|
3969
|
+
// `;
|
|
3970
|
+
var TreeTableComponent = /** @class */ (function (_super) {
|
|
3971
|
+
__extends(TreeTableComponent, _super);
|
|
3972
|
+
function TreeTableComponent() {
|
|
3973
|
+
return _super.call(this) || this;
|
|
3974
|
+
}
|
|
3975
|
+
return TreeTableComponent;
|
|
3396
3976
|
}(DisposableComponent));
|
|
3397
|
-
|
|
3977
|
+
TreeTableComponent.decorators = [
|
|
3398
3978
|
{ type: i0.Component, args: [{
|
|
3399
|
-
selector:
|
|
3400
|
-
template: "
|
|
3401
|
-
|
|
3979
|
+
selector: "aup-tree-table",
|
|
3980
|
+
template: "<aup-table [tableModel]=\"treeTableModel\"></aup-table>\n",
|
|
3981
|
+
encapsulation: i0.ViewEncapsulation.None // allow us to target nested table styles
|
|
3982
|
+
,
|
|
3983
|
+
styles: ["td.mat-cell{border-bottom-width:0!important;border-top-width:0!important}td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}"]
|
|
3402
3984
|
},] }
|
|
3403
3985
|
];
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
menu: [{ type: i0.ViewChild, args: [menu.MatMenuTrigger,] }]
|
|
3986
|
+
TreeTableComponent.ctorParameters = function () { return []; };
|
|
3987
|
+
TreeTableComponent.propDecorators = {
|
|
3988
|
+
treeTableModel: [{ type: i0.Input }]
|
|
3408
3989
|
};
|
|
3990
|
+
__decorate([
|
|
3991
|
+
pectin.TrackExternal(),
|
|
3992
|
+
__metadata("design:type", TreeTableModel)
|
|
3993
|
+
], TreeTableComponent.prototype, "treeTableModel", void 0);
|
|
3409
3994
|
|
|
3410
3995
|
var VerticalFocusContainerComponent = /** @class */ (function (_super) {
|
|
3411
3996
|
__extends(VerticalFocusContainerComponent, _super);
|
|
@@ -3521,7 +4106,11 @@
|
|
|
3521
4106
|
SeparatorComponent,
|
|
3522
4107
|
FlexComponent,
|
|
3523
4108
|
AbstractPopupMenuComponent,
|
|
3524
|
-
PopupMenuRendererComponent
|
|
4109
|
+
PopupMenuRendererComponent,
|
|
4110
|
+
TreeTableComponent,
|
|
4111
|
+
exports.TreeInheritanceIconComponent,
|
|
4112
|
+
TreeLabelCellRendererComponent,
|
|
4113
|
+
exports.IconComponent
|
|
3525
4114
|
],
|
|
3526
4115
|
imports: [
|
|
3527
4116
|
i2.CommonModule,
|
|
@@ -3574,7 +4163,8 @@
|
|
|
3574
4163
|
CommandFaceComponent,
|
|
3575
4164
|
MoreMenuComponent,
|
|
3576
4165
|
SeparatorComponent,
|
|
3577
|
-
FlexComponent
|
|
4166
|
+
FlexComponent,
|
|
4167
|
+
TreeTableComponent
|
|
3578
4168
|
],
|
|
3579
4169
|
providers: [
|
|
3580
4170
|
FocusBindingFactory
|
|
@@ -4215,6 +4805,35 @@
|
|
|
4215
4805
|
activityOutlets: [{ type: i0.ViewChildren, args: [ActivityOutletComponent,] }]
|
|
4216
4806
|
};
|
|
4217
4807
|
|
|
4808
|
+
var ActivityTitleComponent = /** @class */ (function (_super) {
|
|
4809
|
+
__extends(ActivityTitleComponent, _super);
|
|
4810
|
+
function ActivityTitleComponent() {
|
|
4811
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4812
|
+
}
|
|
4813
|
+
// @Input()
|
|
4814
|
+
// align: 'start' | 'end' | 'stretch' = 'start';
|
|
4815
|
+
//
|
|
4816
|
+
// @HostBinding('class.align-end')
|
|
4817
|
+
// get alignEnd():boolean {
|
|
4818
|
+
// return this.align === 'end'
|
|
4819
|
+
// }
|
|
4820
|
+
//
|
|
4821
|
+
// @HostBinding('class.align-stretch')
|
|
4822
|
+
// get alignStretch():boolean {
|
|
4823
|
+
// return this.align === 'stretch'
|
|
4824
|
+
// }
|
|
4825
|
+
ActivityTitleComponent.prototype.ngOnInit = function () {
|
|
4826
|
+
};
|
|
4827
|
+
return ActivityTitleComponent;
|
|
4828
|
+
}(DisposableComponent));
|
|
4829
|
+
ActivityTitleComponent.decorators = [
|
|
4830
|
+
{ type: i0.Component, args: [{
|
|
4831
|
+
selector: 'aup-activity-title',
|
|
4832
|
+
template: "<ng-content></ng-content>\n",
|
|
4833
|
+
styles: [":host{display:block}"]
|
|
4834
|
+
},] }
|
|
4835
|
+
];
|
|
4836
|
+
|
|
4218
4837
|
var InteractionServiceRoutingAdapter = /** @class */ (function () {
|
|
4219
4838
|
function InteractionServiceRoutingAdapter(activeInteractionContextIds, activeModalContext, createExclusiveInteractionContext) {
|
|
4220
4839
|
this.activeInteractionContextIds = activeInteractionContextIds;
|
|
@@ -4900,6 +5519,93 @@
|
|
|
4900
5519
|
{ type: i0.NgZone }
|
|
4901
5520
|
]; };
|
|
4902
5521
|
|
|
5522
|
+
/**
|
|
5523
|
+
* Example:
|
|
5524
|
+
* @example
|
|
5525
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
5526
|
+
* table.pluck("firstName");
|
|
5527
|
+
* table.pluck("lastName");
|
|
5528
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
5529
|
+
* });
|
|
5530
|
+
*
|
|
5531
|
+
* Editable tables
|
|
5532
|
+
* @example
|
|
5533
|
+
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
5534
|
+
* if (form.validate()) {
|
|
5535
|
+
* // normal form save stuff
|
|
5536
|
+
* return true; // finish editing
|
|
5537
|
+
* }
|
|
5538
|
+
* return false; // continue editiing
|
|
5539
|
+
* }
|
|
5540
|
+
* const colorsNames: ListModel<string> = ...;
|
|
5541
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
5542
|
+
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
5543
|
+
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
5544
|
+
* validators: [Validator.present("We need a last name")]
|
|
5545
|
+
* });
|
|
5546
|
+
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
5547
|
+
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
5548
|
+
* initialiseComponent(component: SelectInputComponent) {
|
|
5549
|
+
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
5550
|
+
* }
|
|
5551
|
+
* });
|
|
5552
|
+
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
5553
|
+
* });
|
|
5554
|
+
*
|
|
5555
|
+
* Selection models
|
|
5556
|
+
* @example
|
|
5557
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
5558
|
+
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
5559
|
+
* table.pluck("firstName");
|
|
5560
|
+
* table.pluck("lastName");
|
|
5561
|
+
* });
|
|
5562
|
+
*
|
|
5563
|
+
* Custom cell renderers and editors
|
|
5564
|
+
* @example
|
|
5565
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
5566
|
+
* table.pluck("favoriteColor")
|
|
5567
|
+
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
5568
|
+
* // configure your component with what ever you need.
|
|
5569
|
+
* });
|
|
5570
|
+
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
5571
|
+
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
5572
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
5573
|
+
* });
|
|
5574
|
+
*
|
|
5575
|
+
* I18n
|
|
5576
|
+
* @example
|
|
5577
|
+
* [table.yml]
|
|
5578
|
+
* table:
|
|
5579
|
+
* columns(ColumnTextProperties[]):
|
|
5580
|
+
* firstName:
|
|
5581
|
+
* headerText: "First Name"
|
|
5582
|
+
* fullName:
|
|
5583
|
+
* headerText: "Full Name"
|
|
5584
|
+
*
|
|
5585
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
5586
|
+
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
5587
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
5588
|
+
*
|
|
5589
|
+
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
5590
|
+
* });
|
|
5591
|
+
*/
|
|
5592
|
+
var TableModel = /** @class */ (function (_super) {
|
|
5593
|
+
__extends(TableModel, _super);
|
|
5594
|
+
function TableModel() {
|
|
5595
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5596
|
+
}
|
|
5597
|
+
TableModel.fromList = function (sourceOfTruth, builder) {
|
|
5598
|
+
var model = new TableModel(sourceOfTruth);
|
|
5599
|
+
if (builder)
|
|
5600
|
+
builder(model);
|
|
5601
|
+
return model;
|
|
5602
|
+
};
|
|
5603
|
+
TableModel.prototype.addSelectionColumn = function (selectionModel) {
|
|
5604
|
+
return this._addSelectionColumn(selectionModel);
|
|
5605
|
+
};
|
|
5606
|
+
return TableModel;
|
|
5607
|
+
}(exports.AbstractTableModel));
|
|
5608
|
+
|
|
4903
5609
|
/**
|
|
4904
5610
|
* @file Automatically generated by barrelsby.
|
|
4905
5611
|
*/
|
|
@@ -4938,11 +5644,13 @@
|
|
|
4938
5644
|
SelectInputActivity,
|
|
4939
5645
|
AbstractInputActivity,
|
|
4940
5646
|
InteractionContextTriggerFor,
|
|
4941
|
-
Activity
|
|
5647
|
+
Activity,
|
|
5648
|
+
ActivityTitleComponent
|
|
4942
5649
|
],
|
|
4943
5650
|
exports: [
|
|
4944
5651
|
ActivityContainerComponent,
|
|
4945
5652
|
ActivityOutletComponent,
|
|
5653
|
+
ActivityTitleComponent,
|
|
4946
5654
|
InPlaceInteractionContextComponent,
|
|
4947
5655
|
AddItemInteractionContextComponent,
|
|
4948
5656
|
ActivityActionsComponent,
|
|
@@ -8059,6 +8767,7 @@
|
|
|
8059
8767
|
exports.ActivityContainerComponent = ActivityContainerComponent;
|
|
8060
8768
|
exports.ActivityOutletComponent = ActivityOutletComponent;
|
|
8061
8769
|
exports.ActivityRef = ActivityRef;
|
|
8770
|
+
exports.ActivityTitleComponent = ActivityTitleComponent;
|
|
8062
8771
|
exports.AddItemInteractionContextComponent = AddItemInteractionContextComponent;
|
|
8063
8772
|
exports.AlertDialogComponent = AlertDialogComponent;
|
|
8064
8773
|
exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
|
|
@@ -8098,6 +8807,7 @@
|
|
|
8098
8807
|
exports.EditorControlColumnModel = EditorControlColumnModel;
|
|
8099
8808
|
exports.EmptyStateComponent = EmptyStateComponent;
|
|
8100
8809
|
exports.EventCleanUpSession = EventCleanUpSession;
|
|
8810
|
+
exports.FlattenStrategy = FlattenStrategy;
|
|
8101
8811
|
exports.FlexComponent = FlexComponent;
|
|
8102
8812
|
exports.FocusBinding = FocusBinding;
|
|
8103
8813
|
exports.FocusBindingDirective = FocusBindingDirective;
|
|
@@ -8164,10 +8874,17 @@
|
|
|
8164
8874
|
exports.TableCellRendererComponent = TableCellRendererComponent;
|
|
8165
8875
|
exports.TableComponent = TableComponent;
|
|
8166
8876
|
exports.TableHeaderCellRendererComponent = TableHeaderCellRendererComponent;
|
|
8877
|
+
exports.TableModel = TableModel;
|
|
8167
8878
|
exports.TableRowMenuComponent = TableRowMenuComponent;
|
|
8168
8879
|
exports.TemplateCellRendererPortalRef = TemplateCellRendererPortalRef;
|
|
8169
8880
|
exports.TextInputComponent = TextInputComponent;
|
|
8170
8881
|
exports.ToolBarComponent = ToolBarComponent;
|
|
8882
|
+
exports.TreeExpansionModel = TreeExpansionModel;
|
|
8883
|
+
exports.TreeLabelCellRendererComponent = TreeLabelCellRendererComponent;
|
|
8884
|
+
exports.TreeLabelColumnModel = TreeLabelColumnModel;
|
|
8885
|
+
exports.TreeTableComponent = TreeTableComponent;
|
|
8886
|
+
exports.TreeTableModel = TreeTableModel;
|
|
8887
|
+
exports.TreeToListModel = TreeToListModel;
|
|
8171
8888
|
exports.UrlService = UrlService;
|
|
8172
8889
|
exports.VerticalFocusContainerComponent = VerticalFocusContainerComponent;
|
|
8173
8890
|
exports.Visit = Visit;
|