@veeqo/transfigure 1.1.5 → 1.1.7

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 (230) hide show
  1. package/dist/components/ActionsDropdown/ActionsDropdown.d.ts +2 -0
  2. package/dist/components/ActionsDropdown/index.d.ts +1 -0
  3. package/dist/components/ActionsDropdown/types.d.ts +7 -0
  4. package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
  5. package/dist/components/Views/PillNotifications/variants/styled.d.ts +3 -3
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.css +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +146 -144
  10. package/dist/index100.cjs +1 -1
  11. package/dist/index100.js +29 -21
  12. package/dist/index101.cjs +1 -1
  13. package/dist/index101.js +21 -24
  14. package/dist/index102.cjs +16 -77
  15. package/dist/index102.js +19 -96
  16. package/dist/index103.cjs +12 -1
  17. package/dist/index103.js +16 -2
  18. package/dist/index104.cjs +80 -1
  19. package/dist/index104.js +101 -19
  20. package/dist/index105.cjs +1 -1
  21. package/dist/index105.js +18 -7
  22. package/dist/index106.cjs +1 -1
  23. package/dist/index106.js +7 -63
  24. package/dist/index107.cjs +1 -1
  25. package/dist/index107.js +60 -26
  26. package/dist/index108.cjs +1 -13
  27. package/dist/index108.js +30 -17
  28. package/dist/index109.cjs +13 -1
  29. package/dist/index109.js +15 -24
  30. package/dist/index11.cjs +1 -1
  31. package/dist/index11.js +27 -18
  32. package/dist/index110.cjs +1 -1
  33. package/dist/index110.js +2 -36
  34. package/dist/index111.cjs +1 -1
  35. package/dist/index111.js +35 -46
  36. package/dist/index112.cjs +1 -1
  37. package/dist/index112.js +25 -62
  38. package/dist/index113.cjs +1 -7
  39. package/dist/index113.js +47 -10
  40. package/dist/index114.cjs +1 -0
  41. package/dist/index114.js +65 -0
  42. package/dist/index115.cjs +7 -0
  43. package/dist/index115.js +12 -0
  44. package/dist/index12.cjs +1 -1
  45. package/dist/index12.js +18 -21
  46. package/dist/index13.cjs +1 -1
  47. package/dist/index13.js +19 -41
  48. package/dist/index14.cjs +1 -1
  49. package/dist/index14.js +41 -23
  50. package/dist/index15.cjs +1 -1
  51. package/dist/index15.js +24 -36
  52. package/dist/index16.cjs +1 -1
  53. package/dist/index16.js +37 -33
  54. package/dist/index17.cjs +1 -1
  55. package/dist/index17.js +32 -49
  56. package/dist/index18.cjs +1 -1
  57. package/dist/index18.js +47 -38
  58. package/dist/index19.cjs +1 -1
  59. package/dist/index19.js +29 -29
  60. package/dist/index20.cjs +1 -1
  61. package/dist/index20.js +41 -58
  62. package/dist/index21.cjs +1 -1
  63. package/dist/index21.js +48 -42
  64. package/dist/index22.cjs +1 -1
  65. package/dist/index22.js +50 -44
  66. package/dist/index23.cjs +1 -1
  67. package/dist/index23.js +46 -7
  68. package/dist/index24.cjs +1 -1
  69. package/dist/index24.js +7 -11
  70. package/dist/index25.cjs +1 -1
  71. package/dist/index25.js +11 -64
  72. package/dist/index26.cjs +1 -1
  73. package/dist/index26.js +40 -39
  74. package/dist/index27.cjs +1 -1
  75. package/dist/index27.js +60 -37
  76. package/dist/index28.cjs +1 -1
  77. package/dist/index28.js +36 -53
  78. package/dist/index29.cjs +1 -1
  79. package/dist/index29.js +54 -51
  80. package/dist/index3.cjs +1 -1
  81. package/dist/index3.js +2 -2
  82. package/dist/index30.cjs +1 -1
  83. package/dist/index30.js +50 -81
  84. package/dist/index31.cjs +1 -1
  85. package/dist/index31.js +81 -35
  86. package/dist/index32.cjs +1 -1
  87. package/dist/index32.js +38 -33
  88. package/dist/index33.cjs +1 -1
  89. package/dist/index33.js +33 -10
  90. package/dist/index34.cjs +1 -1
  91. package/dist/index34.js +10 -39
  92. package/dist/index35.cjs +1 -1
  93. package/dist/index35.js +38 -102
  94. package/dist/index36.cjs +1 -1
  95. package/dist/index36.js +103 -19
  96. package/dist/index37.cjs +1 -1
  97. package/dist/index37.js +17 -134
  98. package/dist/index38.cjs +1 -1
  99. package/dist/index38.js +135 -49
  100. package/dist/index39.cjs +1 -1
  101. package/dist/index39.js +51 -32
  102. package/dist/index4.cjs +1 -1
  103. package/dist/index4.js +2 -2
  104. package/dist/index40.cjs +1 -1
  105. package/dist/index40.js +31 -53
  106. package/dist/index41.cjs +1 -1
  107. package/dist/index41.js +54 -48
  108. package/dist/index42.cjs +1 -1
  109. package/dist/index42.js +41 -81
  110. package/dist/index43.cjs +1 -1
  111. package/dist/index43.js +81 -41
  112. package/dist/index44.cjs +1 -1
  113. package/dist/index44.js +48 -5
  114. package/dist/index45.cjs +1 -1
  115. package/dist/index45.js +5 -45
  116. package/dist/index46.cjs +1 -1
  117. package/dist/index46.js +44 -41
  118. package/dist/index47.cjs +1 -1
  119. package/dist/index47.js +42 -19
  120. package/dist/index48.cjs +1 -1
  121. package/dist/index48.js +19 -8
  122. package/dist/index49.cjs +1 -1
  123. package/dist/index49.js +7 -22
  124. package/dist/index5.cjs +1 -1
  125. package/dist/index5.js +2 -2
  126. package/dist/index50.cjs +1 -1
  127. package/dist/index50.js +23 -2
  128. package/dist/index51.cjs +1 -1
  129. package/dist/index51.js +2 -4
  130. package/dist/index52.cjs +1 -1
  131. package/dist/index52.js +4 -11
  132. package/dist/index53.cjs +1 -1
  133. package/dist/index53.js +10 -12
  134. package/dist/index54.cjs +1 -1
  135. package/dist/index54.js +12 -11
  136. package/dist/index55.cjs +1 -1
  137. package/dist/index55.js +11 -184
  138. package/dist/index56.cjs +1 -1
  139. package/dist/index56.js +183 -25
  140. package/dist/index57.cjs +1 -1
  141. package/dist/index57.js +26 -24
  142. package/dist/index58.cjs +1 -1
  143. package/dist/index58.js +19 -22
  144. package/dist/index59.cjs +1 -1
  145. package/dist/index59.js +25 -97
  146. package/dist/index6.cjs +1 -1
  147. package/dist/index6.js +2 -2
  148. package/dist/index60.cjs +1 -1
  149. package/dist/index60.js +99 -8
  150. package/dist/index61.cjs +1 -1
  151. package/dist/index61.js +8 -51
  152. package/dist/index62.cjs +1 -1
  153. package/dist/index62.js +50 -60
  154. package/dist/index63.cjs +1 -1
  155. package/dist/index63.js +57 -18
  156. package/dist/index64.cjs +1 -1
  157. package/dist/index64.js +22 -18
  158. package/dist/index65.cjs +1 -1
  159. package/dist/index65.js +16 -26
  160. package/dist/index66.cjs +1 -1
  161. package/dist/index66.js +27 -56
  162. package/dist/index67.cjs +1 -1
  163. package/dist/index67.js +57 -341
  164. package/dist/index68.cjs +1 -1
  165. package/dist/index68.js +337 -55
  166. package/dist/index69.cjs +1 -1
  167. package/dist/index69.js +50 -47
  168. package/dist/index7.cjs +1 -1
  169. package/dist/index7.js +4 -4
  170. package/dist/index70.cjs +1 -1
  171. package/dist/index70.js +51 -32
  172. package/dist/index71.cjs +1 -1
  173. package/dist/index71.js +30 -24
  174. package/dist/index72.cjs +1 -1
  175. package/dist/index72.js +26 -32
  176. package/dist/index73.cjs +1 -1
  177. package/dist/index73.js +37 -12
  178. package/dist/index74.cjs +1 -1
  179. package/dist/index74.js +13 -9
  180. package/dist/index75.cjs +1 -1
  181. package/dist/index75.js +9 -17
  182. package/dist/index76.cjs +1 -1
  183. package/dist/index76.js +14 -16
  184. package/dist/index77.cjs +1 -1
  185. package/dist/index77.js +18 -49
  186. package/dist/index78.cjs +1 -1
  187. package/dist/index78.js +50 -21
  188. package/dist/index79.cjs +1 -1
  189. package/dist/index79.js +21 -7
  190. package/dist/index80.cjs +1 -1
  191. package/dist/index80.js +7 -2
  192. package/dist/index81.cjs +1 -1
  193. package/dist/index81.js +2 -9
  194. package/dist/index82.cjs +1 -3
  195. package/dist/index82.js +8 -13
  196. package/dist/index83.cjs +3 -1
  197. package/dist/index83.js +13 -8
  198. package/dist/index84.cjs +1 -1
  199. package/dist/index84.js +9 -41
  200. package/dist/index85.cjs +1 -1
  201. package/dist/index85.js +4 -8
  202. package/dist/index86.cjs +1 -1
  203. package/dist/index86.js +39 -116
  204. package/dist/index87.cjs +1 -1
  205. package/dist/index87.js +9 -19
  206. package/dist/index88.cjs +1 -1
  207. package/dist/index88.js +118 -13
  208. package/dist/index89.cjs +1 -104
  209. package/dist/index89.js +17 -118
  210. package/dist/index90.cjs +1 -1
  211. package/dist/index90.js +13 -68
  212. package/dist/index91.cjs +104 -1
  213. package/dist/index91.js +119 -28
  214. package/dist/index92.cjs +1 -1
  215. package/dist/index92.js +68 -2
  216. package/dist/index93.cjs +1 -1
  217. package/dist/index93.js +27 -39
  218. package/dist/index94.cjs +1 -1
  219. package/dist/index94.js +2 -11
  220. package/dist/index95.cjs +1 -1
  221. package/dist/index95.js +37 -29
  222. package/dist/index96.cjs +1 -1
  223. package/dist/index96.js +11 -29
  224. package/dist/index97.cjs +1 -19
  225. package/dist/index97.js +24 -24
  226. package/dist/index98.cjs +1 -1
  227. package/dist/index98.js +1 -1
  228. package/dist/index99.cjs +1 -12
  229. package/dist/index99.js +33 -16
  230. package/package.json +1 -1
@@ -0,0 +1,65 @@
1
+ import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
+ import { observer as N } from "mobx-react";
3
+ import { Stack as h, TextField as u } from "@veeqo/ui";
4
+ import { MUISlider as L } from "./index111.js";
5
+ const j = N(
6
+ ({ data: g, editedValue: t, setEditedValue: l }) => {
7
+ var f;
8
+ if (!((f = g.options) != null && f.length)) return null;
9
+ const [i, x] = g.options, s = Number(i.value), c = Number(x.value), p = (e, n) => {
10
+ if (!Array.isArray(n) || n.length !== 2 || !t) return;
11
+ const [r, y] = n, m = t == null ? void 0 : t.clone();
12
+ m.setGte(r), m.setLte(y), l(m);
13
+ }, o = {
14
+ gte: (t == null ? void 0 : t.gte) || 0,
15
+ lte: (t == null ? void 0 : t.lte) || 100
16
+ }, M = (e) => {
17
+ if (!t) return;
18
+ const n = t.clone(), r = Number(e);
19
+ r > n.lteMax || (r >= n.gteMin && r <= n.lteMax && n.setGte(r), (!n.lte || r >= n.lte) && n.setLte(n.lteMax), l(n));
20
+ }, v = (e) => {
21
+ if (!t) return;
22
+ const n = t.clone(), r = Number(e);
23
+ r < n.gteMin || (r >= n.gteMin && r <= n.lteMax && n.setLte(r), (!n.gte || r <= n.gte) && n.setGte(n.gteMin), l(n));
24
+ }, C = [o.gte, o.lte];
25
+ return /* @__PURE__ */ b(h, { spacing: "xs", alignX: "stretch", children: [
26
+ /* @__PURE__ */ b(h, { direction: "horizontal", children: [
27
+ /* @__PURE__ */ a(
28
+ u,
29
+ {
30
+ label: i.label,
31
+ type: "number",
32
+ min: s,
33
+ max: c,
34
+ value: o.gte.toString(),
35
+ onChange: M
36
+ }
37
+ ),
38
+ /* @__PURE__ */ a(
39
+ u,
40
+ {
41
+ label: x.label,
42
+ type: "number",
43
+ min: s,
44
+ max: c,
45
+ value: o.lte.toString(),
46
+ onChange: v
47
+ }
48
+ )
49
+ ] }),
50
+ /* @__PURE__ */ a(
51
+ L,
52
+ {
53
+ value: C,
54
+ onChange: p,
55
+ min: s,
56
+ max: c,
57
+ valueLabelDisplay: "auto"
58
+ }
59
+ )
60
+ ] });
61
+ }
62
+ );
63
+ export {
64
+ j as FilterNumberRangeFilter
65
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
2
+ padding: ${e.theme.sizes.sm};
3
+ // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
4
+ // with an additional sizes.base offset at the bottom.
5
+ max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
6
+ overflow-y: auto;
7
+ `;exports.AdaptiveStyledContainer=s;
@@ -0,0 +1,12 @@
1
+ import o from "styled-components";
2
+ import { theme as e, BaseContainer as i } from "@veeqo/ui";
3
+ const h = o(i)`
4
+ padding: ${e.sizes.sm};
5
+ // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
6
+ // with an additional sizes.base offset at the bottom.
7
+ max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
8
+ overflow-y: auto;
9
+ `;
10
+ export {
11
+ h as AdaptiveStyledContainer
12
+ };
package/dist/index12.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),_=require("mobx-react"),b=require("@veeqo/ui"),f=require("lodash/debounce"),c=require("react"),h=require("./index8.cjs"),q=require("./index60.cjs"),g=e=>e&&e.__esModule?e:{default:e},E=g(f),R=_.observer(({onChange:e,capture:x,...o})=>{const{SEARCH_FILTER_ID:s,FILTERS_DEBOUCE_INTERVAL_MS:n}=h.useBusinessLogic(),{Filters:{setFilter:r,filters:a}}=q.useStores(),[i,l]=c.useState(a.get(s)||""),S=c.useCallback(E.default(t=>{r(s,t)},n),[r,s]),d=t=>{l(t),S(t),e&&e(t)};return u.jsx("div",{style:{flexGrow:1},children:u.jsx(b.Search,{value:i,onChange:d,...o})})});exports.SearchBar=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("react");class n extends s.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,e){console.log(r,e)}render(){const{hasError:r}=this.state,{children:e,errorComponent:t}=this.props;return r?t||o.jsx("p",{children:"Error"}):e}}exports.ErrorBoundary=n;
package/dist/index12.js CHANGED
@@ -1,23 +1,20 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { observer as u } from "mobx-react";
3
- import { Search as f } from "@veeqo/ui";
4
- import p from "lodash/debounce";
5
- import { useState as S, useCallback as h } from "react";
6
- import { useBusinessLogic as d } from "./index8.js";
7
- import { useStores as E } from "./index60.js";
8
- const x = u(({ onChange: o, capture: C, ...n }) => {
9
- const { SEARCH_FILTER_ID: r, FILTERS_DEBOUCE_INTERVAL_MS: a } = d(), {
10
- Filters: { setFilter: t, filters: c }
11
- } = E(), [i, m] = S(c.get(r) || ""), l = h(
12
- p((e) => {
13
- t(r, e);
14
- }, a),
15
- [t, r]
16
- );
17
- return /* @__PURE__ */ s("div", { style: { flexGrow: 1 }, children: /* @__PURE__ */ s(f, { value: i, onChange: (e) => {
18
- m(e), l(e), o && o(e);
19
- }, ...n }) });
20
- });
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Component as s } from "react";
3
+ class i extends s {
4
+ constructor(r) {
5
+ super(r), this.state = { hasError: !1 };
6
+ }
7
+ static getDerivedStateFromError() {
8
+ return { hasError: !0 };
9
+ }
10
+ componentDidCatch(r, o) {
11
+ console.log(r, o);
12
+ }
13
+ render() {
14
+ const { hasError: r } = this.state, { children: o, errorComponent: t } = this.props;
15
+ return r ? t || /* @__PURE__ */ e("p", { children: "Error" }) : o;
16
+ }
17
+ }
21
18
  export {
22
- x as SearchBar
19
+ i as ErrorBoundary
23
20
  };
package/dist/index13.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("mobx-react"),s=require("@veeqo/ui"),h=require("react"),d=require("./index8.cjs"),P=require("./index60.cjs"),S=g.observer(({totalPagesCount:i})=>{const{PAGE_SIZE_OPTIONS:a}=d.useBusinessLogic(),{Filters:{setCurrentPage:c,currentPage:o,pageSize:r,setPageSize:t}}=P.useStores(),u=e=>{c(e)},l=h.useCallback(e=>{r!==e&&t(e)},[r,t]);return n.jsxs(s.Stack,{direction:"horizontal",children:[n.jsx(s.Pagination,{currentPage:o,totalPagesCount:i,handleChangePage:u}),n.jsx(s.ActionMenu,{menuLabel:"items per page",ctaProps:{children:`${r} / page`,style:{marginLeft:s.theme.sizes.xs}},children:a.map(e=>n.jsxs(s.ActionMenu.Item,{onAction:()=>l(e),children:[e," / page"]},e))})]})});exports.TableControls=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),_=require("mobx-react"),b=require("@veeqo/ui"),f=require("lodash/debounce"),c=require("react"),h=require("./index8.cjs"),q=require("./index61.cjs"),g=e=>e&&e.__esModule?e:{default:e},E=g(f),R=_.observer(({onChange:e,capture:x,...o})=>{const{SEARCH_FILTER_ID:s,FILTERS_DEBOUCE_INTERVAL_MS:n}=h.useBusinessLogic(),{Filters:{setFilter:r,filters:a}}=q.useStores(),[i,l]=c.useState(a.get(s)||""),S=c.useCallback(E.default(t=>{r(s,t)},n),[r,s]),d=t=>{l(t),S(t),e&&e(t)};return u.jsx("div",{style:{flexGrow:1},children:u.jsx(b.Search,{value:i,onChange:d,...o})})});exports.SearchBar=R;
package/dist/index13.js CHANGED
@@ -1,45 +1,23 @@
1
- import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { observer as h } from "mobx-react";
3
- import { Stack as p, Pagination as u, ActionMenu as s, theme as P } from "@veeqo/ui";
4
- import { useCallback as d } from "react";
5
- import { useBusinessLogic as f } from "./index8.js";
6
- import { useStores as S } from "./index60.js";
7
- const L = h(({ totalPagesCount: o }) => {
8
- const { PAGE_SIZE_OPTIONS: i } = f(), {
9
- Filters: { setCurrentPage: m, currentPage: c, pageSize: r, setPageSize: t }
10
- } = S(), g = (e) => {
11
- m(e);
12
- }, l = d(
13
- (e) => {
14
- r !== e && t(e);
15
- },
16
- [r, t]
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { observer as u } from "mobx-react";
3
+ import { Search as f } from "@veeqo/ui";
4
+ import p from "lodash/debounce";
5
+ import { useState as S, useCallback as h } from "react";
6
+ import { useBusinessLogic as d } from "./index8.js";
7
+ import { useStores as E } from "./index61.js";
8
+ const x = u(({ onChange: o, capture: C, ...n }) => {
9
+ const { SEARCH_FILTER_ID: r, FILTERS_DEBOUCE_INTERVAL_MS: a } = d(), {
10
+ Filters: { setFilter: t, filters: c }
11
+ } = E(), [i, m] = S(c.get(r) || ""), l = h(
12
+ p((e) => {
13
+ t(r, e);
14
+ }, a),
15
+ [t, r]
17
16
  );
18
- return /* @__PURE__ */ n(p, { direction: "horizontal", children: [
19
- /* @__PURE__ */ a(
20
- u,
21
- {
22
- currentPage: c,
23
- totalPagesCount: o,
24
- handleChangePage: g
25
- }
26
- ),
27
- /* @__PURE__ */ a(
28
- s,
29
- {
30
- menuLabel: "items per page",
31
- ctaProps: {
32
- children: `${r} / page`,
33
- style: { marginLeft: P.sizes.xs }
34
- },
35
- children: i.map((e) => /* @__PURE__ */ n(s.Item, { onAction: () => l(e), children: [
36
- e,
37
- " / page"
38
- ] }, e))
39
- }
40
- )
41
- ] });
17
+ return /* @__PURE__ */ s("div", { style: { flexGrow: 1 }, children: /* @__PURE__ */ s(f, { value: i, onChange: (e) => {
18
+ m(e), l(e), o && o(e);
19
+ }, ...n }) });
42
20
  });
43
21
  export {
44
- L as TableControls
22
+ x as SearchBar
45
23
  };
package/dist/index14.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("@veeqo/ui"),n=require("mobx-react"),u=require("react"),a=require("./index60.cjs"),c=n.observer(()=>{const{Notifications:{toasts:t,removeByKey:r}}=a.useStores();return u.useEffect(()=>{const s=t.filter(e=>!e.persistent).map(e=>setTimeout(()=>{r(e.key)},2e3));return()=>{s.forEach(e=>clearTimeout(e))}},[t,r]),o.jsx(i.ToastsLayout,{max:10,minWidth:"",toasts:t,onClose:r})});exports.ToastsManager=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("mobx-react"),s=require("@veeqo/ui"),h=require("react"),d=require("./index8.cjs"),P=require("./index61.cjs"),S=g.observer(({totalPagesCount:a})=>{const{PAGE_SIZE_OPTIONS:c}=d.useBusinessLogic(),{Filters:{setCurrentPage:t,currentPage:o,pageSize:r,setPageSize:i}}=P.useStores(),u=e=>{t(e)},l=h.useCallback(e=>{r!==e&&(t(1),i(e))},[r,i]);return n.jsxs(s.Stack,{direction:"horizontal",children:[n.jsx(s.Pagination,{currentPage:o,totalPagesCount:a,handleChangePage:u}),n.jsx(s.ActionMenu,{menuLabel:"items per page",ctaProps:{children:`${r} / page`,style:{marginLeft:s.theme.sizes.xs}},children:c.map(e=>n.jsxs(s.ActionMenu.Item,{onAction:()=>l(e),children:[e," / page"]},e))})]})});exports.TableControls=S;
package/dist/index14.js CHANGED
@@ -1,27 +1,45 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { ToastsLayout as m } from "@veeqo/ui";
3
- import { observer as i } from "mobx-react";
4
- import { useEffect as a } from "react";
5
- import { useStores as n } from "./index60.js";
6
- const T = i(() => {
7
- const { Notifications: { toasts: o, removeByKey: r } } = n();
8
- return a(() => {
9
- const e = o.filter((t) => !t.persistent).map((t) => setTimeout(() => {
10
- r(t.key);
11
- }, 2e3));
12
- return () => {
13
- e.forEach((t) => clearTimeout(t));
14
- };
15
- }, [o, r]), /* @__PURE__ */ s(
16
- m,
17
- {
18
- max: 10,
19
- minWidth: "",
20
- toasts: o,
21
- onClose: r
22
- }
1
+ import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
+ import { observer as h } from "mobx-react";
3
+ import { Stack as p, Pagination as u, ActionMenu as o, theme as P } from "@veeqo/ui";
4
+ import { useCallback as d } from "react";
5
+ import { useBusinessLogic as f } from "./index8.js";
6
+ import { useStores as S } from "./index61.js";
7
+ const L = h(({ totalPagesCount: i }) => {
8
+ const { PAGE_SIZE_OPTIONS: m } = f(), {
9
+ Filters: { setCurrentPage: t, currentPage: c, pageSize: r, setPageSize: n }
10
+ } = S(), g = (e) => {
11
+ t(e);
12
+ }, l = d(
13
+ (e) => {
14
+ r !== e && (t(1), n(e));
15
+ },
16
+ [r, n]
23
17
  );
18
+ return /* @__PURE__ */ a(p, { direction: "horizontal", children: [
19
+ /* @__PURE__ */ s(
20
+ u,
21
+ {
22
+ currentPage: c,
23
+ totalPagesCount: i,
24
+ handleChangePage: g
25
+ }
26
+ ),
27
+ /* @__PURE__ */ s(
28
+ o,
29
+ {
30
+ menuLabel: "items per page",
31
+ ctaProps: {
32
+ children: `${r} / page`,
33
+ style: { marginLeft: P.sizes.xs }
34
+ },
35
+ children: m.map((e) => /* @__PURE__ */ a(o.Item, { onAction: () => l(e), children: [
36
+ e,
37
+ " / page"
38
+ ] }, e))
39
+ }
40
+ )
41
+ ] });
24
42
  });
25
43
  export {
26
- T as ToastsManager
44
+ L as TableControls
27
45
  };
package/dist/index15.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),F=require("mobx-react"),s=require("@veeqo/ui"),r=require("./index48.cjs"),A=require("./index8.cjs"),g=require("./index60.cjs"),h=require("./index18.cjs"),v=require("./index21.cjs"),T=require("./index20.cjs"),f=require("./index19.cjs"),x=F.observer(()=>{const{FIELDS_MAP:c}=A.useBusinessLogic(),{Filters:{hasActiveFilters:a,activeFilterKeysList:l,clearAllFilters:n}}=g.useStores();if(!a)return null;const o=Array.from(c).filter(([e])=>l.includes(e));return t.jsxs(s.Stack,{direction:"horizontal",alignY:"center",style:{flexWrap:"wrap",rowGap:s.theme.sizes.sm},children:[t.jsx(s.Button,{variant:"link",onClick:()=>n(),children:"Clear all"}),o.map(([e,i])=>{const u=()=>{switch(i.filterType){case r.FilterChoiceValue.CHECKBOX:return t.jsx(f.ActiveFilterArrayTag,{filterData:i},e);case r.FilterChoiceValue.DATE_RANGE:return t.jsx(T.ActiveFilterDateRangeTag,{filterData:i},e);case r.FilterChoiceValue.NUMBER_RANGE:return t.jsx(v.ActiveFilterNumberRangeTag,{filterData:i},e);case r.FilterChoiceValue.TEXT:case r.FilterChoiceValue.NUMBER:case r.FilterChoiceValue.RADIO:return t.jsx(h.ActiveFilterTag,{filterData:i},e);default:return t.jsx(s.Alert,{size:"xs",variant:"error",title:`Unsupport filter "${e}"`},e)}};return t.jsx("div",{children:u()})})]})});exports.ActiveFilters=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("@veeqo/ui"),n=require("mobx-react"),u=require("react"),a=require("./index61.cjs"),c=n.observer(()=>{const{Notifications:{toasts:t,removeByKey:r}}=a.useStores();return u.useEffect(()=>{const s=t.filter(e=>!e.persistent).map(e=>setTimeout(()=>{r(e.key)},2e3));return()=>{s.forEach(e=>clearTimeout(e))}},[t,r]),o.jsx(i.ToastsLayout,{max:10,minWidth:"",toasts:t,onClose:r})});exports.ToastsManager=c;
package/dist/index15.js CHANGED
@@ -1,39 +1,27 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { observer as m } from "mobx-react";
3
- import { Stack as f, theme as p, Button as A, Alert as u } from "@veeqo/ui";
4
- import { FilterChoiceValue as e } from "./index48.js";
5
- import { useBusinessLogic as F } from "./index8.js";
6
- import { useStores as h } from "./index60.js";
7
- import { ActiveFilterTag as d } from "./index18.js";
8
- import { ActiveFilterNumberRangeTag as g } from "./index21.js";
9
- import { ActiveFilterDateRangeTag as v } from "./index20.js";
10
- import { ActiveFilterArrayTag as D } from "./index19.js";
11
- const M = m(() => {
12
- const { FIELDS_MAP: o } = F(), {
13
- Filters: { hasActiveFilters: s, activeFilterKeysList: a, clearAllFilters: l }
14
- } = h();
15
- if (!s) return null;
16
- const n = Array.from(o).filter(([r]) => a.includes(r));
17
- return /* @__PURE__ */ c(f, { direction: "horizontal", alignY: "center", style: { flexWrap: "wrap", rowGap: p.sizes.sm }, children: [
18
- /* @__PURE__ */ t(A, { variant: "link", onClick: () => l(), children: "Clear all" }),
19
- n.map(([r, i]) => /* @__PURE__ */ t("div", { children: (() => {
20
- switch (i.filterType) {
21
- case e.CHECKBOX:
22
- return /* @__PURE__ */ t(D, { filterData: i }, r);
23
- case e.DATE_RANGE:
24
- return /* @__PURE__ */ t(v, { filterData: i }, r);
25
- case e.NUMBER_RANGE:
26
- return /* @__PURE__ */ t(g, { filterData: i }, r);
27
- case e.TEXT:
28
- case e.NUMBER:
29
- case e.RADIO:
30
- return /* @__PURE__ */ t(d, { filterData: i }, r);
31
- default:
32
- return /* @__PURE__ */ t(u, { size: "xs", variant: "error", title: `Unsupport filter "${r}"` }, r);
33
- }
34
- })() }))
35
- ] });
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { ToastsLayout as m } from "@veeqo/ui";
3
+ import { observer as i } from "mobx-react";
4
+ import { useEffect as a } from "react";
5
+ import { useStores as n } from "./index61.js";
6
+ const T = i(() => {
7
+ const { Notifications: { toasts: o, removeByKey: r } } = n();
8
+ return a(() => {
9
+ const e = o.filter((t) => !t.persistent).map((t) => setTimeout(() => {
10
+ r(t.key);
11
+ }, 2e3));
12
+ return () => {
13
+ e.forEach((t) => clearTimeout(t));
14
+ };
15
+ }, [o, r]), /* @__PURE__ */ s(
16
+ m,
17
+ {
18
+ max: 10,
19
+ minWidth: "",
20
+ toasts: o,
21
+ onClose: r
22
+ }
23
+ );
36
24
  });
37
25
  export {
38
- M as ActiveFilters
26
+ T as ToastsManager
39
27
  };
package/dist/index16.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index48.cjs"),u=require("./index111.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),F=require("mobx-react"),s=require("@veeqo/ui"),r=require("./index49.cjs"),A=require("./index8.cjs"),g=require("./index61.cjs"),h=require("./index19.cjs"),v=require("./index22.cjs"),T=require("./index21.cjs"),f=require("./index20.cjs"),x=F.observer(()=>{const{FIELDS_MAP:c}=A.useBusinessLogic(),{Filters:{hasActiveFilters:a,activeFilterKeysList:l,clearAllFilters:n}}=g.useStores();if(!a)return null;const o=Array.from(c).filter(([e])=>l.includes(e));return t.jsxs(s.Stack,{direction:"horizontal",alignY:"center",style:{flexWrap:"wrap",rowGap:s.theme.sizes.sm},children:[t.jsx(s.Button,{variant:"link",onClick:()=>n(),children:"Clear all"}),o.map(([e,i])=>{const u=()=>{switch(i.filterType){case r.FilterChoiceValue.CHECKBOX:return t.jsx(f.ActiveFilterArrayTag,{filterData:i},e);case r.FilterChoiceValue.DATE_RANGE:return t.jsx(T.ActiveFilterDateRangeTag,{filterData:i},e);case r.FilterChoiceValue.NUMBER_RANGE:return t.jsx(v.ActiveFilterNumberRangeTag,{filterData:i},e);case r.FilterChoiceValue.TEXT:case r.FilterChoiceValue.NUMBER:case r.FilterChoiceValue.RADIO:return t.jsx(h.ActiveFilterTag,{filterData:i},e);default:return t.jsx(s.Alert,{size:"xs",variant:"error",title:`Unsupport filter "${e}"`},e)}};return t.jsx("div",{children:u()})})]})});exports.ActiveFilters=x;
package/dist/index16.js CHANGED
@@ -1,35 +1,39 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { observer as n } from "mobx-react";
3
- import { ChoiceList as p } from "@veeqo/ui";
4
- import { FilterChoiceValue as s } from "./index48.js";
5
- import { ActiveAsyncCheckboxFilter as c } from "./index111.js";
6
- const F = n(
7
- ({ data: r, editedValue: e, setEditedValue: o }) => {
8
- var i;
9
- switch (r.filterType) {
10
- case s.CHECKBOX:
11
- return r.fetchAsyncFilterOptions ? /* @__PURE__ */ t(
12
- c,
13
- {
14
- field: r,
15
- setEditedValue: o,
16
- editedValue: e
17
- }
18
- ) : /* @__PURE__ */ t(
19
- p,
20
- {
21
- allowMultiple: !0,
22
- title: r.label,
23
- options: (i = r.options) != null && i.length ? r.options : [],
24
- selected: e,
25
- onChange: (l) => o(l)
26
- }
27
- );
28
- default:
29
- return null;
30
- }
31
- }
32
- );
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
+ import { observer as m } from "mobx-react";
3
+ import { Stack as f, theme as p, Button as A, Alert as u } from "@veeqo/ui";
4
+ import { FilterChoiceValue as e } from "./index49.js";
5
+ import { useBusinessLogic as F } from "./index8.js";
6
+ import { useStores as h } from "./index61.js";
7
+ import { ActiveFilterTag as d } from "./index19.js";
8
+ import { ActiveFilterNumberRangeTag as g } from "./index22.js";
9
+ import { ActiveFilterDateRangeTag as v } from "./index21.js";
10
+ import { ActiveFilterArrayTag as D } from "./index20.js";
11
+ const M = m(() => {
12
+ const { FIELDS_MAP: o } = F(), {
13
+ Filters: { hasActiveFilters: s, activeFilterKeysList: a, clearAllFilters: l }
14
+ } = h();
15
+ if (!s) return null;
16
+ const n = Array.from(o).filter(([r]) => a.includes(r));
17
+ return /* @__PURE__ */ c(f, { direction: "horizontal", alignY: "center", style: { flexWrap: "wrap", rowGap: p.sizes.sm }, children: [
18
+ /* @__PURE__ */ t(A, { variant: "link", onClick: () => l(), children: "Clear all" }),
19
+ n.map(([r, i]) => /* @__PURE__ */ t("div", { children: (() => {
20
+ switch (i.filterType) {
21
+ case e.CHECKBOX:
22
+ return /* @__PURE__ */ t(D, { filterData: i }, r);
23
+ case e.DATE_RANGE:
24
+ return /* @__PURE__ */ t(v, { filterData: i }, r);
25
+ case e.NUMBER_RANGE:
26
+ return /* @__PURE__ */ t(g, { filterData: i }, r);
27
+ case e.TEXT:
28
+ case e.NUMBER:
29
+ case e.RADIO:
30
+ return /* @__PURE__ */ t(d, { filterData: i }, r);
31
+ default:
32
+ return /* @__PURE__ */ t(u, { size: "xs", variant: "error", title: `Unsupport filter "${r}"` }, r);
33
+ }
34
+ })() }))
35
+ ] });
36
+ });
33
37
  export {
34
- F as FilterArrayField
38
+ M as ActiveFilters
35
39
  };
package/dist/index17.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("mobx-react"),s=require("@veeqo/ui"),i=require("./index48.cjs"),F=require("./index22.cjs"),h=u.observer(({data:e,editedValue:r,setEditedValue:t})=>{var n;let l;switch(e.filterType){case i.FilterChoiceValue.NUMBER:l="number";break;case i.FilterChoiceValue.TEXT:l="text";break}switch(e.filterType){case i.FilterChoiceValue.TEXT:case i.FilterChoiceValue.NUMBER:return o.jsx(s.TextField,{label:e.label,type:l,value:r,onChange:c=>t(c)});case i.FilterChoiceValue.RADIO:return e.fetchAsyncFilterOptions?o.jsx(F.ActiveAsyncRadioFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{title:e.label,options:(n=e.options)!=null&&n.length?e.options:[],selected:[r],onChange:c=>t(`${c[0]}`)});default:return null}});exports.FilterField=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./index113.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
package/dist/index17.js CHANGED
@@ -1,52 +1,35 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { observer as c } from "mobx-react";
3
- import { ChoiceList as p, TextField as f } from "@veeqo/ui";
4
- import { FilterChoiceValue as r } from "./index48.js";
5
- import { ActiveAsyncRadioFilter as m } from "./index22.js";
6
- const y = c(({ data: e, editedValue: o, setEditedValue: i }) => {
7
- var s;
8
- let t;
9
- switch (e.filterType) {
10
- case r.NUMBER:
11
- t = "number";
12
- break;
13
- case r.TEXT:
14
- t = "text";
15
- break;
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { observer as n } from "mobx-react";
3
+ import { ChoiceList as p } from "@veeqo/ui";
4
+ import { FilterChoiceValue as s } from "./index49.js";
5
+ import { ActiveAsyncCheckboxFilter as c } from "./index113.js";
6
+ const F = n(
7
+ ({ data: r, editedValue: e, setEditedValue: o }) => {
8
+ var i;
9
+ switch (r.filterType) {
10
+ case s.CHECKBOX:
11
+ return r.fetchAsyncFilterOptions ? /* @__PURE__ */ t(
12
+ c,
13
+ {
14
+ field: r,
15
+ setEditedValue: o,
16
+ editedValue: e
17
+ }
18
+ ) : /* @__PURE__ */ t(
19
+ p,
20
+ {
21
+ allowMultiple: !0,
22
+ title: r.label,
23
+ options: (i = r.options) != null && i.length ? r.options : [],
24
+ selected: e,
25
+ onChange: (l) => o(l)
26
+ }
27
+ );
28
+ default:
29
+ return null;
30
+ }
16
31
  }
17
- switch (e.filterType) {
18
- case r.TEXT:
19
- case r.NUMBER:
20
- return /* @__PURE__ */ n(
21
- f,
22
- {
23
- label: e.label,
24
- type: t,
25
- value: o,
26
- onChange: (l) => i(l)
27
- }
28
- );
29
- case r.RADIO:
30
- return e.fetchAsyncFilterOptions ? /* @__PURE__ */ n(
31
- m,
32
- {
33
- field: e,
34
- setEditedValue: i,
35
- editedValue: o
36
- }
37
- ) : /* @__PURE__ */ n(
38
- p,
39
- {
40
- title: e.label,
41
- options: (s = e.options) != null && s.length ? e.options : [],
42
- selected: [o],
43
- onChange: (l) => i(`${l[0]}`)
44
- }
45
- );
46
- default:
47
- return null;
48
- }
49
- });
32
+ );
50
33
  export {
51
- y as FilterField
34
+ F as FilterArrayField
52
35
  };
package/dist/index18.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),g=require("mobx-react"),s=require("@veeqo/ui"),v=require("./index60.cjs"),q=require("./index58.cjs"),A=require("./index23.cjs"),x=require("./index17.cjs"),j=require("./index24.cjs"),y=g.observer(({filterData:e})=>{const{Filters:{filters:l,clearFilter:n,setFilter:u}}=v.useStores(),r=l.get(e.id),{filterLabel:d}=q.useFilterLabel({filterData:e}),[i,o]=c.useState(r||"");c.useEffect(()=>{i!==r&&o(r||"")},[e.id,r,l]);const F=()=>{n(e.id)},a=()=>{u(e.id,i)};return t.jsx(s.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx(j.ActiveFilterHeader,{filterLabel:e.label,glyph:e.glyph}),label:e.label,text:d||"Loading...",content:t.jsx(s.BaseContainer,{style:{padding:s.theme.sizes.md},children:t.jsx(x.FilterField,{data:e,editedValue:i,setEditedValue:b=>o(b)})}),footer:t.jsx(A.ActiveFilterFooter,{clearActiveFilter:F,applyActiveFilter:a})})});exports.ActiveFilterTag=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("mobx-react"),s=require("@veeqo/ui"),i=require("./index49.cjs"),F=require("./index23.cjs"),h=u.observer(({data:e,editedValue:r,setEditedValue:t})=>{var n;let l;switch(e.filterType){case i.FilterChoiceValue.NUMBER:l="number";break;case i.FilterChoiceValue.TEXT:l="text";break}switch(e.filterType){case i.FilterChoiceValue.TEXT:case i.FilterChoiceValue.NUMBER:return o.jsx(s.TextField,{label:e.label,type:l,value:r,onChange:c=>t(c)});case i.FilterChoiceValue.RADIO:return e.fetchAsyncFilterOptions?o.jsx(F.ActiveAsyncRadioFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{title:e.label,options:(n=e.options)!=null&&n.length?e.options:[],selected:[r],onChange:c=>t(`${c[0]}`)});default:return null}});exports.FilterField=h;