@veeqo/transfigure 1.2.4 → 1.2.6

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 (104) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +158 -157
  3. package/dist/index100.cjs +11 -18
  4. package/dist/index100.js +12 -20
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +37 -14
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.js +29 -21
  9. package/dist/index103.cjs +19 -1
  10. package/dist/index103.js +24 -38
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +21 -29
  13. package/dist/index105.cjs +1 -12
  14. package/dist/index105.js +15 -16
  15. package/dist/index106.cjs +1 -80
  16. package/dist/index106.js +24 -101
  17. package/dist/index107.cjs +80 -1
  18. package/dist/index107.js +101 -19
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +18 -7
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +7 -63
  23. package/dist/index110.cjs +1 -1
  24. package/dist/index110.js +60 -26
  25. package/dist/index111.cjs +1 -1
  26. package/dist/index111.js +30 -2
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +2 -36
  29. package/dist/index114.cjs +1 -1
  30. package/dist/index114.js +32 -22
  31. package/dist/index115.cjs +1 -1
  32. package/dist/index115.js +25 -62
  33. package/dist/index116.cjs +1 -7
  34. package/dist/index116.js +63 -10
  35. package/dist/index118.cjs +7 -0
  36. package/dist/index118.js +12 -0
  37. package/dist/index2.cjs +1 -1
  38. package/dist/index2.js +3 -2
  39. package/dist/index22.cjs +1 -1
  40. package/dist/index22.js +1 -1
  41. package/dist/index31.cjs +1 -1
  42. package/dist/index31.js +1 -1
  43. package/dist/index34.cjs +1 -1
  44. package/dist/index34.js +1 -1
  45. package/dist/index36.cjs +1 -1
  46. package/dist/index36.js +39 -38
  47. package/dist/index39.cjs +1 -1
  48. package/dist/index39.js +1 -1
  49. package/dist/index40.cjs +1 -1
  50. package/dist/index40.js +1 -1
  51. package/dist/index41.cjs +1 -1
  52. package/dist/index41.js +1 -1
  53. package/dist/index42.cjs +1 -1
  54. package/dist/index42.js +1 -1
  55. package/dist/index44.cjs +1 -1
  56. package/dist/index44.js +1 -1
  57. package/dist/index46.cjs +1 -1
  58. package/dist/index46.js +2 -2
  59. package/dist/index47.cjs +1 -1
  60. package/dist/index47.js +2 -2
  61. package/dist/index68.cjs +1 -1
  62. package/dist/index68.js +114 -114
  63. package/dist/index78.cjs +1 -1
  64. package/dist/index78.js +22 -19
  65. package/dist/index79.cjs +1 -1
  66. package/dist/index79.js +7 -5
  67. package/dist/index80.cjs +1 -1
  68. package/dist/index80.js +1 -1
  69. package/dist/index84.cjs +1 -1
  70. package/dist/index84.js +1 -1
  71. package/dist/index85.cjs +1 -1
  72. package/dist/index85.js +1 -1
  73. package/dist/index87.cjs +1 -1
  74. package/dist/index87.js +116 -39
  75. package/dist/index88.cjs +1 -1
  76. package/dist/index88.js +19 -9
  77. package/dist/index89.cjs +1 -1
  78. package/dist/index89.js +39 -116
  79. package/dist/index90.cjs +1 -1
  80. package/dist/index90.js +9 -19
  81. package/dist/index91.cjs +1 -1
  82. package/dist/index91.js +13 -7
  83. package/dist/index92.cjs +104 -1
  84. package/dist/index92.js +120 -13
  85. package/dist/index93.cjs +1 -104
  86. package/dist/index93.js +65 -117
  87. package/dist/index94.cjs +1 -1
  88. package/dist/index94.js +24 -63
  89. package/dist/index95.cjs +1 -1
  90. package/dist/index95.js +2 -29
  91. package/dist/index96.cjs +1 -1
  92. package/dist/index96.js +41 -2
  93. package/dist/index97.cjs +1 -1
  94. package/dist/index97.js +9 -39
  95. package/dist/index98.cjs +1 -1
  96. package/dist/index98.js +17 -10
  97. package/dist/index99.cjs +1 -1
  98. package/dist/index99.js +6 -23
  99. package/dist/storybookHelpers/apiMocks/views/custom_views.d.ts +7 -0
  100. package/dist/types.d.ts +14 -0
  101. package/dist/utils/getViewTheme/getViewTheme.d.ts +21 -0
  102. package/dist/utils/getViewTheme/getViewTheme.test.d.ts +1 -0
  103. package/dist/utils/getViewTheme/index.d.ts +1 -0
  104. package/package.json +1 -1
package/dist/index97.js CHANGED
@@ -1,43 +1,13 @@
1
- import { useState as d } from "react";
2
- import { useViews as v } from "./index62.js";
3
- import { useStores as y } from "./index61.js";
4
- import { useModal as C } from "./index52.js";
5
- import { usePersistUnsavedChanges as g } from "./index60.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
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));
14
8
  }
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
- };
9
+ );
40
10
  };
41
11
  export {
42
- b as usePersistColumns
12
+ a as filterColumnsBySearch
43
13
  };
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 t=require("@veeqo/ui"),r=require("./index2.cjs"),s=o=>{let e={colourPalette:t.theme.colors.secondary.blue,customTextColour:void 0};switch(o){case r.ViewStatusTypes.ERROR:e={colourPalette:t.theme.colors.secondary.red,customTextColour:void 0};break}return e};exports.getViewTheme=s;
package/dist/index98.js CHANGED
@@ -1,13 +1,20 @@
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
- );
1
+ import { theme as o } from "@veeqo/ui";
2
+ import { ViewStatusTypes as r } from "./index2.js";
3
+ const l = (t) => {
4
+ let e = {
5
+ colourPalette: o.colors.secondary.blue,
6
+ customTextColour: void 0
7
+ };
8
+ switch (t) {
9
+ case r.ERROR:
10
+ e = {
11
+ colourPalette: o.colors.secondary.red,
12
+ customTextColour: void 0
13
+ };
14
+ break;
15
+ }
16
+ return e;
10
17
  };
11
18
  export {
12
- a as filterColumnsBySearch
19
+ l as getViewTheme
13
20
  };
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),n=require("react"),l=require("./index116.cjs"),v=({children:i,style:o,className:c})=>{const r=n.useRef(null),[u,f]=n.useState(0);return n.useEffect(()=>{const e=r.current,s=()=>{if(e){const{top:a}=e.getBoundingClientRect();f(a)}};s();const t=new ResizeObserver(s);return e&&t.observe(e),()=>{e&&t.unobserve(e),t.disconnect()}},[]),d.jsx(l.AdaptiveStyledContainer,{style:o,className:c,offset:u,ref:r,children:i})};exports.AdaptiveHeightContainer=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index79.cjs"),e=i.createAllView(),t={fixedViews:[e],customViews:[],viewsMap:new Map([[e.id,e]])};exports.INITIAL_VIEWS_STATE=t;
package/dist/index99.js CHANGED
@@ -1,26 +1,9 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { useRef as a, useState as d, useEffect as m } from "react";
3
- import { AdaptiveStyledContainer as v } from "./index116.js";
4
- const R = ({
5
- children: o,
6
- style: s,
7
- className: f
8
- }) => {
9
- const r = a(null), [i, c] = d(0);
10
- return m(() => {
11
- const e = r.current, n = () => {
12
- if (e) {
13
- const { top: u } = e.getBoundingClientRect();
14
- c(u);
15
- }
16
- };
17
- n();
18
- const t = new ResizeObserver(n);
19
- return e && t.observe(e), () => {
20
- e && t.unobserve(e), t.disconnect();
21
- };
22
- }, []), /* @__PURE__ */ p(v, { style: s, className: f, offset: i, ref: r, children: o });
1
+ import { createAllView as i } from "./index79.js";
2
+ const e = i(), s = {
3
+ fixedViews: [e],
4
+ customViews: [],
5
+ viewsMap: /* @__PURE__ */ new Map([[e.id, e]])
23
6
  };
24
7
  export {
25
- R as AdaptiveHeightContainer
8
+ s as INITIAL_VIEWS_STATE
26
9
  };
@@ -26,6 +26,7 @@ export declare const custom_views: {
26
26
  columns: {
27
27
  columnIds: string[];
28
28
  };
29
+ view_attributes?: undefined;
29
30
  } | {
30
31
  id: string;
31
32
  title: string;
@@ -53,6 +54,7 @@ export declare const custom_views: {
53
54
  columns: {
54
55
  columnIds: string[];
55
56
  };
57
+ view_attributes?: undefined;
56
58
  } | {
57
59
  id: string;
58
60
  title: string;
@@ -86,6 +88,7 @@ export declare const custom_views: {
86
88
  columns: {
87
89
  columnIds: string[];
88
90
  };
91
+ view_attributes?: undefined;
89
92
  } | {
90
93
  id: string;
91
94
  title: string;
@@ -115,6 +118,9 @@ export declare const custom_views: {
115
118
  created_at: string;
116
119
  updated_at: string;
117
120
  editable: boolean;
121
+ view_attributes: {
122
+ type: string;
123
+ };
118
124
  company_id: number;
119
125
  columns: {
120
126
  columnIds?: undefined;
@@ -152,5 +158,6 @@ export declare const custom_views: {
152
158
  columns: {
153
159
  columnIds?: undefined;
154
160
  };
161
+ view_attributes?: undefined;
155
162
  })[];
156
163
  };
package/dist/types.d.ts CHANGED
@@ -70,6 +70,9 @@ type ViewFilters = {
70
70
  filter?: OrderFilter | InventoryFilter;
71
71
  sort?: string;
72
72
  };
73
+ export declare enum ViewStatusTypes {
74
+ ERROR = "error"
75
+ }
73
76
  export type View = {
74
77
  id: string;
75
78
  type: ViewType;
@@ -83,6 +86,9 @@ export type View = {
83
86
  created_at: string;
84
87
  updated_at: string;
85
88
  editable: boolean;
89
+ view_attributes?: {
90
+ type: ViewStatusTypes;
91
+ };
86
92
  };
87
93
  export type FilterMaps = {
88
94
  filters: Map<string, string>;
@@ -107,6 +113,14 @@ export type TransformedView = {
107
113
  isShared: boolean;
108
114
  originalView?: TransformedView;
109
115
  columns: ViewColumns;
116
+ colourPalette: {
117
+ lightest: string;
118
+ light: string;
119
+ base: string;
120
+ dark: string;
121
+ darkest: string;
122
+ };
123
+ customTextColour?: string;
110
124
  };
111
125
  export type ViewsState = {
112
126
  fixedViews: TransformedView[];
@@ -0,0 +1,21 @@
1
+ import { ViewStatusTypes } from '../../types';
2
+ /**
3
+ * Returns a view theme configuration based on the provided view status.
4
+ *
5
+ * @param type - The current view status used to determine which theme
6
+ * colours to apply (for example, an error state).
7
+ * @returns An object describing the theme for the view, including
8
+ * {@code colourPalette}, which provides the base colour palette for
9
+ * the view, and {@code customTextColour}, an optional override for
10
+ * the default text colour.
11
+ */
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
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { getViewTheme } from './getViewTheme';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",