@daisforge/ui 1.12.2 → 1.13.0
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/chunks/AnalyticalWidget-29tSeB0C.cjs +43 -0
- package/chunks/{AnalyticalWidget-CBi-2MtJ.mjs → AnalyticalWidget-DnHHyjnv.mjs} +144 -144
- package/chunks/{ApprovalCenter-ClCoA3cr.mjs → ApprovalCenter-BREfTiqK.mjs} +1 -1
- package/chunks/{ApprovalCenter-oACSjXxE.cjs → ApprovalCenter-BRUYlLoC.cjs} +1 -1
- package/chunks/{BlockTitle-DTaIqiFF.mjs → BlockTitle-BNm60_dx.mjs} +1 -1
- package/chunks/{BlockTitle-CylSY2DM.cjs → BlockTitle-CCvkcUe_.cjs} +1 -1
- package/chunks/{FiltersActions-D1aQXh5d.cjs → FiltersActions-49uNOjLq.cjs} +1 -1
- package/chunks/{FiltersActions-C3yWFtQT.mjs → FiltersActions-Be9uBM67.mjs} +3 -3
- package/chunks/{GridDND-BP_H26We.cjs → GridDND-BAHGzR5e.cjs} +1 -1
- package/chunks/{GridDND-rVSi0xX1.mjs → GridDND-rY1o5ItA.mjs} +1 -1
- package/chunks/ListOfFilters-BQyYeGQG.cjs +1 -0
- package/chunks/ListOfFilters-DRrawM8s.mjs +260 -0
- package/chunks/{MassActions-D4nb1_gx.mjs → MassActions-ByZr-Wjd.mjs} +2 -2
- package/chunks/{MassActions-BCgI08G9.cjs → MassActions-CxF6wvlS.cjs} +1 -1
- package/chunks/{PageTitle-B0tuR3fU.mjs → PageTitle-BLBN06Xe.mjs} +1 -1
- package/chunks/{PageTitle-BC0PnHgQ.cjs → PageTitle-j-pmmoZ9.cjs} +1 -1
- package/chunks/Stories-CO4lXbo6.cjs +1 -0
- package/chunks/Stories-COpgkk_M.mjs +673 -0
- package/chunks/Table-JFzBB9zK.cjs +31 -0
- package/chunks/{Table-Bj2se1hR.mjs → Table-XpsCe-vS.mjs} +1161 -1161
- package/chunks/TableCanvas-AwmzU0Jc.cjs +30 -0
- package/chunks/{TableCanvas-Y53zQ7M0.mjs → TableCanvas-BnwR-C1X.mjs} +2561 -2548
- package/chunks/TableGlide-BAH73oGi.cjs +1 -0
- package/chunks/{TableGlide-CuBMIM6Q.mjs → TableGlide-o9aqEk4d.mjs} +2184 -2126
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/AnalyticalWidgetChipsGroup.styled.d.ts +7 -0
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.mjs +1 -1
- package/components/AnalyticalWidget/index.cjs +1 -1
- package/components/AnalyticalWidget/index.mjs +1 -1
- package/components/ApprovalCenter/components/index.cjs +1 -1
- package/components/ApprovalCenter/components/index.mjs +1 -1
- package/components/ApprovalCenter/index.cjs +1 -1
- package/components/ApprovalCenter/index.mjs +1 -1
- package/components/AutocompleteSearch/index.cjs +1 -1
- package/components/AutocompleteSearch/index.mjs +1 -1
- package/components/BlockTitle/index.cjs +1 -1
- package/components/BlockTitle/index.mjs +1 -1
- package/components/BlockTitle/utils/index.cjs +1 -1
- package/components/BlockTitle/utils/index.mjs +1 -1
- package/components/Combobox/index.cjs +1 -1
- package/components/Combobox/index.mjs +1 -1
- package/components/GridDND/index.cjs +1 -1
- package/components/GridDND/index.mjs +1 -1
- package/components/GridDND/utils/index.cjs +1 -1
- package/components/GridDND/utils/index.mjs +1 -1
- package/components/ListOfFilters/index.cjs +1 -1
- package/components/ListOfFilters/index.mjs +1 -1
- package/components/ListOfFilters/useSyncTabsScrollArrows.d.ts +3 -0
- package/components/MassActions/hooks/index.cjs +1 -1
- package/components/MassActions/hooks/index.mjs +1 -1
- package/components/MassActions/index.cjs +1 -1
- package/components/MassActions/index.mjs +1 -1
- package/components/PageTitle/index.cjs +1 -1
- package/components/PageTitle/index.mjs +1 -1
- package/components/PageTitle/utils/index.cjs +1 -1
- package/components/PageTitle/utils/index.mjs +1 -1
- package/components/PopoverDF/index.cjs +1 -1
- package/components/PopoverDF/index.mjs +1 -1
- package/components/PopupDF/index.cjs +1 -1
- package/components/PopupDF/index.mjs +1 -1
- package/components/Stories/Stories.types.d.ts +1 -0
- package/components/Stories/components/StoriesBanner/index.cjs +1 -1
- package/components/Stories/components/StoriesBanner/index.mjs +1 -1
- package/components/Stories/components/StoriesContent/index.cjs +1 -1
- package/components/Stories/components/StoriesContent/index.mjs +1 -1
- package/components/Stories/components/StoriesPreview/index.cjs +1 -1
- package/components/Stories/components/StoriesPreview/index.mjs +1 -1
- package/components/Stories/components/StoriesProgress/index.cjs +1 -1
- package/components/Stories/components/StoriesProgress/index.mjs +1 -1
- package/components/Stories/components/StoriesViewer/index.cjs +1 -1
- package/components/Stories/components/StoriesViewer/index.mjs +1 -1
- package/components/Stories/index.cjs +1 -1
- package/components/Stories/index.mjs +1 -1
- package/components/Stories/store/StoriesContext.d.ts +1 -0
- package/components/Table/components/TableDropdown/index.cjs +1 -1
- package/components/Table/components/TableDropdown/index.mjs +1 -1
- package/components/Table/feature-collapse-table/index.cjs +1 -1
- package/components/Table/feature-collapse-table/index.mjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.mjs +1 -1
- package/components/Table/feature-column-control/index.cjs +1 -1
- package/components/Table/feature-column-control/index.mjs +1 -1
- package/components/Table/feature-columns-grouping/index.cjs +1 -1
- package/components/Table/feature-columns-grouping/index.mjs +1 -1
- package/components/Table/feature-context-menu/index.cjs +1 -1
- package/components/Table/feature-context-menu/index.mjs +1 -1
- package/components/Table/feature-edit/index.cjs +1 -1
- package/components/Table/feature-edit/index.mjs +1 -1
- package/components/Table/feature-filtering/combobox/index.cjs +1 -1
- package/components/Table/feature-filtering/combobox/index.mjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/Table/feature-filtering/index.cjs +1 -1
- package/components/Table/feature-filtering/index.mjs +1 -1
- package/components/Table/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/Table/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/Table/feature-infinity-scroll/index.cjs +1 -1
- package/components/Table/feature-infinity-scroll/index.mjs +1 -1
- package/components/Table/feature-key-text/index.cjs +1 -1
- package/components/Table/feature-key-text/index.mjs +1 -1
- package/components/Table/feature-pagination/index.cjs +1 -1
- package/components/Table/feature-pagination/index.mjs +1 -1
- package/components/Table/feature-right-sidebar/index.cjs +1 -1
- package/components/Table/feature-right-sidebar/index.mjs +1 -1
- package/components/Table/feature-row-detail/index.cjs +1 -1
- package/components/Table/feature-row-detail/index.mjs +1 -1
- package/components/Table/feature-row-instruments/index.cjs +1 -1
- package/components/Table/feature-row-instruments/index.mjs +1 -1
- package/components/Table/feature-row-size/index.cjs +1 -1
- package/components/Table/feature-row-size/index.mjs +1 -1
- package/components/Table/feature-rows-grouping/index.cjs +1 -1
- package/components/Table/feature-rows-grouping/index.mjs +1 -1
- package/components/Table/feature-searching/index.cjs +1 -1
- package/components/Table/feature-searching/index.mjs +1 -1
- package/components/Table/feature-select-row/index.cjs +1 -1
- package/components/Table/feature-select-row/index.mjs +1 -1
- package/components/Table/feature-sorting/index.cjs +1 -1
- package/components/Table/feature-sorting/index.mjs +1 -1
- package/components/Table/feature-table-settings/index.cjs +1 -1
- package/components/Table/feature-table-settings/index.mjs +1 -1
- package/components/Table/feature-tree/index.cjs +1 -1
- package/components/Table/feature-tree/index.mjs +1 -1
- package/components/Table/index.cjs +1 -1
- package/components/Table/index.mjs +1 -1
- package/components/Table/renders/formatCell/index.cjs +1 -1
- package/components/Table/renders/formatCell/index.mjs +1 -1
- package/components/Table/styles/index.cjs +1 -1
- package/components/Table/styles/index.mjs +1 -1
- package/components/Table/table-hooks/index.cjs +1 -1
- package/components/Table/table-hooks/index.mjs +1 -1
- package/components/Table/types/index.cjs +1 -1
- package/components/Table/types/index.mjs +1 -1
- package/components/Table/utils/index.cjs +1 -1
- package/components/Table/utils/index.mjs +1 -1
- package/components/Table/widgets/control-block/index.cjs +1 -1
- package/components/Table/widgets/control-block/index.mjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.cjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.mjs +1 -1
- package/components/Table/widgets/index.cjs +1 -1
- package/components/Table/widgets/index.mjs +1 -1
- package/components/Table/widgets/mass-actions/index.cjs +1 -1
- package/components/Table/widgets/mass-actions/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.mjs +2 -2
- package/components/TableCanvas/TableGlideInstance/type.d.ts +2 -0
- package/components/TableCanvas/TableGlideInstance/utils/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.mjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.cjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.mjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.cjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.mjs +1 -1
- package/components/TableCanvas/feature-cell-transfer/index.cjs +1 -1
- package/components/TableCanvas/feature-cell-transfer/index.mjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.cjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.mjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.mjs +1 -1
- package/components/TableCanvas/feature-column-control/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/index.mjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.mjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/useLastLvlColumnConfig.d.ts +1 -0
- package/components/TableCanvas/feature-content-state/index.cjs +1 -1
- package/components/TableCanvas/feature-content-state/index.mjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.cjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.mjs +1 -1
- package/components/TableCanvas/feature-edit/index.cjs +1 -1
- package/components/TableCanvas/feature-edit/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.cjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.mjs +1 -1
- package/components/TableCanvas/feature-key-text/index.cjs +1 -1
- package/components/TableCanvas/feature-key-text/index.mjs +1 -1
- package/components/TableCanvas/feature-notifications/index.cjs +1 -1
- package/components/TableCanvas/feature-notifications/index.mjs +1 -1
- package/components/TableCanvas/feature-pagination/index.cjs +1 -1
- package/components/TableCanvas/feature-pagination/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/context/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/context/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/utils/index.mjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/index.cjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/index.mjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.cjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.mjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.cjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.mjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.cjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.mjs +1 -1
- package/components/TableCanvas/feature-row-size/index.cjs +1 -1
- package/components/TableCanvas/feature-row-size/index.mjs +1 -1
- package/components/TableCanvas/feature-rows-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-rows-grouping/index.mjs +1 -1
- package/components/TableCanvas/feature-searching/index.cjs +1 -1
- package/components/TableCanvas/feature-searching/index.mjs +1 -1
- package/components/TableCanvas/feature-select-row/index.cjs +1 -1
- package/components/TableCanvas/feature-select-row/index.mjs +1 -1
- package/components/TableCanvas/feature-sorting/index.cjs +1 -1
- package/components/TableCanvas/feature-sorting/index.mjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.cjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.mjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.mjs +1 -1
- package/components/TableCanvas/feature-tooltip/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/utils/index.mjs +1 -1
- package/components/TableCanvas/feature-tree/index.cjs +1 -1
- package/components/TableCanvas/feature-tree/index.mjs +1 -1
- package/components/TableCanvas/index.cjs +1 -1
- package/components/TableCanvas/index.mjs +2 -2
- package/components/TableCanvas/renders/formatCell/index.cjs +1 -1
- package/components/TableCanvas/renders/formatCell/index.mjs +1 -1
- package/components/TableCanvas/styles/index.cjs +1 -1
- package/components/TableCanvas/styles/index.mjs +1 -1
- package/components/TableCanvas/table-hooks/index.cjs +1 -1
- package/components/TableCanvas/table-hooks/index.mjs +1 -1
- package/components/TableCanvas/types/column-config.type.d.ts +3 -0
- package/components/TableCanvas/types/columns-grouping.type.d.ts +8 -0
- package/components/TableCanvas/types/index.cjs +1 -1
- package/components/TableCanvas/types/index.mjs +1 -1
- package/components/TableCanvas/types/table-config.type.d.ts +3 -0
- package/components/TableCanvas/utils/index.cjs +1 -1
- package/components/TableCanvas/utils/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/compression/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/compression/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/right-side/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/right-side/index.mjs +1 -1
- package/components/TableCanvas/widgets/index.cjs +1 -1
- package/components/TableCanvas/widgets/index.mjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.mjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/index.mjs +1 -1
- package/components/TableContract/index.cjs +1 -1
- package/components/TableContract/index.mjs +1 -1
- package/components/TableGlide/TableGlide.d.ts +1 -1
- package/components/TableGlide/hooks/selection/index.cjs +1 -1
- package/components/TableGlide/hooks/selection/index.mjs +1 -1
- package/components/TableGlide/index.cjs +1 -1
- package/components/TableGlide/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/buttons/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/buttons/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.mjs +1 -1
- package/components/TableGlide/theming/index.cjs +1 -1
- package/components/TableGlide/theming/index.mjs +1 -1
- package/components/TableGlide/types.d.ts +3 -2
- package/components/Tooltip/index.cjs +1 -1
- package/components/Tooltip/index.mjs +1 -1
- package/components/TourWidget/index.cjs +1 -1
- package/components/TourWidget/index.mjs +1 -1
- package/components/Typography/index.cjs +1 -1
- package/components/Typography/index.mjs +1 -1
- package/components/Widget/index.cjs +1 -1
- package/components/Widget/index.mjs +1 -1
- package/formComponents/FormCombobox/index.cjs +1 -1
- package/formComponents/FormCombobox/index.mjs +1 -1
- package/formComponents/FormSwitch/index.cjs +1 -1
- package/formComponents/FormSwitch/index.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +11 -11
- package/layouts/FiltersActions/hooks/index.cjs +1 -1
- package/layouts/FiltersActions/hooks/index.mjs +1 -1
- package/layouts/FiltersActions/index.cjs +1 -1
- package/layouts/FiltersActions/index.mjs +1 -1
- package/package.json +6 -6
- package/chunks/AnalyticalWidget-fBDe37Ur.cjs +0 -43
- package/chunks/ListOfFilters-DgInAZFi.cjs +0 -1
- package/chunks/ListOfFilters-IEPKSKxx.mjs +0 -243
- package/chunks/Stories--_pE4YtR.mjs +0 -668
- package/chunks/Stories-Dvh6rMeV.cjs +0 -1
- package/chunks/Table-CnWVNNoW.cjs +0 -31
- package/chunks/TableCanvas-eYhmqTbp.cjs +0 -30
- package/chunks/TableGlide-CvMz7x7a.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("@salutejs/sdds-finai"),e=require("react/jsx-runtime"),W=require("react"),r=require("@salutejs/sdds-themes/tokens/sdds_finai"),y=require("@salutejs/plasma-icons"),l=require("styled-components"),h=require("./AnalyticalWidget-
|
|
1
|
+
"use strict";const o=require("@salutejs/sdds-finai"),e=require("react/jsx-runtime"),W=require("react"),r=require("@salutejs/sdds-themes/tokens/sdds_finai"),y=require("@salutejs/plasma-icons"),l=require("styled-components"),h=require("./AnalyticalWidget-29tSeB0C.cjs"),R=require("./EmptyState-BD6Ic-OX.cjs"),P={DEFAULT:e.jsx(y.IconDoneCircleFill,{size:"xs",color:r.surfaceTransparentSecondary}),WAIT:e.jsx(y.IconFocusOutline,{size:"xs",color:r.textWarning}),SUCCESSFUL:e.jsx(y.IconDoneCircleFill,{size:"xs",color:r.surfacePositive}),FAILURE:e.jsx(y.IconCloseCircleFill,{size:"xs",color:r.textNegative})},_={DEFAULT:e.jsx(y.IconDoneCircleFill,{size:"xs",color:r.surfaceTransparentSecondary}),WAIT:e.jsx(y.IconInProgressFill,{size:"xs",color:r.textWarning}),SUCCESSFUL:e.jsx(y.IconDoneCircleFill,{size:"xs",color:r.surfacePositive}),FAILURE:e.jsx(y.IconCloseCircleFill,{size:"xs",color:r.textNegative})},q={DEFAULT:"inactive",WAIT:"active",SUCCESSFUL:"completed",FAILURE:"completed"},Y={DEFAULT:"default",WAIT:"warning",SUCCESSFUL:"positive",FAILURE:"negative"},O={LIFE_CYCLE:"Жизненный цикл",HISTORY:"История изменений"},I=l.div.withConfig({displayName:"styled__ApprovalCenterContainer"})(["min-width:360px;min-height:600px;width:100%;height:100%;border-radius:16px;display:flex;flex-direction:column;flex:1;padding:12px 4px 12px 16px;background:",";",""],()=>r.surfaceSolidCard,({$css:s})=>s),V=l.div.withConfig({displayName:"styled__ApprovalCenterContentWrapper"})(["margin-top:20px;min-height:0;flex-direction:column;display:flex;flex:1;"]),X=l.div.withConfig({displayName:"styled__PreviewContainer"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;flex:1;"]),M=l.div.withConfig({displayName:"styled__LifeCycleContainer"})(["overflow-y:auto;min-height:0;flex:1;display:flex;flex-direction:column;padding-right:12px;"]),K=l.div.withConfig({displayName:"styled__LifeCycleAccordionTitle"})(["display:flex;align-items:center;gap:4px;"]),D=l.div.withConfig({displayName:"styled__LifeCycleStageContent"})(["> *:not(:first-child){margin-top:8px;}> .comment:not(:first-child){margin-top:2px;}"]),$=l.div.withConfig({displayName:"styled__LifeCycleAssignees"})(["display:flex;flex-direction:column;gap:8px;"]),B=l.div.withConfig({displayName:"styled__LifeCycleButtonsWrapper"})(["display:flex;gap:4px;"]),G=l.div.withConfig({displayName:"styled__LifeCycleStageButtonsWrapper"})(["display:flex;gap:16px;"]),E=l(o.Button).withConfig({displayName:"styled__LifeCycleStyledButton"})(["margin-top:8px;"]),J=l.div.withConfig({displayName:"styled__HistoryContainer"})(["display:flex;flex-direction:column;flex:1;min-height:0;gap:12px;overflow-y:auto;padding-right:12px;"]),Q=l.div.withConfig({displayName:"styled__HistoryDay"})(["display:flex;flex-direction:column;gap:12px;"]),Z=l.div.withConfig({displayName:"styled__HistoryDate"})(["top:0px;position:sticky;display:flex;justify-content:center;width:100%;"]),ee=l.div.withConfig({displayName:"styled__HistoryActions"})(["display:flex;flex-direction:column;gap:12px;"]);l(o.Badge).withConfig({displayName:"styled__HistoryStyledBadge"})(["flex-shrink:0;white-space:nowrap;"]);const T=s=>{const{historyByDay:p}=s;return e.jsx(J,{children:p.map(c=>e.jsxs(Q,{children:[e.jsx(Z,{children:e.jsx(o.Badge,{size:"m",text:c.date,view:"light",customColor:r.textSecondary,customBackgroundColor:r.surfaceSolidCard})}),e.jsx(ee,{children:c.actions.map(i=>e.jsx(o.Cell,{size:"s",title:i.title,subtitle:i.time,contentLeft:P[i.status]}))})]},c.date))})};function d(s){return s!=null}function g(s){return Array.isArray(s)&&s.length>0}function te(s){const p=new Intl.DateTimeFormat("ru-RU",{day:"numeric",month:"long"}),c=new Intl.DateTimeFormat("ru-RU",{hour:"2-digit",minute:"2-digit",hour12:!1}),i=new Date,t=new Map;for(const a of s){const n=new Date(a.actionDate),m=n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()?"Сегодня":p.format(n),v=c.format(n),u={status:a.status,title:a.actionTitle,time:v};let x=t.get(m);x===void 0&&(x=[],t.set(m,x)),x.push(u)}return Array.from(t,([a,n])=>({date:a,actions:n}))}const w=s=>{const{lifeCycle:p}=s,c=p.map(i=>({title:i.title,status:q[i.status],completedItemView:Y[i.status],content:d(i.stages)?e.jsxs(e.Fragment,{children:[e.jsx(o.Accordion,{size:"s",view:"clear",defaultActiveEventKey:i.stages.reduce((t,a,n)=>(a.open&&t.push(n),t),[]),children:i.stages.map((t,a)=>e.jsx(o.AccordionItem,{contentLeft:d(t.tooltip)?e.jsx(o.ViewContainer,{view:"onDark",children:e.jsx(o.Tooltip,{maxWidth:250,offset:[2,11],target:_[t.status],trigger:"hover",placement:"top-start",text:t.tooltip.text})}):_[t.status],title:e.jsxs(K,{children:[e.jsx(h.Typography,{variant:"TextS",children:t.title}),d(t.mark)&&(t.mark.tooltip?e.jsx(o.ViewContainer,{view:"onDark",children:e.jsx(o.Tooltip,{maxWidth:250,offset:[2,11],target:t.mark.icon,trigger:"hover",placement:"top-start",text:t.mark.tooltip.text})}):t.mark.icon)]}),eventKey:a,children:e.jsxs(D,{children:[g(t.assignee)&&e.jsx($,{children:t.assignee.map(n=>e.jsx(h.Typography,{variant:"TextXS",bold:!0,color:r.textPrimary,children:n},n))}),d(t.comment)&&e.jsx(h.Typography,{variant:"TextXS",color:r.textPrimary,children:t.comment}),g(t.buttons)&&e.jsx(G,{children:t.buttons.map(n=>e.jsx(o.LinkButton,{contentLeft:n.contentLeft,text:n.text,size:"xxs",onClick:n.onClick},n.text))}),d(t.actionTitle)&&e.jsx(h.Typography,{variant:"TextXS",color:r.textSecondary,children:t.actionTitle})]})},t.title))}),g(i.buttons)&&e.jsx(B,{children:i.buttons.map(t=>e.jsx(E,{text:t.text,contentLeft:t.contentLeft,view:"secondary",size:"xs"}))})]}):e.jsxs(D,{children:[e.jsx(h.Typography,{variant:"BodyXS",color:r.textSecondary,children:i.actionTitle}),g(i.buttons)&&e.jsx(B,{children:i.buttons.map(t=>e.jsx(E,{text:t.text,contentLeft:t.contentLeft,view:"secondary",size:"xs"}))})]})}));return e.jsx(M,{children:e.jsx(o.Steps,{style:{paddingTop:"1px",height:"auto"},items:c,orientation:"vertical",size:"m"})})},L=s=>{const{preview:p}=s,{button:c,loading:i}=p??{},t=d(c);return e.jsx(X,{children:i?e.jsx(o.Spinner,{size:"l",view:"default"}):e.jsx(R.EmptyState,{size:"m",variant:"no-content",buttons:t?[{props:{text:c.text,children:c.text,view:"accent",onClick:c.onClick},type:"link"}]:void 0})})},ie=s=>{const{className:p,$css:c,preview:i,tabs:t,lifeCycle:a,history:n}=s,[f,m]=W.useState(t.active),v=t.available.length>1,u=t.available[0],x=u==="LIFE_CYCLE",N=u==="HISTORY",b=f==="LIFE_CYCLE",z=f==="HISTORY",S=d(a),H=d(n),A=d(i),j=H?te(n):null,F=d(j);if(v){const k=e.jsxs(V,{children:[S&&b&&e.jsx(w,{lifeCycle:a}),F&&z&&e.jsx(T,{historyByDay:j})]});return e.jsx(I,{className:p,$css:c,children:A?e.jsx(L,{preview:i}):e.jsxs(e.Fragment,{children:[e.jsx(o.Tabs,{view:"divider",size:"s",orientation:"horizontal",children:t.available.map(C=>e.jsx(o.TabItem,{view:"divider",size:"s",selected:C===f,onClick:()=>m(C),children:O[C]},C))}),k]})})}const U=e.jsxs(e.Fragment,{children:[S&&x&&e.jsx(w,{lifeCycle:a}),F&&N&&e.jsx(T,{historyByDay:j})]});return e.jsx(I,{children:A?e.jsx(L,{preview:i}):U})};exports.ApprovalCenter=ie;exports.History=T;exports.LifeCycle=w;exports.Preview=L;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Box as T } from "../components/Box/index.mjs";
|
|
3
3
|
import { IconButton as x } from "@salutejs/sdds-finai";
|
|
4
|
-
import { T as b, a as S } from "./AnalyticalWidget-
|
|
4
|
+
import { T as b, a as S } from "./AnalyticalWidget-DnHHyjnv.mjs";
|
|
5
5
|
import { IconChevronLeft as u } from "@salutejs/plasma-icons";
|
|
6
6
|
import { d as C } from "./utils-C5SQhoON.mjs";
|
|
7
7
|
import { spacing2x as k, spacing12x as N, spacing8x as w, textSecondary as z } from "@salutejs/sdds-themes/tokens/sdds_finai";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),u=require("../components/Box/index.cjs"),S=require("@salutejs/sdds-finai"),x=require("./AnalyticalWidget-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),u=require("../components/Box/index.cjs"),S=require("@salutejs/sdds-finai"),x=require("./AnalyticalWidget-29tSeB0C.cjs"),b=require("@salutejs/plasma-icons"),C=require("./utils-DKi1rqLX.cjs"),c=require("@salutejs/sdds-themes/tokens/sdds_finai"),o=require("styled-components"),i={backButton:"block-title__back-button",container:"block-title__container",contentLeft:"block-title__content-left",description:"block-title__description",topBlock:"block-title__top-block",rightBlock:"block-title__right-block",title:"block-title__title",titleBlock:"block-title__title-block"},N=o.div.withConfig({displayName:"styled__BlockTitleContainer"})(["display:flex;justify-content:space-between;width:100%;gap:",";"],()=>c.spacing12x),z=o.div.withConfig({displayName:"styled__BlockTitleBlock"})(["display:flex;align-items:center;gap:",";margin-bottom:",";"],()=>c.spacing2x,()=>c.spacing2x),j=o.div.withConfig({displayName:"styled__BlockTitleCustomBlock"})(["width:100%;margin-bottom:",";"],()=>c.spacing2x),w=o(x.Typography).withConfig({displayName:"styled__BlockTitleDescription"})(["color:",";padding-left:",";"],()=>c.textSecondary,({$hasLeftSlot:t})=>t?"28px":"0"),v=o.div.withConfig({displayName:"styled__BlockTitleLeftBlock"})(["display:flex;min-height:100%;flex-direction:column;justify-content:end;"]),L=o.div.withConfig({displayName:"styled__BlockTitleRightBlock"})(["display:flex;min-height:100%;align-items:end;"]),I=o.div.withConfig({displayName:"styled__BlockTitleContentLeft"})(["display:flex;align-items:flex-start;gap:",";flex:1;min-width:0;"],()=>c.spacing8x),q=o.div.withConfig({displayName:"styled__BlockTitleBackButtonContainer"})(["margin-top:3px;"]),p={titleBadgeSize:"m",titleIconSize:"s"},A=t=>t==="H4"||t==="H5"?{titleBadgeSize:"s",titleIconSize:"xs"}:p,h=(t,l)=>({...l?A(t):p,buttonSize:l?"xs":"s",actionIconSize:l?"xs":"s"}),m=t=>t?"xxs":"xs",s=(t,l)=>typeof t=="function"?t(l):t,D=({title:t,titleSize:l="H2",titleLeftSlot:d,titleRightSlot:k,description:r,topSlot:_,rightSlot:T,disableMediaAdaptive:y=!1,containerProps:n,onBackButtonClick:B})=>{const{down:f}=C.useBreakpoint(),g=!y&&f("xl"),a=h(l,g);return e.jsxs(u.Box,{...n,className:`${i.container} ${(n==null?void 0:n.className)??""}`,children:[e.jsx(j,{className:i.topBlock,children:s(_,a)}),e.jsxs(N,{children:[e.jsxs(I,{className:i.contentLeft,children:[B&&e.jsx(q,{className:i.backButton,children:e.jsx(S.IconButton,{size:m(g),view:"secondary",pin:"circle-circle",onClick:B,children:e.jsx(b.IconChevronLeft,{size:"xs",color:"inherit"})})}),e.jsxs(v,{children:[e.jsxs(z,{className:i.titleBlock,children:[s(d,a),e.jsx(x.TypographyWithAutoTooltip,{tooltipText:typeof t=="string"?t:void 0,variant:l,className:i.title,lines:2,children:t}),s(k,a)]}),r&&e.jsx(w,{variant:"BodyS",className:i.description,$hasLeftSlot:!!d,children:r})]})]}),e.jsx(L,{className:i.rightBlock,children:s(T,a)})]})]})};exports.BlockTitle=D;exports.blockTitleClassNames=i;exports.getBlockTitleBackButtonSize=m;exports.getBlockTitleSlotSizes=h;exports.renderBlockTitleSlot=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const g=require("@salutejs/sdds-finai"),e=require("react/jsx-runtime"),C=require("@salutejs/plasma-icons"),d=require("styled-components"),z=require("../components/Box/index.cjs"),K=require("./Table-CnWVNNoW.cjs"),v=require("@salutejs/sdds-themes/tokens/sdds_finai"),p=require("react"),Q=require("../components/IconButton/index.cjs"),E=require("../components/TextField/index.cjs"),M=require("./AnalyticalWidget-fBDe37Ur.cjs"),P=require("./utils-DKi1rqLX.cjs"),Y=({dropdownProps:t,iconSize:i,...l})=>{const n=e.jsx(g.IconButton,{view:"secondary",size:"s",...l,children:e.jsx(C.IconDotsVerticalCenteredOutline,{size:i??"s"})});return t?e.jsx(g.Dropdown,{...t,children:n}):n},q=({visible:t,topLeft:i})=>e.jsx(z.Box,{$css:{position:"absolute",top:i??0,right:i??0,width:"8px",aspectRatio:"1",borderRadius:"50%",transition:K.DEFAULT_TABLE_TRANSITION,backgroundColor:"transparent",transform:"scale(0)",...t&&{backgroundColor:v.surfaceNegative,transform:"scale(1)"}}}),N=d(g.Button).attrs(({redSquare:t,hideLabel:i=!1,size:l,iconSize:n,children:r,...h})=>({view:"secondary",size:l??"s",type:"button",contentLeft:!i&&e.jsx(C.IconSettingsFilter,{size:n??"s"}),children:e.jsxs(e.Fragment,{children:[r??(!i&&(h.text??"Ещё фильтры")),i&&e.jsx(C.IconSettingsFilter,{size:n??"s"}),e.jsx(q,{visible:t})]}),...h})).withConfig({displayName:"FiltersButton__FiltersActionsFiltersButton"})(["position:relative;white-space:nowrap;"]),tt=p.lazy(()=>Promise.resolve().then(()=>require("./ListOfFilters-DgInAZFi.cjs")).then(t=>t.ListOfFilters_lazy)),H=d(tt).attrs(({paddingTop:t,...i})=>({paddingTop:8,...i})).withConfig({displayName:"ListOfFilters__FiltersActionsListOfFilters"})([""]),O=({visible:t,offset:i})=>e.jsx(q,{visible:t,topLeft:i}),$=d(g.Tabs).attrs(t=>({size:"xs",view:"filled",...t})).withConfig({displayName:"Tabs__FiltersActionsTabs"})(["&{margin:-2px;","}"],({$css:t})=>t),V=d(g.TabItem).attrs(t=>({size:"s",view:"default",...t})).withConfig({displayName:"Tabs__FiltersActionsTabItem"})(["&{","}"],({$css:t})=>t),A={borderRadiusM:()=>v.borderRadiusM,shadowDownHardS:()=>v.shadowDownHardS,surfaceSolidCard:()=>v.surfaceSolidCard},et=d(g.Popover).withConfig({displayName:"FiltersButtonWithPopover__StyledPopover"})(["& .popover-root{box-shadow:none;}& .resizable-container{}"]),it=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverContentContainer"})(["background-color:",";border-radius:",";box-shadow:",";min-width:360px;max-width:700px;max-height:80dvh;height:100%;box-sizing:border-box;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;"],A.surfaceSolidCard,A.borderRadiusM,A.shadowDownHardS),st=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverHeader"})(["display:flex;flex-direction:column;padding:16px 16px 12px 16px;flex-shrink:0;"]),ot=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverHeaderTop"})(["display:flex;justify-content:space-between;align-items:flex-start;flex-shrink:0;"]),nt=d.div.withConfig({displayName:"FiltersButtonWithPopover__HeaderText"})(["display:flex;flex-direction:column;gap:4px;margin-bottom:8px;"]),rt=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverMainContent"})(["overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:16px;min-height:40px;margin:12px 16px 16px 16px;"]),lt=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverFooter"})(["box-sizing:border-box;min-height:60px;padding:12px 16px 16px 16px;flex-shrink:0;display:flex;align-items:center;"]),R={minHeight:430,minWidth:360,maxWidth:700,maxHeight:typeof window<"u"?window.innerHeight*.8:600,defaultSize:{width:360,height:430},directions:["bottom-right","right","top-right"],icons:{topRight:null,bottomRight:e.jsx(C.IconResizeCorneredFill,{color:v.textTertiary}),bottomLeft:null,topLeft:null},hiddenIcons:["bottom-left","top-left","top-right"]},U=({title:t,subtitle:i,content:l,state:n,onClose:r,footer:h,redSquare:o=!1,popoverProps:u={},buttonProps:s,renderTarget:a,searchable:w,searchValue:F,onSearchChange:m,searchingProps:b,emptySearchContent:y})=>{const{resizable:c,...B}=u,_=(x=>x===!1?!1:x===!0||x==null?R:typeof x=="object"&&x!==null?{...R,...x}:R)(c),[I,k]=p.useState(!1),[S,T]=n??[I,k],Z=p.useCallback(()=>{T(!1),r==null||r()},[r,T]),J=p.useCallback(x=>{T(x),x||r==null||r()},[r,T]),W=p.useCallback(()=>{T(!S)},[S,T]);return e.jsx(et,{opened:S,onToggle:J,target:a?a({onClick:W,isOpen:S,isRedDotVisible:o,RedDot:O}):e.jsx(N,{redSquare:o,hideLabel:!1,iconSize:"s",...s,onClick:x=>{var L;(L=s==null?void 0:s.onClick)==null||L.call(s,x),W()}}),placement:"bottom-start",offset:[0,2],trigger:"click",hasArrow:!1,closeOnOverlayClick:!0,closeOnEsc:!0,isFocusTrapped:!0,usePortal:!0,animated:!0,resizable:_,...B,children:e.jsxs(it,{children:[e.jsxs(st,{children:[e.jsxs(ot,{children:[e.jsxs(nt,{children:[e.jsx(g.BodyM,{bold:!0,children:t}),i&&e.jsx(g.BodyXS,{color:v.textSecondary,children:i})]}),e.jsx(g.IconButton,{onClick:Z,size:"xs",view:"secondary",pin:"circle-circle",title:"Закрыть",style:{marginBottom:"8px"},children:e.jsx(C.IconClose,{size:"xs"})})]}),w&&e.jsx(E.TextFieldSearch,{value:F,onChange:x=>m==null?void 0:m(x.target.value),placeholder:"Поиск",...b})]}),e.jsx(rt,{children:y||l}),h&&e.jsx(lt,{children:h})]})})},at=d(g.LinkButton).attrs(t=>({view:"default",size:"s",text:"Сбросить фильтры",contentLeft:e.jsx(C.IconClose,{size:"xs",color:"inherit"}),style:{...t.style,visibility:t.isVisible?"visible":"hidden",pointerEvents:t.isVisible?"auto":"none"}})).withConfig({displayName:"ResetAllFiltersButton"})(["",""],({$css:t})=>t),ct=d(g.SegmentItem).attrs(t=>({size:"s",view:"primary",...t})).withConfig({displayName:"Segments__FiltersActionsSegmentItem"})(["&{","}"],({$css:t})=>t),dt=d(g.Switch).withConfig({displayName:"styled__StyledSwitch"})(["background:",";padding:",";border-radius:",";max-height:48px;"],({hasBackground:t})=>t?v.surfaceTransparentSecondary:"none",({hasBackground:t})=>t?"10px 14px":"auto",({hasBackground:t})=>t?"10px":"auto"),X=p.forwardRef(({hasBackground:t,size:i,...l},n)=>e.jsx(dt,{hasBackground:t,ref:n,size:t?"m":i,...l})),ut=({...t})=>e.jsx(X,{size:"m",toggleSize:"s",hasBackground:!0,...t}),ht=(t,i)=>{if(!t&&!i)return;const l=t&&{$css:t.split(" ").map((n,r)=>({[`& > *:nth-child(${r+1})`]:{width:n}})).reduce((n,r)=>({...n,...r}),{})};return d.css(["",";",";"],()=>l&&l.$css,()=>i&&i)},pt=d(z.Box).withConfig({displayName:"styled__StyledContainer"})(["width:100%;display:flex;align-items:flex-start;gap:16px;& > div:first-child{width:100%;}"]),G=d.div.withConfig({displayName:"styled__StyledCard"})(["padding-block:8px;border-radius:",";"],()=>v.borderRadiusL),ft=d(G).withConfig({displayName:"styled__StyledButtonsBlock"})(["display:flex;column-gap:8px;flex-shrink:0;margin-left:auto;padding-left:24px;"]),xt=d(z.Box).withConfig({displayName:"styled__StyledMainBlock"})(["display:flex;gap:8px;align-items:center;max-height:40px;"]),f=({mainBlock:t,listOfFilters:i,activeButtonsBlock:l,mainBlockElementsWidth:n,containerProps:r,mainBlockProps:{$css:h,ref:o,...u}={},onResize:s})=>{const a=p.useRef(null),w=p.useRef(null),F=p.useRef(null);return p.useLayoutEffect(()=>{if(!s)return;const m=a.current,b=w.current,y=F.current;if(!m||!b)return;const c={containerWidth:0,mainBlockWidth:0,buttonsBlockWidth:0,availableMainBlockWidth:0},B=()=>{const _=m.getBoundingClientRect().width,I=b.getBoundingClientRect().width,k=y?y.getBoundingClientRect().width:0,S=I;c.containerWidth=_,c.mainBlockWidth=I,c.buttonsBlockWidth=k,c.availableMainBlockWidth=S,s({...c})},j=P.createSafeResizeObserver(()=>{B()});return j.observe(m),j.observe(b),y&&j.observe(y),B(),()=>{j.disconnect()}},[s]),e.jsx(pt,{ref:a,...r,children:e.jsxs(G,{children:[e.jsxs(xt,{$css:ht(n,h),...u,ref:P.mergeRefs(o,w),children:[t,l&&e.jsx(ft,{ref:F,children:l})]}),i]})})};f.FiltersButton=N;f.DotsIconButton=Q.IconButtonDots;f.ListOfFilters=H;f.TextFieldSearch=E.TextFieldSearch;f.Tabs=$;f.TabItem=V;f.SegmentItem=ct;f.Tooltip=M.TooltipList;f.TooltipList=M.TooltipList;f.FilterPopover=U;f.FiltersButtonWithPopover=U;f.ResetAllFiltersButton=at;f.SwitcherFilter=ut;f.RedDot=O;function D(t,i,l){const{visible:n=[],inOverlay:r=[],hidden:h=[],modifications:o={},customActions:u={}}=l,s=new Set(n),a=new Set(r),w=new Set(h),F=t.filter(c=>s.has(c.id)),m=t.filter(c=>a.has(c.id)),b=t.filter(c=>w.has(c.id)),y=[];return n.forEach(c=>{y.push({type:"show",targetId:c,payload:null})}),r.forEach(c=>{y.push({type:"moveToOverlay",targetId:c,payload:null})}),h.forEach(c=>{y.push({type:"hide",targetId:c,payload:null})}),Object.entries(o).forEach(([c,B])=>{y.push({type:"modify",targetId:c,payload:B})}),{visibleItems:F,overlayItems:m,hiddenItems:b,modifications:o,actions:y,activeBreakpoint:i,hasOverlayItems:m.length>0,hasModifications:Object.keys(o).length>0,customActions:u}}const gt=({items:t,width:i,breakpoints:l})=>{const n=p.useMemo(()=>{const o=Object.entries(l).map(([s,a])=>({breakpoint:Number(s),config:a})).sort((s,a)=>a.breakpoint-s.breakpoint),u=o.find(({breakpoint:s})=>i>=s);if(!u){const s=o[o.length-1];return D(t,(s==null?void 0:s.breakpoint)||0,(s==null?void 0:s.config)||{visible:[],inOverlay:[],hidden:[]})}return D(t,u.breakpoint,u.config)},[t,i,l]),r=p.useCallback((o,u)=>{if(!o)return{};const s={...o.style};return o.width?s.width=o.width:o.widthPercent&&u?s.width=`${u*o.widthPercent/100}px`:o.widthPercent&&(s.width=`${o.widthPercent}%`),s},[]),h=p.useCallback((o,u)=>o.some(s=>{const a=u[s.id];return a===void 0?!1:Array.isArray(a)?a.length>0:typeof a=="boolean"?a===!0:typeof a=="string"?a!=="":typeof a=="number"?a!==0:!!a}),[]);return{...n,getItemStyle:r,hasActiveFilters:h}},yt=()=>d.css(v.bodyXS),mt=d.div.withConfig({displayName:"Tooltip__StyledTooltipContent"})(["color:",";"," & > ul{padding-top:1px;display:flex;flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;}& li{padding-left:12px;position:relative;&::before{content:'•';position:absolute;left:2px;}}"],()=>v.inverseTextPrimary,()=>yt()),vt=({groupLabel:t,items:i})=>e.jsxs(mt,{children:[e.jsx("span",{children:t}),e.jsx("ul",{children:i.map(l=>e.jsx("li",{children:l}))})]}),bt=({groupLabel:t,items:i,children:l,...n})=>{const[r,h]=p.useState(!1),o=i.length>0;return p.useEffect(()=>{if(!o){h(!0);const u=setTimeout(()=>{h(!1)},0);return()=>clearTimeout(u)}},[o]),e.jsx(g.Tooltip,{usePortal:!0,trigger:o?(n==null?void 0:n.trigger)??"hover":"none",text:e.jsx(vt,{groupLabel:t,items:i}),size:"s",...n,children:l},`tooltip-${r}`)};exports.FiltersActions=f;exports.FiltersActionsDotsIconButton=Y;exports.FiltersActionsFiltersButton=N;exports.FiltersActionsListOfFilters=H;exports.FiltersActionsTabItem=V;exports.FiltersActionsTabs=$;exports.FiltersActionsTooltip=bt;exports.RedDot=O;exports.Switch=X;exports.useAdaptiveFilters=gt;
|
|
1
|
+
"use strict";const g=require("@salutejs/sdds-finai"),e=require("react/jsx-runtime"),C=require("@salutejs/plasma-icons"),d=require("styled-components"),z=require("../components/Box/index.cjs"),K=require("./Table-JFzBB9zK.cjs"),v=require("@salutejs/sdds-themes/tokens/sdds_finai"),p=require("react"),Q=require("../components/IconButton/index.cjs"),E=require("../components/TextField/index.cjs"),M=require("./AnalyticalWidget-29tSeB0C.cjs"),P=require("./utils-DKi1rqLX.cjs"),Y=({dropdownProps:t,iconSize:i,...l})=>{const n=e.jsx(g.IconButton,{view:"secondary",size:"s",...l,children:e.jsx(C.IconDotsVerticalCenteredOutline,{size:i??"s"})});return t?e.jsx(g.Dropdown,{...t,children:n}):n},q=({visible:t,topLeft:i})=>e.jsx(z.Box,{$css:{position:"absolute",top:i??0,right:i??0,width:"8px",aspectRatio:"1",borderRadius:"50%",transition:K.DEFAULT_TABLE_TRANSITION,backgroundColor:"transparent",transform:"scale(0)",...t&&{backgroundColor:v.surfaceNegative,transform:"scale(1)"}}}),N=d(g.Button).attrs(({redSquare:t,hideLabel:i=!1,size:l,iconSize:n,children:r,...h})=>({view:"secondary",size:l??"s",type:"button",contentLeft:!i&&e.jsx(C.IconSettingsFilter,{size:n??"s"}),children:e.jsxs(e.Fragment,{children:[r??(!i&&(h.text??"Ещё фильтры")),i&&e.jsx(C.IconSettingsFilter,{size:n??"s"}),e.jsx(q,{visible:t})]}),...h})).withConfig({displayName:"FiltersButton__FiltersActionsFiltersButton"})(["position:relative;white-space:nowrap;"]),tt=p.lazy(()=>Promise.resolve().then(()=>require("./ListOfFilters-BQyYeGQG.cjs")).then(t=>t.ListOfFilters_lazy)),H=d(tt).attrs(({paddingTop:t,...i})=>({paddingTop:8,...i})).withConfig({displayName:"ListOfFilters__FiltersActionsListOfFilters"})([""]),O=({visible:t,offset:i})=>e.jsx(q,{visible:t,topLeft:i}),$=d(g.Tabs).attrs(t=>({size:"xs",view:"filled",...t})).withConfig({displayName:"Tabs__FiltersActionsTabs"})(["&{margin:-2px;","}"],({$css:t})=>t),V=d(g.TabItem).attrs(t=>({size:"s",view:"default",...t})).withConfig({displayName:"Tabs__FiltersActionsTabItem"})(["&{","}"],({$css:t})=>t),A={borderRadiusM:()=>v.borderRadiusM,shadowDownHardS:()=>v.shadowDownHardS,surfaceSolidCard:()=>v.surfaceSolidCard},et=d(g.Popover).withConfig({displayName:"FiltersButtonWithPopover__StyledPopover"})(["& .popover-root{box-shadow:none;}& .resizable-container{}"]),it=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverContentContainer"})(["background-color:",";border-radius:",";box-shadow:",";min-width:360px;max-width:700px;max-height:80dvh;height:100%;box-sizing:border-box;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;"],A.surfaceSolidCard,A.borderRadiusM,A.shadowDownHardS),st=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverHeader"})(["display:flex;flex-direction:column;padding:16px 16px 12px 16px;flex-shrink:0;"]),ot=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverHeaderTop"})(["display:flex;justify-content:space-between;align-items:flex-start;flex-shrink:0;"]),nt=d.div.withConfig({displayName:"FiltersButtonWithPopover__HeaderText"})(["display:flex;flex-direction:column;gap:4px;margin-bottom:8px;"]),rt=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverMainContent"})(["overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:16px;min-height:40px;margin:12px 16px 16px 16px;"]),lt=d.div.withConfig({displayName:"FiltersButtonWithPopover__PopoverFooter"})(["box-sizing:border-box;min-height:60px;padding:12px 16px 16px 16px;flex-shrink:0;display:flex;align-items:center;"]),R={minHeight:430,minWidth:360,maxWidth:700,maxHeight:typeof window<"u"?window.innerHeight*.8:600,defaultSize:{width:360,height:430},directions:["bottom-right","right","top-right"],icons:{topRight:null,bottomRight:e.jsx(C.IconResizeCorneredFill,{color:v.textTertiary}),bottomLeft:null,topLeft:null},hiddenIcons:["bottom-left","top-left","top-right"]},U=({title:t,subtitle:i,content:l,state:n,onClose:r,footer:h,redSquare:o=!1,popoverProps:u={},buttonProps:s,renderTarget:a,searchable:w,searchValue:F,onSearchChange:m,searchingProps:b,emptySearchContent:y})=>{const{resizable:c,...B}=u,_=(x=>x===!1?!1:x===!0||x==null?R:typeof x=="object"&&x!==null?{...R,...x}:R)(c),[I,k]=p.useState(!1),[S,T]=n??[I,k],Z=p.useCallback(()=>{T(!1),r==null||r()},[r,T]),J=p.useCallback(x=>{T(x),x||r==null||r()},[r,T]),W=p.useCallback(()=>{T(!S)},[S,T]);return e.jsx(et,{opened:S,onToggle:J,target:a?a({onClick:W,isOpen:S,isRedDotVisible:o,RedDot:O}):e.jsx(N,{redSquare:o,hideLabel:!1,iconSize:"s",...s,onClick:x=>{var L;(L=s==null?void 0:s.onClick)==null||L.call(s,x),W()}}),placement:"bottom-start",offset:[0,2],trigger:"click",hasArrow:!1,closeOnOverlayClick:!0,closeOnEsc:!0,isFocusTrapped:!0,usePortal:!0,animated:!0,resizable:_,...B,children:e.jsxs(it,{children:[e.jsxs(st,{children:[e.jsxs(ot,{children:[e.jsxs(nt,{children:[e.jsx(g.BodyM,{bold:!0,children:t}),i&&e.jsx(g.BodyXS,{color:v.textSecondary,children:i})]}),e.jsx(g.IconButton,{onClick:Z,size:"xs",view:"secondary",pin:"circle-circle",title:"Закрыть",style:{marginBottom:"8px"},children:e.jsx(C.IconClose,{size:"xs"})})]}),w&&e.jsx(E.TextFieldSearch,{value:F,onChange:x=>m==null?void 0:m(x.target.value),placeholder:"Поиск",...b})]}),e.jsx(rt,{children:y||l}),h&&e.jsx(lt,{children:h})]})})},at=d(g.LinkButton).attrs(t=>({view:"default",size:"s",text:"Сбросить фильтры",contentLeft:e.jsx(C.IconClose,{size:"xs",color:"inherit"}),style:{...t.style,visibility:t.isVisible?"visible":"hidden",pointerEvents:t.isVisible?"auto":"none"}})).withConfig({displayName:"ResetAllFiltersButton"})(["",""],({$css:t})=>t),ct=d(g.SegmentItem).attrs(t=>({size:"s",view:"primary",...t})).withConfig({displayName:"Segments__FiltersActionsSegmentItem"})(["&{","}"],({$css:t})=>t),dt=d(g.Switch).withConfig({displayName:"styled__StyledSwitch"})(["background:",";padding:",";border-radius:",";max-height:48px;"],({hasBackground:t})=>t?v.surfaceTransparentSecondary:"none",({hasBackground:t})=>t?"10px 14px":"auto",({hasBackground:t})=>t?"10px":"auto"),X=p.forwardRef(({hasBackground:t,size:i,...l},n)=>e.jsx(dt,{hasBackground:t,ref:n,size:t?"m":i,...l})),ut=({...t})=>e.jsx(X,{size:"m",toggleSize:"s",hasBackground:!0,...t}),ht=(t,i)=>{if(!t&&!i)return;const l=t&&{$css:t.split(" ").map((n,r)=>({[`& > *:nth-child(${r+1})`]:{width:n}})).reduce((n,r)=>({...n,...r}),{})};return d.css(["",";",";"],()=>l&&l.$css,()=>i&&i)},pt=d(z.Box).withConfig({displayName:"styled__StyledContainer"})(["width:100%;display:flex;align-items:flex-start;gap:16px;& > div:first-child{width:100%;}"]),G=d.div.withConfig({displayName:"styled__StyledCard"})(["padding-block:8px;border-radius:",";"],()=>v.borderRadiusL),ft=d(G).withConfig({displayName:"styled__StyledButtonsBlock"})(["display:flex;column-gap:8px;flex-shrink:0;margin-left:auto;padding-left:24px;"]),xt=d(z.Box).withConfig({displayName:"styled__StyledMainBlock"})(["display:flex;gap:8px;align-items:center;max-height:40px;"]),f=({mainBlock:t,listOfFilters:i,activeButtonsBlock:l,mainBlockElementsWidth:n,containerProps:r,mainBlockProps:{$css:h,ref:o,...u}={},onResize:s})=>{const a=p.useRef(null),w=p.useRef(null),F=p.useRef(null);return p.useLayoutEffect(()=>{if(!s)return;const m=a.current,b=w.current,y=F.current;if(!m||!b)return;const c={containerWidth:0,mainBlockWidth:0,buttonsBlockWidth:0,availableMainBlockWidth:0},B=()=>{const _=m.getBoundingClientRect().width,I=b.getBoundingClientRect().width,k=y?y.getBoundingClientRect().width:0,S=I;c.containerWidth=_,c.mainBlockWidth=I,c.buttonsBlockWidth=k,c.availableMainBlockWidth=S,s({...c})},j=P.createSafeResizeObserver(()=>{B()});return j.observe(m),j.observe(b),y&&j.observe(y),B(),()=>{j.disconnect()}},[s]),e.jsx(pt,{ref:a,...r,children:e.jsxs(G,{children:[e.jsxs(xt,{$css:ht(n,h),...u,ref:P.mergeRefs(o,w),children:[t,l&&e.jsx(ft,{ref:F,children:l})]}),i]})})};f.FiltersButton=N;f.DotsIconButton=Q.IconButtonDots;f.ListOfFilters=H;f.TextFieldSearch=E.TextFieldSearch;f.Tabs=$;f.TabItem=V;f.SegmentItem=ct;f.Tooltip=M.TooltipList;f.TooltipList=M.TooltipList;f.FilterPopover=U;f.FiltersButtonWithPopover=U;f.ResetAllFiltersButton=at;f.SwitcherFilter=ut;f.RedDot=O;function D(t,i,l){const{visible:n=[],inOverlay:r=[],hidden:h=[],modifications:o={},customActions:u={}}=l,s=new Set(n),a=new Set(r),w=new Set(h),F=t.filter(c=>s.has(c.id)),m=t.filter(c=>a.has(c.id)),b=t.filter(c=>w.has(c.id)),y=[];return n.forEach(c=>{y.push({type:"show",targetId:c,payload:null})}),r.forEach(c=>{y.push({type:"moveToOverlay",targetId:c,payload:null})}),h.forEach(c=>{y.push({type:"hide",targetId:c,payload:null})}),Object.entries(o).forEach(([c,B])=>{y.push({type:"modify",targetId:c,payload:B})}),{visibleItems:F,overlayItems:m,hiddenItems:b,modifications:o,actions:y,activeBreakpoint:i,hasOverlayItems:m.length>0,hasModifications:Object.keys(o).length>0,customActions:u}}const gt=({items:t,width:i,breakpoints:l})=>{const n=p.useMemo(()=>{const o=Object.entries(l).map(([s,a])=>({breakpoint:Number(s),config:a})).sort((s,a)=>a.breakpoint-s.breakpoint),u=o.find(({breakpoint:s})=>i>=s);if(!u){const s=o[o.length-1];return D(t,(s==null?void 0:s.breakpoint)||0,(s==null?void 0:s.config)||{visible:[],inOverlay:[],hidden:[]})}return D(t,u.breakpoint,u.config)},[t,i,l]),r=p.useCallback((o,u)=>{if(!o)return{};const s={...o.style};return o.width?s.width=o.width:o.widthPercent&&u?s.width=`${u*o.widthPercent/100}px`:o.widthPercent&&(s.width=`${o.widthPercent}%`),s},[]),h=p.useCallback((o,u)=>o.some(s=>{const a=u[s.id];return a===void 0?!1:Array.isArray(a)?a.length>0:typeof a=="boolean"?a===!0:typeof a=="string"?a!=="":typeof a=="number"?a!==0:!!a}),[]);return{...n,getItemStyle:r,hasActiveFilters:h}},yt=()=>d.css(v.bodyXS),mt=d.div.withConfig({displayName:"Tooltip__StyledTooltipContent"})(["color:",";"," & > ul{padding-top:1px;display:flex;flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;}& li{padding-left:12px;position:relative;&::before{content:'•';position:absolute;left:2px;}}"],()=>v.inverseTextPrimary,()=>yt()),vt=({groupLabel:t,items:i})=>e.jsxs(mt,{children:[e.jsx("span",{children:t}),e.jsx("ul",{children:i.map(l=>e.jsx("li",{children:l}))})]}),bt=({groupLabel:t,items:i,children:l,...n})=>{const[r,h]=p.useState(!1),o=i.length>0;return p.useEffect(()=>{if(!o){h(!0);const u=setTimeout(()=>{h(!1)},0);return()=>clearTimeout(u)}},[o]),e.jsx(g.Tooltip,{usePortal:!0,trigger:o?(n==null?void 0:n.trigger)??"hover":"none",text:e.jsx(vt,{groupLabel:t,items:i}),size:"s",...n,children:l},`tooltip-${r}`)};exports.FiltersActions=f;exports.FiltersActionsDotsIconButton=Y;exports.FiltersActionsFiltersButton=N;exports.FiltersActionsListOfFilters=H;exports.FiltersActionsTabItem=V;exports.FiltersActionsTabs=$;exports.FiltersActionsTooltip=bt;exports.RedDot=O;exports.Switch=X;exports.useAdaptiveFilters=gt;
|
|
@@ -3,12 +3,12 @@ import { jsx as o, jsxs as y, Fragment as lt } from "react/jsx-runtime";
|
|
|
3
3
|
import { IconDotsVerticalCenteredOutline as at, IconSettingsFilter as W, IconClose as P, IconResizeCorneredFill as dt } from "@salutejs/plasma-icons";
|
|
4
4
|
import c, { css as D } from "styled-components";
|
|
5
5
|
import { Box as A } from "../components/Box/index.mjs";
|
|
6
|
-
import { D as ct } from "./Table-
|
|
6
|
+
import { D as ct } from "./Table-XpsCe-vS.mjs";
|
|
7
7
|
import { surfaceNegative as pt, textSecondary as ht, surfaceSolidCard as ft, borderRadiusM as ut, shadowDownHardS as mt, textTertiary as gt, surfaceTransparentSecondary as yt, borderRadiusL as xt, inverseTextPrimary as vt, bodyXS as wt } from "@salutejs/sdds-themes/tokens/sdds_finai";
|
|
8
8
|
import { lazy as bt, useState as M, useCallback as T, forwardRef as Ft, useRef as I, useLayoutEffect as St, useMemo as Bt, useEffect as Tt } from "react";
|
|
9
9
|
import { IconButtonDots as Ct } from "../components/IconButton/index.mjs";
|
|
10
10
|
import { TextFieldSearch as H } from "../components/TextField/index.mjs";
|
|
11
|
-
import { c as j } from "./AnalyticalWidget-
|
|
11
|
+
import { c as j } from "./AnalyticalWidget-DnHHyjnv.mjs";
|
|
12
12
|
import { c as _t, q as kt } from "./utils-C5SQhoON.mjs";
|
|
13
13
|
const ce = ({
|
|
14
14
|
dropdownProps: t,
|
|
@@ -54,7 +54,7 @@ const ce = ({
|
|
|
54
54
|
...h
|
|
55
55
|
})).withConfig({
|
|
56
56
|
displayName: "FiltersButton__FiltersActionsFiltersButton"
|
|
57
|
-
})(["position:relative;white-space:nowrap;"]), It = bt(() => import("./ListOfFilters-
|
|
57
|
+
})(["position:relative;white-space:nowrap;"]), It = bt(() => import("./ListOfFilters-DRrawM8s.mjs").then((t) => t.a)), Rt = c(It).attrs(({
|
|
58
58
|
paddingTop: t,
|
|
59
59
|
...e
|
|
60
60
|
}) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const P=require("react/jsx-runtime");require("react-grid-layout/css/styles.css");const ht=require("../components/IconButton/index.cjs"),l=require("react"),ze=require("./AnalyticalWidget-fBDe37Ur.cjs"),bt=require("react-grid-layout"),gt=require("./utils-DKi1rqLX.cjs"),L=require("@salutejs/sdds-themes/tokens/sdds_finai"),ye=require("styled-components"),z={gridItemWrapper:"grid-dnd__item-wrapper",gridItem:"grid-dnd__item",dragHandle:"grid-dnd__drag-handle",noDrag:"grid-dnd__no-drag"},Ge=248,I=6,kt=({item:t,actionsSlot:n,actionsSlotStyle:r,children:f})=>P.jsxs("div",{style:{height:"100%",position:"relative"},id:t.id,className:z.gridItemWrapper,children:[n&&P.jsx("div",{style:{position:"absolute",right:16,top:16,...r},className:z.noDrag,children:n}),f]});function Dt(){const t=l.useRef(null),[n,r]=l.useState(0);return l.useLayoutEffect(()=>{const f=t.current;if(!f)return;let u=0;const c=gt.createSafeResizeObserver(i=>{var h;const m=((h=i[0])==null?void 0:h.contentRect.width)??0;cancelAnimationFrame(u),u=requestAnimationFrame(()=>r(m))});return c.observe(f),()=>{cancelAnimationFrame(u),c.disconnect()}},[]),{ref:t,width:n}}function vt(t){const{onWidthChange:n,margin:r,cols:f,containerPadding:u}=t,{ref:c,width:i}=Dt(),m=l.useRef(0);return l.useEffect(()=>{i>0&&i!==m.current&&(n==null||n(i,r,f,u),m.current=i)},[i,n,r,f,u]),P.jsx("div",{ref:c,style:{width:"100%"},children:i>0&&P.jsx(bt.Responsive,{...t,width:i})})}const Pe=ye.css(["background-color:",";border-radius:16px;outline:1px solid ",";"],()=>L.surfaceTransparentAccent,()=>L.outlineAccent),Rt=ye.div.withConfig({displayName:"GridDNDstyled__GridDNDContainer"})(["width:100%;min-height:400px;max-width:1890px;&:has(.react-grid-placeholder){& .react-grid-item.react-grid-placeholder{"," opacity:1;}}"],Pe),Nt=ye.div.attrs(()=>({className:z.gridItem})).withConfig({displayName:"GridDNDstyled__GridItem"})(["&.react-draggable-dragging{outline:2px solid ",";box-shadow:",";cursor:grabbing;}& .","{cursor:default;}height:100%;width:100%;cursor:",";background-color:white;border-radius:16px;outline:",";box-shadow:",";overflow:hidden;"],()=>L.outlineAccentMinor,()=>L.shadowDownHardS,ze.analyticalWidgetClassNames.topSlot,t=>t.$isDraggable?"grab":"default",t=>t.$isDraggable?`2px solid ${L.outlineTransparentAccent}`:"none",()=>L.shadowDownSoftS),Ot=ye.div.withConfig({displayName:"GridDNDstyled__GridItemContent"})(["height:100%;width:100%;"]),Ke=t=>!t||t==="."||t==="-"||t===" ";function Mt(t,n,r,f){var m,h;const u=[],c=r[n],i=new Set;for(let O=0;O<t.length;O++){const M=t[O];if(!M)return u;for(let s=0;s<M.length;s++){const p=M[s];if(!p||Ke(p)||i.has(`${p}`))continue;let x=0;for(let d=s;d<M.length&&M[d]===p;d++)x++;let y=0;for(let d=O;d<t.length;d++){let k=!0;for(let v=s;v<s+x;v++)if(!((m=t[d])!=null&&m[v])||((h=t[d])==null?void 0:h[v])!==p){k=!1;break}if(!k)break;y++}for(let d=O;d<O+y;d++)for(let k=s;k<s+x;k++)i.add(`${p}`);u.push({i:p,x:s,y:O,w:x,h:y,minW:1,maxW:c,minH:1,isResizable:f,static:!1})}}return u}function At(t){return Object.keys(t).sort((n,r)=>(t[r]||0)-(t[n]||0))}function Gt(t,n){const r=Object.keys(t).sort((f,u)=>{const c=t[f]||0;return(t[u]||0)-c});for(const f of r){const u=t[f];if(u!==void 0&&n>=u)return f}return r[r.length-1]}function Et(t,n,r){var u,c;const f=r.indexOf(t);if(f===-1)return null;for(let i=f-1;i>=0;i--){const m=r[i];if(m&&((u=n[m])!=null&&u.length))return m}for(let i=f+1;i<r.length;i++){const m=r[i];if(m&&((c=n[m])!=null&&c.length))return m}return null}function Ft(t,n){const r=[...t].map(s=>({...s,w:Math.max(1,Math.min(s.w,n))})).sort((s,p)=>s.y-p.y||s.x-p.x),f=[],u=s=>{for(;f.length<s;)f.push(Array(n).fill(!1))},c=(s,p,x,y)=>{u(p+y);for(let d=p;d<p+y;d++){const k=f[d];if(!k)return!1;for(let v=s;v<s+x;v++)if(v>=n||k[v])return!1}return!0},i=(s,p,x,y)=>{u(p+y);for(let d=p;d<p+y;d++){const k=f[d];if(k)for(let v=s;v<s+x;v++)v<k.length&&(k[v]=!0)}},m=s=>{let p=s;for(;;){u(p+1);const x=f[p];if(x&&x.some(y=>!y))return p;p++}};let h=0,O=0;const M=[];for(const s of r){let p=!1;for(let y=O;y<=n-s.w;y++)if(c(y,h,s.w,s.h)){i(y,h,s.w,s.h),M.push({...s,x:y,y:h}),O=y+s.w,O>n-1&&(h=m(h),O=0),p=!0;break}if(p)continue;h=m(h),O=0;let x=h;for(;;){let y=!1;for(let d=0;d<=n-s.w;d++)if(c(d,x,s.w,s.h)){i(d,x,s.w,s.h),M.push({...s,x:d,y:x}),x===h&&(O=d+s.w,O>n-1&&(h=m(h),O=0)),y=!0;break}if(y)break;x++}}return M}const Z=t=>t==="l"?{w:2,h:2}:t==="m"?{w:2,h:1}:{w:1,h:1};function we(t,n){if(!t||!n||t.length!==n.length)return!1;const r=[...t].sort((u,c)=>u.i>c.i?1:-1),f=[...n].sort((u,c)=>u.i>c.i?1:-1);for(let u=0;u<r.length;u+=1){const c=r[u],i=f[u];if(!c||!i||c.i!==i.i||c.x!==i.x||c.y!==i.y||c.w!==i.w||c.h!==i.h)return!1}return!0}function he(t,n,r){for(;t.length<n;)t.push(Array(r).fill(!1))}function St(t,n,r){he(t,n+1,r);const f=t[n];return f?f.some(u=>!u):!1}function xe(t,n,r,f=0){he(t,n+1,r);const u=t[n];if(!u)return-1;for(let c=Math.max(0,f);c<r;c++){if(c>=u.length)return-1;if(!u[c])return c}return-1}function $e(t,n,r,f,u,c){he(t,r+u,c);for(let i=r;i<r+u;i++){const m=t[i];if(!m)return!1;for(let h=n;h<n+f;h++)if(h>=c||m[h])return!1}return!0}function Wt(t,n,r,f,u,c){he(t,r+u,c);for(let i=r;i<r+u;i++){const m=t[i];if(m)for(let h=n;h<n+f;h++)h<c&&(m[h]=!0)}}function Xe(t,n,r){let f=Math.max(0,n);for(;;){if(St(t,f,r))return f;f++}}function Qe(t,n,r,f){const u=[],c=[];let i=0,m=0;for(const h of t){const O=n[h];if(!O)continue;const M=O,s=Math.max(1,Math.min(M.w,r)),p=Math.max(1,M.h);let x=null;for(let k=m;k<=r-s;k++)if($e(c,k,i,s,p,r)){x={x:k,y:i};break}if(!x){let k=i+1;for(;;){for(let v=0;v<=r-s;v++)if($e(c,v,k,s,p,r)){x={x:v,y:k};break}if(x)break;k++}}const{x:y,y:d}=x;if(Wt(c,y,d,s,p,r),u.push({i:h,x:y,y:d,w:s,h:p,minW:1,maxW:r,minH:1,isResizable:f,static:!1}),d>i)i=d,m=Math.max(0,xe(c,i,r,0)),m===-1&&(i=Xe(c,i,r),m=xe(c,i,r,0));else{const k=xe(c,i,r,y+s);k===-1?(i=Xe(c,i,r),m=xe(c,i,r,0)):m=k}}return u}function Ee(t){return[...t].sort((n,r)=>n.y-r.y||n.x-r.x).map(n=>n.i)}const qt=t=>Object.keys(t).sort((n,r)=>(t[r]||0)-(t[n]||0))[0]??"lg";function Ue(t,n,r,f,u=0,c=0){const i=t.reduce((s,p)=>Math.max(s,p.y+p.h),0),m=Array.from({length:Math.max(i,c)+f+1},()=>Array(n).fill(!1));for(const{x:s,y:p,w:x,h:y}of t)for(let d=p;d<p+y;d++){m[d]||(m[d]=Array(n).fill(!1));const k=m[d];for(let v=s;v<s+x;v++)d>=0&&v>=0&&v<n&&k&&(k[v]=!0)}const h=(s,p)=>{for(let x=p;x<p+f;x++){m[x]||(m[x]=Array(n).fill(!1));const y=m[x];for(let d=s;d<s+r;d++)if(d>=n||y&&y[d])return!1}return!0},O=(s,p)=>{for(let x=p;x<p+f;x++){m[x]||(m[x]=Array(n).fill(!1));const y=m[x];for(let d=s;d<s+r;d++)d<n&&y&&(y[d]=!0)}};let M=c;for(;;){m[M]||(m[M]=Array(n).fill(!1));for(let s=M===c?u:0;s<=n-r;s++)if(h(s,M))return O(s,M),{x:s,y:M};M++}}const Tt=t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>t(!1)):setTimeout(()=>t(!1),0)},Ht=({children:t,className:n})=>P.jsx(Ot,{className:n,children:t}),Ye=(...t)=>console.log("%c[GridDND]","color:#6b5b95;font-weight:600",...t),Bt=l.forwardRef(({items:t,breakpoints:n={lg:1375,md:1143,sm:911,xs:679,xxs:0},cols:r={lg:6,md:5,sm:4,xs:3,xxs:2},rowHeights:f={lg:248,md:248,sm:248,xs:248,xxs:248},isDraggable:u=!0,isResizable:c=!1,margin:i=[16,16],containerPadding:m=[0,0],preventCollision:h=!1,allowOverlap:O=!1,isBounded:M=!0,autoSize:s=!0,useCSSTransforms:p=!0,compactType:x="horizontal",smartCompact:y=!0,resizeHandles:d=["se","sw","ne","nw","s","w","e","n"],draggableHandle:k=`.${z.dragHandle}`,draggableCancel:v=`button, input, select, textarea, .${z.noDrag}, .${ze.analyticalWidgetClassNames.topSlot}, .${ht.iconButtonFilterClassNames.root}`,maxRows:Je,transformScale:Ze,onLayoutChange:A,onBreakpointChange:ee,onItemsChange:E,onWidthChange:te,onDrag:re,onDragStart:ne,onDragStop:se,children:be,dragActivationDelay:ge=0,gridItemComponent:Fe,containerStyle:Le,gridStyle:Ce,enableLogs:Se=!1},et)=>{const[G,ie]=l.useState(()=>t.map(e=>e.id)),U=l.useRef(Object.fromEntries(t.map(e=>[e.id,Z(e.type)]))),ke=l.useRef(!1),V=l.useRef({lg:[],md:[],sm:[],xs:[],xxs:[]}),K=l.useRef("lg"),Q=l.useRef([]),$=ge>0,[De,We]=l.useState(!1),[tt,ve]=l.useState(null),ce=l.useRef(null),Re=l.useRef(!1),Ne=l.useRef(null),oe=l.useRef(null),C=l.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null)},[]),le=l.useCallback(()=>{We(!1),ve(null),Re.current=!1},[]),rt=64;l.useEffect(()=>{if(!$||!Ne.current)return;const e=Ne.current;let a=null;const o=(g,R)=>{const F=W=>{const q=W.clientX-g,X=W.clientY-R;q*q+X*X>rt&&(C(),ve(null),oe.current=null,w())};document.addEventListener("pointermove",F),a=()=>{document.removeEventListener("pointermove",F),a=null}},w=()=>{a==null||a()},b=g=>{const R=g.target;return g.offsetX>R.clientWidth||g.offsetY>R.clientHeight},D=g=>{if(g._synthetic||g.button!==0||b(g))return;C(),w();const F=g.target.closest(`.${z.gridItem}`),W=F==null?void 0:F.querySelector(`.${z.gridItemWrapper}`),q=(W==null?void 0:W.id)??null,X=F==null?void 0:F.querySelector(`.${z.dragHandle}`);ve(q),oe.current={clientX:g.clientX,clientY:g.clientY,handleEl:X},o(g.clientX,g.clientY),ce.current=setTimeout(()=>{w(),We(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const Y=oe.current;if(!(Y!=null&&Y.handleEl))return;const me=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,clientX:Y.clientX,clientY:Y.clientY,button:0,buttons:1});me._synthetic=!0,Y.handleEl.dispatchEvent(me)})})},ge)},N=()=>{C(),w(),oe.current=null,Re.current||requestAnimationFrame(()=>{le()})};return e.addEventListener("pointerdown",D),document.addEventListener("pointerup",N),()=>{e.removeEventListener("pointerdown",D),document.removeEventListener("pointerup",N),C(),w()}},[$,ge,C,le]);const qe=$?u&&De:u,[_,Te]=l.useState({lg:[],md:[],sm:[],xs:[],xxs:[]}),[He,nt]=l.useState("lg"),[T,st]=l.useState(f.lg??Ge),[it,ue]=l.useState(x),[ct,Be]=l.useState(!1),ot=l.useMemo(()=>k.split(".").join(" "),[k]),lt=l.useMemo(()=>Fe??Ht,[Fe]),ae=l.useMemo(()=>new Map(t.map(e=>[e.id,e.type])),[t]),J=l.useRef(new Map),fe=l.useCallback(e=>J.current.get(e)??ae.get(e)??"s",[ae]),j=l.useCallback(e=>e.map(a=>({id:a,type:fe(a)})),[fe]),Oe=l.useCallback(e=>f[e]??f.md??Ge,[f]),S=l.useCallback((e,a,o)=>{const w=o??G,b=a[e]??[],D=V.current[e]??[],N=new Map(b.map(R=>[R.i,R])),g=new Map(D.map(R=>[R.i,R]));return w.map(R=>{const F=fe(R),W=N.get(R)??g.get(R)??null,q=U.current[R]??Z(F),X=W?{x:W.x,y:W.y,w:W.w,h:W.h}:{x:0,y:0,w:q.w,h:q.h};return{id:R,type:F,position:X}})},[G,fe]),_e=l.useCallback(e=>{const a=V.current[e]??[];return a.length?a:_[e]??[]},[_]),H=l.useCallback((...e)=>{Se&&Ye(...e)},[Se]),de=l.useCallback(e=>{V.current=e,ke.current=!0,Be(!0),Te(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ke.current=!1,Be(!1),Ye("[GridDND] reflow window closed")})})},[]),B=l.useCallback(e=>{const a={};for(const o of Object.keys(r)){const w=r[o]??I;a[o]=Qe(e,U.current,w,c)}return H("reflowAllByOrder",{order:e,out:a}),de(a),a},[r,c,de,H]),je=l.useCallback((e,a)=>{if(!y)return;const o=Date.now();if(Q.current.push({x:e,y:a,timestamp:o}),Q.current=Q.current.filter(D=>o-D.timestamp<=300),Q.current.length<2)return;let w=0,b=0;for(let D=1;D<Q.current.length;D+=1){const N=Q.current[D-1],g=Q.current[D];!N||!g||(w+=Math.abs(g.x-N.x),b+=Math.abs(g.y-N.y))}w+b<10||(w>b*1.5?ue("horizontal"):b>w*1.5&&ue("vertical"))},[y]),Ie=l.useCallback(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=V.current,a={};for(const[o,w]of Object.entries(e))a[o]=w.map(b=>({...b}));H("[GridDND] forceSyncWithRgl → re-push target layouts"),de(a)})})},[de,H]);l.useEffect(()=>{B(t.map(e=>e.id))},[]),l.useEffect(()=>{const e=new Set([...ae.keys(),...G]);J.current.forEach((a,o)=>{e.has(o)||J.current.delete(o)})},[ae,G]),l.useEffect(()=>{t.forEach(e=>{U.current[e.id]||(U.current[e.id]=Z(e.type))})},[t]);const ut=l.useCallback((e,a,o,w,b,D)=>{Q.current=[],ue(x),$&&(Re.current=!0),ne==null||ne(e,a,o,w,b,D)},[x,ne,$]),at=l.useCallback((e,a,o,w,b,D)=>{je(b.clientX,b.clientY),re==null||re(e,a,o,w,b,D)},[je,re]),ft=l.useCallback((e,a,o,w,b,D)=>{se==null||se(e,a,o,w,b,D),$&&le();const N=Ee(e);H("[GridDND] dragStop: nextOrder(readingOrder)",N),ie(N);const g=B(N),R=K.current,F=S(R,g,N);E==null||E(F),A==null||A({breakpoint:R,cols:r[R]??I,rowHeight:T,items:F},g,{itemsOrder:N,itemsOrderTyped:j(N)}),ue(x);const W=e,q=g[R];we(W,q)?H("[GridDND] dragStop: live layout == target (OK)"):(H("[GridDND] dragStop: live layout != target → forceSyncWithRgl()"),Ie())},[se,$,le,B,S,E,A,r,T,x,Ie,H,j]),dt=l.useCallback((e,a)=>{H("RGL onLayoutChange",{cur:e,all:a});const o=K.current,w=(V.current[o]??[]).length;if(e.length===w&&we(e,V.current[o])){H("[GridDND] onLayoutChange[IGNORED: equals-target]",{bp:o});return}if(ke.current){H("[GridDND] onLayoutChange[IGNORED: reflow-window]",{bp:o,cur:e});return}const b=r[o]??I;if(e.some(g=>typeof g.maxW=="number"&&g.maxW!==b))return;if(we(e,V.current[o])){H("[GridDND] onLayoutChange[IGNORED: equals-target]",{bp:o});return}Te(g=>({...g,[o]:e.map(R=>({...R}))}));const N=S(o,{..._,[o]:e});A==null||A({breakpoint:o,cols:b,rowHeight:T,items:N},{..._,[o]:e},{itemsOrder:G})},[A,S,_,r,T,G,H]),mt=l.useCallback(e=>{K.current=e,nt(e),st(Oe(e));const a=B(G),o=S(e,a,G);ee==null||ee(e,{breakpoint:e,cols:r[e]??I,rowHeight:Oe(e),items:o})},[Oe,B,G,S,ee,r]),pt=l.useCallback((e,a,o,w)=>{te==null||te(e,a,o,w)},[te]),Me=l.useCallback(e=>{J.current.delete(e),delete U.current[e],ie(a=>{const o=a.filter(N=>N!==e),w=B(o),b=K.current,D=S(b,w,o);return E==null||E(D),A==null||A({breakpoint:b,cols:r[b]??I,rowHeight:T,items:D},w,{itemsOrder:o,itemsOrderTyped:j(o)}),o})},[B,S,E,A,r,T,j]),Ae=l.useCallback((e,a)=>{if(!G.includes(e))return;J.current.set(e,a);const o=K.current,w=r[o]??I,b=Z(a);U.current[e]={w:Math.max(1,Math.min(b.w,w)),h:Math.max(1,b.h)};const D=B(G),N=S(o,D,G);E==null||E(N),A==null||A({breakpoint:o,cols:w,rowHeight:T,items:N},D,{itemsOrder:G,itemsOrderTyped:j(G)})},[G,r,B,S,E,A,T,j]);l.useImperativeHandle(et,()=>({api:{getOrder:()=>G,getOrderDetailed:()=>j(G),setOrder:e=>{ie(e);const a=B(e),o=K.current,w=S(o,a,e);E==null||E(w),A==null||A({breakpoint:o,cols:r[o]??I,rowHeight:T,items:w},a,{itemsOrder:e,itemsOrderTyped:j(e)})},addItem:(e,a)=>{J.current.set(e.id,e.type);const o=Z(e.type),w=K.current,b=r[w]??I,D={w:Math.max(1,Math.min(o.w,b)),h:Math.max(1,o.h)};U.current[e.id]=D;const N=_e(w);let g=0,R=0;if(a!=null){const me=Math.max(0,Math.min(a-1,G.length-1)),wt=G[me],pe=N.find(yt=>yt.i===wt);pe&&(R=pe.y,g=pe.x+pe.w)}const F=Ue(N,b,D.w,D.h,g,R),W=N.concat([{i:e.id,x:F.x,y:F.y,w:D.w,h:D.h}]),q=Ee(W);ie(q);const X=B(q),Y=S(w,X,q);E==null||E(Y),A==null||A({breakpoint:w,cols:b,rowHeight:T,items:Y},X,{itemsOrder:q,itemsOrderTyped:j(q)})},removeItem:Me,setItemType:Ae,getAllLayouts:()=>_,getCurrentLayout:()=>{const e=K.current,a=S(e,_,G);return{breakpoint:e,cols:r[e]??I,rowHeight:T,items:a}}}}),[Me,Ae,G,j,B,S,E,A,r,T,_e,_]);const xt=l.useMemo(()=>S(He,_,G),[He,_,G,S]);return P.jsx(Rt,{ref:Ne,style:{...Le,...$&&De?{userSelect:"none",touchAction:"none"}:{}},children:P.jsx(vt,{className:"layout",layouts:_,breakpoints:n,cols:r,rowHeight:T,margin:i,containerPadding:m,isDraggable:qe,isResizable:c,onLayoutChange:dt,onBreakpointChange:mt,autoSize:s,useCSSTransforms:p,preventCollision:h,compactType:ct?null:y?it:x,allowOverlap:O,isBounded:M,draggableHandle:k,draggableCancel:v,resizeHandles:c?d:[],maxRows:Je,transformScale:Ze,onWidthChange:pt,onDrag:at,onDragStart:ut,onDragStop:ft,style:{background:"transparent",...Ce},children:xt.map(e=>P.jsx(Nt,{$isDraggable:$?De&&tt===e.id:u,children:P.jsx(lt,{isDraggable:qe,className:ot,children:typeof be=="function"?be(e,()=>Me(e.id),a=>Ae(e.id,a)):be})},e.id))})})}),Ve=Object.assign(Bt,{ItemWrapper:kt});Ve.displayName="GridDND";exports.GridDND=Ve;exports.GridDNDClassNames=z;exports.convertAreaToLayoutsInit=Mt;exports.fallbackCols=I;exports.fallbackRowHeight=Ge;exports.findNearestSourceBp=Et;exports.getBreakpointFromWidth=Gt;exports.gridItemPlaceholderMixin=Pe;exports.gridWrapWordLike=Ft;exports.initSizeByType=Z;exports.isEmptyCell=Ke;exports.layoutsShallowEqual=we;exports.orderBreakpointsDesc=At;exports.packByItemsOrder=Qe;exports.pickWidestBreakpoint=qt;exports.placeRectFirstFit=Ue;exports.readingOrder=Ee;exports.unlockAfterFrame=Tt;
|
|
1
|
+
"use strict";const P=require("react/jsx-runtime");require("react-grid-layout/css/styles.css");const ht=require("../components/IconButton/index.cjs"),l=require("react"),ze=require("./AnalyticalWidget-29tSeB0C.cjs"),bt=require("react-grid-layout"),gt=require("./utils-DKi1rqLX.cjs"),L=require("@salutejs/sdds-themes/tokens/sdds_finai"),ye=require("styled-components"),z={gridItemWrapper:"grid-dnd__item-wrapper",gridItem:"grid-dnd__item",dragHandle:"grid-dnd__drag-handle",noDrag:"grid-dnd__no-drag"},Ge=248,I=6,kt=({item:t,actionsSlot:n,actionsSlotStyle:r,children:f})=>P.jsxs("div",{style:{height:"100%",position:"relative"},id:t.id,className:z.gridItemWrapper,children:[n&&P.jsx("div",{style:{position:"absolute",right:16,top:16,...r},className:z.noDrag,children:n}),f]});function Dt(){const t=l.useRef(null),[n,r]=l.useState(0);return l.useLayoutEffect(()=>{const f=t.current;if(!f)return;let u=0;const c=gt.createSafeResizeObserver(i=>{var h;const m=((h=i[0])==null?void 0:h.contentRect.width)??0;cancelAnimationFrame(u),u=requestAnimationFrame(()=>r(m))});return c.observe(f),()=>{cancelAnimationFrame(u),c.disconnect()}},[]),{ref:t,width:n}}function vt(t){const{onWidthChange:n,margin:r,cols:f,containerPadding:u}=t,{ref:c,width:i}=Dt(),m=l.useRef(0);return l.useEffect(()=>{i>0&&i!==m.current&&(n==null||n(i,r,f,u),m.current=i)},[i,n,r,f,u]),P.jsx("div",{ref:c,style:{width:"100%"},children:i>0&&P.jsx(bt.Responsive,{...t,width:i})})}const Pe=ye.css(["background-color:",";border-radius:16px;outline:1px solid ",";"],()=>L.surfaceTransparentAccent,()=>L.outlineAccent),Rt=ye.div.withConfig({displayName:"GridDNDstyled__GridDNDContainer"})(["width:100%;min-height:400px;max-width:1890px;&:has(.react-grid-placeholder){& .react-grid-item.react-grid-placeholder{"," opacity:1;}}"],Pe),Nt=ye.div.attrs(()=>({className:z.gridItem})).withConfig({displayName:"GridDNDstyled__GridItem"})(["&.react-draggable-dragging{outline:2px solid ",";box-shadow:",";cursor:grabbing;}& .","{cursor:default;}height:100%;width:100%;cursor:",";background-color:white;border-radius:16px;outline:",";box-shadow:",";overflow:hidden;"],()=>L.outlineAccentMinor,()=>L.shadowDownHardS,ze.analyticalWidgetClassNames.topSlot,t=>t.$isDraggable?"grab":"default",t=>t.$isDraggable?`2px solid ${L.outlineTransparentAccent}`:"none",()=>L.shadowDownSoftS),Ot=ye.div.withConfig({displayName:"GridDNDstyled__GridItemContent"})(["height:100%;width:100%;"]),Ke=t=>!t||t==="."||t==="-"||t===" ";function Mt(t,n,r,f){var m,h;const u=[],c=r[n],i=new Set;for(let O=0;O<t.length;O++){const M=t[O];if(!M)return u;for(let s=0;s<M.length;s++){const p=M[s];if(!p||Ke(p)||i.has(`${p}`))continue;let x=0;for(let d=s;d<M.length&&M[d]===p;d++)x++;let y=0;for(let d=O;d<t.length;d++){let k=!0;for(let v=s;v<s+x;v++)if(!((m=t[d])!=null&&m[v])||((h=t[d])==null?void 0:h[v])!==p){k=!1;break}if(!k)break;y++}for(let d=O;d<O+y;d++)for(let k=s;k<s+x;k++)i.add(`${p}`);u.push({i:p,x:s,y:O,w:x,h:y,minW:1,maxW:c,minH:1,isResizable:f,static:!1})}}return u}function At(t){return Object.keys(t).sort((n,r)=>(t[r]||0)-(t[n]||0))}function Gt(t,n){const r=Object.keys(t).sort((f,u)=>{const c=t[f]||0;return(t[u]||0)-c});for(const f of r){const u=t[f];if(u!==void 0&&n>=u)return f}return r[r.length-1]}function Et(t,n,r){var u,c;const f=r.indexOf(t);if(f===-1)return null;for(let i=f-1;i>=0;i--){const m=r[i];if(m&&((u=n[m])!=null&&u.length))return m}for(let i=f+1;i<r.length;i++){const m=r[i];if(m&&((c=n[m])!=null&&c.length))return m}return null}function Ft(t,n){const r=[...t].map(s=>({...s,w:Math.max(1,Math.min(s.w,n))})).sort((s,p)=>s.y-p.y||s.x-p.x),f=[],u=s=>{for(;f.length<s;)f.push(Array(n).fill(!1))},c=(s,p,x,y)=>{u(p+y);for(let d=p;d<p+y;d++){const k=f[d];if(!k)return!1;for(let v=s;v<s+x;v++)if(v>=n||k[v])return!1}return!0},i=(s,p,x,y)=>{u(p+y);for(let d=p;d<p+y;d++){const k=f[d];if(k)for(let v=s;v<s+x;v++)v<k.length&&(k[v]=!0)}},m=s=>{let p=s;for(;;){u(p+1);const x=f[p];if(x&&x.some(y=>!y))return p;p++}};let h=0,O=0;const M=[];for(const s of r){let p=!1;for(let y=O;y<=n-s.w;y++)if(c(y,h,s.w,s.h)){i(y,h,s.w,s.h),M.push({...s,x:y,y:h}),O=y+s.w,O>n-1&&(h=m(h),O=0),p=!0;break}if(p)continue;h=m(h),O=0;let x=h;for(;;){let y=!1;for(let d=0;d<=n-s.w;d++)if(c(d,x,s.w,s.h)){i(d,x,s.w,s.h),M.push({...s,x:d,y:x}),x===h&&(O=d+s.w,O>n-1&&(h=m(h),O=0)),y=!0;break}if(y)break;x++}}return M}const Z=t=>t==="l"?{w:2,h:2}:t==="m"?{w:2,h:1}:{w:1,h:1};function we(t,n){if(!t||!n||t.length!==n.length)return!1;const r=[...t].sort((u,c)=>u.i>c.i?1:-1),f=[...n].sort((u,c)=>u.i>c.i?1:-1);for(let u=0;u<r.length;u+=1){const c=r[u],i=f[u];if(!c||!i||c.i!==i.i||c.x!==i.x||c.y!==i.y||c.w!==i.w||c.h!==i.h)return!1}return!0}function he(t,n,r){for(;t.length<n;)t.push(Array(r).fill(!1))}function St(t,n,r){he(t,n+1,r);const f=t[n];return f?f.some(u=>!u):!1}function xe(t,n,r,f=0){he(t,n+1,r);const u=t[n];if(!u)return-1;for(let c=Math.max(0,f);c<r;c++){if(c>=u.length)return-1;if(!u[c])return c}return-1}function $e(t,n,r,f,u,c){he(t,r+u,c);for(let i=r;i<r+u;i++){const m=t[i];if(!m)return!1;for(let h=n;h<n+f;h++)if(h>=c||m[h])return!1}return!0}function Wt(t,n,r,f,u,c){he(t,r+u,c);for(let i=r;i<r+u;i++){const m=t[i];if(m)for(let h=n;h<n+f;h++)h<c&&(m[h]=!0)}}function Xe(t,n,r){let f=Math.max(0,n);for(;;){if(St(t,f,r))return f;f++}}function Qe(t,n,r,f){const u=[],c=[];let i=0,m=0;for(const h of t){const O=n[h];if(!O)continue;const M=O,s=Math.max(1,Math.min(M.w,r)),p=Math.max(1,M.h);let x=null;for(let k=m;k<=r-s;k++)if($e(c,k,i,s,p,r)){x={x:k,y:i};break}if(!x){let k=i+1;for(;;){for(let v=0;v<=r-s;v++)if($e(c,v,k,s,p,r)){x={x:v,y:k};break}if(x)break;k++}}const{x:y,y:d}=x;if(Wt(c,y,d,s,p,r),u.push({i:h,x:y,y:d,w:s,h:p,minW:1,maxW:r,minH:1,isResizable:f,static:!1}),d>i)i=d,m=Math.max(0,xe(c,i,r,0)),m===-1&&(i=Xe(c,i,r),m=xe(c,i,r,0));else{const k=xe(c,i,r,y+s);k===-1?(i=Xe(c,i,r),m=xe(c,i,r,0)):m=k}}return u}function Ee(t){return[...t].sort((n,r)=>n.y-r.y||n.x-r.x).map(n=>n.i)}const qt=t=>Object.keys(t).sort((n,r)=>(t[r]||0)-(t[n]||0))[0]??"lg";function Ue(t,n,r,f,u=0,c=0){const i=t.reduce((s,p)=>Math.max(s,p.y+p.h),0),m=Array.from({length:Math.max(i,c)+f+1},()=>Array(n).fill(!1));for(const{x:s,y:p,w:x,h:y}of t)for(let d=p;d<p+y;d++){m[d]||(m[d]=Array(n).fill(!1));const k=m[d];for(let v=s;v<s+x;v++)d>=0&&v>=0&&v<n&&k&&(k[v]=!0)}const h=(s,p)=>{for(let x=p;x<p+f;x++){m[x]||(m[x]=Array(n).fill(!1));const y=m[x];for(let d=s;d<s+r;d++)if(d>=n||y&&y[d])return!1}return!0},O=(s,p)=>{for(let x=p;x<p+f;x++){m[x]||(m[x]=Array(n).fill(!1));const y=m[x];for(let d=s;d<s+r;d++)d<n&&y&&(y[d]=!0)}};let M=c;for(;;){m[M]||(m[M]=Array(n).fill(!1));for(let s=M===c?u:0;s<=n-r;s++)if(h(s,M))return O(s,M),{x:s,y:M};M++}}const Tt=t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>t(!1)):setTimeout(()=>t(!1),0)},Ht=({children:t,className:n})=>P.jsx(Ot,{className:n,children:t}),Ye=(...t)=>console.log("%c[GridDND]","color:#6b5b95;font-weight:600",...t),Bt=l.forwardRef(({items:t,breakpoints:n={lg:1375,md:1143,sm:911,xs:679,xxs:0},cols:r={lg:6,md:5,sm:4,xs:3,xxs:2},rowHeights:f={lg:248,md:248,sm:248,xs:248,xxs:248},isDraggable:u=!0,isResizable:c=!1,margin:i=[16,16],containerPadding:m=[0,0],preventCollision:h=!1,allowOverlap:O=!1,isBounded:M=!0,autoSize:s=!0,useCSSTransforms:p=!0,compactType:x="horizontal",smartCompact:y=!0,resizeHandles:d=["se","sw","ne","nw","s","w","e","n"],draggableHandle:k=`.${z.dragHandle}`,draggableCancel:v=`button, input, select, textarea, .${z.noDrag}, .${ze.analyticalWidgetClassNames.topSlot}, .${ht.iconButtonFilterClassNames.root}`,maxRows:Je,transformScale:Ze,onLayoutChange:A,onBreakpointChange:ee,onItemsChange:E,onWidthChange:te,onDrag:re,onDragStart:ne,onDragStop:se,children:be,dragActivationDelay:ge=0,gridItemComponent:Fe,containerStyle:Le,gridStyle:Ce,enableLogs:Se=!1},et)=>{const[G,ie]=l.useState(()=>t.map(e=>e.id)),U=l.useRef(Object.fromEntries(t.map(e=>[e.id,Z(e.type)]))),ke=l.useRef(!1),V=l.useRef({lg:[],md:[],sm:[],xs:[],xxs:[]}),K=l.useRef("lg"),Q=l.useRef([]),$=ge>0,[De,We]=l.useState(!1),[tt,ve]=l.useState(null),ce=l.useRef(null),Re=l.useRef(!1),Ne=l.useRef(null),oe=l.useRef(null),C=l.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null)},[]),le=l.useCallback(()=>{We(!1),ve(null),Re.current=!1},[]),rt=64;l.useEffect(()=>{if(!$||!Ne.current)return;const e=Ne.current;let a=null;const o=(g,R)=>{const F=W=>{const q=W.clientX-g,X=W.clientY-R;q*q+X*X>rt&&(C(),ve(null),oe.current=null,w())};document.addEventListener("pointermove",F),a=()=>{document.removeEventListener("pointermove",F),a=null}},w=()=>{a==null||a()},b=g=>{const R=g.target;return g.offsetX>R.clientWidth||g.offsetY>R.clientHeight},D=g=>{if(g._synthetic||g.button!==0||b(g))return;C(),w();const F=g.target.closest(`.${z.gridItem}`),W=F==null?void 0:F.querySelector(`.${z.gridItemWrapper}`),q=(W==null?void 0:W.id)??null,X=F==null?void 0:F.querySelector(`.${z.dragHandle}`);ve(q),oe.current={clientX:g.clientX,clientY:g.clientY,handleEl:X},o(g.clientX,g.clientY),ce.current=setTimeout(()=>{w(),We(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const Y=oe.current;if(!(Y!=null&&Y.handleEl))return;const me=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,clientX:Y.clientX,clientY:Y.clientY,button:0,buttons:1});me._synthetic=!0,Y.handleEl.dispatchEvent(me)})})},ge)},N=()=>{C(),w(),oe.current=null,Re.current||requestAnimationFrame(()=>{le()})};return e.addEventListener("pointerdown",D),document.addEventListener("pointerup",N),()=>{e.removeEventListener("pointerdown",D),document.removeEventListener("pointerup",N),C(),w()}},[$,ge,C,le]);const qe=$?u&&De:u,[_,Te]=l.useState({lg:[],md:[],sm:[],xs:[],xxs:[]}),[He,nt]=l.useState("lg"),[T,st]=l.useState(f.lg??Ge),[it,ue]=l.useState(x),[ct,Be]=l.useState(!1),ot=l.useMemo(()=>k.split(".").join(" "),[k]),lt=l.useMemo(()=>Fe??Ht,[Fe]),ae=l.useMemo(()=>new Map(t.map(e=>[e.id,e.type])),[t]),J=l.useRef(new Map),fe=l.useCallback(e=>J.current.get(e)??ae.get(e)??"s",[ae]),j=l.useCallback(e=>e.map(a=>({id:a,type:fe(a)})),[fe]),Oe=l.useCallback(e=>f[e]??f.md??Ge,[f]),S=l.useCallback((e,a,o)=>{const w=o??G,b=a[e]??[],D=V.current[e]??[],N=new Map(b.map(R=>[R.i,R])),g=new Map(D.map(R=>[R.i,R]));return w.map(R=>{const F=fe(R),W=N.get(R)??g.get(R)??null,q=U.current[R]??Z(F),X=W?{x:W.x,y:W.y,w:W.w,h:W.h}:{x:0,y:0,w:q.w,h:q.h};return{id:R,type:F,position:X}})},[G,fe]),_e=l.useCallback(e=>{const a=V.current[e]??[];return a.length?a:_[e]??[]},[_]),H=l.useCallback((...e)=>{Se&&Ye(...e)},[Se]),de=l.useCallback(e=>{V.current=e,ke.current=!0,Be(!0),Te(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ke.current=!1,Be(!1),Ye("[GridDND] reflow window closed")})})},[]),B=l.useCallback(e=>{const a={};for(const o of Object.keys(r)){const w=r[o]??I;a[o]=Qe(e,U.current,w,c)}return H("reflowAllByOrder",{order:e,out:a}),de(a),a},[r,c,de,H]),je=l.useCallback((e,a)=>{if(!y)return;const o=Date.now();if(Q.current.push({x:e,y:a,timestamp:o}),Q.current=Q.current.filter(D=>o-D.timestamp<=300),Q.current.length<2)return;let w=0,b=0;for(let D=1;D<Q.current.length;D+=1){const N=Q.current[D-1],g=Q.current[D];!N||!g||(w+=Math.abs(g.x-N.x),b+=Math.abs(g.y-N.y))}w+b<10||(w>b*1.5?ue("horizontal"):b>w*1.5&&ue("vertical"))},[y]),Ie=l.useCallback(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=V.current,a={};for(const[o,w]of Object.entries(e))a[o]=w.map(b=>({...b}));H("[GridDND] forceSyncWithRgl → re-push target layouts"),de(a)})})},[de,H]);l.useEffect(()=>{B(t.map(e=>e.id))},[]),l.useEffect(()=>{const e=new Set([...ae.keys(),...G]);J.current.forEach((a,o)=>{e.has(o)||J.current.delete(o)})},[ae,G]),l.useEffect(()=>{t.forEach(e=>{U.current[e.id]||(U.current[e.id]=Z(e.type))})},[t]);const ut=l.useCallback((e,a,o,w,b,D)=>{Q.current=[],ue(x),$&&(Re.current=!0),ne==null||ne(e,a,o,w,b,D)},[x,ne,$]),at=l.useCallback((e,a,o,w,b,D)=>{je(b.clientX,b.clientY),re==null||re(e,a,o,w,b,D)},[je,re]),ft=l.useCallback((e,a,o,w,b,D)=>{se==null||se(e,a,o,w,b,D),$&&le();const N=Ee(e);H("[GridDND] dragStop: nextOrder(readingOrder)",N),ie(N);const g=B(N),R=K.current,F=S(R,g,N);E==null||E(F),A==null||A({breakpoint:R,cols:r[R]??I,rowHeight:T,items:F},g,{itemsOrder:N,itemsOrderTyped:j(N)}),ue(x);const W=e,q=g[R];we(W,q)?H("[GridDND] dragStop: live layout == target (OK)"):(H("[GridDND] dragStop: live layout != target → forceSyncWithRgl()"),Ie())},[se,$,le,B,S,E,A,r,T,x,Ie,H,j]),dt=l.useCallback((e,a)=>{H("RGL onLayoutChange",{cur:e,all:a});const o=K.current,w=(V.current[o]??[]).length;if(e.length===w&&we(e,V.current[o])){H("[GridDND] onLayoutChange[IGNORED: equals-target]",{bp:o});return}if(ke.current){H("[GridDND] onLayoutChange[IGNORED: reflow-window]",{bp:o,cur:e});return}const b=r[o]??I;if(e.some(g=>typeof g.maxW=="number"&&g.maxW!==b))return;if(we(e,V.current[o])){H("[GridDND] onLayoutChange[IGNORED: equals-target]",{bp:o});return}Te(g=>({...g,[o]:e.map(R=>({...R}))}));const N=S(o,{..._,[o]:e});A==null||A({breakpoint:o,cols:b,rowHeight:T,items:N},{..._,[o]:e},{itemsOrder:G})},[A,S,_,r,T,G,H]),mt=l.useCallback(e=>{K.current=e,nt(e),st(Oe(e));const a=B(G),o=S(e,a,G);ee==null||ee(e,{breakpoint:e,cols:r[e]??I,rowHeight:Oe(e),items:o})},[Oe,B,G,S,ee,r]),pt=l.useCallback((e,a,o,w)=>{te==null||te(e,a,o,w)},[te]),Me=l.useCallback(e=>{J.current.delete(e),delete U.current[e],ie(a=>{const o=a.filter(N=>N!==e),w=B(o),b=K.current,D=S(b,w,o);return E==null||E(D),A==null||A({breakpoint:b,cols:r[b]??I,rowHeight:T,items:D},w,{itemsOrder:o,itemsOrderTyped:j(o)}),o})},[B,S,E,A,r,T,j]),Ae=l.useCallback((e,a)=>{if(!G.includes(e))return;J.current.set(e,a);const o=K.current,w=r[o]??I,b=Z(a);U.current[e]={w:Math.max(1,Math.min(b.w,w)),h:Math.max(1,b.h)};const D=B(G),N=S(o,D,G);E==null||E(N),A==null||A({breakpoint:o,cols:w,rowHeight:T,items:N},D,{itemsOrder:G,itemsOrderTyped:j(G)})},[G,r,B,S,E,A,T,j]);l.useImperativeHandle(et,()=>({api:{getOrder:()=>G,getOrderDetailed:()=>j(G),setOrder:e=>{ie(e);const a=B(e),o=K.current,w=S(o,a,e);E==null||E(w),A==null||A({breakpoint:o,cols:r[o]??I,rowHeight:T,items:w},a,{itemsOrder:e,itemsOrderTyped:j(e)})},addItem:(e,a)=>{J.current.set(e.id,e.type);const o=Z(e.type),w=K.current,b=r[w]??I,D={w:Math.max(1,Math.min(o.w,b)),h:Math.max(1,o.h)};U.current[e.id]=D;const N=_e(w);let g=0,R=0;if(a!=null){const me=Math.max(0,Math.min(a-1,G.length-1)),wt=G[me],pe=N.find(yt=>yt.i===wt);pe&&(R=pe.y,g=pe.x+pe.w)}const F=Ue(N,b,D.w,D.h,g,R),W=N.concat([{i:e.id,x:F.x,y:F.y,w:D.w,h:D.h}]),q=Ee(W);ie(q);const X=B(q),Y=S(w,X,q);E==null||E(Y),A==null||A({breakpoint:w,cols:b,rowHeight:T,items:Y},X,{itemsOrder:q,itemsOrderTyped:j(q)})},removeItem:Me,setItemType:Ae,getAllLayouts:()=>_,getCurrentLayout:()=>{const e=K.current,a=S(e,_,G);return{breakpoint:e,cols:r[e]??I,rowHeight:T,items:a}}}}),[Me,Ae,G,j,B,S,E,A,r,T,_e,_]);const xt=l.useMemo(()=>S(He,_,G),[He,_,G,S]);return P.jsx(Rt,{ref:Ne,style:{...Le,...$&&De?{userSelect:"none",touchAction:"none"}:{}},children:P.jsx(vt,{className:"layout",layouts:_,breakpoints:n,cols:r,rowHeight:T,margin:i,containerPadding:m,isDraggable:qe,isResizable:c,onLayoutChange:dt,onBreakpointChange:mt,autoSize:s,useCSSTransforms:p,preventCollision:h,compactType:ct?null:y?it:x,allowOverlap:O,isBounded:M,draggableHandle:k,draggableCancel:v,resizeHandles:c?d:[],maxRows:Je,transformScale:Ze,onWidthChange:pt,onDrag:at,onDragStart:ut,onDragStop:ft,style:{background:"transparent",...Ce},children:xt.map(e=>P.jsx(Nt,{$isDraggable:$?De&&tt===e.id:u,children:P.jsx(lt,{isDraggable:qe,className:ot,children:typeof be=="function"?be(e,()=>Me(e.id),a=>Ae(e.id,a)):be})},e.id))})})}),Ve=Object.assign(Bt,{ItemWrapper:kt});Ve.displayName="GridDND";exports.GridDND=Ve;exports.GridDNDClassNames=z;exports.convertAreaToLayoutsInit=Mt;exports.fallbackCols=I;exports.fallbackRowHeight=Ge;exports.findNearestSourceBp=Et;exports.getBreakpointFromWidth=Gt;exports.gridItemPlaceholderMixin=Pe;exports.gridWrapWordLike=Ft;exports.initSizeByType=Z;exports.isEmptyCell=Ke;exports.layoutsShallowEqual=we;exports.orderBreakpointsDesc=At;exports.packByItemsOrder=Qe;exports.pickWidestBreakpoint=qt;exports.placeRectFirstFit=Ue;exports.readingOrder=Ee;exports.unlockAfterFrame=Tt;
|
|
@@ -2,7 +2,7 @@ import { jsxs as xe, jsx as V } from "react/jsx-runtime";
|
|
|
2
2
|
import "react-grid-layout/css/styles.css";
|
|
3
3
|
import { iconButtonFilterClassNames as ye } from "../components/IconButton/index.mjs";
|
|
4
4
|
import { useRef as B, useState as P, useLayoutEffect as he, useEffect as et, forwardRef as ge, useCallback as G, useMemo as yt, useImperativeHandle as be } from "react";
|
|
5
|
-
import { b as Qt } from "./AnalyticalWidget-
|
|
5
|
+
import { b as Qt } from "./AnalyticalWidget-DnHHyjnv.mjs";
|
|
6
6
|
import { Responsive as De } from "react-grid-layout";
|
|
7
7
|
import { c as ve } from "./utils-C5SQhoON.mjs";
|
|
8
8
|
import { surfaceTransparentAccent as ke, outlineAccent as Oe, outlineAccentMinor as Ne, shadowDownHardS as Ae, outlineTransparentAccent as Me, shadowDownSoftS as Re } from "@salutejs/sdds-themes/tokens/sdds_finai";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("react"),g=require("react/jsx-runtime"),O=require("../components/Box/index.cjs"),w=require("@salutejs/sdds-finai"),T=require("../components/Collapse/index.cjs"),A=require("./Table-JFzBB9zK.cjs"),$=require("@salutejs/plasma-icons"),q=require("./utils-DKi1rqLX.cjs"),B=require("styled-components"),k=require("@salutejs/sdds-themes/tokens/sdds_finai"),I=require("./FiltersActions-49uNOjLq.cjs"),_="list-of-filters",f={chipsGroup:`${_}__chip-group`,chipsGroupLabel:`${_}__chip-group__label`,chipsGroupCount:`${_}__chip-group__count`,chip:`${_}__chip`,clearButtonBlock:`${_}__clear-button-block`,chipsContainer:`${_}__chips-container`,container:`${_}__container`},N=e=>"groupId"in e,W=()=>B.css(k.bodyS),G=250,M=B(w.ChipGroup).withConfig({displayName:"ChipOrGroup__StyledChipGroup"})(["&{border-radius:",";padding:4px 2px;"," align-items:center;&.","{gap:4px;& .",":first-child,& ."," + .","{margin-left:4px;}& .","{display:inline-block;min-width:0;max-width:","px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}& .","{color:",";margin-left:4px;}& ."," svg{color:"," !important;}}}"],()=>k.borderRadiusS,()=>W(),f.chipsGroup,f.chip,f.chipsGroupLabel,f.chip,f.chipsGroupLabel,G,f.chipsGroupCount,()=>k.textPrimary,f.chip,()=>k.onLightTextSecondary),V=({itemOrGroup:e,maxLengthInGroup:i=2,ellipsisLabel:h=!1,chipStyle:n,renderGroupLabel:u,renderChipLabel:r})=>{if(N(e)){const p=e,b=p.items.slice(0,i),d=p.items.length-b.length,l=u?u(p):p.groupLabel;return g.jsxs(M,{className:f.chipsGroup,size:"xs",gap:"wide",view:"default",isCommonChipStyles:!1,children:[h?g.jsx("span",{className:f.chipsGroupLabel,title:l,children:l}):l,b.map(t=>g.jsx(w.Chip,{className:f.chip,title:"Удалить фильтр",view:"default",text:r?r(p,t):t.label.toString(),size:"xs",pilled:!0,onClick:t.onClick,style:{maxWidth:180,...A.overflowDotsStyle,...n&&n(p,t)},appearance:"transparent"},t.id)),d>0&&g.jsx(I.FiltersActionsTooltip,{groupLabel:l,items:p.items.map(t=>r?r(p,t):t.label.toString()),children:g.jsxs("span",{className:f.chipsGroupCount,children:["+",d]})})]})}return g.jsx(w.Chip,{className:f.chip,title:"Удалить фильтр",view:"default",text:r?r(null,e):e.label.toString(),size:"xs",pilled:!0,onClick:e.onClick,style:{maxWidth:150,...A.overflowDotsStyle,...n&&n(e,void 0)},appearance:"transparent"})},H=(e,i)=>{y.useEffect(()=>{var p;if(!i)return;const h=(p=e.current)==null?void 0:p.querySelector(".tabs-clip-scroll"),n=h==null?void 0:h.firstElementChild;if(!h)return;const u=()=>{h.dispatchEvent(new Event("scroll",{bubbles:!0}))},r=q.createSafeResizeObserver(u);return r.observe(h),n&&r.observe(n),()=>{r.disconnect()}},[e,i])},P=(e,i,h)=>{var c,s;const n=y.useRef(null),u=!!n.current,[r,p]=y.useState(0),b=n.current,d=(c=n.current)==null?void 0:c.firstChild,l=(s=n.current)==null?void 0:s.lastChild,t=(b&&d&&l&&b.offsetWidth-d.offsetWidth-l.offsetWidth-i*2-h*2)??void 0;return y.useEffect(()=>{const o=n.current;let m=0;function j(){m=(o==null?void 0:o.offsetWidth)??0,p(m)}j();const S=q.createSafeResizeObserver(j);return e&&o&&S.observe(o),()=>{S.disconnect()}},[e,u]),{refForContainer:n,maxWidthForCenterElement:t}},K={xs:{height:32,paddingInline:0}},D=1,F=`${D}px solid ${()=>A.COLORS.border}`,U=B(w.Tabs).withConfig({displayName:"ListOfFilters__StyledTabs"})({"&":{"& .tabs-clip-scroll":{overflowY:"hidden"},"& button.tab-item-animated":{marginLeft:"8px","&:first-of-type":{marginLeft:"0px"}}}}),Z=({opened:e,items:i,clearAll:h,size:n="xs",paddingTop:u=0,maxLengthInGroup:r=2,ellipsisLabel:p=!1,sizeOnOpen:b,leftSlot:d,paddingInline:l,maxHeight:t,chipStyle:c,renderGroupLabel:s,renderChipLabel:o,showResetAllFiltersButton:m=!0,extraCss:j={}})=>{const S=K[n],z=l??S.paddingInline,C=t??S.height,{refForContainer:L}=P(e,z,D);return q.useDebouncedValue(e,200),H(L,e),g.jsx(T.Collapse,{isOpen:e,sizeOnOpen:b??C+u,unMountOnClose:!0,children:g.jsxs(O.Box,{ref:L,className:f.container,$css:{display:"flex",borderInline:F,borderTop:F,paddingInline:z,maxHeight:C,marginTop:u,flexDirection:"row-reverse",...j},children:[g.jsx(O.Box,{$css:"display: inline;",children:d??null}),g.jsx(U,{className:f.chipsContainer,view:"clear",size:"xs",style:{height:C-D,flex:1,minWidth:0,overflow:"hidden"},children:!!i.length&&i.map((a,x)=>{let v;return"groupId"in a&&(v=a.groupId??x),"id"in a&&(v=a.id??x),g.jsx(w.TabItem,{view:"clear",onClick:E=>E.preventDefault(),children:g.jsx(V,{maxLengthInGroup:r,ellipsisLabel:p,itemOrGroup:a,chipStyle:c,renderGroupLabel:s,renderChipLabel:o})},v)})}),g.jsx(O.Box,{className:f.clearButtonBlock,$css:"display: inline-flex; margin-left: auto;",children:m&&g.jsx(w.Button,{view:"clear",size:"xs",text:"Сбросить все",disabled:!i.length,contentLeft:g.jsx($.IconClose,{size:"xs",color:"inherit"}),onClick:h})})]})})},R=y.memo(Z),X=e=>e==null?"":e instanceof Date?e.toLocaleDateString():Array.isArray(e)?e.map(i=>i instanceof Date?i.toLocaleDateString():String(i??"")).join(", "):String(e),Y=({filters:e,filtersInfo:i,options:h,updateFilters:n,order:u})=>{const{labelFromValueMaps:r}=y.useMemo(()=>{const d={};for(const l of Object.entries(h)){const[t,c]=l;d[t]=new Map(c.map(s=>[String(s.value),s.label]))}return{labelFromValueMaps:d}},[h]),p=y.useCallback(()=>{for(const d of Object.entries(i)){const[l,t]=d;n(l,t.clearedValue)}},[i,n]);return{...y.useMemo(()=>{const d=Object.entries(e).reduce((t,c)=>{var L;const s=c[0],o=c[1],m=Array.isArray(o);if(!(m&&o.length||!m&&o&&o!==!1)||o===i[s].clearedValue)return t;if(typeof o=="boolean"){const a={id:s,label:i[s].label,onClick:()=>{n(s,i[s].clearedValue)}};return t.push(a),t}const C={groupId:s,groupLabel:i[s].label,items:[]};if(m)C.items=o.map(a=>{var x,v;return{id:a,label:((v=(x=r==null?void 0:r[s])==null?void 0:x.get)==null?void 0:v.call(x,a))??a.toString(),onClick:()=>{n(s,o.filter(E=>E!==a))}}});else{const a=r==null?void 0:r[s],x=((L=a==null?void 0:a.get)==null?void 0:L.call(a,o))??X(o);C.items=[{id:o.toString(),label:x,onClick:()=>{n(s,"clearedValue"in i[s]?i[s].clearedValue:"")}}]}return t.push(C),t},[]);let l=d;if(u&&u!=="default"){if(typeof u=="function")l=u(d);else if(Array.isArray(u)){const t=new Map;d.forEach(c=>{const s="groupId"in c?c.groupId:String(c.id);t.set(s,c)}),l=[],u.forEach(c=>{const s=t.get(c);s&&(l.push(s),t.delete(c))}),t.size>0&&Array.from(t.keys()).sort().forEach(s=>{const o=t.get(s);o&&l.push(o)})}}return{filterListOpened:d.length>0,filterList:l}},[e,i,r,n,u]),clearAll:p,labelFromValueMaps:r}},J=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));exports.ListOfFilters=R;exports.ListOfFilters_lazy=J;exports.isGroup=N;exports.listOfFiltersClassNames=f;exports.useFiltersList=Y;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { useEffect as B, useRef as j, useState as I, memo as R, useMemo as D, useCallback as V } from "react";
|
|
2
|
+
import { jsxs as E, jsx as g } from "react/jsx-runtime";
|
|
3
|
+
import { Box as A } from "../components/Box/index.mjs";
|
|
4
|
+
import { Chip as O, ChipGroup as F, TabItem as G, Button as M, Tabs as H } from "@salutejs/sdds-finai";
|
|
5
|
+
import { Collapse as P } from "../components/Collapse/index.mjs";
|
|
6
|
+
import { o as N, C as q } from "./Table-XpsCe-vS.mjs";
|
|
7
|
+
import { IconClose as K } from "@salutejs/plasma-icons";
|
|
8
|
+
import { c as T, u as U } from "./utils-C5SQhoON.mjs";
|
|
9
|
+
import W, { css as Z } from "styled-components";
|
|
10
|
+
import { borderRadiusS as X, textPrimary as Y, onLightTextSecondary as J, bodyS as Q } from "@salutejs/sdds-themes/tokens/sdds_finai";
|
|
11
|
+
import { F as tt } from "./FiltersActions-Be9uBM67.mjs";
|
|
12
|
+
const x = "list-of-filters", h = {
|
|
13
|
+
chipsGroup: `${x}__chip-group`,
|
|
14
|
+
chipsGroupLabel: `${x}__chip-group__label`,
|
|
15
|
+
chipsGroupCount: `${x}__chip-group__count`,
|
|
16
|
+
chip: `${x}__chip`,
|
|
17
|
+
clearButtonBlock: `${x}__clear-button-block`,
|
|
18
|
+
chipsContainer: `${x}__chips-container`,
|
|
19
|
+
container: `${x}__container`
|
|
20
|
+
}, et = (t) => "groupId" in t, it = () => Z(Q), st = 250, nt = W(F).withConfig({
|
|
21
|
+
displayName: "ChipOrGroup__StyledChipGroup"
|
|
22
|
+
})(["&{border-radius:", ";padding:4px 2px;", " align-items:center;&.", "{gap:4px;& .", ":first-child,& .", " + .", "{margin-left:4px;}& .", "{display:inline-block;min-width:0;max-width:", "px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}& .", "{color:", ";margin-left:4px;}& .", " svg{color:", " !important;}}}"], () => X, () => it(), h.chipsGroup, h.chip, h.chipsGroupLabel, h.chip, h.chipsGroupLabel, st, h.chipsGroupCount, () => Y, h.chip, () => J), ot = ({
|
|
23
|
+
itemOrGroup: t,
|
|
24
|
+
maxLengthInGroup: s = 2,
|
|
25
|
+
ellipsisLabel: d = !1,
|
|
26
|
+
chipStyle: n,
|
|
27
|
+
renderGroupLabel: f,
|
|
28
|
+
renderChipLabel: o
|
|
29
|
+
}) => {
|
|
30
|
+
if (et(t)) {
|
|
31
|
+
const p = t, b = p.items.slice(0, s), u = p.items.length - b.length, l = f ? f(p) : p.groupLabel;
|
|
32
|
+
return /* @__PURE__ */ E(nt, { className: h.chipsGroup, size: "xs", gap: "wide", view: "default", isCommonChipStyles: !1, children: [
|
|
33
|
+
d ? /* @__PURE__ */ g("span", { className: h.chipsGroupLabel, title: l, children: l }) : l,
|
|
34
|
+
b.map((e) => /* @__PURE__ */ g(O, { className: h.chip, title: "Удалить фильтр", view: "default", text: o ? o(p, e) : e.label.toString(), size: "xs", pilled: !0, onClick: e.onClick, style: {
|
|
35
|
+
maxWidth: 180,
|
|
36
|
+
...N,
|
|
37
|
+
...n && n(p, e)
|
|
38
|
+
}, appearance: "transparent" }, e.id)),
|
|
39
|
+
u > 0 && /* @__PURE__ */ g(tt, { groupLabel: l, items: p.items.map((e) => o ? o(p, e) : e.label.toString()), children: /* @__PURE__ */ E("span", { className: h.chipsGroupCount, children: [
|
|
40
|
+
"+",
|
|
41
|
+
u
|
|
42
|
+
] }) })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ g(O, { className: h.chip, title: "Удалить фильтр", view: "default", text: o ? o(null, t) : t.label.toString(), size: "xs", pilled: !0, onClick: t.onClick, style: {
|
|
46
|
+
maxWidth: 150,
|
|
47
|
+
...N,
|
|
48
|
+
...n && n(t, void 0)
|
|
49
|
+
}, appearance: "transparent" });
|
|
50
|
+
}, rt = (t, s) => {
|
|
51
|
+
B(() => {
|
|
52
|
+
var p;
|
|
53
|
+
if (!s)
|
|
54
|
+
return;
|
|
55
|
+
const d = (p = t.current) == null ? void 0 : p.querySelector(".tabs-clip-scroll"), n = d == null ? void 0 : d.firstElementChild;
|
|
56
|
+
if (!d)
|
|
57
|
+
return;
|
|
58
|
+
const o = T(() => {
|
|
59
|
+
d.dispatchEvent(new Event("scroll", {
|
|
60
|
+
bubbles: !0
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
63
|
+
return o.observe(d), n && o.observe(n), () => {
|
|
64
|
+
o.disconnect();
|
|
65
|
+
};
|
|
66
|
+
}, [t, s]);
|
|
67
|
+
}, lt = (t, s, d) => {
|
|
68
|
+
var c, i;
|
|
69
|
+
const n = j(null), f = !!n.current, [o, p] = I(0), b = n.current, u = (c = n.current) == null ? void 0 : c.firstChild, l = (i = n.current) == null ? void 0 : i.lastChild, e = (b && u && l && b.offsetWidth - u.offsetWidth - l.offsetWidth - s * 2 - d * 2) ?? void 0;
|
|
70
|
+
return B(() => {
|
|
71
|
+
const r = n.current;
|
|
72
|
+
let y = 0;
|
|
73
|
+
function w() {
|
|
74
|
+
y = (r == null ? void 0 : r.offsetWidth) ?? 0, p(y);
|
|
75
|
+
}
|
|
76
|
+
w();
|
|
77
|
+
const _ = T(w);
|
|
78
|
+
return t && r && _.observe(r), () => {
|
|
79
|
+
_.disconnect();
|
|
80
|
+
};
|
|
81
|
+
}, [t, f]), {
|
|
82
|
+
refForContainer: n,
|
|
83
|
+
maxWidthForCenterElement: e
|
|
84
|
+
};
|
|
85
|
+
}, ct = {
|
|
86
|
+
xs: {
|
|
87
|
+
height: 32,
|
|
88
|
+
paddingInline: 0
|
|
89
|
+
}
|
|
90
|
+
}, z = 1, $ = `${z}px solid ${() => q.border}`, at = W(H).withConfig({
|
|
91
|
+
displayName: "ListOfFilters__StyledTabs"
|
|
92
|
+
})({
|
|
93
|
+
"&": {
|
|
94
|
+
"& .tabs-clip-scroll": {
|
|
95
|
+
overflowY: "hidden"
|
|
96
|
+
},
|
|
97
|
+
"& button.tab-item-animated": {
|
|
98
|
+
marginLeft: "8px",
|
|
99
|
+
"&:first-of-type": {
|
|
100
|
+
marginLeft: "0px"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}), pt = ({
|
|
105
|
+
opened: t,
|
|
106
|
+
items: s,
|
|
107
|
+
clearAll: d,
|
|
108
|
+
size: n = "xs",
|
|
109
|
+
paddingTop: f = 0,
|
|
110
|
+
maxLengthInGroup: o = 2,
|
|
111
|
+
ellipsisLabel: p = !1,
|
|
112
|
+
sizeOnOpen: b,
|
|
113
|
+
leftSlot: u,
|
|
114
|
+
paddingInline: l,
|
|
115
|
+
maxHeight: e,
|
|
116
|
+
chipStyle: c,
|
|
117
|
+
renderGroupLabel: i,
|
|
118
|
+
renderChipLabel: r,
|
|
119
|
+
showResetAllFiltersButton: y = !0,
|
|
120
|
+
extraCss: w = {}
|
|
121
|
+
}) => {
|
|
122
|
+
const _ = ct[n], L = l ?? _.paddingInline, C = e ?? _.height, {
|
|
123
|
+
refForContainer: v
|
|
124
|
+
} = lt(t, L, z);
|
|
125
|
+
return U(t, 200), rt(v, t), /* @__PURE__ */ g(P, { isOpen: t, sizeOnOpen: b ?? C + f, unMountOnClose: !0, children: /* @__PURE__ */ E(A, { ref: v, className: h.container, $css: {
|
|
126
|
+
display: "flex",
|
|
127
|
+
borderInline: $,
|
|
128
|
+
borderTop: $,
|
|
129
|
+
paddingInline: L,
|
|
130
|
+
maxHeight: C,
|
|
131
|
+
marginTop: f,
|
|
132
|
+
// transition: `all ${DURATION}s ease`,
|
|
133
|
+
flexDirection: "row-reverse",
|
|
134
|
+
...w
|
|
135
|
+
}, children: [
|
|
136
|
+
/* @__PURE__ */ g(A, { $css: "display: inline;", children: u ?? null }),
|
|
137
|
+
/* @__PURE__ */ g(at, { className: h.chipsContainer, view: "clear", size: "xs", style: {
|
|
138
|
+
height: C - z,
|
|
139
|
+
flex: 1,
|
|
140
|
+
// Добавляем стили вместо maxWidthForCenterElement
|
|
141
|
+
minWidth: 0,
|
|
142
|
+
// Добавляем стили вместо maxWidthForCenterElement
|
|
143
|
+
overflow: "hidden"
|
|
144
|
+
// Добавляем стили вместо maxWidthForCenterElement
|
|
145
|
+
// width: maxWidthForCenterElement, // убираем. в splitView вызывает "дерганье"
|
|
146
|
+
}, children: !!s.length && s.map((a, m) => {
|
|
147
|
+
let S;
|
|
148
|
+
return "groupId" in a && (S = a.groupId ?? m), "id" in a && (S = a.id ?? m), /* @__PURE__ */ g(G, { view: "clear", onClick: (k) => k.preventDefault(), children: /* @__PURE__ */ g(ot, { maxLengthInGroup: o, ellipsisLabel: p, itemOrGroup: a, chipStyle: c, renderGroupLabel: i, renderChipLabel: r }) }, S);
|
|
149
|
+
}) }),
|
|
150
|
+
/* @__PURE__ */ g(A, { className: h.clearButtonBlock, $css: "display: inline-flex; margin-left: auto;", children: y && /* @__PURE__ */ g(M, { view: "clear", size: "xs", text: "Сбросить все", disabled: !s.length, contentLeft: /* @__PURE__ */ g(K, { size: "xs", color: "inherit" }), onClick: d }) })
|
|
151
|
+
] }) });
|
|
152
|
+
}, ut = R(pt), ft = (t) => t == null ? "" : t instanceof Date ? t.toLocaleDateString() : Array.isArray(t) ? t.map((s) => s instanceof Date ? s.toLocaleDateString() : String(s ?? "")).join(", ") : String(t), vt = ({
|
|
153
|
+
filters: t,
|
|
154
|
+
filtersInfo: s,
|
|
155
|
+
options: d,
|
|
156
|
+
updateFilters: n,
|
|
157
|
+
order: f
|
|
158
|
+
}) => {
|
|
159
|
+
const {
|
|
160
|
+
labelFromValueMaps: o
|
|
161
|
+
} = D(() => {
|
|
162
|
+
const u = {};
|
|
163
|
+
for (const l of Object.entries(d)) {
|
|
164
|
+
const [e, c] = l;
|
|
165
|
+
u[e] = new Map(c.map((i) => [String(i.value), i.label]));
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
labelFromValueMaps: u
|
|
169
|
+
};
|
|
170
|
+
}, [d]), p = V(() => {
|
|
171
|
+
for (const u of Object.entries(s)) {
|
|
172
|
+
const [l, e] = u;
|
|
173
|
+
n(l, e.clearedValue);
|
|
174
|
+
}
|
|
175
|
+
}, [s, n]);
|
|
176
|
+
return {
|
|
177
|
+
...D(() => {
|
|
178
|
+
const u = Object.entries(t).reduce((e, c) => {
|
|
179
|
+
var v;
|
|
180
|
+
const i = c[0], r = c[1], y = Array.isArray(r);
|
|
181
|
+
if (!(y && r.length || !y && r && r !== !1) || r === s[i].clearedValue)
|
|
182
|
+
return e;
|
|
183
|
+
if (typeof r == "boolean") {
|
|
184
|
+
const a = {
|
|
185
|
+
id: i,
|
|
186
|
+
label: s[i].label,
|
|
187
|
+
onClick: () => {
|
|
188
|
+
n(i, s[i].clearedValue);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
return e.push(a), e;
|
|
192
|
+
}
|
|
193
|
+
const C = {
|
|
194
|
+
groupId: i,
|
|
195
|
+
groupLabel: s[i].label,
|
|
196
|
+
items: []
|
|
197
|
+
};
|
|
198
|
+
if (y)
|
|
199
|
+
C.items = r.map((a) => {
|
|
200
|
+
var m, S;
|
|
201
|
+
return {
|
|
202
|
+
id: a,
|
|
203
|
+
label: ((S = (m = o == null ? void 0 : o[i]) == null ? void 0 : m.get) == null ? void 0 : S.call(m, a)) ?? a.toString(),
|
|
204
|
+
onClick: () => {
|
|
205
|
+
n(i, r.filter((k) => k !== a));
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
else {
|
|
210
|
+
const a = o == null ? void 0 : o[i], m = (
|
|
211
|
+
// если это - single select, combobox; (имеют свои label), то otherLabelOptions имеется.
|
|
212
|
+
((v = a == null ? void 0 : a.get) == null ? void 0 : v.call(a, r)) ?? ft(r)
|
|
213
|
+
);
|
|
214
|
+
C.items = [{
|
|
215
|
+
id: r.toString(),
|
|
216
|
+
label: m,
|
|
217
|
+
onClick: () => {
|
|
218
|
+
n(i, "clearedValue" in s[i] ? s[i].clearedValue : "");
|
|
219
|
+
}
|
|
220
|
+
}];
|
|
221
|
+
}
|
|
222
|
+
return e.push(C), e;
|
|
223
|
+
}, []);
|
|
224
|
+
let l = u;
|
|
225
|
+
if (f && f !== "default") {
|
|
226
|
+
if (typeof f == "function")
|
|
227
|
+
l = f(u);
|
|
228
|
+
else if (Array.isArray(f)) {
|
|
229
|
+
const e = /* @__PURE__ */ new Map();
|
|
230
|
+
u.forEach((c) => {
|
|
231
|
+
const i = "groupId" in c ? c.groupId : String(c.id);
|
|
232
|
+
e.set(i, c);
|
|
233
|
+
}), l = [], f.forEach((c) => {
|
|
234
|
+
const i = e.get(c);
|
|
235
|
+
i && (l.push(i), e.delete(c));
|
|
236
|
+
}), e.size > 0 && Array.from(e.keys()).sort().forEach((i) => {
|
|
237
|
+
const r = e.get(i);
|
|
238
|
+
r && l.push(r);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
filterListOpened: u.length > 0,
|
|
244
|
+
filterList: l
|
|
245
|
+
};
|
|
246
|
+
}, [t, s, o, n, f]),
|
|
247
|
+
clearAll: p,
|
|
248
|
+
labelFromValueMaps: o
|
|
249
|
+
};
|
|
250
|
+
}, Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
251
|
+
__proto__: null,
|
|
252
|
+
default: ut
|
|
253
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
254
|
+
export {
|
|
255
|
+
ut as L,
|
|
256
|
+
Lt as a,
|
|
257
|
+
et as i,
|
|
258
|
+
h as l,
|
|
259
|
+
vt as u
|
|
260
|
+
};
|
|
@@ -3,13 +3,13 @@ import { Divider as Ft, EmbedIconButton as Kt, LinkButton as Zt, Button as Pt, D
|
|
|
3
3
|
import { IconDoubleDisclosureUp as ee, IconDotsVerticalCenteredOutline as ne } from "@salutejs/plasma-icons";
|
|
4
4
|
import { c as Ut, d as qt, i as se, p as ie } from "./utils-C5SQhoON.mjs";
|
|
5
5
|
import { useMemo as Xt, useCallback as pt, useRef as $, useState as ht, useEffect as st, useLayoutEffect as oe } from "react";
|
|
6
|
-
import { T as jt, A as ce } from "./Table-
|
|
6
|
+
import { T as jt, A as ce } from "./Table-XpsCe-vS.mjs";
|
|
7
7
|
import { s as Jt } from "../constants/index.mjs";
|
|
8
8
|
import { surfaceSolidCard as re, outlineSolidPrimary as le, shadowDownHardS as ae, spacing10x as de } from "@salutejs/sdds-themes/tokens/sdds_finai";
|
|
9
9
|
import U, { css as yt } from "styled-components";
|
|
10
10
|
import { Box as kt } from "../components/Box/index.mjs";
|
|
11
11
|
import { Collapse as ue } from "../components/Collapse/index.mjs";
|
|
12
|
-
import { T as zt } from "./AnalyticalWidget-
|
|
12
|
+
import { T as zt } from "./AnalyticalWidget-DnHHyjnv.mjs";
|
|
13
13
|
const mt = 24, k = 4, Ct = 44, Yt = 40, Tt = 24, it = {
|
|
14
14
|
top: 12,
|
|
15
15
|
right: 8,
|