@redneckz/wildless-cms-uni-blocks 0.14.898 → 0.14.899

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 (39) hide show
  1. package/bundle/bundle.umd.js +76 -8
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  4. package/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
  5. package/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  6. package/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  7. package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  8. package/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
  9. package/dist/components/OfficesAtmsMap/filters.js +18 -0
  10. package/dist/components/OfficesAtmsMap/filters.js.map +1 -1
  11. package/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  12. package/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  13. package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  14. package/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
  15. package/lib/components/OfficesAtmsMap/filters.js +18 -0
  16. package/lib/components/OfficesAtmsMap/filters.js.map +1 -1
  17. package/mobile/bundle/bundle.umd.js +76 -8
  18. package/mobile/bundle/bundle.umd.min.js +1 -1
  19. package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  20. package/mobile/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
  21. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  22. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  23. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  24. package/mobile/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
  25. package/mobile/dist/components/OfficesAtmsMap/filters.js +18 -0
  26. package/mobile/dist/components/OfficesAtmsMap/filters.js.map +1 -1
  27. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  28. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  29. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  30. package/mobile/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
  31. package/mobile/lib/components/OfficesAtmsMap/filters.js +18 -0
  32. package/mobile/lib/components/OfficesAtmsMap/filters.js.map +1 -1
  33. package/mobile/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
  34. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
  35. package/mobile/src/components/OfficesAtmsMap/filters.ts +24 -0
  36. package/package.json +1 -1
  37. package/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
  38. package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
  39. package/src/components/OfficesAtmsMap/filters.ts +24 -0
@@ -4038,6 +4038,12 @@
4038
4038
  bullionOperations: false,
4039
4039
  preciousMetalsOperations: false,
4040
4040
  transferringDataToBiometricSystem: false,
4041
+ hasAccessibilitySign: false,
4042
+ equippedWithRamp: false,
4043
+ equippedWithLift: false,
4044
+ equippedWithElevator: false,
4045
+ equippedWithStairclimber: false,
4046
+ hasHelpMeButton: false,
4041
4047
  ...ATMS_INITIAL_FILTRATION_STATE,
4042
4048
  };
4043
4049
  const FILTRATION_LABELS = {
@@ -4058,6 +4064,12 @@
4058
4064
  serviceDisabledPeople: 'Для маломобильных граждан',
4059
4065
  workAllTime: 'Круглосуточно',
4060
4066
  workingSaturday: 'Открыты по субботам',
4067
+ hasAccessibilitySign: 'Без барьеров',
4068
+ equippedWithRamp: 'Есть пандус',
4069
+ equippedWithLift: 'Есть подъёмник',
4070
+ equippedWithElevator: 'Есть лифт',
4071
+ equippedWithStairclimber: 'Есть лестницеход',
4072
+ hasHelpMeButton: 'Есть кнопка «HELP ME»',
4061
4073
  };
4062
4074
  const FILTRATION_PREDICATES_ATMS = {
4063
4075
  terminalTypeTerm: (item) => item.terminalType?.toLowerCase() === 'терминал',
@@ -4079,6 +4091,12 @@
4079
4091
  bullionOperations: (item) => Boolean('bullionOperations' in item && item.bullionOperations),
4080
4092
  preciousMetalsOperations: (item) => Boolean('preciousMetalsOperations' in item && item.preciousMetalsOperations),
4081
4093
  transferringDataToBiometricSystem: (item) => Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
4094
+ hasAccessibilitySign: (item) => Boolean('hasAccessibilitySign' in item && item.hasAccessibilitySign),
4095
+ equippedWithRamp: (item) => Boolean('equippedWithRamp' in item && item.equippedWithRamp),
4096
+ equippedWithLift: (item) => Boolean('equippedWithLift' in item && item.equippedWithLift),
4097
+ equippedWithElevator: (item) => Boolean('equippedWithElevator' in item && item.equippedWithElevator),
4098
+ equippedWithStairclimber: (item) => Boolean('equippedWithStairclimber' in item && item.equippedWithStairclimber),
4099
+ hasHelpMeButton: (item) => Boolean('hasHelpMeButton' in item && item.hasHelpMeButton),
4082
4100
  };
4083
4101
 
4084
4102
  const filterItems = (data, filtrationState) => {
@@ -10944,15 +10962,65 @@
10944
10962
  });
10945
10963
 
10946
10964
  const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
10947
- const FiltrationForm = JSX(({ filters, field: { field, reset }, onlyOffice, labels }) => {
10948
- const visibleFiltersNum = onlyOffice ? 5 : 6;
10949
- const filtersCheckbox = (filters || []).map((key) => (jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
10950
- const [visibleFilters, hiddenFilters] = visibleFiltersNum > 0
10951
- ? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
10952
- : [filtersCheckbox, []];
10965
+ const VISIBLE_FILTERS = [
10966
+ 'workingSaturday',
10967
+ 'premiumService',
10968
+ 'privateBanking',
10969
+ 'remoteWorkplace',
10970
+ 'serviceDisabledPeople',
10971
+ 'transferringDataToBiometricSystem',
10972
+ ];
10973
+ const PRECIOUS_METALS_FILTERS = [
10974
+ 'sellingCoins',
10975
+ 'buyingCoins',
10976
+ 'bullionOperations',
10977
+ 'preciousMetalsOperations',
10978
+ ];
10979
+ const DISABLED_SERVICE_FILTERS = [
10980
+ 'hasAccessibilitySign',
10981
+ 'equippedWithRamp',
10982
+ 'equippedWithLift',
10983
+ 'equippedWithElevator',
10984
+ 'equippedWithStairclimber',
10985
+ 'hasHelpMeButton',
10986
+ ];
10987
+ const VISIBLE_ATMS_FILTERS_NUM = 6;
10988
+ const FiltrationForm = JSX(({ filters = [], field: { field, reset }, onlyOffice, labels }) => {
10989
+ const filtersCheckbox = filters.map((key) => (jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
10990
+ const [visibleFilters, hiddenPreciousMetalsFilters, hiddenDisabledServiceFilters] = getFilters({
10991
+ onlyOffice,
10992
+ filtersCheckbox,
10993
+ });
10953
10994
  const [isUnfolded, { toggle }] = useBool(false);
10954
- return (jsx("div", { children: filters?.length ? (jsx("div", { children: jsxs(Foldable, { children: [jsxs("div", { children: [jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }), jsx(FoldableSection, { className: COMMON_FILTERS_STYLES, isUnfolded: isUnfolded, children: hiddenFilters })] }), jsxs("div", { className: "flex space-x-lg", children: [onlyOffice ? (jsx(DefaultFoldButton, { label: isUnfolded ? 'Меньше фильтров' : 'Больше фильтров', isUnfolded: isUnfolded, embedded: true, short: true, onClick: toggle })) : null, jsxs(Button, { embedded: true, onClick: reset, children: [jsx(ButtonTitle, { children: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440" }), jsx(Icon, { name: "CloseIcon", size: "small" })] })] })] }) })) : null }));
10995
+ return (jsx("div", { children: filters?.length ? (jsx("div", { children: jsxs(Foldable, { children: [jsx("div", { children: jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }) }), jsxs("div", { className: "flex space-x-lg pb-2xl", children: [onlyOffice ? (jsx(DefaultFoldButton, { label: isUnfolded ? 'Меньше фильтров' : 'Больше фильтров', isUnfolded: isUnfolded, embedded: true, short: true, onClick: toggle })) : null, jsxs(Button, { embedded: true, onClick: reset, children: [jsx(ButtonTitle, { children: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440" }), jsx(Icon, { name: "CloseIcon", size: "small" })] })] }), jsx("div", { children: jsxs(FoldableSection, { isUnfolded: isUnfolded, children: [renderFoldableSubsection('Драгоценные металлы', hiddenPreciousMetalsFilters), renderFoldableSubsection('Специальные возможности', hiddenDisabledServiceFilters)] }) })] }) })) : null }));
10955
10996
  });
10997
+ const getFilters = ({ onlyOffice = false, filtersCheckbox = [] }) => {
10998
+ return onlyOffice ? getOfficeFilters(filtersCheckbox) : getAtmsFilters(filtersCheckbox);
10999
+ };
11000
+ const getOfficeFilters = (filtersCheckbox) => {
11001
+ const visibleFilters = [];
11002
+ const preciousMetalsFilters = [];
11003
+ const disabledServiceFilters = [];
11004
+ for (const item of filtersCheckbox) {
11005
+ if (VISIBLE_FILTERS.includes(item.key)) {
11006
+ visibleFilters.push(item);
11007
+ }
11008
+ if (PRECIOUS_METALS_FILTERS.includes(item.key)) {
11009
+ preciousMetalsFilters.push(item);
11010
+ }
11011
+ if (DISABLED_SERVICE_FILTERS.includes(item.key)) {
11012
+ disabledServiceFilters.push(item);
11013
+ }
11014
+ }
11015
+ return [visibleFilters, preciousMetalsFilters, disabledServiceFilters];
11016
+ };
11017
+ const getAtmsFilters = (filtersCheckbox) => [
11018
+ filtersCheckbox.slice(0, VISIBLE_ATMS_FILTERS_NUM),
11019
+ filtersCheckbox.slice(VISIBLE_ATMS_FILTERS_NUM),
11020
+ ];
11021
+ const renderFoldableSubsection = (text, filters = []) => {
11022
+ return (jsx("div", { children: filters.length > 0 ? (jsxs("div", { className: "space-y-s", children: [jsx(Text, { children: text }), jsx("div", { className: COMMON_FILTERS_STYLES, children: filters })] })) : null }));
11023
+ };
10956
11024
 
10957
11025
  const getVersion = (isPrimary, type) => isPrimary && type !== 'underlined' ? 'primary' : 'secondary';
10958
11026
 
@@ -11693,7 +11761,7 @@
11693
11761
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11694
11762
  });
11695
11763
 
11696
- const packageVersion = "0.14.897";
11764
+ const packageVersion = "0.14.898";
11697
11765
 
11698
11766
  exports.Blocks = Blocks;
11699
11767
  exports.ContentPage = ContentPage;