@coolon/angular-ui-powerups 3.10.4 → 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.
- package/CHANGELOG.md +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +10 -2
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/table/column-model.js +7 -0
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.js +2 -2
- package/esm2015/lib/components/table/table.component.js.map +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +91 -84
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/table/column-model.d.ts +3 -0
- package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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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AE,CAAC,SAAS,EAAE,OAAqB,EAAE,EAAE;YAC9H,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YAC5B,SAAS,CAAC,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,uDA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S,CAAC,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 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":
|
|
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() {
|
package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map
CHANGED
|
@@ -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;
|
|
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;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAW,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,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,GA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MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,0CAAE,YAAY,GAAG;SACrC;IACH,CAAC;IAED,WAAW;IACX,WAAW,CAAC,OAAsB;QAChC,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 { 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"]}
|
package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"TableCellRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":
|
|
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\"
|
|
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,
|
|
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,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EtC;;;;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\"
|
|
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"}]}}}}]
|
|
@@ -2059,6 +2059,7 @@ class ColumnModel {
|
|
|
2059
2059
|
this.columnId = columnId;
|
|
2060
2060
|
this.textPropertiesProvider = textPropertiesProvider;
|
|
2061
2061
|
this._selectRowOnClick = undefined;
|
|
2062
|
+
this._flex = false;
|
|
2062
2063
|
this.installHeaderRenderer();
|
|
2063
2064
|
}
|
|
2064
2065
|
installHeaderRenderer() {
|
|
@@ -2093,6 +2094,12 @@ class ColumnModel {
|
|
|
2093
2094
|
this.configureHeaderRenderer(new CellHeaderPortalRef(componentType, initialiser));
|
|
2094
2095
|
return this;
|
|
2095
2096
|
}
|
|
2097
|
+
flex(flex = true) {
|
|
2098
|
+
this._flex = flex;
|
|
2099
|
+
}
|
|
2100
|
+
isFlex() {
|
|
2101
|
+
return this._flex;
|
|
2102
|
+
}
|
|
2096
2103
|
hasEditorPortal() {
|
|
2097
2104
|
return !!this._cellEditorPortalRef;
|
|
2098
2105
|
}
|
|
@@ -2584,8 +2591,8 @@ class TableComponent extends DisposableComponent {
|
|
|
2584
2591
|
TableComponent.decorators = [
|
|
2585
2592
|
{ type: Component, args: [{
|
|
2586
2593
|
selector: 'aup-table',
|
|
2587
|
-
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\"
|
|
2588
|
-
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}"]
|
|
2589
2596
|
},] }
|
|
2590
2597
|
];
|
|
2591
2598
|
TableComponent.ctorParameters = () => [];
|
|
@@ -2628,88 +2635,6 @@ ColumnTemplateDirective.propDecorators = {
|
|
|
2628
2635
|
aupColumnTemplateAutoPadChild: [{ type: Input }]
|
|
2629
2636
|
};
|
|
2630
2637
|
|
|
2631
|
-
/**
|
|
2632
|
-
* Example:
|
|
2633
|
-
* @example
|
|
2634
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2635
|
-
* table.pluck("firstName");
|
|
2636
|
-
* table.pluck("lastName");
|
|
2637
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2638
|
-
* });
|
|
2639
|
-
*
|
|
2640
|
-
* Editable tables
|
|
2641
|
-
* @example
|
|
2642
|
-
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
2643
|
-
* if (form.validate()) {
|
|
2644
|
-
* // normal form save stuff
|
|
2645
|
-
* return true; // finish editing
|
|
2646
|
-
* }
|
|
2647
|
-
* return false; // continue editiing
|
|
2648
|
-
* }
|
|
2649
|
-
* const colorsNames: ListModel<string> = ...;
|
|
2650
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2651
|
-
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
2652
|
-
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
2653
|
-
* validators: [Validator.present("We need a last name")]
|
|
2654
|
-
* });
|
|
2655
|
-
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
2656
|
-
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
2657
|
-
* initialiseComponent(component: SelectInputComponent) {
|
|
2658
|
-
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
2659
|
-
* }
|
|
2660
|
-
* });
|
|
2661
|
-
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
2662
|
-
* });
|
|
2663
|
-
*
|
|
2664
|
-
* Selection models
|
|
2665
|
-
* @example
|
|
2666
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2667
|
-
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
2668
|
-
* table.pluck("firstName");
|
|
2669
|
-
* table.pluck("lastName");
|
|
2670
|
-
* });
|
|
2671
|
-
*
|
|
2672
|
-
* Custom cell renderers and editors
|
|
2673
|
-
* @example
|
|
2674
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2675
|
-
* table.pluck("favoriteColor")
|
|
2676
|
-
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
2677
|
-
* // configure your component with what ever you need.
|
|
2678
|
-
* });
|
|
2679
|
-
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
2680
|
-
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
2681
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2682
|
-
* });
|
|
2683
|
-
*
|
|
2684
|
-
* I18n
|
|
2685
|
-
* @example
|
|
2686
|
-
* [table.yml]
|
|
2687
|
-
* table:
|
|
2688
|
-
* columns(ColumnTextProperties[]):
|
|
2689
|
-
* firstName:
|
|
2690
|
-
* headerText: "First Name"
|
|
2691
|
-
* fullName:
|
|
2692
|
-
* headerText: "Full Name"
|
|
2693
|
-
*
|
|
2694
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2695
|
-
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
2696
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2697
|
-
*
|
|
2698
|
-
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
2699
|
-
* });
|
|
2700
|
-
*/
|
|
2701
|
-
class TableModel extends AbstractTableModel {
|
|
2702
|
-
static fromList(sourceOfTruth, builder) {
|
|
2703
|
-
const model = new TableModel(sourceOfTruth);
|
|
2704
|
-
if (builder)
|
|
2705
|
-
builder(model);
|
|
2706
|
-
return model;
|
|
2707
|
-
}
|
|
2708
|
-
addSelectionColumn(selectionModel) {
|
|
2709
|
-
return this._addSelectionColumn(selectionModel);
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
|
|
2713
2638
|
class TableCellRendererComponent extends DisposableComponent {
|
|
2714
2639
|
constructor() {
|
|
2715
2640
|
super();
|
|
@@ -4836,6 +4761,88 @@ ResizeAwareComponent.ctorParameters = () => [
|
|
|
4836
4761
|
{ type: NgZone }
|
|
4837
4762
|
];
|
|
4838
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
|
+
|
|
4839
4846
|
/**
|
|
4840
4847
|
* @file Automatically generated by barrelsby.
|
|
4841
4848
|
*/
|