@teselagen/ui 0.5.23-beta.12 → 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
@@ -64403,29 +64403,14 @@ const withStore = /* @__PURE__ */ __name((Component) => {
64403
64403
  return /* @__PURE__ */ React$1.createElement(Component, __spreadProps(__spreadValues({}, props), { store }));
64404
64404
  };
64405
64405
  }, "withStore");
64406
- const isEq = /* @__PURE__ */ __name((o1, o2) => {
64407
- const isEq2 = isEqualWith(o1, o2, function(val1, val2) {
64408
- if (isFunction$4(val1) && isFunction$4(val2)) {
64409
- return val1 === val2 || val1.toString() === val2.toString();
64410
- }
64411
- if (val1 && val1.constructor && val1.constructor.name === "FiberNode")
64412
- return true;
64413
- });
64414
- return isEq2;
64415
- }, "isEq");
64416
- const pure = /* @__PURE__ */ __name((BaseComponent) => {
64417
- const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
64418
- return hoc(BaseComponent);
64419
- }, "pure");
64420
- function withTableParams(compOrOpts, pTopLevelOpts) {
64421
- let topLevelOptions;
64422
- let Component;
64423
- if (!pTopLevelOpts) {
64424
- topLevelOptions = compOrOpts;
64425
- } else {
64426
- topLevelOptions = pTopLevelOpts;
64427
- Component = compOrOpts;
64428
- }
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) {
64429
64414
  const { isLocalCall = false } = topLevelOptions;
64430
64415
  const mapStateToProps = /* @__PURE__ */ __name((state, ownProps) => {
64431
64416
  var _a, _b;
@@ -64600,23 +64585,11 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
64600
64585
  }),
64601
64586
  //don't use withRouter if noRouter is passed!
64602
64587
  branch((props) => !props.noRouter, withRouter),
64603
- reactRedux.connect(mapStateToProps, mapDispatchToProps, mergeProps),
64604
- pure
64588
+ reactRedux.connect(mapStateToProps, mapDispatchToProps, mergeProps)
64605
64589
  );
64606
- if (Component) {
64607
- return toReturn(Component);
64608
- }
64609
64590
  return toReturn;
64610
64591
  }
64611
64592
  __name(withTableParams, "withTableParams");
64612
- function getSchema(options) {
64613
- const { schema } = options;
64614
- if (isFunction$4(schema))
64615
- return schema(options);
64616
- else
64617
- return schema;
64618
- }
64619
- __name(getSchema, "getSchema");
64620
64593
  function showAppSpinner() {
64621
64594
  return renderOnDocSimple(
64622
64595
  /* @__PURE__ */ React$1.createElement(core.Overlay, { isOpen: true }, /* @__PURE__ */ React$1.createElement(Loading, { centeredInPage: true, loading: true }))
@@ -69420,6 +69393,20 @@ function withSelectTableRecords(_tableFormName, propName = "selectTableRecords")
69420
69393
  );
69421
69394
  }
69422
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");
69423
69410
  const isSafari = /^((?!chrome|android).)*safari/i.test(
69424
69411
  navigator.userAgent
69425
69412
  );
package/index.es.js CHANGED
@@ -64385,29 +64385,14 @@ const withStore = /* @__PURE__ */ __name((Component2) => {
64385
64385
  return /* @__PURE__ */ React__default.createElement(Component2, __spreadProps(__spreadValues({}, props), { store }));
64386
64386
  };
64387
64387
  }, "withStore");
64388
- const isEq = /* @__PURE__ */ __name((o1, o2) => {
64389
- const isEq2 = isEqualWith(o1, o2, function(val1, val2) {
64390
- if (isFunction$4(val1) && isFunction$4(val2)) {
64391
- return val1 === val2 || val1.toString() === val2.toString();
64392
- }
64393
- if (val1 && val1.constructor && val1.constructor.name === "FiberNode")
64394
- return true;
64395
- });
64396
- return isEq2;
64397
- }, "isEq");
64398
- const pure = /* @__PURE__ */ __name((BaseComponent) => {
64399
- const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
64400
- return hoc(BaseComponent);
64401
- }, "pure");
64402
- function withTableParams(compOrOpts, pTopLevelOpts) {
64403
- let topLevelOptions;
64404
- let Component2;
64405
- if (!pTopLevelOpts) {
64406
- topLevelOptions = compOrOpts;
64407
- } else {
64408
- topLevelOptions = pTopLevelOpts;
64409
- Component2 = compOrOpts;
64410
- }
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) {
64411
64396
  const { isLocalCall = false } = topLevelOptions;
64412
64397
  const mapStateToProps = /* @__PURE__ */ __name((state, ownProps) => {
64413
64398
  var _a, _b;
@@ -64582,23 +64567,11 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
64582
64567
  }),
64583
64568
  //don't use withRouter if noRouter is passed!
64584
64569
  branch((props) => !props.noRouter, withRouter),
64585
- connect(mapStateToProps, mapDispatchToProps, mergeProps),
64586
- pure
64570
+ connect(mapStateToProps, mapDispatchToProps, mergeProps)
64587
64571
  );
64588
- if (Component2) {
64589
- return toReturn(Component2);
64590
- }
64591
64572
  return toReturn;
64592
64573
  }
64593
64574
  __name(withTableParams, "withTableParams");
64594
- function getSchema(options) {
64595
- const { schema } = options;
64596
- if (isFunction$4(schema))
64597
- return schema(options);
64598
- else
64599
- return schema;
64600
- }
64601
- __name(getSchema, "getSchema");
64602
64575
  function showAppSpinner() {
64603
64576
  return renderOnDocSimple(
64604
64577
  /* @__PURE__ */ React__default.createElement(Overlay, { isOpen: true }, /* @__PURE__ */ React__default.createElement(Loading, { centeredInPage: true, loading: true }))
@@ -69402,6 +69375,20 @@ function withSelectTableRecords(_tableFormName, propName = "selectTableRecords")
69402
69375
  );
69403
69376
  }
69404
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");
69405
69392
  const isSafari = /^((?!chrome|android).)*safari/i.test(
69406
69393
  navigator.userAgent
69407
69394
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.5.23-beta.12",
3
+ "version": "0.5.23-beta.13",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -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
- }