@veeqo/transfigure 2.3.0 → 2.4.0

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.
Files changed (210) hide show
  1. package/dist/constants/viewConstants.d.ts +2 -0
  2. package/dist/hooks/index.d.ts +1 -0
  3. package/dist/hooks/useCreateEmptyDraftView/index.d.ts +1 -0
  4. package/dist/hooks/useCreateEmptyDraftView/useCreateEmptyDraftView.d.ts +3 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +72 -70
  7. package/dist/index100.cjs +1 -1
  8. package/dist/index100.js +48 -19
  9. package/dist/index101.cjs +1 -1
  10. package/dist/index101.js +28 -17
  11. package/dist/index102.cjs +1 -1
  12. package/dist/index102.js +15 -24
  13. package/dist/index103.cjs +11 -18
  14. package/dist/index103.js +12 -20
  15. package/dist/index104.cjs +1 -1
  16. package/dist/index104.js +15 -14
  17. package/dist/index105.cjs +19 -1
  18. package/dist/index105.js +24 -7
  19. package/dist/index106.cjs +1 -12
  20. package/dist/index106.js +21 -16
  21. package/dist/index107.cjs +1 -1
  22. package/dist/index107.js +23 -49
  23. package/dist/index108.cjs +1 -1
  24. package/dist/index108.js +12 -29
  25. package/dist/index109.cjs +1 -1
  26. package/dist/index109.js +1 -1
  27. package/dist/index11.cjs +1 -1
  28. package/dist/index11.js +1 -1
  29. package/dist/index110.cjs +1 -1
  30. package/dist/index110.js +8 -18
  31. package/dist/index111.cjs +1 -1
  32. package/dist/index111.js +2 -8
  33. package/dist/index112.cjs +1 -1
  34. package/dist/index112.js +17 -59
  35. package/dist/index113.cjs +1 -1
  36. package/dist/index113.js +7 -29
  37. package/dist/index114.cjs +1 -1
  38. package/dist/index114.js +61 -2
  39. package/dist/index115.cjs +1 -13
  40. package/dist/index115.js +30 -17
  41. package/dist/index116.cjs +13 -1
  42. package/dist/index116.js +15 -24
  43. package/dist/index117.cjs +1 -1
  44. package/dist/index117.js +22 -32
  45. package/dist/index118.cjs +1 -1
  46. package/dist/index118.js +36 -5
  47. package/dist/index119.cjs +1 -1
  48. package/dist/index119.js +5 -63
  49. package/dist/index120.cjs +1 -7
  50. package/dist/index120.js +63 -10
  51. package/dist/index121.cjs +7 -1
  52. package/dist/index121.js +10 -47
  53. package/dist/index122.cjs +1 -0
  54. package/dist/index122.js +49 -0
  55. package/dist/index13.cjs +1 -1
  56. package/dist/index13.js +1 -1
  57. package/dist/index14.cjs +1 -1
  58. package/dist/index14.js +1 -1
  59. package/dist/index15.cjs +1 -1
  60. package/dist/index15.js +1 -1
  61. package/dist/index16.cjs +1 -1
  62. package/dist/index16.js +1 -1
  63. package/dist/index17.cjs +1 -1
  64. package/dist/index17.js +1 -1
  65. package/dist/index19.cjs +1 -1
  66. package/dist/index19.js +3 -3
  67. package/dist/index20.cjs +1 -1
  68. package/dist/index20.js +3 -3
  69. package/dist/index21.cjs +1 -1
  70. package/dist/index21.js +2 -2
  71. package/dist/index22.cjs +1 -1
  72. package/dist/index22.js +3 -3
  73. package/dist/index23.cjs +1 -1
  74. package/dist/index23.js +2 -2
  75. package/dist/index26.cjs +1 -1
  76. package/dist/index26.js +3 -3
  77. package/dist/index27.cjs +1 -1
  78. package/dist/index27.js +3 -3
  79. package/dist/index28.cjs +1 -1
  80. package/dist/index28.js +1 -1
  81. package/dist/index29.cjs +1 -1
  82. package/dist/index29.js +2 -2
  83. package/dist/index30.cjs +1 -1
  84. package/dist/index30.js +1 -1
  85. package/dist/index31.cjs +1 -1
  86. package/dist/index31.js +3 -3
  87. package/dist/index32.cjs +1 -1
  88. package/dist/index32.js +1 -1
  89. package/dist/index33.cjs +1 -1
  90. package/dist/index33.js +1 -1
  91. package/dist/index34.cjs +1 -1
  92. package/dist/index34.js +1 -1
  93. package/dist/index36.cjs +1 -1
  94. package/dist/index36.js +35 -35
  95. package/dist/index37.cjs +1 -1
  96. package/dist/index37.js +10 -10
  97. package/dist/index38.cjs +1 -1
  98. package/dist/index38.js +40 -37
  99. package/dist/index39.cjs +1 -1
  100. package/dist/index39.js +1 -1
  101. package/dist/index40.cjs +1 -1
  102. package/dist/index40.js +3 -3
  103. package/dist/index41.cjs +1 -1
  104. package/dist/index41.js +4 -4
  105. package/dist/index42.cjs +1 -1
  106. package/dist/index42.js +1 -1
  107. package/dist/index44.cjs +1 -1
  108. package/dist/index44.js +4 -4
  109. package/dist/index46.cjs +1 -1
  110. package/dist/index46.js +3 -3
  111. package/dist/index47.cjs +1 -1
  112. package/dist/index47.js +3 -3
  113. package/dist/index57.cjs +1 -1
  114. package/dist/index57.js +33 -33
  115. package/dist/index58.cjs +1 -1
  116. package/dist/index58.js +2 -2
  117. package/dist/index59.cjs +1 -1
  118. package/dist/index59.js +10 -23
  119. package/dist/index60.cjs +1 -1
  120. package/dist/index60.js +19 -22
  121. package/dist/index61.cjs +1 -1
  122. package/dist/index61.js +26 -96
  123. package/dist/index62.cjs +1 -1
  124. package/dist/index62.js +97 -8
  125. package/dist/index63.cjs +1 -1
  126. package/dist/index63.js +8 -33
  127. package/dist/index64.cjs +1 -1
  128. package/dist/index64.js +33 -63
  129. package/dist/index65.cjs +1 -1
  130. package/dist/index65.js +59 -19
  131. package/dist/index66.cjs +1 -1
  132. package/dist/index66.js +23 -18
  133. package/dist/index67.cjs +1 -1
  134. package/dist/index67.js +16 -29
  135. package/dist/index68.cjs +1 -1
  136. package/dist/index68.js +30 -60
  137. package/dist/index69.cjs +1 -1
  138. package/dist/index69.js +61 -376
  139. package/dist/index7.cjs +1 -1
  140. package/dist/index7.js +4 -4
  141. package/dist/index70.cjs +1 -1
  142. package/dist/index70.js +372 -53
  143. package/dist/index71.cjs +1 -1
  144. package/dist/index71.js +48 -47
  145. package/dist/index72.cjs +1 -1
  146. package/dist/index72.js +51 -32
  147. package/dist/index73.cjs +1 -1
  148. package/dist/index73.js +40 -24
  149. package/dist/index74.cjs +1 -1
  150. package/dist/index74.js +26 -32
  151. package/dist/index75.cjs +1 -1
  152. package/dist/index75.js +38 -4
  153. package/dist/index76.cjs +1 -1
  154. package/dist/index76.js +4 -13
  155. package/dist/index77.cjs +1 -1
  156. package/dist/index77.js +12 -16
  157. package/dist/index78.cjs +1 -1
  158. package/dist/index78.js +14 -16
  159. package/dist/index79.cjs +1 -1
  160. package/dist/index79.js +18 -65
  161. package/dist/index80.cjs +1 -1
  162. package/dist/index80.js +67 -24
  163. package/dist/index81.cjs +1 -1
  164. package/dist/index81.js +24 -21
  165. package/dist/index82.cjs +1 -1
  166. package/dist/index82.js +19 -6
  167. package/dist/index83.cjs +1 -1
  168. package/dist/index83.js +7 -2
  169. package/dist/index84.cjs +1 -1
  170. package/dist/index84.js +2 -9
  171. package/dist/index85.cjs +1 -3
  172. package/dist/index85.js +8 -13
  173. package/dist/index86.cjs +3 -1
  174. package/dist/index86.js +13 -8
  175. package/dist/index87.cjs +1 -1
  176. package/dist/index87.js +8 -4
  177. package/dist/index88.cjs +1 -1
  178. package/dist/index88.js +39 -115
  179. package/dist/index89.cjs +1 -1
  180. package/dist/index89.js +9 -41
  181. package/dist/index90.cjs +1 -1
  182. package/dist/index90.js +116 -8
  183. package/dist/index92.cjs +1 -1
  184. package/dist/index92.js +5 -13
  185. package/dist/index93.cjs +1 -104
  186. package/dist/index93.js +13 -119
  187. package/dist/index94.cjs +104 -1
  188. package/dist/index94.js +116 -65
  189. package/dist/index95.cjs +1 -1
  190. package/dist/index95.js +63 -23
  191. package/dist/index96.cjs +1 -1
  192. package/dist/index96.js +28 -2
  193. package/dist/index97.cjs +1 -1
  194. package/dist/index97.js +2 -41
  195. package/dist/index98.cjs +1 -1
  196. package/dist/index98.js +39 -9
  197. package/dist/index99.cjs +1 -1
  198. package/dist/index99.js +10 -8
  199. package/dist/mobx/Views/Views.d.ts +1 -0
  200. package/dist/types.d.ts +4 -7
  201. package/dist/utils/createEmptyTransformedView/createEmptyTransformedView.d.ts +6 -0
  202. package/dist/utils/createEmptyTransformedView/createEmptyTransformedView.test.d.ts +1 -0
  203. package/dist/utils/createEmptyTransformedView/index.d.ts +1 -0
  204. package/dist/utils/getViewTheme/getViewTheme.d.ts +10 -13
  205. package/dist/utils/index.d.ts +1 -1
  206. package/dist/utils/viewsAdapter/viewsAdapter.d.ts +1 -1
  207. package/package.json +1 -1
  208. package/dist/utils/createAllView/createAllView.d.ts +0 -3
  209. package/dist/utils/createAllView/index.d.ts +0 -1
  210. /package/dist/{utils/createAllView/createAllView.test.d.ts → hooks/useCreateEmptyDraftView/useCreateEmptyDraftView.test.d.ts} +0 -0
package/dist/index97.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),f=require("./index63.cjs"),y=require("./index62.cjs"),g=require("./index53.cjs"),h=require("./index61.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=(e=>(e.Hidden="hidden",e.Visible="visible",e))(i||{});exports.ColumnGroupIds=i;
package/dist/index97.js CHANGED
@@ -1,43 +1,4 @@
1
- import { useState as d } from "react";
2
- import { useViews as v } from "./index63.js";
3
- import { useStores as y } from "./index62.js";
4
- import { useModal as C } from "./index53.js";
5
- import { usePersistUnsavedChanges as g } from "./index61.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
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
- };
1
+ var i = /* @__PURE__ */ ((e) => (e.Hidden = "hidden", e.Visible = "visible", e))(i || {});
41
2
  export {
42
- b as usePersistColumns
3
+ i as ColumnGroupIds
43
4
  };
package/dist/index98.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=(t,r)=>{if(!r)return t;const i=r.toLowerCase();return t.filter(e=>{var s,a;return((s=e==null?void 0:e.title)==null?void 0:s.toLowerCase().includes(i))||((a=e==null?void 0:e.id)==null?void 0:a.toLowerCase().includes(i))})};exports.filterColumnsBySearch=d;
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/index98.js CHANGED
@@ -1,13 +1,43 @@
1
- const a = (t, r) => {
2
- if (!r) return t;
3
- const i = r.toLowerCase();
4
- return t.filter(
5
- (e) => {
6
- var s, C;
7
- return ((s = e == null ? void 0 : e.title) == null ? void 0 : s.toLowerCase().includes(i)) || ((C = e == null ? void 0 : e.id) == null ? void 0 : C.toLowerCase().includes(i));
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
8
14
  }
9
- );
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
+ };
10
40
  };
11
41
  export {
12
- a as filterColumnsBySearch
42
+ b as usePersistColumns
13
43
  };
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=r=>{if(!r)return{columnId:"",direction:"asc"};if(r.startsWith("-")){const t=r.slice(1);return t?{columnId:t,direction:"desc"}:{columnId:"",direction:"asc"}}return{columnId:r,direction:"asc"}};exports.parseSortString=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=(t,r)=>{if(!r)return t;const i=r.toLowerCase();return t.filter(e=>{var s,a;return((s=e==null?void 0:e.title)==null?void 0:s.toLowerCase().includes(i))||((a=e==null?void 0:e.id)==null?void 0:a.toLowerCase().includes(i))})};exports.filterColumnsBySearch=d;
package/dist/index99.js CHANGED
@@ -1,11 +1,13 @@
1
- const i = (c) => {
2
- if (!c) return { columnId: "", direction: "asc" };
3
- if (c.startsWith("-")) {
4
- const n = c.slice(1);
5
- return n ? { columnId: n, direction: "desc" } : { columnId: "", direction: "asc" };
6
- }
7
- return { columnId: c, direction: "asc" };
1
+ const a = (t, r) => {
2
+ if (!r) return t;
3
+ const i = r.toLowerCase();
4
+ return t.filter(
5
+ (e) => {
6
+ var s, C;
7
+ return ((s = e == null ? void 0 : e.title) == null ? void 0 : s.toLowerCase().includes(i)) || ((C = e == null ? void 0 : e.id) == null ? void 0 : C.toLowerCase().includes(i));
8
+ }
9
+ );
8
10
  };
9
11
  export {
10
- i as parseSortString
12
+ a as filterColumnsBySearch
11
13
  };
@@ -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[];
package/dist/types.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { FilterChoiceValue } from './constants/constants';
2
2
  import { NumberRangeFilterClass } from './mobx/NumberRangeFilter';
3
3
  import { RangeFilter } from './mobx/RangeFilter';
4
+ import { theme } from '@veeqo/ui';
4
5
  import { ReactElement } from 'react';
6
+ export type ColourPalette = typeof theme.colors.secondary.blue;
5
7
  export declare enum SortingMode {
6
8
  MONOLITH = "MONOLITH",
7
9
  CORAL = "CORAL"
@@ -91,14 +93,9 @@ export type TransformedView = {
91
93
  isShared: boolean;
92
94
  originalView?: TransformedView;
93
95
  columns: ViewColumns;
94
- colourPalette: {
95
- lightest: string;
96
- light: string;
97
- base: string;
98
- dark: string;
99
- darkest: string;
100
- };
96
+ colourPalette: ColourPalette;
101
97
  customTextColour?: string;
98
+ view_attributes?: View['view_attributes'];
102
99
  };
103
100
  export type ViewsState = {
104
101
  fixedViews: TransformedView[];
@@ -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 { createEmptyTransformedView } from './createEmptyTransformedView';
@@ -1,21 +1,18 @@
1
- import { ViewStatusTypes } from '../../types';
1
+ import { ColourPalette, ViewStatusTypes } from '../../types';
2
+ type ViewTheme = {
3
+ colourPalette: ColourPalette;
4
+ customTextColour?: string;
5
+ };
2
6
  /**
3
7
  * Returns a view theme configuration based on the provided view status.
4
8
  *
5
- * @param type - The current view status used to determine which theme
6
- * colours to apply (for example, an error state).
9
+ * @param type - The view status used to determine which theme
10
+ * colours to apply (for example, an error state). When undefined,
11
+ * the default blue theme is returned.
7
12
  * @returns An object describing the theme for the view, including
8
13
  * {@code colourPalette}, which provides the base colour palette for
9
14
  * the view, and {@code customTextColour}, an optional override for
10
15
  * the default text colour.
11
16
  */
12
- export declare const getViewTheme: (type: ViewStatusTypes) => {
13
- colourPalette: {
14
- lightest: string;
15
- light: string;
16
- base: string;
17
- dark: string;
18
- darkest: string;
19
- };
20
- customTextColour: string | undefined;
21
- };
17
+ export declare const getViewTheme: (type: ViewStatusTypes | undefined) => ViewTheme;
18
+ export {};
@@ -2,5 +2,5 @@ export * from './getAsyncOptions';
2
2
  export * from './getFetcherFunction';
3
3
  export * from './isValidDateRange';
4
4
  export * from './viewsAdapter';
5
- export * from './createAllView';
5
+ export * from './createEmptyTransformedView';
6
6
  export * from './organiseViews';
@@ -3,5 +3,5 @@ type ViewsAdapterProps = {
3
3
  view: any;
4
4
  canUpdateCustomViews: boolean;
5
5
  };
6
- export declare const viewsAdapter: ({ view, canUpdateCustomViews, }: ViewsAdapterProps) => TransformedView;
6
+ export declare const viewsAdapter: ({ view, canUpdateCustomViews }: ViewsAdapterProps) => TransformedView;
7
7
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",
@@ -1,3 +0,0 @@
1
- import { TransformedView } from 'src/types';
2
- export declare const ALL_VIEW_ID = "all";
3
- export declare const createAllView: () => TransformedView;
@@ -1 +0,0 @@
1
- export { createAllView } from './createAllView';