@daisforge/ui 1.14.1 → 1.15.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-BSpo7GCr.mjs +535 -0
- package/chunks/AnalyticalWidget-D_g7b36w.cjs +43 -0
- package/chunks/{ApprovalCenter-XCXGHaEP.mjs → ApprovalCenter-B0yUrIFR.mjs} +1 -1
- package/chunks/{ApprovalCenter-DG3YvEkY.cjs → ApprovalCenter-BeD-ALq3.cjs} +1 -1
- package/chunks/{BlockTitle-3YmyxJHJ.cjs → BlockTitle-BcV_T7TJ.cjs} +1 -1
- package/chunks/{BlockTitle-DDWF1ZeV.mjs → BlockTitle-D-4agd3o.mjs} +1 -1
- package/chunks/{FiltersActions-C38x0y5T.mjs → FiltersActions-DlV5c-6Y.mjs} +3 -3
- package/chunks/{FiltersActions-CvAwGV9F.cjs → FiltersActions-Dw5QqWa8.cjs} +1 -1
- package/chunks/{GridDND-BnK1dEhJ.mjs → GridDND-BhSmT9qp.mjs} +125 -131
- package/chunks/GridDND-D7-FwG3y.cjs +1 -0
- package/chunks/{ListOfFilters-DNzfSG-p.cjs → ListOfFilters-DEkjOH7o.cjs} +1 -1
- package/chunks/{ListOfFilters-Cji5UH2J.mjs → ListOfFilters-DngSRGOp.mjs} +2 -2
- package/chunks/{MassActions-BOG04zip.mjs → MassActions-CA35MxqC.mjs} +2 -2
- package/chunks/{MassActions-DCk9APKP.cjs → MassActions-Cphn-d4v.cjs} +1 -1
- package/chunks/{PageTitle-CQ_6jZ0x.mjs → PageTitle-BjLWtqbD.mjs} +1 -1
- package/chunks/{PageTitle-BIllremL.cjs → PageTitle-S-pY5lbg.cjs} +1 -1
- package/chunks/{Stories-dFpUqS5T.mjs → Stories-BCtwdhv0.mjs} +1 -1
- package/chunks/{Stories-e_CX_1CS.cjs → Stories-CkjLhZAi.cjs} +1 -1
- package/chunks/{Table-CrJFfavU.cjs → Table-C2ehPQDQ.cjs} +1 -1
- package/chunks/{Table-f0CmcIhI.mjs → Table-DBKZzRuR.mjs} +4 -4
- package/chunks/{TableCanvas-1bi1WWeP.mjs → TableCanvas-1y-yKIq1.mjs} +4 -4
- package/chunks/{TableCanvas-DqF5YxEY.cjs → TableCanvas-CE8Fv99t.cjs} +1 -1
- package/components/AnalyticalWidget/AnalyticalWidget.constants.d.ts +2 -0
- package/components/AnalyticalWidget/AnalyticalWidget.d.ts +13 -54
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/AnalyticalWidgetIconButtonDots.d.ts +14 -0
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/AnalyticalWidgetIconButtonDots.styled.d.ts +3 -0
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.d.ts +3 -2
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.mjs +4 -3
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.mjs +2 -2
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/AnalyticalWidgetHeader.d.ts +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/AnalyticalWidgetHeader.styled.d.ts +1 -75
- 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/GridDND.ItemWrapper.d.ts +1 -2
- package/components/GridDND/GridDND.d.ts +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/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/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/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 +1 -1
- 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-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 +1 -1
- 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/index.cjs +1 -1
- package/components/TableCanvas/types/index.mjs +1 -1
- 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/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/mcp-data/component-index.json +57 -131
- package/package.json +1 -1
- package/shared/utils/inputs/index.cjs +1 -1
- package/shared/utils/inputs/index.mjs +6 -6
- package/chunks/AnalyticalWidget-B6czTLSw.cjs +0 -43
- package/chunks/AnalyticalWidget-BWggL9xa.mjs +0 -528
- package/chunks/GridDND-CVAlpElj.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-08-
|
|
3
|
-
"libVersion": "1.
|
|
2
|
+
"generatedAt": "2026-08-24T15:14:49.679Z",
|
|
3
|
+
"libVersion": "1.15.0",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"name": "Accordion",
|
|
@@ -570,12 +570,6 @@
|
|
|
570
570
|
"required": false,
|
|
571
571
|
"description": "Стили для метки (badge). Позволяет переопределить, например, text-transform"
|
|
572
572
|
},
|
|
573
|
-
{
|
|
574
|
-
"name": "hrefProps",
|
|
575
|
-
"type": "{ onClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined; onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined; } | undefined",
|
|
576
|
-
"required": false,
|
|
577
|
-
"description": "Дополнительные свойства для `href элемента`. Не будет работать, если не заполнено свойство `href`"
|
|
578
|
-
},
|
|
579
573
|
{
|
|
580
574
|
"name": "infoTooltipProps",
|
|
581
575
|
"type": "Omit<TooltipProps, \"text\" | \"target\"> | undefined",
|
|
@@ -618,6 +612,13 @@
|
|
|
618
612
|
"type": "Omit<TooltipProps, \"text\" | \"target\"> | undefined",
|
|
619
613
|
"required": false,
|
|
620
614
|
"description": "Пропсы для Tooltip заголовка"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"name": "hrefProps",
|
|
618
|
+
"type": "{ onClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined; onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined; } | undefined",
|
|
619
|
+
"required": false,
|
|
620
|
+
"description": "",
|
|
621
|
+
"deprecated": true
|
|
621
622
|
}
|
|
622
623
|
]
|
|
623
624
|
},
|
|
@@ -779,8 +780,22 @@
|
|
|
779
780
|
},
|
|
780
781
|
{
|
|
781
782
|
"name": "DotsIconButton",
|
|
782
|
-
"typeName": "
|
|
783
|
+
"typeName": "AnalyticalWidgetIconButtonDotsProps",
|
|
783
784
|
"props": [
|
|
785
|
+
{
|
|
786
|
+
"name": "absolute",
|
|
787
|
+
"type": "boolean | undefined",
|
|
788
|
+
"required": false,
|
|
789
|
+
"description": "Позиционировать кнопку абсолютом в правом верхнем углу ближайшего\nrelative-контейнера. Для потребителей (напр. GridDND рабочих столов),\nу которых нет доступа к контенту виджета.",
|
|
790
|
+
"default": "false"
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
"name": "absoluteOffset",
|
|
794
|
+
"type": "number | undefined",
|
|
795
|
+
"required": false,
|
|
796
|
+
"description": "Отступ (top/right) при `absolute`.",
|
|
797
|
+
"default": "12"
|
|
798
|
+
},
|
|
784
799
|
{
|
|
785
800
|
"name": "as",
|
|
786
801
|
"type": "keyof JSX.IntrinsicElements | React.ComponentType<any> | undefined",
|
|
@@ -798,7 +813,7 @@
|
|
|
798
813
|
"type": "\"horizontal\" | \"vertical\" | undefined",
|
|
799
814
|
"required": false,
|
|
800
815
|
"description": "",
|
|
801
|
-
"default": "'
|
|
816
|
+
"default": "'vertical'"
|
|
802
817
|
},
|
|
803
818
|
{
|
|
804
819
|
"name": "iconSize",
|
|
@@ -806,48 +821,6 @@
|
|
|
806
821
|
"required": false,
|
|
807
822
|
"description": ""
|
|
808
823
|
},
|
|
809
|
-
{
|
|
810
|
-
"name": "additionalContent",
|
|
811
|
-
"type": "React.ReactNode",
|
|
812
|
-
"required": false,
|
|
813
|
-
"description": ""
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
"name": "appearance",
|
|
817
|
-
"type": "\"default\" | \"outline\" | undefined",
|
|
818
|
-
"required": false,
|
|
819
|
-
"description": ""
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
"name": "blur",
|
|
823
|
-
"type": "\"small\" | \"medium\" | \"large\" | undefined",
|
|
824
|
-
"required": false,
|
|
825
|
-
"description": ""
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
"name": "contentLeft",
|
|
829
|
-
"type": "React.ReactNode",
|
|
830
|
-
"required": false,
|
|
831
|
-
"description": ""
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
"name": "contentPlacing",
|
|
835
|
-
"type": "\"default\" | \"relaxed\" | undefined",
|
|
836
|
-
"required": false,
|
|
837
|
-
"description": ""
|
|
838
|
-
},
|
|
839
|
-
{
|
|
840
|
-
"name": "contentRight",
|
|
841
|
-
"type": "React.ReactNode",
|
|
842
|
-
"required": false,
|
|
843
|
-
"description": ""
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
"name": "focused",
|
|
847
|
-
"type": "boolean | undefined",
|
|
848
|
-
"required": false,
|
|
849
|
-
"description": ""
|
|
850
|
-
},
|
|
851
824
|
{
|
|
852
825
|
"name": "isLoading",
|
|
853
826
|
"type": "boolean | undefined",
|
|
@@ -861,58 +834,17 @@
|
|
|
861
834
|
"description": ""
|
|
862
835
|
},
|
|
863
836
|
{
|
|
864
|
-
"name": "
|
|
865
|
-
"type": "
|
|
866
|
-
"required": false,
|
|
867
|
-
"description": ""
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
"name": "pin",
|
|
871
|
-
"type": "\"square-square\" | \"square-clear\" | \"clear-square\" | \"clear-clear\" | \"clear-circle\" | \"circle-clear\" | \"circle-circle\" | undefined",
|
|
872
|
-
"required": false,
|
|
873
|
-
"description": ""
|
|
874
|
-
},
|
|
875
|
-
{
|
|
876
|
-
"name": "shiftLeft",
|
|
877
|
-
"type": "boolean | undefined",
|
|
878
|
-
"required": false,
|
|
879
|
-
"description": ""
|
|
880
|
-
},
|
|
881
|
-
{
|
|
882
|
-
"name": "shiftRight",
|
|
883
|
-
"type": "boolean | undefined",
|
|
837
|
+
"name": "position",
|
|
838
|
+
"type": "any",
|
|
884
839
|
"required": false,
|
|
885
840
|
"description": ""
|
|
886
841
|
},
|
|
887
842
|
{
|
|
888
843
|
"name": "size",
|
|
889
|
-
"type": "\"xs\" | \"s\" | \"
|
|
844
|
+
"type": "\"xs\" | \"s\" | \"m\" | \"l\" | undefined",
|
|
890
845
|
"required": false,
|
|
891
|
-
"description": ""
|
|
892
|
-
|
|
893
|
-
{
|
|
894
|
-
"name": "square",
|
|
895
|
-
"type": "boolean | undefined",
|
|
896
|
-
"required": false,
|
|
897
|
-
"description": ""
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
"name": "stretch",
|
|
901
|
-
"type": "boolean | undefined",
|
|
902
|
-
"required": false,
|
|
903
|
-
"description": ""
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
"name": "stretching",
|
|
907
|
-
"type": "\"auto\" | \"filled\" | \"fixed\" | undefined",
|
|
908
|
-
"required": false,
|
|
909
|
-
"description": ""
|
|
910
|
-
},
|
|
911
|
-
{
|
|
912
|
-
"name": "text",
|
|
913
|
-
"type": "string | undefined",
|
|
914
|
-
"required": false,
|
|
915
|
-
"description": ""
|
|
846
|
+
"description": "",
|
|
847
|
+
"default": "'m'"
|
|
916
848
|
},
|
|
917
849
|
{
|
|
918
850
|
"name": "type",
|
|
@@ -920,17 +852,12 @@
|
|
|
920
852
|
"required": false,
|
|
921
853
|
"description": ""
|
|
922
854
|
},
|
|
923
|
-
{
|
|
924
|
-
"name": "value",
|
|
925
|
-
"type": "string | number | undefined",
|
|
926
|
-
"required": false,
|
|
927
|
-
"description": ""
|
|
928
|
-
},
|
|
929
855
|
{
|
|
930
856
|
"name": "view",
|
|
931
|
-
"type": "\"
|
|
857
|
+
"type": "\"default\" | \"secondary\" | \"accent\" | \"positive\" | \"warning\" | \"negative\" | \"info\" | undefined",
|
|
932
858
|
"required": false,
|
|
933
|
-
"description": ""
|
|
859
|
+
"description": "",
|
|
860
|
+
"default": "'secondary'"
|
|
934
861
|
}
|
|
935
862
|
]
|
|
936
863
|
},
|
|
@@ -979,25 +906,31 @@
|
|
|
979
906
|
],
|
|
980
907
|
"scope": "internal",
|
|
981
908
|
"docs": "# AnalyticalWidget\n\nАналитический виджет с адаптивным поведением и слотами для контента.\n\n## Ключевые особенности\n\n- Три размера (`L`, `M`, `S`) с разными параметрами высоты, ширины, border-radius и padding\n- Слоты: `headerSlot`, `topSlot`, `middleSlot` (только для `L`), `contentSlot`\n- `middleSlot` видим только при размере `L`\n- Прокрутка контентной области (`scrollable`)\n- Кастомизация через `classes`, `$css` и CSS-переменные\n\n## Compound-компоненты\n\n```ts\nAnalyticalWidget.Header = AnalyticalWidgetHeader;\nAnalyticalWidget.FilterIconButton = IconButtonFilter;\nAnalyticalWidget.DotsIconButton = IconButtonDots;\nAnalyticalWidget.Chips = AnalyticalWidgetChipsGroup;\n```\n\n- `AnalyticalWidget.Header` — шапка виджета с заголовком и слотами для действий\n- `AnalyticalWidget.FilterIconButton` — кнопка-иконка для фильтров (с поддержкой Dropdown). Поддерживает красный индикатор применения фильтров\n- `AnalyticalWidget.DotsIconButton` — кнопка-иконка для дополнительных действий (с поддержкой Dropdown)\n- `AnalyticalWidget.Chips` — чипы для отображения применённых фильтров\n\n## CSS-переменные\n\n- `--analytical-widget-bg` — фон всего виджета\n- `--analytical-widget-padding` — внутренние отступы контейнера\n- `--analytical-widget-br` — радиус скругления углов\n- `--analytical-widget-min-height` — минимальная высота контентной области\n\n## Особенности\n\n- Все параметры можно переопределить через CSS-переменные, нативные/кастомные классы компонента или проп `$css` для основного контейнера. Объект `analyticalWidgetClassNames` доступен для импорта\n- Кнопка троеточия вставляется через микрофронт другой командой — место под неё зарезервировано. В stories показан пример через `position: absolute`\n- Высота, ширина, border-radius, padding зависят от размера и имеют фиксированные значения\n\n<AnalyticalWidgetInfoAboutAdaptive />\n\nОписание типов и compound-пропсов — в разделе [API](/docs/композиции-analyticalwidget-api--docs).",
|
|
982
|
-
"apiDocs": "# AnalyticalWidget API\n\n## AnalyticalWidgetProps\n\n```typescript\ntype AnalyticalWidgetProps = {\n /**\n * Размер виджета\n */\n size: AnalyticalWidgetSize;\n /**\n * Добавление или удаление скролла у contentSlot\n */\n scrollable?: boolean;\n /**\n * ReactNode для шапки\n */\n headerSlot?: ReactNode;\n /**\n * ReactNode (в основном для фильтров)\n */\n topSlot?: ReactNode;\n /**\n * ReactNode (в основном для табов. Отображается только в режиме l)\n */\n middleSlot?: ReactNode;\n /**\n * ReactNode с контентом\n */\n contentSlot: ReactNode;\n /**\n * Кастомные классы для слотов и самого компонента\n */\n classes?: AnalyticalWidgetClasses;\n /**\n * Кастомные стили styled-components для основного контейнера виджета\n */\n $css?: string | CSSObject | FlattenSimpleInterpolation;\n};\n```\n\n## AnalyticalWidgetSize\n\n```typescript\ntype AnalyticalWidgetSize = 'l' | 'm' | 's';\n```\n\n## AnalyticalWidgetClasses\n\n```typescript\ntype AnalyticalWidgetClasses = {\n /**\n * Кастомный класс для root элемента\n */\n root?: string;\n /**\n * Кастомный класс для topSlot элемента\n */\n topSlot?: string;\n /**\n * Кастомный класс для middleSlot элемента\n */\n middleSlot?: string;\n /**\n * Кастомный класс для contentSlot элемента\n */\n contentSlot?: string;\n};\n```\n\n## Compound types\n\n### AnalyticalWidget.Header\n\n```typescript\ninterface AnalyticalWidgetHeaderProps {\n /**\n * Заголовок. При нехватке места будет обрезаться троеточием (truncated text) с Tooltip при наведении на обрезанный текст\n */\n title?: string;\n /**\n * Пропсы для Tooltip заголовка\n */\n titleTooltipProps?: Omit<TooltipProps, 'text' | 'target'>;\n /**\n * Метка справа от заголовка\n */\n badge?: string;\n /**\n * Стили для метки (badge). Позволяет переопределить, например, text-transform\n */\n badgeStyles?: CSSProperties;\n /**\n * Подзаголовок. При нехватке места будет обрезаться троеточием (truncated text) с Tooltip при наведении на обрезанный текст\n */\n subtitle?: string;\n /**\n * Пропсы для Tooltip подзаголовка\n */\n subtitleTooltipProps?: Omit<TooltipProps, 'text' | 'target'>;\n /**\n * Текст Tooltip при наведении на иконку i, справа от тега. Если не передать этот параметр, то иконка отображаться не будет\n */\n infoTooltipText?: string;\n /**\n * Пропсы для Tooltip иконки i, справа от тега.\n */\n infoTooltipProps?: Omit<TooltipProps, 'text' | 'target'>;\n /**\n *
|
|
909
|
+
"apiDocs": "# AnalyticalWidget API\n\n## AnalyticalWidgetProps\n\n```typescript\ntype AnalyticalWidgetProps = {\n /**\n * Размер виджета\n */\n size: AnalyticalWidgetSize;\n /**\n * Добавление или удаление скролла у contentSlot\n */\n scrollable?: boolean;\n /**\n * ReactNode для шапки\n */\n headerSlot?: ReactNode;\n /**\n * ReactNode (в основном для фильтров)\n */\n topSlot?: ReactNode;\n /**\n * ReactNode (в основном для табов. Отображается только в режиме l)\n */\n middleSlot?: ReactNode;\n /**\n * ReactNode с контентом\n */\n contentSlot: ReactNode;\n /**\n * Кастомные классы для слотов и самого компонента\n */\n classes?: AnalyticalWidgetClasses;\n /**\n * Кастомные стили styled-components для основного контейнера виджета\n */\n $css?: string | CSSObject | FlattenSimpleInterpolation;\n};\n```\n\n## AnalyticalWidgetSize\n\n```typescript\ntype AnalyticalWidgetSize = 'l' | 'm' | 's';\n```\n\n## AnalyticalWidgetClasses\n\n```typescript\ntype AnalyticalWidgetClasses = {\n /**\n * Кастомный класс для root элемента\n */\n root?: string;\n /**\n * Кастомный класс для topSlot элемента\n */\n topSlot?: string;\n /**\n * Кастомный класс для middleSlot элемента\n */\n middleSlot?: string;\n /**\n * Кастомный класс для contentSlot элемента\n */\n contentSlot?: string;\n};\n```\n\n## Compound types\n\n### AnalyticalWidget.Header\n\n```typescript\ninterface AnalyticalWidgetHeaderProps {\n /**\n * Заголовок. При нехватке места будет обрезаться троеточием (truncated text) с Tooltip при наведении на обрезанный текст\n */\n title?: string;\n /**\n * Пропсы для Tooltip заголовка\n */\n titleTooltipProps?: Omit<TooltipProps, 'text' | 'target'>;\n /**\n * Метка справа от заголовка\n */\n badge?: string;\n /**\n * Стили для метки (badge). Позволяет переопределить, например, text-transform\n */\n badgeStyles?: CSSProperties;\n /**\n * Подзаголовок. При нехватке места будет обрезаться троеточием (truncated text) с Tooltip при наведении на обрезанный текст\n */\n subtitle?: string;\n /**\n * Пропсы для Tooltip подзаголовка\n */\n subtitleTooltipProps?: Omit<TooltipProps, 'text' | 'target'>;\n /**\n * Текст Tooltip при наведении на иконку i, справа от тега. Если не передать этот параметр, то иконка отображаться не будет\n */\n infoTooltipText?: string;\n /**\n * Пропсы для Tooltip иконки i, справа от тега.\n */\n infoTooltipProps?: Omit<TooltipProps, 'text' | 'target'>;\n /**\n * @deprecated Стрелка больше не рисуется. Используйте `titleLinkProps`.\n */\n href?: string;\n /**\n * @deprecated Стрелка больше не рисуется. Используйте `titleLinkProps`.\n */\n hrefProps?: {\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n onKeyDown?: KeyboardEventHandler<HTMLAnchorElement>;\n };\n /**\n * Если необходимо title сделать ссылкой.\n * Пропсы для компонента Link, который оборачивает заголовок.\n * @default underline=\"none\"\n */\n titleLinkProps?: Omit<LinkCompProps, 'ref'>;\n /**\n * Слот для контента в правой части шапки\n */\n rightSlot?: ReactNode;\n /**\n * Имя класса для шапки\n */\n className?: string;\n}\n```\n\n### AnalyticalWidget.Chips\n\n```typescript\ntype AnalyticalWidgetFixedChipProps = ChipCompProps & {\n key?: string | number;\n};\n```\n\n### AnalyticalWidget.FilterIconButton\n\n```typescript\ntype IconButtonFilterProps = IconButtonProps & {\n redSquare?: boolean;\n dropdownProps?: ComponentProps<typeof Dropdown>;\n iconSize?: ComponentProps<typeof Icon>['size'];\n};\n```\n\n### AnalyticalWidget.DotsIconButton\n\n```typescript\ntype IconButtonDotsProps = IconButtonProps & {\n dropdownProps?: ComponentProps<typeof Dropdown>;\n iconSize?: ComponentProps<typeof Icon>['size'];\n iconOrientation?: 'horizontal' | 'vertical';\n};\n```",
|
|
983
910
|
"curatedStories": [
|
|
984
911
|
{
|
|
985
912
|
"exportName": "AnalyticalWidgetL",
|
|
986
913
|
"displayName": "AnalyticalWidgetL",
|
|
987
914
|
"type": "full-code",
|
|
988
|
-
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n
|
|
915
|
+
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n SegmentItem,\n AnalyticalWidget,\n textInfo\n} from '@daisforge/ui';\nimport type { ItemOrGroup } from '@daisforge/ui';\n\nimport React, { useMemo, useReducer, useState } from 'react';\n\ntype Filters = {\n searchedV: string;\n blocks: string[];\n tribes: string[];\n allocation: string;\n year: number | null;\n filterButton: string;\n dotsButton: string;\n};\n\nconst DEFAULT_FILTERS: Filters = {\n searchedV: '',\n blocks: [],\n tribes: [],\n allocation: '',\n year: null,\n filterButton: '',\n dotsButton: '',\n};\n\nconst LABELS: { [key in keyof Filters]: string } = {\n searchedV: 'Поиск',\n blocks: 'Блок',\n tribes: 'Трайб',\n allocation: 'Аллокация',\n year: 'Год',\n filterButton: 'Фильтры',\n dotsButton: 'Меню',\n};\n\nconst useFetch = (key: 'blocks' | 'tribes' | 'allocation', num = 10) =>\n useMemo(\n () =>\n Array(num)\n .fill(0)\n .map((_, i) => ({\n label: \\\n\n() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n const someItems = Array(3).fill(0);\n\n const { filterList, filterListOpened } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const chipsList = filterList\n .map((item) => {\n if ('groupLabel' in item) {\n return item.items.map((innerItem) => ({\n text: String(innerItem.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: innerItem.onClick,\n }));\n }\n return {\n text: String(item.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: item.onClick,\n };\n })\n .flat();\n\n return (\n <GridContainerL>\n <SegmentProvider defaultSelected={['item_0']}>\n <div\n style={{\n position: 'relative',\n width: 'min-content',\n }}\n >\n <AnalyticalWidget\n size=\"l\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Analytic widget L\"\n badge=\"TA\"\n subtitle=\"Monthly report\"\n rightSlot={\n <Flow\n alignment=\"center\"\n mainAxisGap=\"8px\"\n style={{\n flexWrap: 'nowrap',\n }}\n >\n <SegmentGroup hasBackground size=\"xs\">\n {someItems.map((_, i) => (\n <SegmentItem\n // eslint-disable-next-line react/no-array-index-key\n key={`item:${i}`}\n value={`item_${i}`}\n label={`Label${i + 1}`}\n size=\"xs\"\n view=\"primary\"\n />\n ))}\n </SegmentGroup>\n </Flow>\n }\n infoTooltipText=\"Info\"\n href=\"/\"\n />\n }\n topSlot={\n <Flow orientation=\"vertical\" mainAxisGap={8}>\n <AnalyticalWidget.Chips\n opened={filterListOpened}\n isWrapped\n gap=\"wide\"\n isCommonChipStyles={false}\n chips={chipsList}\n />\n </Flow>\n }\n contentSlot={\n <div\n style={{\n minHeight: 'fit-content',\n }}\n >\n {longText()}\n </div>\n }\n classes={{\n topSlot: 'myCustomClassForTopSlot',\n middleSlot: 'myCustomClassForMiddleSlot',\n contentSlot: 'myCustomClassForContentSlot',\n root: 'myCustomClassForRoot',\n }}\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </SegmentProvider>\n </GridContainerL>\n );\n }"
|
|
989
916
|
},
|
|
990
917
|
{
|
|
991
918
|
"exportName": "AnalyticalWidgetM",
|
|
992
919
|
"displayName": "AnalyticalWidgetM",
|
|
993
920
|
"type": "full-code",
|
|
994
|
-
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n
|
|
921
|
+
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n SegmentItem,\n AnalyticalWidget,\n textInfo\n} from '@daisforge/ui';\nimport type { ItemOrGroup } from '@daisforge/ui';\n\nimport React, { useMemo, useReducer, useState } from 'react';\n\ntype Filters = {\n searchedV: string;\n blocks: string[];\n tribes: string[];\n allocation: string;\n year: number | null;\n filterButton: string;\n dotsButton: string;\n};\n\nconst DEFAULT_FILTERS: Filters = {\n searchedV: '',\n blocks: [],\n tribes: [],\n allocation: '',\n year: null,\n filterButton: '',\n dotsButton: '',\n};\n\nconst LABELS: { [key in keyof Filters]: string } = {\n searchedV: 'Поиск',\n blocks: 'Блок',\n tribes: 'Трайб',\n allocation: 'Аллокация',\n year: 'Год',\n filterButton: 'Фильтры',\n dotsButton: 'Меню',\n};\n\nconst useFetch = (key: 'blocks' | 'tribes' | 'allocation', num = 10) =>\n useMemo(\n () =>\n Array(num)\n .fill(0)\n .map((_, i) => ({\n label: \\\n\n() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n const someItems = Array(3).fill(0);\n\n const { filterList, filterListOpened } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const chipsList = filterList\n .map((item, index) => {\n if ('groupLabel' in item) {\n return item.items.map((innerItem, innerIdex) => ({\n text: String(innerItem.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: innerItem.onClick,\n key: `chip-key${index}-${innerIdex}-${innerItem.label}`,\n }));\n }\n return {\n text: String(item.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: item.onClick,\n key: `chip-key-${index}-${item.label}`,\n };\n })\n .flat();\n\n return (\n <GridContainerM>\n <SegmentProvider defaultSelected={['item_0']}>\n <div\n style={{\n position: 'relative',\n width: 'min-content',\n }}\n >\n <AnalyticalWidget\n size=\"m\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Analytic widget M\"\n badge=\"TA\"\n subtitle=\"Monthly report\"\n rightSlot={\n <Flow\n alignment=\"center\"\n mainAxisGap=\"8px\"\n style={{\n flexWrap: 'nowrap',\n }}\n >\n <SegmentGroup hasBackground size=\"xs\">\n {someItems.map((_, i) => (\n <SegmentItem\n // eslint-disable-next-line react/no-array-index-key\n key={`item:${i}`}\n value={`item_${i}`}\n label={`Label${i + 1}`}\n size=\"xs\"\n view=\"primary\"\n />\n ))}\n </SegmentGroup>\n </Flow>\n }\n infoTooltipText=\"Info\"\n href=\"/\"\n />\n }\n topSlot={\n <Flow orientation=\"vertical\" mainAxisGap={8}>\n <AnalyticalWidget.Chips\n opened={filterListOpened}\n isWrapped\n gap=\"wide\"\n isCommonChipStyles={false}\n chips={chipsList}\n />\n </Flow>\n }\n contentSlot={\n <div\n style={{\n minHeight: 'fit-content',\n }}\n >\n {longText()}\n </div>\n }\n classes={{\n topSlot: 'myCustomClassForTopSlot',\n middleSlot: 'myCustomClassForMiddleSlot',\n contentSlot: 'myCustomClassForContentSlot',\n root: 'myCustomClassForRoot',\n }}\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </SegmentProvider>\n </GridContainerM>\n );\n }"
|
|
995
922
|
},
|
|
996
923
|
{
|
|
997
924
|
"exportName": "AnalyticalWidgetS",
|
|
998
925
|
"displayName": "AnalyticalWidgetS",
|
|
999
926
|
"type": "full-code",
|
|
1000
|
-
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n
|
|
927
|
+
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n SegmentItem,\n AnalyticalWidget,\n textInfo\n} from '@daisforge/ui';\nimport type { ItemOrGroup } from '@daisforge/ui';\n\nimport React, { useMemo, useReducer, useState } from 'react';\n\ntype Filters = {\n searchedV: string;\n blocks: string[];\n tribes: string[];\n allocation: string;\n year: number | null;\n filterButton: string;\n dotsButton: string;\n};\n\nconst DEFAULT_FILTERS: Filters = {\n searchedV: '',\n blocks: [],\n tribes: [],\n allocation: '',\n year: null,\n filterButton: '',\n dotsButton: '',\n};\n\nconst LABELS: { [key in keyof Filters]: string } = {\n searchedV: 'Поиск',\n blocks: 'Блок',\n tribes: 'Трайб',\n allocation: 'Аллокация',\n year: 'Год',\n filterButton: 'Фильтры',\n dotsButton: 'Меню',\n};\n\nconst useFetch = (key: 'blocks' | 'tribes' | 'allocation', num = 10) =>\n useMemo(\n () =>\n Array(num)\n .fill(0)\n .map((_, i) => ({\n label: \\\n\n() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n\n const { filterList, filterListOpened } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const chipsList = filterList\n .map((item) => {\n if ('groupLabel' in item) {\n return item.items.map((innerItem) => ({\n text: String(innerItem.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: innerItem.onClick,\n }));\n }\n return {\n text: String(item.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: item.onClick,\n };\n })\n .flat();\n\n return (\n <GridContainerS>\n <SegmentProvider defaultSelected={['item_0']}>\n <div\n style={{\n position: 'relative',\n width: 'min-content',\n }}\n >\n <AnalyticalWidget\n size=\"s\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Заголовок\"\n badge=\"TA\"\n subtitle=\"Подзаголовок здесь\"\n infoTooltipText=\"Info\"\n href=\"/\"\n />\n }\n topSlot={\n <Flow orientation=\"vertical\" mainAxisGap={8}>\n <AnalyticalWidget.Chips\n opened={filterListOpened}\n isWrapped\n gap=\"wide\"\n isCommonChipStyles={false}\n chips={chipsList}\n />\n </Flow>\n }\n contentSlot={\n <div\n style={{\n minHeight: 'fit-content',\n }}\n >\n {longText()}\n </div>\n }\n classes={{\n topSlot: 'myCustomClassForTopSlot',\n middleSlot: 'myCustomClassForMiddleSlot',\n contentSlot: 'myCustomClassForContentSlot',\n root: 'myCustomClassForRoot',\n }}\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </SegmentProvider>\n </GridContainerS>\n );\n }"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"exportName": "AnalyticalWidgetCustomTopSlot",
|
|
931
|
+
"displayName": "Custom topSlot + rightSlot",
|
|
932
|
+
"type": "full-code",
|
|
933
|
+
"code": "() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n const [period, setPeriod] = useState('month');\n\n const { filterList } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const customChips = filterList.flatMap((item) =>\n 'groupLabel' in item\n ? item.items.map((inner) => ({\n label: String(inner.label),\n onClick: inner.onClick,\n }))\n : [{ label: String(item.label), onClick: item.onClick }],\n );\n const hasChips = customChips.length > 0;\n const lastRef = useRef(customChips);\n if (hasChips) {\n lastRef.current = customChips;\n }\n const renderedChips = hasChips ? customChips : lastRef.current;\n\n return (\n <div style={{ padding: 20, background: 'grey' }}>\n <div style={{ position: 'relative', width: 600, height: 512 }}>\n <AnalyticalWidget\n size=\"l\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Custom topSlot\"\n badge=\"TA\"\n subtitle=\"Свои чипы + Select в rightSlot\"\n infoTooltipText=\"Info\"\n rightSlot={\n <Select\n size=\"xs\"\n value={period}\n onChange={(v) => setPeriod(v as string)}\n items={[\n { label: 'Месяц', value: 'month' },\n { label: 'Квартал', value: 'quarter' },\n { label: 'Год', value: 'year' },\n ]}\n />\n }\n />\n }\n topSlot={\n <div className={analyticalWidgetClassNames.selfSpacedTopSlot}>\n <Collapse isOpen={hasChips} unMountOnClose>\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 4,\n paddingTop: 8,\n }}\n >\n {renderedChips.map((chip, index) => (\n <button\n type=\"button\"\n // eslint-disable-next-line react/no-array-index-key\n key={`${chip.label}-${index}`}\n onClick={chip.onClick}\n style={{\n padding: '2px 8px',\n borderRadius: 12,\n background: 'rgba(0, 0, 0, 0.06)',\n border: 'none',\n fontSize: 12,\n lineHeight: '16px',\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n }}\n >\n {chip.label}\n </button>\n ))}\n </div>\n </Collapse>\n </div>\n }\n contentSlot={\n <div style={{ minHeight: 'fit-content' }}>{longText()}</div>\n }\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </div>\n );\n }"
|
|
1001
934
|
}
|
|
1002
935
|
],
|
|
1003
936
|
"hasCuratedMeta": true,
|
|
@@ -1010,26 +943,25 @@
|
|
|
1010
943
|
"exportName": "AnalyticalWidgetL",
|
|
1011
944
|
"displayName": "AnalyticalWidgetL",
|
|
1012
945
|
"type": "full-code",
|
|
1013
|
-
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n
|
|
946
|
+
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n SegmentItem,\n AnalyticalWidget,\n textInfo\n} from '@daisforge/ui';\nimport type { ItemOrGroup } from '@daisforge/ui';\n\nimport React, { useMemo, useReducer, useState } from 'react';\n\ntype Filters = {\n searchedV: string;\n blocks: string[];\n tribes: string[];\n allocation: string;\n year: number | null;\n filterButton: string;\n dotsButton: string;\n};\n\nconst DEFAULT_FILTERS: Filters = {\n searchedV: '',\n blocks: [],\n tribes: [],\n allocation: '',\n year: null,\n filterButton: '',\n dotsButton: '',\n};\n\nconst LABELS: { [key in keyof Filters]: string } = {\n searchedV: 'Поиск',\n blocks: 'Блок',\n tribes: 'Трайб',\n allocation: 'Аллокация',\n year: 'Год',\n filterButton: 'Фильтры',\n dotsButton: 'Меню',\n};\n\nconst useFetch = (key: 'blocks' | 'tribes' | 'allocation', num = 10) =>\n useMemo(\n () =>\n Array(num)\n .fill(0)\n .map((_, i) => ({\n label: \\\n\n() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n const someItems = Array(3).fill(0);\n\n const { filterList, filterListOpened } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const chipsList = filterList\n .map((item) => {\n if ('groupLabel' in item) {\n return item.items.map((innerItem) => ({\n text: String(innerItem.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: innerItem.onClick,\n }));\n }\n return {\n text: String(item.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: item.onClick,\n };\n })\n .flat();\n\n return (\n <GridContainerL>\n <SegmentProvider defaultSelected={['item_0']}>\n <div\n style={{\n position: 'relative',\n width: 'min-content',\n }}\n >\n <AnalyticalWidget\n size=\"l\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Analytic widget L\"\n badge=\"TA\"\n subtitle=\"Monthly report\"\n rightSlot={\n <Flow\n alignment=\"center\"\n mainAxisGap=\"8px\"\n style={{\n flexWrap: 'nowrap',\n }}\n >\n <SegmentGroup hasBackground size=\"xs\">\n {someItems.map((_, i) => (\n <SegmentItem\n // eslint-disable-next-line react/no-array-index-key\n key={`item:${i}`}\n value={`item_${i}`}\n label={`Label${i + 1}`}\n size=\"xs\"\n view=\"primary\"\n />\n ))}\n </SegmentGroup>\n </Flow>\n }\n infoTooltipText=\"Info\"\n href=\"/\"\n />\n }\n topSlot={\n <Flow orientation=\"vertical\" mainAxisGap={8}>\n <AnalyticalWidget.Chips\n opened={filterListOpened}\n isWrapped\n gap=\"wide\"\n isCommonChipStyles={false}\n chips={chipsList}\n />\n </Flow>\n }\n contentSlot={\n <div\n style={{\n minHeight: 'fit-content',\n }}\n >\n {longText()}\n </div>\n }\n classes={{\n topSlot: 'myCustomClassForTopSlot',\n middleSlot: 'myCustomClassForMiddleSlot',\n contentSlot: 'myCustomClassForContentSlot',\n root: 'myCustomClassForRoot',\n }}\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </SegmentProvider>\n </GridContainerL>\n );\n }"
|
|
1014
947
|
},
|
|
1015
948
|
{
|
|
1016
949
|
"exportName": "AnalyticalWidgetM",
|
|
1017
950
|
"displayName": "AnalyticalWidgetM",
|
|
1018
951
|
"type": "full-code",
|
|
1019
|
-
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n
|
|
952
|
+
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n SegmentItem,\n AnalyticalWidget,\n textInfo\n} from '@daisforge/ui';\nimport type { ItemOrGroup } from '@daisforge/ui';\n\nimport React, { useMemo, useReducer, useState } from 'react';\n\ntype Filters = {\n searchedV: string;\n blocks: string[];\n tribes: string[];\n allocation: string;\n year: number | null;\n filterButton: string;\n dotsButton: string;\n};\n\nconst DEFAULT_FILTERS: Filters = {\n searchedV: '',\n blocks: [],\n tribes: [],\n allocation: '',\n year: null,\n filterButton: '',\n dotsButton: '',\n};\n\nconst LABELS: { [key in keyof Filters]: string } = {\n searchedV: 'Поиск',\n blocks: 'Блок',\n tribes: 'Трайб',\n allocation: 'Аллокация',\n year: 'Год',\n filterButton: 'Фильтры',\n dotsButton: 'Меню',\n};\n\nconst useFetch = (key: 'blocks' | 'tribes' | 'allocation', num = 10) =>\n useMemo(\n () =>\n Array(num)\n .fill(0)\n .map((_, i) => ({\n label: \\\n\n() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n const someItems = Array(3).fill(0);\n\n const { filterList, filterListOpened } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const chipsList = filterList\n .map((item, index) => {\n if ('groupLabel' in item) {\n return item.items.map((innerItem, innerIdex) => ({\n text: String(innerItem.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: innerItem.onClick,\n key: `chip-key${index}-${innerIdex}-${innerItem.label}`,\n }));\n }\n return {\n text: String(item.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: item.onClick,\n key: `chip-key-${index}-${item.label}`,\n };\n })\n .flat();\n\n return (\n <GridContainerM>\n <SegmentProvider defaultSelected={['item_0']}>\n <div\n style={{\n position: 'relative',\n width: 'min-content',\n }}\n >\n <AnalyticalWidget\n size=\"m\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Analytic widget M\"\n badge=\"TA\"\n subtitle=\"Monthly report\"\n rightSlot={\n <Flow\n alignment=\"center\"\n mainAxisGap=\"8px\"\n style={{\n flexWrap: 'nowrap',\n }}\n >\n <SegmentGroup hasBackground size=\"xs\">\n {someItems.map((_, i) => (\n <SegmentItem\n // eslint-disable-next-line react/no-array-index-key\n key={`item:${i}`}\n value={`item_${i}`}\n label={`Label${i + 1}`}\n size=\"xs\"\n view=\"primary\"\n />\n ))}\n </SegmentGroup>\n </Flow>\n }\n infoTooltipText=\"Info\"\n href=\"/\"\n />\n }\n topSlot={\n <Flow orientation=\"vertical\" mainAxisGap={8}>\n <AnalyticalWidget.Chips\n opened={filterListOpened}\n isWrapped\n gap=\"wide\"\n isCommonChipStyles={false}\n chips={chipsList}\n />\n </Flow>\n }\n contentSlot={\n <div\n style={{\n minHeight: 'fit-content',\n }}\n >\n {longText()}\n </div>\n }\n classes={{\n topSlot: 'myCustomClassForTopSlot',\n middleSlot: 'myCustomClassForMiddleSlot',\n contentSlot: 'myCustomClassForContentSlot',\n root: 'myCustomClassForRoot',\n }}\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </SegmentProvider>\n </GridContainerM>\n );\n }"
|
|
1020
953
|
},
|
|
1021
954
|
{
|
|
1022
955
|
"exportName": "AnalyticalWidgetS",
|
|
1023
956
|
"displayName": "AnalyticalWidgetS",
|
|
1024
957
|
"type": "full-code",
|
|
1025
|
-
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n
|
|
958
|
+
"code": "import {\n Box,\n Combobox,\n Flow,\n SegmentGroup,\n SegmentProvider,\n TooltipList,\n useFiltersList,\n IconDone,\n SegmentItem,\n AnalyticalWidget,\n textInfo\n} from '@daisforge/ui';\nimport type { ItemOrGroup } from '@daisforge/ui';\n\nimport React, { useMemo, useReducer, useState } from 'react';\n\ntype Filters = {\n searchedV: string;\n blocks: string[];\n tribes: string[];\n allocation: string;\n year: number | null;\n filterButton: string;\n dotsButton: string;\n};\n\nconst DEFAULT_FILTERS: Filters = {\n searchedV: '',\n blocks: [],\n tribes: [],\n allocation: '',\n year: null,\n filterButton: '',\n dotsButton: '',\n};\n\nconst LABELS: { [key in keyof Filters]: string } = {\n searchedV: 'Поиск',\n blocks: 'Блок',\n tribes: 'Трайб',\n allocation: 'Аллокация',\n year: 'Год',\n filterButton: 'Фильтры',\n dotsButton: 'Меню',\n};\n\nconst useFetch = (key: 'blocks' | 'tribes' | 'allocation', num = 10) =>\n useMemo(\n () =>\n Array(num)\n .fill(0)\n .map((_, i) => ({\n label: \\\n\n() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n\n const { filterList, filterListOpened } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const chipsList = filterList\n .map((item) => {\n if ('groupLabel' in item) {\n return item.items.map((innerItem) => ({\n text: String(innerItem.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: innerItem.onClick,\n }));\n }\n return {\n text: String(item.label),\n view: 'default' as const,\n hasClear: false as const,\n onClick: item.onClick,\n };\n })\n .flat();\n\n return (\n <GridContainerS>\n <SegmentProvider defaultSelected={['item_0']}>\n <div\n style={{\n position: 'relative',\n width: 'min-content',\n }}\n >\n <AnalyticalWidget\n size=\"s\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Заголовок\"\n badge=\"TA\"\n subtitle=\"Подзаголовок здесь\"\n infoTooltipText=\"Info\"\n href=\"/\"\n />\n }\n topSlot={\n <Flow orientation=\"vertical\" mainAxisGap={8}>\n <AnalyticalWidget.Chips\n opened={filterListOpened}\n isWrapped\n gap=\"wide\"\n isCommonChipStyles={false}\n chips={chipsList}\n />\n </Flow>\n }\n contentSlot={\n <div\n style={{\n minHeight: 'fit-content',\n }}\n >\n {longText()}\n </div>\n }\n classes={{\n topSlot: 'myCustomClassForTopSlot',\n middleSlot: 'myCustomClassForMiddleSlot',\n contentSlot: 'myCustomClassForContentSlot',\n root: 'myCustomClassForRoot',\n }}\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </SegmentProvider>\n </GridContainerS>\n );\n }"
|
|
1026
959
|
},
|
|
1027
960
|
{
|
|
1028
|
-
"exportName": "
|
|
1029
|
-
"displayName": "
|
|
1030
|
-
"type": "
|
|
1031
|
-
"code": "
|
|
1032
|
-
"sourceFile": "packages/storybook/src/stories/AnalyticalWidget/components/WidgetS.tsx"
|
|
961
|
+
"exportName": "AnalyticalWidgetCustomTopSlot",
|
|
962
|
+
"displayName": "Custom topSlot + rightSlot",
|
|
963
|
+
"type": "full-code",
|
|
964
|
+
"code": "() => {\n const [filters, updateFilters] = useReducer(\n filtersReducer,\n DEFAULT_FILTERS,\n );\n const filtersBlocksOption = useFetch('blocks', 10);\n const filtersTribesOption = useFetch('tribes', 15);\n const filtersAllocationOption = useFetch('allocation', 10);\n const [period, setPeriod] = useState('month');\n\n const { filterList } = useFiltersList({\n filters,\n options: {\n blocks: filtersBlocksOption,\n tribes: filtersTribesOption,\n allocation: filtersAllocationOption,\n filterButton: filterButtonOptions,\n dotsButton: dotsButtonOptions,\n } as Record<keyof Filters, { label: string; value: string }[]>,\n updateFilters: (key, newV) => updateFilters({ [key]: newV }),\n filtersInfo: {\n searchedV: { label: 'Поиск', clearedValue: '' },\n blocks: { label: 'Блок', clearedValue: [] },\n tribes: { label: 'Трайб', clearedValue: [] },\n allocation: { label: 'Аллокация', clearedValue: '' },\n year: { label: 'Год', clearedValue: null },\n filterButton: { label: 'Фильтр', clearedValue: '' },\n dotsButton: { label: 'Меню', clearedValue: '' },\n },\n });\n\n const customChips = filterList.flatMap((item) =>\n 'groupLabel' in item\n ? item.items.map((inner) => ({\n label: String(inner.label),\n onClick: inner.onClick,\n }))\n : [{ label: String(item.label), onClick: item.onClick }],\n );\n const hasChips = customChips.length > 0;\n const lastRef = useRef(customChips);\n if (hasChips) {\n lastRef.current = customChips;\n }\n const renderedChips = hasChips ? customChips : lastRef.current;\n\n return (\n <div style={{ padding: 20, background: 'grey' }}>\n <div style={{ position: 'relative', width: 600, height: 512 }}>\n <AnalyticalWidget\n size=\"l\"\n headerSlot={\n <AnalyticalWidget.Header\n title=\"Custom topSlot\"\n badge=\"TA\"\n subtitle=\"Свои чипы + Select в rightSlot\"\n infoTooltipText=\"Info\"\n rightSlot={\n <Select\n size=\"xs\"\n value={period}\n onChange={(v) => setPeriod(v as string)}\n items={[\n { label: 'Месяц', value: 'month' },\n { label: 'Квартал', value: 'quarter' },\n { label: 'Год', value: 'year' },\n ]}\n />\n }\n />\n }\n topSlot={\n <div className={analyticalWidgetClassNames.selfSpacedTopSlot}>\n <Collapse isOpen={hasChips} unMountOnClose>\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 4,\n paddingTop: 8,\n }}\n >\n {renderedChips.map((chip, index) => (\n <button\n type=\"button\"\n // eslint-disable-next-line react/no-array-index-key\n key={`${chip.label}-${index}`}\n onClick={chip.onClick}\n style={{\n padding: '2px 8px',\n borderRadius: 12,\n background: 'rgba(0, 0, 0, 0.06)',\n border: 'none',\n fontSize: 12,\n lineHeight: '16px',\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n }}\n >\n {chip.label}\n </button>\n ))}\n </div>\n </Collapse>\n </div>\n }\n contentSlot={\n <div style={{ minHeight: 'fit-content' }}>{longText()}</div>\n }\n />\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: generateButtonItems(\n 'dotsButton',\n dotsButtonOptions,\n filterList,\n ),\n onItemSelect(item) {\n updateFilters({\n dotsButton:\n filters.dotsButton === item.value?.toString()\n ? ''\n : item.value?.toString() ?? '',\n });\n },\n }}\n />\n </div>\n </div>\n );\n }"
|
|
1033
965
|
}
|
|
1034
966
|
]
|
|
1035
967
|
},
|
|
@@ -13270,12 +13202,6 @@
|
|
|
13270
13202
|
"type": "React.ReactNode",
|
|
13271
13203
|
"required": false,
|
|
13272
13204
|
"description": ""
|
|
13273
|
-
},
|
|
13274
|
-
{
|
|
13275
|
-
"name": "actionsSlotStyle",
|
|
13276
|
-
"type": "React.CSSProperties | undefined",
|
|
13277
|
-
"required": false,
|
|
13278
|
-
"description": ""
|
|
13279
13205
|
}
|
|
13280
13206
|
]
|
|
13281
13207
|
}
|
|
@@ -13296,13 +13222,13 @@
|
|
|
13296
13222
|
"exportName": "DragDelay",
|
|
13297
13223
|
"displayName": "Задержка активации D&D (dragActivationDelay)",
|
|
13298
13224
|
"type": "full-code",
|
|
13299
|
-
"code": "render() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items] = useState<GridDNDItems[]>([\n { id: 'w1', type: 'm' },\n { id: 'w2', type: 's' },\n { id: 'w3', type: 's' },\n { id: 'w4', type: 'm' },\n { id: 'w5', type: 's' },\n ]);\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper
|
|
13225
|
+
"code": "render() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items] = useState<GridDNDItems[]>([\n { id: 'w1', type: 'm' },\n { id: 'w2', type: 's' },\n { id: 'w3', type: 's' },\n { id: 'w4', type: 'm' },\n { id: 'w5', type: 's' },\n ]);\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper\n item={item}\n actionsSlot={\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: [{ label: 'Удалить', value: 'Удалить' }],\n onItemSelect() {\n onRemove();\n },\n }}\n />\n }\n >\n {item.type === 's' && <WidgetS id={item.id} onRemove={onRemove} />}\n {item.type === 'm' && <WidgetM id={item.id} onRemove={onRemove} />}\n </GridDND.ItemWrapper>\n ),\n [],\n );\n\n return (\n <div>\n <div style={{ marginBottom: 12, color: '#666', fontSize: 14 }}>\n Зажмите карточку на 500мс для активации перетаскивания. Обводка\n появится только у зажатой карточки.\n </div>\n <div style={{ width: 1200, background: 'lightGray' }}>\n <GridDND\n ref={gridRef}\n items={items}\n isDraggable\n dragActivationDelay={500}\n compactType=\"horizontal\"\n // eslint-disable-next-line react/no-children-prop\n children={renderItem}\n onLayoutChange={(layout, _allAreas, meta) => {\n console.debug('Layout changed:', layout, meta);\n }}\n />\n </div>\n </div>\n );\n }"
|
|
13300
13226
|
},
|
|
13301
13227
|
{
|
|
13302
13228
|
"exportName": "GridDNDClassic",
|
|
13303
13229
|
"displayName": "GridDND Classic",
|
|
13304
13230
|
"type": "full-code",
|
|
13305
|
-
"code": "import { GridDND } from '@daisforge/ui';\n\nrender() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items, setItems] = useState<GridDNDItems[]>([]);\n const [width, setWidth] = useState(1660);\n const [drag, setDrag] = useState(true);\n const [loading, setLoading] = useState(true);\n const [smartCompact, setSmartCompact] = useState(true);\n const [compactType, setCompactType] = useState<\n 'vertical' | 'horizontal' | null\n >('horizontal');\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper\n item={item}\n actionsSlot={\n <AnalyticalWidget.DotsIconButton\n
|
|
13231
|
+
"code": "import { GridDND } from '@daisforge/ui';\n\nrender() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items, setItems] = useState<GridDNDItems[]>([]);\n const [width, setWidth] = useState(1660);\n const [drag, setDrag] = useState(true);\n const [loading, setLoading] = useState(true);\n const [smartCompact, setSmartCompact] = useState(true);\n const [compactType, setCompactType] = useState<\n 'vertical' | 'horizontal' | null\n >('horizontal');\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper\n item={item}\n actionsSlot={\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: [{ label: 'Удалить', value: 'Удалить' }],\n onItemSelect(m) {\n if (m.value?.toString().toLowerCase() === 'удалить')\n onRemove();\n },\n }}\n />\n }\n >\n {item.type === 's' && <WidgetS id={item.id} onRemove={onRemove} />}\n {item.type === 'm' && <WidgetM id={item.id} onRemove={onRemove} />}\n {item.type === 'l' && <WidgetL id={item.id} onRemove={onRemove} />}\n </GridDND.ItemWrapper>\n ),\n [],\n );\n\n const handleReorder = () => {\n const currentOrder = gridRef.current?.api.getOrder() || [];\n // Перевернуть порядок\n gridRef.current?.api.setOrder([...currentOrder].reverse());\n };\n\n const saveItems = useCallback(async (newItems: GridDNDItems[]) => {\n try {\n console.log('💾 Saving items to server:', newItems);\n await fetch(gridDndRoutes.ENDPOINTS.PUT_ITEMS, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ items: newItems }),\n });\n console.log('✅ Items saved successfully');\n } catch (error) {\n console.error('❌ Failed to save items:', error);\n }\n }, []);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const debouncedSave = useCallback(\n debounce((newItems: GridDNDItems[]) => {\n saveItems(newItems);\n }, 800),\n [saveItems],\n );\n\n // Загрузка initial items с сервера\n useEffect(() => {\n const fetchInitialItems = async () => {\n try {\n const response = await fetch(gridDndRoutes.ENDPOINTS.GET_ITEMS);\n const data = await response.json();\n setItems(data.items);\n } catch (error) {\n console.error('Failed to fetch items:', error);\n } finally {\n setLoading(false);\n }\n };\n\n fetchInitialItems();\n }, []);\n\n if (loading) {\n return <div>Loading...</div>;\n }\n\n return (\n <div>\n <div\n style={{\n display: 'flex',\n gap: 8,\n alignItems: 'center',\n marginBottom: 12,\n }}\n >\n <span>Width: {width}px</span>\n <input\n type=\"range\"\n min={600}\n max={1890}\n step={10}\n value={width}\n onChange={(e) => setWidth(+e.target.value)}\n />\n <Switch\n onChange={(e) => setDrag(e.target.checked)}\n label=\"Activate DND\"\n checked={drag}\n />\n <Switch\n onChange={(e) => setSmartCompact(e.target.checked)}\n label=\"Activate Smart Compact\"\n checked={smartCompact}\n />\n <Switch\n onChange={(e) =>\n setCompactType(e.target.checked ? 'vertical' : null)\n }\n label=\"Activate Compact Type Vertical\"\n checked={compactType === 'vertical'}\n />\n <Switch\n onChange={(e) =>\n setCompactType(e.target.checked ? 'horizontal' : null)\n }\n label=\"Activate Compact Type Horizontal\"\n checked={compactType === 'horizontal'}\n />\n </div>\n <div\n style={{\n marginBottom: '30px',\n display: 'flex',\n gap: '8px',\n }}\n >\n <Button\n onClick={() => {\n console.debug(gridRef.current?.api.getOrderDetailed());\n }}\n >\n Get Order Detail\n </Button>\n <Button\n onClick={() =>\n console.debug('Current layout:', gridRef.current?.api.getOrder())\n }\n >\n Get Order\n </Button>\n <Button\n onClick={() =>\n console.debug(\n 'Current template area:',\n gridRef.current?.api.getCurrentLayout(),\n )\n }\n >\n Get Current Layout\n </Button>\n <Button\n onClick={() =>\n console.debug(\n 'All template areas:',\n gridRef.current?.api.getAllLayouts(),\n )\n }\n >\n Get All Layouts\n </Button>\n <Button\n onClick={() => {\n const id = prompt('Enter id');\n const type = prompt('Enter type (s, m, l)');\n if (\n !id ||\n !type ||\n !gridRef.current ||\n (type !== 's' && type !== 'm' && type !== 'l')\n )\n return;\n gridRef.current?.api.addItem({\n id,\n type,\n });\n }}\n >\n + Add widget\n </Button>\n <Button onClick={() => handleReorder()}>Reorder</Button>\n </div>\n\n <div style={{ width, background: 'lightGray' }}>\n <GridDND\n ref={gridRef}\n items={items}\n compactType=\"horizontal\"\n smartCompact={smartCompact}\n // eslint-disable-next-line react/no-children-prop\n children={renderItem}\n onItemsChange={(items) =>\n console.debug('📦 Template Items changed:', items)\n }\n onLayoutChange={(layout, allAreas, meta) => {\n console.group('📐 Template Layout changed:');\n console.debug('Layout:', layout);\n console.debug('All areas:', allAreas);\n console.debug('Meta:', meta);\n if (meta.itemsOrderTyped) {\n console.debug('🔄 Items order changed, saving...');\n debouncedSave(meta.itemsOrderTyped);\n }\n console.groupEnd();\n }}\n onBreakpointChange={(breakpoint: string, layout: unknown) => {\n console.group('📱 Template Breakpoint changed:');\n console.debug('Breakpoint:', breakpoint);\n console.debug('Layout:', layout);\n console.groupEnd();\n }}\n isDraggable={drag}\n />\n </div>\n </div>\n );\n }"
|
|
13306
13232
|
},
|
|
13307
13233
|
{
|
|
13308
13234
|
"exportName": "SelfResize",
|
|
@@ -13321,13 +13247,13 @@
|
|
|
13321
13247
|
"exportName": "DragDelay",
|
|
13322
13248
|
"displayName": "Задержка активации D&D (dragActivationDelay)",
|
|
13323
13249
|
"type": "full-code",
|
|
13324
|
-
"code": "render() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items] = useState<GridDNDItems[]>([\n { id: 'w1', type: 'm' },\n { id: 'w2', type: 's' },\n { id: 'w3', type: 's' },\n { id: 'w4', type: 'm' },\n { id: 'w5', type: 's' },\n ]);\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper
|
|
13250
|
+
"code": "render() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items] = useState<GridDNDItems[]>([\n { id: 'w1', type: 'm' },\n { id: 'w2', type: 's' },\n { id: 'w3', type: 's' },\n { id: 'w4', type: 'm' },\n { id: 'w5', type: 's' },\n ]);\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper\n item={item}\n actionsSlot={\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: [{ label: 'Удалить', value: 'Удалить' }],\n onItemSelect() {\n onRemove();\n },\n }}\n />\n }\n >\n {item.type === 's' && <WidgetS id={item.id} onRemove={onRemove} />}\n {item.type === 'm' && <WidgetM id={item.id} onRemove={onRemove} />}\n </GridDND.ItemWrapper>\n ),\n [],\n );\n\n return (\n <div>\n <div style={{ marginBottom: 12, color: '#666', fontSize: 14 }}>\n Зажмите карточку на 500мс для активации перетаскивания. Обводка\n появится только у зажатой карточки.\n </div>\n <div style={{ width: 1200, background: 'lightGray' }}>\n <GridDND\n ref={gridRef}\n items={items}\n isDraggable\n dragActivationDelay={500}\n compactType=\"horizontal\"\n // eslint-disable-next-line react/no-children-prop\n children={renderItem}\n onLayoutChange={(layout, _allAreas, meta) => {\n console.debug('Layout changed:', layout, meta);\n }}\n />\n </div>\n </div>\n );\n }"
|
|
13325
13251
|
},
|
|
13326
13252
|
{
|
|
13327
13253
|
"exportName": "GridDNDClassic",
|
|
13328
13254
|
"displayName": "GridDND Classic",
|
|
13329
13255
|
"type": "full-code",
|
|
13330
|
-
"code": "import { GridDND } from '@daisforge/ui';\n\nrender() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items, setItems] = useState<GridDNDItems[]>([]);\n const [width, setWidth] = useState(1660);\n const [drag, setDrag] = useState(true);\n const [loading, setLoading] = useState(true);\n const [smartCompact, setSmartCompact] = useState(true);\n const [compactType, setCompactType] = useState<\n 'vertical' | 'horizontal' | null\n >('horizontal');\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper\n item={item}\n actionsSlot={\n <AnalyticalWidget.DotsIconButton\n
|
|
13256
|
+
"code": "import { GridDND } from '@daisforge/ui';\n\nrender() {\n const gridRef = useRef<GridDNDRef>(null);\n const [items, setItems] = useState<GridDNDItems[]>([]);\n const [width, setWidth] = useState(1660);\n const [drag, setDrag] = useState(true);\n const [loading, setLoading] = useState(true);\n const [smartCompact, setSmartCompact] = useState(true);\n const [compactType, setCompactType] = useState<\n 'vertical' | 'horizontal' | null\n >('horizontal');\n\n const renderItem = useCallback(\n (item: GridDNDItemConfig, onRemove: () => void) => (\n <GridDND.ItemWrapper\n item={item}\n actionsSlot={\n <AnalyticalWidget.DotsIconButton\n absolute\n dropdownProps={{\n items: [{ label: 'Удалить', value: 'Удалить' }],\n onItemSelect(m) {\n if (m.value?.toString().toLowerCase() === 'удалить')\n onRemove();\n },\n }}\n />\n }\n >\n {item.type === 's' && <WidgetS id={item.id} onRemove={onRemove} />}\n {item.type === 'm' && <WidgetM id={item.id} onRemove={onRemove} />}\n {item.type === 'l' && <WidgetL id={item.id} onRemove={onRemove} />}\n </GridDND.ItemWrapper>\n ),\n [],\n );\n\n const handleReorder = () => {\n const currentOrder = gridRef.current?.api.getOrder() || [];\n // Перевернуть порядок\n gridRef.current?.api.setOrder([...currentOrder].reverse());\n };\n\n const saveItems = useCallback(async (newItems: GridDNDItems[]) => {\n try {\n console.log('💾 Saving items to server:', newItems);\n await fetch(gridDndRoutes.ENDPOINTS.PUT_ITEMS, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ items: newItems }),\n });\n console.log('✅ Items saved successfully');\n } catch (error) {\n console.error('❌ Failed to save items:', error);\n }\n }, []);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const debouncedSave = useCallback(\n debounce((newItems: GridDNDItems[]) => {\n saveItems(newItems);\n }, 800),\n [saveItems],\n );\n\n // Загрузка initial items с сервера\n useEffect(() => {\n const fetchInitialItems = async () => {\n try {\n const response = await fetch(gridDndRoutes.ENDPOINTS.GET_ITEMS);\n const data = await response.json();\n setItems(data.items);\n } catch (error) {\n console.error('Failed to fetch items:', error);\n } finally {\n setLoading(false);\n }\n };\n\n fetchInitialItems();\n }, []);\n\n if (loading) {\n return <div>Loading...</div>;\n }\n\n return (\n <div>\n <div\n style={{\n display: 'flex',\n gap: 8,\n alignItems: 'center',\n marginBottom: 12,\n }}\n >\n <span>Width: {width}px</span>\n <input\n type=\"range\"\n min={600}\n max={1890}\n step={10}\n value={width}\n onChange={(e) => setWidth(+e.target.value)}\n />\n <Switch\n onChange={(e) => setDrag(e.target.checked)}\n label=\"Activate DND\"\n checked={drag}\n />\n <Switch\n onChange={(e) => setSmartCompact(e.target.checked)}\n label=\"Activate Smart Compact\"\n checked={smartCompact}\n />\n <Switch\n onChange={(e) =>\n setCompactType(e.target.checked ? 'vertical' : null)\n }\n label=\"Activate Compact Type Vertical\"\n checked={compactType === 'vertical'}\n />\n <Switch\n onChange={(e) =>\n setCompactType(e.target.checked ? 'horizontal' : null)\n }\n label=\"Activate Compact Type Horizontal\"\n checked={compactType === 'horizontal'}\n />\n </div>\n <div\n style={{\n marginBottom: '30px',\n display: 'flex',\n gap: '8px',\n }}\n >\n <Button\n onClick={() => {\n console.debug(gridRef.current?.api.getOrderDetailed());\n }}\n >\n Get Order Detail\n </Button>\n <Button\n onClick={() =>\n console.debug('Current layout:', gridRef.current?.api.getOrder())\n }\n >\n Get Order\n </Button>\n <Button\n onClick={() =>\n console.debug(\n 'Current template area:',\n gridRef.current?.api.getCurrentLayout(),\n )\n }\n >\n Get Current Layout\n </Button>\n <Button\n onClick={() =>\n console.debug(\n 'All template areas:',\n gridRef.current?.api.getAllLayouts(),\n )\n }\n >\n Get All Layouts\n </Button>\n <Button\n onClick={() => {\n const id = prompt('Enter id');\n const type = prompt('Enter type (s, m, l)');\n if (\n !id ||\n !type ||\n !gridRef.current ||\n (type !== 's' && type !== 'm' && type !== 'l')\n )\n return;\n gridRef.current?.api.addItem({\n id,\n type,\n });\n }}\n >\n + Add widget\n </Button>\n <Button onClick={() => handleReorder()}>Reorder</Button>\n </div>\n\n <div style={{ width, background: 'lightGray' }}>\n <GridDND\n ref={gridRef}\n items={items}\n compactType=\"horizontal\"\n smartCompact={smartCompact}\n // eslint-disable-next-line react/no-children-prop\n children={renderItem}\n onItemsChange={(items) =>\n console.debug('📦 Template Items changed:', items)\n }\n onLayoutChange={(layout, allAreas, meta) => {\n console.group('📐 Template Layout changed:');\n console.debug('Layout:', layout);\n console.debug('All areas:', allAreas);\n console.debug('Meta:', meta);\n if (meta.itemsOrderTyped) {\n console.debug('🔄 Items order changed, saving...');\n debouncedSave(meta.itemsOrderTyped);\n }\n console.groupEnd();\n }}\n onBreakpointChange={(breakpoint: string, layout: unknown) => {\n console.group('📱 Template Breakpoint changed:');\n console.debug('Breakpoint:', breakpoint);\n console.debug('Layout:', layout);\n console.groupEnd();\n }}\n isDraggable={drag}\n />\n </div>\n </div>\n );\n }"
|
|
13331
13257
|
},
|
|
13332
13258
|
{
|
|
13333
13259
|
"exportName": "SelfResize",
|
|
@@ -35536,10 +35462,10 @@
|
|
|
35536
35462
|
},
|
|
35537
35463
|
{
|
|
35538
35464
|
"exportName": "Usage2",
|
|
35539
|
-
"displayName": "Использование в
|
|
35465
|
+
"displayName": "Использование в Layout.stories.tsx",
|
|
35540
35466
|
"type": "usage",
|
|
35541
|
-
"code": "<Tabs
|
|
35542
|
-
"sourceFile": "packages/storybook/src/stories/
|
|
35467
|
+
"code": "<Tabs view=\"filled\" stretch size=\"xs\">\n {items.map((_, i) => (\n <TabItem\n view=\"secondary\"\n size=\"xs\"\n selected={i === index}\n tabIndex={0}\n contentLeft={<IconClock size=\"xs\" color=\"inherit\" />}\n onClick={() => setIndex(i)}\n >\n {`Label${i + 1}`}\n </TabItem>\n ))}\n </Tabs>",
|
|
35468
|
+
"sourceFile": "packages/storybook/src/stories/Layout/Layout.stories.tsx"
|
|
35543
35469
|
},
|
|
35544
35470
|
{
|
|
35545
35471
|
"exportName": "Vendor1",
|