@coolon/angular-ui-powerups 2.0.0-alpha.17 → 2.0.0-alpha.18

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 (74) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +59 -42
  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/components.module.ngfactory.js.map +1 -1
  8. package/esm2015/lib/components/forms/abstract-input.component.js +12 -4
  9. package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
  10. package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
  11. package/esm2015/lib/components/forms/abstract-list-input.component.js +20 -14
  12. package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
  13. package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
  14. package/esm2015/lib/components/forms/abstract-value-input.component.js +20 -17
  15. package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
  16. package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
  17. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +1 -1
  18. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
  19. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json +1 -1
  20. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
  21. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
  22. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
  23. package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js +1 -1
  24. package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
  25. package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.metadata.json +1 -1
  26. package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
  27. package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
  28. package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
  29. package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
  30. package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
  31. package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
  32. package/esm2015/lib/components/forms/select-input/select-input.component.js +1 -1
  33. package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
  34. package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
  35. package/esm2015/lib/components/forms/string-input/string-input.component.js +3 -3
  36. package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
  37. package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
  38. package/esm2015/lib/components/forms/text-input/text-input.component.js +1 -1
  39. package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
  40. package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
  41. package/esm2015/lib/components/table/column-model.js.map +1 -1
  42. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  43. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  44. package/esm5/lib/components/forms/abstract-input.component.js +12 -4
  45. package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
  46. package/esm5/lib/components/forms/abstract-list-input.component.js +20 -14
  47. package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
  48. package/esm5/lib/components/forms/abstract-value-input.component.js +20 -17
  49. package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
  50. package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js +1 -1
  51. package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
  52. package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
  53. package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
  54. package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js +1 -1
  55. package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
  56. package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
  57. package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
  58. package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
  59. package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
  60. package/esm5/lib/components/forms/select-input/select-input.component.js +1 -1
  61. package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
  62. package/esm5/lib/components/forms/string-input/string-input.component.js +3 -3
  63. package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
  64. package/esm5/lib/components/forms/text-input/text-input.component.js +1 -1
  65. package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
  66. package/esm5/lib/components/table/column-model.js.map +1 -1
  67. package/fesm2015/coolon-angular-ui-powerups.js +60 -43
  68. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  69. package/fesm5/coolon-angular-ui-powerups.js +60 -43
  70. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  71. package/lib/components/forms/abstract-input.component.d.ts +8 -2
  72. package/lib/components/forms/abstract-list-input.component.d.ts +3 -3
  73. package/lib/components/forms/abstract-value-input.component.d.ts +3 -3
  74. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"column-model.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/column-model.ts"],"names":[],"mappings":";AAEA,OAAO,EAGL,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,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,SAAS,CAAC,cAAc,GAAG,cAAc,CAAC;gBAC1C,SAAS,CAAC,oBAAoB,GAAG,KAAI,CAAC,qBAAqB,CAAC;YAC9D,CAAC,CAAC,CAAC;SACJ;QACD,KAAI,CAAC,qBAAqB,CAAC,IAAI,8BAA8B,CAAC,2BAA2B,EAAE,UAAC,SAAS,EAAE,OAAqB;YAC1H,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YAC5B,SAAS,CAAC,cAAc,GAAG,cAAc,CAAC;QAC5C,CAAC,CAAC,CAAC,CAAC;;IACN,CAAC;IAES,mDAAoB,GAA9B;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,6DAA8B,GAA9B;QACE,OAAO,IAAI,CAAC,+BAA+B,EAAE,CAAC;IAChD,CAAC;IAED,+CAAgB,GAAhB,UAAiB,gBAAyB;QACxC,6EAA6E;QAC7E,wCAAwC;QACxC,OAAO,iBAAM,gBAAgB,YAAC,gBAAgB,CAAC,CAAC;IAClD,CAAC;IAED,mDAAoB,GAApB,UAAqB,MAAe;QAClC,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wCAAS,GAAT,UAAU,GAAQ;QAChB,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;IACH,2BAAC;AAAD,CAAC,AAzCD,CAA+C,WAAW,GAyCzD","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { TemplateRef, ViewContainerRef } from '@angular/core';\nimport {\n Command,\n DirtyTrackingForm,\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 { 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 { 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\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 defaults: ColumnModel.Defaults) {\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.defaults.getColumnTextProperties(this);\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 interface Defaults {\n getColumnTextProperties(columnModel: ColumnModel<any>): ColumnTextProperties;\n }\n}\n\nexport interface CellEditorOptions<V, C> { //extends CellRendererOptions<E> {\n validators?: Validator<V>[];\n\n initialiseComponent?(component: C);\n}\n\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\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.Defaults) {\n super(id, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer<E extends { value: Row[P] }>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this\n cellRenderer<E extends { value: Row[P] }>(componentType: ComponentType<E>, onComponentInit?: OnComponentInit<E>): this\n cellRenderer<E extends { value: 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 }));\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.Defaults) {\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.Defaults, 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.Defaults) {\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.Defaults) {\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.Defaults, private 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":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/column-model.ts"],"names":[],"mappings":";AAEA,OAAO,EAGL,sBAAsB,EAKvB,MAAM,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,2BAAqB,GAAG,IAAI,CAAC;QAInC,KAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,cAAc,YAAY,sBAAsB,EAAE;YACpD,KAAI,CAAC,kBAAkB,CAAC,iCAAiC,EAAE,UAAC,SAAS;gBACnE,SAAS,CAAC,cAAc,GAAG,cAAc,CAAC;gBAC1C,SAAS,CAAC,oBAAoB,GAAG,KAAI,CAAC,qBAAqB,CAAC;YAC9D,CAAC,CAAC,CAAC;SACJ;QACD,KAAI,CAAC,qBAAqB,CAAC,IAAI,8BAA8B,CAAC,2BAA2B,EAAE,UAAC,SAAS,EAAE,OAAqB;YAC1H,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YAC5B,SAAS,CAAC,cAAc,GAAG,cAAc,CAAC;QAC5C,CAAC,CAAC,CAAC,CAAC;;IACN,CAAC;IAES,mDAAoB,GAA9B;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,6DAA8B,GAA9B;QACE,OAAO,IAAI,CAAC,+BAA+B,EAAE,CAAC;IAChD,CAAC;IAED,+CAAgB,GAAhB,UAAiB,gBAAyB;QACxC,6EAA6E;QAC7E,wCAAwC;QACxC,OAAO,iBAAM,gBAAgB,YAAC,gBAAgB,CAAC,CAAC;IAClD,CAAC;IAED,mDAAoB,GAApB,UAAqB,MAAe;QAClC,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wCAAS,GAAT,UAAU,GAAQ;QAChB,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;IACH,2BAAC;AAAD,CAAC,AAzCD,CAA+C,WAAW,GAyCzD","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { EventEmitter, TemplateRef, ViewContainerRef } from '@angular/core';\nimport {\n Command,\n DirtyTrackingForm,\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 { 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 { 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\n\ninterface CellRenderer<T> {\n value: T\n}\n\ninterface MutableCellRenderer<T> extends CellRenderer<T> {\n value: T;\n valueChange: EventEmitter<T>;\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 defaults: ColumnModel.Defaults) {\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.defaults.getColumnTextProperties(this);\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 interface Defaults {\n getColumnTextProperties(columnModel: ColumnModel<any>): ColumnTextProperties;\n }\n}\n\nexport interface CellEditorOptions<V, C> { //extends CellRendererOptions<E> {\n validators?: Validator<V>[];\n\n initialiseComponent?(component: C);\n}\n\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\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.Defaults) {\n super(id, defaults);\n this.cellRenderer(DefaultCellRendererComponent);\n }\n\n cellRenderer<E extends { value: Row[P] }>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this\n cellRenderer<E extends { value: Row[P] }>(componentType: ComponentType<E>, onComponentInit?: OnComponentInit<E>): this\n cellRenderer<E extends { value: 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 }));\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.Defaults) {\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.Defaults, 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.Defaults) {\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.Defaults) {\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.Defaults, private 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"]}
@@ -17,7 +17,7 @@ import { MatTableModule } from '@angular/material/table';
17
17
  import { MatTooltipModule } from '@angular/material/tooltip';
18
18
  import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
19
19
  import { fas } from '@fortawesome/free-solid-svg-icons';
20
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Binding, Functions } from '@coolon/pectin';
20
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, FocusManager, EventListenerList, Form, MutableListModel, Guard, Binding, DebugContext, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Functions } from '@coolon/pectin';
21
21
  import ___default, { isEqual, isNil } from 'lodash';
22
22
  import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
23
23
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
@@ -468,6 +468,7 @@ FocusableComponent = __decorate([
468
468
  let AbstractInputComponent = class AbstractInputComponent extends DisposableComponent {
469
469
  constructor() {
470
470
  super();
471
+ this.onValueEditedListeners = new EventListenerList();
471
472
  this.dense = false;
472
473
  // TODO: fix this.
473
474
  // tslint:disable-next-line:no-output-native
@@ -516,19 +517,19 @@ let AbstractInputComponent = class AbstractInputComponent extends DisposableComp
516
517
  return this.enabled.value;
517
518
  }
518
519
  get enabled() {
519
- return this.inputModel.enabled;
520
+ return this.formValueModel.enabled;
520
521
  }
521
522
  hasErrors() {
522
523
  return !this.errorList.query().isEmpty();
523
524
  }
524
525
  get errorList() {
525
- return this.inputModel.errorList;
526
+ return this.formValueModel.errorList;
526
527
  }
527
528
  get firstError() {
528
529
  return this.hasErrors() ? this.errorList.value[0] : null;
529
530
  }
530
531
  get focusContext() {
531
- return this.inputModel.focusContext;
532
+ return this.formValueModel.focusContext;
532
533
  }
533
534
  get floatLabel() {
534
535
  return this.dense ? 'never' : this.userFloatLabel;
@@ -536,6 +537,13 @@ let AbstractInputComponent = class AbstractInputComponent extends DisposableComp
536
537
  get showHint() {
537
538
  return this.dense ? false : !!this.hint;
538
539
  }
540
+ /**
541
+ * Invokes the callback when this components value is changed by a user edit.
542
+ * @param callback
543
+ */
544
+ onValueEdited(callback) {
545
+ return this.onValueEditedListeners.add(callback);
546
+ }
539
547
  };
540
548
  __decorate([
541
549
  Input(),
@@ -635,30 +643,36 @@ let AbstractListInputComponent = class AbstractListInputComponent extends Abstra
635
643
  * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
636
644
  */
637
645
  // We have to register it as a disposable so it ditches any listeners when we're disposed.
638
- this.inputModel = this.registerDisposable(new Form.DelegatingListModel());
646
+ this.formValueModel = this.registerDisposable(new Form.DelegatingListModel());
647
+ this.componentListModel = new MutableListModel();
639
648
  this.setValueIsInProgress = new Guard();
640
649
  this.valueChange = new EventEmitter();
641
- const { when } = Dsl.disposeWith(this);
642
- when(this.inputModel).changes(value => this.valueChange.emit(value), {
650
+ const { when, valueOf, chain } = Dsl.disposeWith(this);
651
+ const binding = new Binding.Identity(this.formValueModel, this.componentListModel);
652
+ const inExternalChange = valueOf.any(this.setValueIsInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
653
+ when(this.componentListModel).changes((is, was) => {
654
+ this.valueChange.emit(is);
655
+ this.onValueEditedListeners.fire(l => l(is, was));
656
+ }, {
643
657
  initialValue: 'ignore',
644
- unless: this.setValueIsInProgress
658
+ // we never fire events during an external changes to the value. This allows
659
+ // the component to behave when used in the conventional angular
660
+ // fashion, i.e. [(value)]="..."
661
+ unless: inExternalChange
645
662
  });
646
- DebugContext.tag(this.inputModel, `${this.constructor.name}.inputModel`);
663
+ DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);
647
664
  }
665
+ // We add support for simple direct display of values by allowing components to be used
666
+ // by `component.value = ...` This use of the component without a value model in tables
667
+ // and the like.
648
668
  set value(value) {
649
669
  this.setValueIsInProgress.whileTrue(() => {
650
- if (!this.listHolder) {
651
- this.listHolder = new MutableListModel(value);
652
- this.listModel = this.listHolder;
653
- }
654
- else {
655
- this.listHolder.value = value;
656
- }
670
+ this.componentListModel.value = value;
657
671
  });
658
672
  }
659
673
  };
660
674
  __decorate([
661
- Input(), TrackExternal({ delegateTo: 'inputModel' }),
675
+ Input(), TrackExternal({ delegateTo: 'formValueModel' }),
662
676
  __metadata("design:type", Object)
663
677
  ], AbstractListInputComponent.prototype, "listModel", void 0);
664
678
  __decorate([
@@ -689,33 +703,36 @@ let AbstractValueInputComponent = class AbstractValueInputComponent extends Abst
689
703
  * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
690
704
  */
691
705
  // We have to register it as a disposable so it ditches any listeners when we're disposed.
692
- this.inputModel = this.registerDisposable(new Form.DelegatingValueModel());
706
+ this.formValueModel = this.registerDisposable(new Form.DelegatingValueModel());
693
707
  this.setValueInProgress = new Guard();
708
+ this.componentValueModel = new MutableValueModel();
694
709
  this.valueChange = new EventEmitter();
695
- const { when } = Dsl.disposeWith(this);
696
- when(this.inputModel).changes(value => this.valueChange.emit(value), {
710
+ const { when, chain, valueOf } = Dsl.disposeWith(this);
711
+ const binding = new Binding.Identity(this.formValueModel, this.componentValueModel);
712
+ const inExternalChange = valueOf.any(this.setValueInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
713
+ when(this.componentValueModel).changes((is, was) => {
714
+ this.valueChange.emit(is);
715
+ this.onValueEditedListeners.fire(l => l(is, was));
716
+ }, {
697
717
  initialValue: 'ignore',
698
- unless: this.setValueInProgress
718
+ // we never fire events during an external set value operation. This allows
719
+ // the component to behave when used in the conventional angular
720
+ // fashion, i.e. [(value)]="..."
721
+ unless: inExternalChange
699
722
  });
700
- DebugContext.tag(this.inputModel, `${this.constructor.name}.inputModel`);
723
+ DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);
701
724
  }
725
+ // We add support for simple direct display of values by allowing components to be used
726
+ // by `component.value = ...` This use of the component without a value model in tables
727
+ // and the like.
702
728
  set value(value) {
703
- // we never fire events during an external set value operation. This allows
704
- // the component to behave when used in the conventional angular
705
- // fashion, i.e. [(value)]="..."
706
729
  this.setValueInProgress.whileTrue(() => {
707
- if (!this.valueHolder) {
708
- this.valueHolder = new MutableValueModel(value);
709
- this.valueModel = this.valueHolder;
710
- }
711
- else {
712
- this.valueHolder.value = value;
713
- }
730
+ this.componentValueModel.value = value;
714
731
  });
715
732
  }
716
733
  };
717
734
  __decorate([
718
- Input(), TrackExternal({ delegateTo: 'inputModel' }),
735
+ Input(), TrackExternal({ delegateTo: 'formValueModel' }),
719
736
  __metadata("design:type", Object)
720
737
  ], AbstractValueInputComponent.prototype, "valueModel", void 0);
721
738
  __decorate([
@@ -790,7 +807,7 @@ __decorate([
790
807
  AutocompleteInputComponent = __decorate([
791
808
  Component({
792
809
  selector: 'aup-autocomplete-input',
793
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"valueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
810
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
794
811
  styles: [":host{display:inline-block}mat-form-field{width:100%}"]
795
812
  }),
796
813
  __metadata("design:paramtypes", [])
@@ -818,7 +835,7 @@ __decorate([
818
835
  CheckboxInputComponent = __decorate([
819
836
  Component({
820
837
  selector: 'aup-checkbox-input',
821
- template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"valueModel.value\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{label}}</mat-checkbox>\n<mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n<mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n",
838
+ template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"componentValueModel.value\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{label}}</mat-checkbox>\n<mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n<mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n",
822
839
  styles: [":host{display:inline-flex;flex-direction:column;padding:24px 0 16px}:host.dense{padding:6px 0 2px}mat-error,mat-hint{margin-top:4px;margin-left:24px;font-size:12px;font-weight:400;line-height:13.5px}"]
823
840
  }),
824
841
  __metadata("design:paramtypes", [])
@@ -862,7 +879,7 @@ __decorate([
862
879
  MultipleSelectInputComponent = __decorate([
863
880
  Component({
864
881
  selector: 'aup-multiple-select-input',
865
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n multiple\n [(ngModel)]=\"listModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
882
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n multiple\n [(ngModel)]=\"componentListModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
866
883
  styles: [":host{display:inline-block}mat-form-field{width:100%}"]
867
884
  }),
868
885
  __metadata("design:paramtypes", [])
@@ -890,7 +907,7 @@ __decorate([
890
907
  NumberInputComponent = __decorate([
891
908
  Component({
892
909
  selector: 'aup-number-input',
893
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [min]=\"min\"\n [max]=\"max\"\n >\n <mat-hint *ngIf=\"hint && !dense\" >{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
910
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [min]=\"min\"\n [max]=\"max\"\n >\n <mat-hint *ngIf=\"hint && !dense\" >{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
894
911
  styles: [""]
895
912
  }),
896
913
  __metadata("design:paramtypes", [])
@@ -908,7 +925,7 @@ let PasswordInputComponent = class PasswordInputComponent extends AbstractValueI
908
925
  PasswordInputComponent = __decorate([
909
926
  Component({
910
927
  selector: 'aup-password-input',
911
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
928
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
912
929
  styles: [""]
913
930
  }),
914
931
  __metadata("design:paramtypes", [])
@@ -960,7 +977,7 @@ __decorate([
960
977
  SelectInputComponent = __decorate([
961
978
  Component({
962
979
  selector: 'aup-select-input',
963
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
980
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
964
981
  styles: [":host{display:inline-block}mat-form-field{width:100%}"]
965
982
  }),
966
983
  __metadata("design:paramtypes", [])
@@ -971,9 +988,9 @@ let StringInputComponent = class StringInputComponent extends AbstractValueInput
971
988
  super();
972
989
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
973
990
  this.clearCommand = Command.create(() => {
974
- this.valueModel.value = null;
991
+ this.componentValueModel.value = null;
975
992
  });
976
- this.clearCommand.disableWhile(chain.stringValue(this.valueModel).isBlank());
993
+ this.clearCommand.disableWhile(chain.stringValue(this.componentValueModel).isBlank());
977
994
  }
978
995
  ngOnInit() {
979
996
  }
@@ -989,7 +1006,7 @@ __decorate([
989
1006
  StringInputComponent = __decorate([
990
1007
  Component({
991
1008
  selector: 'aup-string-input',
992
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n</mat-form-field>\n\n",
1009
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n</mat-form-field>\n\n",
993
1010
  styles: ["button[disabled]{visibility:hidden}"]
994
1011
  }),
995
1012
  __metadata("design:paramtypes", [])
@@ -1017,7 +1034,7 @@ __decorate([
1017
1034
  TextInputComponent = __decorate([
1018
1035
  Component({
1019
1036
  selector: 'aup-text-input',
1020
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
1037
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
1021
1038
  styles: ["button[disabled]{visibility:hidden}textarea{overflow:auto}"]
1022
1039
  }),
1023
1040
  __metadata("design:paramtypes", [])