@veeqo/transfigure 1.2.0 → 1.2.2

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 (118) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -0
  2. package/dist/components/Views/ViewList/ViewsList.d.ts +5 -1
  3. package/dist/constants/viewConstants.d.ts +2 -0
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.js +16 -14
  6. package/dist/index10.cjs +1 -1
  7. package/dist/index10.js +14 -13
  8. package/dist/index100.cjs +1 -1
  9. package/dist/index100.js +20 -14
  10. package/dist/index101.cjs +1 -19
  11. package/dist/index101.js +14 -23
  12. package/dist/index102.cjs +12 -1
  13. package/dist/index102.js +16 -24
  14. package/dist/index103.cjs +1 -12
  15. package/dist/index103.js +33 -16
  16. package/dist/index104.cjs +1 -80
  17. package/dist/index104.js +28 -100
  18. package/dist/index105.cjs +1 -1
  19. package/dist/index105.js +24 -2
  20. package/dist/index106.cjs +80 -1
  21. package/dist/index106.js +101 -19
  22. package/dist/index107.cjs +1 -1
  23. package/dist/index107.js +18 -7
  24. package/dist/index108.cjs +1 -1
  25. package/dist/index108.js +7 -63
  26. package/dist/index109.cjs +1 -1
  27. package/dist/index109.js +60 -26
  28. package/dist/index11.cjs +1 -1
  29. package/dist/index11.js +1 -1
  30. package/dist/index110.cjs +1 -13
  31. package/dist/index110.js +30 -17
  32. package/dist/index111.cjs +1 -1
  33. package/dist/index111.js +2 -26
  34. package/dist/index112.cjs +13 -1
  35. package/dist/index112.js +14 -33
  36. package/dist/index113.cjs +1 -7
  37. package/dist/index113.js +36 -10
  38. package/dist/index114.cjs +1 -1
  39. package/dist/index114.js +25 -62
  40. package/dist/index115.cjs +1 -1
  41. package/dist/index115.js +58 -42
  42. package/dist/index116.cjs +1 -0
  43. package/dist/index116.js +49 -0
  44. package/dist/index117.cjs +7 -0
  45. package/dist/index117.js +12 -0
  46. package/dist/index17.cjs +1 -1
  47. package/dist/index17.js +1 -1
  48. package/dist/index22.cjs +1 -1
  49. package/dist/index22.js +1 -1
  50. package/dist/index31.cjs +1 -1
  51. package/dist/index31.js +1 -1
  52. package/dist/index34.cjs +1 -1
  53. package/dist/index34.js +1 -1
  54. package/dist/index36.cjs +1 -1
  55. package/dist/index36.js +62 -60
  56. package/dist/index39.cjs +1 -1
  57. package/dist/index39.js +1 -1
  58. package/dist/index40.cjs +1 -1
  59. package/dist/index40.js +1 -1
  60. package/dist/index41.cjs +1 -1
  61. package/dist/index41.js +1 -1
  62. package/dist/index42.cjs +1 -1
  63. package/dist/index42.js +1 -1
  64. package/dist/index44.cjs +1 -1
  65. package/dist/index44.js +36 -34
  66. package/dist/index46.cjs +1 -1
  67. package/dist/index46.js +2 -2
  68. package/dist/index62.cjs +1 -1
  69. package/dist/index62.js +31 -49
  70. package/dist/index7.cjs +1 -1
  71. package/dist/index7.js +4 -4
  72. package/dist/index80.cjs +1 -1
  73. package/dist/index80.js +20 -6
  74. package/dist/index81.cjs +1 -1
  75. package/dist/index81.js +7 -2
  76. package/dist/index82.cjs +1 -1
  77. package/dist/index82.js +2 -9
  78. package/dist/index83.cjs +1 -3
  79. package/dist/index83.js +8 -13
  80. package/dist/index84.cjs +3 -1
  81. package/dist/index84.js +13 -8
  82. package/dist/index85.cjs +1 -1
  83. package/dist/index85.js +8 -4
  84. package/dist/index88.cjs +1 -1
  85. package/dist/index88.js +4 -117
  86. package/dist/index89.cjs +1 -1
  87. package/dist/index89.js +117 -18
  88. package/dist/index90.cjs +1 -1
  89. package/dist/index90.js +19 -13
  90. package/dist/index91.cjs +1 -104
  91. package/dist/index91.js +13 -120
  92. package/dist/index92.cjs +104 -1
  93. package/dist/index92.js +117 -65
  94. package/dist/index93.cjs +1 -1
  95. package/dist/index93.js +63 -24
  96. package/dist/index94.cjs +1 -1
  97. package/dist/index94.js +29 -2
  98. package/dist/index95.cjs +1 -1
  99. package/dist/index95.js +2 -41
  100. package/dist/index96.cjs +1 -1
  101. package/dist/index96.js +39 -9
  102. package/dist/index97.cjs +1 -1
  103. package/dist/index97.js +9 -31
  104. package/dist/index98.cjs +1 -1
  105. package/dist/index98.js +7 -29
  106. package/dist/index99.cjs +19 -1
  107. package/dist/index99.js +24 -21
  108. package/dist/mocks/createMockTransformedView.d.ts +2 -0
  109. package/dist/mocks/createMockView.d.ts +2 -0
  110. package/dist/storybookHelpers/Code.d.ts +3 -0
  111. package/dist/storybookHelpers/apiMocks/views/mockSeededAllView.d.ts +26 -0
  112. package/dist/types.d.ts +5 -0
  113. package/dist/utils/index.d.ts +1 -0
  114. package/dist/utils/organiseViews/index.d.ts +1 -0
  115. package/dist/utils/organiseViews/organiseViews.d.ts +18 -0
  116. package/dist/utils/organiseViews/organiseViews.test.d.ts +1 -0
  117. package/package.json +1 -1
  118. /package/dist/storybookHelpers/apiMocks/{custom_views.d.ts → views/custom_views.d.ts} +0 -0
package/dist/index99.cjs CHANGED
@@ -1 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index104.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),e=require("@veeqo/ui"),s=t=>t&&t.__esModule?t:{default:t},o=s(r),i=o.default(e.Button).attrs(()=>({role:"option",variant:"flat"}))`
2
+ margin: ${e.theme.sizes.xs};
3
+ min-width: 180px;
4
+ justify-content: flex-start;
5
+ font-size: ${e.theme.text.body.fontSize};
6
+
7
+ &:hover {
8
+ background-color: ${e.theme.colors.neutral.grey.lightest};
9
+ color: ${e.theme.colors.secondary.blue.base};
10
+ cursor: pointer;
11
+ }
12
+ `,n=o.default(e.Card.Surface).attrs(()=>({role:"listbox",elevation:4}))`
13
+ margin-top: ${e.theme.sizes.xs};
14
+ background-color: white;
15
+ `,l=o.default.hr`
16
+ width: 100%;
17
+ border-top: 1px solid ${e.theme.colors.neutral.grey.dark};
18
+ margin: 0;
19
+ `;exports.Divider=l;exports.Item=i;exports.MenuItems=n;
package/dist/index99.js CHANGED
@@ -1,23 +1,26 @@
1
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { Stack as a, theme as n } from "@veeqo/ui";
3
- import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index104.js";
4
- const p = n.colors.secondary.blue.base, b = ({ onClick: e }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(a, { direction: "horizontal", alignY: "center", children: [
5
- /* @__PURE__ */ r(l, { ariaLabel: "info", name: "info", color: p }),
6
- /* @__PURE__ */ i(c, { children: [
7
- /* @__PURE__ */ r(d, { variant: "body", margin: "0 4px 0 0", children: "You are currently in a" }),
8
- /* @__PURE__ */ r(s, { variant: "bodyBoldDark", children: "draft view" }),
9
- /* @__PURE__ */ r(h, { variant: "hintText", children: "Apply filters and save these by creating a custom view" })
10
- ] }),
11
- /* @__PURE__ */ r(
12
- m,
13
- {
14
- variant: "primary",
15
- onClick: e,
16
- size: "sm",
17
- children: "Create view"
18
- }
19
- )
20
- ] }) }) });
1
+ import t from "styled-components";
2
+ import { theme as o, Card as r, Button as e } from "@veeqo/ui";
3
+ const n = t(e).attrs(() => ({ role: "option", variant: "flat" }))`
4
+ margin: ${o.sizes.xs};
5
+ min-width: 180px;
6
+ justify-content: flex-start;
7
+ font-size: ${o.text.body.fontSize};
8
+
9
+ &:hover {
10
+ background-color: ${o.colors.neutral.grey.lightest};
11
+ color: ${o.colors.secondary.blue.base};
12
+ cursor: pointer;
13
+ }
14
+ `, a = t(r.Surface).attrs(() => ({ role: "listbox", elevation: 4 }))`
15
+ margin-top: ${o.sizes.xs};
16
+ background-color: white;
17
+ `, l = t.hr`
18
+ width: 100%;
19
+ border-top: 1px solid ${o.colors.neutral.grey.dark};
20
+ margin: 0;
21
+ `;
21
22
  export {
22
- b as DraftPill
23
+ l as Divider,
24
+ n as Item,
25
+ a as MenuItems
23
26
  };
@@ -0,0 +1,2 @@
1
+ import { TransformedView } from 'src/types';
2
+ export declare const createMockTransformedView: (overrides?: Partial<TransformedView>) => TransformedView;
@@ -0,0 +1,2 @@
1
+ import { View } from 'src/types';
2
+ export declare const createMockView: (overrides?: Partial<View>) => View;
@@ -0,0 +1,3 @@
1
+ export declare const Code: ({ text }: {
2
+ text: string;
3
+ }) => JSX.Element;
@@ -0,0 +1,26 @@
1
+ export declare const MOCK_SEEDED_ALL_VIEW: {
2
+ id: string;
3
+ type: string;
4
+ attributes: {
5
+ title: string;
6
+ filters: {
7
+ filter: {};
8
+ };
9
+ columns: {
10
+ columnIds: string[];
11
+ };
12
+ shared: boolean;
13
+ created_at: string;
14
+ updated_at: string;
15
+ editable: boolean;
16
+ type: string;
17
+ };
18
+ relationships: {
19
+ user: {
20
+ data: {
21
+ id: string;
22
+ type: string;
23
+ };
24
+ };
25
+ };
26
+ };
package/dist/types.d.ts CHANGED
@@ -108,4 +108,9 @@ export type TransformedView = {
108
108
  originalView?: TransformedView;
109
109
  columns: ViewColumns;
110
110
  };
111
+ export type ViewsState = {
112
+ fixedViews: TransformedView[];
113
+ customViews: TransformedView[];
114
+ viewsMap: Map<string, TransformedView>;
115
+ };
111
116
  export {};
@@ -3,3 +3,4 @@ export * from './getFetcherFunction';
3
3
  export * from './isValidDateRange';
4
4
  export * from './viewsAdapter';
5
5
  export * from './createAllView';
6
+ export * from './organiseViews';
@@ -0,0 +1 @@
1
+ export { organiseViews } from './organiseViews';
@@ -0,0 +1,18 @@
1
+ import { View, ViewsState } from 'src/types';
2
+ export type OrganiseViewsProps = {
3
+ data?: View[];
4
+ canUpdateCustomViews: boolean;
5
+ };
6
+ /**
7
+ * This helper takes an array of custom_view objects returned from the v2/custom_views endpoint
8
+ * and organises them into 3 data structures:
9
+ *
10
+ * - Fixed views
11
+ * - Custom views
12
+ * - A map containing all views for easy lookup
13
+ *
14
+ * It also contains logic to conditionally add the "All" view, a generic view intended to contain
15
+ * no/minimal filters. If one is provided in the response, it replaces the generated "All" view
16
+ * in the data structures.
17
+ */
18
+ export declare const organiseViews: ({ data, canUpdateCustomViews }: OrganiseViewsProps) => ViewsState;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",