@reltio/components 1.4.2017 → 1.4.2019
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/BarChart/helpers.d.ts +2 -2
- package/BasicTable/IntegrationBasicTable.test.js +6 -18
- package/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +2 -5
- package/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +2 -5
- package/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.js +33 -22
- package/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +120 -112
- package/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/LineChart/helpers.d.ts +2 -2
- package/PieChart/PieChart.test.js +4 -0
- package/SimpleAttribute/IntegrationSimpleAttribute.test.js +21 -5
- package/UploadImageDialog/UploadImageDialog.specs.js +1 -4
- package/UploadImageDialog/components/TargetBox/TargetBox.js +31 -20
- package/UploadImageDialog/components/TargetBox/TargetBox.specs.d.ts +1 -1
- package/UploadImageDialog/components/TargetBox/TargetBox.specs.js +57 -16
- package/UploadImageDialog/components/TargetBox/styles.js +2 -1
- package/VerticalHeadingsTable/DndVerticalHeadingsTable.test.js +114 -0
- package/VerticalHeadingsTable/VerticalHeadingsTable.d.ts +2 -1
- package/VerticalHeadingsTable/VerticalHeadingsTable.js +10 -13
- package/VerticalHeadingsTable/VerticalHeadingsTable.test.js +74 -269
- package/VerticalHeadingsTable/components/DndComponent/DndComponent.d.ts +14 -0
- package/VerticalHeadingsTable/components/DndComponent/DndComponent.js +96 -0
- package/VerticalHeadingsTable/components/DndComponent/helpers.d.ts +3 -0
- package/VerticalHeadingsTable/components/DndComponent/helpers.js +35 -0
- package/VerticalHeadingsTable/components/DndComponent/index.d.ts +1 -0
- package/VerticalHeadingsTable/components/DndComponent/index.js +1 -0
- package/VerticalHeadingsTable/components/{TableColumnDragLayer → DndComponent}/styles.d.ts +1 -1
- package/VerticalHeadingsTable/components/DndComponent/styles.js +10 -0
- package/VerticalHeadingsTable/components/DndComponent/types.d.ts +14 -0
- package/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.d.ts +7 -0
- package/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.js +13 -0
- package/VerticalHeadingsTable/components/DndMeasurer/index.d.ts +1 -0
- package/VerticalHeadingsTable/components/DndMeasurer/index.js +1 -0
- package/VerticalHeadingsTable/components/TableCell/TableCell.d.ts +2 -2
- package/VerticalHeadingsTable/components/TableCell/TableCell.js +2 -2
- package/VerticalHeadingsTable/components/TableCell/TableCell.test.js +101 -43
- package/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.d.ts +10 -0
- package/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.js +32 -0
- package/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.d.ts +2 -4
- package/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.js +30 -59
- package/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +126 -56
- package/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.d.ts +3 -3
- package/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.js +16 -6
- package/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.d.ts +9 -0
- package/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.js +30 -0
- package/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.d.ts +4 -4
- package/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.js +3 -4
- package/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.test.js +44 -29
- package/VerticalHeadingsTable/components/TableRow/TableRow.d.ts +4 -5
- package/VerticalHeadingsTable/components/TableRow/TableRow.js +3 -3
- package/VerticalHeadingsTable/components/TableRow/TableRow.test.js +35 -57
- package/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.d.ts +12 -0
- package/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.js +16 -0
- package/VerticalHeadingsTable/components/TableRowDragPreview/index.d.ts +1 -0
- package/VerticalHeadingsTable/components/TableRowDragPreview/index.js +1 -0
- package/{cjs/VerticalHeadingsTable/components/TableColumnDragLayer → VerticalHeadingsTable/components/TableRowDragPreview}/styles.d.ts +1 -1
- package/VerticalHeadingsTable/components/TableRowDragPreview/styles.js +8 -0
- package/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.d.ts +2 -8
- package/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.js +22 -53
- package/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +53 -83
- package/cjs/BarChart/helpers.d.ts +2 -2
- package/cjs/BasicTable/IntegrationBasicTable.test.js +6 -18
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +2 -5
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +2 -5
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.js +55 -21
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +120 -135
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/cjs/LineChart/helpers.d.ts +2 -2
- package/cjs/PieChart/PieChart.test.js +4 -0
- package/cjs/SimpleAttribute/IntegrationSimpleAttribute.test.js +21 -5
- package/cjs/UploadImageDialog/UploadImageDialog.specs.js +1 -4
- package/cjs/UploadImageDialog/components/TargetBox/TargetBox.js +54 -20
- package/cjs/UploadImageDialog/components/TargetBox/TargetBox.specs.d.ts +1 -1
- package/cjs/UploadImageDialog/components/TargetBox/TargetBox.specs.js +57 -16
- package/cjs/UploadImageDialog/components/TargetBox/styles.js +2 -1
- package/cjs/VerticalHeadingsTable/DndVerticalHeadingsTable.test.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/DndVerticalHeadingsTable.test.js +119 -0
- package/cjs/VerticalHeadingsTable/VerticalHeadingsTable.d.ts +2 -1
- package/cjs/VerticalHeadingsTable/VerticalHeadingsTable.js +9 -12
- package/cjs/VerticalHeadingsTable/VerticalHeadingsTable.test.js +74 -269
- package/cjs/VerticalHeadingsTable/components/DndComponent/DndComponent.d.ts +14 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/DndComponent.js +123 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/helpers.d.ts +3 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/helpers.js +40 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/index.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/index.js +5 -0
- package/{features/crosswalks/CrosswalkDragLayer → cjs/VerticalHeadingsTable/components/DndComponent}/styles.d.ts +1 -1
- package/cjs/VerticalHeadingsTable/components/DndComponent/styles.js +13 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/types.d.ts +14 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/types.js +2 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.d.ts +7 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.js +40 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/index.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/index.js +5 -0
- package/cjs/VerticalHeadingsTable/components/TableCell/TableCell.d.ts +2 -2
- package/cjs/VerticalHeadingsTable/components/TableCell/TableCell.js +2 -2
- package/cjs/VerticalHeadingsTable/components/TableCell/TableCell.test.js +101 -43
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.d.ts +10 -0
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.js +39 -0
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.d.ts +2 -4
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.js +29 -58
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +128 -58
- package/cjs/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.d.ts +3 -3
- package/cjs/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.js +38 -9
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.d.ts +9 -0
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.js +37 -0
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.d.ts +4 -4
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.js +3 -4
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.test.js +43 -51
- package/cjs/VerticalHeadingsTable/components/TableRow/TableRow.d.ts +4 -5
- package/cjs/VerticalHeadingsTable/components/TableRow/TableRow.js +3 -3
- package/cjs/VerticalHeadingsTable/components/TableRow/TableRow.test.js +35 -57
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.d.ts +12 -0
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.js +42 -0
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/index.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/index.js +5 -0
- package/cjs/{features/crosswalks/CrosswalkDragLayer → VerticalHeadingsTable/components/TableRowDragPreview}/styles.d.ts +1 -1
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/styles.js +11 -0
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.d.ts +2 -8
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.js +21 -52
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +55 -85
- package/cjs/contexts/CrosswalksDisplayContext/index.d.ts +2 -2
- package/cjs/contexts/CrosswalksDisplayContext/index.js +6 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.d.ts +3 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +2 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +17 -10
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.d.ts +3 -2
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +13 -2
- package/cjs/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.d.ts +8 -0
- package/cjs/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.js +51 -0
- package/cjs/features/crosswalks/CrosswalkDndComponent/index.d.ts +1 -0
- package/cjs/features/crosswalks/CrosswalkDndComponent/index.js +5 -0
- package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/CrosswalkDragPreview.js +16 -5
- package/cjs/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +1 -0
- package/cjs/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.js +97 -0
- package/{features/crosswalks/CrosswalkDragLayer/components → cjs/features/crosswalks}/CrosswalkDragPreview/styles.d.ts +1 -1
- package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/styles.js +6 -1
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.js +25 -16
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +7 -33
- package/cjs/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.d.ts +1 -0
- package/cjs/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.js +134 -0
- package/cjs/features/crosswalks/CrosswalkRow/styles.d.ts +1 -1
- package/cjs/features/crosswalks/CrosswalkRow/styles.js +10 -1
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +0 -1
- package/cjs/features/crosswalks/hooks/useDraggingCrosswalk.d.ts +6 -0
- package/cjs/features/crosswalks/hooks/useDraggingCrosswalk.js +19 -0
- package/cjs/features/crosswalks/hooks/useModifiedEntity.js +6 -6
- package/cjs/features/crosswalks/index.d.ts +1 -1
- package/cjs/features/crosswalks/index.js +3 -3
- package/cjs/hooks/useDndBasicTableScrollModifier/index.d.ts +1 -0
- package/cjs/hooks/useDndBasicTableScrollModifier/index.js +5 -0
- package/cjs/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.d.ts +10 -0
- package/cjs/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +57 -0
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/test-utils/dndKit/DndContext.d.ts +12 -0
- package/cjs/test-utils/dndKit/DndContext.js +5 -0
- package/cjs/test-utils/dndKit/DndContextComponent.d.ts +5 -0
- package/cjs/test-utils/dndKit/DndContextComponent.js +97 -0
- package/cjs/test-utils/dndKit/DndMonitorContext.d.ts +2 -0
- package/cjs/test-utils/dndKit/DndMonitorContext.js +5 -0
- package/cjs/test-utils/dndKit/DragOverlay.d.ts +5 -0
- package/cjs/test-utils/dndKit/DragOverlay.js +14 -0
- package/cjs/test-utils/dndKit/index.d.ts +32 -0
- package/cjs/test-utils/dndKit/index.js +22 -0
- package/cjs/test-utils/dndKit/type.d.ts +17 -0
- package/cjs/test-utils/dndKit/type.js +2 -0
- package/cjs/test-utils/dndKit/useDndContext.d.ts +8 -0
- package/cjs/test-utils/dndKit/useDndContext.js +13 -0
- package/cjs/test-utils/dndKit/useDndMonitor.d.ts +2 -0
- package/cjs/test-utils/dndKit/useDndMonitor.js +13 -0
- package/cjs/test-utils/dndKit/useDndMonitorProvider.d.ts +1 -0
- package/cjs/test-utils/dndKit/useDndMonitorProvider.js +17 -0
- package/cjs/test-utils/dndKit/useDraggable.d.ts +12 -0
- package/cjs/test-utils/dndKit/useDraggable.js +43 -0
- package/cjs/test-utils/dndKit/useDroppable.d.ts +4 -0
- package/cjs/test-utils/dndKit/useDroppable.js +45 -0
- package/cjs/types/basicTable.d.ts +4 -0
- package/contexts/CrosswalksDisplayContext/index.d.ts +2 -2
- package/contexts/CrosswalksDisplayContext/index.js +6 -2
- package/features/crosswalks/AttributesTable/AttributesTable.d.ts +3 -1
- package/features/crosswalks/AttributesTable/AttributesTable.js +2 -2
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +17 -10
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.d.ts +3 -2
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +13 -2
- package/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.d.ts +8 -0
- package/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.js +24 -0
- package/features/crosswalks/CrosswalkDndComponent/index.d.ts +1 -0
- package/features/crosswalks/CrosswalkDndComponent/index.js +1 -0
- package/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.js +30 -0
- package/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +1 -0
- package/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.js +69 -0
- package/{cjs/features/crosswalks/CrosswalkDragLayer/components → features/crosswalks}/CrosswalkDragPreview/styles.d.ts +1 -1
- package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/styles.js +6 -1
- package/features/crosswalks/CrosswalkRow/CrosswalkRow.js +25 -16
- package/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +7 -33
- package/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.d.ts +1 -0
- package/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.js +129 -0
- package/features/crosswalks/CrosswalkRow/styles.d.ts +1 -1
- package/features/crosswalks/CrosswalkRow/styles.js +10 -1
- package/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +0 -1
- package/features/crosswalks/hooks/useDraggingCrosswalk.d.ts +6 -0
- package/features/crosswalks/hooks/useDraggingCrosswalk.js +15 -0
- package/features/crosswalks/hooks/useModifiedEntity.js +6 -6
- package/features/crosswalks/index.d.ts +1 -1
- package/features/crosswalks/index.js +1 -1
- package/hooks/useDndBasicTableScrollModifier/index.d.ts +1 -0
- package/hooks/useDndBasicTableScrollModifier/index.js +1 -0
- package/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.d.ts +10 -0
- package/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +53 -0
- package/index.d.ts +2 -1
- package/index.js +1 -0
- package/package.json +3 -3
- package/test-utils/dndKit/DndContext.d.ts +12 -0
- package/test-utils/dndKit/DndContext.js +2 -0
- package/test-utils/dndKit/DndContextComponent.d.ts +5 -0
- package/test-utils/dndKit/DndContextComponent.js +70 -0
- package/test-utils/dndKit/DndMonitorContext.d.ts +2 -0
- package/test-utils/dndKit/DndMonitorContext.js +2 -0
- package/test-utils/dndKit/DragOverlay.d.ts +5 -0
- package/test-utils/dndKit/DragOverlay.js +7 -0
- package/test-utils/dndKit/index.d.ts +32 -0
- package/test-utils/dndKit/index.js +19 -0
- package/test-utils/dndKit/type.d.ts +17 -0
- package/test-utils/dndKit/type.js +1 -0
- package/test-utils/dndKit/useDndContext.d.ts +8 -0
- package/test-utils/dndKit/useDndContext.js +9 -0
- package/test-utils/dndKit/useDndMonitor.d.ts +2 -0
- package/test-utils/dndKit/useDndMonitor.js +9 -0
- package/test-utils/dndKit/useDndMonitorProvider.d.ts +1 -0
- package/test-utils/dndKit/useDndMonitorProvider.js +13 -0
- package/test-utils/dndKit/useDraggable.d.ts +12 -0
- package/test-utils/dndKit/useDraggable.js +39 -0
- package/test-utils/dndKit/useDroppable.d.ts +4 -0
- package/test-utils/dndKit/useDroppable.js +41 -0
- package/types/basicTable.d.ts +4 -0
- package/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.d.ts +0 -6
- package/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.js +0 -23
- package/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.d.ts +0 -6
- package/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.js +0 -11
- package/VerticalHeadingsTable/components/TableColumnDragLayer/index.d.ts +0 -1
- package/VerticalHeadingsTable/components/TableColumnDragLayer/index.js +0 -1
- package/VerticalHeadingsTable/components/TableColumnDragLayer/styles.js +0 -13
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.d.ts +0 -6
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.js +0 -50
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.d.ts +0 -6
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.js +0 -15
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/index.d.ts +0 -1
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/index.js +0 -5
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/styles.js +0 -16
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.d.ts +0 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.js +0 -51
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +0 -93
- package/cjs/features/crosswalks/CrosswalkDragLayer/index.d.ts +0 -1
- package/cjs/features/crosswalks/CrosswalkDragLayer/index.js +0 -5
- package/cjs/features/crosswalks/CrosswalkDragLayer/styles.js +0 -17
- package/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.d.ts +0 -2
- package/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.js +0 -25
- package/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +0 -65
- package/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +0 -19
- package/features/crosswalks/CrosswalkDragLayer/index.d.ts +0 -1
- package/features/crosswalks/CrosswalkDragLayer/index.js +0 -1
- package/features/crosswalks/CrosswalkDragLayer/styles.js +0 -14
- /package/{cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.d.ts → VerticalHeadingsTable/DndVerticalHeadingsTable.test.d.ts} +0 -0
- /package/{features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.d.ts → VerticalHeadingsTable/components/DndComponent/types.js} +0 -0
- /package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/CrosswalkDragPreview.d.ts +0 -0
- /package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.d.ts +0 -0
- /package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.js +0 -0
- /package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/CrosswalkDragPreview.d.ts +0 -0
- /package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.d.ts +0 -0
- /package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.js +0 -0
|
@@ -15,106 +15,76 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var react_dnd_test_backend_1 = __importDefault(require("react-dnd-test-backend"));
|
|
22
|
-
var TableCell_1 = require("../TableCell");
|
|
23
|
-
var TableCellWithDnd_1 = require("../TableCellWithDnd");
|
|
24
|
-
var TableHeadCell_1 = require("../TableHeadCell");
|
|
18
|
+
var core_1 = require("@dnd-kit/core");
|
|
19
|
+
var react_2 = require("@testing-library/react");
|
|
20
|
+
var types_1 = require("../../types");
|
|
25
21
|
var TableRowWithDnd_1 = require("./TableRowWithDnd");
|
|
22
|
+
jest.mock('@dnd-kit/core', function () { return (__assign(__assign({}, jest.requireActual('@dnd-kit/core')), { useDndMonitor: jest.fn(), useDroppable: jest.fn().mockReturnValue({ setNodeRef: jest.fn() }) })); });
|
|
26
23
|
var defaultColumnsData = [
|
|
27
24
|
{ 'attributes.FirstName': 'FirstName1', isDraggable: false, id: 'entities/123' },
|
|
28
25
|
{ 'attributes.FirstName': 'FirstName2', isDraggable: true, id: 'entities/234' }
|
|
29
26
|
];
|
|
30
27
|
var defaultRowData = { id: 'attributes.FirstName', label: 'FirstName' };
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
var rowName = "".concat(defaultRowData.label, " ").concat(defaultColumnsData[0]['attributes.FirstName'], " ").concat(defaultColumnsData[1]['attributes.FirstName']);
|
|
29
|
+
var defaultProps = {
|
|
30
|
+
columnsData: defaultColumnsData,
|
|
31
|
+
rowData: defaultRowData,
|
|
32
|
+
isMoveColumnEnabled: false,
|
|
33
|
+
setHoveredColumn: jest.fn(),
|
|
34
|
+
resetHoveredColumn: jest.fn()
|
|
35
|
+
};
|
|
36
|
+
var setUp = function (props) {
|
|
37
|
+
if (props === void 0) { props = defaultProps; }
|
|
38
|
+
var Providers = function (_a) {
|
|
39
|
+
var children = _a.children;
|
|
40
|
+
return (react_1.default.createElement(core_1.DndContext, null,
|
|
41
|
+
react_1.default.createElement("table", null,
|
|
42
|
+
react_1.default.createElement("tbody", null, children))));
|
|
43
|
+
};
|
|
44
|
+
return (0, react_2.render)(react_1.default.createElement(TableRowWithDnd_1.TableRowWithDnd, __assign({}, props)), { wrapper: Providers });
|
|
43
45
|
};
|
|
44
46
|
describe('TableRow tests', function () {
|
|
45
47
|
it('should render TableHeadCell correctly', function () {
|
|
46
|
-
|
|
47
|
-
expect(
|
|
48
|
-
|
|
49
|
-
isDraggable: true
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
it('should render "TableCellWithDnd" cells correctly if "onMoveColumn" exist in props', function () {
|
|
53
|
-
var onMoveColumn = jest.fn();
|
|
54
|
-
var onDropColumn = jest.fn();
|
|
55
|
-
var props = { onMoveColumn: onMoveColumn, onDropColumn: onDropColumn, someRowIsDragging: true };
|
|
56
|
-
var component = setUp(props)[0];
|
|
57
|
-
expect(component.find(TableCellWithDnd_1.TableCellWithDnd)).toHaveLength(2);
|
|
58
|
-
component.find(TableCellWithDnd_1.TableCellWithDnd).forEach(function (node, index) {
|
|
59
|
-
expect(node.props()).toMatchObject({
|
|
60
|
-
rowData: defaultRowData,
|
|
61
|
-
columnValue: defaultColumnsData[index],
|
|
62
|
-
index: index,
|
|
63
|
-
onMoveColumn: onMoveColumn,
|
|
64
|
-
onDropColumn: onDropColumn,
|
|
65
|
-
shouldRenderDragIndicator: false,
|
|
66
|
-
someRowIsDragging: true
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
it('should render "TableCell" cells correctly if "onMoveColumn" is missing in props', function () {
|
|
71
|
-
var setHoveredColumn = jest.fn();
|
|
72
|
-
var resetHoveredColumn = jest.fn();
|
|
73
|
-
var props = {
|
|
74
|
-
onMoveColumn: null,
|
|
75
|
-
setHoveredColumn: setHoveredColumn,
|
|
76
|
-
resetHoveredColumn: resetHoveredColumn,
|
|
77
|
-
someRowIsDragging: false
|
|
78
|
-
};
|
|
79
|
-
var component = setUp(props)[0];
|
|
80
|
-
expect(component.find(TableCell_1.TableCell)).toHaveLength(2);
|
|
81
|
-
component.find(TableCell_1.TableCell).forEach(function (node, index) {
|
|
82
|
-
expect(node.props()).toEqual({
|
|
83
|
-
rowData: defaultRowData,
|
|
84
|
-
columnValue: defaultColumnsData[index],
|
|
85
|
-
setHoveredColumn: setHoveredColumn,
|
|
86
|
-
resetHoveredColumn: resetHoveredColumn,
|
|
87
|
-
someRowIsDragging: false
|
|
88
|
-
});
|
|
89
|
-
});
|
|
48
|
+
setUp();
|
|
49
|
+
expect(react_2.screen.getByText('FirstName1')).toBeInTheDocument();
|
|
50
|
+
expect(react_2.screen.getByText('FirstName2')).toBeInTheDocument();
|
|
90
51
|
});
|
|
91
52
|
it('should add rowClassName to tr element', function () {
|
|
92
53
|
var rowClassName = 'class1';
|
|
93
|
-
|
|
94
|
-
expect(
|
|
95
|
-
expect(component.find('tr').hasClass(rowClassName)).toBe(true);
|
|
54
|
+
setUp(__assign(__assign({}, defaultProps), { rowData: __assign(__assign({}, defaultRowData), { rowClassName: rowClassName }) }));
|
|
55
|
+
expect(react_2.screen.getByRole('row', { name: rowName })).toHaveClass(rowClassName);
|
|
96
56
|
});
|
|
97
|
-
it('should set
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
57
|
+
it('should set opacity correctly when dragging was start and dragging was end', function () {
|
|
58
|
+
var onDragStart, onDragEnd;
|
|
59
|
+
core_1.useDndMonitor.mockImplementation(function (listeners) {
|
|
60
|
+
onDragStart = listeners.onDragStart;
|
|
61
|
+
onDragEnd = listeners.onDragEnd;
|
|
62
|
+
});
|
|
63
|
+
setUp();
|
|
64
|
+
var row = react_2.screen.getByRole('row', { name: rowName });
|
|
65
|
+
expect(row).toHaveStyle({ opacity: 1 });
|
|
66
|
+
(0, react_2.act)(function () {
|
|
67
|
+
onDragStart({
|
|
68
|
+
active: {
|
|
69
|
+
id: defaultProps.rowData.id,
|
|
70
|
+
data: {
|
|
71
|
+
current: {
|
|
72
|
+
type: types_1.DndItemTypes.Row
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
107
76
|
});
|
|
108
77
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
(0, test_utils_1.act)(function () {
|
|
113
|
-
backend.simulateHover([targetId]);
|
|
114
|
-
backend.simulateDrop();
|
|
115
|
-
backend.simulateEndDrag();
|
|
78
|
+
expect(row).toHaveStyle({ opacity: 0 });
|
|
79
|
+
(0, react_2.act)(function () {
|
|
80
|
+
onDragEnd();
|
|
116
81
|
});
|
|
117
|
-
|
|
118
|
-
|
|
82
|
+
expect(row).toHaveStyle({ opacity: 1 });
|
|
83
|
+
});
|
|
84
|
+
it('should should use TableCellWithDnd if isMoveColumnEnabled is true', function () {
|
|
85
|
+
core_1.useDroppable.mockClear();
|
|
86
|
+
setUp(__assign(__assign({}, defaultProps), { isMoveColumnEnabled: true }));
|
|
87
|
+
expect(core_1.useDroppable).toHaveBeenCalledWith({ id: defaultColumnsData[0].id });
|
|
88
|
+
expect(core_1.useDroppable).toHaveBeenCalledWith({ id: defaultColumnsData[1].id });
|
|
119
89
|
});
|
|
120
90
|
});
|
|
@@ -14,8 +14,8 @@ export declare const useHighlightedCrosswalks: () => any;
|
|
|
14
14
|
export declare const useCrosswalkHighlight: (crosswalk?: CrosswalkBase) => {
|
|
15
15
|
isHighlighted: boolean;
|
|
16
16
|
isDimmed: boolean;
|
|
17
|
-
highlightCrosswalk: () =>
|
|
18
|
-
removeHighlight: () =>
|
|
17
|
+
highlightCrosswalk: () => void;
|
|
18
|
+
removeHighlight: () => void;
|
|
19
19
|
};
|
|
20
20
|
export declare const useCrosswalkFocus: (crosswalk?: CrosswalkBase) => {
|
|
21
21
|
isFocused: any;
|
|
@@ -60,8 +60,12 @@ var useCrosswalkHighlight = function (crosswalk) {
|
|
|
60
60
|
return {
|
|
61
61
|
isHighlighted: isHighlighted,
|
|
62
62
|
isDimmed: highlightedCrosswalks.length > 0 && !isHighlighted,
|
|
63
|
-
highlightCrosswalk: (0, react_1.useCallback)(function () {
|
|
64
|
-
|
|
63
|
+
highlightCrosswalk: (0, react_1.useCallback)(function () {
|
|
64
|
+
setCrosswalkHighlighted(crosswalk, true);
|
|
65
|
+
}, [crosswalk, setCrosswalkHighlighted]),
|
|
66
|
+
removeHighlight: (0, react_1.useCallback)(function () {
|
|
67
|
+
setCrosswalkHighlighted(crosswalk, false);
|
|
68
|
+
}, [crosswalk, setCrosswalkHighlighted])
|
|
65
69
|
};
|
|
66
70
|
};
|
|
67
71
|
exports.useCrosswalkHighlight = useCrosswalkHighlight;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AttributeType, Entity, Relation } from '@reltio/mdm-sdk';
|
|
3
3
|
import { AddInlineAttributeEvent, DeleteInlineAttributeEvent, EditInlineAttributeEvent, IgnoreInlineAttributeEvent, PinInlineAttributeEvent } from '../../../types/inlineAttributes';
|
|
4
|
+
import { BasicTable } from '../../../BasicTable';
|
|
4
5
|
import { CrosswalksByOwnerTypeMap } from '../types';
|
|
5
6
|
type Props = {
|
|
6
7
|
entity?: Entity | Relation;
|
|
@@ -20,6 +21,7 @@ type Props = {
|
|
|
20
21
|
additionalHeaderItems?: React.ReactNode;
|
|
21
22
|
className?: string;
|
|
22
23
|
activeSurvivorshipGroupUri?: string;
|
|
24
|
+
tableRef?: React.ElementRef<typeof BasicTable>;
|
|
23
25
|
};
|
|
24
|
-
declare const _default: React.MemoExoticComponent<({ entity, isLoading, crosswalksMap, visibleColumns, onChangeVisibleColumns, readOnly, onDelete, onPin, onIgnore, onEdit, onAdd, emptyTempAttributeUris, selectedAttributeTypes, onSelectAttributeTypes, additionalHeaderItems, className, activeSurvivorshipGroupUri }: Props) => React.JSX.Element>;
|
|
26
|
+
declare const _default: React.MemoExoticComponent<({ entity, isLoading, crosswalksMap, visibleColumns, onChangeVisibleColumns, readOnly, onDelete, onPin, onIgnore, onEdit, onAdd, emptyTempAttributeUris, selectedAttributeTypes, onSelectAttributeTypes, additionalHeaderItems, className, activeSurvivorshipGroupUri, tableRef }: Props) => React.JSX.Element>;
|
|
25
27
|
export default _default;
|
|
@@ -60,7 +60,7 @@ var getRowCellKey = function (_a) {
|
|
|
60
60
|
return "".concat(id, "[").concat(getIdFromRowValue(rowValue), "][").concat(cellIndex, "]");
|
|
61
61
|
};
|
|
62
62
|
var AttributesTable = function (_a) {
|
|
63
|
-
var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? helpers_1.DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? ramda_1.identity : _c, _d = _a.onPin, onPin = _d === void 0 ? ramda_1.identity : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? ramda_1.identity : _e, _f = _a.onEdit, onEdit = _f === void 0 ? ramda_1.identity : _f, _g = _a.onAdd, onAdd = _g === void 0 ? ramda_1.identity : _g, emptyTempAttributeUris = _a.emptyTempAttributeUris, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? ramda_1.identity : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className, activeSurvivorshipGroupUri = _a.activeSurvivorshipGroupUri;
|
|
63
|
+
var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? helpers_1.DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? ramda_1.identity : _c, _d = _a.onPin, onPin = _d === void 0 ? ramda_1.identity : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? ramda_1.identity : _e, _f = _a.onEdit, onEdit = _f === void 0 ? ramda_1.identity : _f, _g = _a.onAdd, onAdd = _g === void 0 ? ramda_1.identity : _g, emptyTempAttributeUris = _a.emptyTempAttributeUris, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? ramda_1.identity : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className, activeSurvivorshipGroupUri = _a.activeSurvivorshipGroupUri, tableRef = _a.tableRef;
|
|
64
64
|
var styles = (0, styles_1.useStyles)();
|
|
65
65
|
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
66
66
|
var visibleColumnsData = (0, react_1.useMemo)(function () {
|
|
@@ -142,7 +142,7 @@ var AttributesTable = function (_a) {
|
|
|
142
142
|
react_1.default.createElement(ColumnsSettings_1.ColumnsSettings, { columnsData: helpers_1.COLUMNS_DATA, selectedColumns: visibleColumns, onChangeColumns: onChangeVisibleColumns })),
|
|
143
143
|
react_1.default.createElement("div", { className: styles.tableContent },
|
|
144
144
|
isLoading && react_1.default.createElement(LinearLoadIndicator_1.LinearLoadIndicator, null),
|
|
145
|
-
react_1.default.createElement(BasicTable_1.BasicTable, { fixFirstColumn: true, headRowHeight: 48, defaultColumnWidth: 250, defaultColumnMinWidth: 200, columnsData: visibleColumnsData, dndRowReorderingEnabled: false, dndRowReorderingHandler: handleReorderAttributeTypes, getIdFromRowValue: getIdFromRowValue, rowsData: rowsData, renderRowCell: renderRowCell, getRowCellHeight: getRowCellHeight, context: tableContext })),
|
|
145
|
+
react_1.default.createElement(BasicTable_1.BasicTable, { ref: tableRef, fixFirstColumn: true, headRowHeight: 48, defaultColumnWidth: 250, defaultColumnMinWidth: 200, columnsData: visibleColumnsData, dndRowReorderingEnabled: false, dndRowReorderingHandler: handleReorderAttributeTypes, getIdFromRowValue: getIdFromRowValue, rowsData: rowsData, renderRowCell: renderRowCell, getRowCellHeight: getRowCellHeight, context: tableContext })),
|
|
146
146
|
react_1.default.createElement(ConfirmDeleteDialog_1.ConfirmDeleteDialog, { open: !!pendingDeletion, onClose: function () { return setPendingDeletion(null); }, onConfirm: handleDelete }),
|
|
147
147
|
react_1.default.createElement(ConfirmEditIgnoredDialog_1.ConfirmEditIgnoredDialog, { open: !!pendingIgnoredEditing, onClose: function () { return setPendingIgnoredEditing(null); }, onConfirmEditWithIgnore: function () { return pendingIgnoredEditing && onEdit(pendingIgnoredEditing); }, onConfirmEditWithoutIgnore: function () {
|
|
148
148
|
if (pendingIgnoredEditing)
|
|
@@ -62,13 +62,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
62
62
|
var react_1 = __importDefault(require("react"));
|
|
63
63
|
var react_2 = require("@testing-library/react");
|
|
64
64
|
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
65
|
-
var react_dnd_1 = require("react-dnd");
|
|
66
|
-
var react_dnd_html5_backend_1 = __importDefault(require("react-dnd-html5-backend"));
|
|
67
65
|
var react_transition_group_1 = require("react-transition-group");
|
|
66
|
+
var dndKit_1 = require("../../../test-utils/dndKit");
|
|
67
|
+
var core_1 = require("@dnd-kit/core");
|
|
68
68
|
var test_utils_1 = require("../../../test-utils");
|
|
69
69
|
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
70
70
|
var AttributesTable_test_data_1 = require("./AttributesTable.test-data");
|
|
71
71
|
var AttributesTable_1 = __importDefault(require("./AttributesTable"));
|
|
72
|
+
jest.mock('@dnd-kit/core', function () { return dndKit_1.mockDndKit; });
|
|
72
73
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { debounce: function (x) { return x; } })); });
|
|
73
74
|
var visibleColumns = ['ovValues', 'values'];
|
|
74
75
|
var crosswalksMap = {
|
|
@@ -121,7 +122,7 @@ var setUp = function (props) {
|
|
|
121
122
|
var user = user_event_1.default.setup({ delay: null, skipHover: true });
|
|
122
123
|
var Providers = function (_a) {
|
|
123
124
|
var children = _a.children;
|
|
124
|
-
return (react_1.default.createElement(
|
|
125
|
+
return (react_1.default.createElement(core_1.DndContext, null,
|
|
125
126
|
react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } }, children)));
|
|
126
127
|
};
|
|
127
128
|
var renderer = (0, react_2.render)(react_1.default.createElement(AttributesTable_1.default, __assign({}, props)), { wrapper: Providers });
|
|
@@ -356,23 +357,29 @@ describe('attribute table tests', function () {
|
|
|
356
357
|
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
|
|
357
358
|
expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('Yes')).toBeInTheDocument();
|
|
358
359
|
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('text field value')).toBeInTheDocument();
|
|
359
|
-
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('
|
|
360
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('String Label')).toBeInTheDocument();
|
|
360
361
|
expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('text field value')).toBeInTheDocument();
|
|
361
362
|
var dragIndicator = getCellByIndexes(0, 0).querySelector('.dragIndicator');
|
|
362
|
-
react_2.fireEvent.
|
|
363
|
+
react_2.fireEvent.mouseDown(dragIndicator);
|
|
363
364
|
jest.runAllTimers();
|
|
364
365
|
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Yes')).not.toBeInTheDocument();
|
|
365
366
|
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
|
|
366
367
|
expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('Yes')).not.toBeInTheDocument();
|
|
367
368
|
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('text field value')).not.toBeInTheDocument();
|
|
368
|
-
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('
|
|
369
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('String Label')).toBeInTheDocument();
|
|
369
370
|
expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('text field value')).not.toBeInTheDocument();
|
|
370
371
|
var dropRow = getCellByIndexes(1, 0);
|
|
371
|
-
react_2.fireEvent.
|
|
372
|
+
react_2.fireEvent.mouseOver(dropRow);
|
|
372
373
|
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('Boolean')).toBeInTheDocument();
|
|
373
|
-
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('
|
|
374
|
-
react_2.fireEvent.
|
|
375
|
-
expect(onSelectAttributeTypes).toHaveBeenCalledWith([
|
|
374
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('String Label')).toBeInTheDocument();
|
|
375
|
+
react_2.fireEvent.mouseUp(dragIndicator);
|
|
376
|
+
expect(onSelectAttributeTypes).toHaveBeenCalledWith([
|
|
377
|
+
AttributesTable_test_data_1.selectedAttributeTypes[1],
|
|
378
|
+
AttributesTable_test_data_1.selectedAttributeTypes[0],
|
|
379
|
+
AttributesTable_test_data_1.selectedAttributeTypes[2],
|
|
380
|
+
AttributesTable_test_data_1.selectedAttributeTypes[3],
|
|
381
|
+
AttributesTable_test_data_1.selectedAttributeTypes[4]
|
|
382
|
+
]);
|
|
376
383
|
unmockTableSizing();
|
|
377
384
|
});
|
|
378
385
|
it('should pin and ignore attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OvValues } from '../../types';
|
|
3
|
+
import { DraggableProps } from '../../../../../types/basicTable';
|
|
3
4
|
type Props = {
|
|
4
5
|
value: OvValues;
|
|
5
6
|
someRowIsDragging?: boolean;
|
|
6
|
-
|
|
7
|
+
draggableProps?: DraggableProps;
|
|
7
8
|
};
|
|
8
|
-
export declare const OvValuesRenderer: ({ value: { values, attributeType }, someRowIsDragging,
|
|
9
|
+
export declare const OvValuesRenderer: ({ value: { values, attributeType }, someRowIsDragging, draggableProps }: Props) => React.JSX.Element;
|
|
9
10
|
export {};
|
package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -14,12 +25,12 @@ var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
|
14
25
|
var styles_1 = require("../../styles");
|
|
15
26
|
var styles_2 = require("./styles");
|
|
16
27
|
var OvValuesRenderer = function (_a) {
|
|
17
|
-
var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging,
|
|
28
|
+
var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging, draggableProps = _a.draggableProps;
|
|
18
29
|
var styles = (0, styles_2.useStyles)();
|
|
19
30
|
var commonStyles = (0, styles_1.useCommonStyles)();
|
|
20
31
|
var entity = (0, MdmModuleContext_1.useMdmEntity)();
|
|
21
32
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, commonStyles.basicCell) },
|
|
22
|
-
react_1.default.createElement("div", {
|
|
33
|
+
react_1.default.createElement("div", __assign({}, draggableProps, { className: styles.dragIndicator }),
|
|
23
34
|
react_1.default.createElement(DragIndicator_1.default, { className: styles.dragIndicatorIcon })),
|
|
24
35
|
react_1.default.createElement(AttributeTitle_1.AttributeTitle, { className: styles.attributeTitle, label: attributeType.label }),
|
|
25
36
|
!someRowIsDragging && (react_1.default.createElement(EntityContext_1.EntityContext.Provider, { value: entity },
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BasicTable } from '../../../BasicTable';
|
|
3
|
+
type Props = {
|
|
4
|
+
tableRef: React.ElementRef<typeof BasicTable>;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const CrosswalkDndComponent: ({ children, tableRef }: Props) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CrosswalkDndComponent = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
var useDndBasicTableScrollModifier_1 = require("../../../hooks/useDndBasicTableScrollModifier");
|
|
29
|
+
var useDraggingCrosswalk_1 = require("../hooks/useDraggingCrosswalk");
|
|
30
|
+
var modifiers_1 = require("@dnd-kit/modifiers");
|
|
31
|
+
var core_1 = require("@dnd-kit/core");
|
|
32
|
+
var CrosswalkDragPreview_1 = require("../CrosswalkDragPreview");
|
|
33
|
+
var CrosswalkDndComponent = function (_a) {
|
|
34
|
+
var children = _a.children, tableRef = _a.tableRef;
|
|
35
|
+
var _b = (0, useDndBasicTableScrollModifier_1.useDndBasicTableScrollModifier)({ tableRef: tableRef }), scrollModifier = _b.scrollModifier, stopScroll = _b.stopScroll;
|
|
36
|
+
var dragOverlayStyles = (0, react_1.useMemo)(function () { return ({ width: 'max-content' }); }, []);
|
|
37
|
+
var _c = (0, useDraggingCrosswalk_1.useDraggingCrosswalk)(), draggingCrosswalk = _c.draggingCrosswalk, onDragEndCrosswalk = _c.onDragEnd, onDragStart = _c.onDragStart;
|
|
38
|
+
var onDragEnd = (0, react_1.useCallback)(function () {
|
|
39
|
+
onDragEndCrosswalk();
|
|
40
|
+
stopScroll();
|
|
41
|
+
}, [onDragEndCrosswalk, stopScroll]);
|
|
42
|
+
var dndContextModifiers = (0, react_1.useMemo)(function () { return [scrollModifier]; }, [scrollModifier]);
|
|
43
|
+
var dragOverlayModifiers = (0, react_1.useMemo)(function () { return [modifiers_1.snapCenterToCursor]; }, []);
|
|
44
|
+
var mouseSensor = (0, core_1.useSensor)(core_1.MouseSensor);
|
|
45
|
+
var sensors = (0, core_1.useSensors)(mouseSensor);
|
|
46
|
+
return (react_1.default.createElement(core_1.DndContext, { sensors: sensors, modifiers: dndContextModifiers, autoScroll: false, onDragStart: onDragStart, onDragEnd: onDragEnd },
|
|
47
|
+
react_1.default.createElement(core_1.DragOverlay, { style: dragOverlayStyles, modifiers: dragOverlayModifiers, dropAnimation: null },
|
|
48
|
+
react_1.default.createElement(CrosswalkDragPreview_1.CrosswalkDragPreview, { crosswalk: draggingCrosswalk })),
|
|
49
|
+
children));
|
|
50
|
+
};
|
|
51
|
+
exports.CrosswalkDndComponent = CrosswalkDndComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CrosswalkDndComponent } from './CrosswalkDndComponent';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CrosswalkDndComponent = void 0;
|
|
4
|
+
var CrosswalkDndComponent_1 = require("./CrosswalkDndComponent");
|
|
5
|
+
Object.defineProperty(exports, "CrosswalkDndComponent", { enumerable: true, get: function () { return CrosswalkDndComponent_1.CrosswalkDndComponent; } });
|
|
@@ -28,20 +28,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.CrosswalkDragPreview = void 0;
|
|
30
30
|
var react_1 = __importStar(require("react"));
|
|
31
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
31
32
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
33
|
+
var core_1 = require("@dnd-kit/core");
|
|
32
34
|
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
33
|
-
var MdmModuleContext_1 = require("
|
|
34
|
-
var CrosswalksDisplayContext_1 = require("
|
|
35
|
-
var SourceIcon_1 = require("
|
|
36
|
-
var ColoredBlock_1 = require("
|
|
35
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
36
|
+
var CrosswalksDisplayContext_1 = require("../../../contexts/CrosswalksDisplayContext");
|
|
37
|
+
var SourceIcon_1 = require("../../../SourceIcon");
|
|
38
|
+
var ColoredBlock_1 = require("../ColoredBlock");
|
|
37
39
|
var styles_1 = require("./styles");
|
|
38
40
|
exports.CrosswalkDragPreview = (0, react_1.memo)(function (_a) {
|
|
41
|
+
var _b;
|
|
39
42
|
var crosswalk = _a.crosswalk;
|
|
40
43
|
var styles = (0, styles_1.useStyles)();
|
|
41
44
|
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
42
45
|
var color = (0, CrosswalksDisplayContext_1.useCrosswalkColor)(crosswalk);
|
|
43
46
|
var sourceSystemLabel = (0, mdm_sdk_1.getSourceSystemLabel)(metadata, crosswalk.type);
|
|
44
|
-
|
|
47
|
+
var _c = (0, react_1.useState)(false), canDrop = _c[0], setCanDrop = _c[1];
|
|
48
|
+
(0, core_1.useDndMonitor)({
|
|
49
|
+
onDragOver: function (event) {
|
|
50
|
+
var _a, _b, _c;
|
|
51
|
+
var attributeType = (_c = (_b = (_a = event.over) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.attributeType;
|
|
52
|
+
setCanDrop(!!attributeType && (0, mdm_sdk_1.canAddCrosswalk)(crosswalk, attributeType));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return (react_1.default.createElement(ColoredBlock_1.ColoredBlock, { color: color, className: (0, classnames_1.default)(styles.crosswalkPreview, (_b = {}, _b[styles.noDrop] = !canDrop, _b)) },
|
|
45
56
|
react_1.default.createElement(SourceIcon_1.SourceIcon, { className: styles.sourceIcon, sourceType: crosswalk.type }),
|
|
46
57
|
react_1.default.createElement(Typography_1.default, { className: styles.sourceLabel, variant: 'body2' }, sourceSystemLabel)));
|
|
47
58
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var react_1 = __importDefault(require("react"));
|
|
41
|
+
var CrosswalksDisplay = __importStar(require("../../../contexts/CrosswalksDisplayContext"));
|
|
42
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
43
|
+
var CrosswalkDragPreview_1 = require("./CrosswalkDragPreview");
|
|
44
|
+
var react_2 = require("@testing-library/react");
|
|
45
|
+
var core_1 = require("@dnd-kit/core");
|
|
46
|
+
jest.mock('@dnd-kit/core', function () { return (__assign(__assign({}, jest.requireActual('@dnd-kit/core')), { useDndMonitor: jest.fn() })); });
|
|
47
|
+
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { canAddCrosswalk: jest.fn().mockReturnValue(true) })); });
|
|
48
|
+
var defaultProps = {
|
|
49
|
+
crosswalk: { uri: 'entities/1/crosswalks/1', type: 'configuration/sources/FB', value: '123' }
|
|
50
|
+
};
|
|
51
|
+
var setUp = function (props) {
|
|
52
|
+
if (props === void 0) { props = defaultProps; }
|
|
53
|
+
var metadata = {
|
|
54
|
+
sources: [
|
|
55
|
+
{
|
|
56
|
+
uri: 'configuration/sources/FB',
|
|
57
|
+
label: 'Facebook'
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
var Providers = function (_a) {
|
|
62
|
+
var children = _a.children;
|
|
63
|
+
return (react_1.default.createElement(core_1.DndContext, null,
|
|
64
|
+
react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } }, children)));
|
|
65
|
+
};
|
|
66
|
+
return (0, react_2.render)(react_1.default.createElement(CrosswalkDragPreview_1.CrosswalkDragPreview, __assign({}, props)), { wrapper: Providers });
|
|
67
|
+
};
|
|
68
|
+
describe('CrosswalkDragPreview tests', function () {
|
|
69
|
+
beforeAll(function () {
|
|
70
|
+
jest.spyOn(CrosswalksDisplay, 'useCrosswalkColor').mockImplementation(function (crosswalks) { return crosswalks === null || crosswalks === void 0 ? void 0 : crosswalks.value; });
|
|
71
|
+
});
|
|
72
|
+
it('should render correctly', function () {
|
|
73
|
+
setUp();
|
|
74
|
+
expect(react_2.screen.getByText('Facebook')).toBeInTheDocument();
|
|
75
|
+
expect(react_2.screen.getByText('F')).toBeInTheDocument();
|
|
76
|
+
expect(react_2.screen.getByTestId('cw-colored-block')).toHaveClass('noDrop');
|
|
77
|
+
});
|
|
78
|
+
it('should able for drop', function () {
|
|
79
|
+
var onDragOver;
|
|
80
|
+
core_1.useDndMonitor.mockImplementation(function (listeners) {
|
|
81
|
+
onDragOver = listeners.onDragOver;
|
|
82
|
+
});
|
|
83
|
+
setUp();
|
|
84
|
+
(0, react_2.act)(function () {
|
|
85
|
+
onDragOver({
|
|
86
|
+
over: {
|
|
87
|
+
data: {
|
|
88
|
+
current: {
|
|
89
|
+
attributeType: 'testAttrTypeUri'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
expect(react_2.screen.getByTestId('cw-colored-block')).not.toHaveClass('noDrop');
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"sourceIcon" | "crosswalkPreview" | "sourceLabel">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"sourceIcon" | "crosswalkPreview" | "sourceLabel" | "noDrop">;
|
|
@@ -5,12 +5,14 @@ var styles_1 = require("@mui/styles");
|
|
|
5
5
|
exports.useStyles = (0, styles_1.makeStyles)({
|
|
6
6
|
crosswalkPreview: {
|
|
7
7
|
height: '28px',
|
|
8
|
+
width: 'max-content',
|
|
8
9
|
maxWidth: '394px',
|
|
9
10
|
display: 'flex',
|
|
10
11
|
overflow: 'hidden',
|
|
11
12
|
padding: '6px',
|
|
12
13
|
alignItems: 'center',
|
|
13
|
-
boxSizing: 'border-box'
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
cursor: 'copy'
|
|
14
16
|
},
|
|
15
17
|
sourceLabel: {
|
|
16
18
|
fontSize: '13px',
|
|
@@ -22,5 +24,8 @@ exports.useStyles = (0, styles_1.makeStyles)({
|
|
|
22
24
|
width: '16px',
|
|
23
25
|
height: '16px',
|
|
24
26
|
marginRight: '9px'
|
|
27
|
+
},
|
|
28
|
+
noDrop: {
|
|
29
|
+
cursor: 'no-drop'
|
|
25
30
|
}
|
|
26
31
|
});
|