@veeqo/transfigure 0.0.1 → 0.0.4

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 (153) hide show
  1. package/README.md +2 -53
  2. package/dist/BusinessLogic/mocks.d.ts +3 -3
  3. package/dist/BusinessLogic/types.d.ts +5 -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.cjs +1 -1
  68. package/dist/index33.js +50 -49
  69. package/dist/index34.js +12 -11
  70. package/dist/index35.js +104 -39
  71. package/dist/index36.cjs +1 -1
  72. package/dist/index36.js +47 -24
  73. package/dist/index37.cjs +1 -1
  74. package/dist/index37.js +43 -22
  75. package/dist/index38.cjs +1 -1
  76. package/dist/index38.js +22 -27
  77. package/dist/index39.cjs +1 -1
  78. package/dist/index39.js +67 -26
  79. package/dist/index4.js +1 -8
  80. package/dist/index40.js +71 -21
  81. package/dist/index41.cjs +1 -1
  82. package/dist/index41.js +31 -18
  83. package/dist/index42.js +2 -8
  84. package/dist/index43.js +13 -1
  85. package/dist/index45.js +14 -12
  86. package/dist/index48.js +1 -3
  87. package/dist/index5.js +2 -9
  88. package/dist/index50.js +3 -12
  89. package/dist/index51.js +8 -42
  90. package/dist/index52.js +20 -35
  91. package/dist/index53.js +16 -25
  92. package/dist/index54.js +18 -27
  93. package/dist/index55.js +31 -36
  94. package/dist/index57.js +22 -32
  95. package/dist/index58.js +14 -15
  96. package/dist/index59.js +2 -10
  97. package/dist/index6.js +8 -40
  98. package/dist/index60.cjs +1 -1
  99. package/dist/index60.js +249 -232
  100. package/dist/index61.js +5 -9
  101. package/dist/index62.js +3 -9
  102. package/dist/index65.js +1 -6
  103. package/dist/index66.js +1 -4
  104. package/dist/index67.js +1 -3
  105. package/dist/index69.js +28 -23
  106. package/dist/index75.cjs +1 -1
  107. package/dist/index75.js +28 -25
  108. package/dist/index76.cjs +19 -1
  109. package/dist/index76.js +24 -19
  110. package/dist/index77.cjs +1 -19
  111. package/dist/index77.js +14 -29
  112. package/dist/index78.cjs +12 -1
  113. package/dist/index78.js +16 -16
  114. package/dist/index79.cjs +80 -1
  115. package/dist/index79.js +95 -9
  116. package/dist/index80.cjs +1 -12
  117. package/dist/index80.js +22 -16
  118. package/dist/index81.cjs +1 -80
  119. package/dist/index81.js +24 -97
  120. package/dist/index83.cjs +10 -77
  121. package/dist/index83.js +13 -93
  122. package/dist/index84.cjs +80 -1
  123. package/dist/index84.js +94 -35
  124. package/dist/index85.cjs +1 -13
  125. package/dist/index85.js +33 -16
  126. package/dist/index86.cjs +1 -7
  127. package/dist/index86.js +63 -12
  128. package/dist/index87.cjs +7 -0
  129. package/dist/index87.js +12 -0
  130. package/dist/index9.cjs +1 -1
  131. package/dist/index9.js +96 -79
  132. package/dist/mobx/Filters/Filters.d.ts +5 -0
  133. package/dist/mocks/internal/mockUseStores/index.d.ts +1 -0
  134. package/dist/mocks/internal/mockUseStores/mockUseStores.d.ts +6 -0
  135. package/dist/types.d.ts +1 -1
  136. package/package.json +4 -5
  137. package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/AsyncInlineCheckboxFilter.d.ts +0 -8
  138. package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/index.d.ts +0 -1
  139. package/dist/components/Filters/Fields/AsyncInlineRadioFilter/AsyncInlineRadioFilter.d.ts +0 -8
  140. package/dist/components/Filters/Fields/AsyncInlineRadioFilter/index.d.ts +0 -1
  141. package/dist/components/Filters/Fields/FilterGroup/index.d.ts +0 -1
  142. package/dist/components/Table/Table.d.ts +0 -1
  143. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterArrayField/FilterArrayField.d.ts +0 -0
  144. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterArrayField/index.d.ts +0 -0
  145. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterField/FilterField.d.ts +0 -0
  146. /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterField/index.d.ts +0 -0
  147. /package/dist/components/Filters/ActiveFilters/{ActiveFilterArrayTag → Variants/ActiveFilterArrayTag}/ActiveFilterArrayTag.d.ts +0 -0
  148. /package/dist/components/Filters/ActiveFilters/{ActiveFilterArrayTag → Variants/ActiveFilterArrayTag}/index.d.ts +0 -0
  149. /package/dist/components/Filters/ActiveFilters/{ActiveFilterDateRangeTag → Variants/ActiveFilterDateRangeTag}/ActiveFilterDateRangeTag.d.ts +0 -0
  150. /package/dist/components/Filters/ActiveFilters/{ActiveFilterDateRangeTag → Variants/ActiveFilterDateRangeTag}/index.d.ts +0 -0
  151. /package/dist/components/Filters/ActiveFilters/{ActiveFilterNumberRangeTag → Variants/ActiveFilterNumberRangeTag}/ActiveFilterNumberRangeTag.d.ts +0 -0
  152. /package/dist/components/Filters/{Fields → ActiveFilters/Variants/ActiveFilterNumberRangeTag}/FilterNumberRangeFilter/index.d.ts +0 -0
  153. /package/dist/components/Filters/ActiveFilters/{ActiveFilterNumberRangeTag → Variants/ActiveFilterNumberRangeTag}/index.d.ts +0 -0
package/dist/index86.cjs CHANGED
@@ -1,7 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("mobx-react"),l=require("@veeqo/ui"),v=require("./index85.cjs"),y=p.observer(({data:m,editedValue:t,setEditedValue:c})=>{var b;if(!((b=m.options)!=null&&b.length))return null;const[u,x]=m.options,i=Number(u.value),a=Number(x.value),h=(s,n)=>{if(!Array.isArray(n)||n.length!==2||!t)return;const[e,j]=n,g=t==null?void 0:t.clone();g.setGte(e),g.setLte(j),c(g)},o={gte:(t==null?void 0:t.gte)||0,lte:(t==null?void 0:t.lte)||100},M=s=>{if(!t)return;const n=t.clone(),e=Number(s);e>n.lteMax||(e>=n.gteMin&&e<=n.lteMax&&n.setGte(e),(!n.lte||e>=n.lte)&&n.setLte(n.lteMax),c(n))},f=s=>{if(!t)return;const n=t.clone(),e=Number(s);e<n.gteMin||(e>=n.gteMin&&e<=n.lteMax&&n.setLte(e),(!n.gte||e<=n.gte)&&n.setGte(n.gteMin),c(n))},S=[o.gte,o.lte];return r.jsxs(l.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsxs(l.Stack,{direction:"horizontal",children:[r.jsx(l.TextField,{label:u.label,type:"number",min:i,max:a,value:o.gte.toString(),onChange:M}),r.jsx(l.TextField,{label:x.label,type:"number",min:i,max:a,value:o.lte.toString(),onChange:f})]}),r.jsx(v.MUISlider,{value:S,onChange:h,min:i,max:a,valueLabelDisplay:"auto"})]})});exports.FilterNumberRangeFilter=y;
package/dist/index86.js CHANGED
@@ -1,14 +1,65 @@
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 ${({
8
- offset: t
9
- }) => t && `- ${t}px`} - ${e.sizes.base});
10
- overflow-y: auto;
11
- `;
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 "./index85.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
+ );
12
63
  export {
13
- h as AdaptiveStyledContainer
64
+ j as FilterNumberRangeFilter
14
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/index9.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@veeqo/ui"),u=require("./index8.cjs"),a=["due_date"],o=["product_count"],i="filter[search]",s=l.DateRanges.TODAY,d=l.getDateRange(s),c=l.DATE_RANGE_OPTIONS.find(({value:e})=>e===s),_="25",T="1",E="order",A=200,n={DATE_RANGE_FILTERS:a,SEARCH_FILTER_ID:i,NUMBER_RANGE_FILTERS:o,DEFAULT_DATE_SELECTION:s,DEFAULT_DATE_RANGE:d,DEFAULT_DATE_PRESET:c,DEFAULT_PAGE_SIZE:_,DEFAULT_PAGE_NUMBER:T,VIEW_TYPE:E,FILTERS_DEBOUCE_INTERVAL_MS:A},r=()=>{const e=new Map,t=new Map;return e.set("order_number",{id:"order_number",label:"Order number",filterType:"text",isFilterAllowed:!0}),t.set("order",{id:"order",label:"Order",fields:[e.get("order_number")]}),e.set("shoe_size",{id:"shoe_size",label:"Shoe size",filterType:"radio",isFilterAllowed:!0,options:[{label:"One",value:"1"},{label:"Two",value:"2"},{label:"Three",value:"3"},{label:"Four",value:"4"},{label:"Five",value:"5"}]}),t.set("shoe",{id:"shoe",label:"Shoe",fields:[e.get("shoe_size")]}),e.set("channel_id",{id:"channel_id",label:"Channel",filterType:"checkbox",isFilterAllowed:!0,fetchAsyncFilterOptions:{URL:"/channels",labelProperty:"name",valueProperty:"id",fetcher:"fetcherV1"}}),t.set("channel",{id:"channel",label:"Channel",fields:[e.get("channel_id")]}),e.set("product_count",{id:"product_count",label:"Product count",filterType:"number_range",isFilterAllowed:!0,options:[{label:"Min",value:"0"},{label:"Max",value:"100"}]}),t.set("product_count",{id:"product_count",label:"Product count",fields:[e.get("product_count")]}),e.set("due_date",{id:"due_date",label:"Due date",filterType:"date_range",isFilterAllowed:!0,options:[{label:"Today",value:"TODAY"},{label:"Yesterday",value:"YESTERDAY"},{label:"Last 7 days",value:"LAST_7_DAYS"},{label:"Last 30 days",value:"LAST_30_DAYS"},{label:"Last 90 days",value:"LAST_90_DAYS"},{label:"Last month",value:"LAST_MONTH"},{label:"Last 12 months",value:"LAST_12_MONTHS"},{label:"Week to date",value:"WEEK_TO_DATE"},{label:"Month to date",value:"MONTH_TO_DATE"},{label:"Year to date",value:"YEAR_TO_DATE"}]}),t.set("due",{id:"due",label:"Due",fields:[e.get("due_date")]}),e.set("max_products",{id:"max_products",label:"Max products",filterType:"number",isFilterAllowed:!0}),t.set("max_count",{id:"max_count",label:"Max count",fields:[e.get("max_products")]}),{FIELDS_MAP:e,GROUP_MAP:t}},b=()=>{const e=r(),t={...n,...e};u.BusinessLogicManager.setBusinessLogic(t)};exports.DATE_RANGE_FILTERS=a;exports.NUMBER_RANGE_FILTERS=o;exports.customAppBusinessLogic=n;exports.generateMockedFilterMaps=r;exports.setMockedBusinessLogic=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@veeqo/ui"),i=require("./index8.cjs"),a=["due_date"],o=["product_count"],d="filter[search]",s=l.DateRanges.TODAY,_=l.getDateRange(s),c=l.DATE_RANGE_OPTIONS.find(({value:e})=>e===s),E="25",T="1",A="order",b=200,p=[10,25,50,100],L="page[number]",D="page[size]",n={DATE_RANGE_FILTERS:a,SEARCH_FILTER_ID:d,NUMBER_RANGE_FILTERS:o,DEFAULT_DATE_SELECTION:s,DEFAULT_DATE_RANGE:_,DEFAULT_DATE_PRESET:c,DEFAULT_PAGE_SIZE:E,DEFAULT_PAGE_NUMBER:T,VIEW_TYPE:A,FILTERS_DEBOUCE_INTERVAL_MS:b,PAGE_SIZE_OPTIONS:p,PAGE_NUMBER_FILTER_ID:L,PAGE_SIZE_FILTER_ID:D},r=()=>{const e=new Map,t=new Map;return e.set("order_number",{id:"order_number",label:"Order number",filterType:"text",isFilterAllowed:!0}),t.set("order",{id:"order",label:"Order",fields:[e.get("order_number")]}),e.set("shoe_size",{id:"shoe_size",label:"Shoe size",filterType:"radio",isFilterAllowed:!0,options:[{label:"One",value:"1"},{label:"Two",value:"2"},{label:"Three",value:"3"},{label:"Four",value:"4"},{label:"Five",value:"5"}]}),t.set("shoe",{id:"shoe",label:"Shoe",fields:[e.get("shoe_size")]}),e.set("channel_id",{id:"channel_id",label:"Channel",filterType:"checkbox",isFilterAllowed:!0,fetchAsyncFilterOptions:{URL:"/channels",labelProperty:"name",valueProperty:"id",fetcher:"fetcherV1"}}),t.set("channel",{id:"channel",label:"Channel",fields:[e.get("channel_id")]}),e.set("product_count",{id:"product_count",label:"Product count",filterType:"number_range",isFilterAllowed:!0,options:[{label:"Min",value:"0"},{label:"Max",value:"100"}]}),t.set("product_count",{id:"product_count",label:"Product count",fields:[e.get("product_count")]}),e.set("due_date",{id:"due_date",label:"Due date",filterType:"date_range",isFilterAllowed:!0,options:[{label:"Today",value:"TODAY"},{label:"Yesterday",value:"YESTERDAY"},{label:"Last 7 days",value:"LAST_7_DAYS"},{label:"Last 30 days",value:"LAST_30_DAYS"},{label:"Last 90 days",value:"LAST_90_DAYS"},{label:"Last month",value:"LAST_MONTH"},{label:"Last 12 months",value:"LAST_12_MONTHS"},{label:"Week to date",value:"WEEK_TO_DATE"},{label:"Month to date",value:"MONTH_TO_DATE"},{label:"Year to date",value:"YEAR_TO_DATE"}]}),t.set("due",{id:"due",label:"Due",fields:[e.get("due_date")]}),e.set("max_products",{id:"max_products",label:"Max products",filterType:"number",isFilterAllowed:!0}),t.set("max_count",{id:"max_count",label:"Max count",fields:[e.get("max_products")]}),{FIELDS_MAP:e,GROUP_MAP:t}},S=e=>{const t=r(),u={...n,...t,...e};i.BusinessLogicManager.setBusinessLogic(u)};exports.DATE_RANGE_FILTERS=a;exports.NUMBER_RANGE_FILTERS=o;exports.customAppBusinessLogic=n;exports.generateMockedFilterMaps=r;exports.setMockedBusinessLogic=S;
package/dist/index9.js CHANGED
@@ -1,19 +1,22 @@
1
- import { DATE_RANGE_OPTIONS as a, getDateRange as o, DateRanges as s } from "@veeqo/ui";
1
+ import { DATE_RANGE_OPTIONS as s, getDateRange as o, DateRanges as n } from "@veeqo/ui";
2
2
  import { BusinessLogicManager as r } from "./index8.js";
3
- const n = ["due_date"], d = ["product_count"], u = "filter[search]", l = s.TODAY, i = o(l), _ = a.find(({
4
- value: e
5
- }) => e === l), c = "25", T = "1", A = "order", E = 200, b = {
6
- DATE_RANGE_FILTERS: n,
3
+ const d = ["due_date"], _ = ["product_count"], u = "filter[search]", l = n.TODAY, i = o(l), c = s.find(
4
+ ({ value: e }) => e === l
5
+ ), E = "25", T = "1", A = "order", b = 200, p = [10, 25, 50, 100], L = "page[number]", D = "page[size]", S = {
6
+ DATE_RANGE_FILTERS: d,
7
7
  SEARCH_FILTER_ID: u,
8
- NUMBER_RANGE_FILTERS: d,
8
+ NUMBER_RANGE_FILTERS: _,
9
9
  DEFAULT_DATE_SELECTION: l,
10
10
  DEFAULT_DATE_RANGE: i,
11
- DEFAULT_DATE_PRESET: _,
12
- DEFAULT_PAGE_SIZE: c,
11
+ DEFAULT_DATE_PRESET: c,
12
+ DEFAULT_PAGE_SIZE: E,
13
13
  DEFAULT_PAGE_NUMBER: T,
14
14
  VIEW_TYPE: A,
15
- FILTERS_DEBOUCE_INTERVAL_MS: E
16
- }, p = () => {
15
+ FILTERS_DEBOUCE_INTERVAL_MS: b,
16
+ PAGE_SIZE_OPTIONS: p,
17
+ PAGE_NUMBER_FILTER_ID: L,
18
+ PAGE_SIZE_FILTER_ID: D
19
+ }, h = () => {
17
20
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
18
21
  return e.set("order_number", {
19
22
  id: "order_number",
@@ -29,22 +32,28 @@ const n = ["due_date"], d = ["product_count"], u = "filter[search]", l = s.TODAY
29
32
  label: "Shoe size",
30
33
  filterType: "radio",
31
34
  isFilterAllowed: !0,
32
- options: [{
33
- label: "One",
34
- value: "1"
35
- }, {
36
- label: "Two",
37
- value: "2"
38
- }, {
39
- label: "Three",
40
- value: "3"
41
- }, {
42
- label: "Four",
43
- value: "4"
44
- }, {
45
- label: "Five",
46
- value: "5"
47
- }]
35
+ options: [
36
+ {
37
+ label: "One",
38
+ value: "1"
39
+ },
40
+ {
41
+ label: "Two",
42
+ value: "2"
43
+ },
44
+ {
45
+ label: "Three",
46
+ value: "3"
47
+ },
48
+ {
49
+ label: "Four",
50
+ value: "4"
51
+ },
52
+ {
53
+ label: "Five",
54
+ value: "5"
55
+ }
56
+ ]
48
57
  }), t.set("shoe", {
49
58
  id: "shoe",
50
59
  label: "Shoe",
@@ -69,13 +78,16 @@ const n = ["due_date"], d = ["product_count"], u = "filter[search]", l = s.TODAY
69
78
  label: "Product count",
70
79
  filterType: "number_range",
71
80
  isFilterAllowed: !0,
72
- options: [{
73
- label: "Min",
74
- value: "0"
75
- }, {
76
- label: "Max",
77
- value: "100"
78
- }]
81
+ options: [
82
+ {
83
+ label: "Min",
84
+ value: "0"
85
+ },
86
+ {
87
+ label: "Max",
88
+ value: "100"
89
+ }
90
+ ]
79
91
  }), t.set("product_count", {
80
92
  id: "product_count",
81
93
  label: "Product count",
@@ -85,37 +97,48 @@ const n = ["due_date"], d = ["product_count"], u = "filter[search]", l = s.TODAY
85
97
  label: "Due date",
86
98
  filterType: "date_range",
87
99
  isFilterAllowed: !0,
88
- options: [{
89
- label: "Today",
90
- value: "TODAY"
91
- }, {
92
- label: "Yesterday",
93
- value: "YESTERDAY"
94
- }, {
95
- label: "Last 7 days",
96
- value: "LAST_7_DAYS"
97
- }, {
98
- label: "Last 30 days",
99
- value: "LAST_30_DAYS"
100
- }, {
101
- label: "Last 90 days",
102
- value: "LAST_90_DAYS"
103
- }, {
104
- label: "Last month",
105
- value: "LAST_MONTH"
106
- }, {
107
- label: "Last 12 months",
108
- value: "LAST_12_MONTHS"
109
- }, {
110
- label: "Week to date",
111
- value: "WEEK_TO_DATE"
112
- }, {
113
- label: "Month to date",
114
- value: "MONTH_TO_DATE"
115
- }, {
116
- label: "Year to date",
117
- value: "YEAR_TO_DATE"
118
- }]
100
+ options: [
101
+ {
102
+ label: "Today",
103
+ value: "TODAY"
104
+ },
105
+ {
106
+ label: "Yesterday",
107
+ value: "YESTERDAY"
108
+ },
109
+ {
110
+ label: "Last 7 days",
111
+ value: "LAST_7_DAYS"
112
+ },
113
+ {
114
+ label: "Last 30 days",
115
+ value: "LAST_30_DAYS"
116
+ },
117
+ {
118
+ label: "Last 90 days",
119
+ value: "LAST_90_DAYS"
120
+ },
121
+ {
122
+ label: "Last month",
123
+ value: "LAST_MONTH"
124
+ },
125
+ {
126
+ label: "Last 12 months",
127
+ value: "LAST_12_MONTHS"
128
+ },
129
+ {
130
+ label: "Week to date",
131
+ value: "WEEK_TO_DATE"
132
+ },
133
+ {
134
+ label: "Month to date",
135
+ value: "MONTH_TO_DATE"
136
+ },
137
+ {
138
+ label: "Year to date",
139
+ value: "YEAR_TO_DATE"
140
+ }
141
+ ]
119
142
  }), t.set("due", {
120
143
  id: "due",
121
144
  label: "Due",
@@ -129,21 +152,15 @@ const n = ["due_date"], d = ["product_count"], u = "filter[search]", l = s.TODAY
129
152
  id: "max_count",
130
153
  label: "Max count",
131
154
  fields: [e.get("max_products")]
132
- }), {
133
- FIELDS_MAP: e,
134
- GROUP_MAP: t
135
- };
136
- }, h = () => {
137
- const e = p(), t = {
138
- ...b,
139
- ...e
140
- };
141
- r.setBusinessLogic(t);
155
+ }), { FIELDS_MAP: e, GROUP_MAP: t };
156
+ }, M = (e) => {
157
+ const t = h(), a = { ...S, ...t, ...e };
158
+ r.setBusinessLogic(a);
142
159
  };
143
160
  export {
144
- n as DATE_RANGE_FILTERS,
145
- d as NUMBER_RANGE_FILTERS,
146
- b as customAppBusinessLogic,
147
- p as generateMockedFilterMaps,
148
- h as setMockedBusinessLogic
161
+ d as DATE_RANGE_FILTERS,
162
+ _ as NUMBER_RANGE_FILTERS,
163
+ S as customAppBusinessLogic,
164
+ h as generateMockedFilterMaps,
165
+ M as setMockedBusinessLogic
149
166
  };
@@ -4,6 +4,9 @@ import { RangeFilter } from '../RangeFilter/RangeFilter';
4
4
  import { NumberRangeFilter } from '../NumberRangeFilter/NumberRangeFilter';
5
5
  import { FilterType } from '../../constants/dateConstants';
6
6
  export declare class Filters {
7
+ defaultPageSize: number;
8
+ pageSize: number;
9
+ currentPage: number;
7
10
  defaultFilters: Map<string, string>;
8
11
  defaultArrayFilters: Map<string, string[]>;
9
12
  defaultDateRangeFilters: Map<string, RangeFilter>;
@@ -17,6 +20,8 @@ export declare class Filters {
17
20
  constructor();
18
21
  initDefaultFilterMaps: () => void;
19
22
  updateUrl: (pushToHistory?: boolean) => void;
23
+ setCurrentPage: (count: number) => void;
24
+ setPageSize: (size: number) => void;
20
25
  setFilter: (key: string, value: string) => void;
21
26
  clearFilter: (key: string) => void;
22
27
  setArrayFilter: (key: string, values: string[]) => void;
@@ -0,0 +1 @@
1
+ export { mockUseStores } from './mockUseStores';
@@ -0,0 +1,6 @@
1
+ import { ComponentStores } from '../../../hooks/useStores/types';
2
+ type PartialStoresWithProperties<T> = {
3
+ [P in keyof T]?: T[P] extends (infer U)[] ? PartialStoresWithProperties<U>[] : T[P] extends object ? PartialStoresWithProperties<T[P]> : T[P];
4
+ };
5
+ export declare const mockUseStores: (props: PartialStoresWithProperties<ComponentStores>) => void;
6
+ export {};
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FilterChoiceValue } from './constants/constants';
2
2
  import { NumberRangeFilterClass } from './mobx/NumberRangeFilter';
3
3
  import { RangeFilter } from './mobx/RangeFilter';
4
- export type FilterGroup = {
4
+ export type FilterGroupType = {
5
5
  id: string;
6
6
  label: string;
7
7
  fields: Array<Filter>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",
@@ -35,7 +35,7 @@
35
35
  "@material-ui/core": "^4.11.0",
36
36
  "@tanstack/react-table": "^8.21.2",
37
37
  "@veeqo/components": "6.1.1",
38
- "@veeqo/ui": "9.9.5",
38
+ "@veeqo/ui": ">=9.9.5",
39
39
  "ajv-keywords": "^5.1.0",
40
40
  "axios": "^1.6.2",
41
41
  "framer-motion": "^6.5.1",
@@ -80,7 +80,7 @@
80
80
  "@types/styled-components": "^5.1.27",
81
81
  "@types/testing-library__jest-dom": "^6.0.0",
82
82
  "@veeqo/components": "6.1.1",
83
- "@veeqo/ui": "^9.9.5",
83
+ "@veeqo/ui": ">=9.9.5",
84
84
  "@vitejs/plugin-react": "^4.3.4",
85
85
  "@vitest/browser": "^3.1.2",
86
86
  "@vitest/coverage-v8": "^3.1.2",
@@ -113,7 +113,6 @@
113
113
  "uid": "^2.0.2",
114
114
  "vite": "^6.2.0",
115
115
  "vite-css-modules": "^1.8.6",
116
- "vite-plugin-babel-macros": "^1.0.6",
117
116
  "vite-plugin-dts": "^4.5.3",
118
117
  "vite-plugin-externalize-deps": "^0.9.0",
119
118
  "vitest": "^3.1.2"
@@ -123,4 +122,4 @@
123
122
  "plugin:storybook/recommended"
124
123
  ]
125
124
  }
126
- }
125
+ }
@@ -1,8 +0,0 @@
1
- import { Filter } from 'src/types';
2
- type AsyncInlineCheckboxFilterProps = {
3
- field: Filter;
4
- editedValue: string[];
5
- setEditedValue: (value: string[]) => void;
6
- };
7
- export declare const AsyncInlineCheckboxFilter: ({ field, editedValue, setEditedValue }: AsyncInlineCheckboxFilterProps) => JSX.Element;
8
- export {};
@@ -1 +0,0 @@
1
- export { AsyncInlineCheckboxFilter } from './AsyncInlineCheckboxFilter';
@@ -1,8 +0,0 @@
1
- import { Filter } from 'src/types';
2
- type AsyncInlineRadioFilterProps = {
3
- field: Filter;
4
- editedValue: string;
5
- setEditedValue: (value: string) => void;
6
- };
7
- export declare const AsyncInlineRadioFilter: ({ field, editedValue, setEditedValue }: AsyncInlineRadioFilterProps) => JSX.Element;
8
- export {};
@@ -1 +0,0 @@
1
- export { AsyncInlineRadioFilter } from './AsyncInlineRadioFilter';
@@ -1 +0,0 @@
1
- export { FilterGroup as FilterGroupComponent } from './FilterGroup';
@@ -1 +0,0 @@
1
- export declare const Table: () => JSX.Element;