@teselagen/ui 0.3.19 → 0.3.20

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.
package/index.cjs.js CHANGED
@@ -30630,11 +30630,11 @@ var _enumBugKeys = (
30630
30630
  ).split(',');
30631
30631
 
30632
30632
  // 19.1.2.14 / 15.2.3.14 Object.keys(O)
30633
- var $keys$3 = _objectKeysInternal;
30633
+ var $keys$2 = _objectKeysInternal;
30634
30634
  var enumBugKeys = _enumBugKeys;
30635
30635
 
30636
30636
  var _objectKeys = Object.keys || function keys(O) {
30637
- return $keys$3(O, enumBugKeys);
30637
+ return $keys$2(O, enumBugKeys);
30638
30638
  };
30639
30639
 
30640
30640
  var _objectGops = {};
@@ -31422,17 +31422,24 @@ var _objectGopnExt = {};
31422
31422
 
31423
31423
  var _objectGopn = {};
31424
31424
 
31425
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
31426
- var $keys$2 = _objectKeysInternal;
31427
- var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
31425
+ var hasRequired_objectGopn;
31428
31426
 
31429
- _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
31430
- return $keys$2(O, hiddenKeys);
31431
- };
31427
+ function require_objectGopn () {
31428
+ if (hasRequired_objectGopn) return _objectGopn;
31429
+ hasRequired_objectGopn = 1;
31430
+ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
31431
+ var $keys = _objectKeysInternal;
31432
+ var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
31433
+
31434
+ _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
31435
+ return $keys(O, hiddenKeys);
31436
+ };
31437
+ return _objectGopn;
31438
+ }
31432
31439
 
31433
31440
  // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
31434
31441
  var toIObject$2 = _toIobject;
31435
- var gOPN$1 = _objectGopn.f;
31442
+ var gOPN$1 = require_objectGopn().f;
31436
31443
  var toString$5 = {}.toString;
31437
31444
 
31438
31445
  var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
@@ -31619,7 +31626,7 @@ if (!USE_NATIVE) {
31619
31626
 
31620
31627
  $GOPD.f = $getOwnPropertyDescriptor;
31621
31628
  $DP.f = $defineProperty;
31622
- _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
31629
+ require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
31623
31630
  require_objectPie().f = $propertyIsEnumerable;
31624
31631
  $GOPS.f = $getOwnPropertySymbols;
31625
31632
 
@@ -69039,7 +69046,7 @@ function getFieldsMappedByCCDisplayName(schema) {
69039
69046
  }, {});
69040
69047
  }
69041
69048
  function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
69042
- if (orderArray && orderArray.length) {
69049
+ if (orderArray?.length) {
69043
69050
  const orderFuncs = [];
69044
69051
  const ascOrDescArray = [];
69045
69052
  orderArray.forEach((order) => {
@@ -85530,6 +85537,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85530
85537
  noForm
85531
85538
  } = mergedOpts;
85532
85539
  const schema = getSchema$1(mergedOpts);
85540
+ const convertedSchema = convertSchema(schema);
85533
85541
  if (ownProps.isTableParamsConnected) {
85534
85542
  if (formName && formNameFromWithTPCall && formName !== formNameFromWithTPCall) {
85535
85543
  console.error(
@@ -85551,6 +85559,12 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85551
85559
  schema
85552
85560
  );
85553
85561
  }
85562
+ if (mergedOpts.orderByFirstColumn && !mergedOpts.defaults?.order?.length) {
85563
+ const r = [
85564
+ lodashExports.camelCase(schema.fields[0].displayName || schema.fields[0].path)
85565
+ ];
85566
+ lodashExports.set(mergedOpts, "defaults.order", r);
85567
+ }
85554
85568
  } else {
85555
85569
  if (!formName || formName === "tgDataTable") {
85556
85570
  console.error(
@@ -85599,7 +85613,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85599
85613
  // for local table
85600
85614
  urlConnected,
85601
85615
  defaults: defaultsToUse,
85602
- schema: convertSchema(schema),
85616
+ schema: convertedSchema,
85603
85617
  isInfinite: isInfinite || isSimple && !withPaging,
85604
85618
  isLocalCall,
85605
85619
  additionalFilter: additionalFilterToUse,
package/index.es.js CHANGED
@@ -30609,11 +30609,11 @@ var _enumBugKeys = (
30609
30609
  ).split(',');
30610
30610
 
30611
30611
  // 19.1.2.14 / 15.2.3.14 Object.keys(O)
30612
- var $keys$3 = _objectKeysInternal;
30612
+ var $keys$2 = _objectKeysInternal;
30613
30613
  var enumBugKeys = _enumBugKeys;
30614
30614
 
30615
30615
  var _objectKeys = Object.keys || function keys(O) {
30616
- return $keys$3(O, enumBugKeys);
30616
+ return $keys$2(O, enumBugKeys);
30617
30617
  };
30618
30618
 
30619
30619
  var _objectGops = {};
@@ -31401,17 +31401,24 @@ var _objectGopnExt = {};
31401
31401
 
31402
31402
  var _objectGopn = {};
31403
31403
 
31404
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
31405
- var $keys$2 = _objectKeysInternal;
31406
- var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
31404
+ var hasRequired_objectGopn;
31407
31405
 
31408
- _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
31409
- return $keys$2(O, hiddenKeys);
31410
- };
31406
+ function require_objectGopn () {
31407
+ if (hasRequired_objectGopn) return _objectGopn;
31408
+ hasRequired_objectGopn = 1;
31409
+ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
31410
+ var $keys = _objectKeysInternal;
31411
+ var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
31412
+
31413
+ _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
31414
+ return $keys(O, hiddenKeys);
31415
+ };
31416
+ return _objectGopn;
31417
+ }
31411
31418
 
31412
31419
  // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
31413
31420
  var toIObject$2 = _toIobject;
31414
- var gOPN$1 = _objectGopn.f;
31421
+ var gOPN$1 = require_objectGopn().f;
31415
31422
  var toString$5 = {}.toString;
31416
31423
 
31417
31424
  var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
@@ -31598,7 +31605,7 @@ if (!USE_NATIVE) {
31598
31605
 
31599
31606
  $GOPD.f = $getOwnPropertyDescriptor;
31600
31607
  $DP.f = $defineProperty;
31601
- _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
31608
+ require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
31602
31609
  require_objectPie().f = $propertyIsEnumerable;
31603
31610
  $GOPS.f = $getOwnPropertySymbols;
31604
31611
 
@@ -69018,7 +69025,7 @@ function getFieldsMappedByCCDisplayName(schema) {
69018
69025
  }, {});
69019
69026
  }
69020
69027
  function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
69021
- if (orderArray && orderArray.length) {
69028
+ if (orderArray?.length) {
69022
69029
  const orderFuncs = [];
69023
69030
  const ascOrDescArray = [];
69024
69031
  orderArray.forEach((order) => {
@@ -85509,6 +85516,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85509
85516
  noForm
85510
85517
  } = mergedOpts;
85511
85518
  const schema = getSchema$1(mergedOpts);
85519
+ const convertedSchema = convertSchema(schema);
85512
85520
  if (ownProps.isTableParamsConnected) {
85513
85521
  if (formName && formNameFromWithTPCall && formName !== formNameFromWithTPCall) {
85514
85522
  console.error(
@@ -85530,6 +85538,12 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85530
85538
  schema
85531
85539
  );
85532
85540
  }
85541
+ if (mergedOpts.orderByFirstColumn && !mergedOpts.defaults?.order?.length) {
85542
+ const r = [
85543
+ lodashExports.camelCase(schema.fields[0].displayName || schema.fields[0].path)
85544
+ ];
85545
+ lodashExports.set(mergedOpts, "defaults.order", r);
85546
+ }
85533
85547
  } else {
85534
85548
  if (!formName || formName === "tgDataTable") {
85535
85549
  console.error(
@@ -85578,7 +85592,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85578
85592
  // for local table
85579
85593
  urlConnected,
85580
85594
  defaults: defaultsToUse,
85581
- schema: convertSchema(schema),
85595
+ schema: convertedSchema,
85582
85596
  isInfinite: isInfinite || isSimple && !withPaging,
85583
85597
  isLocalCall,
85584
85598
  additionalFilter: additionalFilterToUse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -71,7 +71,7 @@ function getFieldsMappedByCCDisplayName(schema) {
71
71
  }
72
72
 
73
73
  function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
74
- if (orderArray && orderArray.length) {
74
+ if (orderArray?.length) {
75
75
  const orderFuncs = [];
76
76
  const ascOrDescArray = [];
77
77
  orderArray.forEach(order => {
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useEffect } from "react";
2
2
  import { change, formValueSelector } from "redux-form";
3
3
  import { connect } from "react-redux";
4
- import { isFunction } from "lodash";
4
+ import { camelCase, isFunction, set } from "lodash";
5
5
  import { withRouter } from "react-router-dom";
6
6
  import { branch, compose } from "recompose";
7
7
 
@@ -69,7 +69,7 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
69
69
  } = mergedOpts;
70
70
 
71
71
  const schema = getSchema(mergedOpts);
72
-
72
+ const convertedSchema = convertSchema(schema)
73
73
  if (ownProps.isTableParamsConnected) {
74
74
  if (
75
75
  formName &&
@@ -97,6 +97,12 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
97
97
  schema
98
98
  );
99
99
  }
100
+ if (mergedOpts.orderByFirstColumn && !mergedOpts.defaults?.order?.length) {
101
+ const r = [
102
+ camelCase(schema.fields[0].displayName || schema.fields[0].path)
103
+ ];
104
+ set(mergedOpts, 'defaults.order', r)
105
+ }
100
106
  } else {
101
107
  //in user instantiated withTableParams() call
102
108
  if (!formName || formName === "tgDataTable") {
@@ -163,7 +169,7 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
163
169
  entities: mergedOpts.entities, // for local table
164
170
  urlConnected,
165
171
  defaults: defaultsToUse,
166
- schema: convertSchema(schema),
172
+ schema: convertedSchema,
167
173
  isInfinite: isInfinite || (isSimple && !withPaging),
168
174
  isLocalCall,
169
175
  additionalFilter: additionalFilterToUse,