@teselagen/ui 0.5.23-beta.11 → 0.5.23-beta.13

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.
@@ -13,7 +13,7 @@
13
13
  * @property {object} defaults - tableParam defaults such as pageSize, filter, etc
14
14
  * @property {boolean} noOrderError - won't console an error if an order is not found on schema
15
15
  */
16
- export default function withTableParams(compOrOpts: compOrOpts, pTopLevelOpts: any): any;
16
+ export default function withTableParams(topLevelOptions: any): any;
17
17
  /**
18
18
  * Note all these options can be passed at Design Time or at Runtime (like reduxForm())
19
19
  */
package/index.cjs.js CHANGED
@@ -47942,7 +47942,10 @@ const RenderColumns = /* @__PURE__ */ __name(({
47942
47942
  setNewParams
47943
47943
  });
47944
47944
  } else if (cellRenderer && cellRenderer[column.path]) {
47945
- text2 = cellRenderer[column.path](row.value, row.original, row);
47945
+ text2 = cellRenderer[column.path](row.value, row.original, row, {
47946
+ currentParams,
47947
+ setNewParams
47948
+ });
47946
47949
  } else if (text2) {
47947
47950
  text2 = React$1.isValidElement(text2) ? text2 : String(text2);
47948
47951
  }
@@ -48160,7 +48163,10 @@ const RenderColumns = /* @__PURE__ */ __name(({
48160
48163
  }
48161
48164
  if (cellRenderer && cellRenderer[column.path]) {
48162
48165
  tableColumn.Cell = (row) => {
48163
- const val = cellRenderer[column.path](row.value, row.original, row);
48166
+ const val = cellRenderer[column.path](row.value, row.original, row, {
48167
+ currentParams,
48168
+ setNewParams
48169
+ });
48164
48170
  return val;
48165
48171
  };
48166
48172
  } else if (column.render) {
@@ -64397,29 +64403,14 @@ const withStore = /* @__PURE__ */ __name((Component) => {
64397
64403
  return /* @__PURE__ */ React$1.createElement(Component, __spreadProps(__spreadValues({}, props), { store }));
64398
64404
  };
64399
64405
  }, "withStore");
64400
- const isEq = /* @__PURE__ */ __name((o1, o2) => {
64401
- const isEq2 = isEqualWith(o1, o2, function(val1, val2) {
64402
- if (isFunction$4(val1) && isFunction$4(val2)) {
64403
- return val1 === val2 || val1.toString() === val2.toString();
64404
- }
64405
- if (val1 && val1.constructor && val1.constructor.name === "FiberNode")
64406
- return true;
64407
- });
64408
- return isEq2;
64409
- }, "isEq");
64410
- const pure = /* @__PURE__ */ __name((BaseComponent) => {
64411
- const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
64412
- return hoc(BaseComponent);
64413
- }, "pure");
64414
- function withTableParams(compOrOpts, pTopLevelOpts) {
64415
- let topLevelOptions;
64416
- let Component;
64417
- if (!pTopLevelOpts) {
64418
- topLevelOptions = compOrOpts;
64419
- } else {
64420
- topLevelOptions = pTopLevelOpts;
64421
- Component = compOrOpts;
64422
- }
64406
+ const getSchema = /* @__PURE__ */ __name((options) => {
64407
+ const { schema } = options;
64408
+ if (isFunction$4(schema))
64409
+ return schema(options);
64410
+ else
64411
+ return schema;
64412
+ }, "getSchema");
64413
+ function withTableParams(topLevelOptions) {
64423
64414
  const { isLocalCall = false } = topLevelOptions;
64424
64415
  const mapStateToProps = /* @__PURE__ */ __name((state, ownProps) => {
64425
64416
  var _a, _b;
@@ -64594,23 +64585,11 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
64594
64585
  }),
64595
64586
  //don't use withRouter if noRouter is passed!
64596
64587
  branch((props) => !props.noRouter, withRouter),
64597
- reactRedux.connect(mapStateToProps, mapDispatchToProps, mergeProps),
64598
- pure
64588
+ reactRedux.connect(mapStateToProps, mapDispatchToProps, mergeProps)
64599
64589
  );
64600
- if (Component) {
64601
- return toReturn(Component);
64602
- }
64603
64590
  return toReturn;
64604
64591
  }
64605
64592
  __name(withTableParams, "withTableParams");
64606
- function getSchema(options) {
64607
- const { schema } = options;
64608
- if (isFunction$4(schema))
64609
- return schema(options);
64610
- else
64611
- return schema;
64612
- }
64613
- __name(getSchema, "getSchema");
64614
64593
  function showAppSpinner() {
64615
64594
  return renderOnDocSimple(
64616
64595
  /* @__PURE__ */ React$1.createElement(core.Overlay, { isOpen: true }, /* @__PURE__ */ React$1.createElement(Loading, { centeredInPage: true, loading: true }))
@@ -69414,6 +69393,20 @@ function withSelectTableRecords(_tableFormName, propName = "selectTableRecords")
69414
69393
  );
69415
69394
  }
69416
69395
  __name(withSelectTableRecords, "withSelectTableRecords");
69396
+ const isEq = /* @__PURE__ */ __name((o1, o2) => {
69397
+ const isEq2 = isEqualWith(o1, o2, function(val1, val2) {
69398
+ if (isFunction$4(val1) && isFunction$4(val2)) {
69399
+ return val1 === val2 || val1.toString() === val2.toString();
69400
+ }
69401
+ if (val1 && val1.constructor && val1.constructor.name === "FiberNode")
69402
+ return true;
69403
+ });
69404
+ return isEq2;
69405
+ }, "isEq");
69406
+ const pure = /* @__PURE__ */ __name((BaseComponent) => {
69407
+ const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
69408
+ return hoc(BaseComponent);
69409
+ }, "pure");
69417
69410
  const isSafari = /^((?!chrome|android).)*safari/i.test(
69418
69411
  navigator.userAgent
69419
69412
  );
package/index.es.js CHANGED
@@ -47924,7 +47924,10 @@ const RenderColumns = /* @__PURE__ */ __name(({
47924
47924
  setNewParams
47925
47925
  });
47926
47926
  } else if (cellRenderer && cellRenderer[column.path]) {
47927
- text2 = cellRenderer[column.path](row.value, row.original, row);
47927
+ text2 = cellRenderer[column.path](row.value, row.original, row, {
47928
+ currentParams,
47929
+ setNewParams
47930
+ });
47928
47931
  } else if (text2) {
47929
47932
  text2 = isValidElement(text2) ? text2 : String(text2);
47930
47933
  }
@@ -48142,7 +48145,10 @@ const RenderColumns = /* @__PURE__ */ __name(({
48142
48145
  }
48143
48146
  if (cellRenderer && cellRenderer[column.path]) {
48144
48147
  tableColumn.Cell = (row) => {
48145
- const val = cellRenderer[column.path](row.value, row.original, row);
48148
+ const val = cellRenderer[column.path](row.value, row.original, row, {
48149
+ currentParams,
48150
+ setNewParams
48151
+ });
48146
48152
  return val;
48147
48153
  };
48148
48154
  } else if (column.render) {
@@ -64379,29 +64385,14 @@ const withStore = /* @__PURE__ */ __name((Component2) => {
64379
64385
  return /* @__PURE__ */ React__default.createElement(Component2, __spreadProps(__spreadValues({}, props), { store }));
64380
64386
  };
64381
64387
  }, "withStore");
64382
- const isEq = /* @__PURE__ */ __name((o1, o2) => {
64383
- const isEq2 = isEqualWith(o1, o2, function(val1, val2) {
64384
- if (isFunction$4(val1) && isFunction$4(val2)) {
64385
- return val1 === val2 || val1.toString() === val2.toString();
64386
- }
64387
- if (val1 && val1.constructor && val1.constructor.name === "FiberNode")
64388
- return true;
64389
- });
64390
- return isEq2;
64391
- }, "isEq");
64392
- const pure = /* @__PURE__ */ __name((BaseComponent) => {
64393
- const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
64394
- return hoc(BaseComponent);
64395
- }, "pure");
64396
- function withTableParams(compOrOpts, pTopLevelOpts) {
64397
- let topLevelOptions;
64398
- let Component2;
64399
- if (!pTopLevelOpts) {
64400
- topLevelOptions = compOrOpts;
64401
- } else {
64402
- topLevelOptions = pTopLevelOpts;
64403
- Component2 = compOrOpts;
64404
- }
64388
+ const getSchema = /* @__PURE__ */ __name((options) => {
64389
+ const { schema } = options;
64390
+ if (isFunction$4(schema))
64391
+ return schema(options);
64392
+ else
64393
+ return schema;
64394
+ }, "getSchema");
64395
+ function withTableParams(topLevelOptions) {
64405
64396
  const { isLocalCall = false } = topLevelOptions;
64406
64397
  const mapStateToProps = /* @__PURE__ */ __name((state, ownProps) => {
64407
64398
  var _a, _b;
@@ -64576,23 +64567,11 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
64576
64567
  }),
64577
64568
  //don't use withRouter if noRouter is passed!
64578
64569
  branch((props) => !props.noRouter, withRouter),
64579
- connect(mapStateToProps, mapDispatchToProps, mergeProps),
64580
- pure
64570
+ connect(mapStateToProps, mapDispatchToProps, mergeProps)
64581
64571
  );
64582
- if (Component2) {
64583
- return toReturn(Component2);
64584
- }
64585
64572
  return toReturn;
64586
64573
  }
64587
64574
  __name(withTableParams, "withTableParams");
64588
- function getSchema(options) {
64589
- const { schema } = options;
64590
- if (isFunction$4(schema))
64591
- return schema(options);
64592
- else
64593
- return schema;
64594
- }
64595
- __name(getSchema, "getSchema");
64596
64575
  function showAppSpinner() {
64597
64576
  return renderOnDocSimple(
64598
64577
  /* @__PURE__ */ React__default.createElement(Overlay, { isOpen: true }, /* @__PURE__ */ React__default.createElement(Loading, { centeredInPage: true, loading: true }))
@@ -69396,6 +69375,20 @@ function withSelectTableRecords(_tableFormName, propName = "selectTableRecords")
69396
69375
  );
69397
69376
  }
69398
69377
  __name(withSelectTableRecords, "withSelectTableRecords");
69378
+ const isEq = /* @__PURE__ */ __name((o1, o2) => {
69379
+ const isEq2 = isEqualWith(o1, o2, function(val1, val2) {
69380
+ if (isFunction$4(val1) && isFunction$4(val2)) {
69381
+ return val1 === val2 || val1.toString() === val2.toString();
69382
+ }
69383
+ if (val1 && val1.constructor && val1.constructor.name === "FiberNode")
69384
+ return true;
69385
+ });
69386
+ return isEq2;
69387
+ }, "isEq");
69388
+ const pure = /* @__PURE__ */ __name((BaseComponent) => {
69389
+ const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
69390
+ return hoc(BaseComponent);
69391
+ }, "pure");
69399
69392
  const isSafari = /^((?!chrome|android).)*safari/i.test(
69400
69393
  navigator.userAgent
69401
69394
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.5.23-beta.11",
3
+ "version": "0.5.23-beta.13",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -752,7 +752,10 @@ export const RenderColumns = ({
752
752
  setNewParams
753
753
  });
754
754
  } else if (cellRenderer && cellRenderer[column.path]) {
755
- text = cellRenderer[column.path](row.value, row.original, row);
755
+ text = cellRenderer[column.path](row.value, row.original, row, {
756
+ currentParams,
757
+ setNewParams
758
+ });
756
759
  } else if (text) {
757
760
  text = isValidElement(text) ? text : String(text);
758
761
  }
@@ -983,7 +986,10 @@ export const RenderColumns = ({
983
986
  }
984
987
  if (cellRenderer && cellRenderer[column.path]) {
985
988
  tableColumn.Cell = row => {
986
- const val = cellRenderer[column.path](row.value, row.original, row);
989
+ const val = cellRenderer[column.path](row.value, row.original, row, {
990
+ currentParams,
991
+ setNewParams
992
+ });
987
993
  return val;
988
994
  };
989
995
  } else if (column.render) {
@@ -3,8 +3,6 @@ import { connect } from "react-redux";
3
3
  import { isFunction, set } from "lodash-es";
4
4
  import { withRouter } from "react-router-dom";
5
5
  import { branch, compose } from "recompose";
6
-
7
- import pureNoFunc from "../../utils/pureNoFunc";
8
6
  import convertSchema from "./convertSchema";
9
7
  import { getRecordsFromReduxForm } from "./withSelectedEntities";
10
8
  import {
@@ -17,6 +15,17 @@ import {
17
15
  } from "./queryParams";
18
16
  import getTableConfigFromStorage from "./getTableConfigFromStorage";
19
17
 
18
+ /**
19
+ * Given the options, get the schema. This enables the user to provide
20
+ * a function instead of an object for the schema.
21
+ * @param {Object} options Merged options
22
+ */
23
+ const getSchema = options => {
24
+ const { schema } = options;
25
+ if (isFunction(schema)) return schema(options);
26
+ else return schema;
27
+ };
28
+
20
29
  /**
21
30
  * Note all these options can be passed at Design Time or at Runtime (like reduxForm())
22
31
  *
@@ -32,15 +41,7 @@ import getTableConfigFromStorage from "./getTableConfigFromStorage";
32
41
  * @property {object} defaults - tableParam defaults such as pageSize, filter, etc
33
42
  * @property {boolean} noOrderError - won't console an error if an order is not found on schema
34
43
  */
35
- export default function withTableParams(compOrOpts, pTopLevelOpts) {
36
- let topLevelOptions;
37
- let Component;
38
- if (!pTopLevelOpts) {
39
- topLevelOptions = compOrOpts;
40
- } else {
41
- topLevelOptions = pTopLevelOpts;
42
- Component = compOrOpts;
43
- }
44
+ export default function withTableParams(topLevelOptions) {
44
45
  const { isLocalCall = false } = topLevelOptions;
45
46
  const mapStateToProps = (state, ownProps) => {
46
47
  const mergedOpts = getMergedOpts(topLevelOptions, ownProps);
@@ -169,6 +170,7 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
169
170
  },
170
171
  showEmptyColumnsByDefault
171
172
  };
173
+
172
174
  return mapStateProps;
173
175
  // return { ...mergedOpts, ...mapStateProps };
174
176
  };
@@ -253,22 +255,7 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
253
255
  }),
254
256
  //don't use withRouter if noRouter is passed!
255
257
  branch(props => !props.noRouter, withRouter),
256
- connect(mapStateToProps, mapDispatchToProps, mergeProps),
257
- pureNoFunc
258
+ connect(mapStateToProps, mapDispatchToProps, mergeProps)
258
259
  );
259
- if (Component) {
260
- return toReturn(Component);
261
- }
262
260
  return toReturn;
263
261
  }
264
-
265
- /**
266
- * Given the options, get the schema. This enables the user to provide
267
- * a function instead of an object for the schema.
268
- * @param {Object} options Merged options
269
- */
270
- function getSchema(options) {
271
- const { schema } = options;
272
- if (isFunction(schema)) return schema(options);
273
- else return schema;
274
- }