@zeedhi/common 1.39.0 → 1.39.1

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.
@@ -4313,10 +4313,10 @@ class Column extends Component {
4313
4313
  * Apply conditions
4314
4314
  * @param row Datasource row
4315
4315
  */
4316
- applyCondition(row) {
4316
+ applyCondition(row, factoredConditions = this.factoredConditions) {
4317
4317
  const appliedConditions = {};
4318
- Object.keys(this.factoredConditions).forEach((condition) => {
4319
- const conditionFunction = this.factoredConditions[condition];
4318
+ Object.keys(factoredConditions).forEach((condition) => {
4319
+ const conditionFunction = factoredConditions[condition];
4320
4320
  set(appliedConditions, condition, conditionFunction({ row, column: this }));
4321
4321
  });
4322
4322
  return appliedConditions;
@@ -4331,11 +4331,7 @@ class Column extends Component {
4331
4331
  const appliedConditions = {};
4332
4332
  Object.keys(this.actionFactoredConditions).forEach((action) => {
4333
4333
  const factoredConditions = this.actionFactoredConditions[action];
4334
- appliedConditions[action] = {};
4335
- Object.keys(factoredConditions).forEach((condition) => {
4336
- const conditionFunction = factoredConditions[condition];
4337
- set(appliedConditions[action], condition, conditionFunction({ row }));
4338
- });
4334
+ appliedConditions[action] = Object.assign({}, this.applyCondition(row, factoredConditions));
4339
4335
  });
4340
4336
  return appliedConditions;
4341
4337
  }
@@ -4320,10 +4320,10 @@
4320
4320
  * Apply conditions
4321
4321
  * @param row Datasource row
4322
4322
  */
4323
- applyCondition(row) {
4323
+ applyCondition(row, factoredConditions = this.factoredConditions) {
4324
4324
  const appliedConditions = {};
4325
- Object.keys(this.factoredConditions).forEach((condition) => {
4326
- const conditionFunction = this.factoredConditions[condition];
4325
+ Object.keys(factoredConditions).forEach((condition) => {
4326
+ const conditionFunction = factoredConditions[condition];
4327
4327
  set__default["default"](appliedConditions, condition, conditionFunction({ row, column: this }));
4328
4328
  });
4329
4329
  return appliedConditions;
@@ -4338,11 +4338,7 @@
4338
4338
  const appliedConditions = {};
4339
4339
  Object.keys(this.actionFactoredConditions).forEach((action) => {
4340
4340
  const factoredConditions = this.actionFactoredConditions[action];
4341
- appliedConditions[action] = {};
4342
- Object.keys(factoredConditions).forEach((condition) => {
4343
- const conditionFunction = factoredConditions[condition];
4344
- set__default["default"](appliedConditions[action], condition, conditionFunction({ row }));
4345
- });
4341
+ appliedConditions[action] = Object.assign({}, this.applyCondition(row, factoredConditions));
4346
4342
  });
4347
4343
  return appliedConditions;
4348
4344
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.39.0",
3
+ "version": "1.39.1",
4
4
  "description": "Zeedhi Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -37,5 +37,5 @@
37
37
  "lodash.times": "^4.3.2",
38
38
  "mockdate": "^3.0.2"
39
39
  },
40
- "gitHead": "71a699db31a055a0ea5102b6903c97f80bc34edd"
40
+ "gitHead": "fbf85c6aaac496ff2df31cf231d70b79b3114e5c"
41
41
  }
@@ -1,4 +1,4 @@
1
- import { IDictionary, Datasource } from '@zeedhi/core';
1
+ import { IDictionary, Datasource, IEvents } from '@zeedhi/core';
2
2
  import { IColumn, ColumnAlign, ColumnType } from './interfaces';
3
3
  import { Component } from '../zd-component/component';
4
4
  /**
@@ -69,7 +69,9 @@ export declare class Column extends Component implements IColumn {
69
69
  * Apply conditions
70
70
  * @param row Datasource row
71
71
  */
72
- applyCondition(row: IDictionary<any>): IDictionary<any>;
72
+ applyCondition(row: IDictionary<any>, factoredConditions?: IEvents<{
73
+ row: IDictionary<any>;
74
+ }>): IDictionary<any>;
73
75
  /**
74
76
  * Apply conditions on action columns
75
77
  * @param row Datasource row