@scbt-ecom/ui 0.156.0 → 0.156.2
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.
- package/dist/lib/exports/widget.js +1 -1
- package/dist/lib/next/utils/hasWidget.js.map +1 -1
- package/dist/lib/next/utils/hideWidgetsWithQueryParams.js.map +1 -1
- package/dist/lib/next/utils/isEmptyWidgetList.js.map +1 -1
- package/dist/lib/next/utils/orderWidgetWithQueryParams.js.map +1 -1
- package/dist/lib/shared/hooks/useObserverWidgets.js.map +1 -1
- package/dist/lib/shared/ui/button/model/helpers.js.map +1 -1
- package/dist/lib/shared/ui/calendar/Calendar.js +1 -1
- package/dist/lib/shared/ui/calendar/Calendar.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/MonthCaption.js +1 -1
- package/dist/lib/shared/ui/calendar/ui/MonthCaption.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/Weekday.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/model/utils.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/SelectDate.js +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/SelectDate.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/ui/Trigger.js +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/ui/Trigger.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/constant.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/RenderSlides.js.map +1 -1
- package/dist/lib/shared/ui/carouselBase/model/helpers.js.map +1 -1
- package/dist/lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/ui/dropdownItem/DropdownItem.js +1 -1
- package/dist/lib/shared/ui/dropdownList/ui/dropdownItem/DropdownItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/dayPickerControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/single.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/Editor.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/EditorModal.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/EditorModal.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/Toolbar.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/Toolbar.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetColor.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetHeadings.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/setCustomLink.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/setCustomLink.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/index.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/index.js.map +1 -1
- package/dist/lib/shared/ui/formElements/ui/fieldAttachment/FieldAttachment.js.map +1 -1
- package/dist/lib/shared/ui/formElements/ui/fieldAttachment/ui/IconSlot.js.map +1 -1
- package/dist/lib/shared/ui/formElements/ui/fieldAttachment/ui/ValidateSlot.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/combobox/combobox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/combobox/hooks/useCombobox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/index.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/index.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/inputCurrency/hooks/useCurrencyControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/ui/RadioItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/ui/RadioItemCard.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/ui/RadioItemTab.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/UploaderBase.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/model/hooks/useUploader.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/model/hooks/useUploader.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/ui/UploaderInput.js.map +1 -1
- package/dist/lib/shared/ui/icon/Icon.js +1 -1
- package/dist/lib/shared/ui/icon/Icon.js.map +1 -1
- package/dist/lib/shared/ui/modal/Modal.js.map +1 -1
- package/dist/lib/shared/ui/notification/Notification.js.map +1 -1
- package/dist/lib/shared/ui/notification/ui/CustomToast.js.map +1 -1
- package/dist/lib/shared/ui/slot/model/isSlottable.js.map +1 -1
- package/dist/lib/shared/ui/slot/ui/SlotClone.js +1 -1
- package/dist/lib/shared/ui/slot/ui/SlotClone.js.map +1 -1
- package/dist/lib/shared/ui/tabSwitcher/ui/TabContent.js.map +1 -1
- package/dist/lib/shared/utils/scrollToElement.js.map +1 -1
- package/dist/lib/widgets/banner/index.js +1 -1
- package/dist/lib/widgets/banner/ui/banners/BannerImageFull.js +1 -1
- package/dist/lib/widgets/banner/ui/banners/BannerImageFull.js.map +1 -1
- package/dist/lib/widgets/banner/ui/banners/BannerWithSeparateImg.js +1 -1
- package/dist/lib/widgets/banner/ui/banners/BannerWithSeparateImg.js.map +1 -1
- package/dist/lib/widgets/benefit/Benefit.js +1 -1
- package/dist/lib/widgets/benefit/Benefit.js.map +1 -1
- package/dist/lib/widgets/calculator/Calculator.js +1 -1
- package/dist/lib/widgets/calculator/Calculator.js.map +1 -1
- package/dist/lib/widgets/calculator/model/utils.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorFields/ui/AdditionalSlider.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorFields/ui/CalculatorModal.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/index.js +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatedBlock.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatorInfoBody.js +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatorInfoBody.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/InfoListItem.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/index.js +1 -1
- package/dist/lib/widgets/carouselBlock/CarouselBlock.js +1 -1
- package/dist/lib/widgets/carouselBlock/CarouselBlock.js.map +1 -1
- package/dist/lib/widgets/conditionBlock/ConditionBlock.js +1 -1
- package/dist/lib/widgets/conditionBlock/ConditionBlock.js.map +1 -1
- package/dist/lib/widgets/conditionBlock/ui/ConditionsWithCTA.js.map +1 -1
- package/dist/lib/widgets/dynamicForm/DynamicForm.js +1 -1
- package/dist/lib/widgets/dynamicForm/DynamicForm.js.map +1 -1
- package/dist/lib/widgets/dynamicForm/model/helpers.js +1 -1
- package/dist/lib/widgets/dynamicForm/model/helpers.js.map +1 -1
- package/dist/lib/widgets/dynamicFormDialog/DynamicFormDialog.js +1 -1
- package/dist/lib/widgets/dynamicFormDialog/DynamicFormDialog.js.map +1 -1
- package/dist/lib/widgets/footer/Footer.js +1 -1
- package/dist/lib/widgets/footer/Footer.js.map +1 -1
- package/dist/lib/widgets/footer/ui/NavLinks.js.map +1 -1
- package/dist/lib/widgets/footer/ui/PhonesBlock.js.map +1 -1
- package/dist/lib/widgets/footer/ui/SocialLinks.js.map +1 -1
- package/dist/lib/widgets/header/Header.js +1 -1
- package/dist/lib/widgets/header/Header.js.map +1 -1
- package/dist/lib/widgets/index.js +1 -1
- package/dist/lib/widgets/infoBlock/InfoBlock.js +1 -1
- package/dist/lib/widgets/infoBlock/InfoBlock.js.map +1 -1
- package/dist/lib/widgets/interLinking/InterLinking.js +1 -1
- package/dist/lib/widgets/interLinking/InterLinking.js.map +1 -1
- package/dist/lib/widgets/longBanner/LongBanner.js +1 -1
- package/dist/lib/widgets/longBanner/LongBanner.js.map +1 -1
- package/dist/lib/widgets/model/helpers.js +2 -2
- package/dist/lib/widgets/queryClientProvider/QueryClientProvider.js +1 -1
- package/dist/lib/widgets/seoHeader/SeoHeader.js +1 -1
- package/dist/lib/widgets/seoHeader/SeoHeader.js.map +1 -1
- package/dist/lib/widgets/stepper/Stepper.js +1 -1
- package/dist/lib/widgets/stepper/Stepper.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/UsefulInfo.js +1 -1
- package/dist/lib/widgets/usefulInfo/UsefulInfo.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/documents/Documents.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/experts/Experts.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/html/Html.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/table/Table.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/table/model/utils.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/table/ui/DesktopHeadings.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/table/ui/DesktopRow.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/table/ui/MobileRow.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/subEntities/table/ui/TableBody.js.map +1 -1
- package/dist/lib/widgets/userFeedback/ui/UserReview.js +1 -1
- package/dist/lib/widgets/userFeedback/ui/UserReview.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/lib/next/utils/hasWidget.d.ts +1 -1
- package/dist/types/lib/next/utils/hideWidgetsWithQueryParams.d.ts +1 -1
- package/dist/types/lib/next/utils/isEmptyWidgetList.d.ts +1 -1
- package/dist/types/lib/next/utils/orderWidgetWithQueryParams.d.ts +1 -1
- package/dist/types/lib/shared/hooks/useObserverWidgets.d.ts +1 -1
- package/dist/types/lib/shared/ui/calendar/Calendar.d.ts +1 -1
- package/dist/types/lib/shared/ui/calendar/ui/index.d.ts +0 -1
- package/dist/types/lib/shared/ui/calendar/ui/model/utils.d.ts +1 -1
- package/dist/types/lib/shared/ui/carousel/model/constant.d.ts +1 -1
- package/dist/types/lib/shared/ui/carousel/model/types.d.ts +1 -1
- package/dist/types/lib/shared/ui/carousel/ui/RenderSlides.d.ts +1 -2
- package/dist/types/lib/shared/ui/carouselBase/model/helpers.d.ts +1 -1
- package/dist/types/lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.d.ts +1 -1
- package/dist/types/lib/shared/ui/carouselBase/model/types.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/controlled/dayPickerControl/single.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/controlled/editor/ui/Editor.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/controlled/editor/ui/EditorModal.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/controlled/index.d.ts +19 -19
- package/dist/types/lib/shared/ui/formElements/ui/fieldAttachment/ui/IconSlot.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/ui/fieldAttachment/ui/ValidateSlot.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/uncontrolled/combobox/hooks/useCombobox.d.ts +1 -2
- package/dist/types/lib/shared/ui/formElements/uncontrolled/index.d.ts +13 -10
- package/dist/types/lib/shared/ui/formElements/uncontrolled/inputCurrency/hooks/useCurrencyControl.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/uncontrolled/slider/model/types.d.ts +1 -1
- package/dist/types/lib/shared/ui/formElements/uncontrolled/uploader/UploaderBase.d.ts +1 -1
- package/dist/types/lib/shared/ui/loader/model/helpers.d.ts +1 -1
- package/dist/types/lib/shared/ui/notification/ui/CustomToast.d.ts +1 -1
- package/dist/types/lib/shared/ui/tabSwitcher/ui/TabContent.d.ts +1 -1
- package/dist/types/lib/shared/utils/scrollToElement.d.ts +1 -1
- package/dist/types/lib/widgets/authProvider/model/types.d.ts +2 -1
- package/dist/types/lib/widgets/banner/index.d.ts +0 -1
- package/dist/types/lib/widgets/buttonWithHandlers/model/types.d.ts +1 -1
- package/dist/types/lib/widgets/calculator/model/utils.d.ts +2 -2
- package/dist/types/lib/widgets/calculator/ui/calculatorFields/ui/CalculatorModal.d.ts +1 -1
- package/dist/types/lib/widgets/calculator/ui/calculatorInfo/index.d.ts +1 -1
- package/dist/types/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatorInfoBody.d.ts +1 -1
- package/dist/types/lib/widgets/conditionBlock/model/types.d.ts +1 -1
- package/dist/types/lib/widgets/dynamicForm/DynamicForm.d.ts +1 -1
- package/dist/types/lib/widgets/dynamicForm/model/helpers.d.ts +1 -1
- package/dist/types/lib/widgets/dynamicFormDialog/DynamicFormDialog.d.ts +2 -1
- package/dist/types/lib/widgets/usefulInfo/ui/subEntities/table/model/utils.d.ts +1 -1
- package/dist/types/lib/widgets/usefulInfo/ui/subEntities/table/ui/DesktopHeadings.d.ts +1 -1
- package/dist/types/lib/widgets/usefulInfo/ui/subEntities/table/ui/DesktopRow.d.ts +1 -1
- package/dist/types/lib/widgets/usefulInfo/ui/subEntities/table/ui/MobileRow.d.ts +1 -1
- package/dist/types/lib/widgets/usefulInfo/ui/subEntities/table/ui/TableBody.d.ts +1 -1
- package/dist/types/lib/widgets/userFeedback/ui/UserReview.d.ts +1 -1
- package/package.json +126 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{queryClient as e}from"../widgets/queryClientProvider/QueryClientProvider.js";import{Benefit as
|
|
1
|
+
import{queryClient as e}from"../widgets/queryClientProvider/QueryClientProvider.js";import{Benefit as f}from"../widgets/benefit/Benefit.js";import{Header as p}from"../widgets/header/Header.js";import{Banner as a}from"../widgets/banner/Banner.js";import{Footer as l}from"../widgets/footer/Footer.js";import{Stepper as c}from"../widgets/stepper/Stepper.js";import{LongBanner as I}from"../widgets/longBanner/LongBanner.js";import{AuthProvider as u}from"../widgets/authProvider/AuthProvider.js";import{InterLinking as T}from"../widgets/interLinking/InterLinking.js";import{UsefulInfo as F}from"../widgets/usefulInfo/UsefulInfo.js";import{DynamicForm as g}from"../widgets/dynamicForm/DynamicForm.js";import{DynamicFormDialog as D}from"../widgets/dynamicFormDialog/DynamicFormDialog.js";import{ButtonWithHandlers as S}from"../widgets/buttonWithHandlers/ButtonWithHandlers.js";import{KEYS_OF_WIDGET_LIST as b,WIDGET_LIST_MAP as E,widgetIds as P}from"../widgets/model/helpers.js";import{FallbacksView as y}from"../widgets/fallbacksView/FallbacksView.js";import{ErrorPage as W}from"../widgets/errorPage/ErrorPage.js";import{HTMLParser as A}from"../widgets/htmlParser/htmlParser.js";import{HTMLRenderer as U}from"../widgets/htmlParser/HTMLRenderer.js";import{Breadcrumbs as q}from"../widgets/breadcrumbs/Breadcrumbs.js";import{SeoHeader as K}from"../widgets/seoHeader/SeoHeader.js";import{Calculator as R}from"../widgets/calculator/Calculator.js";import{CalculatorView as j}from"../widgets/calculator/CalculatorView.js";import{InfoBlock as J}from"../widgets/infoBlock/InfoBlock.js";import{UserFeedback as Q}from"../widgets/userFeedback/UserFeedback.js";import{InfoTable as Z}from"../widgets/table/InfoTable.js";import{ConditionBlock as rr}from"../widgets/conditionBlock/ConditionBlock.js";import{CarouselBlock as er}from"../widgets/carouselBlock/CarouselBlock.js";export{u as AuthProvider,a as Banner,f as Benefit,q as Breadcrumbs,S as ButtonWithHandlers,R as Calculator,j as CalculatorView,er as CarouselBlock,rr as ConditionBlock,g as DynamicForm,D as DynamicFormDialog,W as ErrorPage,y as FallbacksView,l as Footer,A as HTMLParser,U as HTMLRenderer,p as Header,J as InfoBlock,Z as InfoTable,T as InterLinking,b as KEYS_OF_WIDGET_LIST,I as LongBanner,K as SeoHeader,c as Stepper,F as UsefulInfo,Q as UserFeedback,E as WIDGET_LIST_MAP,e as queryClient,P as widgetIds};
|
|
2
2
|
//# sourceMappingURL=widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasWidget.js","sources":["../../../../lib/next/utils/hasWidget.ts"],"sourcesContent":["import type { AllowedWidgets, WidgetsListDTO } from '
|
|
1
|
+
{"version":3,"file":"hasWidget.js","sources":["../../../../lib/next/utils/hasWidget.ts"],"sourcesContent":["import type { AllowedWidgets, WidgetsListDTO } from '$/widgets/model'\n\nexport const hasWidget = (searchableWidget: AllowedWidgets, widgetsList: WidgetsListDTO): boolean => {\n if (!widgetsList || !Array.isArray(widgetsList)) return false\n\n const targetWidget = widgetsList.find((widget) => {\n if (!widget || !Array.isArray(widget)) return false\n const [widgetName, props] = widget\n return widgetName === searchableWidget && Boolean(props) && Object.keys(props).length > 0\n })\n\n return Boolean(targetWidget)\n}\n"],"names":["hasWidget","searchableWidget","widgetsList","widget","widgetName","props"],"mappings":"AAEO,MAAMA,EAAY,CAACC,EAAkCC,IACtD,CAACA,GAAe,CAAC,MAAM,QAAQA,CAAW,EAAU,GAQjD,EANcA,EAAY,KAAMC,GAAW,CAChD,GAAI,CAACA,GAAU,CAAC,MAAM,QAAQA,CAAM,EAAG,MAAO,GAC9C,KAAM,CAACC,EAAYC,CAAK,EAAIF,EAC5B,OAAOC,IAAeH,GAAoB,EAAQI,GAAU,OAAO,KAAKA,CAAK,EAAE,OAAS,CAC1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hideWidgetsWithQueryParams.js","sources":["../../../../lib/next/utils/hideWidgetsWithQueryParams.tsx"],"sourcesContent":["import { isEmptyWidgetList } from './isEmptyWidgetList'\nimport type { WidgetsListDTO } from '$/widgets'\n\n/**\n * Скрытие виджетов по query параметрам в URL\n * @extends searchParams наследуется от URLSearchParams, но использует ReadonlyURLSearchParams от next.js !!!\n * @example hidden widgets\n * sovcombank.ru/apply/credit/some-page?hide=0-2 (скрыть виджеты с индексами 0 и 2)\n * @returns WidgetsListDTO если в URL странице передан параметр hide, возвращается новый список исключающий скрытые виджеты, иначе исходный список\n */\n\nexport const hideWidgetsWithQueryParams = <Params extends URLSearchParams>(widgetsList: WidgetsListDTO, searchParams: Params) => {\n if (!widgetsList || isEmptyWidgetList(widgetsList)) return widgetsList\n\n let formattedWidgetList = [...widgetsList]\n\n const hideParam = searchParams.get('hide')\n if (hideParam) {\n const indexesToHide = hideParam.split('-').map((index) => parseInt(index, 10))\n\n formattedWidgetList = formattedWidgetList.filter((_, index) => {\n return !indexesToHide.includes(index)\n })\n }\n\n return formattedWidgetList\n}\n"],"names":["hideWidgetsWithQueryParams","widgetsList","searchParams","isEmptyWidgetList","formattedWidgetList","hideParam","indexesToHide","index","_"],"mappings":"2DAWO,MAAMA,EAA6B,CAAiCC,EAA6BC,IAAyB,CAC/H,GAAI,CAACD,GAAeE,EAAkBF,CAAW,EAAG,OAAOA,EAE3D,IAAIG,EAAsB,CAAC,GAAGH,CAAW,EAEzC,MAAMI,EAAYH,EAAa,IAAI,MAAM,EACzC,GAAIG,EAAW,CACb,MAAMC,EAAgBD,EAAU,MAAM,GAAG,EAAE,IAAKE,GAAU,SAASA,EAAO,EAAE,CAAC,EAE7EH,EAAsBA,EAAoB,OAAO,CAACI,EAAGD,IAC5C,CAACD,EAAc,SAASC,CAAK,CACrC,CACH,CAEA,OAAOH,CACT"}
|
|
1
|
+
{"version":3,"file":"hideWidgetsWithQueryParams.js","sources":["../../../../lib/next/utils/hideWidgetsWithQueryParams.tsx"],"sourcesContent":["import { isEmptyWidgetList } from './isEmptyWidgetList'\nimport type { WidgetsListDTO } from '$/widgets/model'\n\n/**\n * Скрытие виджетов по query параметрам в URL\n * @extends searchParams наследуется от URLSearchParams, но использует ReadonlyURLSearchParams от next.js !!!\n * @example hidden widgets\n * sovcombank.ru/apply/credit/some-page?hide=0-2 (скрыть виджеты с индексами 0 и 2)\n * @returns WidgetsListDTO если в URL странице передан параметр hide, возвращается новый список исключающий скрытые виджеты, иначе исходный список\n */\n\nexport const hideWidgetsWithQueryParams = <Params extends URLSearchParams>(widgetsList: WidgetsListDTO, searchParams: Params) => {\n if (!widgetsList || isEmptyWidgetList(widgetsList)) return widgetsList\n\n let formattedWidgetList = [...widgetsList]\n\n const hideParam = searchParams.get('hide')\n if (hideParam) {\n const indexesToHide = hideParam.split('-').map((index) => parseInt(index, 10))\n\n formattedWidgetList = formattedWidgetList.filter((_, index) => {\n return !indexesToHide.includes(index)\n })\n }\n\n return formattedWidgetList\n}\n"],"names":["hideWidgetsWithQueryParams","widgetsList","searchParams","isEmptyWidgetList","formattedWidgetList","hideParam","indexesToHide","index","_"],"mappings":"2DAWO,MAAMA,EAA6B,CAAiCC,EAA6BC,IAAyB,CAC/H,GAAI,CAACD,GAAeE,EAAkBF,CAAW,EAAG,OAAOA,EAE3D,IAAIG,EAAsB,CAAC,GAAGH,CAAW,EAEzC,MAAMI,EAAYH,EAAa,IAAI,MAAM,EACzC,GAAIG,EAAW,CACb,MAAMC,EAAgBD,EAAU,MAAM,GAAG,EAAE,IAAKE,GAAU,SAASA,EAAO,EAAE,CAAC,EAE7EH,EAAsBA,EAAoB,OAAO,CAACI,EAAGD,IAC5C,CAACD,EAAc,SAASC,CAAK,CACrC,CACH,CAEA,OAAOH,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEmptyWidgetList.js","sources":["../../../../lib/next/utils/isEmptyWidgetList.ts"],"sourcesContent":["import type { WidgetsListDTO } from '$/widgets'\n\nexport const isEmptyWidgetList = (widgetsList: WidgetsListDTO): boolean => {\n return !widgetsList || widgetsList.every(([, props]) => !props)\n}\n"],"names":["isEmptyWidgetList","widgetsList","props"],"mappings":"AAEO,MAAMA,EAAqBC,GACzB,CAACA,GAAeA,EAAY,MAAM,CAAC,EAAGC,CAAK,IAAM,CAACA,CAAK"}
|
|
1
|
+
{"version":3,"file":"isEmptyWidgetList.js","sources":["../../../../lib/next/utils/isEmptyWidgetList.ts"],"sourcesContent":["import type { WidgetsListDTO } from '$/widgets/model'\n\nexport const isEmptyWidgetList = (widgetsList: WidgetsListDTO): boolean => {\n return !widgetsList || widgetsList.every(([, props]) => !props)\n}\n"],"names":["isEmptyWidgetList","widgetsList","props"],"mappings":"AAEO,MAAMA,EAAqBC,GACzB,CAACA,GAAeA,EAAY,MAAM,CAAC,EAAGC,CAAK,IAAM,CAACA,CAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderWidgetWithQueryParams.js","sources":["../../../../lib/next/utils/orderWidgetWithQueryParams.ts"],"sourcesContent":["import { type WidgetsListDTO } from '$/widgets'\n\n/**\n * Смена расположения виджетов по query параметрам в URL\n * @extends searchParams наследуется от URLSearchParams, но использует ReadonlyURLSearchParams от next.js !!!\n * @example order widgets\n * sovcombank.ru/apply/credit/some-page?order=3-4-1\n *\n * ['header', {}],\n * ['banner', {}],\n * ['calculator', {}],\n * ['personalForm', {}],\n * ['stepper', {}],\n * ---------------------\n * Вернется новый список\n * ---------------------\n * 0: ['personalForm', {}], (индекс 3)\n * 1: ['stepper', {}], (индекс 4)\n * 2: ['banner', {}], (индекс 1)\n * 3: ['header', {}], (индекс 0)\n * 4: ['calculator', {}], (индекс 2)\n * @returns WidgetsListDTO если в URL странице передан параметр order, возвращается новый список,\n * список выстраивается в приоритете переданных виджетов в query, в конец возвращает остальные виджеты\n */\n\nexport const orderWidgetWithQueryParams = <Params extends URLSearchParams>(widgetsList: WidgetsListDTO, searchParams: Params) => {\n const orderedParams = searchParams.get('order')\n\n if (!orderedParams) {\n return widgetsList\n }\n\n const sorted = [] as unknown as WidgetsListDTO\n const indexesToOrder = orderedParams.split('-').map((index) => parseInt(index, 10))\n\n // Собираем виджеты в указанном порядке индексов\n for (const index of indexesToOrder) {\n if (index >= 0 && index < widgetsList.length) {\n sorted.push(widgetsList[index])\n }\n }\n\n // Добавляем остальные виджеты, которые не были указаны в порядке\n const withoutSort = widgetsList.filter((_, index) => !indexesToOrder.includes(index))\n return [...sorted, ...withoutSort]\n}\n"],"names":["orderWidgetWithQueryParams","widgetsList","searchParams","orderedParams","sorted","indexesToOrder","index","withoutSort","_"],"mappings":"AAyBO,MAAMA,EAA6B,CAAiCC,EAA6BC,IAAyB,CAC/H,MAAMC,EAAgBD,EAAa,IAAI,OAAO,EAE9C,GAAI,CAACC,EACH,OAAOF,EAGT,MAAMG,EAAS,CAAA,EACTC,EAAiBF,EAAc,MAAM,GAAG,EAAE,IAAKG,GAAU,SAASA,EAAO,EAAE,CAAC,EAGlF,UAAWA,KAASD,EACdC,GAAS,GAAKA,EAAQL,EAAY,QACpCG,EAAO,KAAKH,EAAYK,CAAK,CAAC,EAKlC,MAAMC,EAAcN,EAAY,OAAO,CAACO,EAAGF,IAAU,CAACD,EAAe,SAASC,CAAK,CAAC,EACpF,MAAO,CAAC,GAAGF,EAAQ,GAAGG,CAAW,CACnC"}
|
|
1
|
+
{"version":3,"file":"orderWidgetWithQueryParams.js","sources":["../../../../lib/next/utils/orderWidgetWithQueryParams.ts"],"sourcesContent":["import { type WidgetsListDTO } from '$/widgets/model'\n\n/**\n * Смена расположения виджетов по query параметрам в URL\n * @extends searchParams наследуется от URLSearchParams, но использует ReadonlyURLSearchParams от next.js !!!\n * @example order widgets\n * sovcombank.ru/apply/credit/some-page?order=3-4-1\n *\n * ['header', {}],\n * ['banner', {}],\n * ['calculator', {}],\n * ['personalForm', {}],\n * ['stepper', {}],\n * ---------------------\n * Вернется новый список\n * ---------------------\n * 0: ['personalForm', {}], (индекс 3)\n * 1: ['stepper', {}], (индекс 4)\n * 2: ['banner', {}], (индекс 1)\n * 3: ['header', {}], (индекс 0)\n * 4: ['calculator', {}], (индекс 2)\n * @returns WidgetsListDTO если в URL странице передан параметр order, возвращается новый список,\n * список выстраивается в приоритете переданных виджетов в query, в конец возвращает остальные виджеты\n */\n\nexport const orderWidgetWithQueryParams = <Params extends URLSearchParams>(widgetsList: WidgetsListDTO, searchParams: Params) => {\n const orderedParams = searchParams.get('order')\n\n if (!orderedParams) {\n return widgetsList\n }\n\n const sorted = [] as unknown as WidgetsListDTO\n const indexesToOrder = orderedParams.split('-').map((index) => parseInt(index, 10))\n\n // Собираем виджеты в указанном порядке индексов\n for (const index of indexesToOrder) {\n if (index >= 0 && index < widgetsList.length) {\n sorted.push(widgetsList[index])\n }\n }\n\n // Добавляем остальные виджеты, которые не были указаны в порядке\n const withoutSort = widgetsList.filter((_, index) => !indexesToOrder.includes(index))\n return [...sorted, ...withoutSort]\n}\n"],"names":["orderWidgetWithQueryParams","widgetsList","searchParams","orderedParams","sorted","indexesToOrder","index","withoutSort","_"],"mappings":"AAyBO,MAAMA,EAA6B,CAAiCC,EAA6BC,IAAyB,CAC/H,MAAMC,EAAgBD,EAAa,IAAI,OAAO,EAE9C,GAAI,CAACC,EACH,OAAOF,EAGT,MAAMG,EAAS,CAAA,EACTC,EAAiBF,EAAc,MAAM,GAAG,EAAE,IAAKG,GAAU,SAASA,EAAO,EAAE,CAAC,EAGlF,UAAWA,KAASD,EACdC,GAAS,GAAKA,EAAQL,EAAY,QACpCG,EAAO,KAAKH,EAAYK,CAAK,CAAC,EAKlC,MAAMC,EAAcN,EAAY,OAAO,CAACO,EAAGF,IAAU,CAACD,EAAe,SAASC,CAAK,CAAC,EACpF,MAAO,CAAC,GAAGF,EAAQ,GAAGG,CAAW,CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useObserverWidgets.js","sources":["../../../../lib/shared/hooks/useObserverWidgets.ts"],"sourcesContent":["'use client'\n\nimport { useEffect, useState } from 'react'\nimport type { AllowedWidgets } from '$/widgets'\n\nexport type UseObserverWidgets = {\n ids: AllowedWidgets[]\n options?: IntersectionObserverInit\n initialState?: boolean\n}\n\nexport const useObserverWidgets = ({ ids, options, initialState = false }: UseObserverWidgets) => {\n const [isVisible, setIsVisible] = useState(initialState)\n\n useEffect(() => {\n const observer = new IntersectionObserver((entries) => {\n const visibleIds = entries.filter((entry) => entry.isIntersecting).map((entry) => entry.target.id) as AllowedWidgets[]\n setIsVisible(visibleIds.some((id) => ids.includes(id)))\n }, options)\n\n const elementsMap = new Map<string, HTMLElement | null>()\n\n ids.forEach((id) => {\n const element = document.getElementById(id)\n elementsMap.set(id, element)\n if (element) {\n observer.observe(element)\n }\n })\n\n return () => {\n observer.disconnect()\n }\n }, [ids, options])\n\n return isVisible\n}\n"],"names":["useObserverWidgets","ids","options","initialState","isVisible","setIsVisible","useState","useEffect","observer","entries","visibleIds","entry","id","elementsMap","element"],"mappings":"gDAWO,MAAMA,EAAqB,CAAC,CAAE,IAAAC,EAAK,QAAAC,EAAS,aAAAC,EAAe,MAAgC,CAChG,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAASH,CAAY,EAEvD,OAAAI,EAAU,IAAM,CACd,MAAMC,EAAW,IAAI,qBAAsBC,GAAY,CACrD,MAAMC,EAAaD,EAAQ,OAAQE,GAAUA,EAAM,cAAc,EAAE,IAAKA,GAAUA,EAAM,OAAO,EAAE,EACjGN,EAAaK,EAAW,KAAME,GAAOX,EAAI,SAASW,CAAE,CAAC,CAAC,CACxD,EAAGV,CAAO,EAEJW,MAAkB,IAExB,OAAAZ,EAAI,QAASW,GAAO,CAClB,MAAME,EAAU,SAAS,eAAeF,CAAE,EAC1CC,EAAY,IAAID,EAAIE,CAAO,EACvBA,GACFN,EAAS,QAAQM,CAAO,CAE5B,CAAC,EAEM,IAAM,CACXN,EAAS,WAAA,CACX,CACF,EAAG,CAACP,EAAKC,CAAO,CAAC,EAEVE,CACT"}
|
|
1
|
+
{"version":3,"file":"useObserverWidgets.js","sources":["../../../../lib/shared/hooks/useObserverWidgets.ts"],"sourcesContent":["'use client'\n\nimport { useEffect, useState } from 'react'\nimport type { AllowedWidgets } from '$/widgets/model'\n\nexport type UseObserverWidgets = {\n ids: AllowedWidgets[]\n options?: IntersectionObserverInit\n initialState?: boolean\n}\n\nexport const useObserverWidgets = ({ ids, options, initialState = false }: UseObserverWidgets) => {\n const [isVisible, setIsVisible] = useState(initialState)\n\n useEffect(() => {\n const observer = new IntersectionObserver((entries) => {\n const visibleIds = entries.filter((entry) => entry.isIntersecting).map((entry) => entry.target.id) as AllowedWidgets[]\n setIsVisible(visibleIds.some((id) => ids.includes(id)))\n }, options)\n\n const elementsMap = new Map<string, HTMLElement | null>()\n\n ids.forEach((id) => {\n const element = document.getElementById(id)\n elementsMap.set(id, element)\n if (element) {\n observer.observe(element)\n }\n })\n\n return () => {\n observer.disconnect()\n }\n }, [ids, options])\n\n return isVisible\n}\n"],"names":["useObserverWidgets","ids","options","initialState","isVisible","setIsVisible","useState","useEffect","observer","entries","visibleIds","entry","id","elementsMap","element"],"mappings":"gDAWO,MAAMA,EAAqB,CAAC,CAAE,IAAAC,EAAK,QAAAC,EAAS,aAAAC,EAAe,MAAgC,CAChG,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAASH,CAAY,EAEvD,OAAAI,EAAU,IAAM,CACd,MAAMC,EAAW,IAAI,qBAAsBC,GAAY,CACrD,MAAMC,EAAaD,EAAQ,OAAQE,GAAUA,EAAM,cAAc,EAAE,IAAKA,GAAUA,EAAM,OAAO,EAAE,EACjGN,EAAaK,EAAW,KAAME,GAAOX,EAAI,SAASW,CAAE,CAAC,CAAC,CACxD,EAAGV,CAAO,EAEJW,MAAkB,IAExB,OAAAZ,EAAI,QAASW,GAAO,CAClB,MAAME,EAAU,SAAS,eAAeF,CAAE,EAC1CC,EAAY,IAAID,EAAIE,CAAO,EACvBA,GACFN,EAAS,QAAQM,CAAO,CAE5B,CAAC,EAEM,IAAM,CACXN,EAAS,WAAA,CACX,CACF,EAAG,CAACP,EAAKC,CAAO,CAAC,EAEVE,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../../../lib/shared/ui/button/model/helpers.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport { type ButtonConfig } from '
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../../lib/shared/ui/button/model/helpers.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport { type ButtonConfig } from '$/shared/ui/button/Button'\n\nexport const setButtonLoaderIntent = (intent: ButtonConfig['intent']) => {\n switch (intent) {\n case 'ghost':\n case 'secondary':\n return 'secondary'\n\n case 'primary':\n case 'negative':\n return 'primary'\n\n default:\n return intent\n }\n}\n\nexport const buttonPrimitiveSize = {\n sm: 'h-10',\n md: 'h-12',\n lg: 'h-14'\n} as const\n\nexport const buttonPrimitiveTextFormat = {\n capitalize: 'capitalize',\n uppercase: 'uppercase',\n lowercase: 'lowercase',\n initial: 'initial'\n} as const\n\nexport const buttonPrimitiveType = {\n submit: 'submit',\n button: 'button'\n} as const\n\nexport const buttonPrimitiveIntent = {\n primary:\n 'bg-color-primary-default text-color-white outline-offset-[3px] hover:bg-color-primary-hover active:bg-color-primary-hover focus:bg-color-primary-default focus:outline-primary-focus disabled:bg-color-primary-disabled',\n secondary:\n 'bg-transparent text-color-primary-default border border-solid border-primary-default hover:bg-color-primary-tr-hover active:bg-color-primary-tr-pressed active:border-primary-hover focus:outline-primary-focus focus:bg-color-primary-tr-focus disabled:bg-color-blue-grey-200 disabled:text-color-primary-disabled disabled:border-transparent',\n ghost:\n 'bg-transparent text-color-primary-default hover:bg-color-primary-tr-hover hover:text-color-primary-hover focus:bg-color-primary-tr-focus focus:outline-primary-focus active:bg-color-primary-tr-pressed active:text-color-primary-hover disabled:text-color-primary-disabled disabled:bg-transparent',\n negative:\n 'bg-color-secondary-default text-color-white outline-offset-[3px] hover:bg-color-secondary-hover disabled:bg-color-secondary-disabled active:bg-color-secondary-hover focus:bg-color-secondary-default focus:outline-primary-focus'\n} as const\n\nexport const buttonConfig = cva(\n 'relative flex items-center justify-center gap-4 cursor-pointer rounded-sm w-max px-4 outline-offset-4 outline-transparent outline-2 desk-body-medium-l transition duration-12 active:scale-[0.97] disabled:pointer-events-none',\n {\n variants: {\n intent: buttonPrimitiveIntent,\n size: buttonPrimitiveSize,\n textFormat: buttonPrimitiveTextFormat,\n isFull: {\n true: 'w-full px-4'\n },\n isLoading: {\n true: '',\n false: ''\n }\n },\n compoundVariants: [\n {\n intent: 'primary',\n isLoading: true,\n class: '!bg-color-primary-default'\n },\n {\n intent: 'secondary',\n isLoading: true,\n class: '!bg-color-transparent !border-primary-hover'\n },\n {\n intent: 'ghost',\n isLoading: true,\n class: '!bg-color-blue-grey-200'\n },\n {\n intent: 'negative',\n isLoading: true,\n class: '!bg-color-secondary-default'\n }\n ],\n defaultVariants: {\n intent: 'primary',\n size: 'md',\n textFormat: 'initial',\n isFull: false\n }\n }\n)\n"],"names":["setButtonLoaderIntent","intent","buttonPrimitiveSize","buttonPrimitiveTextFormat","buttonPrimitiveType","buttonPrimitiveIntent","buttonConfig","cva"],"mappings":"+CAGO,MAAMA,EAAyBC,GAAmC,CACvE,OAAQA,EAAA,CACN,IAAK,QACL,IAAK,YACH,MAAO,YAET,IAAK,UACL,IAAK,WACH,MAAO,UAET,QACE,OAAOA,CAAA,CAEb,EAEaC,EAAsB,CACjC,GAAI,OACJ,GAAI,OACJ,GAAI,MACN,EAEaC,EAA4B,CACvC,WAAY,aACZ,UAAW,YACX,UAAW,YACX,QAAS,SACX,EAEaC,EAAsB,CACjC,OAAQ,SACR,OAAQ,QACV,EAEaC,EAAwB,CACnC,QACE,4NACF,UACE,qVACF,MACE,uSACF,SACE,mOACJ,EAEaC,EAAeC,EAC1B,iOACA,CACE,SAAU,CACR,OAAQF,EACR,KAAMH,EACN,WAAYC,EACZ,OAAQ,CACN,KAAM,aAAA,EAER,UAAW,CACT,KAAM,GACN,MAAO,EAAA,CACT,EAEF,iBAAkB,CAChB,CACE,OAAQ,UACR,UAAW,GACX,MAAO,2BAAA,EAET,CACE,OAAQ,YACR,UAAW,GACX,MAAO,8CAAA,EAET,CACE,OAAQ,QACR,UAAW,GACX,MAAO,yBAAA,EAET,CACE,OAAQ,WACR,UAAW,GACX,MAAO,6BAAA,CACT,EAEF,gBAAiB,CACf,OAAQ,UACR,KAAM,KACN,WAAY,UACZ,OAAQ,EAAA,CACV,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as l,jsx as o,Fragment as m}from"react/jsx-runtime";import{forwardRef as w,useMemo as D}from"react";import{DayPicker as C}from"react-day-picker";import{
|
|
1
|
+
import{jsxs as l,jsx as o,Fragment as m}from"react/jsx-runtime";import{forwardRef as w,useMemo as D}from"react";import{DayPicker as C}from"react-day-picker";import{MonthCaption as b}from"./ui/MonthCaption.js";import{cn as e}from"../../utils/cn.js";import{defaultClassNames as a}from"./model/utils.js";import{Weekday as c}from"./ui/Weekday.js";import{DayButton as k}from"./ui/DayButton.js";import{Day as v}from"./ui/Day.js";import{Footer as F}from"./ui/Footer.js";const M=w(({classNames:r,showOutsideDays:i=!0,navigation:y=!0,renderFooter:n,selectOptions:d,className:p,disabledAfterToday:f,style:g,...u},_)=>{const x=D(()=>({today:e(a.today,r?.today),outside:e(a.outside,r?.outside),selected:e(a.selected,r?.selected),range_start:e(a.range_outer,r?.range_start),range_middle:e(a.range_middle,r?.range_middle),range_end:e(a.range_outer,r?.range_end),month_grid:"h-[280px]",day:e(a.day,r?.day),...r}),[r]),h=d?.year&&"startFrom"in d.year&&d.year.startFrom?new Date(d.year.startFrom,0):void 0;return l("div",{ref:_,style:g,className:e("relative flex flex-col gap-y-1 rounded-sm border-[1px] border-warm-grey-200","bg-color-white p-4 shadow-[0_16px_24px_0px_rgba(0,33,87,0.16)]",p),children:[o(C,{...u,fixedWeeks:!0,captionLayout:"dropdown",showOutsideDays:i,classNames:x,startMonth:h,components:{Day:t=>o(v,{...t,disabledAfterToday:f}),DayButton:t=>o(k,{...t}),Weekday:t=>o(c,{...t}),Nav:()=>o(m,{}),MonthCaption:t=>y?o(b,{...t,selectOptions:d}):o(m,{})}}),n&&o(F,{render:n})]})});M.displayName="Calendar";export{M as Calendar};
|
|
2
2
|
//# sourceMappingURL=Calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","sources":["../../../../../lib/shared/ui/calendar/Calendar.tsx"],"sourcesContent":["import { type DetailedHTMLProps, forwardRef, type HTMLAttributes, type JSX, useMemo } from 'react'\nimport { type ClassNames, DayPicker, type DayPickerProps } from 'react-day-picker'\n// import { ru } from 'date-fns/locale'\n// import 'react-day-picker/dist/style.css'\nimport { defaultClassNames } from './model'\nimport { Day, DayButton, Footer,
|
|
1
|
+
{"version":3,"file":"Calendar.js","sources":["../../../../../lib/shared/ui/calendar/Calendar.tsx"],"sourcesContent":["import { type DetailedHTMLProps, forwardRef, type HTMLAttributes, type JSX, useMemo } from 'react'\nimport { type ClassNames, DayPicker, type DayPickerProps } from 'react-day-picker'\n// import { ru } from 'date-fns/locale'\n// import 'react-day-picker/dist/style.css'\nimport { defaultClassNames } from './model'\nimport { Day, DayButton, Footer, Weekday } from './ui'\nimport { type SelectOptions } from '$/shared/ui/calendar/ui/model'\nimport { MonthCaption } from '$/shared/ui/calendar/ui/MonthCaption'\nimport { cn } from '$/shared/utils'\n\ntype CalendarProps = DayPickerProps & {\n navigation?: boolean\n renderFooter?: (props: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => JSX.Element | string\n selectOptions?: SelectOptions\n disabledAfterToday?: boolean\n}\n\nexport const Calendar = forwardRef<HTMLDivElement, CalendarProps>(\n (\n {\n classNames,\n showOutsideDays = true,\n navigation = true,\n renderFooter,\n selectOptions,\n className,\n disabledAfterToday,\n style,\n ...props\n },\n ref\n ) => {\n const cls = useMemo<Partial<ClassNames>>(\n () => ({\n today: cn(defaultClassNames.today, classNames?.today),\n outside: cn(defaultClassNames.outside, classNames?.outside),\n selected: cn(defaultClassNames.selected, classNames?.selected),\n range_start: cn(defaultClassNames.range_outer, classNames?.range_start),\n range_middle: cn(defaultClassNames.range_middle, classNames?.range_middle),\n range_end: cn(defaultClassNames.range_outer, classNames?.range_end),\n month_grid: 'h-[280px]',\n day: cn(defaultClassNames.day, classNames?.day),\n ...classNames\n }),\n [classNames]\n )\n\n const startYear =\n selectOptions?.year && 'startFrom' in selectOptions.year && selectOptions.year.startFrom\n ? new Date(selectOptions.year.startFrom, 0)\n : undefined\n\n return (\n <div\n ref={ref}\n style={style}\n className={cn(\n 'relative flex flex-col gap-y-1 rounded-sm border-[1px] border-warm-grey-200',\n 'bg-color-white p-4 shadow-[0_16px_24px_0px_rgba(0,33,87,0.16)]',\n className\n )}\n >\n <DayPicker\n {...props}\n fixedWeeks\n captionLayout='dropdown'\n showOutsideDays={showOutsideDays}\n // locale={ru}\n classNames={cls}\n startMonth={startYear}\n components={{\n Day: (props) => <Day {...props} disabledAfterToday={disabledAfterToday} />,\n DayButton: (props) => <DayButton {...props} />,\n Weekday: (props) => <Weekday {...props} />,\n Nav: () => <></>,\n MonthCaption: (props) => (navigation ? <MonthCaption {...props} selectOptions={selectOptions} /> : <></>)\n }}\n />\n {renderFooter && <Footer render={renderFooter} />}\n </div>\n )\n }\n)\nCalendar.displayName = 'Calendar'\n"],"names":["Calendar","forwardRef","classNames","showOutsideDays","navigation","renderFooter","selectOptions","className","disabledAfterToday","style","props","ref","cls","useMemo","cn","defaultClassNames","startYear","jsxs","jsx","DayPicker","Day","DayButton","Weekday","Fragment","MonthCaption","Footer"],"mappings":"+cAiBO,MAAMA,EAAWC,EACtB,CACE,CACE,WAAAC,EACA,gBAAAC,EAAkB,GAClB,WAAAC,EAAa,GACb,aAAAC,EACA,cAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAMC,EACV,KAAO,CACL,MAAOC,EAAGC,EAAkB,MAAOb,GAAY,KAAK,EACpD,QAASY,EAAGC,EAAkB,QAASb,GAAY,OAAO,EAC1D,SAAUY,EAAGC,EAAkB,SAAUb,GAAY,QAAQ,EAC7D,YAAaY,EAAGC,EAAkB,YAAab,GAAY,WAAW,EACtE,aAAcY,EAAGC,EAAkB,aAAcb,GAAY,YAAY,EACzE,UAAWY,EAAGC,EAAkB,YAAab,GAAY,SAAS,EAClE,WAAY,YACZ,IAAKY,EAAGC,EAAkB,IAAKb,GAAY,GAAG,EAC9C,GAAGA,CAAA,GAEL,CAACA,CAAU,CAAA,EAGPc,EACJV,GAAe,MAAQ,cAAeA,EAAc,MAAQA,EAAc,KAAK,UAC3E,IAAI,KAAKA,EAAc,KAAK,UAAW,CAAC,EACxC,OAEN,OACEW,EAAC,MAAA,CACC,IAAAN,EACA,MAAAF,EACA,UAAWK,EACT,8EACA,iEACAP,CAAA,EAGF,SAAA,CAAAW,EAACC,EAAA,CACE,GAAGT,EACJ,WAAU,GACV,cAAc,WACd,gBAAAP,EAEA,WAAYS,EACZ,WAAYI,EACZ,WAAY,CACV,IAAMN,KAAWU,EAAA,CAAK,GAAGV,EAAO,mBAAAF,EAAwC,EACxE,UAAYE,GAAUQ,EAACG,EAAA,CAAW,GAAGX,EAAO,EAC5C,QAAUA,GAAUQ,EAACI,EAAA,CAAS,GAAGZ,EAAO,EACxC,IAAK,IAAMQ,EAAAK,EAAA,EAAE,EACb,aAAeb,GAAWN,EAAac,EAACM,GAAc,GAAGd,EAAO,cAAAJ,CAAA,CAA8B,EAAKY,EAAAK,EAAA,CAAA,CAAE,CAAA,CACvG,CAAA,EAEDlB,GAAgBa,EAACO,EAAA,CAAO,OAAQpB,CAAA,CAAc,CAAA,CAAA,CAAA,CAGrD,CACF,EACAL,EAAS,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as s,jsx as r}from"react/jsx-runtime";import{useState as b}from"react";import{useDayPicker as g}from"react-day-picker";import{Navigation as u}from"./Navigation.js";import{defaultSelectOptions as
|
|
1
|
+
import{jsxs as s,jsx as r}from"react/jsx-runtime";import{useState as b}from"react";import{useDayPicker as g}from"react-day-picker";import{Navigation as u}from"./Navigation.js";import{SelectDate as h}from"./selectDate/SelectDate.js";import{defaultSelectOptions as c,getMonthsFrom as x,getYearsFrom as v}from"./model/utils.js";import{cn as C}from"../../../utils/cn.js";const O=({calendarMonth:n,displayIndex:M,className:l,selectOptions:e,...p})=>{const[a,f]=b(null),m=i=>{f(y=>y===i?null:i)},{goToMonth:d}=g(),o=e&&e.month!==void 0?e.month:c.month,t=e&&e.year!==void 0?e.year:c.year;return s("div",{...p,className:C("relative mb-2 flex h-fit items-center justify-between border-b-[1px] border-warm-grey-200 pb-2",l),children:[s("div",{className:"flex content-center justify-center",children:[o&&r(h,{dates:x(o.startFrom,o.order),currentMonth:n,onMonthChange:d,mode:"month",disabled:o?.disabled,open:a==="month",onOpenChange:()=>m("month")}),t&&r(h,{dates:v(t.startFrom,t.order),currentMonth:n,onMonthChange:d,mode:"year",disabled:t?.disabled,open:a==="year",onOpenChange:()=>m("year")})]}),r(u,{})]})};export{O as MonthCaption};
|
|
2
2
|
//# sourceMappingURL=MonthCaption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthCaption.js","sources":["../../../../../../lib/shared/ui/calendar/ui/MonthCaption.tsx"],"sourcesContent":["import { type ClassAttributes, type HTMLAttributes, useState } from 'react'\nimport { type CalendarMonth, useDayPicker } from 'react-day-picker'\nimport { defaultSelectOptions, getMonthsFrom, getYearsFrom, type SelectOptions } from '
|
|
1
|
+
{"version":3,"file":"MonthCaption.js","sources":["../../../../../../lib/shared/ui/calendar/ui/MonthCaption.tsx"],"sourcesContent":["import { type ClassAttributes, type HTMLAttributes, useState } from 'react'\nimport { type CalendarMonth, useDayPicker } from 'react-day-picker'\nimport { Navigation } from './Navigation'\nimport { defaultSelectOptions, getMonthsFrom, getYearsFrom, type SelectOptions } from '$/shared/ui/calendar/ui/model'\nimport { SelectDate } from '$/shared/ui/calendar/ui/selectDate/SelectDate'\nimport { cn } from '$/shared/utils'\n\ntype MonthCaptionProps = ClassAttributes<HTMLDivElement> &\n HTMLAttributes<HTMLDivElement> & {\n calendarMonth: CalendarMonth\n displayIndex: number\n selectOptions?: SelectOptions | false\n }\n\nexport const MonthCaption = ({\n calendarMonth,\n // disable this rules cuz we do need this prop\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,unused-imports/no-unused-vars\n displayIndex,\n className,\n selectOptions,\n ...props\n}: MonthCaptionProps) => {\n const [selectOpen, setSelectOpen] = useState<'month' | 'year' | null>(null)\n const onSelectOpenChange = (key: typeof selectOpen) => {\n setSelectOpen((prev) => (prev === key ? null : key))\n }\n\n const { goToMonth } = useDayPicker()\n\n const month = selectOptions && selectOptions.month !== undefined ? selectOptions.month : defaultSelectOptions.month\n const year = selectOptions && selectOptions.year !== undefined ? selectOptions.year : defaultSelectOptions.year\n\n return (\n <div\n {...props}\n className={cn('relative mb-2 flex h-fit items-center justify-between border-b-[1px] border-warm-grey-200 pb-2', className)}\n >\n <div className='flex content-center justify-center'>\n {month && (\n <SelectDate\n dates={getMonthsFrom(month.startFrom, month.order)}\n currentMonth={calendarMonth}\n onMonthChange={goToMonth}\n mode='month'\n disabled={month?.disabled}\n open={selectOpen === 'month'}\n onOpenChange={() => onSelectOpenChange('month')}\n />\n )}\n {year && (\n <SelectDate\n dates={getYearsFrom(year.startFrom, year.order)}\n currentMonth={calendarMonth}\n onMonthChange={goToMonth}\n mode='year'\n disabled={year?.disabled}\n open={selectOpen === 'year'}\n onOpenChange={() => onSelectOpenChange('year')}\n />\n )}\n </div>\n <Navigation />\n </div>\n )\n}\n"],"names":["MonthCaption","calendarMonth","displayIndex","className","selectOptions","props","selectOpen","setSelectOpen","useState","onSelectOpenChange","key","prev","goToMonth","useDayPicker","month","defaultSelectOptions","year","jsxs","cn","jsx","SelectDate","getMonthsFrom","getYearsFrom","Navigation"],"mappings":"+WAcO,MAAMA,EAAe,CAAC,CAC3B,cAAAC,EAGA,aAAAC,EACA,UAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IAAyB,CACvB,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAkC,IAAI,EACpEC,EAAsBC,GAA2B,CACrDH,EAAeI,GAAUA,IAASD,EAAM,KAAOA,CAAI,CACrD,EAEM,CAAE,UAAAE,CAAA,EAAcC,EAAA,EAEhBC,EAAQV,GAAiBA,EAAc,QAAU,OAAYA,EAAc,MAAQW,EAAqB,MACxGC,EAAOZ,GAAiBA,EAAc,OAAS,OAAYA,EAAc,KAAOW,EAAqB,KAE3G,OACEE,EAAC,MAAA,CACE,GAAGZ,EACJ,UAAWa,EAAG,iGAAkGf,CAAS,EAEzH,SAAA,CAAAc,EAAC,MAAA,CAAI,UAAU,qCACZ,SAAA,CAAAH,GACCK,EAACC,EAAA,CACC,MAAOC,EAAcP,EAAM,UAAWA,EAAM,KAAK,EACjD,aAAcb,EACd,cAAeW,EACf,KAAK,QACL,SAAUE,GAAO,SACjB,KAAMR,IAAe,QACrB,aAAc,IAAMG,EAAmB,OAAO,CAAA,CAAA,EAGjDO,GACCG,EAACC,EAAA,CACC,MAAOE,EAAaN,EAAK,UAAWA,EAAK,KAAK,EAC9C,aAAcf,EACd,cAAeW,EACf,KAAK,OACL,SAAUI,GAAM,SAChB,KAAMV,IAAe,OACrB,aAAc,IAAMG,EAAmB,MAAM,CAAA,CAAA,CAC/C,EAEJ,IACCc,EAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Weekday.js","sources":["../../../../../../lib/shared/ui/calendar/ui/Weekday.tsx"],"sourcesContent":["import { type DetailedHTMLProps, type ThHTMLAttributes } from 'react'\nimport { weekdays } from '
|
|
1
|
+
{"version":3,"file":"Weekday.js","sources":["../../../../../../lib/shared/ui/calendar/ui/Weekday.tsx"],"sourcesContent":["import { type DetailedHTMLProps, type ThHTMLAttributes } from 'react'\nimport { weekdays } from '$/shared/ui/calendar/ui/model'\nimport { cn } from '$/shared/utils'\n\ntype WeekdayProps = DetailedHTMLProps<ThHTMLAttributes<HTMLTableCellElement>, HTMLTableCellElement>\n\nexport const Weekday = ({ className, children, ...props }: WeekdayProps) => {\n const isWeekend = weekdays[children as keyof typeof weekdays]\n\n return (\n <td\n {...props}\n className={cn('h-10 w-10 p-0 text-14 font-medium capitalize', { 'text-color-negative': isWeekend }, className)}\n >\n {children}\n </td>\n )\n}\n"],"names":["Weekday","className","children","props","isWeekend","weekdays","jsx","cn"],"mappings":"8HAMO,MAAMA,EAAU,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,KAA0B,CAC1E,MAAMC,EAAYC,EAASH,CAAiC,EAE5D,OACEI,EAAC,KAAA,CACE,GAAGH,EACJ,UAAWI,EAAG,+CAAgD,CAAE,sBAAuBH,CAAA,EAAaH,CAAS,EAE5G,SAAAC,CAAA,CAAA,CAGP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../lib/shared/ui/calendar/ui/model/utils.ts"],"sourcesContent":["import { type SelectOptions } from '
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../../lib/shared/ui/calendar/ui/model/utils.ts"],"sourcesContent":["import { type SelectOptions } from '$/shared/ui/calendar/ui/model/types'\n\nexport const weekdays = {\n пн: false,\n вт: false,\n ср: false,\n чт: false,\n пт: false,\n сб: true,\n вс: true\n}\n\nexport const getYearsFrom = (startFrom = 2000, order = 'desc'): number[] => {\n const dates: number[] = []\n\n const today = new Date()\n\n switch (order) {\n case 'asc':\n for (let i = startFrom; i <= today.getFullYear(); i += 1) {\n dates.push(i)\n }\n break\n case 'desc':\n default:\n for (let i = today.getFullYear(); i >= startFrom; i -= 1) {\n dates.push(i)\n }\n }\n\n return dates\n}\n\nexport const getMonthsFrom = (startFrom = 0, order = 'desc'): number[] => {\n const dates: number[] = []\n\n switch (order) {\n case 'asc':\n for (let i = startFrom; i <= 11; i += 1) {\n dates.push(i)\n }\n break\n case 'desc':\n default:\n for (let i = 11; i >= startFrom; i -= 1) {\n dates.push(i)\n }\n }\n\n return dates\n}\n\nexport const defaultSelectOptions: SelectOptions = {\n year: {\n order: 'desc',\n startFrom: 2000,\n disabled: false\n },\n month: {\n order: 'asc',\n startFrom: 0,\n disabled: false\n }\n}\n"],"names":["weekdays","getYearsFrom","startFrom","order","dates","today","i","getMonthsFrom","defaultSelectOptions"],"mappings":"AAEO,MAAMA,EAAW,CACtB,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,EACN,EAEaC,EAAe,CAACC,EAAY,IAAMC,EAAQ,SAAqB,CAC1E,MAAMC,EAAkB,CAAA,EAElBC,MAAY,KAElB,OAAQF,EAAA,CACN,IAAK,MACH,QAASG,EAAIJ,EAAWI,GAAKD,EAAM,YAAA,EAAeC,GAAK,EACrDF,EAAM,KAAKE,CAAC,EAEd,MACF,IAAK,OACL,QACE,QAASA,EAAID,EAAM,YAAA,EAAeC,GAAKJ,EAAWI,GAAK,EACrDF,EAAM,KAAKE,CAAC,CACd,CAGJ,OAAOF,CACT,EAEaG,EAAgB,CAACL,EAAY,EAAGC,EAAQ,SAAqB,CACxE,MAAMC,EAAkB,CAAA,EAExB,OAAQD,EAAA,CACN,IAAK,MACH,QAASG,EAAIJ,EAAWI,GAAK,GAAIA,GAAK,EACpCF,EAAM,KAAKE,CAAC,EAEd,MACF,IAAK,OACL,QACE,QAASA,EAAI,GAAIA,GAAKJ,EAAWI,GAAK,EACpCF,EAAM,KAAKE,CAAC,CACd,CAGJ,OAAOF,CACT,EAEaI,EAAsC,CACjD,KAAM,CACJ,MAAO,OACP,UAAW,IACX,SAAU,EAAA,EAEZ,MAAO,CACL,MAAO,MACP,UAAW,EACX,SAAU,EAAA,CAEd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as S,jsx as m}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsxs as S,jsx as m}from"react/jsx-runtime";import{SelectList as p}from"./ui/SelectList.js";import{Trigger as x}from"./ui/Trigger.js";import{cn as j}from"../../../../utils/cn.js";const v=({dates:o,currentMonth:t,onMonthChange:s,className:i,open:e,onOpenChange:r,mode:c,disabled:l,...a})=>{const d=f=>{s(f),r()};return S("div",{...a,className:j("",i),children:[m(x,{currentDate:t.date,mode:c,open:e,onOpenChange:r,disabled:l}),e&&m(p,{dates:o,selected:t.date,mode:c,onSelect:d})]})};export{v as SelectDate};
|
|
2
2
|
//# sourceMappingURL=SelectDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDate.js","sources":["../../../../../../../lib/shared/ui/calendar/ui/selectDate/SelectDate.tsx"],"sourcesContent":["import { type HTMLAttributes } from 'react'\nimport { type CalendarMonth } from 'react-day-picker'\nimport { SelectList
|
|
1
|
+
{"version":3,"file":"SelectDate.js","sources":["../../../../../../../lib/shared/ui/calendar/ui/selectDate/SelectDate.tsx"],"sourcesContent":["import { type HTMLAttributes } from 'react'\nimport { type CalendarMonth } from 'react-day-picker'\nimport { SelectList } from '$/shared/ui/calendar/ui/selectDate/ui/SelectList'\nimport { Trigger } from '$/shared/ui/calendar/ui/selectDate/ui/Trigger'\nimport { cn } from '$/shared/utils'\n\ntype SelectDateProps = HTMLAttributes<HTMLDivElement> & {\n dates: number[]\n currentMonth: CalendarMonth\n onMonthChange: (month: Date) => void\n mode: 'month' | 'year'\n disabled?: boolean\n open: boolean\n onOpenChange: () => void\n}\n\nexport const SelectDate = ({\n dates,\n currentMonth,\n onMonthChange,\n className,\n open,\n onOpenChange,\n mode,\n disabled,\n ...props\n}: SelectDateProps) => {\n const onItemSelect = (date: Date) => {\n onMonthChange(date)\n onOpenChange()\n }\n\n return (\n <div {...props} className={cn('', className)}>\n <Trigger currentDate={currentMonth.date} mode={mode} open={open} onOpenChange={onOpenChange} disabled={disabled} />\n {open && <SelectList dates={dates} selected={currentMonth.date} mode={mode} onSelect={onItemSelect} />}\n </div>\n )\n}\n"],"names":["SelectDate","dates","currentMonth","onMonthChange","className","open","onOpenChange","mode","disabled","props","onItemSelect","date","jsxs","cn","jsx","Trigger","SelectList"],"mappings":"yLAgBO,MAAMA,EAAa,CAAC,CACzB,MAAAC,EACA,aAAAC,EACA,cAAAC,EACA,UAAAC,EACA,KAAAC,EACA,aAAAC,EACA,KAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAuB,CACrB,MAAMC,EAAgBC,GAAe,CACnCR,EAAcQ,CAAI,EAClBL,EAAA,CACF,EAEA,OACEM,EAAC,OAAK,GAAGH,EAAO,UAAWI,EAAG,GAAIT,CAAS,EACzC,SAAA,CAAAU,EAACC,GAAQ,YAAab,EAAa,KAAM,KAAAK,EAAY,KAAAF,EAAY,aAAAC,EAA4B,SAAAE,EAAoB,EAChHH,KAASW,EAAA,CAAW,MAAAf,EAAc,SAAUC,EAAa,KAAM,KAAAK,EAAY,SAAUG,CAAA,CAAc,CAAA,EACtG,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as s,jsx as l}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsxs as s,jsx as l}from"react/jsx-runtime";import{cn as o}from"../../../../../utils/cn.js";import{formatDateToYearString as c,formatDateToMonthString as d}from"../../../model/utils.js";import{Icon as p}from"../../../../icon/Icon.js";const h=({currentDate:r,mode:e,className:a,open:t,onOpenChange:i,...m})=>{const n=e==="year"?c(r):d(r);return s("button",{...m,type:"button",onClick:i,className:o("mob-body-medium-m flex h-10 items-center gap-1 rounded-sm px-2","capitalize text-color-tetriary hover:bg-color-primary-tr-hover","disabled:pointer-events-none disabled:text-color-disabled",{"text-color-primary-default":t},a),children:[n,l(p,{name:"arrows/arrowRight",className:o("size-4 rotate-90",{"-rotate-90":t})})]})};export{h as Trigger};
|
|
2
2
|
//# sourceMappingURL=Trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../lib/shared/ui/calendar/ui/selectDate/ui/Trigger.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes } from 'react'\nimport { formatDateToMonthString, formatDateToYearString } from '
|
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../lib/shared/ui/calendar/ui/selectDate/ui/Trigger.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes } from 'react'\nimport { formatDateToMonthString, formatDateToYearString } from '$/shared/ui'\nimport { Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\ntype TriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {\n currentDate: Date\n mode: 'year' | 'month'\n open: boolean\n onOpenChange: () => void\n}\n\nexport const Trigger = ({ currentDate, mode, className, open, onOpenChange, ...props }: TriggerProps) => {\n const title = mode === 'year' ? formatDateToYearString(currentDate) : formatDateToMonthString(currentDate)\n\n return (\n <button\n {...props}\n type='button'\n onClick={onOpenChange}\n className={cn(\n 'mob-body-medium-m flex h-10 items-center gap-1 rounded-sm px-2',\n 'capitalize text-color-tetriary hover:bg-color-primary-tr-hover',\n 'disabled:pointer-events-none disabled:text-color-disabled',\n { 'text-color-primary-default': open },\n className\n )}\n >\n {title}\n <Icon name='arrows/arrowRight' className={cn('size-4 rotate-90', { '-rotate-90': open })} />\n </button>\n )\n}\n"],"names":["Trigger","currentDate","mode","className","open","onOpenChange","props","title","formatDateToYearString","formatDateToMonthString","jsxs","cn","jsx","Icon"],"mappings":"gPAYO,MAAMA,EAAU,CAAC,CAAE,YAAAC,EAAa,KAAAC,EAAM,UAAAC,EAAW,KAAAC,EAAM,aAAAC,EAAc,GAAGC,KAA0B,CACvG,MAAMC,EAAQL,IAAS,OAASM,EAAuBP,CAAW,EAAIQ,EAAwBR,CAAW,EAEzG,OACES,EAAC,SAAA,CACE,GAAGJ,EACJ,KAAK,SACL,QAASD,EACT,UAAWM,EACT,iEACA,iEACA,4DACA,CAAE,6BAA8BP,CAAA,EAChCD,CAAA,EAGD,SAAA,CAAAI,EACDK,EAACC,EAAA,CAAK,KAAK,oBAAoB,UAAWF,EAAG,mBAAoB,CAAE,aAAcP,CAAA,CAAM,CAAA,CAAG,CAAA,CAAA,CAAA,CAGhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sources":["../../../../../../lib/shared/ui/carousel/model/constant.ts"],"sourcesContent":["import type { EmblaOptionsType } from 'embla-carousel'\nimport type { AutoplayOptionsType } from 'embla-carousel-autoplay'\nimport { type NavigationOptions } from '
|
|
1
|
+
{"version":3,"file":"constant.js","sources":["../../../../../../lib/shared/ui/carousel/model/constant.ts"],"sourcesContent":["import type { EmblaOptionsType } from 'embla-carousel'\nimport type { AutoplayOptionsType } from 'embla-carousel-autoplay'\nimport { type NavigationOptions } from '$/shared/ui'\n\nexport const SLIDE_VARIANT = {\n multipleCards: 'multipleCards',\n fullScreen: 'fullScreen',\n stepsList: 'stepsList'\n} as const\n\nexport const defaultCarouselOptions: EmblaOptionsType = {\n dragFree: false,\n loop: false,\n align: 'start',\n slidesToScroll: 1\n}\n\nexport const defaultNavigationOptions: NavigationOptions = {\n dotsOnDesk: true,\n dotsOnMob: true,\n arrowsOnDesk: true,\n arrowsOnMob: false\n}\n\nexport const defaultAutoPlayOptions: AutoplayOptionsType = {\n active: false\n}\n"],"names":["SLIDE_VARIANT","defaultCarouselOptions","defaultNavigationOptions","defaultAutoPlayOptions"],"mappings":"AAIO,MAAMA,EAAgB,CAC3B,cAAe,gBACf,WAAY,aACZ,UAAW,WACb,EAEaC,EAA2C,CACtD,SAAU,GACV,KAAM,GACN,MAAO,QACP,eAAgB,CAClB,EAEaC,EAA8C,CACzD,WAAY,GACZ,UAAW,GACX,aAAc,GACd,YAAa,EACf,EAEaC,EAA8C,CACzD,OAAQ,EACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderSlides.js","sources":["../../../../../../lib/shared/ui/carousel/ui/RenderSlides.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"RenderSlides.js","sources":["../../../../../../lib/shared/ui/carousel/ui/RenderSlides.tsx"],"sourcesContent":["import {\n SlideFullScreen,\n type SlideFullScreenClasses,\n SlideMultipleCards,\n type SlideMultipleCardsClasses,\n SlideStepsList,\n type SlideStepsListClasses\n} from './slideVariants'\nimport { type CarouselProps, SLIDE_VARIANT, type SlideVariant } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\nexport type RenderSlidesClasses = {\n renderSlidesWrapper?: string\n slideProductCardClasses?: SlideMultipleCardsClasses\n slideFullScreenClasses?: SlideFullScreenClasses\n slideStepsListClasses?: SlideStepsListClasses\n}\n\nexport interface RenderSlidesProps<V extends SlideVariant> {\n slidesOptions: CarouselProps<V>['slidesOptions']\n classes?: RenderSlidesClasses\n}\n\nexport const RenderSlides = <V extends SlideVariant>({ slidesOptions, classes }: RenderSlidesProps<V>) => {\n const { slidesConfig, slides, slideVariant } = slidesOptions\n\n return (\n <div className={cn('flex gap-4 desktop:gap-6', classes?.renderSlidesWrapper)}>\n {slides?.map((slide, slideIndex) => {\n switch (slideVariant) {\n case SLIDE_VARIANT.multipleCards:\n return (\n <SlideMultipleCards\n key={slideIndex}\n {...slide}\n slidesConfig={slidesConfig}\n slideProductCardClasses={classes?.slideProductCardClasses}\n />\n )\n case SLIDE_VARIANT.fullScreen:\n return (\n <SlideFullScreen\n key={slideIndex}\n slideIndex={slideIndex + 1}\n {...slide}\n slidesConfig={slidesConfig}\n slideFullScreenClasses={classes?.slideFullScreenClasses}\n />\n )\n case SLIDE_VARIANT.stepsList:\n return (\n <SlideStepsList\n key={slideIndex}\n slideIndex={slideIndex + 1}\n {...slide}\n slidesConfig={slidesConfig}\n slideStepsListClasses={classes?.slideStepsListClasses}\n />\n )\n }\n })}\n </div>\n )\n}\n"],"names":["RenderSlides","slidesOptions","classes","slidesConfig","slides","slideVariant","jsx","cn","slide","slideIndex","SLIDE_VARIANT","SlideMultipleCards","SlideFullScreen","SlideStepsList"],"mappings":"0VAuBO,MAAMA,EAAe,CAAyB,CAAE,cAAAC,EAAe,QAAAC,KAAoC,CACxG,KAAM,CAAE,aAAAC,EAAc,OAAAC,EAAQ,aAAAC,CAAA,EAAiBJ,EAE/C,OACEK,EAAC,MAAA,CAAI,UAAWC,EAAG,2BAA4BL,GAAS,mBAAmB,EACxE,SAAAE,GAAQ,IAAI,CAACI,EAAOC,IAAe,CAClC,OAAQJ,EAAA,CACN,KAAKK,EAAc,cACjB,OACEJ,EAACK,EAAA,CAEE,GAAGH,EACJ,aAAAL,EACA,wBAAyBD,GAAS,uBAAA,EAH7BO,CAAA,EAMX,KAAKC,EAAc,WACjB,OACEJ,EAACM,EAAA,CAEC,WAAYH,EAAa,EACxB,GAAGD,EACJ,aAAAL,EACA,uBAAwBD,GAAS,sBAAA,EAJ5BO,CAAA,EAOX,KAAKC,EAAc,UACjB,OACEJ,EAACO,EAAA,CAEC,WAAYJ,EAAa,EACxB,GAAGD,EACJ,aAAAL,EACA,sBAAuBD,GAAS,qBAAA,EAJ3BO,CAAA,CAKP,CAGR,CAAC,CAAA,CACH,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../../../lib/shared/ui/carouselBase/model/helpers.tsx"],"sourcesContent":["import type { EmblaOptionsType } from 'embla-carousel'\nimport type { AutoplayOptionsType } from 'embla-carousel-autoplay'\nimport {
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../../lib/shared/ui/carouselBase/model/helpers.tsx"],"sourcesContent":["import type { EmblaOptionsType } from 'embla-carousel'\nimport type { AutoplayOptionsType } from 'embla-carousel-autoplay'\nimport type { DiscriminatedUnion } from '$/shared/types'\nimport {\n type CarouselSlideVariant,\n type DotsOptions,\n type NavArrowOptions,\n SlideFullScreen,\n SlideOnlyImage,\n SlideProductCard\n} from '$/shared/ui'\n\nexport const defaultCarouselOptions: EmblaOptionsType = {\n dragFree: true,\n loop: false,\n align: 'start',\n slidesToScroll: 1\n}\n\nexport const defaultDotsOptions: DotsOptions = {\n position: 'center',\n deskVisible: true,\n mobVisible: true\n}\n\nexport const defaultNavArrowOptions: NavArrowOptions = {\n position: 'top-right',\n deskVisible: true,\n mobVisible: false\n}\n\nexport const defaultAutoPlayOptions: AutoplayOptionsType = {\n active: true\n}\n\nexport const renderSlideVariant = (props: DiscriminatedUnion<'variant', CarouselSlideVariant>) => {\n switch (props.variant) {\n case 'productCard':\n return <SlideProductCard {...props} />\n case 'onlyImage':\n return <SlideOnlyImage {...props} />\n case 'fullScreen':\n return <SlideFullScreen {...props} />\n }\n}\n"],"names":["defaultCarouselOptions","defaultDotsOptions","defaultNavArrowOptions","defaultAutoPlayOptions","renderSlideVariant","props","jsx","SlideProductCard","SlideOnlyImage","SlideFullScreen"],"mappings":"mQAYO,MAAMA,EAA2C,CACtD,SAAU,GACV,KAAM,GACN,MAAO,QACP,eAAgB,CAClB,EAEaC,EAAkC,CAC7C,SAAU,SACV,YAAa,GACb,WAAY,EACd,EAEaC,EAA0C,CACrD,SAAU,YACV,YAAa,GACb,WAAY,EACd,EAEaC,EAA8C,CACzD,OAAQ,EACV,EAEaC,EAAsBC,GAA+D,CAChG,OAAQA,EAAM,QAAA,CACZ,IAAK,cACH,OAAOC,EAACC,EAAA,CAAkB,GAAGF,CAAA,CAAO,EACtC,IAAK,YACH,OAAOC,EAACE,EAAA,CAAgB,GAAGH,CAAA,CAAO,EACpC,IAAK,aACH,OAAOC,EAACG,EAAA,CAAiB,GAAGJ,CAAA,CAAO,CAAA,CAEzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArrowNavigation.js","sources":["../../../../../../../lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport type { EmblaCarouselType } from 'embla-carousel'\nimport type
|
|
1
|
+
{"version":3,"file":"useArrowNavigation.js","sources":["../../../../../../../lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport type { EmblaCarouselType } from 'embla-carousel'\nimport { type NavigationMode } from '$/shared/ui'\n\ntype UseArrowNavigationProps = {\n emblaApi: EmblaCarouselType | undefined\n navigationHandler?: (emblaApi: EmblaCarouselType) => void\n}\n\nexport const useArrowNavigation = ({ emblaApi, navigationHandler }: UseArrowNavigationProps) => {\n const [prevBtnDisabled, setPrevBtnDisabled] = useState(true)\n const [nextBtnDisabled, setNextBtnDisabled] = useState(true)\n\n const onClickNavigationButton = useCallback(\n (mode: NavigationMode) => {\n if (!emblaApi) return\n switch (mode) {\n case 'prev':\n emblaApi.scrollPrev()\n break\n case 'next':\n emblaApi.scrollNext()\n break\n }\n\n if (navigationHandler) {\n navigationHandler(emblaApi)\n }\n },\n [emblaApi, navigationHandler]\n )\n\n const onSelect = useCallback((emblaApi: EmblaCarouselType) => {\n setPrevBtnDisabled(!emblaApi.canScrollPrev())\n setNextBtnDisabled(!emblaApi.canScrollNext())\n }, [])\n\n useEffect(() => {\n if (!emblaApi) return\n\n onSelect(emblaApi)\n emblaApi.on('reInit', onSelect).on('select', onSelect)\n }, [emblaApi, onSelect])\n\n return {\n prevBtnDisabled,\n nextBtnDisabled,\n onClickNavigationButton\n }\n}\n"],"names":["useArrowNavigation","emblaApi","navigationHandler","prevBtnDisabled","setPrevBtnDisabled","useState","nextBtnDisabled","setNextBtnDisabled","onClickNavigationButton","useCallback","mode","onSelect","useEffect"],"mappings":"iEASO,MAAMA,EAAqB,CAAC,CAAE,SAAAC,EAAU,kBAAAC,KAAiD,CAC9F,KAAM,CAACC,EAAiBC,CAAkB,EAAIC,EAAS,EAAI,EACrD,CAACC,EAAiBC,CAAkB,EAAIF,EAAS,EAAI,EAErDG,EAA0BC,EAC7BC,GAAyB,CACxB,GAAKT,EACL,QAAQS,EAAA,CACN,IAAK,OACHT,EAAS,WAAA,EACT,MACF,IAAK,OACHA,EAAS,WAAA,EACT,KAAA,CAGAC,GACFA,EAAkBD,CAAQ,EAE9B,EACA,CAACA,EAAUC,CAAiB,CAAA,EAGxBS,EAAWF,EAAaR,GAAgC,CAC5DG,EAAmB,CAACH,EAAS,eAAe,EAC5CM,EAAmB,CAACN,EAAS,eAAe,CAC9C,EAAG,CAAA,CAAE,EAEL,OAAAW,EAAU,IAAM,CACTX,IAELU,EAASV,CAAQ,EACjBA,EAAS,GAAG,SAAUU,CAAQ,EAAE,GAAG,SAAUA,CAAQ,EACvD,EAAG,CAACV,EAAUU,CAAQ,CAAC,EAEhB,CACL,gBAAAR,EACA,gBAAAG,EACA,wBAAAE,CAAA,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as d,jsx as a}from"react/jsx-runtime";import{memo as y,forwardRef as k,Fragment as v}from"react";import{
|
|
1
|
+
import{jsxs as d,jsx as a}from"react/jsx-runtime";import{memo as y,forwardRef as k,Fragment as v}from"react";import{CheckboxBase as N}from"../../../formElements/uncontrolled/checkbox/Checkbox.js";import{cn as m}from"../../../../utils/cn.js";const w=k(({item:e,className:o,onPick:p,multiple:t=!1,active:n=!1,focused:c=!1,displayValue:i,classes:x,...f},h)=>{const{label:g,helperText:l,disabled:s,attachment:r}=e,b=t||r||l?"div":v;return d("li",{...f,ref:h,role:"listitem",onClick:u=>p?.(e,u),"data-focused":c,"data-active":n,className:m("desk-body-regular-l w-full cursor-pointer list-none truncate rounded-sm bg-color-white px-2","flex h-12 items-center gap-x-4 text-color-dark","[&:not(:disabled)]:cursor-pointer [&:not(:last-child)]:mb-1 [&>p]:hover:text-color-secondary",{"pointer-events-none text-color-disabled":s,"flex items-center gap-x-4":t,"bg-color-primary-tr-hover text-color-primary-hover":n||c,"gap-x-3":r&&r.left},x?.root,o),children:[t?a(N,{checked:n,disabled:s}):r&&r.left,d(b,{children:[i?i(e):g,l&&a("p",{className:m("desk-body-regular-s text-color-tetriary",{"text-color-disabled":s}),children:l})]}),r&&r.right&&a("div",{className:"ml-auto",children:r.right})]})}),O=y(w,(e,o)=>JSON.stringify(e)===JSON.stringify(o));export{O as DropdownItem};
|
|
2
2
|
//# sourceMappingURL=DropdownItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem.js","sources":["../../../../../../../lib/shared/ui/dropdownList/ui/dropdownItem/DropdownItem.tsx"],"sourcesContent":["import { forwardRef, Fragment, memo } from 'react'\nimport type { DropdownItemOption } from './model'\nimport { CheckboxBase } from '$/shared/ui/formElements/uncontrolled/checkbox'\nimport { cn } from '$/shared/utils'\n\nexport type DropdownItemClasses = {\n root?: string\n}\n\nexport interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'children'> {\n item: DropdownItemOption\n onPick?: (value: DropdownItemOption, event: React.MouseEvent<HTMLLIElement, MouseEvent>) => void\n multiple?: boolean\n active?: boolean\n focused?: boolean\n disabled?: boolean\n displayValue?: (option: DropdownItemOption) => string\n classes?: DropdownItemClasses\n}\n\nconst InnerComponent = forwardRef<HTMLLIElement, DropdownItemProps>(\n ({ item, className, onPick, multiple = false, active = false, focused = false, displayValue, classes, ...props }, ref) => {\n const { label, helperText, disabled, attachment } = item\n const ContentWrapper = multiple || attachment || helperText ? 'div' : Fragment\n\n return (\n <li\n {...props}\n ref={ref}\n role='listitem'\n onClick={(event) => onPick?.(item, event)}\n data-focused={focused}\n data-active={active}\n className={cn(\n 'desk-body-regular-l w-full cursor-pointer list-none truncate rounded-sm bg-color-white px-2',\n 'flex h-12 items-center gap-x-4 text-color-dark',\n '[&:not(:disabled)]:cursor-pointer [&:not(:last-child)]:mb-1 [&>p]:hover:text-color-secondary',\n {\n 'pointer-events-none text-color-disabled': disabled,\n 'flex items-center gap-x-4': multiple,\n 'bg-color-primary-tr-hover text-color-primary-hover': active || focused,\n 'gap-x-3': attachment && attachment.left\n },\n classes?.root,\n className\n )}\n >\n {multiple ? <CheckboxBase checked={active} disabled={disabled} /> : attachment && attachment.left}\n <ContentWrapper>\n {displayValue ? displayValue(item) : label}\n {helperText && (\n <p\n className={cn('desk-body-regular-s text-color-tetriary', {\n 'text-color-disabled': disabled\n })}\n >\n {helperText}\n </p>\n )}\n </ContentWrapper>\n {attachment && attachment.right && <div className='ml-auto'>{attachment.right}</div>}\n </li>\n )\n }\n)\n\nexport const DropdownItem = memo(InnerComponent, (prevProps, nextProps) => {\n return JSON.stringify(prevProps) === JSON.stringify(nextProps)\n})\n"],"names":["InnerComponent","forwardRef","item","className","onPick","multiple","active","focused","displayValue","classes","props","ref","label","helperText","disabled","attachment","ContentWrapper","Fragment","jsxs","event","cn","CheckboxBase","jsx","DropdownItem","memo","prevProps","nextProps"],"mappings":"iPAoBA,MAAMA,EAAiBC,EACrB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,EAAW,GAAO,OAAAC,EAAS,GAAO,QAAAC,EAAU,GAAO,aAAAC,EAAc,QAAAC,EAAS,GAAGC,CAAA,EAASC,IAAQ,CACxH,KAAM,CAAE,MAAAC,EAAO,WAAAC,EAAY,SAAAC,EAAU,WAAAC,GAAeb,EAC9Cc,EAAiBX,GAAYU,GAAcF,EAAa,MAAQI,EAEtE,OACEC,EAAC,KAAA,CACE,GAAGR,EACJ,IAAAC,EACA,KAAK,WACL,QAAUQ,GAAUf,IAASF,EAAMiB,CAAK,EACxC,eAAcZ,EACd,cAAaD,EACb,UAAWc,EACT,8FACA,iDACA,+FACA,CACE,0CAA2CN,EAC3C,4BAA6BT,EAC7B,qDAAsDC,GAAUC,EAChE,UAAWQ,GAAcA,EAAW,IAAA,EAEtCN,GAAS,KACTN,CAAA,EAGD,SAAA,CAAAE,IAAYgB,EAAA,CAAa,QAASf,EAAQ,SAAAQ,EAAoB,EAAKC,GAAcA,EAAW,OAC5FC,EAAA,CACE,SAAA,CAAAR,EAAeA,EAAaN,CAAI,EAAIU,EACpCC,GACCS,EAAC,IAAA,CACC,UAAWF,EAAG,0CAA2C,CACvD,sBAAuBN,CAAA,CACxB,EAEA,SAAAD,CAAA,CAAA,CACH,EAEJ,EACCE,GAAcA,EAAW,OAASO,EAAC,OAAI,UAAU,UAAW,WAAW,KAAA,CAAM,CAAA,CAAA,CAAA,CAGpF,CACF,EAEaC,EAAeC,EAAKxB,EAAgB,CAACyB,EAAWC,IACpD,KAAK,UAAUD,CAAS,IAAM,KAAK,UAAUC,CAAS,CAC9D"}
|
|
1
|
+
{"version":3,"file":"DropdownItem.js","sources":["../../../../../../../lib/shared/ui/dropdownList/ui/dropdownItem/DropdownItem.tsx"],"sourcesContent":["import { forwardRef, Fragment, memo } from 'react'\nimport type { DropdownItemOption } from './model'\nimport { CheckboxBase } from '$/shared/ui/formElements/uncontrolled/checkbox/Checkbox'\nimport { cn } from '$/shared/utils'\n\nexport type DropdownItemClasses = {\n root?: string\n}\n\nexport interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'children'> {\n item: DropdownItemOption\n onPick?: (value: DropdownItemOption, event: React.MouseEvent<HTMLLIElement, MouseEvent>) => void\n multiple?: boolean\n active?: boolean\n focused?: boolean\n disabled?: boolean\n displayValue?: (option: DropdownItemOption) => string\n classes?: DropdownItemClasses\n}\n\nconst InnerComponent = forwardRef<HTMLLIElement, DropdownItemProps>(\n ({ item, className, onPick, multiple = false, active = false, focused = false, displayValue, classes, ...props }, ref) => {\n const { label, helperText, disabled, attachment } = item\n const ContentWrapper = multiple || attachment || helperText ? 'div' : Fragment\n\n return (\n <li\n {...props}\n ref={ref}\n role='listitem'\n onClick={(event) => onPick?.(item, event)}\n data-focused={focused}\n data-active={active}\n className={cn(\n 'desk-body-regular-l w-full cursor-pointer list-none truncate rounded-sm bg-color-white px-2',\n 'flex h-12 items-center gap-x-4 text-color-dark',\n '[&:not(:disabled)]:cursor-pointer [&:not(:last-child)]:mb-1 [&>p]:hover:text-color-secondary',\n {\n 'pointer-events-none text-color-disabled': disabled,\n 'flex items-center gap-x-4': multiple,\n 'bg-color-primary-tr-hover text-color-primary-hover': active || focused,\n 'gap-x-3': attachment && attachment.left\n },\n classes?.root,\n className\n )}\n >\n {multiple ? <CheckboxBase checked={active} disabled={disabled} /> : attachment && attachment.left}\n <ContentWrapper>\n {displayValue ? displayValue(item) : label}\n {helperText && (\n <p\n className={cn('desk-body-regular-s text-color-tetriary', {\n 'text-color-disabled': disabled\n })}\n >\n {helperText}\n </p>\n )}\n </ContentWrapper>\n {attachment && attachment.right && <div className='ml-auto'>{attachment.right}</div>}\n </li>\n )\n }\n)\n\nexport const DropdownItem = memo(InnerComponent, (prevProps, nextProps) => {\n return JSON.stringify(prevProps) === JSON.stringify(nextProps)\n})\n"],"names":["InnerComponent","forwardRef","item","className","onPick","multiple","active","focused","displayValue","classes","props","ref","label","helperText","disabled","attachment","ContentWrapper","Fragment","jsxs","event","cn","CheckboxBase","jsx","DropdownItem","memo","prevProps","nextProps"],"mappings":"iPAoBA,MAAMA,EAAiBC,EACrB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,EAAW,GAAO,OAAAC,EAAS,GAAO,QAAAC,EAAU,GAAO,aAAAC,EAAc,QAAAC,EAAS,GAAGC,CAAA,EAASC,IAAQ,CACxH,KAAM,CAAE,MAAAC,EAAO,WAAAC,EAAY,SAAAC,EAAU,WAAAC,GAAeb,EAC9Cc,EAAiBX,GAAYU,GAAcF,EAAa,MAAQI,EAEtE,OACEC,EAAC,KAAA,CACE,GAAGR,EACJ,IAAAC,EACA,KAAK,WACL,QAAUQ,GAAUf,IAASF,EAAMiB,CAAK,EACxC,eAAcZ,EACd,cAAaD,EACb,UAAWc,EACT,8FACA,iDACA,+FACA,CACE,0CAA2CN,EAC3C,4BAA6BT,EAC7B,qDAAsDC,GAAUC,EAChE,UAAWQ,GAAcA,EAAW,IAAA,EAEtCN,GAAS,KACTN,CAAA,EAGD,SAAA,CAAAE,IAAYgB,EAAA,CAAa,QAASf,EAAQ,SAAAQ,EAAoB,EAAKC,GAAcA,EAAW,OAC5FC,EAAA,CACE,SAAA,CAAAR,EAAeA,EAAaN,CAAI,EAAIU,EACpCC,GACCS,EAAC,IAAA,CACC,UAAWF,EAAG,0CAA2C,CACvD,sBAAuBN,CAAA,CACxB,EAEA,SAAAD,CAAA,CAAA,CACH,EAEJ,EACCE,GAAcA,EAAW,OAASO,EAAC,OAAI,UAAU,UAAW,WAAW,KAAA,CAAM,CAAA,CAAA,CAAA,CAGpF,CACF,EAEaC,EAAeC,EAAKxB,EAAgB,CAACyB,EAAWC,IACpD,KAAK,UAAUD,CAAS,IAAM,KAAK,UAAUC,CAAS,CAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayPickerControl.js","sources":["../../../../../../../lib/shared/ui/formElements/controlled/dayPickerControl/dayPickerControl.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"dayPickerControl.js","sources":["../../../../../../../lib/shared/ui/formElements/controlled/dayPickerControl/dayPickerControl.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { type Control, type FieldPath, type FieldValues, useController, type UseControllerProps } from 'react-hook-form'\nimport { SingleDayPicker } from './single'\nimport type { DataLayers } from '$/shared/types'\nimport { type Calendar, type MaskInputProps } from '$/shared/ui'\nimport { MessageView } from '$/shared/ui/formElements/ui'\nimport { cn } from '$/shared/utils'\n\ntype CalendarProps = React.ComponentPropsWithoutRef<typeof Calendar>\ntype DayPickerControlClasses = MaskInputProps['classes'] & {\n message?: string\n}\n\nexport type ExternalHandlers = {\n onChange?: (value: string) => void\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void\n}\n\nexport type DayPickerControlProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = UseControllerProps<TFieldValues, TName> &\n Omit<CalendarProps, 'selected' | 'onSelect' | 'mode'> & {\n /**\n * Контрол объект для управления полем\n */\n control: Control<TFieldValues>\n /**\n * Свойства отображаемого Input поля\n */\n inputProps: Omit<MaskInputProps, 'mask'>\n /**\n * Дополнительный текст\n */\n helperText?: string\n /**\n * Дополнительные стили компонента\n */\n classes?: DayPickerControlClasses\n /**\n * Дополнительные хендлеры\n */\n externalHandlers?: ExternalHandlers\n /**\n * Даталееры\n */\n dataLayers?: DataLayers\n }\n\nexport const DayPickerControl = <T extends FieldValues = FieldValues>({\n control,\n name,\n disabled,\n rules,\n shouldUnregister,\n defaultValue,\n inputProps,\n helperText,\n classes,\n ...props\n}: DayPickerControlProps<T>) => {\n const { field, fieldState } = useController({\n control,\n name,\n defaultValue,\n disabled,\n rules,\n shouldUnregister\n })\n\n const { value, onChange, ...restField } = field\n const { error, invalid } = fieldState\n const { message, container, ...restClasses } = classes || {}\n\n const [month, setMonth] = useState<Date>(new Date())\n\n return (\n <div className={cn('w-full', container)}>\n <SingleDayPicker\n {...props}\n value={value ?? ''}\n onChange={onChange}\n month={month}\n onMonthChange={setMonth}\n classes={restClasses}\n inputProps={{\n ...inputProps,\n ...restField,\n invalid,\n ['data-error-message']: error?.message\n }}\n />\n <MessageView\n text={error?.message || helperText}\n className={message}\n intent={error ? 'error' : 'simple'}\n disabled={disabled}\n />\n </div>\n )\n}\n"],"names":["DayPickerControl","control","name","disabled","rules","shouldUnregister","defaultValue","inputProps","helperText","classes","props","field","fieldState","useController","value","onChange","restField","error","invalid","message","container","restClasses","month","setMonth","useState","cn","jsx","SingleDayPicker","MessageView"],"mappings":"oRAmDO,MAAMA,EAAmB,CAAsC,CACpE,QAAAC,EACA,KAAAC,EACA,SAAAC,EACA,MAAAC,EACA,iBAAAC,EACA,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAAgC,CAC9B,KAAM,CAAE,MAAAC,EAAO,WAAAC,CAAA,EAAeC,EAAc,CAC1C,QAAAZ,EACA,KAAAC,EACA,aAAAI,EACA,SAAAH,EACA,MAAAC,EACA,iBAAAC,CAAA,CACD,EAEK,CAAE,MAAAS,EAAO,SAAAC,EAAU,GAAGC,GAAcL,EACpC,CAAE,MAAAM,EAAO,QAAAC,CAAA,EAAYN,EACrB,CAAE,QAAAO,EAAS,UAAAC,EAAW,GAAGC,CAAA,EAAgBZ,GAAW,CAAA,EAEpD,CAACa,EAAOC,CAAQ,EAAIC,EAAe,IAAI,IAAM,EAEnD,SACG,MAAA,CAAI,UAAWC,EAAG,SAAUL,CAAS,EACpC,SAAA,CAAAM,EAACC,EAAA,CACE,GAAGjB,EACJ,MAAOI,GAAS,GAChB,SAAAC,EACA,MAAAO,EACA,cAAeC,EACf,QAASF,EACT,WAAY,CACV,GAAGd,EACH,GAAGS,EACH,QAAAE,EACC,qBAAuBD,GAAO,OAAA,CACjC,CAAA,EAEFS,EAACE,EAAA,CACC,KAAMX,GAAO,SAAWT,EACxB,UAAWW,EACX,OAAQF,EAAQ,QAAU,SAC1B,SAAAd,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.js","sources":["../../../../../../../lib/shared/ui/formElements/controlled/dayPickerControl/single.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"single.js","sources":["../../../../../../../lib/shared/ui/formElements/controlled/dayPickerControl/single.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { autoUpdate, flip, offset, useFloating } from '@floating-ui/react'\nimport { format, isValid, parse } from 'date-fns'\nimport { useClickOutside } from '$/shared/hooks'\nimport { type DataLayers } from '$/shared/types'\nimport { Calendar, DATE_VISIBLE_PATTERN, Icon, MaskInput, type MaskInputProps } from '$/shared/ui'\nimport { type ExternalHandlers } from '$/shared/ui/formElements/controlled/dayPickerControl/dayPickerControl'\nimport {\n getCurrentDate,\n getInitialValue,\n SINGLE_MASK,\n SINGLE_VALIDATION_REGEX\n} from '$/shared/ui/formElements/controlled/dayPickerControl/model'\nimport { cn, mergeRefs, TypeGuards } from '$/shared/utils'\n\ntype CalendarProps = React.ComponentPropsWithoutRef<typeof Calendar>\n\ntype SingleDayPickerClasses = MaskInputProps['classes'] & {\n calendar?: string\n}\n\ntype SingleDayPickerProps = Omit<CalendarProps, 'mode'> & {\n /**\n * Свойства Input компонента\n */\n inputProps: Omit<MaskInputProps, 'mask'>\n /**\n * Стили внутренних компонентов\n */\n classes?: SingleDayPickerClasses\n /**\n * Управляемое значение\n */\n value: string\n /**\n * Функция для управления значением\n */\n onChange: (value: string) => void\n /**\n * Дополнительные хендлеры\n */\n externalHandlers?: ExternalHandlers\n /**\n * Даталееры\n */\n dataLayers?: DataLayers\n}\n\nexport const SingleDayPicker = ({\n inputProps,\n classes,\n value,\n onChange,\n externalHandlers,\n month,\n onMonthChange,\n ...props\n}: SingleDayPickerProps) => {\n const { onChange: externalOnChange, onFocus: externalOnFocus, ...restHandlers } = externalHandlers || {}\n\n const calendarRef = useRef<HTMLDivElement>(null)\n\n const { refs, floatingStyles } = useFloating({\n placement: 'bottom-end',\n middleware: [\n flip({\n boundary: 'clippingAncestors',\n crossAxis: false\n }),\n offset(0)\n ],\n whileElementsMounted: autoUpdate\n })\n\n const { calendar, ...restClasses } = classes || {}\n\n const [calendarOpen, setCalendarOpen] = useState<boolean>(false)\n\n const onCalendarOpenChange = () => {\n setCalendarOpen((prev) => !prev)\n }\n\n const date = getCurrentDate('single', value)\n\n const [visibleValue, setVisibleValue] = useState<string>(getInitialValue('single', value))\n\n useEffect(() => {\n if (value && !TypeGuards.isStringEmpty(value)) {\n setVisibleValue(getInitialValue('single', value))\n if (onMonthChange) onMonthChange(new Date(value))\n }\n }, [value])\n\n useClickOutside(calendarRef, () => setCalendarOpen(false))\n\n const onVisibleValueChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = event.target\n\n setVisibleValue(value)\n\n if (TypeGuards.isStringEmpty(value)) {\n return onChange('')\n }\n\n if (!SINGLE_VALIDATION_REGEX.test(value)) {\n return\n }\n\n const date = parse(value, DATE_VISIBLE_PATTERN, new Date())\n\n if (isValid(date)) {\n const isoDate = date.toISOString()\n\n onChange(isoDate)\n if (onMonthChange) onMonthChange(date)\n\n if (externalOnChange) externalOnChange(isoDate)\n }\n }\n\n const onDateChange = (newDate: Date) => {\n if (onMonthChange) onMonthChange(newDate)\n\n const isoDate = newDate.toISOString()\n\n onChange(isoDate)\n setVisibleValue(format(newDate, DATE_VISIBLE_PATTERN))\n setCalendarOpen(false)\n\n if (externalOnChange) externalOnChange(isoDate)\n }\n\n return (\n <div ref={refs.setReference} className={cn('relative w-full', classes?.container)}>\n <MaskInput\n mask={SINGLE_MASK}\n {...inputProps}\n {...restHandlers}\n classes={restClasses}\n value={visibleValue}\n onChange={onVisibleValueChange}\n autoComplete='off'\n onFocus={(event) => {\n setCalendarOpen(true)\n if (externalOnFocus) externalOnFocus(event)\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n onCalendarOpenChange()\n }\n }}\n attachmentProps={{\n disabled: inputProps.disabled,\n icon: <Icon name='general/calendar' className='text-icon-blue-grey-600' />,\n onClickIcon: onCalendarOpenChange,\n ...inputProps.attachmentProps\n }}\n dataLayers={props?.dataLayers}\n />\n {calendarOpen &&\n createPortal(\n <Calendar\n // @ts-expect-error asdf\n ref={mergeRefs(calendarRef, refs.setFloating)}\n {...props}\n required\n mode='single'\n style={{\n ...floatingStyles,\n width: 'max-content'\n }}\n month={month}\n onMonthChange={onMonthChange}\n selected={date}\n onSelect={onDateChange}\n className={cn(calendar)}\n data-id='calendar'\n />,\n document.body\n )}\n </div>\n )\n}\n"],"names":["SingleDayPicker","inputProps","classes","value","onChange","externalHandlers","month","onMonthChange","props","externalOnChange","externalOnFocus","restHandlers","calendarRef","useRef","refs","floatingStyles","useFloating","flip","offset","autoUpdate","calendar","restClasses","calendarOpen","setCalendarOpen","useState","onCalendarOpenChange","prev","date","getCurrentDate","visibleValue","setVisibleValue","getInitialValue","useEffect","TypeGuards","useClickOutside","onVisibleValueChange","event","SINGLE_VALIDATION_REGEX","parse","DATE_VISIBLE_PATTERN","isValid","isoDate","onDateChange","newDate","format","jsxs","cn","jsx","MaskInput","SINGLE_MASK","Icon","createPortal","Calendar","mergeRefs"],"mappings":"+5BAiDO,MAAMA,GAAkB,CAAC,CAC9B,WAAAC,EACA,QAAAC,EACA,MAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,MAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IAA4B,CAC1B,KAAM,CAAE,SAAUC,EAAkB,QAASC,EAAiB,GAAGC,CAAA,EAAiBN,GAAoB,CAAA,EAEhGO,EAAcC,EAAuB,IAAI,EAEzC,CAAE,KAAAC,EAAM,eAAAC,CAAA,EAAmBC,EAAY,CAC3C,UAAW,aACX,WAAY,CACVC,EAAK,CACH,SAAU,oBACV,UAAW,EAAA,CACZ,EACDC,EAAO,CAAC,CAAA,EAEV,qBAAsBC,CAAA,CACvB,EAEK,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAAgBnB,GAAW,CAAA,EAE1C,CAACoB,EAAcC,CAAe,EAAIC,EAAkB,EAAK,EAEzDC,EAAuB,IAAM,CACjCF,EAAiBG,GAAS,CAACA,CAAI,CACjC,EAEMC,EAAOC,EAAe,SAAUzB,CAAK,EAErC,CAAC0B,EAAcC,CAAe,EAAIN,EAAiBO,EAAgB,SAAU5B,CAAK,CAAC,EAEzF6B,EAAU,IAAM,CACV7B,GAAS,CAAC8B,EAAW,cAAc9B,CAAK,IAC1C2B,EAAgBC,EAAgB,SAAU5B,CAAK,CAAC,EAC5CI,GAAeA,EAAc,IAAI,KAAKJ,CAAK,CAAC,EAEpD,EAAG,CAACA,CAAK,CAAC,EAEV+B,EAAgBtB,EAAa,IAAMW,EAAgB,EAAK,CAAC,EAEzD,MAAMY,EAAwBC,GAA+C,CAC3E,KAAM,CAAE,MAAAjC,CAAAA,EAAUiC,EAAM,OAIxB,GAFAN,EAAgB3B,CAAK,EAEjB8B,EAAW,cAAc9B,CAAK,EAChC,OAAOC,EAAS,EAAE,EAGpB,GAAI,CAACiC,EAAwB,KAAKlC,CAAK,EACrC,OAGF,MAAMwB,EAAOW,EAAMnC,EAAOoC,EAAsB,IAAI,IAAM,EAE1D,GAAIC,EAAQb,CAAI,EAAG,CACjB,MAAMc,EAAUd,EAAK,YAAA,EAErBvB,EAASqC,CAAO,EACZlC,KAA6BoB,CAAI,EAEjClB,KAAmCgC,CAAO,CAChD,CACF,EAEMC,EAAgBC,GAAkB,CAClCpC,KAA6BoC,CAAO,EAExC,MAAMF,EAAUE,EAAQ,YAAA,EAExBvC,EAASqC,CAAO,EAChBX,EAAgBc,EAAOD,EAASJ,CAAoB,CAAC,EACrDhB,EAAgB,EAAK,EAEjBd,KAAmCgC,CAAO,CAChD,EAEA,OACEI,EAAC,MAAA,CAAI,IAAK/B,EAAK,aAAc,UAAWgC,EAAG,kBAAmB5C,GAAS,SAAS,EAC9E,SAAA,CAAA6C,EAACC,EAAA,CACC,KAAMC,EACL,GAAGhD,EACH,GAAGU,EACJ,QAASU,EACT,MAAOQ,EACP,SAAUM,EACV,aAAa,MACb,QAAUC,GAAU,CAClBb,EAAgB,EAAI,EAChBb,KAAiC0B,CAAK,CAC5C,EACA,UAAYA,GAAU,CAChBA,EAAM,MAAQ,SAChBX,EAAA,CAEJ,EACA,gBAAiB,CACf,SAAUxB,EAAW,SACrB,KAAM8C,EAACG,EAAA,CAAK,KAAK,mBAAmB,UAAU,0BAA0B,EACxE,YAAazB,EACb,GAAGxB,EAAW,eAAA,EAEhB,WAAYO,GAAO,UAAA,CAAA,EAEpBc,GACC6B,EACEJ,EAACK,EAAA,CAEC,IAAKC,EAAUzC,EAAaE,EAAK,WAAW,EAC3C,GAAGN,EACJ,SAAQ,GACR,KAAK,SACL,MAAO,CACL,GAAGO,EACH,MAAO,aAAA,EAET,MAAAT,EACA,cAAAC,EACA,SAAUoB,EACV,SAAUe,EACV,UAAWI,EAAG1B,CAAQ,EACtB,UAAQ,UAAA,CAAA,EAEV,SAAS,IAAA,CACX,EACJ,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sources":["../../../../../../../../lib/shared/ui/formElements/controlled/editor/ui/Editor.tsx"],"sourcesContent":["import { forwardRef, type ReactElement, useEffect } from 'react'\nimport { type FieldError } from 'react-hook-form'\nimport CharacterCount from '@tiptap/extension-character-count'\nimport { EditorContent, type EditorEvents, useEditor, type UseEditorOptions } from '@tiptap/react'\nimport {
|
|
1
|
+
{"version":3,"file":"Editor.js","sources":["../../../../../../../../lib/shared/ui/formElements/controlled/editor/ui/Editor.tsx"],"sourcesContent":["import { forwardRef, type ReactElement, useEffect } from 'react'\nimport { type FieldError } from 'react-hook-form'\nimport CharacterCount from '@tiptap/extension-character-count'\nimport { EditorContent, type EditorEvents, useEditor, type UseEditorOptions } from '@tiptap/react'\nimport { Toolbar } from './Toolbar'\nimport { type EditorControlClasses } from '$/shared/ui'\nimport { editorConfig } from '$/shared/ui/formElements/controlled/editor/model'\nimport { MessageView } from '$/shared/ui/formElements/ui'\nimport { cn } from '$/shared/utils'\ntype ExternalHandlers = {\n onUpdate?: (editor: EditorEvents['update']) => void\n}\n\ninterface EditorProps extends Partial<UseEditorOptions> {\n onChange: (value: string) => void\n value: string\n error?: FieldError\n classes?: EditorControlClasses\n externalHandlers?: ExternalHandlers\n label?: string\n helperText?: string | ReactElement\n /**\n * Лимит символов\n */\n limit?: number\n /**\n * Сделать текстовый редактор маленьким\n */\n small?: boolean\n}\n\ntype EditorRef = React.ElementRef<typeof EditorContent>\n\nconst DEFAULT_LIMIT = Number.MAX_SAFE_INTEGER\n\nexport const Editor = forwardRef<EditorRef, EditorProps>(\n (\n {\n onChange,\n value = '',\n label,\n limit,\n error,\n classes,\n editable,\n helperText,\n shouldRerenderOnTransaction = true,\n externalHandlers,\n small,\n ...props\n },\n ref\n ) => {\n const { onUpdate: externalOnUpdate } = externalHandlers || {}\n\n const editor = useEditor({\n extensions: [\n ...editorConfig,\n CharacterCount.configure({\n limit: limit ?? DEFAULT_LIMIT\n })\n ],\n editable: editable,\n content: value,\n parseOptions: {\n preserveWhitespace: true\n },\n onUpdate: (props) => {\n const { editor } = props\n const content = editor?.getText() ? editor?.getHTML() : ''\n onChange(content)\n\n if (externalOnUpdate) {\n externalOnUpdate(props)\n }\n },\n editorProps: {\n // TODO: спросить у Рустема\n // transformPastedText(text) {\n // return text.replace(/\\xA0/g, ' ')\n // },\n // transformPastedHTML(html) {\n // return html.replace(/\\xA0/g, ' ')\n // },\n attributes: {\n spellcheck: 'false',\n class: cn(\n 'p-4 outline-none bg-color-blue-grey-100 min-h-[240px] !static max-h-[500px] customScrollbar-y overflow-y-auto break-keep',\n classes?.editor,\n { 'max-h-[80px] min-h-full': small }\n )\n }\n },\n shouldRerenderOnTransaction,\n ...props\n })\n\n useEffect(() => {\n if (editor && editor.getHTML() !== value) {\n editor.commands.setContent(value)\n }\n }, [editor, value])\n\n if (!editor) {\n return null\n }\n\n return (\n <div className={cn('flex w-full flex-col', classes?.root)}>\n <div\n className={cn('relative flex w-full flex-col rounded-md border border-solid border-warm-grey-200', classes?.wrapper)}\n >\n <Toolbar editor={editor} />\n {!value && <p className={cn('absolute left-4 top-16 text-color-disabled', classes?.label)}>{label}</p>}\n <EditorContent ref={ref} editor={editor} />\n {limit && (\n <p className='absolute bottom-4 right-4 text-color-disabled'>\n {editor.storage.characterCount.characters()} / {limit} символов\n </p>\n )}\n </div>\n\n <MessageView\n className={classes?.message}\n intent={error?.message ? 'error' : 'simple'}\n text={error?.message || helperText}\n disabled={!editable}\n />\n </div>\n )\n }\n)\n"],"names":["DEFAULT_LIMIT","Editor","forwardRef","onChange","value","label","limit","error","classes","editable","helperText","shouldRerenderOnTransaction","externalHandlers","small","props","ref","externalOnUpdate","editor","useEditor","editorConfig","CharacterCount","content","cn","useEffect","jsxs","jsx","Toolbar","EditorContent","MessageView"],"mappings":"oZAiCA,MAAMA,EAAgB,OAAO,iBAEhBC,EAASC,EACpB,CACE,CACE,SAAAC,EACA,MAAAC,EAAQ,GACR,MAAAC,EACA,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,WAAAC,EACA,4BAAAC,EAA8B,GAC9B,iBAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,KAAM,CAAE,SAAUC,CAAA,EAAqBJ,GAAoB,CAAA,EAErDK,EAASC,EAAU,CACvB,WAAY,CACV,GAAGC,EACHC,EAAe,UAAU,CACvB,MAAOd,GAASN,CAAA,CACjB,CAAA,EAEH,SAAAS,EACA,QAASL,EACT,aAAc,CACZ,mBAAoB,EAAA,EAEtB,SAAWU,GAAU,CACnB,KAAM,CAAE,OAAAG,CAAAA,EAAWH,EACbO,EAAUJ,GAAQ,QAAA,EAAYA,GAAQ,UAAY,GACxDd,EAASkB,CAAO,EAEZL,GACFA,EAAiBF,CAAK,CAE1B,EACA,YAAa,CAQX,WAAY,CACV,WAAY,QACZ,MAAOQ,EACL,2HACAd,GAAS,OACT,CAAE,0BAA2BK,CAAA,CAAM,CACrC,CACF,EAEF,4BAAAF,EACA,GAAGG,CAAA,CACJ,EAQD,OANAS,EAAU,IAAM,CACVN,GAAUA,EAAO,QAAA,IAAcb,GACjCa,EAAO,SAAS,WAAWb,CAAK,CAEpC,EAAG,CAACa,EAAQb,CAAK,CAAC,EAEba,IAKF,MAAA,CAAI,UAAWK,EAAG,uBAAwBd,GAAS,IAAI,EACtD,SAAA,CAAAgB,EAAC,MAAA,CACC,UAAWF,EAAG,oFAAqFd,GAAS,OAAO,EAEnH,SAAA,CAAAiB,EAACC,GAAQ,OAAAT,EAAgB,EACxB,CAACb,GAASqB,EAAC,IAAA,CAAE,UAAWH,EAAG,6CAA8Cd,GAAS,KAAK,EAAI,SAAAH,CAAA,CAAM,EAClGoB,EAACE,EAAA,CAAc,IAAAZ,EAAU,OAAAE,CAAA,CAAgB,EACxCX,GACCkB,EAAC,IAAA,CAAE,UAAU,gDACV,SAAA,CAAAP,EAAO,QAAQ,eAAe,WAAA,EAAa,MAAIX,EAAM,WAAA,CAAA,CACxD,CAAA,CAAA,CAAA,EAIJmB,EAACG,EAAA,CACC,UAAWpB,GAAS,QACpB,OAAQD,GAAO,QAAU,QAAU,SACnC,KAAMA,GAAO,SAAWG,EACxB,SAAU,CAACD,CAAA,CAAA,CACb,EACF,EAxBO,IA0BX,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as l,Fragment as p,jsx as e}from"react/jsx-runtime";import{useState as d}from"react";import{Editor as x}from"./Editor.js";import{
|
|
1
|
+
import{jsxs as l,Fragment as p,jsx as e}from"react/jsx-runtime";import{useState as d}from"react";import{Editor as x}from"./Editor.js";import{cn as f}from"../../../../../utils/cn.js";import{Modal as u}from"../../../../modal/Modal.js";import{InputBase as g}from"../../../uncontrolled/input/Input.js";import{Icon as M}from"../../../../icon/Icon.js";import{MessageView as h}from"../../../ui/MessageView.js";const E=({label:n,classes:a,editable:s,helperText:t,field:o,error:r,...i})=>{const[c,m]=d(!1);return l(p,{children:[l("div",{className:"flex flex-1 flex-col",children:[e(g,{readOnly:!0,label:n,classes:{},...o,renderValues:()=>e("div",{className:f("customScrollbar-y peer max-h-[70px] w-full !overflow-auto truncate p-4 pb-[9px] pt-[27px]"),dangerouslySetInnerHTML:{__html:o.value}}),attachmentProps:{icon:e(M,{name:"general/edit",className:"size-5 text-color-tetriary"})},onClick:()=>s&&m(!0)}),e(h,{className:a?.message,intent:r?.message?"error":"simple",text:r?.message||t,disabled:!s})]}),e(u,{classes:{modal:"max-w-[700px]"},isModalOpen:c,closeModal:()=>m(!1),children:e(x,{...o,editable:s,error:r,helperText:t,classes:{editor:"min-h-[350px]",...a},...i})})]})};export{E as EditorModal};
|
|
2
2
|
//# sourceMappingURL=EditorModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorModal.js","sources":["../../../../../../../../lib/shared/ui/formElements/controlled/editor/ui/EditorModal.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { type ControllerRenderProps, type FieldError, type FieldValues } from 'react-hook-form'\nimport {
|
|
1
|
+
{"version":3,"file":"EditorModal.js","sources":["../../../../../../../../lib/shared/ui/formElements/controlled/editor/ui/EditorModal.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { type ControllerRenderProps, type FieldError, type FieldValues } from 'react-hook-form'\nimport { Editor } from './Editor'\nimport { Icon } from '$/shared/ui'\nimport { Modal } from '$/shared/ui'\nimport { InputBase } from '$/shared/ui'\nimport { type EditorControlProps } from '$/shared/ui'\nimport { MessageView } from '$/shared/ui/formElements/ui'\nimport { cn } from '$/shared/utils'\n\nexport interface EditorModalProps<T extends FieldValues>\n extends Pick<EditorControlProps<T>, 'label' | 'classes' | 'editable' | 'helperText'> {\n field: ControllerRenderProps<T>\n error?: FieldError\n}\n\nexport const EditorModal = <T extends FieldValues>({\n label,\n classes,\n editable,\n helperText,\n field,\n error,\n ...props\n}: EditorModalProps<T>) => {\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n return (\n <>\n <div className='flex flex-1 flex-col'>\n <InputBase\n readOnly\n label={label}\n classes={{}}\n {...field}\n renderValues={() => (\n <div\n className={cn('customScrollbar-y peer max-h-[70px] w-full !overflow-auto truncate p-4 pb-[9px] pt-[27px]')}\n dangerouslySetInnerHTML={{ __html: field.value }}\n />\n )}\n attachmentProps={{\n icon: <Icon name='general/edit' className='size-5 text-color-tetriary' />\n }}\n onClick={() => editable && setIsModalOpen(true)}\n />\n <MessageView\n className={classes?.message}\n intent={error?.message ? 'error' : 'simple'}\n text={error?.message || helperText}\n disabled={!editable}\n />\n </div>\n <Modal\n classes={{\n modal: 'max-w-[700px]'\n }}\n isModalOpen={isModalOpen}\n closeModal={() => setIsModalOpen(false)}\n >\n <Editor\n {...field}\n editable={editable}\n error={error}\n helperText={helperText}\n classes={{\n editor: 'min-h-[350px]',\n ...classes\n }}\n {...props}\n />\n </Modal>\n </>\n )\n}\n"],"names":["EditorModal","label","classes","editable","helperText","field","error","props","isModalOpen","setIsModalOpen","useState","jsxs","Fragment","jsx","InputBase","cn","Icon","MessageView","Modal","Editor"],"mappings":"mZAgBO,MAAMA,EAAc,CAAwB,CACjD,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,WAAAC,EACA,MAAAC,EACA,MAAAC,EACA,GAAGC,CACL,IAA2B,CACzB,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAS,EAAK,EAEpD,OACEC,EAAAC,EAAA,CACE,SAAA,CAAAD,EAAC,MAAA,CAAI,UAAU,uBACb,SAAA,CAAAE,EAACC,EAAA,CACC,SAAQ,GACR,MAAAb,EACA,QAAS,CAAA,EACR,GAAGI,EACJ,aAAc,IACZQ,EAAC,MAAA,CACC,UAAWE,EAAG,2FAA2F,EACzG,wBAAyB,CAAE,OAAQV,EAAM,KAAA,CAAM,CAAA,EAGnD,gBAAiB,CACf,KAAMQ,EAACG,EAAA,CAAK,KAAK,eAAe,UAAU,4BAAA,CAA6B,CAAA,EAEzE,QAAS,IAAMb,GAAYM,EAAe,EAAI,CAAA,CAAA,EAEhDI,EAACI,EAAA,CACC,UAAWf,GAAS,QACpB,OAAQI,GAAO,QAAU,QAAU,SACnC,KAAMA,GAAO,SAAWF,EACxB,SAAU,CAACD,CAAA,CAAA,CACb,EACF,EACAU,EAACK,EAAA,CACC,QAAS,CACP,MAAO,eAAA,EAET,YAAAV,EACA,WAAY,IAAMC,EAAe,EAAK,EAEtC,SAAAI,EAACM,EAAA,CACE,GAAGd,EACJ,SAAAF,EACA,MAAAG,EACA,WAAAF,EACA,QAAS,CACP,OAAQ,gBACR,GAAGF,CAAA,EAEJ,GAAGK,CAAA,CAAA,CACN,CAAA,CACF,EACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as m,jsx as r}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsxs as m,jsx as r}from"react/jsx-runtime";import{SetColor as t}from"./commands/SetColor.js";import{SetCoreCommands as e}from"./commands/SetCoreCommands.js";import{SetCustomLink as l}from"./commands/setCustomLink.js";import{SetFontSize as p}from"./commands/SetFontSize.js";import{SetHardBreak as s}from"./commands/SetHardBreak.js";import{SetHeadings as a}from"./commands/SetHeadings.js";const b=({editor:o})=>m("div",{className:"customScrollbar-y flex w-full items-center gap-2 overflow-x-auto bg-color-blue-grey-200 px-4 py-3",children:[r(e,{editor:o}),r(s,{editor:o}),r(t,{editor:o}),r(a,{editor:o}),r(l,{editor:o}),r(p,{editor:o})]});export{b as Toolbar};
|
|
2
2
|
//# sourceMappingURL=Toolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sources":["../../../../../../../../lib/shared/ui/formElements/controlled/editor/ui/Toolbar.tsx"],"sourcesContent":["import { type Editor } from '@tiptap/react'\nimport { SetColor
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sources":["../../../../../../../../lib/shared/ui/formElements/controlled/editor/ui/Toolbar.tsx"],"sourcesContent":["import { type Editor } from '@tiptap/react'\nimport { SetColor } from '$/shared/ui/formElements/controlled/editor/ui/commands/SetColor'\nimport { SetCoreCommands } from '$/shared/ui/formElements/controlled/editor/ui/commands/SetCoreCommands'\nimport { SetCustomLink } from '$/shared/ui/formElements/controlled/editor/ui/commands/setCustomLink'\nimport { SetFontSize } from '$/shared/ui/formElements/controlled/editor/ui/commands/SetFontSize'\nimport { SetHardBreak } from '$/shared/ui/formElements/controlled/editor/ui/commands/SetHardBreak'\nimport { SetHeadings } from '$/shared/ui/formElements/controlled/editor/ui/commands/SetHeadings'\n\ninterface ToolbarProps {\n editor: Editor\n}\nexport const Toolbar = ({ editor }: ToolbarProps) => {\n return (\n <div className='customScrollbar-y flex w-full items-center gap-2 overflow-x-auto bg-color-blue-grey-200 px-4 py-3'>\n <SetCoreCommands editor={editor} />\n <SetHardBreak editor={editor} />\n <SetColor editor={editor} />\n <SetHeadings editor={editor} />\n <SetCustomLink editor={editor} />\n <SetFontSize editor={editor} />\n </div>\n )\n}\n"],"names":["Toolbar","editor","jsxs","jsx","SetCoreCommands","SetHardBreak","SetColor","SetHeadings","SetCustomLink","SetFontSize"],"mappings":"0YAWO,MAAMA,EAAU,CAAC,CAAE,OAAAC,KAEtBC,EAAC,MAAA,CAAI,UAAU,oGACb,SAAA,CAAAC,EAACC,GAAgB,OAAAH,EAAgB,EACjCE,EAACE,GAAa,OAAAJ,EAAgB,EAC9BE,EAACG,GAAS,OAAAL,EAAgB,EAC1BE,EAACI,GAAY,OAAAN,EAAgB,EAC7BE,EAACK,GAAc,OAAAP,EAAgB,EAC/BE,EAACM,GAAY,OAAAR,CAAA,CAAgB,CAAA,EAC/B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Popover as t}from"../../../../../popover/Popover.js";import{editorAllowedColors as n}from"../../model/helper.js";import{cn as s}from"../../../../../../utils/cn.js";import{Icon as l}from"../../../../../icon/Icon.js";const p=({editor:o})=>r(t,{classes:{content:"w-full max-w-[500px] bg-color-blue-grey-200 border border-solid border-warm-grey-300",arrowIcon:"fill-dark-hover"},triggerElement:r("span",{title:"Добавить цвет текста",className:"flex size-7 cursor-pointer items-center justify-center rounded-sm text-color-secondary outline-none transition-colors hover:bg-color-primary-hover hover:text-color-white",children:r(l,{name:"editor/palette",className:"size-4"})}),children:r("div",{className:"grid grid-cols-6 gap-3",children:n.map(e=>r("button",{type:"button",style:{background:e},onClick:()=>o.chain().focus().setColor(e).run(),className:s("desk-body-regular-m size-6 cursor-pointer rounded-full border border-solid border-transparent text-left outline-none transition-transform hover:scale-105",{"border-warm-grey-300":e==="#FFFFFF"})},e))})});export{p as SetColor};
|
|
2
2
|
//# sourceMappingURL=SetColor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{headingsOptions as t}from"../../model/helper.js";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{headingsOptions as t}from"../../model/helper.js";import{cn as i}from"../../../../../../utils/cn.js";import{Icon as n}from"../../../../../icon/Icon.js";import{Popover as s}from"../../../../../popover/Popover.js";const h=({editor:r})=>e(s,{classes:{content:"w-full"},triggerElement:e("span",{title:"Добавить заголовок",className:"flex size-7 cursor-pointer items-center justify-center rounded-sm text-color-secondary outline-none transition-colors hover:bg-color-primary-hover hover:text-color-white",children:e(n,{name:"editor/heading",className:"size-4"})}),children:e("div",{className:"flex flex-1 gap-2",children:t.map(o=>e("div",{className:"flex items-center gap-4",children:e("button",{type:"button",onClick:()=>r.chain().focus().toggleHeading({level:o}).run(),className:i("desk-body-regular-l flex size-8 cursor-pointer items-center justify-center rounded-sm text-color-secondary outline-none transition-colors hover:bg-color-primary-hover hover:text-color-white",{"!bg-color-primary-hover !text-color-white":r.isActive("heading",{level:o})}),children:`H${o}`})},o))})});export{h as SetHeadings};
|
|
2
2
|
//# sourceMappingURL=SetHeadings.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as m}from"react/jsx-runtime";import{z as o}from"zod";import{
|
|
1
|
+
import{jsx as e,jsxs as m}from"react/jsx-runtime";import{z as o}from"zod";import{InputControl as a}from"../../../input/InputControl.js";import{SwitchControl as c}from"../../../switch/SwitchControl.js";import{useControlledForm as f}from"../../../../../../hooks/useControlledForm.js";import{cn as i}from"../../../../../../utils/cn.js";import{Popover as u}from"../../../../../popover/Popover.js";import{Button as p}from"../../../../../button/Button.js";import{Icon as d}from"../../../../../icon/Icon.js";const h=o.object({href:o.string().url(),underline:o.boolean().optional().default(!0)}),z=({editor:t})=>{const{control:n,handleSubmit:l}=f({schema:h,defaultValues:{href:"",underline:!0}}),s=r=>{t?.chain().focus().extendMarkRange("link").setLink({href:r?.href,rel:"noopener noreferrer",target:"_blank",class:i("text-color-primary-default",{"underline underline-offset-4":r?.underline})}).run()};return e("div",{children:e(u,{classes:{content:"w-[360px] max-w-full"},triggerElement:e("span",{title:"Добавить заголовок",className:i("flex size-7 cursor-pointer items-center justify-center rounded-sm text-color-secondary outline-none transition-colors hover:bg-color-primary-hover hover:text-color-white",{"!bg-color-primary-hover !text-color-white":t.isActive("link")}),children:e(d,{name:"editor/link",className:"size-4"})}),children:e("div",{className:"flex flex-1",children:m("form",{onSubmit:r=>{r.stopPropagation(),r.nativeEvent.stopPropagation(),l(s)(r)},className:"flex flex-1 flex-col gap-4",children:[e(a,{control:n,name:"href",label:"Введите ссылку"}),e(c,{control:n,name:"underline",children:"С подчеркиванием"}),e(p,{type:"submit",size:"sm",children:"Сохранить"})]})})})})};export{z as SetCustomLink};
|
|
2
2
|
//# sourceMappingURL=setCustomLink.js.map
|