@reltio/components 1.4.2018 → 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/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/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
package/BarChart/helpers.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { BarChartOptions } from '@reltio/mdm-sdk';
|
|
|
4
4
|
type BarChartSettings = {
|
|
5
5
|
barChart: React.ComponentProps<typeof BarChart>;
|
|
6
6
|
bar: Omit<BarProps, 'ref'>;
|
|
7
|
-
xAxis: XAxisProps
|
|
8
|
-
yAxis: YAxisProps
|
|
7
|
+
xAxis: Omit<XAxisProps, 'ref'>;
|
|
8
|
+
yAxis: Omit<YAxisProps, 'ref'>;
|
|
9
9
|
cartesianGrid: Omit<CartesianGridProps, 'ref'>;
|
|
10
10
|
tooltip: TooltipProps<number, string>;
|
|
11
11
|
};
|
|
@@ -48,16 +48,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { screen, render, within, fireEvent, act } from '@testing-library/react';
|
|
50
50
|
import userEvent from '@testing-library/user-event';
|
|
51
|
-
import
|
|
52
|
-
|
|
51
|
+
import { mockDndKit } from '../test-utils/dndKit';
|
|
52
|
+
jest.mock('@dnd-kit/core', function () { return mockDndKit; });
|
|
53
53
|
import { BasicTable } from './BasicTable';
|
|
54
54
|
import { CollapseRowButton } from '../CollapseRowButton';
|
|
55
55
|
import { mockBasicTableSizing } from '../test-utils';
|
|
56
56
|
var FirstColumnRenderer = function (_a) {
|
|
57
|
-
var value = _a.value, rowValue = _a.rowValue, rowIndex = _a.rowIndex,
|
|
57
|
+
var value = _a.value, rowValue = _a.rowValue, rowIndex = _a.rowIndex, draggableProps = _a.draggableProps;
|
|
58
58
|
return (React.createElement("div", null,
|
|
59
59
|
React.createElement(CollapseRowButton, { rowIndex: rowIndex, rowValue: rowValue }),
|
|
60
|
-
React.createElement("div", {
|
|
60
|
+
React.createElement("div", __assign({}, draggableProps), "drag el"),
|
|
61
61
|
React.createElement("div", null, value.name)));
|
|
62
62
|
};
|
|
63
63
|
var SecondColumnRenderer = function (_a) {
|
|
@@ -117,11 +117,7 @@ var defaultProps = {
|
|
|
117
117
|
};
|
|
118
118
|
var setUp = function (props) {
|
|
119
119
|
var user = userEvent.setup();
|
|
120
|
-
|
|
121
|
-
var children = _a.children;
|
|
122
|
-
return React.createElement(DndProvider, { backend: HTML5Backend }, children);
|
|
123
|
-
};
|
|
124
|
-
return __assign(__assign({}, render(React.createElement(BasicTable, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
120
|
+
return __assign(__assign({}, render(React.createElement(BasicTable, __assign({}, props)))), { user: user });
|
|
125
121
|
};
|
|
126
122
|
describe('basic table tests', function () {
|
|
127
123
|
it('should collapse all rows after start dragging', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -153,7 +149,7 @@ describe('basic table tests', function () {
|
|
|
153
149
|
dragIndicator = within(getCellByIndexes(1, 0)).queryByText('drag el');
|
|
154
150
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
155
151
|
return __generator(this, function (_a) {
|
|
156
|
-
fireEvent.
|
|
152
|
+
fireEvent.mouseDown(dragIndicator);
|
|
157
153
|
return [2 /*return*/];
|
|
158
154
|
});
|
|
159
155
|
}); })];
|
|
@@ -164,14 +160,6 @@ describe('basic table tests', function () {
|
|
|
164
160
|
expect(within(getCellByIndexes(0, 1)).queryByText('row 1 value 3')).not.toBeInTheDocument();
|
|
165
161
|
expect(within(getCellByIndexes(1, 1)).queryByText('row 2 value 1')).toBeInTheDocument();
|
|
166
162
|
expect(within(getCellByIndexes(1, 1)).queryByText('row 2 value 2')).not.toBeInTheDocument();
|
|
167
|
-
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
168
|
-
return __generator(this, function (_a) {
|
|
169
|
-
fireEvent.dragEnd(getCellByIndexes(1, 0));
|
|
170
|
-
return [2 /*return*/];
|
|
171
|
-
});
|
|
172
|
-
}); })];
|
|
173
|
-
case 4:
|
|
174
|
-
_a.sent();
|
|
175
163
|
unmockTableSizing();
|
|
176
164
|
return [2 /*return*/];
|
|
177
165
|
}
|
|
@@ -48,8 +48,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import userEvent from '@testing-library/user-event';
|
|
50
50
|
import { render, screen, act, waitFor } from '@testing-library/react';
|
|
51
|
-
import { DndProvider } from 'react-dnd';
|
|
52
|
-
import HTML5Backend from 'react-dnd-html5-backend';
|
|
53
51
|
import { ErrorType, Mode, getAttributesListForEditMode, uploadImage } from '@reltio/mdm-sdk';
|
|
54
52
|
import { EditModeAttributesView } from './EditModeAttributesView';
|
|
55
53
|
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
@@ -106,9 +104,8 @@ describe('EditModeAttributesView tests', function () {
|
|
|
106
104
|
var user = userEvent.setup(userOptions);
|
|
107
105
|
var Providers = function (_a) {
|
|
108
106
|
var children = _a.children;
|
|
109
|
-
return (React.createElement(
|
|
110
|
-
React.createElement(
|
|
111
|
-
React.createElement(ScrollToElementProvider, null, children))));
|
|
107
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues, actions: mdmActions },
|
|
108
|
+
React.createElement(ScrollToElementProvider, null, children)));
|
|
112
109
|
};
|
|
113
110
|
return __assign({ user: user }, render(React.createElement(EditModeAttributesView, __assign({}, props)), { wrapper: Providers }));
|
|
114
111
|
};
|
|
@@ -13,8 +13,6 @@ import React from 'react';
|
|
|
13
13
|
import { act } from 'react-dom/test-utils';
|
|
14
14
|
import ReactResizeDetector from 'react-resize-detector';
|
|
15
15
|
import { mount } from 'enzyme';
|
|
16
|
-
import { DndProvider } from 'react-dnd';
|
|
17
|
-
import HTML5Backend from 'react-dnd-html5-backend';
|
|
18
16
|
import { Mode, insertDefaultImageByAttrUri } from '@reltio/mdm-sdk';
|
|
19
17
|
import { Image } from '../Image';
|
|
20
18
|
import { EmptyStub } from '../EmptyStub';
|
|
@@ -91,9 +89,8 @@ var defaultProps = {
|
|
|
91
89
|
};
|
|
92
90
|
var setUp = function (_a) {
|
|
93
91
|
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d, _e = _b.mdmActions, mdmActions = _e === void 0 ? defaultMdmActions : _e;
|
|
94
|
-
return mount(React.createElement(
|
|
95
|
-
React.createElement(
|
|
96
|
-
React.createElement(ImageAttributesLineEditor, __assign({}, props)))));
|
|
92
|
+
return mount(React.createElement(MdmModuleProvider, { values: mdmValues, actions: mdmActions },
|
|
93
|
+
React.createElement(ImageAttributesLineEditor, __assign({}, props))));
|
|
97
94
|
};
|
|
98
95
|
describe('ImageAttributesLineEditor edit tests', function () {
|
|
99
96
|
beforeAll(function () {
|
package/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.js
CHANGED
|
@@ -20,37 +20,48 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { useCallback, useState } from 'react';
|
|
24
24
|
import i18n from 'ui-i18n';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
25
|
+
import { useDndMonitor, useDroppable } from '@dnd-kit/core';
|
|
26
|
+
import { canAddCrosswalk } from '@reltio/mdm-sdk';
|
|
27
27
|
import { InlineSimpleAttribute } from '../../../InlineSimpleAttribute';
|
|
28
28
|
import { useStyles } from './styles';
|
|
29
29
|
export var InlineSimpleAttributesBlock = function (_a) {
|
|
30
30
|
var attributeValues = _a.attributeValues, attributeType = _a.attributeType, parentUri = _a.parentUri, disableEdit = _a.disableEdit, crosswalksMap = _a.crosswalksMap, onAdd = _a.onAdd, emptyTempAttributeUris = _a.emptyTempAttributeUris, props = __rest(_a, ["attributeValues", "attributeType", "parentUri", "disableEdit", "crosswalksMap", "onAdd", "emptyTempAttributeUris"]);
|
|
31
31
|
var styles = useStyles();
|
|
32
|
-
var _b =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
var _b = useState(false), isDragItemOver = _b[0], setIsDragItemOver = _b[1];
|
|
33
|
+
var checkCanAddCrosswalk = useCallback(function (event) {
|
|
34
|
+
var _a;
|
|
35
|
+
var draggingData = event.active.data.current;
|
|
36
|
+
var crosswalk = draggingData === null || draggingData === void 0 ? void 0 : draggingData.crosswalk;
|
|
37
|
+
return (!disableEdit &&
|
|
38
|
+
(draggingData === null || draggingData === void 0 ? void 0 : draggingData.type) === 'Crosswalk' &&
|
|
39
|
+
attributeType.uri === ((_a = event.over) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
40
|
+
crosswalk &&
|
|
41
|
+
canAddCrosswalk(crosswalk, attributeType));
|
|
42
|
+
}, [disableEdit, attributeType]);
|
|
43
|
+
useDndMonitor({
|
|
44
|
+
onDragOver: function (event) {
|
|
45
|
+
setIsDragItemOver(checkCanAddCrosswalk(event));
|
|
42
46
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
onDragEnd: function (event) {
|
|
48
|
+
var draggingData = event.active.data.current;
|
|
49
|
+
var crosswalk = draggingData === null || draggingData === void 0 ? void 0 : draggingData.crosswalk;
|
|
50
|
+
if (checkCanAddCrosswalk(event)) {
|
|
51
|
+
onAdd({ attributeType: attributeType, crosswalk: crosswalk, parentUri: parentUri, index: attributeValues.length });
|
|
52
|
+
}
|
|
53
|
+
setIsDragItemOver(false);
|
|
50
54
|
}
|
|
51
|
-
})
|
|
55
|
+
});
|
|
56
|
+
var setNodeRef = useDroppable({
|
|
57
|
+
id: attributeType.uri,
|
|
58
|
+
data: {
|
|
59
|
+
type: 'Crosswalk',
|
|
60
|
+
attributeType: attributeType
|
|
61
|
+
}
|
|
62
|
+
}).setNodeRef;
|
|
52
63
|
var attributeIndex = 0;
|
|
53
|
-
return (React.createElement("div", { ref:
|
|
64
|
+
return (React.createElement("div", { ref: setNodeRef, className: styles.simpleAttributesWrapper, "data-reltio-id": 'simple-attributes-wrapper' },
|
|
54
65
|
attributeValues.map(function (value) {
|
|
55
66
|
var _a;
|
|
56
67
|
return (_a = crosswalksMap[value.uri]) === null || _a === void 0 ? void 0 : _a.map(function (crosswalk) { return (React.createElement(InlineSimpleAttribute, __assign({ key: value.uri + crosswalk.uri, attributeType: attributeType, attributeValue: value, crosswalk: crosswalk, disableEdit: disableEdit, isEmpty: emptyTempAttributeUris.includes(value.uri), dataReltioId: "value-index-".concat(attributeIndex++) }, props))); });
|
|
@@ -10,10 +10,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import { shallow } from 'enzyme';
|
|
14
13
|
import { InlineSimpleAttributesBlock } from './InlineSimpleAttributesBlock';
|
|
15
|
-
import
|
|
16
|
-
|
|
14
|
+
import { DndContext, useDndMonitor } from '@dnd-kit/core';
|
|
15
|
+
import { act, render, screen } from '@testing-library/react';
|
|
16
|
+
jest.mock('@dnd-kit/core', function () { return (__assign(__assign({}, jest.requireActual('@dnd-kit/core')), { useDndMonitor: jest.fn() })); });
|
|
17
17
|
describe('InlineSimpleAttributesBlock tests', function () {
|
|
18
18
|
var attributeType = {
|
|
19
19
|
uri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
@@ -73,43 +73,52 @@ describe('InlineSimpleAttributesBlock tests', function () {
|
|
|
73
73
|
onEdit: jest.fn(),
|
|
74
74
|
onDelete: jest.fn()
|
|
75
75
|
};
|
|
76
|
-
var
|
|
77
|
-
var
|
|
76
|
+
var defaultProps = __assign({ attributeValues: attributeValues, crosswalksMap: crosswalksMap, parentUri: 'entities/1', onAdd: jest.fn(), emptyTempAttributeUris: [] }, commonProps);
|
|
77
|
+
var getDragEvent = function (draggingData, attributeType) { return ({
|
|
78
|
+
active: {
|
|
79
|
+
data: {
|
|
80
|
+
current: __assign({}, draggingData)
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
over: {
|
|
84
|
+
id: attributeType.uri
|
|
85
|
+
}
|
|
86
|
+
}); };
|
|
87
|
+
var setUp = function (props) {
|
|
88
|
+
if (props === void 0) { props = defaultProps; }
|
|
89
|
+
var Providers = function (_a) {
|
|
90
|
+
var children = _a.children;
|
|
91
|
+
return React.createElement(DndContext, null, children);
|
|
92
|
+
};
|
|
93
|
+
return render(React.createElement(InlineSimpleAttributesBlock, __assign({}, props)), { wrapper: Providers });
|
|
94
|
+
};
|
|
78
95
|
it('should render values for each crosswalk', function () {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
expect(
|
|
82
|
-
attributes.forEach(function (attribute) {
|
|
83
|
-
expect(attribute.props()).toMatchObject(commonProps);
|
|
84
|
-
});
|
|
85
|
-
expect(attributes.at(0).prop('attributeValue')).toBe(attributeValues[0]);
|
|
86
|
-
expect(attributes.at(0).prop('crosswalk')).toBe(crosswalks[0]);
|
|
87
|
-
expect(attributes.at(1).prop('attributeValue')).toBe(attributeValues[1]);
|
|
88
|
-
expect(attributes.at(1).prop('crosswalk')).toBe(crosswalks[0]);
|
|
89
|
-
expect(attributes.at(2).prop('attributeValue')).toBe(attributeValues[1]);
|
|
90
|
-
expect(attributes.at(2).prop('crosswalk')).toBe(crosswalks[1]);
|
|
96
|
+
setUp();
|
|
97
|
+
expect(screen.getByText(attributeValues[0].value)).toBeInTheDocument();
|
|
98
|
+
expect(screen.getAllByText(attributeValues[1].value)).toHaveLength(2);
|
|
91
99
|
});
|
|
92
|
-
describe('dnd', function () {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
expect(accept).toEqual('Crosswalk');
|
|
100
|
+
describe('dnd behavior', function () {
|
|
101
|
+
var onDragOver, onDragEnd;
|
|
102
|
+
beforeAll(function () {
|
|
103
|
+
useDndMonitor.mockImplementation(function (listeners) {
|
|
104
|
+
onDragOver = listeners.onDragOver;
|
|
105
|
+
onDragEnd = listeners.onDragEnd;
|
|
106
|
+
});
|
|
100
107
|
});
|
|
101
108
|
it('should not allow drop relation crosswalk on entity attribute', function () {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
setUp();
|
|
110
|
+
act(function () {
|
|
111
|
+
onDragOver(getDragEvent({
|
|
112
|
+
type: 'Crosswalk',
|
|
113
|
+
crosswalk: {
|
|
114
|
+
uri: 'entities/1/crosswalks/1',
|
|
115
|
+
ownerType: 'relation',
|
|
116
|
+
type: 'configuration/sources/FB',
|
|
117
|
+
value: '123'
|
|
118
|
+
}
|
|
119
|
+
}, defaultProps.attributeType));
|
|
120
|
+
});
|
|
121
|
+
expect(screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
113
122
|
});
|
|
114
123
|
it('should allow drop relation crosswalk on relation attribute', function () {
|
|
115
124
|
var attributeType = {
|
|
@@ -132,26 +141,31 @@ describe('InlineSimpleAttributesBlock tests', function () {
|
|
|
132
141
|
ov: false
|
|
133
142
|
}
|
|
134
143
|
];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
144
|
+
setUp(__assign(__assign({}, defaultProps), { attributeType: attributeType, attributeValues: attributeValues }));
|
|
145
|
+
act(function () {
|
|
146
|
+
onDragOver(getDragEvent({
|
|
147
|
+
type: 'Crosswalk',
|
|
148
|
+
crosswalk: {
|
|
149
|
+
uri: 'relations/1/crosswalks/1',
|
|
150
|
+
ownerType: 'entity',
|
|
151
|
+
type: 'configuration/sources/FB',
|
|
152
|
+
value: '123'
|
|
153
|
+
}
|
|
154
|
+
}, attributeType));
|
|
155
|
+
});
|
|
156
|
+
expect(screen.getByText('Drop here')).toBeInTheDocument();
|
|
157
|
+
act(function () {
|
|
158
|
+
onDragOver(getDragEvent({
|
|
159
|
+
type: 'Crosswalk',
|
|
160
|
+
crosswalk: {
|
|
161
|
+
uri: 'entities/1/crosswalks/1',
|
|
162
|
+
ownerType: 'relation',
|
|
163
|
+
type: 'configuration/sources/FB',
|
|
164
|
+
value: '123'
|
|
165
|
+
}
|
|
166
|
+
}, attributeType));
|
|
167
|
+
});
|
|
168
|
+
expect(screen.getByText('Drop here')).toBeInTheDocument();
|
|
155
169
|
});
|
|
156
170
|
it('should not allow drop entity crosswalk on relation attribute', function () {
|
|
157
171
|
var attributeType = {
|
|
@@ -174,76 +188,70 @@ describe('InlineSimpleAttributesBlock tests', function () {
|
|
|
174
188
|
ov: false
|
|
175
189
|
}
|
|
176
190
|
];
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
191
|
+
setUp(__assign(__assign({}, defaultProps), { attributeType: attributeType, attributeValues: attributeValues }));
|
|
192
|
+
act(function () {
|
|
193
|
+
onDragOver(getDragEvent({
|
|
194
|
+
type: 'Crosswalk',
|
|
195
|
+
crosswalk: {
|
|
196
|
+
uri: 'entities/1/crosswalks/1',
|
|
197
|
+
ownerType: 'entity',
|
|
198
|
+
type: 'configuration/sources/FB',
|
|
199
|
+
value: '123'
|
|
200
|
+
}
|
|
201
|
+
}, attributeType));
|
|
202
|
+
});
|
|
203
|
+
expect(screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
188
204
|
});
|
|
189
205
|
it('should not allow drop crosswalk on entity attribute without permission to create', function () {
|
|
190
206
|
var readOnlyAttrType = __assign(__assign({}, attributeType), { access: ['READ'] });
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
setUp(__assign(__assign({}, defaultProps), { attributeType: readOnlyAttrType, attributeValues: attributeValues }));
|
|
208
|
+
act(function () {
|
|
209
|
+
onDragOver(getDragEvent({
|
|
210
|
+
type: 'Crosswalk',
|
|
211
|
+
crosswalk: {
|
|
212
|
+
uri: 'entities/1/crosswalks/1',
|
|
213
|
+
ownerType: 'entity',
|
|
214
|
+
type: 'configuration/sources/FB',
|
|
215
|
+
value: '123'
|
|
216
|
+
}
|
|
217
|
+
}, readOnlyAttrType));
|
|
218
|
+
});
|
|
219
|
+
expect(screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
202
220
|
});
|
|
203
221
|
it('should not allow drop crosswalk on attribute if parent attribute can not be edited', function () {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var wrapper = shallow(React.createElement(InlineSimpleAttributesBlock, __assign({}, props)));
|
|
218
|
-
var _a = useDropMock.mock.calls[0][0], canDrop = _a.canDrop, collect = _a.collect;
|
|
219
|
-
expect(canDrop({
|
|
220
|
-
type: 'Crosswalk',
|
|
221
|
-
crosswalk: {
|
|
222
|
-
uri: 'entities/1/crosswalks/1',
|
|
223
|
-
ownerType: 'entity',
|
|
224
|
-
type: 'configuration/sources/FB',
|
|
225
|
-
value: '123'
|
|
226
|
-
}
|
|
227
|
-
}, {})).toBe(true);
|
|
228
|
-
expect(wrapper.find('.dropIndicator')).toHaveLength(0);
|
|
229
|
-
collect({ isOver: function () { return true; }, canDrop: function () { return true; } });
|
|
230
|
-
expect(wrapper.find('.dropIndicator')).toHaveLength(0);
|
|
222
|
+
setUp(__assign(__assign({}, defaultProps), { disableEdit: true }));
|
|
223
|
+
act(function () {
|
|
224
|
+
onDragOver(getDragEvent({
|
|
225
|
+
type: 'Crosswalk',
|
|
226
|
+
crosswalk: {
|
|
227
|
+
uri: 'entities/1/crosswalks/1',
|
|
228
|
+
ownerType: 'entity',
|
|
229
|
+
type: 'configuration/sources/FB',
|
|
230
|
+
value: '123'
|
|
231
|
+
}
|
|
232
|
+
}, defaultProps.attributeType));
|
|
233
|
+
});
|
|
234
|
+
expect(screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
231
235
|
});
|
|
232
236
|
it('should call props.onAdd on crosswalk drop', function () {
|
|
233
|
-
|
|
234
|
-
var drop = useDropMock.mock.calls[0][0].drop;
|
|
237
|
+
setUp();
|
|
235
238
|
var crosswalk = {
|
|
236
239
|
uri: 'entities/1/crosswalks/1',
|
|
237
240
|
ownerType: 'entity',
|
|
238
241
|
type: 'configuration/sources/FB',
|
|
239
242
|
value: '123'
|
|
240
243
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
act(function () {
|
|
245
|
+
onDragEnd(getDragEvent({
|
|
246
|
+
type: 'Crosswalk',
|
|
247
|
+
crosswalk: crosswalk
|
|
248
|
+
}, defaultProps.attributeType));
|
|
249
|
+
});
|
|
250
|
+
expect(defaultProps.onAdd).toHaveBeenCalledWith({
|
|
251
|
+
parentUri: defaultProps.parentUri,
|
|
252
|
+
attributeType: defaultProps.attributeType,
|
|
245
253
|
crosswalk: crosswalk,
|
|
246
|
-
index:
|
|
254
|
+
index: defaultProps.attributeValues.length
|
|
247
255
|
});
|
|
248
256
|
});
|
|
249
257
|
});
|
|
@@ -36,7 +36,7 @@ export var InlineSimpleAttribute = function (_a) {
|
|
|
36
36
|
var showIgnore = !isTemporary && ((!isReadingMode && hasBasicPermission) || attributeValue.ignored);
|
|
37
37
|
var showMaskingSwitcher = (isUnmaskingNeeded && !isTemporary && !isReadingMode) || isUnmasking;
|
|
38
38
|
useEffect(function () {
|
|
39
|
-
if (isTemporary &&
|
|
39
|
+
if (isTemporary && isEmpty) {
|
|
40
40
|
setEditingMode();
|
|
41
41
|
}
|
|
42
42
|
}, [isEmpty]);
|
package/LineChart/helpers.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { LineChartOptions } from '@reltio/mdm-sdk';
|
|
|
3
3
|
import { CartesianGridProps, LineChart, LineProps, TooltipProps, XAxisProps, YAxisProps } from 'recharts';
|
|
4
4
|
type LineChartSettings = {
|
|
5
5
|
lineChart: React.ComponentProps<typeof LineChart>;
|
|
6
|
-
xAxis: XAxisProps
|
|
7
|
-
yAxis: YAxisProps
|
|
6
|
+
xAxis: Omit<XAxisProps, 'ref'>;
|
|
7
|
+
yAxis: Omit<YAxisProps, 'ref'>;
|
|
8
8
|
cartesianGrid: Omit<CartesianGridProps, 'ref'>;
|
|
9
9
|
tooltip: TooltipProps<number, string>;
|
|
10
10
|
line: Omit<LineProps, 'ref'>;
|
|
@@ -86,11 +86,15 @@ describe('PieChart', function () {
|
|
|
86
86
|
expect(wrapper.find(Pie).prop('innerRadius')).toBe('50%');
|
|
87
87
|
});
|
|
88
88
|
it('should call props.onItemClick on sector click', function () {
|
|
89
|
+
jest.useFakeTimers();
|
|
89
90
|
var onItemClick = jest.fn();
|
|
90
91
|
var wrapper = mount(React.createElement(PieChart, { width: 600, height: 300, data: data, onItemClick: onItemClick }));
|
|
92
|
+
jest.runAllTimers();
|
|
93
|
+
wrapper.update();
|
|
91
94
|
var sector = wrapper.find('.recharts-pie-sector').first();
|
|
92
95
|
sector.simulate('click');
|
|
93
96
|
expect(onItemClick).toHaveBeenCalledWith('1');
|
|
97
|
+
jest.useRealTimers();
|
|
94
98
|
});
|
|
95
99
|
it('should render chart legend with percents correctly', function () {
|
|
96
100
|
var legendPayload = [
|
|
@@ -48,8 +48,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { render, screen, act } from '@testing-library/react';
|
|
50
50
|
import userEvent from '@testing-library/user-event';
|
|
51
|
-
import TestBackend from 'react-dnd-test-backend';
|
|
52
|
-
import { DndProvider } from 'react-dnd';
|
|
53
51
|
import { uploadImage } from '@reltio/mdm-sdk';
|
|
54
52
|
import { MAX_IMAGE_SIZE } from './constants';
|
|
55
53
|
import { UploadImageDialog } from './UploadImageDialog';
|
|
@@ -68,8 +66,7 @@ describe('UploadImageDialog tests', function () {
|
|
|
68
66
|
var props = { onClose: onClose, onUpload: onUpload, open: true };
|
|
69
67
|
var Providers = function (_a) {
|
|
70
68
|
var children = _a.children;
|
|
71
|
-
return (React.createElement(MdmModuleProvider, { values: { imageServicePath: imageServicePath, environment: environment, tenant: tenant } },
|
|
72
|
-
React.createElement(DndProvider, { backend: TestBackend }, children)));
|
|
69
|
+
return (React.createElement(MdmModuleProvider, { values: { imageServicePath: imageServicePath, environment: environment, tenant: tenant } }, children));
|
|
73
70
|
};
|
|
74
71
|
return __assign({ user: user }, render(React.createElement(UploadImageDialog, __assign({}, props)), { wrapper: Providers }));
|
|
75
72
|
};
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import i18n from 'ui-i18n';
|
|
4
|
-
import { useDrop } from 'react-dnd';
|
|
5
|
-
import { NativeTypes } from 'react-dnd-html5-backend';
|
|
6
4
|
import Typography from '@mui/material/Typography';
|
|
7
5
|
import { SelectImageButton } from '../SelectImageButton';
|
|
8
6
|
import UploadIcon from '../../../icons/UploadIcon';
|
|
9
7
|
import { MAX_IMAGE_SIZE } from '../../constants';
|
|
10
8
|
import { useStyles } from './styles';
|
|
9
|
+
var ACCEPTABLE_FILE_TYPE = 'Files';
|
|
11
10
|
export var TargetBox = function (_a) {
|
|
12
11
|
var _b;
|
|
13
12
|
var onAppendFile = _a.onAppendFile, className = _a.className;
|
|
14
13
|
var styles = useStyles();
|
|
15
|
-
var _c =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
var _c = useState(false), isActive = _c[0], setIsActive = _c[1];
|
|
15
|
+
var handleDragOver = useCallback(function (e) {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
var filesType = e.dataTransfer.types[0];
|
|
19
|
+
var isValidType = filesType === ACCEPTABLE_FILE_TYPE;
|
|
20
|
+
e.dataTransfer.dropEffect = isValidType ? 'copy' : 'none';
|
|
21
|
+
setIsActive(isValidType);
|
|
22
|
+
}, []);
|
|
23
|
+
var handleDragLeave = useCallback(function (e) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
var relatedTarget = e.relatedTarget;
|
|
27
|
+
var isLeave = relatedTarget && !e.currentTarget.contains(relatedTarget);
|
|
28
|
+
if (isLeave || !relatedTarget) {
|
|
29
|
+
setIsActive(false);
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
var handleDrop = useCallback(function (e) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
setIsActive(false);
|
|
36
|
+
var filesType = e.dataTransfer.types[0];
|
|
37
|
+
if (filesType === ACCEPTABLE_FILE_TYPE) {
|
|
38
|
+
var file = e.dataTransfer.files[0];
|
|
39
|
+
onAppendFile(file);
|
|
40
|
+
}
|
|
41
|
+
}, [onAppendFile]);
|
|
42
|
+
return (React.createElement("div", { className: classnames(styles.root, (_b = {}, _b[styles.isActive] = isActive, _b), className), onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop },
|
|
32
43
|
React.createElement(UploadIcon, { className: styles.icon }),
|
|
33
44
|
React.createElement(Typography, { className: styles.title }, i18n.text('Drag an image here')),
|
|
34
45
|
React.createElement(Typography, { className: styles.description }, i18n.text('Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@testing-library/jest-dom';
|