@coolon/angular-ui-powerups 3.10.3 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +17 -5
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/lib/components/busy-overlay/busy-overlay.component.js +3 -2
  8. package/esm2015/lib/components/busy-overlay/busy-overlay.component.js.map +1 -1
  9. package/esm2015/lib/components/busy-overlay/busy-overlay.component.metadata.json +1 -1
  10. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  11. package/esm2015/lib/components/switch-case/switch-case.component.js +3 -1
  12. package/esm2015/lib/components/switch-case/switch-case.component.js.map +1 -1
  13. package/esm2015/lib/components/table/column-model.js +7 -0
  14. package/esm2015/lib/components/table/column-model.js.map +1 -1
  15. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  16. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
  17. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  18. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -1
  19. package/esm2015/lib/components/table/table.component.js +2 -2
  20. package/esm2015/lib/components/table/table.component.js.map +1 -1
  21. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  22. package/fesm2015/coolon-angular-ui-powerups.js +96 -86
  23. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  24. package/lib/components/busy-overlay/busy-overlay.component.d.ts +2 -2
  25. package/lib/components/table/column-model.d.ts +3 -0
  26. package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +2 -2
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"switch-case.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/switch-case/switch-case.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,SAAS,EACT,KAAK,EAEL,SAAS,EACT,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,OAAgB,gBAAgB;IAIpC,YAAqB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IACrD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CAGF;AAMD,MAAM,OAAO,uBAA2B,SAAQ,gBAAmB;IAIjE,YAAY,WAAgC;QAC1C,KAAK,CAAC,WAAW,CAAC,CAAC;QAHZ,cAAS,GAAG,KAAK,CAAC;IAI3B,CAAC;IAED,OAAO,CAAC,KAAQ;QACd,OAAO,IAAI,CAAC,iBAAiB,KAAK,KAAK,CAAC;IAC1C,CAAC;;;YAdF,SAAS,SAAC;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;aACjF;;;YAxBC,WAAW;;;gCA0BV,KAAK;;AAgBR,MAAM,OAAO,0BAA8B,SAAQ,gBAAmB;IAGpE,YAAY,WAAgC;QAC1C,KAAK,CAAC,WAAW,CAAC,CAAC;QAHZ,cAAS,GAAG,IAAI,CAAC;IAI1B,CAAC;IAED,OAAO,CAAC,KAAQ;QACd,OAAO,KAAK,CAAC;IACf,CAAC;;;YAbF,SAAS,SAAC;gBACT,QAAQ,EAAE,wBAAwB;gBAClC,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CAA8C,CAAC,CAAC;SAC9F;QACD,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAC/C,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;YACH,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,MAAM,6CAA6C,CAAC,CAAC;aAC7F;SACF;QACD,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;SAC1C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;YAC1D,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;SACzB;IACH,CAAC;;;YAzDF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,+RAA2C;;aAE5C;;;YAlEC,iBAAiB;;;0BAqEhB,KAAK;qBAGL,KAAK;gCAGL,eAAe,SAAC,gBAAgB;;AALjC;IADU,aAAa,EAAE;8BACZ,UAAU;wDAAI;AAG3B;IADU,iBAAiB,CAAC,aAAa,CAAC;;mDAChC","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n Input,\n OnInit,\n QueryList,\n TemplateRef\n} from '@angular/core';\n\nimport { Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\n\n\nexport abstract class SwitchCaseOption<T> {\n\n abstract readonly isDefault: boolean;\n\n constructor(readonly templateRef: TemplateRef<Object>) {\n }\n\n get name() {\n return this.constructor.name;\n }\n\n abstract matches(value: T): boolean;\n}\n\n@Directive({\n selector: '[aupSwitchCaseWhen]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseWhenDirective }]\n})\nexport class SwitchCaseWhenDirective<T> extends SwitchCaseOption<T> {\n @Input() aupSwitchCaseWhen: T;\n readonly isDefault = false;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return this.aupSwitchCaseWhen === value;\n }\n}\n\n@Directive({\n selector: '[aupSwitchCaseDefault]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseDefaultDirective }]\n})\nexport class SwitchCaseDefaultDirective<T> extends SwitchCaseOption<T> {\n readonly isDefault = true;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return false;\n }\n}\n\n\n@Component({\n selector: 'aup-switch-case',\n templateUrl: './switch-case.component.html',\n styleUrls: ['./switch-case.component.scss']\n})\nexport class SwitchCaseComponent<T> extends DisposableComponent implements OnInit, AfterContentInit {\n\n @Input() @TrackExternal()\n switchModel: ValueModel<T>;\n\n @Input() @StoreInValueModel('switchModel')\n switch: T;\n\n @ContentChildren(SwitchCaseOption)\n switchCaseOptions: QueryList<SwitchCaseOption<T>>;\n\n selectedIndex = 0;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit(): void {\n }\n\n ngAfterContentInit(): void {\n const subscription = this.switchCaseOptions.changes.subscribe(change => this.updateSelection());\n this.onDispose(() => subscription.unsubscribe());\n const { chain, when } = Dsl.disposeWith(this);\n when(this.switchModel).changes(() => this.updateSelection(), { initialValue: 'triggerChange' });\n this.cdr.detectChanges();\n }\n\n private updateSelection() {\n const matchingIndicies = [];\n this.switchCaseOptions.forEach((option, index) => {\n if (option.matches(this.switchModel.value)) {\n matchingIndicies.push(index);\n }\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} matching case values, displaying the first.`);\n }\n if (matchingIndicies.length === 0) {\n this.switchCaseOptions.forEach((option, index) => {\n matchingIndicies.push(index);\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);\n }\n }\n if (matchingIndicies.length > 0) {\n this.selectedIndex = matchingIndicies[0];\n } else {\n console.warn(`found no matching or default case values.`);\n this.selectedIndex = -1;\n }\n }\n}\n\n"]}
1
+ {"version":3,"file":"switch-case.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/switch-case/switch-case.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,SAAS,EACT,KAAK,EAEL,SAAS,EACT,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,OAAgB,gBAAgB;IAIpC,YAAqB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IACrD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CAGF;AAMD,MAAM,OAAO,uBAA2B,SAAQ,gBAAmB;IAIjE,YAAY,WAAgC;QAC1C,KAAK,CAAC,WAAW,CAAC,CAAC;QAHZ,cAAS,GAAG,KAAK,CAAC;IAI3B,CAAC;IAED,OAAO,CAAC,KAAQ;QACd,OAAO,IAAI,CAAC,iBAAiB,KAAK,KAAK,CAAC;IAC1C,CAAC;;;YAdF,SAAS,SAAC;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;aACjF;;;YAxBC,WAAW;;;gCA0BV,KAAK;;AAgBR,MAAM,OAAO,0BAA8B,SAAQ,gBAAmB;IAGpE,YAAY,WAAgC;QAC1C,KAAK,CAAC,WAAW,CAAC,CAAC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C,KAAK,CAAC,CAAC;aAC9B;QACH,CAAC,CAAC,CAAC;QACH,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,OAAO,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,MAAM,8CAA8C,CAAC,CAAC;SAC9F;QACD,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAC/C,IAAI,MAAM,CAAC,SAAS,EAAE;oBACpB,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC9B;YACH,CAAC,CAAC,CAAC;YACH,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,MAAM,6CAA6C,CAAC,CAAC;aAC7F;SACF;QACD,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;SAC1C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;YAC1D,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;SACzB;IACH,CAAC;;;YA3DF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,+RAA2C;;aAE5C;;;YAlEC,iBAAiB;;;0BAqEhB,KAAK;qBAGL,KAAK;gCAGL,eAAe,SAAC,gBAAgB;;AALjC;IADU,aAAa,EAAE;8BACZ,UAAU;wDAAI;AAG3B;IADU,iBAAiB,CAAC,aAAa,CAAC;;mDAChC","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n Input,\n OnInit,\n QueryList,\n TemplateRef\n} from '@angular/core';\n\nimport { Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\n\n\nexport abstract class SwitchCaseOption<T> {\n\n abstract readonly isDefault: boolean;\n\n constructor(readonly templateRef: TemplateRef<Object>) {\n }\n\n get name() {\n return this.constructor.name;\n }\n\n abstract matches(value: T): boolean;\n}\n\n@Directive({\n selector: '[aupSwitchCaseWhen]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseWhenDirective }]\n})\nexport class SwitchCaseWhenDirective<T> extends SwitchCaseOption<T> {\n @Input() aupSwitchCaseWhen: T;\n readonly isDefault = false;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return this.aupSwitchCaseWhen === value;\n }\n}\n\n@Directive({\n selector: '[aupSwitchCaseDefault]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseDefaultDirective }]\n})\nexport class SwitchCaseDefaultDirective<T> extends SwitchCaseOption<T> {\n readonly isDefault = true;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return false;\n }\n}\n\n\n@Component({\n selector: 'aup-switch-case',\n templateUrl: './switch-case.component.html',\n styleUrls: ['./switch-case.component.scss']\n})\nexport class SwitchCaseComponent<T> extends DisposableComponent implements OnInit, AfterContentInit {\n\n @Input() @TrackExternal()\n switchModel: ValueModel<T>;\n\n @Input() @StoreInValueModel('switchModel')\n switch: T;\n\n @ContentChildren(SwitchCaseOption)\n switchCaseOptions: QueryList<SwitchCaseOption<T>>;\n\n selectedIndex = 0;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit(): void {\n }\n\n ngAfterContentInit(): void {\n const subscription = this.switchCaseOptions.changes.subscribe(change => this.updateSelection());\n this.onDispose(() => subscription.unsubscribe());\n const { chain, when } = Dsl.disposeWith(this);\n when(this.switchModel).changes(() => this.updateSelection(), { initialValue: 'triggerChange' });\n this.cdr.detectChanges();\n }\n\n private updateSelection() {\n const matchingIndicies = [];\n this.switchCaseOptions.forEach((option, index) => {\n if (option.matches(this.switchModel.value)) {\n matchingIndicies.push(index);\n }\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} matching case values, displaying the first.`);\n }\n if (matchingIndicies.length === 0) {\n this.switchCaseOptions.forEach((option, index) => {\n if (option.isDefault) {\n matchingIndicies.push(index);\n }\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);\n }\n }\n if (matchingIndicies.length > 0) {\n this.selectedIndex = matchingIndicies[0];\n } else {\n console.warn(`found no matching or default case values.`);\n this.selectedIndex = -1;\n }\n }\n}\n\n"]}
@@ -18,6 +18,7 @@ export class ColumnModel {
18
18
  this.columnId = columnId;
19
19
  this.textPropertiesProvider = textPropertiesProvider;
20
20
  this._selectRowOnClick = undefined;
21
+ this._flex = false;
21
22
  this.installHeaderRenderer();
22
23
  }
23
24
  installHeaderRenderer() {
@@ -52,6 +53,12 @@ export class ColumnModel {
52
53
  this.configureHeaderRenderer(new CellHeaderPortalRef(componentType, initialiser));
53
54
  return this;
54
55
  }
56
+ flex(flex = true) {
57
+ this._flex = flex;
58
+ }
59
+ isFlex() {
60
+ return this._flex;
61
+ }
55
62
  hasEditorPortal() {
56
63
  return !!this._cellEditorPortalRef;
57
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"column-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/table/column-model.ts"],"names":[],"mappings":";AAEA,OAAO,EAIL,sBAAsB,EAKvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EAEnB,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,4BAA4B,EAAE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cAAc,GAAG,cAAc,CAAC;QAC5C,CAAC,CAAC,CAAC,CAAC;IACN,CAAC;IAES,oBAAoB;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,8BAA8B;QAC5B,OAAO,IAAI,CAAC,+BAA+B,EAAE,CAAC;IAChD,CAAC;IAED,gBAAgB,CAAC,gBAAyB;QACxC,6EAA6E;QAC7E,wCAAwC;QACxC,OAAO,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAClD,CAAC;IAED,oBAAoB,CAAC,MAAe;QAClC,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,GAAQ;QAChB,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { TemplateRef, ViewContainerRef } from '@angular/core';\nimport {\n Command,\n DirtyTrackingForm,\n Disposable,\n MultipleSelectionModel,\n SelectionModel,\n Types,\n UnaryCommand,\n Validator\n} from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { CellEditorComponent, CellListEditorComponent } from './cell-editors';\nimport {\n CellEditorPortalRef,\n CellHeaderPortalRef,\n CellRendererPortalRef,\n ComponentCellRendererPortalRef,\n TemplateCellRendererPortalRef\n} from './cell-portal-ref';\nimport { CellRenderer } from './cell-renderer';\nimport { ColumnTextProperties } from './column-text-properties';\nimport { DefaultCellRendererComponent } from './default-cell-renderer/default-cell-renderer.component';\nimport { DefaultHeaderCellRendererComponent } from './default-header-cell-renderer/default-header-cell-renderer.component';\nimport { EditRowControls } from './edit-row-controls/edit-row-controls.component';\nimport { EditSession } from './edit-session';\nimport { MutableCellRenderer } from './mutable-cell-renderer';\nimport { SelectCellRendererComponent } from './select-cell-renderer/select-cell-renderer.component';\nimport { SelectHeaderCellRendererComponent } from './select-header-cell-renderer/select-header-cell-renderer.component';\nimport { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';\nimport { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';\n\n\nconst noop = () => {\n};\n\nexport interface RowData<Row> {\n row: Row;\n editSession?: EditSession<Row>;\n editRowCommand: Command<void>;\n}\n\nconst CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol(\"aup-cell-renderer:row-data-cache\")\n\nexport type OnComponentInit<C> = (component: C) => void;\n\nexport interface CellRendererOptions<Row, E> {\n onComponentInit?: (component: E) => void;\n onRowUpdate?: (component: E, row: Row) => void;\n}\n\n\nexport interface MutableCellRendererOptions<Row, E, P extends keyof Row> extends CellRendererOptions<Row, E> {\n onValueEdit: (row: Row, is: Row[P], was: Row[P]) => void;\n}\n\nexport class ColumnModel<Row> {\n\n private _columnTextProperties: ColumnTextProperties;\n\n private _columnHeaderPortalRef: CellHeaderPortalRef<Row, any>;\n private _cellRendererPortalRef: CellRendererPortalRef<Row, any>;\n private _cellEditorPortalRef: CellEditorPortalRef<Row, any>;\n\n private _selectRowOnClick = undefined;\n\n constructor(readonly columnId: string, private textPropertiesProvider: ColumnModel.TextPropertiesProvider) {\n this.installHeaderRenderer();\n }\n\n protected installHeaderRenderer() {\n this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, (component, column) => {\n component.headerText = column.getHeaderText();\n });\n }\n\n @Memoize()\n getHeaderText(): string {\n return this.getColumnTextProperties()?.headerText() || this.getDefaultHeaderText();\n }\n\n protected getDefaultHeaderText() {\n return this.columnId;\n }\n\n @Memoize()\n getColumnTextProperties(): ColumnTextProperties {\n return this._columnTextProperties || this.textPropertiesProvider();\n }\n\n textProperties(columnTextProperties: ColumnTextProperties): this {\n this._columnTextProperties = columnTextProperties;\n return this;\n }\n\n protected configureHeaderRenderer<C>(config: CellHeaderPortalRef<Row, any>): void {\n this._columnHeaderPortalRef = config;\n }\n\n protected configureCellRenderer<C>(config: CellRendererPortalRef<Row, any>): void {\n this._cellRendererPortalRef = config;\n }\n\n protected configureCellEditor<E>(cellEditor: CellEditorPortalRef<Row, E>): void {\n this._cellEditorPortalRef = cellEditor;\n }\n\n cellHeaderRenderer<C>(componentType: ComponentType<C>, initialiser: (component: C, column: ColumnModel<Row>) => void): this {\n this.configureHeaderRenderer(new CellHeaderPortalRef<Row, C>(componentType, initialiser));\n return this;\n }\n\n hasEditorPortal() {\n return !!this._cellEditorPortalRef;\n }\n\n attachHeaderCell(host: any) {\n this._columnHeaderPortalRef.initialiseHost(host, this);\n }\n\n attachCell(host: any) {\n this._cellRendererPortalRef.initialiseHost(host, this);\n if (this.hasEditorPortal()) {\n this._cellEditorPortalRef.initialiseHost(host, this);\n }\n }\n\n onHeaderAttached(host: TableHeaderCellRendererComponent, component: any) {\n this._columnHeaderPortalRef.onPortalAttached(host, component);\n }\n\n onRendererAttached(host: TableCellRendererComponent<Row>, component: any) {\n this._cellRendererPortalRef.onPortalAttached(host, component);\n }\n\n // @Trace()\n onEditorAttached(host: TableCellRendererComponent<Row>, component: any) {\n this._cellEditorPortalRef.onPortalAttached(host, component);\n }\n\n updatePortalContent(host: TableCellRendererComponent<Row>) {\n this._cellRendererPortalRef.pushState(host);\n }\n\n protected selectRowOnClick(selectOnRowClick: boolean): this {\n this._selectRowOnClick = selectOnRowClick;\n return this;\n }\n\n isRowSelectionEnabled(): boolean | undefined {\n return this._selectRowOnClick;\n }\n\n isRowSelectionExplicitlyEnabled(): boolean {\n return this._selectRowOnClick === true;\n }\n\n isRowSelectionExplicitlyDisabled(): boolean {\n return this._selectRowOnClick === false;\n }\n}\n\nexport namespace ColumnModel {\n export type TextPropertiesProvider = () => ColumnTextProperties\n}\n\n\nexport class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<Row>> extends ColumnModel<Row> {\n\n\n private _format: (value: Row[P]) => any = (value) => value;\n\n constructor(id: string, readonly property: P, defaults: ColumnModel.TextPropertiesProvider) {\n super(id, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this\n cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, onComponentInit?: OnComponentInit<E>): this\n cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, onComponentInitOrOptions?: CellRendererOptions<Row, E> | OnComponentInit<E>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n if (firstTime) {\n if (_.isFunction(onComponentInitOrOptions)) {\n onComponentInitOrOptions(component);\n } else {\n if (_.isFunction(onComponentInitOrOptions?.onComponentInit)) {\n onComponentInitOrOptions.onComponentInit(component);\n }\n }\n }\n component.value = this._format(rowData.row[this.property]);\n\n if (!_.isFunction(onComponentInitOrOptions) && _.isFunction(onComponentInitOrOptions?.onRowUpdate)) {\n onComponentInitOrOptions.onRowUpdate(component, rowData.row);\n }\n }));\n return this;\n }\n\n liveEditCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this {\n return this.mutableCellRenderer(componentType, options);\n }\n\n /**\n * Deprecated. Use #liveEditCellRenderer instead.\n * @param componentType\n * @param options\n */\n mutableCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this {\n\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n\n // keep a local copy most recent row value so it's available to teh\n // edit callback without having to add/remove subscribers all the time.\n component[CELL_RENDERER_COMPONENT_ROW_CACHE]= rowData.row;\n let disableEditCallback = false;\n\n if (firstTime) {\n if (_.isFunction(options?.onComponentInit)) {\n options.onComponentInit(component);\n }\n // install our edit callback\n component.onValueEdited((is, was) => {\n if (!disableEditCallback) {\n options.onValueEdit(component[CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);\n }\n });\n\n }\n\n // now push the value the component and disable the callback just incase the component misbehaves\n // and fires a value change during the operation.\n disableEditCallback = true;\n component.value = rowData.row[this.property];\n disableEditCallback = false;\n\n if (!_.isFunction(options) && _.isFunction(options?.onRowUpdate)) {\n options.onRowUpdate(component, rowData.row);\n }\n\n }));\n return this;\n }\n\n cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validators?: Validator<Row[P]>[], initialiseComponent?: (component: E) => void): this\n cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, initialiseComponent?: (component: E) => void): this\n cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validatorsOrInitialiser?: Validator<Row[P]>[] | ((component: E) => void), onComponentInit?: (component: E) => void): this {\n const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;\n const initialiser = _.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;\n this.configureCellEditor(new CellEditorPortalRef(editor, (component: E, editSession: EditSession<Row>) => {\n const formValueModel = editSession.form.pluck(this.property);\n if (validators) {\n formValueModel.validateUsing(validators);\n }\n component.valueModel = formValueModel;\n if (initialiser) {\n initialiser(component);\n }\n }));\n return this;\n }\n\n format(formatter: (value: Row[P]) => any): this {\n assert.isFunction(formatter);\n this._format = formatter;\n return this;\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class ListPropertyColumnModel<Row, P extends Types.ArrayPropertiesOf<Row>> extends ColumnModel<Row> {\n\n private _format: (value: Types.ArrayElementType<Row, P>[]) => any = (value) => value.map(v => v?.toString()).join(', ');\n\n constructor(id: string, readonly property: P, defaults: ColumnModel.TextPropertiesProvider) {\n super(id, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer(componentType: ComponentType<{ value: Types.ArrayElementType<Row, P>[] }>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {\n component.value = this._format(rowData.row[this.property]);\n }));\n return this;\n }\n\n cellEditor<C extends CellListEditorComponent<Types.ArrayElementType<Row, P>>>(editor: ComponentType<C>, validators?: Validator<Types.ArrayElementType<Row, P>[]>[], initialiseComponent?: (component: C) => void): this\n cellEditor<C extends CellListEditorComponent<Types.ArrayElementType<Row, P>>>(editor: ComponentType<C>, initialiseComponent?: (component: C) => void): this\n cellEditor<C extends CellListEditorComponent<Types.ArrayElementType<Row, P>>>(editor: ComponentType<C>, validatorsOrInitialiser?: Validator<Types.ArrayElementType<Row, P>[]>[] | ((component: C) => void), initialiseComponent?: (component: C) => void): this {\n const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;\n const initialiser = _.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;\n\n this.configureCellEditor(new CellEditorPortalRef(editor, (component: C, editSession: EditSession<Row>) => {\n const formListModel = editSession.form.pluckList(this.property);\n if (validators) {\n formListModel.validateUsing(validators);\n }\n component.listModel = formListModel;\n if (initialiser) {\n initialiser(component);\n }\n }));\n return this;\n }\n\n format(formatter: (value: Types.ArrayElementType<Row, P>[]) => any): this {\n assert.isFunction(formatter);\n this._format = formatter;\n return this;\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class CustomValueColumnModel<Row, V> extends ColumnModel<Row> {\n constructor(columnId: string, defaults: ColumnModel.TextPropertiesProvider, private getValue: (row: Row) => V) {\n super(columnId, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer<C extends { value: V }>(componentType: ComponentType<C>, onComponentInitOrOptions?: CellRendererOptions<Row, C> | OnComponentInit<C>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n if (firstTime) {\n if (_.isFunction(onComponentInitOrOptions)) {\n onComponentInitOrOptions(component);\n } else {\n if (_.isFunction(onComponentInitOrOptions?.onComponentInit)) {\n onComponentInitOrOptions.onComponentInit(component);\n }\n }\n }\n component.value = this.getValue(rowData.row);\n\n if (!_.isFunction(onComponentInitOrOptions) && _.isFunction(onComponentInitOrOptions?.onRowUpdate)) {\n onComponentInitOrOptions.onRowUpdate(component, rowData.row);\n }\n }));\n return this;\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class EditorControlColumnModel<Row> extends ColumnModel<Row> {\n\n constructor(columnId: string, saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>, defaults: ColumnModel.TextPropertiesProvider) {\n super(columnId, defaults);\n this.cellRenderer(EditRowControls);\n }\n\n cellRenderer(componentType: ComponentType<{ row: Row, editSession: EditSession<Row>, editRowCommand: Command<void> }>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData: RowData<Row>) => {\n component.row = rowData.row;\n component.editSession = rowData.editSession;\n component.editRowCommand = rowData.editRowCommand;\n }));\n return this;\n }\n\n protected getDefaultHeaderText(): string {\n return '';\n }\n}\n\nexport class CustomTemplateColumnModel<Row> extends ColumnModel<Row> {\n private readonly config = new TemplateCellRendererPortalRef<Row>();\n\n constructor(columnId: string, defaults: ColumnModel.TextPropertiesProvider) {\n super(columnId, defaults);\n this.configureCellRenderer(this.config);\n }\n\n setTemplate(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n this.config.registerPortal(templateRef, viewContainer, fillCell, padChild);\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class SelectionColumnModel<Row> extends ColumnModel<Row> {\n\n private _enableHeaderControls = true;\n\n constructor(columnId: string, defaults: ColumnModel.TextPropertiesProvider, readonly selectionModel: SelectionModel<Row>) {\n super(columnId, defaults);\n this.selectOnRowClick(false);\n if (selectionModel instanceof MultipleSelectionModel) {\n this.cellHeaderRenderer(SelectHeaderCellRendererComponent, (component) => {\n component.selectionModel = selectionModel;\n component.enableHeaderControls = this._enableHeaderControls;\n });\n }\n this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectCellRendererComponent, (component, rowData: RowData<Row>) => {\n component.row = rowData.row;\n component.selectionModel = selectionModel;\n }));\n }\n\n protected getDefaultHeaderText(): string {\n return '';\n }\n\n isRowSelectionEnabledByDefault(): boolean | undefined {\n return this.isRowSelectionExplicitlyEnabled();\n }\n\n selectOnRowClick(selectOnRowClick: boolean): this {\n // note we're using different method name as the selection column treats this\n // state as the default for all columns.\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n enableHeaderControls(enable: boolean): this {\n this._enableHeaderControls = enable;\n return this;\n }\n\n selectRow(row: Row) {\n this.selectionModel.selectCommand.execute(row);\n }\n}\n\n\n"]}
1
+ {"version":3,"file":"column-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/table/column-model.ts"],"names":[],"mappings":";AAEA,OAAO,EAIL,sBAAsB,EAKvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EAEnB,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AACvG,OAAO,EAAE,kCAAkC,EAAE,MAAM,uEAAuE,CAAC;AAC3H,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAGlF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAE,iCAAiC,EAAE,MAAM,qEAAqE,CAAC;AAKxH,MAAM,IAAI,GAAG,GAAG,EAAE;AAClB,CAAC,CAAC;;AA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C;IAED,8BAA8B;QAC5B,OAAO,IAAI,CAAC,+BAA+B,EAAE,CAAC;IAChD,CAAC;IAED,gBAAgB,CAAC,gBAAyB;QACxC,6EAA6E;QAC7E,wCAAwC;QACxC,OAAO,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAClD,CAAC;IAED,oBAAoB,CAAC,MAAe;QAClC,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,GAAQ;QAChB,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { TemplateRef, ViewContainerRef } from '@angular/core';\nimport {\n Command,\n DirtyTrackingForm,\n Disposable,\n MultipleSelectionModel,\n SelectionModel,\n Types,\n UnaryCommand,\n Validator\n} from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { CellEditorComponent, CellListEditorComponent } from './cell-editors';\nimport {\n CellEditorPortalRef,\n CellHeaderPortalRef,\n CellRendererPortalRef,\n ComponentCellRendererPortalRef,\n TemplateCellRendererPortalRef\n} from './cell-portal-ref';\nimport { CellRenderer } from './cell-renderer';\nimport { ColumnTextProperties } from './column-text-properties';\nimport { DefaultCellRendererComponent } from './default-cell-renderer/default-cell-renderer.component';\nimport { DefaultHeaderCellRendererComponent } from './default-header-cell-renderer/default-header-cell-renderer.component';\nimport { EditRowControls } from './edit-row-controls/edit-row-controls.component';\nimport { EditSession } from './edit-session';\nimport { MutableCellRenderer } from './mutable-cell-renderer';\nimport { SelectCellRendererComponent } from './select-cell-renderer/select-cell-renderer.component';\nimport { SelectHeaderCellRendererComponent } from './select-header-cell-renderer/select-header-cell-renderer.component';\nimport { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';\nimport { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';\n\n\nconst noop = () => {\n};\n\nexport interface RowData<Row> {\n row: Row;\n editSession?: EditSession<Row>;\n editRowCommand: Command<void>;\n}\n\nconst CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol(\"aup-cell-renderer:row-data-cache\")\n\nexport type OnComponentInit<C> = (component: C) => void;\n\nexport interface CellRendererOptions<Row, E> {\n onComponentInit?: (component: E) => void;\n onRowUpdate?: (component: E, row: Row) => void;\n}\n\n\nexport interface MutableCellRendererOptions<Row, E, P extends keyof Row> extends CellRendererOptions<Row, E> {\n onValueEdit: (row: Row, is: Row[P], was: Row[P]) => void;\n}\n\nexport class ColumnModel<Row> {\n\n private _columnTextProperties: ColumnTextProperties;\n\n private _columnHeaderPortalRef: CellHeaderPortalRef<Row, any>;\n private _cellRendererPortalRef: CellRendererPortalRef<Row, any>;\n private _cellEditorPortalRef: CellEditorPortalRef<Row, any>;\n\n private _selectRowOnClick = undefined;\n private _flex = false;\n\n constructor(readonly columnId: string, private textPropertiesProvider: ColumnModel.TextPropertiesProvider) {\n this.installHeaderRenderer();\n }\n\n protected installHeaderRenderer() {\n this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, (component, column) => {\n component.headerText = column.getHeaderText();\n });\n }\n\n @Memoize()\n getHeaderText(): string {\n return this.getColumnTextProperties()?.headerText() || this.getDefaultHeaderText();\n }\n\n protected getDefaultHeaderText() {\n return this.columnId;\n }\n\n @Memoize()\n getColumnTextProperties(): ColumnTextProperties {\n return this._columnTextProperties || this.textPropertiesProvider();\n }\n\n textProperties(columnTextProperties: ColumnTextProperties): this {\n this._columnTextProperties = columnTextProperties;\n return this;\n }\n\n protected configureHeaderRenderer<C>(config: CellHeaderPortalRef<Row, any>): void {\n this._columnHeaderPortalRef = config;\n }\n\n protected configureCellRenderer<C>(config: CellRendererPortalRef<Row, any>): void {\n this._cellRendererPortalRef = config;\n }\n\n protected configureCellEditor<E>(cellEditor: CellEditorPortalRef<Row, E>): void {\n this._cellEditorPortalRef = cellEditor;\n }\n\n cellHeaderRenderer<C>(componentType: ComponentType<C>, initialiser: (component: C, column: ColumnModel<Row>) => void): this {\n this.configureHeaderRenderer(new CellHeaderPortalRef<Row, C>(componentType, initialiser));\n return this;\n }\n\n flex(flex = true) {\n this._flex = flex;\n }\n\n isFlex() {\n return this._flex;\n }\n\n hasEditorPortal() {\n return !!this._cellEditorPortalRef;\n }\n\n attachHeaderCell(host: any) {\n this._columnHeaderPortalRef.initialiseHost(host, this);\n }\n\n attachCell(host: any) {\n this._cellRendererPortalRef.initialiseHost(host, this);\n if (this.hasEditorPortal()) {\n this._cellEditorPortalRef.initialiseHost(host, this);\n }\n }\n\n onHeaderAttached(host: TableHeaderCellRendererComponent, component: any) {\n this._columnHeaderPortalRef.onPortalAttached(host, component);\n }\n\n onRendererAttached(host: TableCellRendererComponent<Row>, component: any) {\n this._cellRendererPortalRef.onPortalAttached(host, component);\n }\n\n // @Trace()\n onEditorAttached(host: TableCellRendererComponent<Row>, component: any) {\n this._cellEditorPortalRef.onPortalAttached(host, component);\n }\n\n updatePortalContent(host: TableCellRendererComponent<Row>) {\n this._cellRendererPortalRef.pushState(host);\n }\n\n protected selectRowOnClick(selectOnRowClick: boolean): this {\n this._selectRowOnClick = selectOnRowClick;\n return this;\n }\n\n isRowSelectionEnabled(): boolean | undefined {\n return this._selectRowOnClick;\n }\n\n isRowSelectionExplicitlyEnabled(): boolean {\n return this._selectRowOnClick === true;\n }\n\n isRowSelectionExplicitlyDisabled(): boolean {\n return this._selectRowOnClick === false;\n }\n}\n\nexport namespace ColumnModel {\n export type TextPropertiesProvider = () => ColumnTextProperties\n}\n\n\nexport class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<Row>> extends ColumnModel<Row> {\n\n\n private _format: (value: Row[P]) => any = (value) => value;\n\n constructor(id: string, readonly property: P, defaults: ColumnModel.TextPropertiesProvider) {\n super(id, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this\n cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, onComponentInit?: OnComponentInit<E>): this\n cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, onComponentInitOrOptions?: CellRendererOptions<Row, E> | OnComponentInit<E>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n if (firstTime) {\n if (_.isFunction(onComponentInitOrOptions)) {\n onComponentInitOrOptions(component);\n } else {\n if (_.isFunction(onComponentInitOrOptions?.onComponentInit)) {\n onComponentInitOrOptions.onComponentInit(component);\n }\n }\n }\n component.value = this._format(rowData.row[this.property]);\n\n if (!_.isFunction(onComponentInitOrOptions) && _.isFunction(onComponentInitOrOptions?.onRowUpdate)) {\n onComponentInitOrOptions.onRowUpdate(component, rowData.row);\n }\n }));\n return this;\n }\n\n liveEditCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this {\n return this.mutableCellRenderer(componentType, options);\n }\n\n /**\n * Deprecated. Use #liveEditCellRenderer instead.\n * @param componentType\n * @param options\n */\n mutableCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this {\n\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n\n // keep a local copy most recent row value so it's available to teh\n // edit callback without having to add/remove subscribers all the time.\n component[CELL_RENDERER_COMPONENT_ROW_CACHE]= rowData.row;\n let disableEditCallback = false;\n\n if (firstTime) {\n if (_.isFunction(options?.onComponentInit)) {\n options.onComponentInit(component);\n }\n // install our edit callback\n component.onValueEdited((is, was) => {\n if (!disableEditCallback) {\n options.onValueEdit(component[CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);\n }\n });\n\n }\n\n // now push the value the component and disable the callback just incase the component misbehaves\n // and fires a value change during the operation.\n disableEditCallback = true;\n component.value = rowData.row[this.property];\n disableEditCallback = false;\n\n if (!_.isFunction(options) && _.isFunction(options?.onRowUpdate)) {\n options.onRowUpdate(component, rowData.row);\n }\n\n }));\n return this;\n }\n\n cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validators?: Validator<Row[P]>[], initialiseComponent?: (component: E) => void): this\n cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, initialiseComponent?: (component: E) => void): this\n cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validatorsOrInitialiser?: Validator<Row[P]>[] | ((component: E) => void), onComponentInit?: (component: E) => void): this {\n const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;\n const initialiser = _.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;\n this.configureCellEditor(new CellEditorPortalRef(editor, (component: E, editSession: EditSession<Row>) => {\n const formValueModel = editSession.form.pluck(this.property);\n if (validators) {\n formValueModel.validateUsing(validators);\n }\n component.valueModel = formValueModel;\n if (initialiser) {\n initialiser(component);\n }\n }));\n return this;\n }\n\n format(formatter: (value: Row[P]) => any): this {\n assert.isFunction(formatter);\n this._format = formatter;\n return this;\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class ListPropertyColumnModel<Row, P extends Types.ArrayPropertiesOf<Row>> extends ColumnModel<Row> {\n\n private _format: (value: Types.ArrayElementType<Row, P>[]) => any = (value) => value.map(v => v?.toString()).join(', ');\n\n constructor(id: string, readonly property: P, defaults: ColumnModel.TextPropertiesProvider) {\n super(id, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer(componentType: ComponentType<{ value: Types.ArrayElementType<Row, P>[] }>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {\n component.value = this._format(rowData.row[this.property]);\n }));\n return this;\n }\n\n cellEditor<C extends CellListEditorComponent<Types.ArrayElementType<Row, P>>>(editor: ComponentType<C>, validators?: Validator<Types.ArrayElementType<Row, P>[]>[], initialiseComponent?: (component: C) => void): this\n cellEditor<C extends CellListEditorComponent<Types.ArrayElementType<Row, P>>>(editor: ComponentType<C>, initialiseComponent?: (component: C) => void): this\n cellEditor<C extends CellListEditorComponent<Types.ArrayElementType<Row, P>>>(editor: ComponentType<C>, validatorsOrInitialiser?: Validator<Types.ArrayElementType<Row, P>[]>[] | ((component: C) => void), initialiseComponent?: (component: C) => void): this {\n const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;\n const initialiser = _.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;\n\n this.configureCellEditor(new CellEditorPortalRef(editor, (component: C, editSession: EditSession<Row>) => {\n const formListModel = editSession.form.pluckList(this.property);\n if (validators) {\n formListModel.validateUsing(validators);\n }\n component.listModel = formListModel;\n if (initialiser) {\n initialiser(component);\n }\n }));\n return this;\n }\n\n format(formatter: (value: Types.ArrayElementType<Row, P>[]) => any): this {\n assert.isFunction(formatter);\n this._format = formatter;\n return this;\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class CustomValueColumnModel<Row, V> extends ColumnModel<Row> {\n constructor(columnId: string, defaults: ColumnModel.TextPropertiesProvider, private getValue: (row: Row) => V) {\n super(columnId, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer<C extends { value: V }>(componentType: ComponentType<C>, onComponentInitOrOptions?: CellRendererOptions<Row, C> | OnComponentInit<C>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n if (firstTime) {\n if (_.isFunction(onComponentInitOrOptions)) {\n onComponentInitOrOptions(component);\n } else {\n if (_.isFunction(onComponentInitOrOptions?.onComponentInit)) {\n onComponentInitOrOptions.onComponentInit(component);\n }\n }\n }\n component.value = this.getValue(rowData.row);\n\n if (!_.isFunction(onComponentInitOrOptions) && _.isFunction(onComponentInitOrOptions?.onRowUpdate)) {\n onComponentInitOrOptions.onRowUpdate(component, rowData.row);\n }\n }));\n return this;\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class EditorControlColumnModel<Row> extends ColumnModel<Row> {\n\n constructor(columnId: string, saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>, defaults: ColumnModel.TextPropertiesProvider) {\n super(columnId, defaults);\n this.cellRenderer(EditRowControls);\n }\n\n cellRenderer(componentType: ComponentType<{ row: Row, editSession: EditSession<Row>, editRowCommand: Command<void> }>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData: RowData<Row>) => {\n component.row = rowData.row;\n component.editSession = rowData.editSession;\n component.editRowCommand = rowData.editRowCommand;\n }));\n return this;\n }\n\n protected getDefaultHeaderText(): string {\n return '';\n }\n}\n\nexport class CustomTemplateColumnModel<Row> extends ColumnModel<Row> {\n private readonly config = new TemplateCellRendererPortalRef<Row>();\n\n constructor(columnId: string, defaults: ColumnModel.TextPropertiesProvider) {\n super(columnId, defaults);\n this.configureCellRenderer(this.config);\n }\n\n setTemplate(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n this.config.registerPortal(templateRef, viewContainer, fillCell, padChild);\n }\n\n public selectRowOnClick(selectOnRowClick: boolean): this {\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n}\n\nexport class SelectionColumnModel<Row> extends ColumnModel<Row> {\n\n private _enableHeaderControls = true;\n\n constructor(columnId: string, defaults: ColumnModel.TextPropertiesProvider, readonly selectionModel: SelectionModel<Row>) {\n super(columnId, defaults);\n this.selectOnRowClick(false);\n if (selectionModel instanceof MultipleSelectionModel) {\n this.cellHeaderRenderer(SelectHeaderCellRendererComponent, (component) => {\n component.selectionModel = selectionModel;\n component.enableHeaderControls = this._enableHeaderControls;\n });\n }\n this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectCellRendererComponent, (component, rowData: RowData<Row>) => {\n component.row = rowData.row;\n component.selectionModel = selectionModel;\n }));\n }\n\n protected getDefaultHeaderText(): string {\n return '';\n }\n\n isRowSelectionEnabledByDefault(): boolean | undefined {\n return this.isRowSelectionExplicitlyEnabled();\n }\n\n selectOnRowClick(selectOnRowClick: boolean): this {\n // note we're using different method name as the selection column treats this\n // state as the default for all columns.\n return super.selectRowOnClick(selectOnRowClick);\n }\n\n enableHeaderControls(enable: boolean): this {\n this._enableHeaderControls = enable;\n return this;\n }\n\n selectRow(row: Row) {\n this.selectionModel.selectCommand.execute(row);\n }\n}\n\n\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ɵ0":{"__symbolic":"error","message":"Lambda not supported","line":36,"character":13},"RowData":{"__symbolic":"interface"},"OnComponentInit":{"__symbolic":"interface"},"CellRendererOptions":{"__symbolic":"interface"},"MutableCellRendererOptions":{"__symbolic":"interface"},"ColumnModel":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"installHeaderRenderer":[{"__symbolic":"method"}],"getHeaderText":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":79,"character":3}}]}],"getDefaultHeaderText":[{"__symbolic":"method"}],"getColumnTextProperties":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":88,"character":3}}]}],"textProperties":[{"__symbolic":"method"}],"configureHeaderRenderer":[{"__symbolic":"method"}],"configureCellRenderer":[{"__symbolic":"method"}],"configureCellEditor":[{"__symbolic":"method"}],"cellHeaderRenderer":[{"__symbolic":"method"}],"hasEditorPortal":[{"__symbolic":"method"}],"attachHeaderCell":[{"__symbolic":"method"}],"attachCell":[{"__symbolic":"method"}],"onHeaderAttached":[{"__symbolic":"method"}],"onRendererAttached":[{"__symbolic":"method"}],"onEditorAttached":[{"__symbolic":"method"}],"updatePortalContent":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}],"isRowSelectionEnabled":[{"__symbolic":"method"}],"isRowSelectionExplicitlyEnabled":[{"__symbolic":"method"}],"isRowSelectionExplicitlyDisabled":[{"__symbolic":"method"}]}},"PropertyColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":175,"character":45,"context":{"typeName":"P"}},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"cellRenderer":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"liveEditCellRenderer":[{"__symbolic":"method"}],"mutableCellRenderer":[{"__symbolic":"method"}],"cellEditor":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"format":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"ListPropertyColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":281,"character":45,"context":{"typeName":"P"}},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"cellRenderer":[{"__symbolic":"method"}],"cellEditor":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"format":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"CustomValueColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"},{"__symbolic":"error","message":"Expression form not supported","line":325,"character":96}]}],"cellRenderer":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"EditorControlColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"@coolon/pectin","name":"UnaryCommand","line":358,"character":45,"arguments":[{"__symbolic":"reference","module":"@coolon/pectin","name":"DirtyTrackingForm","line":358,"character":58,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":358,"character":76,"context":{"typeName":"Row"}}]},{"__symbolic":"reference","name":"boolean"}]},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"cellRenderer":[{"__symbolic":"method"}],"getDefaultHeaderText":[{"__symbolic":"method"}]}},"CustomTemplateColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"setTemplate":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"SelectionColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"},{"__symbolic":"reference","module":"@coolon/pectin","name":"SelectionModel","line":399,"character":103,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":399,"character":118,"context":{"typeName":"Row"}}]}]}],"getDefaultHeaderText":[{"__symbolic":"method"}],"isRowSelectionEnabledByDefault":[{"__symbolic":"method"}],"selectOnRowClick":[{"__symbolic":"method"}],"enableHeaderControls":[{"__symbolic":"method"}],"selectRow":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ɵ0":{"__symbolic":"error","message":"Lambda not supported","line":36,"character":13},"RowData":{"__symbolic":"interface"},"OnComponentInit":{"__symbolic":"interface"},"CellRendererOptions":{"__symbolic":"interface"},"MutableCellRendererOptions":{"__symbolic":"interface"},"ColumnModel":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"installHeaderRenderer":[{"__symbolic":"method"}],"getHeaderText":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":80,"character":3}}]}],"getDefaultHeaderText":[{"__symbolic":"method"}],"getColumnTextProperties":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":89,"character":3}}]}],"textProperties":[{"__symbolic":"method"}],"configureHeaderRenderer":[{"__symbolic":"method"}],"configureCellRenderer":[{"__symbolic":"method"}],"configureCellEditor":[{"__symbolic":"method"}],"cellHeaderRenderer":[{"__symbolic":"method"}],"flex":[{"__symbolic":"method"}],"isFlex":[{"__symbolic":"method"}],"hasEditorPortal":[{"__symbolic":"method"}],"attachHeaderCell":[{"__symbolic":"method"}],"attachCell":[{"__symbolic":"method"}],"onHeaderAttached":[{"__symbolic":"method"}],"onRendererAttached":[{"__symbolic":"method"}],"onEditorAttached":[{"__symbolic":"method"}],"updatePortalContent":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}],"isRowSelectionEnabled":[{"__symbolic":"method"}],"isRowSelectionExplicitlyEnabled":[{"__symbolic":"method"}],"isRowSelectionExplicitlyDisabled":[{"__symbolic":"method"}]}},"PropertyColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":184,"character":45,"context":{"typeName":"P"}},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"cellRenderer":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"liveEditCellRenderer":[{"__symbolic":"method"}],"mutableCellRenderer":[{"__symbolic":"method"}],"cellEditor":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"format":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"ListPropertyColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":290,"character":45,"context":{"typeName":"P"}},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"cellRenderer":[{"__symbolic":"method"}],"cellEditor":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"format":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"CustomValueColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"},{"__symbolic":"error","message":"Expression form not supported","line":334,"character":96}]}],"cellRenderer":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"EditorControlColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"@coolon/pectin","name":"UnaryCommand","line":367,"character":45,"arguments":[{"__symbolic":"reference","module":"@coolon/pectin","name":"DirtyTrackingForm","line":367,"character":58,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":367,"character":76,"context":{"typeName":"Row"}}]},{"__symbolic":"reference","name":"boolean"}]},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"cellRenderer":[{"__symbolic":"method"}],"getDefaultHeaderText":[{"__symbolic":"method"}]}},"CustomTemplateColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"}]}],"setTemplate":[{"__symbolic":"method"}],"selectRowOnClick":[{"__symbolic":"method"}]}},"SelectionColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ColumnModel"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"ColumnModel"},"member":"TextPropertiesProvider"},{"__symbolic":"reference","module":"@coolon/pectin","name":"SelectionModel","line":408,"character":103,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":408,"character":118,"context":{"typeName":"Row"}}]}]}],"getDefaultHeaderText":[{"__symbolic":"method"}],"isRowSelectionEnabledByDefault":[{"__symbolic":"method"}],"selectOnRowClick":[{"__symbolic":"method"}],"enableHeaderControls":[{"__symbolic":"method"}],"selectRow":[{"__symbolic":"method"}]}}}}]
@@ -1,9 +1,9 @@
1
1
  import { Component, HostBinding, Input } from '@angular/core';
2
2
  import { Command, Dsl } from '@coolon/pectin';
3
3
  import { DisposableComponent } from '../../disposable-component';
4
+ import { AbstractTableModel } from '../abstract-table-model';
4
5
  import { ColumnModel } from '../column-model';
5
6
  import { EditSession } from '../edit-session';
6
- import { TableModel } from '../table-model';
7
7
  import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';
8
8
  export class TableCellRendererComponent extends DisposableComponent {
9
9
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"table-cell-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/table/table-cell-renderer/table-cell-renderer.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAoC,MAAM,eAAe,CAAC;AAChG,OAAO,EAA0B,OAAO,EAAE,GAAG,EAA0B,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAW,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO9E,MAAM,OAAO,0BAAgC,SAAQ,mBAAmB;IA8BtE;QACE,KAAK,EAAE,CAAC;QAXV,sBAAiB,GAAG,mBAAmB,CAAC;QAGxC,aAAQ,GAAG,KAAK,CAAC;QAGjB,aAAQ,GAAG,KAAK,CAAC;QAMf,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;YACxC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED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C,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACpC,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC;IACJ,CAAC;;;YA5FF,SAAS,SAAC;gBACT,QAAQ,EAAE,yBAAyB;gBACnC,yTAAmD;;aAEpD;;;;kBAGE,KAAK;qBAGL,KAAK;0BAGL,KAAK;yBAGL,KAAK;gCAQL,WAAW,SAAC,OAAO;uBAGnB,WAAW,SAAC,gBAAgB;uBAG5B,WAAW,SAAC,gBAAgB","sourcesContent":["import { Portal } from '@angular/cdk/portal';\nimport { Component, HostBinding, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BooleanValueModelChain, Command, Dsl, HasFocusContext, Trace } from '@coolon/pectin';\nimport { DisposableComponent } from '../../disposable-component';\nimport { CellEditorComponent, CellListEditorComponent } from '../cell-editors';\nimport { ColumnModel, RowData } from '../column-model';\nimport { EditSession } from '../edit-session';\nimport { TableModel } from '../table-model';\nimport { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';\n\n@Component({\n selector: 'aup-table-cell-renderer',\n templateUrl: './table-cell-renderer.component.html',\n styleUrls: ['./table-cell-renderer.component.scss']\n})\nexport class TableCellRendererComponent<Row> extends DisposableComponent implements OnInit, OnChanges {\n\n @Input()\n row: Row;\n\n @Input()\n column: ColumnModel<Row>;\n\n @Input()\n editSession: EditSession<Row>;\n\n @Input()\n tableModel: TableModel<Row>;\n\n private editRowCommand: Command<void>;\n\n [CELL_RENDERER_PORTAL]: Portal<any>;\n [CELL_EDITOR_PORTAL]: Portal<any>;\n\n @HostBinding('class')\n defaultClassNames = 'aup-cell-renderer';\n\n @HostBinding('class.fillCell')\n fillCell = false;\n\n @HostBinding('class.padChild')\n padChild = false;\n\n private firstEditableColumn: BooleanValueModelChain;\n\n constructor() {\n super();\n this.editRowCommand = Command.create(() => {\n this.tableModel.startEditSession(this.row);\n });\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.firstEditableColumn = chain(this.tableModel.firstEditableColumn).equals(this.column); // this would break if the column changed.\n this.column.attachCell(this);\n }\n\n hasActiveEditor(): boolean {\n return !!this.editSession && !!this.column.hasEditorPortal();\n }\n\n initialiseRenderer(instance: any) {\n this.column.onRendererAttached(this, instance);\n }\n\n initialiseEditor(instance: CellEditorComponent<Row> | CellListEditorComponent<Row>) {\n this.column.onEditorAttached(this, instance);\n if (this.firstEditableColumn.value) {\n // @see https://github.com/angular/components/issues/12070\n setTimeout(() => this.tryAndFocusEditor(instance));\n }\n }\n\n private tryAndFocusEditor(editor: CellEditorComponent<Row> | CellListEditorComponent<Row>) {\n if (editor.requestFocus) {\n editor.requestFocus();\n } else {\n const model = (editor['valueModel'] || editor['listModel']) as HasFocusContext;\n model?.focusContext?.requestFocus();\n }\n }\n\n // @Trace()\n ngOnChanges(changes: SimpleChanges): void {\n this.column.updatePortalContent(this);\n }\n\n getRendererPortal() {\n return this[CELL_RENDERER_PORTAL];\n }\n\n getEditorPortal() {\n return this[CELL_EDITOR_PORTAL];\n }\n\n getRowData(): RowData<Row> {\n return {\n row: this.row,\n editSession: this.editSession,\n editRowCommand: this.editRowCommand\n };\n }\n}\n"]}
1
+ {"version":3,"file":"table-cell-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/table/table-cell-renderer/table-cell-renderer.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAoC,MAAM,eAAe,CAAC;AAChG,OAA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BAG5B,WAAW,SAAC,gBAAgB","sourcesContent":["import { Portal } from '@angular/cdk/portal';\nimport { Component, HostBinding, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BooleanValueModelChain, Command, Dsl, HasFocusContext, Trace } from '@coolon/pectin';\nimport { DisposableComponent } from '../../disposable-component';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { CellEditorComponent, CellListEditorComponent } from '../cell-editors';\nimport { ColumnModel, RowData } from '../column-model';\nimport { EditSession } from '../edit-session';\nimport { TableModel } from '../table-model';\nimport { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';\n\n@Component({\n selector: 'aup-table-cell-renderer',\n templateUrl: './table-cell-renderer.component.html',\n styleUrls: ['./table-cell-renderer.component.scss']\n})\nexport class TableCellRendererComponent<Row> extends DisposableComponent implements OnInit, OnChanges {\n\n @Input()\n row: Row;\n\n @Input()\n column: ColumnModel<Row>;\n\n @Input()\n editSession: EditSession<Row>;\n\n @Input()\n tableModel: AbstractTableModel<Row>;\n\n private editRowCommand: Command<void>;\n\n [CELL_RENDERER_PORTAL]: Portal<any>;\n [CELL_EDITOR_PORTAL]: Portal<any>;\n\n @HostBinding('class')\n defaultClassNames = 'aup-cell-renderer';\n\n @HostBinding('class.fillCell')\n fillCell = false;\n\n @HostBinding('class.padChild')\n padChild = false;\n\n private firstEditableColumn: BooleanValueModelChain;\n\n constructor() {\n super();\n this.editRowCommand = Command.create(() => {\n this.tableModel.startEditSession(this.row);\n });\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.firstEditableColumn = chain(this.tableModel.firstEditableColumn).equals(this.column); // this would break if the column changed.\n this.column.attachCell(this);\n }\n\n hasActiveEditor(): boolean {\n return !!this.editSession && !!this.column.hasEditorPortal();\n }\n\n initialiseRenderer(instance: any) {\n this.column.onRendererAttached(this, instance);\n }\n\n initialiseEditor(instance: CellEditorComponent<Row> | CellListEditorComponent<Row>) {\n this.column.onEditorAttached(this, instance);\n if (this.firstEditableColumn.value) {\n // @see https://github.com/angular/components/issues/12070\n setTimeout(() => this.tryAndFocusEditor(instance));\n }\n }\n\n private tryAndFocusEditor(editor: CellEditorComponent<Row> | CellListEditorComponent<Row>) {\n if (editor.requestFocus) {\n editor.requestFocus();\n } else {\n const model = (editor['valueModel'] || editor['listModel']) as HasFocusContext;\n model?.focusContext?.requestFocus();\n }\n }\n\n // @Trace()\n ngOnChanges(changes: SimpleChanges): void {\n this.column.updatePortalContent(this);\n }\n\n getRendererPortal() {\n return this[CELL_RENDERER_PORTAL];\n }\n\n getEditorPortal() {\n return this[CELL_EDITOR_PORTAL];\n }\n\n getRowData(): RowData<Row> {\n return {\n row: this.row,\n editSession: this.editSession,\n editRowCommand: this.editRowCommand\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TableCellRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":15,"character":53},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"aup-table-cell-renderer","template":"<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event.instance)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event.instance)\"></ng-container>\n","styles":[""]}]}],"members":{"row":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"column":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"editSession":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"defaultClassNames":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":34,"character":3},"arguments":["class"]}]}],"fillCell":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":37,"character":3},"arguments":["class.fillCell"]}]}],"padChild":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":40,"character":3},"arguments":["class.padChild"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"hasActiveEditor":[{"__symbolic":"method"}],"initialiseRenderer":[{"__symbolic":"method"}],"initialiseEditor":[{"__symbolic":"method"}],"tryAndFocusEditor":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"getRendererPortal":[{"__symbolic":"method"}],"getEditorPortal":[{"__symbolic":"method"}],"getRowData":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TableCellRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":16,"character":53},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"aup-table-cell-renderer","template":"<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event.instance)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event.instance)\"></ng-container>\n","styles":[""]}]}],"members":{"row":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"column":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"editSession":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"defaultClassNames":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":35,"character":3},"arguments":["class"]}]}],"fillCell":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":38,"character":3},"arguments":["class.fillCell"]}]}],"padChild":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":3},"arguments":["class.padChild"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"hasActiveEditor":[{"__symbolic":"method"}],"initialiseRenderer":[{"__symbolic":"method"}],"initialiseEditor":[{"__symbolic":"method"}],"tryAndFocusEditor":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"getRendererPortal":[{"__symbolic":"method"}],"getEditorPortal":[{"__symbolic":"method"}],"getRowData":[{"__symbolic":"method"}]}}}}]
@@ -57,8 +57,8 @@ export class TableComponent extends DisposableComponent {
57
57
  TableComponent.decorators = [
58
58
  { type: Component, args: [{
59
59
  selector: 'aup-table',
60
- template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
61
- styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}"]
60
+ template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\"\n [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
61
+ styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}.mat-cell:not(.flex){white-space:nowrap;width:1px}"]
62
62
  },] }
63
63
  ];
64
64
  TableComponent.ctorParameters = () => [];
@@ -1 +1 @@
1
- {"version":3,"file":"table.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/table/table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA4D,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,GAAG,EAAiC,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAe,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,MAAM,OAAO,cAAoB,SAAQ,mBAAmB;IAU1D;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzF,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;IAED,SAAS,CAAC,GAAQ;QAChB,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;IAED,sBAAsB,CAAC,QAAgB,EAAE,WAA6B,EAAE,aAA+B,EAAE,QAAiB,EAAE,QAAiB;QAC3I,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,MAAM,YAAY,yBAAyB,EAAE;YAC/C,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;SACpE;IACH,CAAC;IAED,iBAAiB,CAAC,WAA6B,EAAE,GAAQ;QACvD,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACvD,CAAC;;;YAvCF,SAAS,SAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,qrDAAqC;;aAEtC;;;;yBAGE,KAAK;;AAEN;IADC,aAAa,EAAE;8BACJ,kBAAkB;kDAAM","sourcesContent":["import { Component, Input, OnInit, TemplateRef, ViewContainerRef, ViewEncapsulation } from '@angular/core';\nimport { Dsl, ListModelChain, MapModelChain, TrackExternal } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\nimport { AbstractTableModel } from './abstract-table-model';\nimport { ColumnModel, CustomTemplateColumnModel } from './column-model';\n\n/**\n * Create your model:\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Create your table\n * @example\n * <aup-table [tableModel]=\"heroTableModel\"></aup-table>\n *\n * Styling\n * @example\n * aup-table {\n * --column-gap: 10px; // defaults to 24px\n * aup-table-cell-renderer {\n * &:first-column {\n * // do stuff\n * }\n * &:last-column {\n * // do stuff\n * }\n * }\n * }\n */\n@Component({\n selector: 'aup-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss']\n})\nexport class TableComponent<Row> extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n tableModel: AbstractTableModel<Row>;\n\n columns: ListModelChain<ColumnModel<Row>>;\n columnIds: ListModelChain<string>;\n private columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.columns = chain(this.tableModel.columns);\n this.columnIds = chain(this.columns).pluck('columnId');\n this.columnsById = chain(this.columns).indexBy('columnId');\n }\n\n isEditing(row: Row): boolean {\n return !!this.tableModel.getEditSessionFor(row);\n }\n\n registerColumnTemplate(columnId: string, templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n const column = this.columnsById.get(columnId);\n if (column instanceof CustomTemplateColumnModel) {\n column.setTemplate(templateRef, viewContainer, fillCell, padChild);\n }\n }\n\n notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n this.tableModel._notifyCellClicked(columnModel, row);\n }\n\n}\n"]}
1
+ {"version":3,"file":"table.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/table/table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA4D,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,GAAG,EAAiC,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE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AC;gBACT,QAAQ,EAAE,WAAW;gBACrB,uyDAAqC;;aAEtC;;;;yBAGE,KAAK;;AAEN;IADC,aAAa,EAAE;8BACJ,kBAAkB;kDAAM","sourcesContent":["import { Component, Input, OnInit, TemplateRef, ViewContainerRef, ViewEncapsulation } from '@angular/core';\nimport { Dsl, ListModelChain, MapModelChain, TrackExternal } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\nimport { AbstractTableModel } from './abstract-table-model';\nimport { ColumnModel, CustomTemplateColumnModel } from './column-model';\n\n/**\n * Create your model:\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Create your table\n * @example\n * <aup-table [tableModel]=\"heroTableModel\"></aup-table>\n *\n * Styling\n * @example\n * aup-table {\n * --column-gap: 10px; // defaults to 24px\n * aup-table-cell-renderer {\n * &:first-column {\n * // do stuff\n * }\n * &:last-column {\n * // do stuff\n * }\n * }\n * }\n */\n@Component({\n selector: 'aup-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss']\n})\nexport class TableComponent<Row> extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n tableModel: AbstractTableModel<Row>;\n\n columns: ListModelChain<ColumnModel<Row>>;\n columnIds: ListModelChain<string>;\n private columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.columns = chain(this.tableModel.columns);\n this.columnIds = chain(this.columns).pluck('columnId');\n this.columnsById = chain(this.columns).indexBy('columnId');\n }\n\n isEditing(row: Row): boolean {\n return !!this.tableModel.getEditSessionFor(row);\n }\n\n registerColumnTemplate(columnId: string, templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n const column = this.columnsById.get(columnId);\n if (column instanceof CustomTemplateColumnModel) {\n column.setTemplate(templateRef, viewContainer, fillCell, padChild);\n }\n }\n\n notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n this.tableModel._notifyCellClicked(columnModel, row);\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":38,"character":41},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":33,"character":1},"arguments":[{"selector":"aup-table","template":"<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n","styles":[":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}"]}]}],"members":{"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":41,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isEditing":[{"__symbolic":"method"}],"registerColumnTemplate":[{"__symbolic":"method"}],"notifyCellClicked":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":38,"character":41},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":33,"character":1},"arguments":[{"selector":"aup-table","template":"<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\"\n [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n","styles":[":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}.mat-cell:not(.flex){white-space:nowrap;width:1px}"]}]}],"members":{"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":41,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isEditing":[{"__symbolic":"method"}],"registerColumnTemplate":[{"__symbolic":"method"}],"notifyCellClicked":[{"__symbolic":"method"}]}}}}]
@@ -319,8 +319,9 @@ DirectivesModule.decorators = [
319
319
  },] }
320
320
  ];
321
321
 
322
- class BusyOverlayComponent {
322
+ class BusyOverlayComponent extends GarbageCollector {
323
323
  constructor() {
324
+ super();
324
325
  }
325
326
  ngOnInit() {
326
327
  }
@@ -1770,7 +1771,9 @@ class SwitchCaseComponent extends DisposableComponent {
1770
1771
  }
1771
1772
  if (matchingIndicies.length === 0) {
1772
1773
  this.switchCaseOptions.forEach((option, index) => {
1773
- matchingIndicies.push(index);
1774
+ if (option.isDefault) {
1775
+ matchingIndicies.push(index);
1776
+ }
1774
1777
  });
1775
1778
  if (matchingIndicies.length > 1) {
1776
1779
  console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);
@@ -2056,6 +2059,7 @@ class ColumnModel {
2056
2059
  this.columnId = columnId;
2057
2060
  this.textPropertiesProvider = textPropertiesProvider;
2058
2061
  this._selectRowOnClick = undefined;
2062
+ this._flex = false;
2059
2063
  this.installHeaderRenderer();
2060
2064
  }
2061
2065
  installHeaderRenderer() {
@@ -2090,6 +2094,12 @@ class ColumnModel {
2090
2094
  this.configureHeaderRenderer(new CellHeaderPortalRef(componentType, initialiser));
2091
2095
  return this;
2092
2096
  }
2097
+ flex(flex = true) {
2098
+ this._flex = flex;
2099
+ }
2100
+ isFlex() {
2101
+ return this._flex;
2102
+ }
2093
2103
  hasEditorPortal() {
2094
2104
  return !!this._cellEditorPortalRef;
2095
2105
  }
@@ -2581,8 +2591,8 @@ class TableComponent extends DisposableComponent {
2581
2591
  TableComponent.decorators = [
2582
2592
  { type: Component, args: [{
2583
2593
  selector: 'aup-table',
2584
- template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
2585
- styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}"]
2594
+ template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\"\n [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
2595
+ styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}.mat-cell:not(.flex){white-space:nowrap;width:1px}"]
2586
2596
  },] }
2587
2597
  ];
2588
2598
  TableComponent.ctorParameters = () => [];
@@ -2625,88 +2635,6 @@ ColumnTemplateDirective.propDecorators = {
2625
2635
  aupColumnTemplateAutoPadChild: [{ type: Input }]
2626
2636
  };
2627
2637
 
2628
- /**
2629
- * Example:
2630
- * @example
2631
- * const model = TableModel.fromList(heroList, table => {
2632
- * table.pluck("firstName");
2633
- * table.pluck("lastName");
2634
- * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2635
- * });
2636
- *
2637
- * Editable tables
2638
- * @example
2639
- * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
2640
- * if (form.validate()) {
2641
- * // normal form save stuff
2642
- * return true; // finish editing
2643
- * }
2644
- * return false; // continue editiing
2645
- * }
2646
- * const colorsNames: ListModel<string> = ...;
2647
- * const model = TableModel.fromList(heroList, table => {
2648
- * table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
2649
- * table.pluck("lastName").cellEditor(StringInputComponent, {
2650
- * validators: [Validator.present("We need a last name")]
2651
- * });
2652
- * table.pluck("age").cellEditor(NumberInputComponent);
2653
- * table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
2654
- * initialiseComponent(component: SelectInputComponent) {
2655
- * selectInput.optionsModel = colorsNames; // <- initialise our component
2656
- * }
2657
- * });
2658
- * table.addEditControls(saveCommand); // <- required to enable editing
2659
- * });
2660
- *
2661
- * Selection models
2662
- * @example
2663
- * const model = TableModel.fromList(heroList, table => {
2664
- * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
2665
- * table.pluck("firstName");
2666
- * table.pluck("lastName");
2667
- * });
2668
- *
2669
- * Custom cell renderers and editors
2670
- * @example
2671
- * const model = TableModel.fromList(heroList, table => {
2672
- * table.pluck("favoriteColor")
2673
- * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
2674
- * // configure your component with what ever you need.
2675
- * });
2676
- * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
2677
- * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
2678
- * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2679
- * });
2680
- *
2681
- * I18n
2682
- * @example
2683
- * [table.yml]
2684
- * table:
2685
- * columns(ColumnTextProperties[]):
2686
- * firstName:
2687
- * headerText: "First Name"
2688
- * fullName:
2689
- * headerText: "Full Name"
2690
- *
2691
- * const model = TableModel.fromList(heroList, table => {
2692
- * table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
2693
- * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2694
- *
2695
- * table.columnTextProperties(I18n.table.columns); // <- configures all columns
2696
- * });
2697
- */
2698
- class TableModel extends AbstractTableModel {
2699
- static fromList(sourceOfTruth, builder) {
2700
- const model = new TableModel(sourceOfTruth);
2701
- if (builder)
2702
- builder(model);
2703
- return model;
2704
- }
2705
- addSelectionColumn(selectionModel) {
2706
- return this._addSelectionColumn(selectionModel);
2707
- }
2708
- }
2709
-
2710
2638
  class TableCellRendererComponent extends DisposableComponent {
2711
2639
  constructor() {
2712
2640
  super();
@@ -4833,6 +4761,88 @@ ResizeAwareComponent.ctorParameters = () => [
4833
4761
  { type: NgZone }
4834
4762
  ];
4835
4763
 
4764
+ /**
4765
+ * Example:
4766
+ * @example
4767
+ * const model = TableModel.fromList(heroList, table => {
4768
+ * table.pluck("firstName");
4769
+ * table.pluck("lastName");
4770
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
4771
+ * });
4772
+ *
4773
+ * Editable tables
4774
+ * @example
4775
+ * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
4776
+ * if (form.validate()) {
4777
+ * // normal form save stuff
4778
+ * return true; // finish editing
4779
+ * }
4780
+ * return false; // continue editiing
4781
+ * }
4782
+ * const colorsNames: ListModel<string> = ...;
4783
+ * const model = TableModel.fromList(heroList, table => {
4784
+ * table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
4785
+ * table.pluck("lastName").cellEditor(StringInputComponent, {
4786
+ * validators: [Validator.present("We need a last name")]
4787
+ * });
4788
+ * table.pluck("age").cellEditor(NumberInputComponent);
4789
+ * table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
4790
+ * initialiseComponent(component: SelectInputComponent) {
4791
+ * selectInput.optionsModel = colorsNames; // <- initialise our component
4792
+ * }
4793
+ * });
4794
+ * table.addEditControls(saveCommand); // <- required to enable editing
4795
+ * });
4796
+ *
4797
+ * Selection models
4798
+ * @example
4799
+ * const model = TableModel.fromList(heroList, table => {
4800
+ * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
4801
+ * table.pluck("firstName");
4802
+ * table.pluck("lastName");
4803
+ * });
4804
+ *
4805
+ * Custom cell renderers and editors
4806
+ * @example
4807
+ * const model = TableModel.fromList(heroList, table => {
4808
+ * table.pluck("favoriteColor")
4809
+ * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
4810
+ * // configure your component with what ever you need.
4811
+ * });
4812
+ * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
4813
+ * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
4814
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
4815
+ * });
4816
+ *
4817
+ * I18n
4818
+ * @example
4819
+ * [table.yml]
4820
+ * table:
4821
+ * columns(ColumnTextProperties[]):
4822
+ * firstName:
4823
+ * headerText: "First Name"
4824
+ * fullName:
4825
+ * headerText: "Full Name"
4826
+ *
4827
+ * const model = TableModel.fromList(heroList, table => {
4828
+ * table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
4829
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
4830
+ *
4831
+ * table.columnTextProperties(I18n.table.columns); // <- configures all columns
4832
+ * });
4833
+ */
4834
+ class TableModel extends AbstractTableModel {
4835
+ static fromList(sourceOfTruth, builder) {
4836
+ const model = new TableModel(sourceOfTruth);
4837
+ if (builder)
4838
+ builder(model);
4839
+ return model;
4840
+ }
4841
+ addSelectionColumn(selectionModel) {
4842
+ return this._addSelectionColumn(selectionModel);
4843
+ }
4844
+ }
4845
+
4836
4846
  /**
4837
4847
  * @file Automatically generated by barrelsby.
4838
4848
  */