@coolon/angular-ui-powerups 2.0.0-alpha.2 → 2.0.0-alpha.20
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 +126 -0
- package/assets/form.scss +33 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +567 -323
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +55 -54
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +53 -52
- package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/esm2015/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 +29 -12
- 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/forms/abstract-input.component.js +26 -6
- package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.js +51 -6
- package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.js +46 -7
- package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +70 -0
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -0
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json +1 -0
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +4 -7
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js +8 -13
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js +4 -7
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +5 -8
- package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js +8 -5
- package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.js +4 -8
- package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js +4 -7
- package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
- package/esm2015/lib/components/index.js +2 -1
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/table/cell-editors.js.map +1 -1
- package/esm2015/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
- package/esm2015/lib/components/table/cell-portal-ref.js.map +1 -0
- package/esm2015/lib/components/table/{cell-protal-ref.metadata.json → cell-portal-ref.metadata.json} +1 -1
- package/esm2015/lib/components/table/column-model.js +66 -11
- 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/mutable-cell-renderer.js +1 -0
- package/esm2015/lib/components/table/mutable-cell-renderer.js.map +1 -0
- package/esm2015/lib/components/table/mutable-cell-renderer.metadata.json +1 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-model.js +8 -5
- 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/interaction/components/activity-container/activity-container.component.js +2 -7
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/place-component.js +1 -1
- package/esm2015/lib/place/place-component.js.map +1 -1
- package/esm2015/lib/place/place-router.js +2 -8
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +2 -3
- package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
- package/esm5/coolon-angular-ui-powerups.js +53 -52
- package/esm5/coolon-angular-ui-powerups.js.map +1 -1
- package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/card-container/card-container.component.js +1 -1
- package/esm5/lib/components/components.module.js +29 -12
- package/esm5/lib/components/components.module.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/forms/abstract-input.component.js +34 -6
- package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-list-input.component.js +56 -6
- package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-value-input.component.js +51 -7
- package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js +73 -0
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -0
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js +4 -7
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js +8 -13
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js +4 -7
- package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +5 -8
- package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js +8 -5
- package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/string-input/string-input.component.js +4 -8
- package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js +4 -7
- package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm5/lib/components/index.js +2 -1
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/table/cell-editors.js.map +1 -1
- package/esm5/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
- package/esm5/lib/components/table/cell-portal-ref.js.map +1 -0
- package/esm5/lib/components/table/column-model.js +67 -11
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/mutable-cell-renderer.js +1 -0
- package/esm5/lib/components/table/mutable-cell-renderer.js.map +1 -0
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-model.js +8 -5
- package/esm5/lib/components/table/table-model.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -7
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm5/lib/place/place-component.js +1 -1
- package/esm5/lib/place/place-component.js.map +1 -1
- package/esm5/lib/place/place-router.js +2 -8
- package/esm5/lib/place/place-router.js.map +1 -1
- package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
- package/esm5/lib/place/route/parameter-decorators.js +2 -3
- package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +462 -241
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +499 -256
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +12 -3
- package/lib/components/forms/abstract-list-input.component.d.ts +10 -3
- package/lib/components/forms/abstract-value-input.component.d.ts +9 -3
- package/lib/components/forms/autocomplete-input/autocomplete-input.component.d.ts +25 -0
- package/lib/components/forms/checkbox-input/checkbox-input.component.d.ts +0 -2
- package/lib/components/forms/multiple-select-input/multiple-select-input.component.d.ts +8 -4
- package/lib/components/forms/number-input/number-input.component.d.ts +0 -2
- package/lib/components/forms/password-input/password-input.component.d.ts +0 -2
- package/lib/components/forms/select-input/select-input.component.d.ts +8 -2
- package/lib/components/forms/string-input/string-input.component.d.ts +1 -2
- package/lib/components/forms/text-input/text-input.component.d.ts +0 -2
- package/lib/components/index.d.ts +3 -1
- package/lib/components/table/cell-editors.d.ts +3 -3
- package/lib/components/table/{cell-protal-ref.d.ts → cell-portal-ref.d.ts} +4 -4
- package/lib/components/table/column-model.d.ts +18 -12
- package/lib/components/table/mutable-cell-renderer.d.ts +6 -0
- package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
- package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +1 -1
- package/lib/components/table/table-model.d.ts +14 -3
- package/package.json +4 -4
- package/esm2015/lib/components/table/cell-protal-ref.js.map +0 -1
- package/esm5/lib/components/table/cell-protal-ref.js.map +0 -1
|
@@ -9,18 +9,19 @@ import { MatTabsModule, MatTabGroup, MAT_TABS_CONFIG } from '@angular/material/t
|
|
|
9
9
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
10
10
|
import { ComponentPortal, TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
11
11
|
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
12
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
12
13
|
import { MatButtonModule } from '@angular/material/button';
|
|
13
14
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
14
15
|
import { MatIconModule } from '@angular/material/icon';
|
|
15
16
|
import { MatTableModule } from '@angular/material/table';
|
|
16
|
-
import {
|
|
17
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
18
|
+
import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
19
|
+
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
20
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, FocusManager, EventListenerList, Form, MutableListModel, Guard, Binding, DebugContext, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Functions } from '@coolon/pectin';
|
|
21
|
+
import ___default, { isEqual, isNil } from 'lodash';
|
|
17
22
|
import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
|
|
18
23
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
19
|
-
import ___default, { isEqual, isNil } from 'lodash';
|
|
20
24
|
import produce from 'immer';
|
|
21
|
-
import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
22
|
-
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
23
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
24
25
|
import { FlexModule, GridModule } from '@angular/flex-layout';
|
|
25
26
|
import { MatDialogModule, MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
26
27
|
import { RouterModule, UrlSegment, Router, UrlSerializer, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterOutlet } from '@angular/router';
|
|
@@ -369,7 +370,7 @@ CardContainerComponent = __decorate([
|
|
|
369
370
|
Component({
|
|
370
371
|
selector: 'aup-card-container',
|
|
371
372
|
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-icon 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",
|
|
372
|
-
styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right: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{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.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 280ms 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-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{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%;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{padding-left:var(--default-column-gap);flex:1}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.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{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
|
|
373
|
+
styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right: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{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.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 280ms 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{padding-bottom:0;border-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{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%;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{padding-left:var(--default-column-gap);flex:1}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.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{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
|
|
373
374
|
}),
|
|
374
375
|
__metadata("design:paramtypes", [])
|
|
375
376
|
], CardContainerComponent);
|
|
@@ -467,6 +468,8 @@ FocusableComponent = __decorate([
|
|
|
467
468
|
let AbstractInputComponent = class AbstractInputComponent extends DisposableComponent {
|
|
468
469
|
constructor() {
|
|
469
470
|
super();
|
|
471
|
+
this.onValueEditedListeners = new EventListenerList();
|
|
472
|
+
this.dense = false;
|
|
470
473
|
// TODO: fix this.
|
|
471
474
|
// tslint:disable-next-line:no-output-native
|
|
472
475
|
this.focus = new EventEmitter();
|
|
@@ -514,19 +517,32 @@ let AbstractInputComponent = class AbstractInputComponent extends DisposableComp
|
|
|
514
517
|
return this.enabled.value;
|
|
515
518
|
}
|
|
516
519
|
get enabled() {
|
|
517
|
-
return this.
|
|
520
|
+
return this.formValueModel.enabled;
|
|
518
521
|
}
|
|
519
522
|
hasErrors() {
|
|
520
523
|
return !this.errorList.query().isEmpty();
|
|
521
524
|
}
|
|
522
525
|
get errorList() {
|
|
523
|
-
return this.
|
|
526
|
+
return this.formValueModel.errorList;
|
|
524
527
|
}
|
|
525
528
|
get firstError() {
|
|
526
529
|
return this.hasErrors() ? this.errorList.value[0] : null;
|
|
527
530
|
}
|
|
528
531
|
get focusContext() {
|
|
529
|
-
return this.
|
|
532
|
+
return this.formValueModel.focusContext;
|
|
533
|
+
}
|
|
534
|
+
get floatLabel() {
|
|
535
|
+
return this.dense ? 'never' : this.userFloatLabel;
|
|
536
|
+
}
|
|
537
|
+
get showHint() {
|
|
538
|
+
return this.dense ? false : !!this.hint;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Invokes the callback when this components value is changed by a user edit.
|
|
542
|
+
* @param callback
|
|
543
|
+
*/
|
|
544
|
+
onValueEdited(callback) {
|
|
545
|
+
return this.onValueEditedListeners.add(callback);
|
|
530
546
|
}
|
|
531
547
|
};
|
|
532
548
|
__decorate([
|
|
@@ -534,9 +550,9 @@ __decorate([
|
|
|
534
550
|
__metadata("design:type", String)
|
|
535
551
|
], AbstractInputComponent.prototype, "label", void 0);
|
|
536
552
|
__decorate([
|
|
537
|
-
Input(),
|
|
553
|
+
Input('floatLabel'),
|
|
538
554
|
__metadata("design:type", String)
|
|
539
|
-
], AbstractInputComponent.prototype, "
|
|
555
|
+
], AbstractInputComponent.prototype, "userFloatLabel", void 0);
|
|
540
556
|
__decorate([
|
|
541
557
|
Input(),
|
|
542
558
|
__metadata("design:type", String)
|
|
@@ -545,6 +561,11 @@ __decorate([
|
|
|
545
561
|
Input(),
|
|
546
562
|
__metadata("design:type", String)
|
|
547
563
|
], AbstractInputComponent.prototype, "placeholder", void 0);
|
|
564
|
+
__decorate([
|
|
565
|
+
HostBinding('class.dense'),
|
|
566
|
+
Input(),
|
|
567
|
+
__metadata("design:type", Object)
|
|
568
|
+
], AbstractInputComponent.prototype, "dense", void 0);
|
|
548
569
|
__decorate([
|
|
549
570
|
Input('command.focus'),
|
|
550
571
|
__metadata("design:type", Command)
|
|
@@ -610,7 +631,7 @@ AbstractInputComponent = __decorate([
|
|
|
610
631
|
|
|
611
632
|
let AbstractListInputComponent = class AbstractListInputComponent extends AbstractInputComponent {
|
|
612
633
|
constructor() {
|
|
613
|
-
super(
|
|
634
|
+
super();
|
|
614
635
|
/**
|
|
615
636
|
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
616
637
|
*
|
|
@@ -622,11 +643,56 @@ let AbstractListInputComponent = class AbstractListInputComponent extends Abstra
|
|
|
622
643
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
623
644
|
*/
|
|
624
645
|
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
625
|
-
this.
|
|
646
|
+
this.formValueModel = this.registerDisposable(new Form.DelegatingListModel());
|
|
647
|
+
this.componentListModel = new MutableListModel();
|
|
648
|
+
this.setValueIsInProgress = new Guard();
|
|
649
|
+
this.valueChange = new EventEmitter();
|
|
650
|
+
const { when, valueOf, chain } = Dsl.disposeWith(this);
|
|
651
|
+
const binding = new Binding.Identity(this.formValueModel, this.componentListModel);
|
|
652
|
+
const inExternalChange = valueOf.any(this.setValueIsInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
|
|
653
|
+
when(this.componentListModel).changes((is, was) => {
|
|
654
|
+
this.valueChange.emit(is);
|
|
655
|
+
this.onValueEditedListeners.fire(l => l(is, was));
|
|
656
|
+
}, {
|
|
657
|
+
initialValue: 'ignore',
|
|
658
|
+
// we never fire events during an external changes to the value. This allows
|
|
659
|
+
// the component to behave when used in the conventional angular
|
|
660
|
+
// fashion, i.e. [(value)]="..."
|
|
661
|
+
unless: inExternalChange
|
|
662
|
+
});
|
|
663
|
+
DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);
|
|
664
|
+
}
|
|
665
|
+
// We add support for simple direct display of values by allowing components to be used
|
|
666
|
+
// by `component.value = ...` This use of the component without a value model in tables
|
|
667
|
+
// and the like.
|
|
668
|
+
set value(value) {
|
|
669
|
+
this.setValueIsInProgress.whileTrue(() => {
|
|
670
|
+
if (!this.listHolder) {
|
|
671
|
+
this.listHolder = new MutableListModel(value);
|
|
672
|
+
this.listModel = this.listHolder;
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
this.listHolder.value = value;
|
|
676
|
+
}
|
|
677
|
+
});
|
|
626
678
|
}
|
|
627
679
|
};
|
|
680
|
+
__decorate([
|
|
681
|
+
Input(), TrackExternal({ delegateTo: 'formValueModel' }),
|
|
682
|
+
__metadata("design:type", Object)
|
|
683
|
+
], AbstractListInputComponent.prototype, "listModel", void 0);
|
|
684
|
+
__decorate([
|
|
685
|
+
Input(),
|
|
686
|
+
__metadata("design:type", Array),
|
|
687
|
+
__metadata("design:paramtypes", [Array])
|
|
688
|
+
], AbstractListInputComponent.prototype, "value", null);
|
|
689
|
+
__decorate([
|
|
690
|
+
Output(),
|
|
691
|
+
__metadata("design:type", Object)
|
|
692
|
+
], AbstractListInputComponent.prototype, "valueChange", void 0);
|
|
628
693
|
AbstractListInputComponent = __decorate([
|
|
629
|
-
Component({ template: '' })
|
|
694
|
+
Component({ template: '' }),
|
|
695
|
+
__metadata("design:paramtypes", [])
|
|
630
696
|
], AbstractListInputComponent);
|
|
631
697
|
|
|
632
698
|
let AbstractValueInputComponent = class AbstractValueInputComponent extends AbstractInputComponent {
|
|
@@ -643,32 +709,133 @@ let AbstractValueInputComponent = class AbstractValueInputComponent extends Abst
|
|
|
643
709
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
644
710
|
*/
|
|
645
711
|
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
646
|
-
this.
|
|
647
|
-
this.
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
712
|
+
this.formValueModel = this.registerDisposable(new Form.DelegatingValueModel());
|
|
713
|
+
this.setValueInProgress = new Guard();
|
|
714
|
+
this.componentValueModel = new MutableValueModel();
|
|
715
|
+
this.valueChange = new EventEmitter();
|
|
716
|
+
const { when, chain, valueOf } = Dsl.disposeWith(this);
|
|
717
|
+
const binding = new Binding.Identity(this.formValueModel, this.componentValueModel);
|
|
718
|
+
const inExternalChange = valueOf.any(this.setValueInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
|
|
719
|
+
when(this.componentValueModel).changes((is, was) => {
|
|
720
|
+
this.valueChange.emit(is);
|
|
721
|
+
this.onValueEditedListeners.fire(l => l(is, was));
|
|
722
|
+
}, {
|
|
723
|
+
initialValue: 'ignore',
|
|
724
|
+
// we never fire events during an external set value operation. This allows
|
|
725
|
+
// the component to behave when used in the conventional angular
|
|
726
|
+
// fashion, i.e. [(value)]="..."
|
|
727
|
+
unless: inExternalChange
|
|
728
|
+
});
|
|
729
|
+
DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);
|
|
730
|
+
}
|
|
731
|
+
// We add support for simple direct display of values by allowing components to be used
|
|
732
|
+
// by `component.value = ...` This use of the component without a value model in tables
|
|
733
|
+
// and the like.
|
|
734
|
+
set value(value) {
|
|
735
|
+
this.setValueInProgress.whileTrue(() => {
|
|
736
|
+
if (!this.plainValueHolder) {
|
|
737
|
+
this.plainValueHolder = new MutableValueModel(value);
|
|
738
|
+
this.valueModel = this.plainValueHolder;
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
this.plainValueHolder.value = value;
|
|
742
|
+
}
|
|
651
743
|
});
|
|
652
744
|
}
|
|
653
745
|
};
|
|
746
|
+
__decorate([
|
|
747
|
+
Input(), TrackExternal({ delegateTo: 'formValueModel' }),
|
|
748
|
+
__metadata("design:type", Object)
|
|
749
|
+
], AbstractValueInputComponent.prototype, "valueModel", void 0);
|
|
750
|
+
__decorate([
|
|
751
|
+
Input(),
|
|
752
|
+
__metadata("design:type", Object),
|
|
753
|
+
__metadata("design:paramtypes", [Object])
|
|
754
|
+
], AbstractValueInputComponent.prototype, "value", null);
|
|
755
|
+
__decorate([
|
|
756
|
+
Output(),
|
|
757
|
+
__metadata("design:type", Object)
|
|
758
|
+
], AbstractValueInputComponent.prototype, "valueChange", void 0);
|
|
654
759
|
AbstractValueInputComponent = __decorate([
|
|
655
760
|
Component({ template: '' }),
|
|
656
761
|
__metadata("design:paramtypes", [])
|
|
657
762
|
], AbstractValueInputComponent);
|
|
658
763
|
|
|
764
|
+
/**
|
|
765
|
+
* Using templates (not only supported for nil values:
|
|
766
|
+
* <aup-autocomplete-input [valueModel]="myModel" [options]="myOptions">
|
|
767
|
+
* <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
768
|
+
* </aup-autocomplete-input>
|
|
769
|
+
*/
|
|
770
|
+
let AutocompleteInputComponent = class AutocompleteInputComponent extends AbstractValueInputComponent {
|
|
771
|
+
constructor() {
|
|
772
|
+
super();
|
|
773
|
+
this.filterValue = new MutableValueModel();
|
|
774
|
+
this.optionLabelFormat = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;
|
|
775
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
776
|
+
const lowerCaseFilterValue = chain(this.filterValue)
|
|
777
|
+
.map(v => ___default.isString(v) ? v.toLowerCase() : '');
|
|
778
|
+
this.filteredOptions = chain(this.optionsModel)
|
|
779
|
+
.select(option => {
|
|
780
|
+
return ___default.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
781
|
+
}, { dependsOn: lowerCaseFilterValue });
|
|
782
|
+
}
|
|
783
|
+
ngOnInit() {
|
|
784
|
+
}
|
|
785
|
+
formatOption(option) {
|
|
786
|
+
return this.optionLabelFormat(option);
|
|
787
|
+
}
|
|
788
|
+
updateFilter($event) {
|
|
789
|
+
this.filterValue.value = $event;
|
|
790
|
+
}
|
|
791
|
+
onSelect($event) {
|
|
792
|
+
this.valueModel.value = $event.option.value;
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
__decorate([
|
|
796
|
+
Input(), TrackExternal(),
|
|
797
|
+
__metadata("design:type", ListModel)
|
|
798
|
+
], AutocompleteInputComponent.prototype, "optionsModel", void 0);
|
|
799
|
+
__decorate([
|
|
800
|
+
Input(), StoreInListModel('optionsModel'),
|
|
801
|
+
__metadata("design:type", Array)
|
|
802
|
+
], AutocompleteInputComponent.prototype, "options", void 0);
|
|
803
|
+
__decorate([
|
|
804
|
+
Input(),
|
|
805
|
+
__metadata("design:type", Object)
|
|
806
|
+
], AutocompleteInputComponent.prototype, "optionLabel", void 0);
|
|
807
|
+
__decorate([
|
|
808
|
+
Input(),
|
|
809
|
+
__metadata("design:type", Boolean)
|
|
810
|
+
], AutocompleteInputComponent.prototype, "allowNil", void 0);
|
|
811
|
+
__decorate([
|
|
812
|
+
ContentChild('nilOptionTemplate'),
|
|
813
|
+
__metadata("design:type", TemplateRef)
|
|
814
|
+
], AutocompleteInputComponent.prototype, "nilOptionTemplateRef", void 0);
|
|
815
|
+
__decorate([
|
|
816
|
+
Input(),
|
|
817
|
+
__metadata("design:type", Function)
|
|
818
|
+
], AutocompleteInputComponent.prototype, "optionLabelFormat", void 0);
|
|
819
|
+
AutocompleteInputComponent = __decorate([
|
|
820
|
+
Component({
|
|
821
|
+
selector: 'aup-autocomplete-input',
|
|
822
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
823
|
+
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
824
|
+
}),
|
|
825
|
+
__metadata("design:paramtypes", [])
|
|
826
|
+
], AutocompleteInputComponent);
|
|
827
|
+
|
|
659
828
|
let CheckboxInputComponent = class CheckboxInputComponent extends AbstractValueInputComponent {
|
|
660
829
|
constructor() {
|
|
661
830
|
super();
|
|
831
|
+
// @Input() @TrackExternal({ delegateTo: 'inputModel' })
|
|
832
|
+
// valueModel: Form.ValueModelBase<boolean> | IMutableValueModel<boolean>;
|
|
662
833
|
this.color = 'accent';
|
|
663
834
|
this.labelPosition = 'after';
|
|
664
835
|
}
|
|
665
836
|
ngOnInit() {
|
|
666
837
|
}
|
|
667
838
|
};
|
|
668
|
-
__decorate([
|
|
669
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
670
|
-
__metadata("design:type", Object)
|
|
671
|
-
], CheckboxInputComponent.prototype, "valueModel", void 0);
|
|
672
839
|
__decorate([
|
|
673
840
|
Input(),
|
|
674
841
|
__metadata("design:type", String)
|
|
@@ -680,25 +847,67 @@ __decorate([
|
|
|
680
847
|
CheckboxInputComponent = __decorate([
|
|
681
848
|
Component({
|
|
682
849
|
selector: 'aup-checkbox-input',
|
|
683
|
-
template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"
|
|
684
|
-
styles: [":host{display:inline-flex;flex-direction:column;
|
|
850
|
+
template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"componentValueModel.value\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{label}}</mat-checkbox>\n<mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n<mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n",
|
|
851
|
+
styles: [":host{display:inline-flex;flex-direction:column;padding:24px 0 16px}:host.dense{padding:6px 0 2px}mat-error,mat-hint{margin-top:4px;margin-left:24px;font-size:12px;font-weight:400;line-height:13.5px}"]
|
|
685
852
|
}),
|
|
686
853
|
__metadata("design:paramtypes", [])
|
|
687
854
|
], CheckboxInputComponent);
|
|
688
855
|
|
|
856
|
+
/**
|
|
857
|
+
* Using templates:
|
|
858
|
+
* <aup-multiple-select-input [valueModel]="myModel" [options]="myOptions">
|
|
859
|
+
* <ng-template #optionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
860
|
+
* <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
861
|
+
* </aup-multiple-select_input>
|
|
862
|
+
*/
|
|
863
|
+
let MultipleSelectInputComponent = class MultipleSelectInputComponent extends AbstractListInputComponent {
|
|
864
|
+
constructor() {
|
|
865
|
+
super();
|
|
866
|
+
this.optionLabelFormat = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;
|
|
867
|
+
}
|
|
868
|
+
ngOnInit() {
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
__decorate([
|
|
872
|
+
Input(), TrackExternal(),
|
|
873
|
+
__metadata("design:type", ListModel)
|
|
874
|
+
], MultipleSelectInputComponent.prototype, "optionsModel", void 0);
|
|
875
|
+
__decorate([
|
|
876
|
+
Input(), StoreInListModel('optionsModel'),
|
|
877
|
+
__metadata("design:type", Array)
|
|
878
|
+
], MultipleSelectInputComponent.prototype, "options", void 0);
|
|
879
|
+
__decorate([
|
|
880
|
+
Input(),
|
|
881
|
+
__metadata("design:type", Object)
|
|
882
|
+
], MultipleSelectInputComponent.prototype, "optionLabel", void 0);
|
|
883
|
+
__decorate([
|
|
884
|
+
ContentChild('optionTemplate'),
|
|
885
|
+
__metadata("design:type", TemplateRef)
|
|
886
|
+
], MultipleSelectInputComponent.prototype, "optionTemplateRef", void 0);
|
|
887
|
+
__decorate([
|
|
888
|
+
Input(),
|
|
889
|
+
__metadata("design:type", Function)
|
|
890
|
+
], MultipleSelectInputComponent.prototype, "optionLabelFormat", void 0);
|
|
891
|
+
MultipleSelectInputComponent = __decorate([
|
|
892
|
+
Component({
|
|
893
|
+
selector: 'aup-multiple-select-input',
|
|
894
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n multiple\n [(ngModel)]=\"componentListModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
895
|
+
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
896
|
+
}),
|
|
897
|
+
__metadata("design:paramtypes", [])
|
|
898
|
+
], MultipleSelectInputComponent);
|
|
899
|
+
|
|
689
900
|
let NumberInputComponent = class NumberInputComponent extends AbstractValueInputComponent {
|
|
690
901
|
constructor() {
|
|
691
902
|
super();
|
|
903
|
+
// @Input() @TrackExternal({ delegateTo: 'inputModel' })
|
|
904
|
+
// valueModel: Form.ValueModelBase<number> | IMutableValueModel<number>;
|
|
692
905
|
this.min = Number.MIN_SAFE_INTEGER;
|
|
693
906
|
this.max = Number.MAX_SAFE_INTEGER;
|
|
694
907
|
}
|
|
695
908
|
ngOnInit() {
|
|
696
909
|
}
|
|
697
910
|
};
|
|
698
|
-
__decorate([
|
|
699
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
700
|
-
__metadata("design:type", Object)
|
|
701
|
-
], NumberInputComponent.prototype, "valueModel", void 0);
|
|
702
911
|
__decorate([
|
|
703
912
|
Input(),
|
|
704
913
|
__metadata("design:type", Object)
|
|
@@ -710,32 +919,37 @@ __decorate([
|
|
|
710
919
|
NumberInputComponent = __decorate([
|
|
711
920
|
Component({
|
|
712
921
|
selector: 'aup-number-input',
|
|
713
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
714
|
-
styles: ["
|
|
922
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [min]=\"min\"\n [max]=\"max\"\n >\n <mat-hint *ngIf=\"hint && !dense\" >{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
923
|
+
styles: [""]
|
|
715
924
|
}),
|
|
716
925
|
__metadata("design:paramtypes", [])
|
|
717
926
|
], NumberInputComponent);
|
|
718
927
|
|
|
719
928
|
let PasswordInputComponent = class PasswordInputComponent extends AbstractValueInputComponent {
|
|
929
|
+
// @Input() @TrackExternal({ delegateTo: 'inputModel' })
|
|
930
|
+
// valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
|
|
720
931
|
constructor() {
|
|
721
932
|
super();
|
|
722
933
|
}
|
|
723
934
|
ngOnInit() {
|
|
724
935
|
}
|
|
725
936
|
};
|
|
726
|
-
__decorate([
|
|
727
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
728
|
-
__metadata("design:type", Object)
|
|
729
|
-
], PasswordInputComponent.prototype, "valueModel", void 0);
|
|
730
937
|
PasswordInputComponent = __decorate([
|
|
731
938
|
Component({
|
|
732
939
|
selector: 'aup-password-input',
|
|
733
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
734
|
-
styles: ["
|
|
940
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
941
|
+
styles: [""]
|
|
735
942
|
}),
|
|
736
943
|
__metadata("design:paramtypes", [])
|
|
737
944
|
], PasswordInputComponent);
|
|
738
945
|
|
|
946
|
+
/**
|
|
947
|
+
* Using templates:
|
|
948
|
+
* <aup-select-input [valueModel]="myModel" [options]="myOptions">
|
|
949
|
+
* <ng-template #optionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
950
|
+
* <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
951
|
+
* </aup-select_input>
|
|
952
|
+
*/
|
|
739
953
|
let SelectInputComponent = class SelectInputComponent extends AbstractValueInputComponent {
|
|
740
954
|
constructor() {
|
|
741
955
|
super();
|
|
@@ -744,10 +958,6 @@ let SelectInputComponent = class SelectInputComponent extends AbstractValueInput
|
|
|
744
958
|
ngOnInit() {
|
|
745
959
|
}
|
|
746
960
|
};
|
|
747
|
-
__decorate([
|
|
748
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
749
|
-
__metadata("design:type", Object)
|
|
750
|
-
], SelectInputComponent.prototype, "valueModel", void 0);
|
|
751
961
|
__decorate([
|
|
752
962
|
Input(), TrackExternal(),
|
|
753
963
|
__metadata("design:type", ListModel)
|
|
@@ -779,7 +989,7 @@ __decorate([
|
|
|
779
989
|
SelectInputComponent = __decorate([
|
|
780
990
|
Component({
|
|
781
991
|
selector: 'aup-select-input',
|
|
782
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
992
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
783
993
|
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
784
994
|
}),
|
|
785
995
|
__metadata("design:paramtypes", [])
|
|
@@ -790,17 +1000,13 @@ let StringInputComponent = class StringInputComponent extends AbstractValueInput
|
|
|
790
1000
|
super();
|
|
791
1001
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
792
1002
|
this.clearCommand = Command.create(() => {
|
|
793
|
-
this.
|
|
1003
|
+
this.componentValueModel.value = null;
|
|
794
1004
|
});
|
|
795
|
-
this.clearCommand.disableWhile(chain.stringValue(this.
|
|
1005
|
+
this.clearCommand.disableWhile(chain.stringValue(this.componentValueModel).isBlank());
|
|
796
1006
|
}
|
|
797
1007
|
ngOnInit() {
|
|
798
1008
|
}
|
|
799
1009
|
};
|
|
800
|
-
__decorate([
|
|
801
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
802
|
-
__metadata("design:type", Object)
|
|
803
|
-
], StringInputComponent.prototype, "valueModel", void 0);
|
|
804
1010
|
__decorate([
|
|
805
1011
|
Input(), TrackExternal({ defaultValue: false }),
|
|
806
1012
|
__metadata("design:type", ValueModel)
|
|
@@ -812,8 +1018,8 @@ __decorate([
|
|
|
812
1018
|
StringInputComponent = __decorate([
|
|
813
1019
|
Component({
|
|
814
1020
|
selector: 'aup-string-input',
|
|
815
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
816
|
-
styles: ["
|
|
1021
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n</mat-form-field>\n\n",
|
|
1022
|
+
styles: ["button[disabled]{visibility:hidden}"]
|
|
817
1023
|
}),
|
|
818
1024
|
__metadata("design:paramtypes", [])
|
|
819
1025
|
], StringInputComponent);
|
|
@@ -821,16 +1027,14 @@ StringInputComponent = __decorate([
|
|
|
821
1027
|
let TextInputComponent = class TextInputComponent extends AbstractValueInputComponent {
|
|
822
1028
|
constructor() {
|
|
823
1029
|
super();
|
|
1030
|
+
// @Input() @TrackExternal({ delegateTo: 'inputModel' })
|
|
1031
|
+
// valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
|
|
824
1032
|
this.rows = 2;
|
|
825
1033
|
// const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
826
1034
|
}
|
|
827
1035
|
ngOnInit() {
|
|
828
1036
|
}
|
|
829
1037
|
};
|
|
830
|
-
__decorate([
|
|
831
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
832
|
-
__metadata("design:type", Object)
|
|
833
|
-
], TextInputComponent.prototype, "valueModel", void 0);
|
|
834
1038
|
__decorate([
|
|
835
1039
|
Input(),
|
|
836
1040
|
__metadata("design:type", Object)
|
|
@@ -842,12 +1046,47 @@ __decorate([
|
|
|
842
1046
|
TextInputComponent = __decorate([
|
|
843
1047
|
Component({
|
|
844
1048
|
selector: 'aup-text-input',
|
|
845
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
846
|
-
styles: ["
|
|
1049
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
1050
|
+
styles: ["button[disabled]{visibility:hidden}textarea{overflow:auto}"]
|
|
847
1051
|
}),
|
|
848
1052
|
__metadata("design:paramtypes", [])
|
|
849
1053
|
], TextInputComponent);
|
|
850
1054
|
|
|
1055
|
+
let IconComponent = class IconComponent {
|
|
1056
|
+
set icon(iconName) {
|
|
1057
|
+
this._icon = iconName;
|
|
1058
|
+
if (!iconName) {
|
|
1059
|
+
this.errorMessage = 'icon is nil';
|
|
1060
|
+
this.prefix = undefined;
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
const colonIndex = iconName.indexOf(':');
|
|
1064
|
+
if (colonIndex > 0) {
|
|
1065
|
+
this.prefix = this.icon.slice(0, colonIndex);
|
|
1066
|
+
this.suffix = this.icon.slice(colonIndex + 1);
|
|
1067
|
+
}
|
|
1068
|
+
if (this.prefix) {
|
|
1069
|
+
this.errorMessage = `Unknown icon "${iconName}"`;
|
|
1070
|
+
}
|
|
1071
|
+
this.errorMessage = `Unknown icon prefix "${this.prefix}"`;
|
|
1072
|
+
}
|
|
1073
|
+
get icon() {
|
|
1074
|
+
return this._icon;
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
__decorate([
|
|
1078
|
+
Input(),
|
|
1079
|
+
__metadata("design:type", String),
|
|
1080
|
+
__metadata("design:paramtypes", [String])
|
|
1081
|
+
], IconComponent.prototype, "icon", null);
|
|
1082
|
+
IconComponent = __decorate([
|
|
1083
|
+
Component({
|
|
1084
|
+
selector: 'aup-icon',
|
|
1085
|
+
template: "<ng-container [ngSwitch]=\"prefix\">\n\n <mat-icon *ngSwitchCase=\"'svg'\"\n [svgIcon]=\"suffix\"\n class=\"svgIcon\">\n </mat-icon>\n\n <mat-icon *ngSwitchCase=\"'mat'\">\n {{suffix}}\n </mat-icon>\n\n <div *ngSwitchCase=\"'fab'\"\n class=\"faIconWrapper\">\n <fa-icon [icon]=\"suffix\">\n </fa-icon>\n </div>\n\n <mat-icon *ngSwitchDefault\n [matTooltip]=\"errorMessage\">\n bug_report\n </mat-icon>\n\n</ng-container>\n\n",
|
|
1086
|
+
styles: [":host{display:inline-flex;width:24px}fa-icon{vertical-align:middle}.faIconWrapper{text-align:center;width:24px;height:24px}.svgIcon{width:24px;height:24px}:host(.mat-chip-remove) mat-icon{font-size:18px}mat-icon{width:inherit;height:inherit}"]
|
|
1087
|
+
})
|
|
1088
|
+
], IconComponent);
|
|
1089
|
+
|
|
851
1090
|
let NoopComponent = class NoopComponent {
|
|
852
1091
|
constructor() {
|
|
853
1092
|
}
|
|
@@ -1032,6 +1271,7 @@ class CellHeaderPortalRef extends CellPortalRef {
|
|
|
1032
1271
|
assert$1.isTruthy(host);
|
|
1033
1272
|
host[HEADER_CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
|
|
1034
1273
|
}
|
|
1274
|
+
// @Trace()
|
|
1035
1275
|
onPortalAttached(host, portalComponent) {
|
|
1036
1276
|
this.initialiseHeader(portalComponent, host.column);
|
|
1037
1277
|
}
|
|
@@ -1047,13 +1287,15 @@ class ComponentCellRendererPortalRef extends CellRendererPortalRef {
|
|
|
1047
1287
|
initialiseHost(host, columnModel) {
|
|
1048
1288
|
host[CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
|
|
1049
1289
|
}
|
|
1290
|
+
// @Trace()
|
|
1050
1291
|
onPortalAttached(host, portalComponent) {
|
|
1051
1292
|
host[PORTAL_RENDERER_COMPONENT] = portalComponent;
|
|
1052
|
-
this.updateComponent(portalComponent, host.getRowData());
|
|
1293
|
+
this.updateComponent(portalComponent, host.getRowData(), true);
|
|
1053
1294
|
}
|
|
1295
|
+
// @Trace()
|
|
1054
1296
|
pushState(host) {
|
|
1055
1297
|
if (host[PORTAL_RENDERER_COMPONENT]) {
|
|
1056
|
-
this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData());
|
|
1298
|
+
this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData(), false);
|
|
1057
1299
|
}
|
|
1058
1300
|
}
|
|
1059
1301
|
}
|
|
@@ -1090,6 +1332,7 @@ class TemplateCellRendererPortalRef extends CellRendererPortalRef {
|
|
|
1090
1332
|
onPortalAttached(host, portalComponent) {
|
|
1091
1333
|
// don't care
|
|
1092
1334
|
}
|
|
1335
|
+
// @Trace()
|
|
1093
1336
|
pushState(host) {
|
|
1094
1337
|
host[CELL_RENDERER_PORTAL] = this.createPortal(host.getRowData());
|
|
1095
1338
|
host.fillCell = this.fillCell;
|
|
@@ -1258,6 +1501,7 @@ SelectHeaderCellRendererComponent = __decorate([
|
|
|
1258
1501
|
const noop = () => {
|
|
1259
1502
|
};
|
|
1260
1503
|
const ɵ0 = noop;
|
|
1504
|
+
const CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol("aup-cell-renderer:row-data-cache");
|
|
1261
1505
|
class ColumnModel {
|
|
1262
1506
|
constructor(columnId, defaults) {
|
|
1263
1507
|
this.columnId = columnId;
|
|
@@ -1346,21 +1590,62 @@ __decorate([
|
|
|
1346
1590
|
__metadata("design:returntype", Object)
|
|
1347
1591
|
], ColumnModel.prototype, "getColumnTextProperties", null);
|
|
1348
1592
|
class PropertyColumnModel extends ColumnModel {
|
|
1349
|
-
constructor(property, defaults) {
|
|
1350
|
-
super(
|
|
1593
|
+
constructor(id, property, defaults) {
|
|
1594
|
+
super(id, defaults);
|
|
1351
1595
|
this.property = property;
|
|
1352
1596
|
this._format = (value) => value;
|
|
1353
1597
|
this.cellRenderer(DefaultCellRendererComponent);
|
|
1354
1598
|
}
|
|
1355
|
-
cellRenderer(componentType) {
|
|
1356
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
|
|
1599
|
+
cellRenderer(componentType, onComponentInitOrOptions) {
|
|
1600
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
1601
|
+
if (firstTime) {
|
|
1602
|
+
if (___default.isFunction(onComponentInitOrOptions)) {
|
|
1603
|
+
onComponentInitOrOptions(component);
|
|
1604
|
+
}
|
|
1605
|
+
else {
|
|
1606
|
+
if (___default.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
|
|
1607
|
+
onComponentInitOrOptions.onComponentInit(component);
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1357
1611
|
component.value = this._format(rowData.row[this.property]);
|
|
1612
|
+
if (!___default.isFunction(onComponentInitOrOptions) && ___default.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
|
|
1613
|
+
onComponentInitOrOptions.onRowUpdate(component, rowData.row);
|
|
1614
|
+
}
|
|
1358
1615
|
}));
|
|
1359
1616
|
return this;
|
|
1360
1617
|
}
|
|
1361
|
-
|
|
1618
|
+
mutableCellRenderer(componentType, options) {
|
|
1619
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
1620
|
+
// keep a local copy most recent row value so it's available to teh
|
|
1621
|
+
// edit callback without having to add/remove subscribers all the time.
|
|
1622
|
+
component[CELL_RENDERER_COMPONENT_ROW_CACHE] = rowData.row;
|
|
1623
|
+
let disableEditCallback = false;
|
|
1624
|
+
if (firstTime) {
|
|
1625
|
+
if (___default.isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
|
|
1626
|
+
options.onComponentInit(component);
|
|
1627
|
+
}
|
|
1628
|
+
// install our edit callback
|
|
1629
|
+
component.onValueEdited((is, was) => {
|
|
1630
|
+
if (!disableEditCallback) {
|
|
1631
|
+
options.onValueEdit(component[CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
// now push the value the component and disable the callback just incase the component misbehaves
|
|
1636
|
+
// and fires a value change during the operation.
|
|
1637
|
+
disableEditCallback = true;
|
|
1638
|
+
component.value = rowData.row[this.property];
|
|
1639
|
+
disableEditCallback = false;
|
|
1640
|
+
if (!___default.isFunction(options) && ___default.isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
|
|
1641
|
+
options.onRowUpdate(component, rowData.row);
|
|
1642
|
+
}
|
|
1643
|
+
}));
|
|
1644
|
+
return this;
|
|
1645
|
+
}
|
|
1646
|
+
cellEditor(editor, validatorsOrInitialiser, onComponentInit) {
|
|
1362
1647
|
const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
|
|
1363
|
-
const initialiser = ___default.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser :
|
|
1648
|
+
const initialiser = ___default.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
|
|
1364
1649
|
this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
|
|
1365
1650
|
const formValueModel = editSession.form.pluck(this.property);
|
|
1366
1651
|
if (validators) {
|
|
@@ -1383,8 +1668,8 @@ class PropertyColumnModel extends ColumnModel {
|
|
|
1383
1668
|
}
|
|
1384
1669
|
}
|
|
1385
1670
|
class ListPropertyColumnModel extends ColumnModel {
|
|
1386
|
-
constructor(property, defaults) {
|
|
1387
|
-
super(
|
|
1671
|
+
constructor(id, property, defaults) {
|
|
1672
|
+
super(id, defaults);
|
|
1388
1673
|
this.property = property;
|
|
1389
1674
|
this._format = (value) => value.map(v => v === null || v === void 0 ? void 0 : v.toString()).join(', ');
|
|
1390
1675
|
this.cellRenderer(DefaultCellRendererComponent);
|
|
@@ -1425,9 +1710,22 @@ class CustomValueColumnModel extends ColumnModel {
|
|
|
1425
1710
|
this.getValue = getValue;
|
|
1426
1711
|
this.cellRenderer(DefaultCellRendererComponent);
|
|
1427
1712
|
}
|
|
1428
|
-
cellRenderer(componentType) {
|
|
1429
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
|
|
1713
|
+
cellRenderer(componentType, onComponentInitOrOptions) {
|
|
1714
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
1715
|
+
if (firstTime) {
|
|
1716
|
+
if (___default.isFunction(onComponentInitOrOptions)) {
|
|
1717
|
+
onComponentInitOrOptions(component);
|
|
1718
|
+
}
|
|
1719
|
+
else {
|
|
1720
|
+
if (___default.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
|
|
1721
|
+
onComponentInitOrOptions.onComponentInit(component);
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1430
1725
|
component.value = this.getValue(rowData.row);
|
|
1726
|
+
if (!___default.isFunction(onComponentInitOrOptions) && ___default.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
|
|
1727
|
+
onComponentInitOrOptions.onRowUpdate(component, rowData.row);
|
|
1728
|
+
}
|
|
1431
1729
|
}));
|
|
1432
1730
|
return this;
|
|
1433
1731
|
}
|
|
@@ -1600,7 +1898,7 @@ let TableModel = TableModel_1 = class TableModel {
|
|
|
1600
1898
|
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
1601
1899
|
this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();
|
|
1602
1900
|
this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(this._columns).findIndex(column => column.isRowSelectionExplicitlyEnabled()).isGreaterThanOrEqualTo(0);
|
|
1603
|
-
this.addRowClass(
|
|
1901
|
+
this.addRowClass('enable-hover', () => this.isRowSelectionEnabled());
|
|
1604
1902
|
}
|
|
1605
1903
|
static fromList(sourceOfTruth, builder) {
|
|
1606
1904
|
const model = new TableModel_1(sourceOfTruth);
|
|
@@ -1618,11 +1916,11 @@ let TableModel = TableModel_1 = class TableModel {
|
|
|
1618
1916
|
get columns() {
|
|
1619
1917
|
return this._columns.readonly;
|
|
1620
1918
|
}
|
|
1621
|
-
pluck(property) {
|
|
1622
|
-
return this.addColumn(new PropertyColumnModel(property, this));
|
|
1919
|
+
pluck(property, options) {
|
|
1920
|
+
return this.addColumn(new PropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
|
|
1623
1921
|
}
|
|
1624
|
-
pluckList(property) {
|
|
1625
|
-
return this.addColumn(new ListPropertyColumnModel(property, this));
|
|
1922
|
+
pluckList(property, options) {
|
|
1923
|
+
return this.addColumn(new ListPropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
|
|
1626
1924
|
}
|
|
1627
1925
|
addSelectionColumn(selectionModel) {
|
|
1628
1926
|
assert.isNil(this.selectionColumnModel);
|
|
@@ -1636,6 +1934,9 @@ let TableModel = TableModel_1 = class TableModel {
|
|
|
1636
1934
|
addCustomColumn(columnId, dataAccessor) {
|
|
1637
1935
|
return this.addColumn(new CustomValueColumnModel(columnId, this, dataAccessor));
|
|
1638
1936
|
}
|
|
1937
|
+
addComponentColumn(columnId, component, onComponentInitOrOptions) {
|
|
1938
|
+
return this.addColumn(new CustomValueColumnModel(columnId, this, row => row)).cellRenderer(component, onComponentInitOrOptions);
|
|
1939
|
+
}
|
|
1639
1940
|
addTemplateColumn(columnId) {
|
|
1640
1941
|
return this.addColumn(new CustomTemplateColumnModel(columnId, this));
|
|
1641
1942
|
}
|
|
@@ -2040,90 +2341,6 @@ VerticalFocusContainerComponent = __decorate([
|
|
|
2040
2341
|
__metadata("design:paramtypes", [FocusManager])
|
|
2041
2342
|
], VerticalFocusContainerComponent);
|
|
2042
2343
|
|
|
2043
|
-
let MultipleSelectInputComponent = class MultipleSelectInputComponent extends AbstractListInputComponent {
|
|
2044
|
-
constructor() {
|
|
2045
|
-
super();
|
|
2046
|
-
this.optionLabelFormat = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;
|
|
2047
|
-
}
|
|
2048
|
-
ngOnInit() {
|
|
2049
|
-
}
|
|
2050
|
-
};
|
|
2051
|
-
__decorate([
|
|
2052
|
-
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
2053
|
-
__metadata("design:type", Object)
|
|
2054
|
-
], MultipleSelectInputComponent.prototype, "listModel", void 0);
|
|
2055
|
-
__decorate([
|
|
2056
|
-
Input(), TrackExternal(),
|
|
2057
|
-
__metadata("design:type", ListModel)
|
|
2058
|
-
], MultipleSelectInputComponent.prototype, "optionsModel", void 0);
|
|
2059
|
-
__decorate([
|
|
2060
|
-
Input(), StoreInListModel('optionsModel'),
|
|
2061
|
-
__metadata("design:type", Array)
|
|
2062
|
-
], MultipleSelectInputComponent.prototype, "options", void 0);
|
|
2063
|
-
__decorate([
|
|
2064
|
-
Input(),
|
|
2065
|
-
__metadata("design:type", Object)
|
|
2066
|
-
], MultipleSelectInputComponent.prototype, "optionLabel", void 0);
|
|
2067
|
-
__decorate([
|
|
2068
|
-
Input(),
|
|
2069
|
-
__metadata("design:type", Boolean)
|
|
2070
|
-
], MultipleSelectInputComponent.prototype, "allowNil", void 0);
|
|
2071
|
-
__decorate([
|
|
2072
|
-
ContentChild('optionTemplate'),
|
|
2073
|
-
__metadata("design:type", TemplateRef)
|
|
2074
|
-
], MultipleSelectInputComponent.prototype, "optionTemplateRef", void 0);
|
|
2075
|
-
__decorate([
|
|
2076
|
-
ContentChild('nilOptionTemplate'),
|
|
2077
|
-
__metadata("design:type", TemplateRef)
|
|
2078
|
-
], MultipleSelectInputComponent.prototype, "nilOptionTemplateRef", void 0);
|
|
2079
|
-
__decorate([
|
|
2080
|
-
Input(),
|
|
2081
|
-
__metadata("design:type", Function)
|
|
2082
|
-
], MultipleSelectInputComponent.prototype, "optionLabelFormat", void 0);
|
|
2083
|
-
MultipleSelectInputComponent = __decorate([
|
|
2084
|
-
Component({
|
|
2085
|
-
selector: 'aup-multiple-select-input',
|
|
2086
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n multiple\n [(ngModel)]=\"listModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
2087
|
-
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
2088
|
-
}),
|
|
2089
|
-
__metadata("design:paramtypes", [])
|
|
2090
|
-
], MultipleSelectInputComponent);
|
|
2091
|
-
|
|
2092
|
-
let IconComponent = class IconComponent {
|
|
2093
|
-
set icon(iconName) {
|
|
2094
|
-
this._icon = iconName;
|
|
2095
|
-
if (!iconName) {
|
|
2096
|
-
this.errorMessage = 'icon is nil';
|
|
2097
|
-
this.prefix = undefined;
|
|
2098
|
-
return;
|
|
2099
|
-
}
|
|
2100
|
-
const colonIndex = iconName.indexOf(':');
|
|
2101
|
-
if (colonIndex > 0) {
|
|
2102
|
-
this.prefix = this.icon.slice(0, colonIndex);
|
|
2103
|
-
this.suffix = this.icon.slice(colonIndex + 1);
|
|
2104
|
-
}
|
|
2105
|
-
if (this.prefix) {
|
|
2106
|
-
this.errorMessage = `Unknown icon "${iconName}"`;
|
|
2107
|
-
}
|
|
2108
|
-
this.errorMessage = `Unknown icon prefix "${this.prefix}"`;
|
|
2109
|
-
}
|
|
2110
|
-
get icon() {
|
|
2111
|
-
return this._icon;
|
|
2112
|
-
}
|
|
2113
|
-
};
|
|
2114
|
-
__decorate([
|
|
2115
|
-
Input(),
|
|
2116
|
-
__metadata("design:type", String),
|
|
2117
|
-
__metadata("design:paramtypes", [String])
|
|
2118
|
-
], IconComponent.prototype, "icon", null);
|
|
2119
|
-
IconComponent = __decorate([
|
|
2120
|
-
Component({
|
|
2121
|
-
selector: 'aup-icon',
|
|
2122
|
-
template: "<ng-container [ngSwitch]=\"prefix\">\n\n <mat-icon *ngSwitchCase=\"'svg'\"\n [svgIcon]=\"suffix\"\n class=\"svgIcon\">\n </mat-icon>\n\n <mat-icon *ngSwitchCase=\"'mat'\">\n {{suffix}}\n </mat-icon>\n\n <div *ngSwitchCase=\"'fab'\"\n class=\"faIconWrapper\">\n <fa-icon [icon]=\"suffix\">\n </fa-icon>\n </div>\n\n <mat-icon *ngSwitchDefault\n [matTooltip]=\"errorMessage\">\n bug_report\n </mat-icon>\n\n</ng-container>\n\n",
|
|
2123
|
-
styles: [":host{display:inline-flex;width:24px}fa-icon{vertical-align:middle}.faIconWrapper{text-align:center;width:24px;height:24px}.svgIcon{width:24px;height:24px}:host(.mat-chip-remove) mat-icon{font-size:18px}mat-icon{width:inherit;height:inherit}"]
|
|
2124
|
-
})
|
|
2125
|
-
], IconComponent);
|
|
2126
|
-
|
|
2127
2344
|
let ComponentsModule = class ComponentsModule {
|
|
2128
2345
|
constructor(faIconLibrary) {
|
|
2129
2346
|
faIconLibrary.addIconPacks(fas);
|
|
@@ -2143,6 +2360,8 @@ ComponentsModule = __decorate([
|
|
|
2143
2360
|
TextInputComponent,
|
|
2144
2361
|
PasswordInputComponent,
|
|
2145
2362
|
SelectInputComponent,
|
|
2363
|
+
MultipleSelectInputComponent,
|
|
2364
|
+
AutocompleteInputComponent,
|
|
2146
2365
|
CheckboxInputComponent,
|
|
2147
2366
|
ScrollContainerComponent,
|
|
2148
2367
|
NoopComponent,
|
|
@@ -2162,7 +2381,6 @@ ComponentsModule = __decorate([
|
|
|
2162
2381
|
SelectHeaderCellRendererComponent,
|
|
2163
2382
|
DefaultHeaderCellRendererComponent,
|
|
2164
2383
|
TableHeaderCellRendererComponent,
|
|
2165
|
-
MultipleSelectInputComponent,
|
|
2166
2384
|
IconComponent,
|
|
2167
2385
|
SectionHeaderComponent
|
|
2168
2386
|
],
|
|
@@ -2182,7 +2400,8 @@ ComponentsModule = __decorate([
|
|
|
2182
2400
|
PortalModule,
|
|
2183
2401
|
CdkScrollableModule,
|
|
2184
2402
|
FontAwesomeModule,
|
|
2185
|
-
MatTooltipModule
|
|
2403
|
+
MatTooltipModule,
|
|
2404
|
+
MatAutocompleteModule
|
|
2186
2405
|
],
|
|
2187
2406
|
exports: [
|
|
2188
2407
|
NumberInputComponent,
|
|
@@ -2191,6 +2410,8 @@ ComponentsModule = __decorate([
|
|
|
2191
2410
|
PasswordInputComponent,
|
|
2192
2411
|
CheckboxInputComponent,
|
|
2193
2412
|
SelectInputComponent,
|
|
2413
|
+
MultipleSelectInputComponent,
|
|
2414
|
+
AutocompleteInputComponent,
|
|
2194
2415
|
ScrollContainerComponent,
|
|
2195
2416
|
NoopComponent,
|
|
2196
2417
|
SwitchCaseComponent,
|
|
@@ -2203,12 +2424,23 @@ ComponentsModule = __decorate([
|
|
|
2203
2424
|
TableComponent,
|
|
2204
2425
|
EditRowControls,
|
|
2205
2426
|
ColumnTemplateDirective,
|
|
2206
|
-
MultipleSelectInputComponent,
|
|
2207
2427
|
IconComponent,
|
|
2208
2428
|
SectionHeaderComponent
|
|
2209
2429
|
],
|
|
2210
2430
|
providers: [
|
|
2211
|
-
FocusBindingFactory
|
|
2431
|
+
FocusBindingFactory
|
|
2432
|
+
// {
|
|
2433
|
+
// provide: CELL_EDITOR_REGISTRATION, useValue: {
|
|
2434
|
+
// type: 'string',
|
|
2435
|
+
// editorClass: StringInputComponent
|
|
2436
|
+
// }, multi: true
|
|
2437
|
+
// },
|
|
2438
|
+
// {
|
|
2439
|
+
// provide: CELL_EDITOR_REGISTRATION, useValue: {
|
|
2440
|
+
// type: 'number',
|
|
2441
|
+
// editorClass: NumberInputComponent
|
|
2442
|
+
// }, multi: true
|
|
2443
|
+
// }
|
|
2212
2444
|
]
|
|
2213
2445
|
}),
|
|
2214
2446
|
__metadata("design:paramtypes", [FaIconLibrary])
|
|
@@ -2581,6 +2813,7 @@ let ActivityContainerComponent = class ActivityContainerComponent extends Abstra
|
|
|
2581
2813
|
registerDisposable(disposable) {
|
|
2582
2814
|
return this.garbage.registerDisposable(disposable);
|
|
2583
2815
|
}
|
|
2816
|
+
// @Trace()
|
|
2584
2817
|
dispose() {
|
|
2585
2818
|
// TODO: think about auto cancelling any outstanding activity on dispose.
|
|
2586
2819
|
// See NavigationState.Navigating for a use-case.
|
|
@@ -2720,12 +2953,6 @@ __decorate([
|
|
|
2720
2953
|
ViewChildren(ActivityOutletComponent),
|
|
2721
2954
|
__metadata("design:type", QueryList)
|
|
2722
2955
|
], ActivityContainerComponent.prototype, "activityOutlets", void 0);
|
|
2723
|
-
__decorate([
|
|
2724
|
-
Trace(),
|
|
2725
|
-
__metadata("design:type", Function),
|
|
2726
|
-
__metadata("design:paramtypes", []),
|
|
2727
|
-
__metadata("design:returntype", void 0)
|
|
2728
|
-
], ActivityContainerComponent.prototype, "dispose", null);
|
|
2729
2956
|
ActivityContainerComponent = __decorate([
|
|
2730
2957
|
Component({
|
|
2731
2958
|
selector: 'aup-activity-container',
|
|
@@ -3712,7 +3939,7 @@ let PlaceComponent = PlaceComponent_1 = class PlaceComponent extends DisposableC
|
|
|
3712
3939
|
assert.isNil(this.visitModel.value);
|
|
3713
3940
|
const { when } = Dsl.disposeWith(this);
|
|
3714
3941
|
this.visitModel.value = visit;
|
|
3715
|
-
DebugContext.
|
|
3942
|
+
DebugContext.getOrCreate(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);
|
|
3716
3943
|
this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));
|
|
3717
3944
|
when.valueOf(this.visitModel).changes((current, previous) => {
|
|
3718
3945
|
notifyVisitChanged(current, previous);
|
|
@@ -4752,70 +4979,6 @@ UrlService = __decorate([
|
|
|
4752
4979
|
__metadata("design:paramtypes", [Router, Location, UrlSerializer])
|
|
4753
4980
|
], UrlService);
|
|
4754
4981
|
|
|
4755
|
-
class Visit {
|
|
4756
|
-
constructor(placeDefinition, visitParameters = {}) {
|
|
4757
|
-
this.placeDefinition = placeDefinition;
|
|
4758
|
-
this.visitParameters = visitParameters;
|
|
4759
|
-
}
|
|
4760
|
-
// @Trace()
|
|
4761
|
-
getRouteId() {
|
|
4762
|
-
return this.placeDefinition.getRouteIdFrom(this);
|
|
4763
|
-
}
|
|
4764
|
-
// @Trace()
|
|
4765
|
-
hasRouteId() {
|
|
4766
|
-
return !isNil(this.getRouteId());
|
|
4767
|
-
}
|
|
4768
|
-
/**
|
|
4769
|
-
* Returns the value of the place parameter with the specified name. The parameter
|
|
4770
|
-
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
4771
|
-
* same as the the ValueModel property name.
|
|
4772
|
-
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
4773
|
-
*/
|
|
4774
|
-
getParameter(parameterName) {
|
|
4775
|
-
return this.visitParameters[parameterName];
|
|
4776
|
-
}
|
|
4777
|
-
// @Trace()
|
|
4778
|
-
hasParameter(parameterName) {
|
|
4779
|
-
return Object.keys(this.visitParameters).includes(parameterName);
|
|
4780
|
-
}
|
|
4781
|
-
replace(parameter, value) {
|
|
4782
|
-
return new Visit(this.placeDefinition, Object.assign(Object.assign({}, this.visitParameters), { [parameter.name]: value }));
|
|
4783
|
-
}
|
|
4784
|
-
mergeRouteParameters(routeParams) {
|
|
4785
|
-
// todo: whitelist parameters.
|
|
4786
|
-
const routeParameterKeys = Object.keys(routeParams);
|
|
4787
|
-
const params = {};
|
|
4788
|
-
this.placeDefinition.getVisitParameterDefs().forEach(def => {
|
|
4789
|
-
if (def.isRouteId || def.isRouteParameter) {
|
|
4790
|
-
if (routeParameterKeys.includes(def.name)) {
|
|
4791
|
-
params[def.name] = routeParams[def.name];
|
|
4792
|
-
}
|
|
4793
|
-
}
|
|
4794
|
-
else {
|
|
4795
|
-
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
4796
|
-
// defaults and remember sanitisation process.
|
|
4797
|
-
const value = this.getParameter(def.name);
|
|
4798
|
-
if (this.hasParameter(def.name)) {
|
|
4799
|
-
params[def.name] = value;
|
|
4800
|
-
}
|
|
4801
|
-
}
|
|
4802
|
-
});
|
|
4803
|
-
return new Visit(this.placeDefinition, params);
|
|
4804
|
-
}
|
|
4805
|
-
hasRoutingChangedFrom(other) {
|
|
4806
|
-
const samePlace = other.placeDefinition === this.placeDefinition;
|
|
4807
|
-
const sameRouteParameters = isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
|
|
4808
|
-
return !samePlace || !sameRouteParameters;
|
|
4809
|
-
}
|
|
4810
|
-
hasChangedFrom(other) {
|
|
4811
|
-
const sameNonRouteParameters = isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
4812
|
-
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
4813
|
-
}
|
|
4814
|
-
toDebugString() {
|
|
4815
|
-
return Object.keys(this.visitParameters).map(k => `${k}=${this.visitParameters[k]}`).join(",");
|
|
4816
|
-
}
|
|
4817
|
-
}
|
|
4818
|
-
|
|
4819
4982
|
let PlaceRouter = class PlaceRouter extends GarbageCollector {
|
|
4820
4983
|
constructor(angularRouter, angularLocation, interactionService, urlService, placeHistory) {
|
|
4821
4984
|
super();
|
|
@@ -4977,6 +5140,7 @@ let PlaceRouter = class PlaceRouter extends GarbageCollector {
|
|
|
4977
5140
|
get activeVisits() {
|
|
4978
5141
|
return this._activeVisits.readonly;
|
|
4979
5142
|
}
|
|
5143
|
+
// @Trace()
|
|
4980
5144
|
pushVisitChangesToRoute(previous, next) {
|
|
4981
5145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4982
5146
|
this.placeHistory.updateVisit(next);
|
|
@@ -5073,12 +5237,6 @@ PlaceRouter.ctorParameters = () => [
|
|
|
5073
5237
|
{ type: PlaceHistory }
|
|
5074
5238
|
];
|
|
5075
5239
|
PlaceRouter.ɵprov = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router), ɵɵinject(Location), ɵɵinject(InteractionService), ɵɵinject(UrlService), ɵɵinject(PlaceHistory)); }, token: PlaceRouter, providedIn: "root" });
|
|
5076
|
-
__decorate([
|
|
5077
|
-
Trace(),
|
|
5078
|
-
__metadata("design:type", Function),
|
|
5079
|
-
__metadata("design:paramtypes", [Visit, Visit]),
|
|
5080
|
-
__metadata("design:returntype", Promise)
|
|
5081
|
-
], PlaceRouter.prototype, "pushVisitChangesToRoute", null);
|
|
5082
5240
|
PlaceRouter = __decorate([
|
|
5083
5241
|
Injectable({
|
|
5084
5242
|
providedIn: 'root'
|
|
@@ -5090,6 +5248,70 @@ PlaceRouter = __decorate([
|
|
|
5090
5248
|
PlaceHistory])
|
|
5091
5249
|
], PlaceRouter);
|
|
5092
5250
|
|
|
5251
|
+
class Visit {
|
|
5252
|
+
constructor(placeDefinition, visitParameters = {}) {
|
|
5253
|
+
this.placeDefinition = placeDefinition;
|
|
5254
|
+
this.visitParameters = visitParameters;
|
|
5255
|
+
}
|
|
5256
|
+
// @Trace()
|
|
5257
|
+
getRouteId() {
|
|
5258
|
+
return this.placeDefinition.getRouteIdFrom(this);
|
|
5259
|
+
}
|
|
5260
|
+
// @Trace()
|
|
5261
|
+
hasRouteId() {
|
|
5262
|
+
return !isNil(this.getRouteId());
|
|
5263
|
+
}
|
|
5264
|
+
/**
|
|
5265
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
5266
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
5267
|
+
* same as the the ValueModel property name.
|
|
5268
|
+
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
5269
|
+
*/
|
|
5270
|
+
getParameter(parameterName) {
|
|
5271
|
+
return this.visitParameters[parameterName];
|
|
5272
|
+
}
|
|
5273
|
+
// @Trace()
|
|
5274
|
+
hasParameter(parameterName) {
|
|
5275
|
+
return Object.keys(this.visitParameters).includes(parameterName);
|
|
5276
|
+
}
|
|
5277
|
+
replace(parameter, value) {
|
|
5278
|
+
return new Visit(this.placeDefinition, Object.assign(Object.assign({}, this.visitParameters), { [parameter.name]: value }));
|
|
5279
|
+
}
|
|
5280
|
+
mergeRouteParameters(routeParams) {
|
|
5281
|
+
// todo: whitelist parameters.
|
|
5282
|
+
const routeParameterKeys = Object.keys(routeParams);
|
|
5283
|
+
const params = {};
|
|
5284
|
+
this.placeDefinition.getVisitParameterDefs().forEach(def => {
|
|
5285
|
+
if (def.isRouteId || def.isRouteParameter) {
|
|
5286
|
+
if (routeParameterKeys.includes(def.name)) {
|
|
5287
|
+
params[def.name] = routeParams[def.name];
|
|
5288
|
+
}
|
|
5289
|
+
}
|
|
5290
|
+
else {
|
|
5291
|
+
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
5292
|
+
// defaults and remember sanitisation process.
|
|
5293
|
+
const value = this.getParameter(def.name);
|
|
5294
|
+
if (this.hasParameter(def.name)) {
|
|
5295
|
+
params[def.name] = value;
|
|
5296
|
+
}
|
|
5297
|
+
}
|
|
5298
|
+
});
|
|
5299
|
+
return new Visit(this.placeDefinition, params);
|
|
5300
|
+
}
|
|
5301
|
+
hasRoutingChangedFrom(other) {
|
|
5302
|
+
const samePlace = other.placeDefinition === this.placeDefinition;
|
|
5303
|
+
const sameRouteParameters = isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
|
|
5304
|
+
return !samePlace || !sameRouteParameters;
|
|
5305
|
+
}
|
|
5306
|
+
hasChangedFrom(other) {
|
|
5307
|
+
const sameNonRouteParameters = isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
5308
|
+
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
5309
|
+
}
|
|
5310
|
+
toDebugString() {
|
|
5311
|
+
return Object.keys(this.visitParameters).map(k => `${k}=${this.visitParameters[k]}`).join(",");
|
|
5312
|
+
}
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5093
5315
|
const AUP_PLACE_CONFIG = new InjectionToken('AUP_PLACE_CONFIG');
|
|
5094
5316
|
|
|
5095
5317
|
// Freezes the state of the components at the start of the animation.
|
|
@@ -5975,8 +6197,7 @@ function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmp
|
|
|
5975
6197
|
binding: null
|
|
5976
6198
|
};
|
|
5977
6199
|
const tag = `${tagPrefix}(${prototype.constructor.name}.${propertyKey.toString()})`;
|
|
5978
|
-
DebugContext.
|
|
5979
|
-
Logger.get(mechanics.backingModel).tag(tag);
|
|
6200
|
+
DebugContext.getOrCreate(mechanics.backingModel).tag(tag);
|
|
5980
6201
|
Object.defineProperty(prototype, propertyKey, {
|
|
5981
6202
|
get: function () {
|
|
5982
6203
|
return mechanics.backingModel;
|
|
@@ -6038,5 +6259,5 @@ function VisitParameterList(options) {
|
|
|
6038
6259
|
* Generated bundle index. Do not edit.
|
|
6039
6260
|
*/
|
|
6040
6261
|
|
|
6041
|
-
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandDirective, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupInteractionContextComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TemplateCellRendererPortalRef, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0, DirectivesModule as ɵa, CommandDirective as ɵb,
|
|
6262
|
+
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandDirective, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupInteractionContextComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TemplateCellRendererPortalRef, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0, DirectivesModule as ɵa, CommandDirective as ɵb, CardContainerComponent as ɵba, TableComponent as ɵbb, EditRowControls as ɵbc, ColumnTemplateDirective as ɵbd, DefaultCellRendererComponent as ɵbe, TableCellRendererComponent as ɵbf, SelectCellRendererComponent as ɵbg, SelectHeaderCellRendererComponent as ɵbh, DefaultHeaderCellRendererComponent as ɵbi, TableHeaderCellRendererComponent as ɵbj, IconComponent as ɵbk, SectionHeaderComponent as ɵbl, PlaceModule as ɵbm, ComponentsModule as ɵbn, EmptyStateComponent as ɵbo, BusyOverlayComponent as ɵbp, PlaceOutletComponent as ɵbq, leftRightPlaceAnimation as ɵbr, LEFT_RIGHT_PLACE_ANIMATION as ɵbs, AUP_PLACE_CONFIG as ɵbt, PlaceRouter as ɵbv, InteractionService as ɵbw, ModalInteractionContextFactory as ɵbx, UrlService as ɵby, PlaceHistory as ɵbz, FocusBindingDirective as ɵc, TabbedPlaceNavigationComponent as ɵca, AbstractPlaceNavigationComponent as ɵcb, ListPlaceNavComponent as ɵcc, SidePlaceNavigationComponent as ɵcd, InteractionModule as ɵce, ActivityContainerComponent as ɵcf, AbstractInteractionContext as ɵcg, ActivityOutletComponent as ɵch, ConfirmationDialogComponent as ɵci, ACTIVITY_DATA as ɵcj, Activity as ɵck, ConfirmThenDialogComponent as ɵcm, AlertDialogComponent as ɵcn, InPlaceInteractionContextComponent as ɵcp, AddItemInteractionContextComponent as ɵcq, ActivityActionsComponent as ɵcr, PopupInteractionContextComponent as ɵcs, StringInputActivity as ɵct, AbstractInputActivity as ɵcu, SelectInputActivity as ɵcv, InteractionContextTriggerFor as ɵcw, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, AbstractInputComponent as ɵg, AbstractValueInputComponent as ɵh, AbstractListInputComponent as ɵi, NumberInputComponent as ɵj, StringInputComponent as ɵk, TextInputComponent as ɵl, PasswordInputComponent as ɵm, SelectInputComponent as ɵn, MultipleSelectInputComponent as ɵo, AutocompleteInputComponent as ɵp, CheckboxInputComponent as ɵq, ScrollContainerComponent as ɵr, NoopComponent as ɵs, SwitchCaseOption as ɵt, SwitchCaseWhenDirective as ɵu, SwitchCaseDefaultDirective as ɵv, SwitchCaseComponent as ɵw, FocusContainerComponent as ɵx, VerticalFocusContainerComponent as ɵy, FocusableComponent as ɵz };
|
|
6042
6263
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|