@veeqo/transfigure 0.0.1 → 0.0.3

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 (150) hide show
  1. package/README.md +2 -53
  2. package/dist/BusinessLogic/mocks.d.ts +3 -3
  3. package/dist/BusinessLogic/types.d.ts +3 -2
  4. package/dist/components/Filters/ActiveFilters/Categories/index.d.ts +2 -0
  5. package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncCheckboxFilter/ActiveAsyncCheckboxFilter.d.ts +8 -0
  6. package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncCheckboxFilter/index.d.ts +1 -0
  7. package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncRadioFilter/ActiveAsyncRadioFilter.d.ts +8 -0
  8. package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncRadioFilter/index.d.ts +1 -0
  9. package/dist/components/Filters/{Fields → ActiveFilters/Variants/ActiveFilterNumberRangeTag}/FilterNumberRangeFilter/FilterNumberRangeFilter.d.ts +1 -1
  10. package/dist/components/Filters/ActiveFilters/Variants/index.d.ts +5 -0
  11. package/dist/components/Filters/ActiveFilters/index.d.ts +2 -3
  12. package/dist/components/Filters/Fields/index.d.ts +0 -6
  13. package/dist/components/Filters/{Fields/FilterGroup → FilterGroup}/FilterGroup.d.ts +1 -1
  14. package/dist/components/Filters/FilterGroup/index.d.ts +1 -0
  15. package/dist/components/Filters/index.d.ts +1 -0
  16. package/dist/components/TableControls/TableControls.d.ts +1 -0
  17. package/dist/components/TableControls/index.d.ts +1 -0
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +75 -75
  21. package/dist/index10.js +3 -12
  22. package/dist/index11.cjs +1 -1
  23. package/dist/index11.js +19 -19
  24. package/dist/index12.cjs +1 -1
  25. package/dist/index12.js +42 -21
  26. package/dist/index13.cjs +1 -1
  27. package/dist/index13.js +23 -38
  28. package/dist/index14.cjs +1 -1
  29. package/dist/index14.js +39 -37
  30. package/dist/index15.cjs +1 -1
  31. package/dist/index15.js +36 -54
  32. package/dist/index16.cjs +1 -1
  33. package/dist/index16.js +32 -46
  34. package/dist/index17.cjs +1 -1
  35. package/dist/index17.js +50 -42
  36. package/dist/index18.cjs +1 -1
  37. package/dist/index18.js +39 -50
  38. package/dist/index19.cjs +1 -1
  39. package/dist/index19.js +59 -37
  40. package/dist/index20.cjs +1 -1
  41. package/dist/index20.js +53 -37
  42. package/dist/index21.cjs +1 -1
  43. package/dist/index21.js +45 -53
  44. package/dist/index22.cjs +1 -1
  45. package/dist/index22.js +43 -33
  46. package/dist/index23.cjs +1 -1
  47. package/dist/index23.js +56 -57
  48. package/dist/index24.cjs +1 -1
  49. package/dist/index24.js +57 -18
  50. package/dist/index25.cjs +1 -1
  51. package/dist/index25.js +38 -31
  52. package/dist/index26.cjs +1 -1
  53. package/dist/index26.js +55 -39
  54. package/dist/index27.cjs +1 -1
  55. package/dist/index27.js +52 -34
  56. package/dist/index28.cjs +1 -1
  57. package/dist/index28.js +81 -47
  58. package/dist/index29.cjs +1 -1
  59. package/dist/index29.js +36 -107
  60. package/dist/index3.js +1 -3
  61. package/dist/index30.cjs +1 -1
  62. package/dist/index30.js +31 -31
  63. package/dist/index31.cjs +1 -1
  64. package/dist/index31.js +10 -30
  65. package/dist/index32.cjs +1 -1
  66. package/dist/index32.js +40 -14
  67. package/dist/index33.js +49 -48
  68. package/dist/index34.js +12 -11
  69. package/dist/index35.js +104 -39
  70. package/dist/index36.cjs +1 -1
  71. package/dist/index36.js +47 -24
  72. package/dist/index37.cjs +1 -1
  73. package/dist/index37.js +43 -22
  74. package/dist/index38.cjs +1 -1
  75. package/dist/index38.js +22 -27
  76. package/dist/index39.cjs +1 -1
  77. package/dist/index39.js +67 -26
  78. package/dist/index4.js +1 -8
  79. package/dist/index40.js +71 -21
  80. package/dist/index41.cjs +1 -1
  81. package/dist/index41.js +31 -18
  82. package/dist/index42.js +2 -8
  83. package/dist/index43.js +13 -1
  84. package/dist/index45.js +14 -12
  85. package/dist/index48.js +1 -3
  86. package/dist/index5.js +2 -9
  87. package/dist/index50.js +3 -12
  88. package/dist/index51.js +8 -42
  89. package/dist/index52.js +20 -35
  90. package/dist/index53.js +16 -25
  91. package/dist/index54.js +18 -27
  92. package/dist/index55.js +31 -36
  93. package/dist/index57.js +22 -32
  94. package/dist/index58.js +14 -15
  95. package/dist/index59.js +2 -10
  96. package/dist/index6.js +8 -40
  97. package/dist/index60.cjs +1 -1
  98. package/dist/index60.js +226 -209
  99. package/dist/index61.js +5 -9
  100. package/dist/index62.js +3 -9
  101. package/dist/index65.js +1 -6
  102. package/dist/index66.js +1 -4
  103. package/dist/index67.js +1 -3
  104. package/dist/index69.js +28 -23
  105. package/dist/index75.cjs +1 -1
  106. package/dist/index75.js +2 -4
  107. package/dist/index76.js +26 -16
  108. package/dist/index77.cjs +1 -19
  109. package/dist/index77.js +14 -29
  110. package/dist/index78.cjs +19 -1
  111. package/dist/index78.js +24 -16
  112. package/dist/index79.cjs +1 -1
  113. package/dist/index79.js +22 -9
  114. package/dist/index80.cjs +78 -10
  115. package/dist/index80.js +92 -13
  116. package/dist/index81.cjs +10 -78
  117. package/dist/index81.js +13 -94
  118. package/dist/index83.cjs +1 -80
  119. package/dist/index83.js +35 -96
  120. package/dist/index84.cjs +1 -1
  121. package/dist/index84.js +62 -35
  122. package/dist/index85.js +1 -3
  123. package/dist/index86.cjs +80 -7
  124. package/dist/index86.js +93 -10
  125. package/dist/index87.cjs +7 -0
  126. package/dist/index87.js +12 -0
  127. package/dist/index9.cjs +1 -1
  128. package/dist/index9.js +99 -84
  129. package/dist/mobx/Filters/Filters.d.ts +5 -0
  130. package/dist/mocks/internal/mockUseStores/index.d.ts +1 -0
  131. package/dist/mocks/internal/mockUseStores/mockUseStores.d.ts +6 -0
  132. package/dist/types.d.ts +1 -1
  133. package/package.json +4 -5
  134. package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/AsyncInlineCheckboxFilter.d.ts +0 -8
  135. package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/index.d.ts +0 -1
  136. package/dist/components/Filters/Fields/AsyncInlineRadioFilter/AsyncInlineRadioFilter.d.ts +0 -8
  137. package/dist/components/Filters/Fields/AsyncInlineRadioFilter/index.d.ts +0 -1
  138. package/dist/components/Filters/Fields/FilterGroup/index.d.ts +0 -1
  139. package/dist/components/Table/Table.d.ts +0 -1
  140. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterArrayField/FilterArrayField.d.ts +0 -0
  141. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterArrayField/index.d.ts +0 -0
  142. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterField/FilterField.d.ts +0 -0
  143. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterField/index.d.ts +0 -0
  144. /package/dist/components/Filters/ActiveFilters/{ActiveFilterArrayTag → Variants/ActiveFilterArrayTag}/ActiveFilterArrayTag.d.ts +0 -0
  145. /package/dist/components/Filters/ActiveFilters/{ActiveFilterArrayTag → Variants/ActiveFilterArrayTag}/index.d.ts +0 -0
  146. /package/dist/components/Filters/ActiveFilters/{ActiveFilterDateRangeTag → Variants/ActiveFilterDateRangeTag}/ActiveFilterDateRangeTag.d.ts +0 -0
  147. /package/dist/components/Filters/ActiveFilters/{ActiveFilterDateRangeTag → Variants/ActiveFilterDateRangeTag}/index.d.ts +0 -0
  148. /package/dist/components/Filters/ActiveFilters/{ActiveFilterNumberRangeTag → Variants/ActiveFilterNumberRangeTag}/ActiveFilterNumberRangeTag.d.ts +0 -0
  149. /package/dist/components/Filters/{Fields → ActiveFilters/Variants/ActiveFilterNumberRangeTag}/FilterNumberRangeFilter/index.d.ts +0 -0
  150. /package/dist/components/Filters/ActiveFilters/{ActiveFilterNumberRangeTag → Variants/ActiveFilterNumberRangeTag}/index.d.ts +0 -0
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index80.cjs"),j=require("./index38.cjs"),m=require("./index57.cjs"),S=require("./index58.cjs"),q=require("./index34.cjs"),u=require("./index33.cjs"),p=require("./index56.cjs"),a=require("./index10.cjs"),b=V.observer(()=>{const{Views:{draftViewsList:c}}=p.useStores(),{viewsArray:l,fixedViews:d}=m.useViews(),[o,i]=n.useState(!1),[w,x]=n.useState(null),h=()=>i(!1);return S.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(s.ViewsContainer,{onClickMenu:()=>i(!0),ariaMenuControls:"views-menu",ariaMenuExpanded:o,ref:x,children:[l.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id)),c.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id))]}),o&&e.jsx(s.Popover,{id:"views-menu",anchorElement:w,placement:"bottom",onShouldClose:()=>i(!1),children:e.jsxs(s.Card.Surface,{children:[e.jsx(t.FixedViews,{children:d.map(r=>e.jsx(s.Text,{variant:"placeholder",children:r.label},r.id||r.label))}),e.jsx(j.SortableViews,{}),e.jsx(t.Divider,{}),e.jsx(q.CreateView,{hideActionsPopover:h})]})})]})});exports.ViewList=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index81.cjs"),j=require("./index38.cjs"),m=require("./index57.cjs"),S=require("./index58.cjs"),q=require("./index34.cjs"),u=require("./index33.cjs"),p=require("./index56.cjs"),a=require("./index10.cjs"),b=V.observer(()=>{const{Views:{draftViewsList:c}}=p.useStores(),{viewsArray:l,fixedViews:d}=m.useViews(),[o,i]=n.useState(!1),[w,x]=n.useState(null),h=()=>i(!1);return S.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(s.ViewsContainer,{onClickMenu:()=>i(!0),ariaMenuControls:"views-menu",ariaMenuExpanded:o,ref:x,children:[l.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id)),c.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id))]}),o&&e.jsx(s.Popover,{id:"views-menu",anchorElement:w,placement:"bottom",onShouldClose:()=>i(!1),children:e.jsxs(s.Card.Surface,{children:[e.jsx(t.FixedViews,{children:d.map(r=>e.jsx(s.Text,{variant:"placeholder",children:r.label},r.id||r.label))}),e.jsx(j.SortableViews,{}),e.jsx(t.Divider,{}),e.jsx(q.CreateView,{hideActionsPopover:h})]})})]})});exports.ViewList=b;
package/dist/index41.js CHANGED
@@ -2,7 +2,7 @@ import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as n } from "react";
3
3
  import { observer as h } from "mobx-react";
4
4
  import { ViewsContainer as w, Popover as V, Card as v, Text as S } from "@veeqo/ui";
5
- import { FixedViews as x, Divider as C } from "./index80.js";
5
+ import { FixedViews as x, Divider as C } from "./index81.js";
6
6
  import { SortableViews as b } from "./index38.js";
7
7
  import { useViews as A } from "./index57.js";
8
8
  import { useViewUrlChange as L } from "./index58.js";
@@ -12,24 +12,37 @@ import { useStores as T } from "./index56.js";
12
12
  import { ErrorBoundary as m } from "./index10.js";
13
13
  const z = h(() => {
14
14
  const {
15
- Views: {
16
- draftViewsList: l
17
- }
18
- } = T(), {
19
- viewsArray: a,
20
- fixedViews: d
21
- } = A(), [t, o] = n(!1), [p, c] = n(null), f = () => o(!1);
15
+ Views: { draftViewsList: l }
16
+ } = T(), { viewsArray: a, fixedViews: d } = A(), [t, o] = n(!1), [p, c] = n(null), f = () => o(!1);
22
17
  return L(), /* @__PURE__ */ i(u, { children: [
23
- /* @__PURE__ */ i(w, { onClickMenu: () => o(!0), ariaMenuControls: "views-menu", ariaMenuExpanded: t, ref: c, children: [
24
- a.map((r) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(s, { view: r }) }, r.id)),
25
- l.map((r) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(s, { view: r }) }, r.id))
26
- ] }),
27
- t && /* @__PURE__ */ e(V, { id: "views-menu", anchorElement: p, placement: "bottom", onShouldClose: () => o(!1), children: /* @__PURE__ */ i(v.Surface, { children: [
28
- /* @__PURE__ */ e(x, { children: d.map((r) => /* @__PURE__ */ e(S, { variant: "placeholder", children: r.label }, r.id || r.label)) }),
29
- /* @__PURE__ */ e(b, {}),
30
- /* @__PURE__ */ e(C, {}),
31
- /* @__PURE__ */ e(M, { hideActionsPopover: f })
32
- ] }) })
18
+ /* @__PURE__ */ i(
19
+ w,
20
+ {
21
+ onClickMenu: () => o(!0),
22
+ ariaMenuControls: "views-menu",
23
+ ariaMenuExpanded: t,
24
+ ref: c,
25
+ children: [
26
+ a.map((r) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(s, { view: r }) }, r.id)),
27
+ l.map((r) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(s, { view: r }) }, r.id))
28
+ ]
29
+ }
30
+ ),
31
+ t && /* @__PURE__ */ e(
32
+ V,
33
+ {
34
+ id: "views-menu",
35
+ anchorElement: p,
36
+ placement: "bottom",
37
+ onShouldClose: () => o(!1),
38
+ children: /* @__PURE__ */ i(v.Surface, { children: [
39
+ /* @__PURE__ */ e(x, { children: d.map((r) => /* @__PURE__ */ e(S, { variant: "placeholder", children: r.label }, r.id || r.label)) }),
40
+ /* @__PURE__ */ e(b, {}),
41
+ /* @__PURE__ */ e(C, {}),
42
+ /* @__PURE__ */ e(M, { hideActionsPopover: f })
43
+ ] })
44
+ }
45
+ )
33
46
  ] });
34
47
  });
35
48
  export {
package/dist/index42.js CHANGED
@@ -1,12 +1,6 @@
1
1
  const e = {
2
- PERSONAL: {
3
- key: "personal",
4
- text: "Personal"
5
- },
6
- COMPANY: {
7
- key: "company",
8
- text: "Company"
9
- }
2
+ PERSONAL: { key: "personal", text: "Personal" },
3
+ COMPANY: { key: "company", text: "Company" }
10
4
  };
11
5
  export {
12
6
  e as SHARING_OPTIONS
package/dist/index43.js CHANGED
@@ -2,7 +2,19 @@ import { DateRanges as A, DATE_RANGE_OPTIONS as T } from "@veeqo/ui";
2
2
  const _ = {
3
3
  ...A,
4
4
  CUSTOM: "CUSTOM"
5
- }, O = /* @__PURE__ */ new Map([["CUSTOM", T[0]], [_.TODAY, T[1]], [_.YESTERDAY, T[2]], [_.LAST_7_DAYS, T[3]], [_.LAST_30_DAYS, T[4]], [_.LAST_90_DAYS, T[5]], [_.LAST_MONTH, T[6]], [_.LAST_12_MONTHS, T[7]], [_.WEEK_TO_DATE, T[8]], [_.MONTH_TO_DATE, T[9]], [_.YEAR_TO_DATE, T[10]]]);
5
+ }, O = /* @__PURE__ */ new Map([
6
+ ["CUSTOM", T[0]],
7
+ [_.TODAY, T[1]],
8
+ [_.YESTERDAY, T[2]],
9
+ [_.LAST_7_DAYS, T[3]],
10
+ [_.LAST_30_DAYS, T[4]],
11
+ [_.LAST_90_DAYS, T[5]],
12
+ [_.LAST_MONTH, T[6]],
13
+ [_.LAST_12_MONTHS, T[7]],
14
+ [_.WEEK_TO_DATE, T[8]],
15
+ [_.MONTH_TO_DATE, T[9]],
16
+ [_.YEAR_TO_DATE, T[10]]
17
+ ]);
6
18
  export {
7
19
  O as DateOptionMap,
8
20
  _ as DateValue
package/dist/index45.js CHANGED
@@ -1,20 +1,22 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import { useState as i, useCallback as n, useMemo as u, createContext as p } from "react";
3
- const v = p(null), f = ({
4
- children: r
5
- }) => {
6
- const [s, a] = i(null), e = n((o) => o === s, [s]), t = n(() => {
3
+ const v = p(null), f = ({ children: r }) => {
4
+ const [s, a] = i(null), e = n(
5
+ (o) => o === s,
6
+ [s]
7
+ ), t = n(() => {
7
8
  a(null);
8
9
  }, []), l = n((o) => {
9
10
  a(o);
10
- }, []), c = n((o) => {
11
- e(o) ? t() : l(o);
12
- }, [t, e, l]), M = u(() => ({
13
- closeModal: t,
14
- isModalOpen: e,
15
- openModal: l,
16
- toggleModal: c
17
- }), [t, e, l, c]);
11
+ }, []), c = n(
12
+ (o) => {
13
+ e(o) ? t() : l(o);
14
+ },
15
+ [t, e, l]
16
+ ), M = u(
17
+ () => ({ closeModal: t, isModalOpen: e, openModal: l, toggleModal: c }),
18
+ [t, e, l, c]
19
+ );
18
20
  return /* @__PURE__ */ d(v.Provider, { value: M, children: r });
19
21
  };
20
22
  export {
package/dist/index48.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const a = (t = {}) => {
2
- const {
3
- headers: n = {}
4
- } = t, e = document.querySelector('meta[name="csrf-token"]'), r = e ? e.content : null, o = window.localStorage.csrf || r;
2
+ const { headers: n = {} } = t, e = document.querySelector('meta[name="csrf-token"]'), r = e ? e.content : null, o = window.localStorage.csrf || r;
5
3
  return o ? {
6
4
  ...t,
7
5
  headers: {
package/dist/index5.js CHANGED
@@ -2,15 +2,8 @@ import { deserialise as r } from "kitsu-core";
2
2
  import { axios as e } from "./index6.js";
3
3
  import { withCSRF as i } from "./index48.js";
4
4
  import { vndAPI as s } from "./index49.js";
5
- const n = async ({
6
- attributes: t
7
- }) => {
8
- const o = await e.post("/api/v2/custom_views", {
9
- data: {
10
- attributes: t,
11
- type: "custom_view"
12
- }
13
- }, i(s));
5
+ const n = async ({ attributes: t }) => {
6
+ const o = await e.post("/api/v2/custom_views", { data: { attributes: t, type: "custom_view" } }, i(s));
14
7
  return r(o.data);
15
8
  };
16
9
  export {
package/dist/index50.js CHANGED
@@ -3,19 +3,10 @@ import { withCSRF as o } from "./index48.js";
3
3
  import { onlyJSON as m, vndAPI as p } from "./index49.js";
4
4
  import { axios as s } from "./index6.js";
5
5
  const w = async (t) => (await s.get(t, o(m))).data, y = async (t, e = {}) => {
6
- const {
7
- serialize: n = !0,
8
- includeMeta: i = !1
9
- } = e, r = await s.get(t, o(p));
6
+ const { serialize: n = !0, includeMeta: i = !1 } = e, r = await s.get(t, o(p));
10
7
  if (!n) return r.data;
11
- const {
12
- data: a,
13
- meta: c
14
- } = f(r.data);
15
- return i ? {
16
- data: a,
17
- meta: c
18
- } : a;
8
+ const { data: a, meta: c } = f(r.data);
9
+ return i ? { data: a, meta: c } : a;
19
10
  };
20
11
  export {
21
12
  w as fetcherV1,
package/dist/index51.js CHANGED
@@ -13,36 +13,17 @@ import { useStores as b } from "./index56.js";
13
13
  import { createCustomView as j } from "./index5.js";
14
14
  import { patchCustomView as z } from "./index4.js";
15
15
  const ye = (e) => {
16
- const {
17
- VIEW_TYPE: r
18
- } = H(), {
19
- duplicateView: E
20
- } = B(), {
21
- getActiveViewInAPIFormat: I
22
- } = T(), {
16
+ const { VIEW_TYPE: r } = H(), { duplicateView: E } = B(), { getActiveViewInAPIFormat: I } = T(), {
23
17
  canDeleteCustomViews: g,
24
18
  defaultCustomViewId: P,
25
19
  canUpdateCustomViews: M,
26
20
  mutate: F
27
21
  } = q({
28
22
  type: r
29
- }), {
30
- mutate: u,
31
- viewsMap: f,
32
- viewsArray: Y
33
- } = W(), [N, a] = c(!1), [A, p] = c(!1), [m, n] = c(!1), [k, h] = c(!1), {
34
- Views: {
35
- removeDraftViewById: D,
36
- draftViewsMap: L
37
- },
38
- Filters: {
39
- initFiltersFromView: d,
40
- updateUrl: l,
41
- setActiveViewId: O
42
- },
43
- Notifications: {
44
- notify: o
45
- }
23
+ }), { mutate: u, viewsMap: f, viewsArray: Y } = W(), [N, a] = c(!1), [A, p] = c(!1), [m, n] = c(!1), [k, h] = c(!1), {
24
+ Views: { removeDraftViewById: D, draftViewsMap: L },
25
+ Filters: { initFiltersFromView: d, updateUrl: l, setActiveViewId: O },
26
+ Notifications: { notify: o }
46
27
  } = b();
47
28
  return {
48
29
  actions: {
@@ -101,11 +82,7 @@ const ye = (e) => {
101
82
  menu: {
102
83
  handleSave: async (t) => {
103
84
  try {
104
- const {
105
- viewName: i,
106
- shareOption: y,
107
- isDefault: v
108
- } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, w = {
85
+ const { viewName: i, shareOption: y, isDefault: v } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, w = {
109
86
  attributes: {
110
87
  title: i,
111
88
  shared: V.key === s.COMPANY.key
@@ -159,15 +136,7 @@ const ye = (e) => {
159
136
  create: {
160
137
  handleCreate: async (t) => {
161
138
  try {
162
- const {
163
- viewName: i,
164
- shareOption: y,
165
- isDefault: v
166
- } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, {
167
- arg: w
168
- } = I(), {
169
- data: S
170
- } = await j({
139
+ const { viewName: i, shareOption: y, isDefault: v } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, { arg: w } = I(), { data: S } = await j({
171
140
  attributes: {
172
141
  ...w,
173
142
  title: i,
@@ -187,10 +156,7 @@ const ye = (e) => {
187
156
  } : {}
188
157
  }
189
158
  }), await u(), D(e.id);
190
- const U = R({
191
- view: S,
192
- canUpdateCustomViews: M
193
- });
159
+ const U = R({ view: S, canUpdateCustomViews: M });
194
160
  d(U), l(), h(!1), o({
195
161
  type: "success",
196
162
  text: `New view '${w.title}' created`
package/dist/index52.js CHANGED
@@ -1,43 +1,28 @@
1
1
  import { useViews as a } from "./index57.js";
2
2
  import { useStores as f } from "./index56.js";
3
3
  const d = () => {
4
- const {
5
- viewsMap: r
6
- } = a(), {
7
- Filters: {
8
- activeViewId: i,
9
- initFiltersFromView: o,
10
- updateUrl: s
11
- },
12
- Views: {
13
- addDraftView: w,
14
- draftViewsMap: n
15
- }
4
+ const { viewsMap: r } = a(), {
5
+ Filters: { activeViewId: i, initFiltersFromView: o, updateUrl: s },
6
+ Views: { addDraftView: w, draftViewsMap: n }
16
7
  } = f();
17
- return {
18
- duplicateView: () => {
19
- if (!i)
20
- throw Error("Creating views from all is not supported...implement me");
21
- if (r.has(i)) {
22
- const e = r.get(i);
23
- if (!e)
24
- throw Error("Could not find view in viewsMap");
25
- const t = w({
26
- ...e
27
- });
28
- o(t);
29
- } else {
30
- const e = n.get(i);
31
- if (!e)
32
- throw Error("Could not find view in draftViewsMap");
33
- const t = w({
34
- ...e
35
- });
36
- o(t);
37
- }
38
- s();
8
+ return { duplicateView: () => {
9
+ if (!i)
10
+ throw Error("Creating views from all is not supported...implement me");
11
+ if (r.has(i)) {
12
+ const e = r.get(i);
13
+ if (!e)
14
+ throw Error("Could not find view in viewsMap");
15
+ const t = w({ ...e });
16
+ o(t);
17
+ } else {
18
+ const e = n.get(i);
19
+ if (!e)
20
+ throw Error("Could not find view in draftViewsMap");
21
+ const t = w({ ...e });
22
+ o(t);
39
23
  }
40
- };
24
+ s();
25
+ } };
41
26
  };
42
27
  export {
43
28
  d as useDuplicateActiveView
package/dist/index53.js CHANGED
@@ -3,33 +3,24 @@ import { getAsyncOptions as m } from "./index66.js";
3
3
  import { getFetcherFunction as p } from "./index67.js";
4
4
  import l from "swr/immutable";
5
5
  import { useStores as f } from "./index56.js";
6
- const a = ({
7
- filterData: e
8
- }) => {
6
+ const a = ({ filterData: e }) => {
9
7
  var s;
10
8
  const {
11
- Filters: {
12
- arrayFilters: c
13
- }
14
- } = f(), o = c.get(e.id), {
15
- data: n
16
- } = l((s = e.fetchAsyncFilterOptions) == null ? void 0 : s.URL, () => {
17
- var t;
18
- return p({
19
- fetcherName: (t = e.fetchAsyncFilterOptions) == null ? void 0 : t.fetcher
20
- })(e.fetchAsyncFilterOptions.URL);
21
- }, {
22
- revalidateOnFocus: !1
23
- });
24
- return {
25
- filterLabel: i(() => {
26
- const r = n ? m({
27
- data: n,
28
- config: e.fetchAsyncFilterOptions
29
- }) : e.options;
30
- return (r == null ? void 0 : r.filter((t) => o == null ? void 0 : o.includes(t.value.toString())).map((t) => t.label).join(", ")) || "";
31
- }, [n, e.options, o, e.fetchAsyncFilterOptions])
32
- };
9
+ Filters: { arrayFilters: c }
10
+ } = f(), o = c.get(e.id), { data: n } = l(
11
+ (s = e.fetchAsyncFilterOptions) == null ? void 0 : s.URL,
12
+ () => {
13
+ var t;
14
+ return p({
15
+ fetcherName: (t = e.fetchAsyncFilterOptions) == null ? void 0 : t.fetcher
16
+ })(e.fetchAsyncFilterOptions.URL);
17
+ },
18
+ { revalidateOnFocus: !1 }
19
+ );
20
+ return { filterLabel: i(() => {
21
+ const r = n ? m({ data: n, config: e.fetchAsyncFilterOptions }) : e.options;
22
+ return (r == null ? void 0 : r.filter((t) => o == null ? void 0 : o.includes(t.value.toString())).map((t) => t.label).join(", ")) || "";
23
+ }, [n, e.options, o, e.fetchAsyncFilterOptions]) };
33
24
  };
34
25
  export {
35
26
  a as useFilterArrayLabel
package/dist/index54.js CHANGED
@@ -3,36 +3,27 @@ import { getAsyncOptions as m } from "./index66.js";
3
3
  import { getFetcherFunction as f } from "./index67.js";
4
4
  import h from "swr/immutable";
5
5
  import { useStores as u } from "./index56.js";
6
- const b = ({
7
- filterData: t
8
- }) => {
6
+ const b = ({ filterData: t }) => {
9
7
  var c;
10
8
  const {
11
- Filters: {
12
- filters: r
13
- }
14
- } = u(), e = r.get(t.id), {
15
- data: s
16
- } = h((c = t.fetchAsyncFilterOptions) == null ? void 0 : c.URL, () => {
17
- var o;
18
- return f({
19
- fetcherName: (o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher
20
- })(t.fetchAsyncFilterOptions.URL);
21
- }, {
22
- revalidateOnFocus: !1
23
- });
24
- return {
25
- filterLabel: p(() => {
9
+ Filters: { filters: r }
10
+ } = u(), e = r.get(t.id), { data: s } = h(
11
+ (c = t.fetchAsyncFilterOptions) == null ? void 0 : c.URL,
12
+ () => {
26
13
  var o;
27
- if (!t.options && !t.fetchAsyncFilterOptions)
28
- return e;
29
- const n = s ? m({
30
- data: s,
31
- config: t.fetchAsyncFilterOptions
32
- }) : t.options;
33
- return ((o = n == null ? void 0 : n.find((i) => i.value.toString() === (e == null ? void 0 : e.toString()))) == null ? void 0 : o.label) || "";
34
- }, [s, t.options, e, t.fetchAsyncFilterOptions])
35
- };
14
+ return f({
15
+ fetcherName: (o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher
16
+ })(t.fetchAsyncFilterOptions.URL);
17
+ },
18
+ { revalidateOnFocus: !1 }
19
+ );
20
+ return { filterLabel: p(() => {
21
+ var o;
22
+ if (!t.options && !t.fetchAsyncFilterOptions)
23
+ return e;
24
+ const n = s ? m({ data: s, config: t.fetchAsyncFilterOptions }) : t.options;
25
+ return ((o = n == null ? void 0 : n.find((i) => i.value.toString() === (e == null ? void 0 : e.toString()))) == null ? void 0 : o.label) || "";
26
+ }, [s, t.options, e, t.fetchAsyncFilterOptions]) };
36
27
  };
37
28
  export {
38
29
  b as useFilterLabel
package/dist/index55.js CHANGED
@@ -21,13 +21,8 @@ const P = () => {
21
21
  numberRangeFilters: b,
22
22
  initFiltersFromView: d
23
23
  },
24
- Views: {
25
- draftViewsMap: E
26
- }
27
- } = V(), {
28
- viewsMap: f,
29
- mutate: A
30
- } = I(), [S, a] = h(!1), n = () => {
24
+ Views: { draftViewsMap: E }
25
+ } = V(), { viewsMap: f, mutate: A } = I(), [S, a] = h(!1), n = () => {
31
26
  if (!o) throw Error("No active view");
32
27
  const r = {};
33
28
  Array.from(u.entries()).filter(([t, e]) => e !== "" && t !== g).forEach(([t, e]) => {
@@ -43,17 +38,14 @@ const P = () => {
43
38
  r[t] = {}, e.gte !== void 0 && (r[t].gte = e.gte.toString()), e.isValidLte && e.lte && (r[t].lte = e.lte.toString());
44
39
  });
45
40
  let i = f.get(o);
46
- return f.has(o) || (i = E.get(o)), {
47
- arg: {
48
- type: F,
49
- filters: {
50
- filter: r,
51
- page: i == null ? void 0 : i.page
52
- },
53
- title: i == null ? void 0 : i.label
41
+ return f.has(o) || (i = E.get(o)), { arg: {
42
+ type: F,
43
+ filters: {
44
+ filter: r,
45
+ page: i == null ? void 0 : i.page
54
46
  },
55
- currentView: i
56
- };
47
+ title: i == null ? void 0 : i.label
48
+ }, currentView: i };
57
49
  };
58
50
  return {
59
51
  getActiveViewInAPIFormat: n,
@@ -61,28 +53,31 @@ const P = () => {
61
53
  if (o)
62
54
  try {
63
55
  a(!0);
64
- const {
65
- arg: r,
66
- currentView: i
67
- } = n();
68
- await C(o, {
69
- attributes: r
70
- }), await A();
56
+ const { arg: r, currentView: i } = n();
57
+ await C(o, { attributes: r }), await A();
71
58
  const m = {
72
59
  ...i,
73
60
  filterMaps: {
74
- filters: new Map(Object.entries(r.filters.filter).filter(([t, e]) => !Array.isArray(e) && typeof e == "string" && !l.includes(t)).map(([t, e]) => [t, e])),
75
- arrayFilters: new Map(Object.entries(r.filters.filter).filter(([, t]) => Array.isArray(t)).map(([t, e]) => [t, e])),
76
- rangeFilters: new Map(Object.entries(r.filters.filter).filter(([t]) => l.includes(t)).map(([t, e]) => {
77
- const s = new T();
78
- return typeof e == "object" ? (s.setFilterType("CUSTOM"), s.setDates(c(e.gte), c(e.lte))) : s.setFilterType(e), [t, s];
79
- })),
80
- numberRangeFilters: new Map(Object.entries(r.filters.filter).filter(([t]) => p.includes(t)).map(([t, e]) => {
81
- const s = new R({
82
- filterId: t
83
- });
84
- return e.gte && s.setGte(Number(e.gte)), e.lte && s.setLte(Number(e.lte)), [t, s];
85
- }))
61
+ filters: new Map(
62
+ Object.entries(r.filters.filter).filter(
63
+ ([t, e]) => !Array.isArray(e) && typeof e == "string" && !l.includes(t)
64
+ ).map(([t, e]) => [t, e])
65
+ ),
66
+ arrayFilters: new Map(
67
+ Object.entries(r.filters.filter).filter(([, t]) => Array.isArray(t)).map(([t, e]) => [t, e])
68
+ ),
69
+ rangeFilters: new Map(
70
+ Object.entries(r.filters.filter).filter(([t]) => l.includes(t)).map(([t, e]) => {
71
+ const s = new T();
72
+ return typeof e == "object" ? (s.setFilterType("CUSTOM"), s.setDates(c(e.gte), c(e.lte))) : s.setFilterType(e), [t, s];
73
+ })
74
+ ),
75
+ numberRangeFilters: new Map(
76
+ Object.entries(r.filters.filter).filter(([t]) => p.includes(t)).map(([t, e]) => {
77
+ const s = new R({ filterId: t });
78
+ return e.gte && s.setGte(Number(e.gte)), e.lte && s.setLte(Number(e.lte)), [t, s];
79
+ })
80
+ )
86
81
  }
87
82
  };
88
83
  d(m);
package/dist/index57.js CHANGED
@@ -6,43 +6,33 @@ import { useCustomViews as U } from "./index59.js";
6
6
  import { useBusinessLogic as b } from "./index7.js";
7
7
  import { fetcherV2 as h } from "./index50.js";
8
8
  const s = y(), F = () => {
9
- const {
10
- DEFAULT_PAGE_NUMBER: p,
11
- DEFAULT_PAGE_SIZE: c,
12
- VIEW_TYPE: m
13
- } = b(), {
9
+ const { DEFAULT_PAGE_NUMBER: p, DEFAULT_PAGE_SIZE: c, VIEW_TYPE: m } = b(), {
14
10
  canUpdateCustomViews: w,
15
11
  orderedListOfCustomViews: o,
16
12
  defaultCustomViewId: l,
17
13
  isLoading: g,
18
14
  isValidating: x
19
- } = U({
20
- type: m
21
- }), {
22
- data: n,
23
- isLoading: A,
24
- isValidating: L,
25
- error: E,
26
- mutate: M
27
- } = _(`/api/v2/custom_views?filter[type]=${m}&page[number]=${p}&page[size]=${c}`, h), V = d(() => ({
28
- fixedViews: [s],
29
- customViews: [],
30
- viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
31
- }), []), {
32
- viewsMap: C,
33
- customViews: r,
34
- fixedViews: f
35
- } = d(() => n ? n.reduce((e, t) => {
36
- const i = I({
37
- view: t,
38
- canUpdateCustomViews: w
39
- });
40
- return e.viewsMap.set(t.id, i), t.editable ? e.customViews.push(i) : e.fixedViews.push(i), e;
41
- }, {
42
- fixedViews: [s],
43
- customViews: [],
44
- viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
45
- }) : V, [n, V, w]), v = d(() => r.sort((e, t) => {
15
+ } = U({ type: m }), { data: n, isLoading: A, isValidating: L, error: E, mutate: M } = _(
16
+ `/api/v2/custom_views?filter[type]=${m}&page[number]=${p}&page[size]=${c}`,
17
+ h
18
+ ), V = d(
19
+ () => ({
20
+ fixedViews: [s],
21
+ customViews: [],
22
+ viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
23
+ }),
24
+ []
25
+ ), { viewsMap: C, customViews: r, fixedViews: f } = d(() => n ? n.reduce(
26
+ (e, t) => {
27
+ const i = I({ view: t, canUpdateCustomViews: w });
28
+ return e.viewsMap.set(t.id, i), t.editable ? e.customViews.push(i) : e.fixedViews.push(i), e;
29
+ },
30
+ {
31
+ fixedViews: [s],
32
+ customViews: [],
33
+ viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
34
+ }
35
+ ) : V, [n, V, w]), v = d(() => r.sort((e, t) => {
46
36
  const i = Array.isArray(o) ? o : [], a = i.indexOf(e.id), u = i.indexOf(t.id);
47
37
  return a === -1 && u === -1 ? 0 : a === -1 ? 1 : u === -1 ? -1 : a - u;
48
38
  }), [r, o]);
package/dist/index58.js CHANGED
@@ -5,10 +5,7 @@ import { useViews as F } from "./index57.js";
5
5
  import { useBusinessLogic as C } from "./index7.js";
6
6
  import { useStores as D } from "./index56.js";
7
7
  const T = () => {
8
- const {
9
- VIEW_TYPE: g,
10
- SEARCH_FILTER_ID: c
11
- } = C(), {
8
+ const { VIEW_TYPE: g, SEARCH_FILTER_ID: c } = C(), {
12
9
  Filters: {
13
10
  activeViewId: d,
14
11
  initFiltersFromView: e,
@@ -17,16 +14,7 @@ const T = () => {
17
14
  updateUrl: L,
18
15
  setFilter: l
19
16
  }
20
- } = D(), {
21
- isLoading: V,
22
- isValidating: v
23
- } = E({
24
- type: g
25
- }), {
26
- viewsMap: t,
27
- defaultCustomViewId: f,
28
- isLoading: h
29
- } = F(), p = v || h || V;
17
+ } = D(), { isLoading: V, isValidating: v } = E({ type: g }), { viewsMap: t, defaultCustomViewId: f, isLoading: h } = F(), p = v || h || V;
30
18
  u(() => {
31
19
  if (p) return;
32
20
  const s = new URLSearchParams(window.location.search), m = s.get("view"), a = s.get(c), o = s.size > 0;
@@ -50,7 +38,18 @@ const T = () => {
50
38
  }
51
39
  a && l(c, a);
52
40
  }
53
- }, [c, d, f, w, e, i, p, l, L, t]), u(() => {
41
+ }, [
42
+ c,
43
+ d,
44
+ f,
45
+ w,
46
+ e,
47
+ i,
48
+ p,
49
+ l,
50
+ L,
51
+ t
52
+ ]), u(() => {
54
53
  const s = () => {
55
54
  const a = new URLSearchParams(window.location.search).get("view");
56
55
  if (!a) return;