@teselagen/ui 0.7.4 → 0.7.5
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/DataTable/EditabelCell.d.ts +2 -5
- package/DataTable/utils/useDeepEqualMemo.d.ts +1 -0
- package/DataTable/utils/useTableParams.d.ts +49 -0
- package/index.cjs.js +4 -4
- package/index.es.js +4 -4
- package/package.json +1 -1
- package/src/DataTable/Columns.jsx +945 -0
- package/src/DataTable/EditabelCell.js +4 -15
- package/src/DataTable/EditabelCell.jsx +44 -0
- package/src/DataTable/RenderCell.jsx +191 -0
- package/src/DataTable/index.js +2 -2
- package/src/DataTable/utils/useDeepEqualMemo.js +10 -0
- package/src/DataTable/utils/useTableParams.js +361 -0
- package/src/DataTable/utils/withTableParams.js +2 -2
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export function EditableCell({ cancelEdit, dataTest, finishEdit,
|
|
1
|
+
export function EditableCell({ cancelEdit, dataTest, finishEdit, isNumeric, initialValue }: {
|
|
2
2
|
cancelEdit: any;
|
|
3
3
|
dataTest: any;
|
|
4
4
|
finishEdit: any;
|
|
5
|
-
initialValue: any;
|
|
6
|
-
isEditableCellInitialValue: any;
|
|
7
5
|
isNumeric: any;
|
|
8
|
-
|
|
9
|
-
stopSelectAll: any;
|
|
6
|
+
initialValue: any;
|
|
10
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function useDeepEqualMemo(value: any): undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note all these options can be passed at Design Time or at Runtime (like reduxForm())
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
*
|
|
6
|
+
* @param {compOrOpts} compOrOpts
|
|
7
|
+
* @typedef {object} compOrOpts
|
|
8
|
+
* @property {*string} formName - required unique identifier for the table
|
|
9
|
+
* @property {Object | Function} schema - The data table schema or a function returning it. The function wll be called with props as the argument.
|
|
10
|
+
* @property {boolean} urlConnected - whether the table should connect to/update the URL
|
|
11
|
+
* @property {boolean} withSelectedEntities - whether or not to pass the selected entities
|
|
12
|
+
* @property {boolean} isCodeModel - whether the model is keyed by code instead of id in the db
|
|
13
|
+
* @property {object} defaults - tableParam defaults such as pageSize, filter, etc
|
|
14
|
+
* @property {boolean} noOrderError - won't console an error if an order is not found on schema
|
|
15
|
+
*/
|
|
16
|
+
export default function useTableParams(props: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* Note all these options can be passed at Design Time or at Runtime (like reduxForm())
|
|
19
|
+
*/
|
|
20
|
+
export type compOrOpts = {
|
|
21
|
+
/**
|
|
22
|
+
* } formName - required unique identifier for the table
|
|
23
|
+
*/
|
|
24
|
+
string: any;
|
|
25
|
+
/**
|
|
26
|
+
* - The data table schema or a function returning it. The function wll be called with props as the argument.
|
|
27
|
+
*/
|
|
28
|
+
schema: Object | Function;
|
|
29
|
+
/**
|
|
30
|
+
* - whether the table should connect to/update the URL
|
|
31
|
+
*/
|
|
32
|
+
urlConnected: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* - whether or not to pass the selected entities
|
|
35
|
+
*/
|
|
36
|
+
withSelectedEntities: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* - whether the model is keyed by code instead of id in the db
|
|
39
|
+
*/
|
|
40
|
+
isCodeModel: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* - tableParam defaults such as pageSize, filter, etc
|
|
43
|
+
*/
|
|
44
|
+
defaults: object;
|
|
45
|
+
/**
|
|
46
|
+
* - won't console an error if an order is not found on schema
|
|
47
|
+
*/
|
|
48
|
+
noOrderError: boolean;
|
|
49
|
+
};
|
package/index.cjs.js
CHANGED
|
@@ -52596,8 +52596,8 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
52596
52596
|
props = __spreadValues(__spreadValues({}, props), tableParams);
|
|
52597
52597
|
const queryParams = React$1.useMemo(() => {
|
|
52598
52598
|
if (!isTableParamsConnected) {
|
|
52599
|
-
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter
|
|
52600
|
-
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter
|
|
52599
|
+
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter : () => props.additionalFilter;
|
|
52600
|
+
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter : () => props.additionalOrFilter;
|
|
52601
52601
|
return getQueryParams({
|
|
52602
52602
|
doNotCoercePageSize,
|
|
52603
52603
|
currentParams,
|
|
@@ -68631,8 +68631,8 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68631
68631
|
[controlled_pageSize, defaultsToUse, pageSize, history == null ? void 0 : history.location]
|
|
68632
68632
|
);
|
|
68633
68633
|
const queryParams = React$1.useMemo(() => {
|
|
68634
|
-
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter
|
|
68635
|
-
const additionalOrFilterToUse = typeof additionalOrFilter === "function" ? additionalOrFilter
|
|
68634
|
+
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter : () => additionalFilter;
|
|
68635
|
+
const additionalOrFilterToUse = typeof additionalOrFilter === "function" ? additionalOrFilter : () => additionalOrFilter;
|
|
68636
68636
|
return getQueryParams({
|
|
68637
68637
|
doNotCoercePageSize,
|
|
68638
68638
|
currentParams,
|
package/index.es.js
CHANGED
|
@@ -52578,8 +52578,8 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
52578
52578
|
props = __spreadValues(__spreadValues({}, props), tableParams);
|
|
52579
52579
|
const queryParams = useMemo(() => {
|
|
52580
52580
|
if (!isTableParamsConnected) {
|
|
52581
|
-
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter
|
|
52582
|
-
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter
|
|
52581
|
+
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter : () => props.additionalFilter;
|
|
52582
|
+
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter : () => props.additionalOrFilter;
|
|
52583
52583
|
return getQueryParams({
|
|
52584
52584
|
doNotCoercePageSize,
|
|
52585
52585
|
currentParams,
|
|
@@ -68613,8 +68613,8 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68613
68613
|
[controlled_pageSize, defaultsToUse, pageSize, history == null ? void 0 : history.location]
|
|
68614
68614
|
);
|
|
68615
68615
|
const queryParams = useMemo(() => {
|
|
68616
|
-
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter
|
|
68617
|
-
const additionalOrFilterToUse = typeof additionalOrFilter === "function" ? additionalOrFilter
|
|
68616
|
+
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter : () => additionalFilter;
|
|
68617
|
+
const additionalOrFilterToUse = typeof additionalOrFilter === "function" ? additionalOrFilter : () => additionalOrFilter;
|
|
68618
68618
|
return getQueryParams({
|
|
68619
68619
|
doNotCoercePageSize,
|
|
68620
68620
|
currentParams,
|