@veeqo/transfigure 2.2.0 → 2.3.1
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/dist/api/types.d.ts +4 -0
- package/dist/constants/viewConstants.d.ts +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useCreateEmptyDraftView/index.d.ts +1 -0
- package/dist/hooks/useCreateEmptyDraftView/useCreateEmptyDraftView.d.ts +3 -0
- package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +72 -70
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +9 -48
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +8 -28
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +48 -19
- package/dist/index103.cjs +1 -19
- package/dist/index103.js +28 -23
- package/dist/index104.cjs +19 -1
- package/dist/index104.js +23 -17
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +15 -7
- package/dist/index106.cjs +1 -12
- package/dist/index106.js +18 -16
- package/dist/index107.cjs +12 -1
- package/dist/index107.js +16 -24
- package/dist/index108.cjs +1 -80
- package/dist/index108.js +21 -98
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +23 -18
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +80 -1
- package/dist/index110.js +98 -8
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +17 -59
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +7 -29
- package/dist/index113.cjs +1 -13
- package/dist/index113.js +60 -16
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +30 -2
- package/dist/index115.cjs +13 -1
- package/dist/index115.js +15 -24
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +2 -36
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +36 -5
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +25 -62
- package/dist/index119.cjs +1 -7
- package/dist/index119.js +5 -10
- package/dist/index120.cjs +7 -1
- package/dist/index120.js +10 -47
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +65 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +49 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +2 -2
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +4 -4
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +3 -3
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +3 -3
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +3 -3
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +3 -3
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +2 -2
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +2 -2
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +3 -3
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +35 -35
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +10 -10
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +40 -37
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -3
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +4 -4
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +2 -2
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +4 -4
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +3 -3
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +1 -1
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +33 -33
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +2 -2
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +10 -23
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +19 -22
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -97
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +97 -8
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +8 -33
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +33 -63
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +59 -19
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +23 -18
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +16 -29
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +30 -59
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +61 -349
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +4 -4
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +372 -53
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +48 -47
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +51 -32
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +40 -24
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +26 -32
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +38 -4
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +4 -13
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +12 -16
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +14 -16
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +18 -65
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +66 -24
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +24 -21
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +19 -6
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +7 -2
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +2 -9
- package/dist/index85.cjs +1 -3
- package/dist/index85.js +8 -13
- package/dist/index86.cjs +3 -1
- package/dist/index86.js +13 -8
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +7 -115
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +2 -2
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +117 -2
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +2 -5
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +5 -13
- package/dist/index93.cjs +1 -104
- package/dist/index93.js +12 -119
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +13 -68
- package/dist/index95.cjs +104 -1
- package/dist/index95.js +118 -27
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +68 -2
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +26 -39
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -11
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +40 -14
- package/dist/mobx/Filters/Filters.d.ts +12 -1
- package/dist/mobx/Views/Views.d.ts +1 -0
- package/dist/storybookHelpers/StoryWrapper.d.ts +1 -1
- package/dist/utils/createEmptyTransformedView/createEmptyTransformedView.d.ts +6 -0
- package/dist/utils/createEmptyTransformedView/createEmptyTransformedView.test.d.ts +1 -0
- package/dist/utils/createEmptyTransformedView/index.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/sortUtils/index.d.ts +2 -0
- package/dist/utils/sortUtils/sortUtils.d.ts +11 -0
- package/dist/utils/sortUtils/sortUtils.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/utils/createAllView/createAllView.d.ts +0 -3
- package/dist/utils/createAllView/index.d.ts +0 -1
- /package/dist/{utils/createAllView/createAllView.test.d.ts → hooks/useCreateEmptyDraftView/useCreateEmptyDraftView.test.d.ts} +0 -0
package/dist/index99.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),f=require("./index64.cjs"),y=require("./index63.cjs"),g=require("./index53.cjs"),h=require("./index62.cjs"),p=require("./index5.cjs"),w=({pinnedLeftColumnIds:r,pinnedRightColumnIds:a})=>{const{Filters:{activeViewId:t},Notifications:{notify:e}}=y.useStores(),{closeModal:i}=g.useModal(),{mutate:c}=f.useViews(),{getActiveViewInAPIFormat:l}=h.usePersistUnsavedChanges(),[m,o]=C.useState(!1);return{saveColumns:async({visibleColumns:n})=>{if(t)try{if(o(!0),n.length<1){e({type:"error",text:"You must have at least one visible column."});return}const u=[...r,...n,...a],{arg:d,currentView:s}=l(),v={...d,columns:{...s==null?void 0:s.columns,columnIds:u}};await p.patchCustomView(t,{attributes:v}),await c(),i(),e({type:"success",text:"Columns updated successfully"})}catch{e({type:"error",text:"Failed to save columns"})}finally{o(!1)}},isSavingColumns:m}};exports.usePersistColumns=w;
|
package/dist/index99.js
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useState as d } from "react";
|
|
2
|
+
import { useViews as v } from "./index64.js";
|
|
3
|
+
import { useStores as y } from "./index63.js";
|
|
4
|
+
import { useModal as C } from "./index53.js";
|
|
5
|
+
import { usePersistUnsavedChanges as g } from "./index62.js";
|
|
6
|
+
import { patchCustomView as h } from "./index5.js";
|
|
7
|
+
const b = ({ pinnedLeftColumnIds: a, pinnedRightColumnIds: i }) => {
|
|
8
|
+
const {
|
|
9
|
+
Filters: {
|
|
10
|
+
activeViewId: e
|
|
11
|
+
},
|
|
12
|
+
Notifications: {
|
|
13
|
+
notify: t
|
|
12
14
|
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
+
} = y(), { closeModal: u } = C(), { mutate: m } = v(), { getActiveViewInAPIFormat: c } = g(), [l, o] = d(!1);
|
|
16
|
+
return {
|
|
17
|
+
saveColumns: async ({ visibleColumns: n }) => {
|
|
18
|
+
if (e)
|
|
19
|
+
try {
|
|
20
|
+
if (o(!0), n.length < 1) {
|
|
21
|
+
t({ type: "error", text: "You must have at least one visible column." });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const r = [...a, ...n, ...i], { arg: f, currentView: s } = c(), p = {
|
|
25
|
+
...f,
|
|
26
|
+
columns: {
|
|
27
|
+
...s == null ? void 0 : s.columns,
|
|
28
|
+
columnIds: r
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
await h(e, { attributes: p }), await m(), u(), t({ type: "success", text: "Columns updated successfully" });
|
|
32
|
+
} catch {
|
|
33
|
+
t({ type: "error", text: "Failed to save columns" });
|
|
34
|
+
} finally {
|
|
35
|
+
o(!1);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
isSavingColumns: l
|
|
39
|
+
};
|
|
40
|
+
};
|
|
15
41
|
export {
|
|
16
|
-
|
|
42
|
+
b as usePersistColumns
|
|
17
43
|
};
|
|
@@ -2,6 +2,7 @@ import { DateValue } from 'react-aria-components';
|
|
|
2
2
|
import { TransformedView } from '../../types';
|
|
3
3
|
import { RangeFilter } from '../RangeFilter/RangeFilter';
|
|
4
4
|
import { NumberRangeFilter } from '../NumberRangeFilter/NumberRangeFilter';
|
|
5
|
+
import { Table } from '../Table/Table';
|
|
5
6
|
import { FilterType } from '../../constants/dateConstants';
|
|
6
7
|
export declare class Filters {
|
|
7
8
|
defaultPageSize: number;
|
|
@@ -16,8 +17,18 @@ export declare class Filters {
|
|
|
16
17
|
dateRangeFilters: Map<string, RangeFilter>;
|
|
17
18
|
numberRangeFilters: Map<string, NumberRangeFilter>;
|
|
18
19
|
activeViewId: string | undefined;
|
|
20
|
+
defaultSortState: Table['sortState'];
|
|
21
|
+
tableStore: Table | undefined;
|
|
19
22
|
isFiltersDropdownVisible: boolean;
|
|
20
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @param tableStore - Optional reference to the Table store for sort state
|
|
25
|
+
* tracking in custom views. Sort state lives on Table (for the UI table
|
|
26
|
+
* component) but needs to participate in view persistence (owned by Filters).
|
|
27
|
+
* Filters reads Table.sortState for comparison and writes to it via setSortState
|
|
28
|
+
* on view initialisation and discard. This store-to-store coupling is intentional but
|
|
29
|
+
* should not be treated as a pattern to follow — keep stores decoupled wherever possible.
|
|
30
|
+
*/
|
|
31
|
+
constructor(tableStore?: Table);
|
|
21
32
|
initDefaultFilterMaps: () => void;
|
|
22
33
|
updateUrl: (pushToHistory?: boolean) => void;
|
|
23
34
|
setCurrentPage: (count: number) => void;
|
|
@@ -4,6 +4,7 @@ export declare class Views {
|
|
|
4
4
|
draftViewsMap: Map<string, TransformedView>;
|
|
5
5
|
constructor();
|
|
6
6
|
addDraftView: (view: TransformedView) => TransformedView;
|
|
7
|
+
addEmptyDraftView: () => TransformedView;
|
|
7
8
|
removeDraftViewById: (viewId: string) => void;
|
|
8
9
|
incrementDraftViewCount: () => void;
|
|
9
10
|
get draftViewsList(): TransformedView[];
|
|
@@ -6,9 +6,9 @@ type Props = {
|
|
|
6
6
|
initialViewId?: string;
|
|
7
7
|
showNotifications?: boolean;
|
|
8
8
|
};
|
|
9
|
+
export declare const table: Table;
|
|
9
10
|
export declare const filters: Filters;
|
|
10
11
|
export declare const views: Views;
|
|
11
12
|
export declare const notifications: Notifications;
|
|
12
|
-
export declare const table: Table;
|
|
13
13
|
export declare const StoryWrapper: ({ children, initialFilters, initialArrayFilters, initialViewId, }: Props) => JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TransformedView } from 'src/types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a `TransformedView` with neutral defaults (no filters, no columns,
|
|
4
|
+
* default page size of '10', and the default colour palette).
|
|
5
|
+
*/
|
|
6
|
+
export declare const createEmptyTransformedView: (overrides?: Partial<TransformedView>) => TransformedView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createEmptyTransformedView } from './createEmptyTransformedView';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SortState = {
|
|
2
|
+
columnId: string;
|
|
3
|
+
direction: 'asc' | 'desc';
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Parses a MONOLITH-format sort string into a SortState object.
|
|
7
|
+
* - undefined/empty → { columnId: '', direction: 'asc' }
|
|
8
|
+
* - "-columnId" → { columnId: 'columnId', direction: 'desc' }
|
|
9
|
+
* - "columnId" → { columnId: 'columnId', direction: 'asc' }
|
|
10
|
+
*/
|
|
11
|
+
export declare const parseSortString: (sort: string | undefined) => SortState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createAllView } from './createAllView';
|