@teselagen/ui 0.3.19 → 0.3.21
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 +11 -2
- package/index.es.js +11 -2
- package/package.json +1 -1
- package/src/DataTable/utils/queryParams.js +1 -1
- package/src/DataTable/utils/withTableParams.js +15 -3
package/index.cjs.js
CHANGED
|
@@ -69039,7 +69039,7 @@ function getFieldsMappedByCCDisplayName(schema) {
|
|
|
69039
69039
|
}, {});
|
|
69040
69040
|
}
|
|
69041
69041
|
function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
|
|
69042
|
-
if (orderArray
|
|
69042
|
+
if (orderArray?.length) {
|
|
69043
69043
|
const orderFuncs = [];
|
|
69044
69044
|
const ascOrDescArray = [];
|
|
69045
69045
|
orderArray.forEach((order) => {
|
|
@@ -85530,6 +85530,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85530
85530
|
noForm
|
|
85531
85531
|
} = mergedOpts;
|
|
85532
85532
|
const schema = getSchema$1(mergedOpts);
|
|
85533
|
+
const convertedSchema = convertSchema(schema);
|
|
85533
85534
|
if (ownProps.isTableParamsConnected) {
|
|
85534
85535
|
if (formName && formNameFromWithTPCall && formName !== formNameFromWithTPCall) {
|
|
85535
85536
|
console.error(
|
|
@@ -85551,6 +85552,14 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85551
85552
|
schema
|
|
85552
85553
|
);
|
|
85553
85554
|
}
|
|
85555
|
+
if (mergedOpts.orderByFirstColumn && !mergedOpts.defaults?.order?.length) {
|
|
85556
|
+
const r = [
|
|
85557
|
+
lodashExports.camelCase(
|
|
85558
|
+
convertedSchema.fields[0].displayName || convertedSchema.fields[0].path
|
|
85559
|
+
)
|
|
85560
|
+
];
|
|
85561
|
+
lodashExports.set(mergedOpts, "defaults.order", r);
|
|
85562
|
+
}
|
|
85554
85563
|
} else {
|
|
85555
85564
|
if (!formName || formName === "tgDataTable") {
|
|
85556
85565
|
console.error(
|
|
@@ -85599,7 +85608,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85599
85608
|
// for local table
|
|
85600
85609
|
urlConnected,
|
|
85601
85610
|
defaults: defaultsToUse,
|
|
85602
|
-
schema:
|
|
85611
|
+
schema: convertedSchema,
|
|
85603
85612
|
isInfinite: isInfinite || isSimple && !withPaging,
|
|
85604
85613
|
isLocalCall,
|
|
85605
85614
|
additionalFilter: additionalFilterToUse,
|
package/index.es.js
CHANGED
|
@@ -69018,7 +69018,7 @@ function getFieldsMappedByCCDisplayName(schema) {
|
|
|
69018
69018
|
}, {});
|
|
69019
69019
|
}
|
|
69020
69020
|
function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
|
|
69021
|
-
if (orderArray
|
|
69021
|
+
if (orderArray?.length) {
|
|
69022
69022
|
const orderFuncs = [];
|
|
69023
69023
|
const ascOrDescArray = [];
|
|
69024
69024
|
orderArray.forEach((order) => {
|
|
@@ -85509,6 +85509,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85509
85509
|
noForm
|
|
85510
85510
|
} = mergedOpts;
|
|
85511
85511
|
const schema = getSchema$1(mergedOpts);
|
|
85512
|
+
const convertedSchema = convertSchema(schema);
|
|
85512
85513
|
if (ownProps.isTableParamsConnected) {
|
|
85513
85514
|
if (formName && formNameFromWithTPCall && formName !== formNameFromWithTPCall) {
|
|
85514
85515
|
console.error(
|
|
@@ -85530,6 +85531,14 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85530
85531
|
schema
|
|
85531
85532
|
);
|
|
85532
85533
|
}
|
|
85534
|
+
if (mergedOpts.orderByFirstColumn && !mergedOpts.defaults?.order?.length) {
|
|
85535
|
+
const r = [
|
|
85536
|
+
lodashExports.camelCase(
|
|
85537
|
+
convertedSchema.fields[0].displayName || convertedSchema.fields[0].path
|
|
85538
|
+
)
|
|
85539
|
+
];
|
|
85540
|
+
lodashExports.set(mergedOpts, "defaults.order", r);
|
|
85541
|
+
}
|
|
85533
85542
|
} else {
|
|
85534
85543
|
if (!formName || formName === "tgDataTable") {
|
|
85535
85544
|
console.error(
|
|
@@ -85578,7 +85587,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85578
85587
|
// for local table
|
|
85579
85588
|
urlConnected,
|
|
85580
85589
|
defaults: defaultsToUse,
|
|
85581
|
-
schema:
|
|
85590
|
+
schema: convertedSchema,
|
|
85582
85591
|
isInfinite: isInfinite || isSimple && !withPaging,
|
|
85583
85592
|
isLocalCall,
|
|
85584
85593
|
additionalFilter: additionalFilterToUse,
|
package/package.json
CHANGED
|
@@ -71,7 +71,7 @@ function getFieldsMappedByCCDisplayName(schema) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
|
|
74
|
-
if (orderArray
|
|
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,18 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
97
97
|
schema
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
|
+
if (
|
|
101
|
+
mergedOpts.orderByFirstColumn &&
|
|
102
|
+
!mergedOpts.defaults?.order?.length
|
|
103
|
+
) {
|
|
104
|
+
const r = [
|
|
105
|
+
camelCase(
|
|
106
|
+
convertedSchema.fields[0].displayName ||
|
|
107
|
+
convertedSchema.fields[0].path
|
|
108
|
+
)
|
|
109
|
+
];
|
|
110
|
+
set(mergedOpts, "defaults.order", r);
|
|
111
|
+
}
|
|
100
112
|
} else {
|
|
101
113
|
//in user instantiated withTableParams() call
|
|
102
114
|
if (!formName || formName === "tgDataTable") {
|
|
@@ -163,7 +175,7 @@ export default function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
163
175
|
entities: mergedOpts.entities, // for local table
|
|
164
176
|
urlConnected,
|
|
165
177
|
defaults: defaultsToUse,
|
|
166
|
-
schema:
|
|
178
|
+
schema: convertedSchema,
|
|
167
179
|
isInfinite: isInfinite || (isSimple && !withPaging),
|
|
168
180
|
isLocalCall,
|
|
169
181
|
additionalFilter: additionalFilterToUse,
|