@redneckz/wildless-cms-uni-blocks 0.14.217 → 0.14.218

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 (61) hide show
  1. package/bundle/bundle.umd.js +58 -9
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -0
  4. package/bundle/components/OfficesAtmsMap/renderFiltrationForm.d.ts +3 -1
  5. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +18 -1
  6. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  7. package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -0
  8. package/dist/components/OfficesAtmsMap/OfficesMap.js +14 -2
  9. package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  10. package/dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts +3 -1
  11. package/dist/components/OfficesAtmsMap/renderFiltrationForm.js +24 -2
  12. package/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  13. package/dist/components/SafeDepositRental/utils.js +3 -1
  14. package/dist/components/SafeDepositRental/utils.js.map +1 -1
  15. package/lib/common.css +1 -1
  16. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +19 -2
  17. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  18. package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -0
  19. package/lib/components/OfficesAtmsMap/OfficesMap.js +14 -2
  20. package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  21. package/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +3 -1
  22. package/lib/components/OfficesAtmsMap/renderFiltrationForm.js +22 -1
  23. package/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  24. package/lib/components/SafeDepositRental/utils.js +3 -1
  25. package/lib/components/SafeDepositRental/utils.js.map +1 -1
  26. package/mobile/bundle/bundle.umd.js +62 -13
  27. package/mobile/bundle/bundle.umd.min.js +1 -1
  28. package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -0
  29. package/mobile/bundle/components/OfficesAtmsMap/renderFiltrationForm.d.ts +3 -1
  30. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +18 -1
  31. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  32. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -0
  33. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +14 -2
  34. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  35. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts +3 -1
  36. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js +24 -2
  37. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  38. package/mobile/dist/components/SafeDepositRental/utils.js +3 -1
  39. package/mobile/dist/components/SafeDepositRental/utils.js.map +1 -1
  40. package/mobile/lib/common.css +1 -1
  41. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +19 -2
  42. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  43. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -0
  44. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +14 -2
  45. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  46. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +3 -1
  47. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js +22 -1
  48. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  49. package/mobile/lib/components/SafeDepositRental/utils.js +3 -1
  50. package/mobile/lib/components/SafeDepositRental/utils.js.map +1 -1
  51. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +56 -2
  52. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +7 -0
  53. package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +15 -2
  54. package/mobile/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +73 -17
  55. package/mobile/src/components/SafeDepositRental/utils.ts +4 -1
  56. package/package.json +1 -1
  57. package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +56 -2
  58. package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +7 -0
  59. package/src/components/OfficesAtmsMap/OfficesMap.tsx +15 -2
  60. package/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +73 -17
  61. package/src/components/SafeDepositRental/utils.ts +4 -1
@@ -3203,9 +3203,9 @@
3203
3203
  const [visibleCells, hiddenCells] = visibleCellsCount > 0
3204
3204
  ? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
3205
3205
  : [cellsNode, []];
3206
- return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$2 : null })) : (jsx("div", { children: visibleCells }))] }));
3206
+ return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$3 : null })) : (jsx("div", { children: visibleCells }))] }));
3207
3207
  });
3208
- const renderFoldButton$2 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: onToggle, type: "button", children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
3208
+ const renderFoldButton$3 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: onToggle, type: "button", children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
3209
3209
 
3210
3210
  const gradientStyle = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
3211
3211
  const borderStyle = 'border-gray border-solid border';
@@ -4772,11 +4772,31 @@
4772
4772
  terminalTypeTerm: 'Терминалы',
4773
4773
  workAllTime: 'Круглосуточно',
4774
4774
  billAcceptorEnable: 'Прием наличных',
4775
+ premiumService: 'Премиальное обслуживание',
4776
+ privateBanking: 'Услуга Private banking',
4777
+ sellingCoins: 'Продажа монет из драгоценных металлов',
4778
+ buyingCoins: 'Покупка монет из драгоценных металлов',
4779
+ bullionOperations: 'Операции со слитками',
4780
+ preciousMetalsOperations: 'Операции с драгоценными металлами',
4781
+ transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
4782
+ };
4783
+ const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
4784
+ const renderFiltrationForm = (filters, { field, reset }, visibleFiltersNum = 3) => {
4785
+ const filtersCheckbox = (filters || []).map((key) => (jsx(Checkbox, { text: FILTRATION_LABELS[key], ...field(key) }, key)));
4786
+ const [visibleFilters, hiddenFilters] = visibleFiltersNum > 0
4787
+ ? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
4788
+ : [filtersCheckbox, []];
4789
+ return (jsx("div", { children: filters?.length ? (jsx("div", { children: hiddenFilters.length > 0 ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }), jsx(FoldableSection, { className: COMMON_FILTERS_STYLES, isUnfolded: isUnfolded, children: hiddenFilters })] })), renderFoldButton: renderFoldButton$2(reset) })) : (jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters })) })) : null }));
4790
+ };
4791
+ const renderFoldButton$2 = (reset) => ({ isUnfolded, onToggle }) => {
4792
+ const labels = ['Больше фильтров', 'Меньше фильтров'];
4793
+ const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
4794
+ return (jsxs("div", { className: "flex", children: [jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0 mr-lg", appendRight: jsx(Icon, { name: icons[Number(isUnfolded)], width: "16", height: "16" }), text: labels[Number(isUnfolded)], onClick: onToggle }), jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, text: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", appendRight: jsx(Icon, { name: "CloseIcon", width: "16", height: "16" }) })] }));
4775
4795
  };
4776
- const renderFiltrationForm = (filters, { field, reset }) => (jsxs("div", { className: "pb-2xl", children: [filters?.length ? (jsx("div", { className: "flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl", children: filters.map((key) => (jsx(Checkbox, { text: FILTRATION_LABELS[key], ...field(key) }, key))) })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, text: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", appendRight: jsx(Icon, { name: "CloseIcon", width: "16", height: "16" }) })] }));
4777
4796
 
4778
4797
  const defaultEmptyFunction = () => void 0;
4779
4798
  const defaultFilterItems = () => [];
4799
+ const filtersVisibleStyles = (activeButton) => activeButton === 'all' ? 'block' : 'hidden';
4780
4800
  const OfficesAtmsMapLayout = JSX(({ className, data = [], renderCard = defaultEmptyFunction, filterItems = defaultFilterItems, getBalloon = defaultEmptyFunction, initFilterState = {}, descriptionData, title, }) => {
4781
4801
  const [filtrationState, { field, reset }] = useForm(initFilterState);
4782
4802
  const [filteredItems, points, lengthItems] = useMemo(() => {
@@ -4789,8 +4809,23 @@
4789
4809
  .filter((_) => _.coords && _.coords.length === 2);
4790
4810
  return [_filteredItems, _points, _filteredItems.length];
4791
4811
  }, [data, filtrationState]);
4792
- return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-6xl pb-0", children: [jsxs("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: [jsx(Heading, { headingType: "h2", children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: `(${lengthItems})` })) : null] }), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, renderFiltrationForm(Object.keys(initFilterState), { field, reset })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, className: "h-full" }) }) })] }), filteredItems.map(renderCard)] }));
4793
- });
4812
+ const [activeButton, setActiveButton] = useState('all');
4813
+ return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-6xl pb-0", children: [jsxs("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: [jsx(Heading, { headingType: "h2", children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: `(${lengthItems})` })) : null] }), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, renderButtonsGroup(data, activeButton, setActiveButton), jsx("div", { className: style('pb-2xl', filtersVisibleStyles(activeButton)), children: renderFiltrationForm(Object.keys(initFilterState), { field, reset }) })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, className: "h-full" }) }) })] }), filteredItems.map(renderCard)] }));
4814
+ });
4815
+ const renderButtonsGroup = (data, activeButton, setActiveButton) => {
4816
+ const allButtonVersion = activeButton === 'all' ? 'primary' : 'secondary';
4817
+ const businessButtonVersion = activeButton === 'business' ? 'primary' : 'secondary';
4818
+ const handleOnClick = (e, key, branches) => {
4819
+ if (e.currentTarget === e.target && key === 'business') {
4820
+ branches.filter((branch) => branch.workSchedule &&
4821
+ branch.workSchedule.businessScheduleVisibleTag &&
4822
+ !branch.workSchedule.businessScheduleDescription);
4823
+ }
4824
+ setActiveButton(key);
4825
+ return branches;
4826
+ };
4827
+ return (jsxs("div", { className: "flex pb-lg", children: [jsx(Button, { className: "mr-m", "data-id": "all", onClick: (e) => handleOnClick(e, 'all', data), version: allButtonVersion, children: "\u0414\u043B\u044F \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" }), jsx(Button, { "data-id": "business", onClick: (e) => handleOnClick(e, 'business', data), version: businessButtonVersion, children: "\u0414\u043B\u044F \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" })] }));
4828
+ };
4794
4829
  const renderDescriptionBlock$1 = ({ __html, list }) => __html || list?.length ? (jsxs("div", { className: "mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [__html ? (jsx("div", { className: "mb-2xl", children: jsx(RichText, { __html: __html }) })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
4795
4830
 
4796
4831
  const colorStyle = {
@@ -5064,12 +5099,24 @@
5064
5099
  };
5065
5100
 
5066
5101
  const INITIAL_FILTRATION_STATE = {
5067
- //safeBoxCaseVolumes: false, //TODO: temp hide
5068
5102
  workingSaturday: false,
5103
+ premiumService: false,
5104
+ privateBanking: false,
5105
+ sellingCoins: false,
5106
+ buyingCoins: false,
5107
+ bullionOperations: false,
5108
+ preciousMetalsOperations: false,
5109
+ transferringDataToBiometricSystem: false,
5069
5110
  };
5070
5111
  const FILTRATION_PREDICATES = {
5071
- //safeBoxCaseVolumes: (item: Branch) => Boolean(item.safeBoxCaseVolumes), //TODO: temp hide
5072
5112
  workingSaturday: (item) => Boolean(item.workSchedule?.workingSaturday),
5113
+ premiumService: (item) => Boolean(item.workSchedule?.premiumService),
5114
+ privateBanking: (item) => Boolean(item.workSchedule?.privateBanking),
5115
+ sellingCoins: (item) => Boolean(item.workSchedule?.sellingCoins),
5116
+ buyingCoins: (item) => Boolean(item.workSchedule?.buyingCoins),
5117
+ bullionOperations: (item) => Boolean(item.workSchedule?.bullionOperations),
5118
+ preciousMetalsOperations: (item) => Boolean(item.workSchedule?.preciousMetalsOperations),
5119
+ transferringDataToBiometricSystem: (item) => Boolean(item.workSchedule?.transferringDataToBiometricSystem),
5073
5120
  };
5074
5121
  const OfficesMap = JSX(({ className }) => {
5075
5122
  const [currentLocation] = useLocation();
@@ -5224,10 +5271,12 @@
5224
5271
  };
5225
5272
 
5226
5273
  const getCoordinates = (data) => {
5274
+ const getBalloon = () => void 0;
5227
5275
  if (Array.isArray(data)) {
5228
5276
  return data
5229
5277
  .map((_) => ({
5230
- coords: [Number(_.gpsLatitude), Number(_.gpsLongitude)]?.filter(Boolean),
5278
+ coords: [Number(_.gpsLatitude), Number(_.gpsLongitude)].filter(Boolean),
5279
+ content: getBalloon(),
5231
5280
  }))
5232
5281
  .filter((_) => _.coords && _.coords.length === 2);
5233
5282
  }
@@ -5961,7 +6010,7 @@
5961
6010
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
5962
6011
  });
5963
6012
 
5964
- const packageVersion = "0.14.216";
6013
+ const packageVersion = "0.14.217";
5965
6014
 
5966
6015
  exports.Blocks = Blocks;
5967
6016
  exports.ContentPage = ContentPage;