@redneckz/wildless-cms-uni-blocks 0.13.8 → 0.13.9

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 (27) hide show
  1. package/bin/migration-scripts/0.13.9.js +59 -0
  2. package/bundle/bundle.umd.js +15 -9
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  5. package/dist/components/DepositFiltration/DepositFiltration.js +14 -8
  6. package/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
  7. package/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  8. package/lib/components/DepositFiltration/DepositFiltration.js +14 -8
  9. package/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
  10. package/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  11. package/mobile/bundle/bundle.umd.js +1 -1
  12. package/mobile/bundle/bundle.umd.min.js +1 -1
  13. package/mobile/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  14. package/mobile/dist/components/DepositFiltration/DepositFiltration.js +14 -8
  15. package/mobile/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
  16. package/mobile/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  17. package/mobile/lib/components/DepositFiltration/DepositFiltration.js +14 -8
  18. package/mobile/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
  19. package/mobile/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  20. package/mobile/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
  21. package/mobile/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
  22. package/mobile/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
  23. package/package.json +1 -1
  24. package/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
  25. package/src/components/DepositFiltration/DepositFiltration.fixture.tsx +21 -8
  26. package/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
  27. package/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
@@ -0,0 +1,59 @@
1
+ export const description = 'v0.13.9';
2
+
3
+ export default (uniPath, content) => {
4
+ if (!content?.blocks) {
5
+ return content;
6
+ }
7
+
8
+ for (const block of content.blocks) {
9
+ adjustDepositFiltration(block);
10
+ }
11
+
12
+ return { ...content };
13
+ };
14
+
15
+ const newSumParams = {
16
+ type: 'object',
17
+ properties: {
18
+ min: {
19
+ title: 'Минимум',
20
+ type: 'number',
21
+ },
22
+ max: {
23
+ title: 'Максимум',
24
+ type: 'number',
25
+ },
26
+ },
27
+ };
28
+
29
+ function adjustDepositFiltration(block) {
30
+ if (block.blocks) {
31
+ for (const childBlock of block.blocks) {
32
+ adjustDepositFiltration(childBlock);
33
+ }
34
+ }
35
+
36
+ if (block.type !== 'DepositFiltration') {
37
+ return;
38
+ }
39
+
40
+ if (block.content) {
41
+ const { sum, ...rest } = block.content;
42
+
43
+ block.content = {
44
+ ...rest,
45
+ sum: {
46
+ ...sum,
47
+ ...newSumParams,
48
+ },
49
+ };
50
+ }
51
+
52
+ if (block.blocks) {
53
+ block.blocks = block.blocks.map((_) =>
54
+ _.content?.sum
55
+ ? { ..._, content: { ..._.content, sum: { min: 500, max: _.content.sum } } }
56
+ : _,
57
+ );
58
+ }
59
+ }
@@ -2981,22 +2981,28 @@
2981
2981
  return (jsxs("div", { children: [item?.title ? (jsx("div", { className: "mb-m", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: item.title }) })) : null, jsx(SlideCheckboxGroup, { items: options, multiple: true, ...field(key) })] }, key));
2982
2982
  };
2983
2983
 
2984
+ const DEFAULT_MIN_MONTHS = 3;
2985
+ const DEFAULT_MAX_MONTHS = 60;
2986
+ const DEFAULT_MIN_SUM = 500;
2987
+ const DEFAULT_MAX_SUM = 1000000000;
2984
2988
  const initialFiltrationState$1 = {
2985
- sum: 500,
2989
+ sum: {
2990
+ min: 10000,
2991
+ max: DEFAULT_MAX_SUM,
2992
+ },
2986
2993
  period: {
2987
2994
  min: 3,
2988
2995
  max: 36,
2989
2996
  },
2990
2997
  };
2991
- const DEFAULT_MIN_MONTHS = 3;
2992
- const DEFAULT_MAX_MONTHS = 36;
2993
- const DEFAULT_MIN_SUM = 500;
2994
- const DEFAULT_MAX_SUM = 1000000000;
2995
2998
  const DepositFiltration = JSX(({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
2996
2999
  const [filtrationState, { field, reset }] = useForm(initialFiltrationState$1);
2997
- const maxValue = periodInput?.max || DEFAULT_MAX_MONTHS;
2998
- const Inputs = (jsxs("div", { children: [jsx(CurrencyInput, { label: sumInput?.title, min: DEFAULT_MIN_SUM, max: DEFAULT_MAX_SUM, ...field('sum', { parse: Number, format: String }) }), jsx(InputRange, { title: periodInput?.title, items: ['От 3 мес', 'До 3 лет'], min: periodInput?.min || DEFAULT_MIN_MONTHS, max: maxValue, ...field('period', {
2999
- parse: (min) => ({ min, max: maxValue }),
3000
+ const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
3001
+ const Inputs = (jsxs("div", { children: [jsx(CurrencyInput, { label: sumInput?.title, min: DEFAULT_MIN_SUM, max: DEFAULT_MAX_SUM, ...field('sum', {
3002
+ parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
3003
+ format: ({ min }) => String(min),
3004
+ }) }), jsx(InputRange, { title: periodInput?.title, items: ['От 3 мес', 'До 5 лет'], min: periodInput?.min || DEFAULT_MIN_MONTHS, max: maxPeriodValue, ...field('period', {
3005
+ parse: (min) => ({ min, max: maxPeriodValue }),
3000
3006
  format: ({ min }) => min,
3001
3007
  }) })] }));
3002
3008
  return (jsxs(BlockWrapper, { className: style('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [renderFiltrationForm({ field, reset, filtrationSchema, resetButton, children: Inputs }), jsx(BaseFiltrationInner, { filtrationState: filtrationState, ...rest })] }));
@@ -5261,7 +5267,7 @@
5261
5267
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
5262
5268
  }
5263
5269
 
5264
- const packageVersion = "0.13.8";
5270
+ const packageVersion = "0.13.9";
5265
5271
 
5266
5272
  exports.Blocks = Blocks;
5267
5273
  exports.ContentPage = ContentPage;