@coolon/angular-ui-powerups 12.4.0-alpha.85 → 12.4.0-alpha.87

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.
@@ -20,6 +20,7 @@ export class ColumnListModel extends AbstractComputedListModel {
20
20
  if (this.hasColumn(column.columnId)) {
21
21
  lang.illegalState(`Column with id=${column.columnId} already exists`);
22
22
  }
23
+ this.registerDisposable(column);
23
24
  this.runInTransaction(() => {
24
25
  if (!_.isNil(index)) {
25
26
  this._allColumns.insert(index, column);
@@ -27,7 +28,7 @@ export class ColumnListModel extends AbstractComputedListModel {
27
28
  else {
28
29
  this._allColumns.push(column);
29
30
  }
30
- this.trackSource(column.visible);
31
+ this.registerDisposable(this.trackSource(column.visible));
31
32
  });
32
33
  return column;
33
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"column-list-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/column-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,IAAI,EAA4B,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,OAAO,eAAqB,SAAQ,yBAAoD;IAK5F;QACE,KAAK,EAAE,CAAC;QAJO,gBAAW,GAAG,IAAI,gBAAgB,EAAoB,CAAC;QAKtE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,SAAS,CAA6B,MAAS,EAAE,KAAc;QAC7D,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACnC,IAAI,CAAC,YAAY,CAAC,kBAAkB,MAAM,CAAC,QAAQ,iBAAiB,CAAC,CAAC;SACvE;QACD,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACzB,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACnB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aACxC;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC/B;YACD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { AbstractComputedListModel, Dsl, lang, ListModel, MapModelChain, MutableListModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { ColumnModel } from './table/column-model';\n\nexport class ColumnListModel<Row> extends AbstractComputedListModel<ColumnModel<Row>, boolean> {\n\n private readonly _allColumns = new MutableListModel<ColumnModel<Row>>();\n private readonly columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.columnsById = chain(this._allColumns).indexBy('columnId');\n }\n\n get allColumns(): ListModel<ColumnModel<Row>> {\n return this._allColumns.readonly;\n }\n\n getColumn(id: string): ColumnModel<Row> {\n return this.columnsById.get(id);\n }\n\n hasColumn(id: string): boolean {\n return !!this.columnsById.get(id);\n }\n\n addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n if (this.hasColumn(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n }\n this.runInTransaction(() => {\n if (!_.isNil(index)) {\n this._allColumns.insert(index, column);\n } else {\n this._allColumns.push(column);\n }\n this.trackSource(column.visible);\n });\n return column;\n }\n\n doComputeValue(): ColumnModel<Row>[] {\n return this._allColumns.value.filter(c => c.visible.value);\n }\n}\n"]}
1
+ {"version":3,"file":"column-list-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/column-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,IAAI,EAA4B,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,OAAO,eAAqB,SAAQ,yBAAoD;IAK5F;QACE,KAAK,EAAE,CAAC;QAJO,gBAAW,GAAG,IAAI,gBAAgB,EAAoB,CAAC;QAKtE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,SAAS,CAA6B,MAAS,EAAE,KAAc;QAC7D,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACnC,IAAI,CAAC,YAAY,CAAC,kBAAkB,MAAM,CAAC,QAAQ,iBAAiB,CAAC,CAAC;SACvE;QACD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACzB,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACnB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aACxC;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC/B;YACD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { AbstractComputedListModel, Dsl, lang, ListModel, MapModelChain, MutableListModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { ColumnModel } from './table/column-model';\n\nexport class ColumnListModel<Row> extends AbstractComputedListModel<ColumnModel<Row>, boolean> {\n\n private readonly _allColumns = new MutableListModel<ColumnModel<Row>>();\n private readonly columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.columnsById = chain(this._allColumns).indexBy('columnId');\n }\n\n get allColumns(): ListModel<ColumnModel<Row>> {\n return this._allColumns.readonly;\n }\n\n getColumn(id: string): ColumnModel<Row> {\n return this.columnsById.get(id);\n }\n\n hasColumn(id: string): boolean {\n return !!this.columnsById.get(id);\n }\n\n addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n if (this.hasColumn(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n }\n this.registerDisposable(column);\n this.runInTransaction(() => {\n if (!_.isNil(index)) {\n this._allColumns.insert(index, column);\n } else {\n this._allColumns.push(column);\n }\n this.registerDisposable(this.trackSource(column.visible));\n });\n return column;\n }\n\n doComputeValue(): ColumnModel<Row>[] {\n return this._allColumns.value.filter(c => c.visible.value);\n }\n}\n"]}
@@ -3092,6 +3092,7 @@ class ColumnListModel extends AbstractComputedListModel {
3092
3092
  if (this.hasColumn(column.columnId)) {
3093
3093
  lang.illegalState(`Column with id=${column.columnId} already exists`);
3094
3094
  }
3095
+ this.registerDisposable(column);
3095
3096
  this.runInTransaction(() => {
3096
3097
  if (!_.isNil(index)) {
3097
3098
  this._allColumns.insert(index, column);
@@ -3099,7 +3100,7 @@ class ColumnListModel extends AbstractComputedListModel {
3099
3100
  else {
3100
3101
  this._allColumns.push(column);
3101
3102
  }
3102
- this.trackSource(column.visible);
3103
+ this.registerDisposable(this.trackSource(column.visible));
3103
3104
  });
3104
3105
  return column;
3105
3106
  }