intergalactic 15.80.0-prerelease.0 → 15.81.0-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/accordion/lib/cjs/Accordion.js +7 -7
- package/accordion/lib/es6/Accordion.js +7 -7
- package/animation/lib/cjs/Animation.js +11 -11
- package/animation/lib/cjs/Collapse.js +28 -28
- package/animation/lib/cjs/FadeInOut.js +28 -28
- package/animation/lib/cjs/Scale.js +28 -28
- package/animation/lib/cjs/Slide.js +28 -28
- package/animation/lib/cjs/Transform.js +28 -28
- package/animation/lib/es6/Animation.js +11 -11
- package/animation/lib/es6/Collapse.js +28 -28
- package/animation/lib/es6/FadeInOut.js +28 -28
- package/animation/lib/es6/Scale.js +28 -28
- package/animation/lib/es6/Slide.js +28 -28
- package/animation/lib/es6/Transform.js +28 -28
- package/badge/lib/cjs/Badge.js +6 -6
- package/badge/lib/es6/Badge.js +6 -6
- package/base-trigger/lib/cjs/BaseTrigger.js +18 -18
- package/base-trigger/lib/cjs/ButtonTrigger.js +3 -3
- package/base-trigger/lib/cjs/FilterTrigger.js +7 -7
- package/base-trigger/lib/cjs/LinkTrigger.js +12 -12
- package/base-trigger/lib/es6/BaseTrigger.js +18 -18
- package/base-trigger/lib/es6/ButtonTrigger.js +3 -3
- package/base-trigger/lib/es6/FilterTrigger.js +7 -7
- package/base-trigger/lib/es6/LinkTrigger.js +12 -12
- package/breadcrumbs/lib/cjs/Breadcrumbs.js +6 -6
- package/breadcrumbs/lib/es6/Breadcrumbs.js +6 -6
- package/button/lib/cjs/Button.js +26 -26
- package/button/lib/es6/Button.js +26 -26
- package/card/lib/cjs/Card.js +8 -8
- package/card/lib/es6/Card.js +8 -8
- package/carousel/lib/cjs/Carousel.js +19 -19
- package/carousel/lib/es6/Carousel.js +19 -19
- package/checkbox/lib/cjs/Checkbox.js +18 -18
- package/checkbox/lib/es6/Checkbox.js +18 -18
- package/color-picker/lib/cjs/ColorPicker.js +23 -23
- package/color-picker/lib/cjs/PaletteManager.js +23 -23
- package/color-picker/lib/cjs/components/InputColor.js +23 -23
- package/color-picker/lib/es6/ColorPicker.js +23 -23
- package/color-picker/lib/es6/PaletteManager.js +23 -23
- package/color-picker/lib/es6/components/InputColor.js +23 -23
- package/components.json +73 -73
- package/counter/lib/cjs/Counter.js +10 -10
- package/counter/lib/es6/Counter.js +10 -10
- package/d3-chart/component/Chart/AbstractChart.type.d.ts +4 -0
- package/d3-chart/lib/cjs/Area.js +11 -11
- package/d3-chart/lib/cjs/Axis.js +14 -14
- package/d3-chart/lib/cjs/Bar.js +10 -10
- package/d3-chart/lib/cjs/Bubble.js +12 -12
- package/d3-chart/lib/cjs/Donut.js +9 -9
- package/d3-chart/lib/cjs/Dots.js +8 -8
- package/d3-chart/lib/cjs/HorizontalBar.js +10 -10
- package/d3-chart/lib/cjs/Hover.js +3 -3
- package/d3-chart/lib/cjs/Line.js +9 -9
- package/d3-chart/lib/cjs/Plot.js +7 -5
- package/d3-chart/lib/cjs/Plot.js.map +1 -1
- package/d3-chart/lib/cjs/Radar.js +19 -19
- package/d3-chart/lib/cjs/RadialTree.js +11 -11
- package/d3-chart/lib/cjs/ReferenceLine.js +9 -9
- package/d3-chart/lib/cjs/ScatterPlot.js +9 -9
- package/d3-chart/lib/cjs/Tooltip.js +9 -9
- package/d3-chart/lib/cjs/Venn.js +9 -9
- package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/cjs/component/Chart/AbstractChart.js +4 -2
- package/d3-chart/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/d3-chart/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/cjs/style/reference-line.shadow.css +1 -1
- package/d3-chart/lib/es6/Area.js +11 -11
- package/d3-chart/lib/es6/Axis.js +14 -14
- package/d3-chart/lib/es6/Bar.js +10 -10
- package/d3-chart/lib/es6/Bubble.js +12 -12
- package/d3-chart/lib/es6/Donut.js +9 -9
- package/d3-chart/lib/es6/Dots.js +8 -8
- package/d3-chart/lib/es6/HorizontalBar.js +10 -10
- package/d3-chart/lib/es6/Hover.js +3 -3
- package/d3-chart/lib/es6/Line.js +9 -9
- package/d3-chart/lib/es6/Plot.js +7 -5
- package/d3-chart/lib/es6/Plot.js.map +1 -1
- package/d3-chart/lib/es6/Radar.js +19 -19
- package/d3-chart/lib/es6/RadialTree.js +11 -11
- package/d3-chart/lib/es6/ReferenceLine.js +9 -9
- package/d3-chart/lib/es6/ScatterPlot.js +9 -9
- package/d3-chart/lib/es6/Tooltip.js +9 -9
- package/d3-chart/lib/es6/Venn.js +9 -9
- package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/es6/component/Chart/AbstractChart.js +4 -2
- package/d3-chart/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/d3-chart/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/es6/style/reference-line.shadow.css +1 -1
- package/d3-chart/lib/types/component/Chart/AbstractChart.type.d.ts +4 -0
- package/data-table/lib/cjs/DataTable.js +35 -35
- package/data-table/lib/cjs/Head.js +1 -1
- package/data-table/lib/cjs/Head.js.map +1 -1
- package/data-table/lib/es6/DataTable.js +35 -35
- package/data-table/lib/es6/Head.js +1 -1
- package/data-table/lib/es6/Head.js.map +1 -1
- package/date-picker/lib/cjs/components/Calendar.js +21 -21
- package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js +29 -29
- package/date-picker/lib/cjs/components/InputTrigger.js +29 -29
- package/date-picker/lib/cjs/components/PickerAbstract.js +29 -29
- package/date-picker/lib/cjs/components/RangePickerAbstract.js +29 -29
- package/date-picker/lib/es6/components/Calendar.js +21 -21
- package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js +29 -29
- package/date-picker/lib/es6/components/InputTrigger.js +29 -29
- package/date-picker/lib/es6/components/PickerAbstract.js +29 -29
- package/date-picker/lib/es6/components/RangePickerAbstract.js +29 -29
- package/divider/lib/cjs/Divider.js +9 -9
- package/divider/lib/es6/Divider.js +9 -9
- package/dot/lib/cjs/Dot.js +10 -10
- package/dot/lib/es6/Dot.js +10 -10
- package/drag-and-drop/lib/cjs/DragAndDrop.js +192 -41
- package/drag-and-drop/lib/cjs/DragAndDrop.js.map +1 -1
- package/drag-and-drop/lib/cjs/style/drag-and-drop.shadow.css +73 -28
- package/drag-and-drop/lib/es6/DragAndDrop.js +192 -41
- package/drag-and-drop/lib/es6/DragAndDrop.js.map +1 -1
- package/drag-and-drop/lib/es6/style/drag-and-drop.shadow.css +73 -28
- package/dropdown/lib/cjs/Dropdown.js +2 -2
- package/dropdown/lib/es6/Dropdown.js +2 -2
- package/dropdown-menu/lib/cjs/DropdownMenu.js +19 -19
- package/dropdown-menu/lib/cjs/DropdownMenu.js.map +1 -1
- package/dropdown-menu/lib/cjs/styleScrollArea.js +6 -6
- package/dropdown-menu/lib/es6/DropdownMenu.js +19 -19
- package/dropdown-menu/lib/es6/DropdownMenu.js.map +1 -1
- package/dropdown-menu/lib/es6/styleScrollArea.js +6 -6
- package/ellipsis/lib/cjs/Ellipsis.js +11 -11
- package/ellipsis/lib/cjs/Ellipsis.js.map +1 -1
- package/ellipsis/lib/es6/Ellipsis.js +11 -11
- package/ellipsis/lib/es6/Ellipsis.js.map +1 -1
- package/errors/lib/cjs/Error.js +9 -9
- package/errors/lib/es6/Error.js +9 -9
- package/feature-popover/lib/cjs/FeaturePopover.js +10 -10
- package/feature-popover/lib/es6/FeaturePopover.js +10 -10
- package/feedback-form/lib/cjs/FeedbackForm.js +7 -7
- package/feedback-form/lib/es6/FeedbackForm.js +7 -7
- package/flags/lib/cjs/Flags.js +3 -3
- package/flags/lib/es6/Flags.js +3 -3
- package/flags/lib/sprites/sprite@1x.css +256 -256
- package/flags/lib/sprites/sprite@2x.css +257 -257
- package/flex-box/lib/cjs/Box/useBox.js +3 -3
- package/flex-box/lib/cjs/Flex/useFlex.js +3 -3
- package/flex-box/lib/cjs/invalid-state-box/InvalidStateBox.js +2 -2
- package/flex-box/lib/es6/Box/useBox.js +3 -3
- package/flex-box/lib/es6/Flex/useFlex.js +3 -3
- package/flex-box/lib/es6/invalid-state-box/InvalidStateBox.js +2 -2
- package/format-text/lib/cjs/FormatText.js +5 -5
- package/format-text/lib/es6/FormatText.js +5 -5
- package/fullscreen-modal/lib/cjs/FullscreenModal.js +13 -13
- package/fullscreen-modal/lib/es6/FullscreenModal.js +13 -13
- package/grid/lib/cjs/Grid.js +114 -114
- package/grid/lib/es6/Grid.js +114 -114
- package/icon/color/Confluence/l/index.js +4 -4
- package/icon/color/Confluence/l/index.mjs +4 -4
- package/icon/color/Confluence/m/index.js +4 -4
- package/icon/color/Confluence/m/index.mjs +4 -4
- package/icon/color/MicrosoftOffice/l/index.js +10 -10
- package/icon/color/MicrosoftOffice/l/index.mjs +10 -10
- package/icon/color/MicrosoftOffice/m/index.js +10 -10
- package/icon/color/MicrosoftOffice/m/index.mjs +10 -10
- package/icon/lib/cjs/Icon.js +5 -5
- package/icon/lib/es6/Icon.js +5 -5
- package/icon/pay/Discover/l/index.js +1 -1
- package/icon/pay/Discover/l/index.mjs +1 -1
- package/icon/pay/Discover/m/index.js +1 -1
- package/icon/pay/Discover/m/index.mjs +1 -1
- package/icon/pay/JCB/l/index.js +10 -10
- package/icon/pay/JCB/l/index.mjs +10 -10
- package/icon/pay/JCB/m/index.js +10 -10
- package/icon/pay/JCB/m/index.mjs +10 -10
- package/icon/pay/Visa/l/index.js +2 -2
- package/icon/pay/Visa/l/index.mjs +2 -2
- package/icon/pay/Visa/m/index.js +2 -2
- package/icon/pay/Visa/m/index.mjs +2 -2
- package/illustration/lib/cjs/index.js +1 -1
- package/illustration/lib/es6/index.js +1 -1
- package/inline-edit/lib/cjs/InlineEdit.js +4 -4
- package/inline-edit/lib/es6/InlineEdit.js +4 -4
- package/inline-input/lib/cjs/InlineInput.js +18 -18
- package/inline-input/lib/es6/InlineInput.js +18 -18
- package/input/lib/cjs/Input.js +17 -17
- package/input/lib/es6/Input.js +17 -17
- package/input-mask/lib/cjs/InputMask.js +6 -6
- package/input-mask/lib/es6/InputMask.js +6 -6
- package/input-number/lib/cjs/InputNumber.js +9 -9
- package/input-number/lib/es6/InputNumber.js +9 -9
- package/input-tags/lib/cjs/InputTags.js +12 -12
- package/input-tags/lib/es6/InputTags.js +12 -12
- package/link/lib/cjs/Link.js +16 -14
- package/link/lib/cjs/Link.js.map +1 -1
- package/link/lib/cjs/style/link.shadow.css +1 -1
- package/link/lib/es6/Link.js +16 -14
- package/link/lib/es6/Link.js.map +1 -1
- package/link/lib/es6/style/link.shadow.css +1 -1
- package/mini-chart/lib/cjs/component/score/Donut.js +9 -9
- package/mini-chart/lib/cjs/component/score/Line.js +17 -17
- package/mini-chart/lib/cjs/component/trend/Bar.js +7 -7
- package/mini-chart/lib/cjs/component/trend/Line.js +7 -7
- package/mini-chart/lib/es6/component/score/Donut.js +9 -9
- package/mini-chart/lib/es6/component/score/Line.js +17 -17
- package/mini-chart/lib/es6/component/trend/Bar.js +7 -7
- package/mini-chart/lib/es6/component/trend/Line.js +7 -7
- package/modal/lib/cjs/Modal.js +9 -9
- package/modal/lib/es6/Modal.js +9 -9
- package/notice/lib/cjs/Notice.js +13 -13
- package/notice/lib/es6/Notice.js +13 -13
- package/notice-bubble/lib/cjs/NoticeBubble.js +12 -12
- package/notice-bubble/lib/es6/NoticeBubble.js +12 -12
- package/notice-global/lib/cjs/NoticeGlobal.js +11 -11
- package/notice-global/lib/es6/NoticeGlobal.js +11 -11
- package/package.json +1 -1
- package/pagination/lib/cjs/Pagination.js +10 -10
- package/pagination/lib/es6/Pagination.js +10 -10
- package/pills/lib/cjs/Pills.js +13 -13
- package/pills/lib/es6/Pills.js +13 -13
- package/popper/index.d.ts +4 -0
- package/popper/lib/cjs/Popper.js +28 -8
- package/popper/lib/cjs/Popper.js.map +1 -1
- package/popper/lib/cjs/createPopper.js +2 -1
- package/popper/lib/cjs/createPopper.js.map +1 -1
- package/popper/lib/cjs/index.d.js.map +1 -1
- package/popper/lib/cjs/modifiers/cursorAnchoring.js +60 -0
- package/popper/lib/cjs/modifiers/cursorAnchoring.js.map +1 -0
- package/popper/lib/es6/Popper.js +28 -8
- package/popper/lib/es6/Popper.js.map +1 -1
- package/popper/lib/es6/createPopper.js +2 -1
- package/popper/lib/es6/createPopper.js.map +1 -1
- package/popper/lib/es6/index.d.js.map +1 -1
- package/popper/lib/es6/modifiers/cursorAnchoring.js +52 -0
- package/popper/lib/es6/modifiers/cursorAnchoring.js.map +1 -0
- package/popper/lib/types/index.d.ts +4 -0
- package/product-head/lib/cjs/Info.js +4 -4
- package/product-head/lib/cjs/ProductHead.js +5 -5
- package/product-head/lib/cjs/Title.js +4 -4
- package/product-head/lib/es6/Info.js +4 -4
- package/product-head/lib/es6/ProductHead.js +5 -5
- package/product-head/lib/es6/Title.js +4 -4
- package/progress-bar/lib/cjs/ProgressBar.js +15 -15
- package/progress-bar/lib/es6/ProgressBar.js +15 -15
- package/radio/lib/cjs/Radio.js +16 -16
- package/radio/lib/es6/Radio.js +16 -16
- package/scroll-area/lib/cjs/ScrollArea.js +21 -21
- package/scroll-area/lib/cjs/ScrollBar.js +6 -6
- package/scroll-area/lib/es6/ScrollArea.js +21 -21
- package/scroll-area/lib/es6/ScrollBar.js +6 -6
- package/select/lib/cjs/InputSearch.js +6 -6
- package/select/lib/cjs/Select.js +8 -8
- package/select/lib/es6/InputSearch.js +6 -6
- package/select/lib/es6/Select.js +8 -8
- package/side-panel/lib/cjs/SidePanel.js +15 -15
- package/side-panel/lib/es6/SidePanel.js +15 -15
- package/skeleton/lib/cjs/Charts/Area.js +9 -9
- package/skeleton/lib/cjs/Charts/Bar.js +9 -9
- package/skeleton/lib/cjs/Charts/Bubble.js +9 -9
- package/skeleton/lib/cjs/Charts/Donut.js +9 -9
- package/skeleton/lib/cjs/Charts/Histogram.js +9 -9
- package/skeleton/lib/cjs/Charts/Line.js +9 -9
- package/skeleton/lib/cjs/Charts/RadialTree.js +9 -9
- package/skeleton/lib/cjs/Charts/ScatterPlot.js +9 -9
- package/skeleton/lib/cjs/Charts/Venn.js +9 -9
- package/skeleton/lib/cjs/Skeleton.js +8 -8
- package/skeleton/lib/es6/Charts/Area.js +9 -9
- package/skeleton/lib/es6/Charts/Bar.js +9 -9
- package/skeleton/lib/es6/Charts/Bubble.js +9 -9
- package/skeleton/lib/es6/Charts/Donut.js +9 -9
- package/skeleton/lib/es6/Charts/Histogram.js +9 -9
- package/skeleton/lib/es6/Charts/Line.js +9 -9
- package/skeleton/lib/es6/Charts/RadialTree.js +9 -9
- package/skeleton/lib/es6/Charts/ScatterPlot.js +9 -9
- package/skeleton/lib/es6/Charts/Venn.js +9 -9
- package/skeleton/lib/es6/Skeleton.js +8 -8
- package/slider/lib/cjs/Slider.js +8 -7
- package/slider/lib/cjs/Slider.js.map +1 -1
- package/slider/lib/cjs/style/slider.shadow.css +9 -0
- package/slider/lib/es6/Slider.js +8 -7
- package/slider/lib/es6/Slider.js.map +1 -1
- package/slider/lib/es6/style/slider.shadow.css +9 -0
- package/spin/lib/cjs/Spin.js +13 -13
- package/spin/lib/es6/Spin.js +13 -13
- package/spin-container/lib/cjs/SpinContainer.js +8 -8
- package/spin-container/lib/es6/SpinContainer.js +8 -8
- package/sticky/lib/cjs/Sticky.js +2 -2
- package/sticky/lib/es6/Sticky.js +2 -2
- package/switch/lib/cjs/Switch.js +21 -21
- package/switch/lib/es6/Switch.js +21 -21
- package/tab-line/lib/cjs/TabLine.js +13 -13
- package/tab-line/lib/es6/TabLine.js +13 -13
- package/tab-panel/lib/cjs/TabPanel.js +8 -8
- package/tab-panel/lib/es6/TabPanel.js +8 -8
- package/tag/lib/cjs/Tag.js +20 -20
- package/tag/lib/es6/Tag.js +20 -20
- package/textarea/lib/cjs/Textarea.js +10 -8
- package/textarea/lib/cjs/Textarea.js.map +1 -1
- package/textarea/lib/es6/Textarea.js +10 -8
- package/textarea/lib/es6/Textarea.js.map +1 -1
- package/time-picker/lib/cjs/TimePicker.js +12 -12
- package/time-picker/lib/es6/TimePicker.js +12 -12
- package/tooltip/index.d.ts +13 -2
- package/tooltip/lib/cjs/Tooltip.js +9 -9
- package/tooltip/lib/cjs/index.d.js.map +1 -1
- package/tooltip/lib/es6/Tooltip.js +9 -9
- package/tooltip/lib/es6/index.d.js.map +1 -1
- package/tooltip/lib/types/index.d.ts +13 -2
- package/typography/index.d.ts +4 -1
- package/typography/lib/cjs/Blockquote.js +4 -4
- package/typography/lib/cjs/Hint.js +7 -7
- package/typography/lib/cjs/List.js +5 -5
- package/typography/lib/cjs/Text.js +34 -34
- package/typography/lib/cjs/index.d.js.map +1 -1
- package/typography/lib/es6/Blockquote.js +4 -4
- package/typography/lib/es6/Hint.js +7 -7
- package/typography/lib/es6/List.js +5 -5
- package/typography/lib/es6/Text.js +34 -34
- package/typography/lib/es6/index.d.js.map +1 -1
- package/typography/lib/types/index.d.ts +4 -1
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +2 -2
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +2 -2
- package/utils/lib/injectStyle.js +1 -1
- package/utils/lib/injectStyle.mjs +1 -1
- package/utils/lib/themes/auto.css +3 -1
- package/utils/lib/themes/default.css +3 -1
- package/utils/lib/themes/default.json +1 -0
- package/utils/lib/themes/light.css +3 -1
- package/utils/lib/themes/light.json +1 -0
- package/widget-empty/lib/cjs/WidgetEmpty.js +8 -6
- package/widget-empty/lib/cjs/WidgetEmpty.js.map +1 -1
- package/widget-empty/lib/es6/WidgetEmpty.js +8 -6
- package/widget-empty/lib/es6/WidgetEmpty.js.map +1 -1
- package/wizard/lib/cjs/Wizard.js +11 -11
- package/wizard/lib/es6/Wizard.js +11 -11
@@ -6,96 +6,135 @@ SDraggable[draggable] {
|
|
6
6
|
-webkit-user-select: none;
|
7
7
|
user-select: none;
|
8
8
|
|
9
|
-
|
9
|
+
|
10
|
+
&::before {
|
10
11
|
content: '';
|
11
12
|
position: absolute;
|
12
13
|
display: none;
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
);
|
14
|
+
pointer-events: none;
|
15
|
+
background-image: radial-gradient(circle at center,
|
16
|
+
var(--intergalactic-icon-primary-neutral, #6c6e79) 1px,
|
17
|
+
transparent 0);
|
18
18
|
background-size: 6px 6px;
|
19
19
|
background-position: 2px 2px;
|
20
20
|
background-repeat: repeat repeat;
|
21
21
|
}
|
22
22
|
|
23
|
-
&:hover::
|
23
|
+
&:hover::before {
|
24
24
|
display: block;
|
25
25
|
}
|
26
|
-
|
26
|
+
|
27
|
+
&[hideHoverEffect]::before {
|
27
28
|
display: none;
|
28
29
|
}
|
29
30
|
}
|
30
31
|
|
31
|
-
SDraggable[placement='top']::
|
32
|
+
SDraggable[placement='top']::before {
|
32
33
|
top: 0;
|
33
34
|
left: 0;
|
34
35
|
width: 100%;
|
35
36
|
height: 20px;
|
36
37
|
}
|
37
38
|
|
38
|
-
SDraggable[placement='top'] {
|
39
|
-
padding-top: var(--intergalactic-spacing-4x, 16px);
|
40
|
-
}
|
41
|
-
|
42
39
|
SDraggable[placement='right'] {
|
43
|
-
|
44
|
-
&::
|
40
|
+
|
41
|
+
&::before {
|
45
42
|
right: 0;
|
46
43
|
}
|
47
44
|
}
|
48
45
|
|
49
46
|
SDraggable[placement='bottom'] {
|
50
|
-
padding-bottom: var(--intergalactic-spacing-4x, 16px);
|
51
47
|
|
52
|
-
&::
|
48
|
+
&::before {
|
53
49
|
bottom: 0;
|
54
50
|
}
|
55
51
|
}
|
56
52
|
|
57
53
|
SDraggable[placement='left'] {
|
58
|
-
padding-left: var(--intergalactic-spacing-4x, 16px);
|
59
54
|
|
60
|
-
&::
|
55
|
+
&::before {
|
61
56
|
left: 0;
|
62
57
|
}
|
63
58
|
}
|
64
59
|
|
65
|
-
SDraggable[placement='top']::
|
66
|
-
SDraggable[placement='right']::
|
67
|
-
SDraggable[placement='left']::
|
60
|
+
SDraggable[placement='top']::before,
|
61
|
+
SDraggable[placement='right']::before,
|
62
|
+
SDraggable[placement='left']::before {
|
68
63
|
top: 0;
|
69
64
|
}
|
70
65
|
|
71
|
-
SDraggable[placement='top']::
|
72
|
-
SDraggable[placement='bottom']::
|
66
|
+
SDraggable[placement='top']::before,
|
67
|
+
SDraggable[placement='bottom']::before {
|
73
68
|
left: 0;
|
74
69
|
width: 100%;
|
75
70
|
height: 16px;
|
76
71
|
}
|
77
72
|
|
78
|
-
SDraggable[placement='right']::
|
79
|
-
SDraggable[placement='left']::
|
73
|
+
SDraggable[placement='right']::before,
|
74
|
+
SDraggable[placement='left']::before {
|
80
75
|
top: 0;
|
81
76
|
width: 16px;
|
82
77
|
height: 100%;
|
83
78
|
}
|
84
79
|
|
85
80
|
SDropZone {
|
86
|
-
|
87
|
-
border-radius: var(--intergalactic-surface-rounded, 6px);
|
81
|
+
position: relative;
|
88
82
|
}
|
89
83
|
|
90
84
|
SDropZone[dropPreview],
|
91
85
|
SDraggable[dropPreview] {
|
92
86
|
background-color: var(--intergalactic-bg-secondary-neutral, #f4f5f9);
|
93
87
|
}
|
88
|
+
|
89
|
+
|
94
90
|
SDropZone[dark][dropPreview],
|
95
91
|
SDraggable[dark][dropPreview] {
|
96
92
|
background-color: var(--intergalactic-bg-primary-invert-active, #484a54);
|
97
93
|
}
|
98
94
|
|
95
|
+
SDraggable:focus {
|
96
|
+
outline: none;
|
97
|
+
}
|
98
|
+
|
99
|
+
SDraggable[keyboardFocused]:focus {
|
100
|
+
box-shadow: none;
|
101
|
+
}
|
102
|
+
|
103
|
+
SDraggable[keyboardFocused]:focus:after {
|
104
|
+
position: absolute;
|
105
|
+
display: block;
|
106
|
+
content: '';
|
107
|
+
inset: 3px;
|
108
|
+
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
|
109
|
+
pointer-events: none;
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
SDraggable[keyboardDragging] {
|
114
|
+
scale: 1.1;
|
115
|
+
|
116
|
+
background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
|
117
|
+
box-shadow: var(--intergalactic-box-shadow-dnd, 0px 0px 1px 0px rgba(25, 27, 35, 0.16), 0px 12px 40px 0px rgba(25, 27, 35, 0.16)) !important;
|
118
|
+
|
119
|
+
|
120
|
+
&::before {
|
121
|
+
display: block;
|
122
|
+
}
|
123
|
+
|
124
|
+
&[hideHoverEffect]::before {
|
125
|
+
display: block;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
SDraggable[keyboardDragging][reversedScaling] {
|
130
|
+
scale: 0.95;
|
131
|
+
}
|
132
|
+
|
133
|
+
SDraggable[animatedScaling] {
|
134
|
+
transition: all calc(var(--intergalactic-duration-extra-fast, 100) * 1ms) ease-in-out;
|
135
|
+
}
|
136
|
+
|
137
|
+
|
99
138
|
SA11yHint {
|
100
139
|
position: absolute;
|
101
140
|
/* disable-tokens-validator */
|
@@ -104,3 +143,9 @@ SA11yHint {
|
|
104
143
|
width: 1px;
|
105
144
|
clip: rect(0 0 0 0);
|
106
145
|
}
|
146
|
+
|
147
|
+
@media (prefers-reduced-motion: reduce) {
|
148
|
+
SDraggable {
|
149
|
+
transition: none;
|
150
|
+
}
|
151
|
+
}
|
@@ -17,19 +17,24 @@ import { localizedMessages } from './translations/__intergalactic-dynamic-locale
|
|
17
17
|
import i18nEnhance from 'intergalactic/utils/lib/enhances/i18nEnhance';
|
18
18
|
import useEnhancedEffect from 'intergalactic/utils/lib/use/useEnhancedEffect';
|
19
19
|
/*__reshadow-styles__:"./style/drag-and-drop.shadow.css"*/
|
20
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
21
|
-
"__SDraggable": "
|
22
|
-
"_placement_top": "
|
23
|
-
"_placement_right": "
|
24
|
-
"_placement_left": "
|
25
|
-
"_placement_bottom": "
|
26
|
-
"__SDropZone": "
|
27
|
-
"_dropPreview": "
|
28
|
-
"_dark": "
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"
|
20
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SDraggable_1ff86_gg_.__draggable_1ff86_gg_{position:relative;cursor:grab;-moz-user-select:none;-webkit-user-select:none;user-select:none}.___SDraggable_1ff86_gg_.__draggable_1ff86_gg_::before{content:\"\";position:absolute;display:none;pointer-events:none;background-image:radial-gradient(circle at center,var(--intergalactic-icon-primary-neutral, #6c6e79) 1px,transparent 0);background-size:6px 6px;background-position:2px 2px;background-repeat:repeat repeat}@media (hover:hover){.___SDraggable_1ff86_gg_.__draggable_1ff86_gg_:hover::before{display:block}}.___SDraggable_1ff86_gg_.__draggable_1ff86_gg_.__hideHoverEffect_1ff86_gg_::before{display:none}.___SDraggable_1ff86_gg_._placement_right_1ff86_gg_::before{right:0}.___SDraggable_1ff86_gg_._placement_bottom_1ff86_gg_::before{bottom:0}.___SDraggable_1ff86_gg_._placement_left_1ff86_gg_::before{left:0}.___SDraggable_1ff86_gg_._placement_top_1ff86_gg_::before{top:0;left:0;width:100%;height:16px}.___SDraggable_1ff86_gg_._placement_bottom_1ff86_gg_::before{left:0;width:100%;height:16px}.___SDraggable_1ff86_gg_._placement_left_1ff86_gg_::before,.___SDraggable_1ff86_gg_._placement_right_1ff86_gg_::before{top:0;width:16px;height:100%}.___SDropZone_1ff86_gg_{position:relative}.___SDraggable_1ff86_gg_.__dropPreview_1ff86_gg_,.___SDropZone_1ff86_gg_.__dropPreview_1ff86_gg_{background-color:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SDraggable_1ff86_gg_.__dark_1ff86_gg_.__dropPreview_1ff86_gg_,.___SDropZone_1ff86_gg_.__dark_1ff86_gg_.__dropPreview_1ff86_gg_{background-color:var(--intergalactic-bg-primary-invert-active, #484a54)}.___SDraggable_1ff86_gg_:focus{outline:0}.___SDraggable_1ff86_gg_.__keyboardFocused_1ff86_gg_:focus{box-shadow:none}.___SDraggable_1ff86_gg_.__keyboardFocused_1ff86_gg_:focus:after{position:absolute;display:block;content:\"\";top:3px;right:3px;bottom:3px;left:3px;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none}.___SDraggable_1ff86_gg_.__keyboardDragging_1ff86_gg_{scale:1.1;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);box-shadow:var(--intergalactic-box-shadow-dnd, 0px 0px 1px 0px rgba(25, 27, 35, 0.16), 0px 12px 40px 0px rgba(25, 27, 35, 0.16))!important}.___SDraggable_1ff86_gg_.__keyboardDragging_1ff86_gg_.__hideHoverEffect_1ff86_gg_::before,.___SDraggable_1ff86_gg_.__keyboardDragging_1ff86_gg_::before{display:block}.___SDraggable_1ff86_gg_.__keyboardDragging_1ff86_gg_.__reversedScaling_1ff86_gg_{scale:.95}.___SDraggable_1ff86_gg_.__animatedScaling_1ff86_gg_{transition:all calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out}.___SA11yHint_1ff86_gg_{position:absolute;margin-top:-1px;height:1px;width:1px;clip:rect(0 0 0 0)}@media (prefers-reduced-motion:reduce){.___SDraggable_1ff86_gg_{transition:none}}" /*__inner_css_end__*/, "1ff86_gg_") /*__reshadow_css_end__*/, {
|
21
|
+
"__SDraggable": "___SDraggable_1ff86_gg_",
|
22
|
+
"_placement_top": "_placement_top_1ff86_gg_",
|
23
|
+
"_placement_right": "_placement_right_1ff86_gg_",
|
24
|
+
"_placement_left": "_placement_left_1ff86_gg_",
|
25
|
+
"_placement_bottom": "_placement_bottom_1ff86_gg_",
|
26
|
+
"__SDropZone": "___SDropZone_1ff86_gg_",
|
27
|
+
"_dropPreview": "__dropPreview_1ff86_gg_",
|
28
|
+
"_dark": "__dark_1ff86_gg_",
|
29
|
+
"_keyboardFocused": "__keyboardFocused_1ff86_gg_",
|
30
|
+
"_keyboardDragging": "__keyboardDragging_1ff86_gg_",
|
31
|
+
"_reversedScaling": "__reversedScaling_1ff86_gg_",
|
32
|
+
"_animatedScaling": "__animatedScaling_1ff86_gg_",
|
33
|
+
"__SA11yHint": "___SA11yHint_1ff86_gg_",
|
34
|
+
"_draggable": "__draggable_1ff86_gg_",
|
35
|
+
"_hideHoverEffect": "__hideHoverEffect_1ff86_gg_"
|
32
36
|
});
|
37
|
+
import keyboardFocusEnhance from 'intergalactic/utils/lib/enhances/keyboardFocusEnhance';
|
33
38
|
var noop = function noop() {
|
34
39
|
/* do nothing */
|
35
40
|
};
|
@@ -50,10 +55,13 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
50
55
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
51
56
|
items: [],
|
52
57
|
dragging: null,
|
53
|
-
|
58
|
+
dragOver: null,
|
54
59
|
hideHoverEffect: false,
|
55
60
|
// https://stackoverflow.com/questions/67118739/hover-effect-reset-when-hovering-over-other-letters
|
56
|
-
a11yHint: null
|
61
|
+
a11yHint: null,
|
62
|
+
keyboardDraggingIndex: null,
|
63
|
+
animatedScaling: null,
|
64
|
+
reversedScaling: false
|
57
65
|
});
|
58
66
|
_defineProperty(_assertThisInitialized(_this), "handleItemDragStart", function (index) {
|
59
67
|
var items = _this.state.items;
|
@@ -67,7 +75,7 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
67
75
|
});
|
68
76
|
var itemsCount = zonedItems.length;
|
69
77
|
var itemPosition = zonedItems.findIndex(function (i) {
|
70
|
-
return (i === null || i === void 0 ? void 0 : i.id) === currentItem.id;
|
78
|
+
return (i === null || i === void 0 ? void 0 : i.node) === currentItem.node || (i === null || i === void 0 ? void 0 : i.id) && (i === null || i === void 0 ? void 0 : i.id) === currentItem.id;
|
71
79
|
});
|
72
80
|
var a11yHint = getI18nText(zoneName ? 'grabbedWithZone' : 'grabbed', {
|
73
81
|
itemText: itemText,
|
@@ -91,8 +99,9 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
91
99
|
event.preventDefault();
|
92
100
|
_this.setState({
|
93
101
|
dragging: null,
|
94
|
-
|
95
|
-
|
102
|
+
dragOver: null,
|
103
|
+
reversedScaling: false,
|
104
|
+
keyboardDraggingIndex: null
|
96
105
|
});
|
97
106
|
});
|
98
107
|
_defineProperty(_assertThisInitialized(_this), "handleItemDragOver", function (event) {
|
@@ -117,7 +126,7 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
117
126
|
});
|
118
127
|
var itemsCount = zonedItems.length;
|
119
128
|
var itemPosition = zonedItems.findIndex(function (i) {
|
120
|
-
return (i === null || i === void 0 ? void 0 : i.id) === currentItem.id;
|
129
|
+
return (i === null || i === void 0 ? void 0 : i.node) === currentItem.node || (i === null || i === void 0 ? void 0 : i.id) && (i === null || i === void 0 ? void 0 : i.id) === currentItem.id;
|
121
130
|
});
|
122
131
|
var i18nKey = !zoneName ? 'grabbing' : currentItem.isDropZone ? 'grabbingJustWithZone' : 'grabbingFullWithZone';
|
123
132
|
var a11yHint = getI18nText(i18nKey, {
|
@@ -127,20 +136,19 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
127
136
|
zoneName: zoneName || ''
|
128
137
|
});
|
129
138
|
if (itemIndex === ((_this$state$dragging = _this.state.dragging) === null || _this$state$dragging === void 0 ? void 0 : _this$state$dragging.index)) _this.setState({
|
130
|
-
|
139
|
+
dragOver: null,
|
131
140
|
a11yHint: a11yHint
|
132
141
|
});else _this.setState({
|
133
|
-
|
142
|
+
dragOver: itemIndex,
|
134
143
|
a11yHint: a11yHint
|
135
144
|
});
|
136
145
|
});
|
137
146
|
_defineProperty(_assertThisInitialized(_this), "getSwapPreview", function (index) {
|
138
|
-
var _this$state$items$
|
147
|
+
var _this$state$items$pre;
|
139
148
|
if (!_this.state.dragging) return null;
|
140
|
-
|
141
|
-
if (
|
142
|
-
|
143
|
-
if (_this.state.previewSwap !== null && index === _this.state.dragging.index) return (_this$state$items$_th3 = _this.state.items[_this.state.previewSwap]) === null || _this$state$items$_th3 === void 0 ? void 0 : _this$state$items$_th3.children;
|
149
|
+
var previewIndex = _this.preview[index];
|
150
|
+
if (typeof previewIndex !== 'number') return null;
|
151
|
+
return (_this$state$items$pre = _this.state.items[previewIndex]) === null || _this$state$items$pre === void 0 ? void 0 : _this$state$items$pre.children;
|
144
152
|
});
|
145
153
|
_defineProperty(_assertThisInitialized(_this), "handleItemDrop", function (index) {
|
146
154
|
var _this$asProps = _this.asProps,
|
@@ -162,7 +170,7 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
162
170
|
});
|
163
171
|
var itemsCount = zonedItems.length;
|
164
172
|
var itemPosition = zonedItems.findIndex(function (i) {
|
165
|
-
return (i === null || i === void 0 ? void 0 : i.id) === currentItem.id;
|
173
|
+
return (i === null || i === void 0 ? void 0 : i.node) === currentItem.node || (i === null || i === void 0 ? void 0 : i.id) && (i === null || i === void 0 ? void 0 : i.id) === currentItem.id;
|
166
174
|
});
|
167
175
|
var i18nKey = !zoneName ? 'dropped' : currentItem.isDropZone ? 'droppedJustWithZone' : 'droppedFullWithZone';
|
168
176
|
var a11yHint = getI18nText(i18nKey, {
|
@@ -174,8 +182,10 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
174
182
|
_this.setState({
|
175
183
|
a11yHint: a11yHint,
|
176
184
|
dragging: null,
|
177
|
-
|
178
|
-
|
185
|
+
dragOver: null,
|
186
|
+
keyboardDraggingIndex: null,
|
187
|
+
hideHoverEffect: true,
|
188
|
+
reversedScaling: false
|
179
189
|
});
|
180
190
|
if (dragging && items[dragging.index]) {
|
181
191
|
var fromNode = items[dragging.index];
|
@@ -205,24 +215,64 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
205
215
|
hideHoverEffect: false
|
206
216
|
});
|
207
217
|
});
|
218
|
+
_defineProperty(_assertThisInitialized(_this), "updateItemScaling", function () {
|
219
|
+
var _this$state$items$;
|
220
|
+
var firstItemNode = (_this$state$items$ = _this.state.items[0]) === null || _this$state$items$ === void 0 ? void 0 : _this$state$items$.node;
|
221
|
+
if (!firstItemNode) return;
|
222
|
+
if (_this.state.reversedScaling) return;
|
223
|
+
var firstItemRect = firstItemNode.getBoundingClientRect();
|
224
|
+
var reversedScaling = false;
|
225
|
+
var parent = firstItemNode.parentElement;
|
226
|
+
while (parent && parent !== document.body) {
|
227
|
+
var computedStyle = getComputedStyle(parent);
|
228
|
+
var rect = parent.getBoundingClientRect();
|
229
|
+
if (computedStyle.overflow !== 'visible') {
|
230
|
+
if (rect.left >= firstItemRect.left || rect.right <= firstItemRect.right || rect.top >= firstItemRect.top || rect.bottom <= firstItemRect.bottom) {
|
231
|
+
reversedScaling = true;
|
232
|
+
break;
|
233
|
+
}
|
234
|
+
} else {
|
235
|
+
if (rect.left < firstItemRect.left && rect.right > firstItemRect.right && rect.top < firstItemRect.top && rect.bottom > firstItemRect.bottom) {
|
236
|
+
break;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
parent = parent.parentElement;
|
240
|
+
}
|
241
|
+
if (_this.state.reversedScaling !== reversedScaling) {
|
242
|
+
_this.setState({
|
243
|
+
reversedScaling: reversedScaling
|
244
|
+
});
|
245
|
+
}
|
246
|
+
});
|
208
247
|
_defineProperty(_assertThisInitialized(_this), "handleItemKeyDown", function (event, index) {
|
209
248
|
if (event.key === ' ') {
|
249
|
+
var _this$state$items$ind;
|
210
250
|
event.preventDefault();
|
211
251
|
event.stopPropagation();
|
212
252
|
if (_this.state.dragging) {
|
213
|
-
var
|
253
|
+
var dragOver = _this.state.dragOver;
|
254
|
+
var prevIndex = _this.state.dragging.index;
|
214
255
|
_this.handleItemDrop(index);
|
215
256
|
_this.setState({
|
216
257
|
dragging: null,
|
217
|
-
|
258
|
+
dragOver: null,
|
259
|
+
keyboardDraggingIndex: null,
|
260
|
+
animatedScaling: index,
|
218
261
|
hideHoverEffect: true
|
219
262
|
});
|
220
|
-
|
221
|
-
var _this$state$items;
|
222
|
-
(_this$state$items = _this.state.items[
|
223
|
-
|
224
|
-
|
263
|
+
requestAnimationFrame(function () {
|
264
|
+
var _this$state$items$pre2, _this$state$items;
|
265
|
+
var prevIndexNode = (_this$state$items$pre2 = _this.state.items[prevIndex]) === null || _this$state$items$pre2 === void 0 ? void 0 : _this$state$items$pre2.node;
|
266
|
+
if (prevIndexNode !== document.activeElement) return;
|
267
|
+
(_this$state$items = _this.state.items[dragOver]) === null || _this$state$items === void 0 ? void 0 : _this$state$items.node.focus();
|
268
|
+
});
|
269
|
+
} else if ((_this$state$items$ind = _this.state.items[index]) !== null && _this$state$items$ind !== void 0 && _this$state$items$ind.draggingAllowed) {
|
225
270
|
_this.handleItemDragStart(index);
|
271
|
+
_this.setState({
|
272
|
+
keyboardDraggingIndex: index,
|
273
|
+
animatedScaling: index
|
274
|
+
});
|
275
|
+
_this.updateItemScaling();
|
226
276
|
}
|
227
277
|
return false;
|
228
278
|
} else if (event.key === 'Escape' && _this.state.dragging) {
|
@@ -233,17 +283,49 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
233
283
|
_this.setState({
|
234
284
|
a11yHint: a11yHint,
|
235
285
|
dragging: null,
|
236
|
-
|
286
|
+
dragOver: null,
|
287
|
+
keyboardDraggingIndex: null,
|
237
288
|
hideHoverEffect: true
|
238
289
|
});
|
239
290
|
return false;
|
291
|
+
} else if (event.key.startsWith('Arrow')) {
|
292
|
+
if (_this.state.animatedScaling !== null) {
|
293
|
+
_this.setState({
|
294
|
+
animatedScaling: null
|
295
|
+
});
|
296
|
+
}
|
297
|
+
var item = _this.state.items[index];
|
298
|
+
if ((item === null || item === void 0 ? void 0 : item.node) !== document.activeElement) return;
|
299
|
+
event.preventDefault();
|
300
|
+
requestAnimationFrame(function () {
|
301
|
+
var _this$state$items$nex;
|
302
|
+
if ((item === null || item === void 0 ? void 0 : item.node) !== document.activeElement) return;
|
303
|
+
var rects = _this.state.items.map(function (item) {
|
304
|
+
return item === null || item === void 0 ? void 0 : item.node.getBoundingClientRect();
|
305
|
+
}).map(function (rect) {
|
306
|
+
return {
|
307
|
+
top: Math.round(rect.top),
|
308
|
+
right: Math.round(rect.right),
|
309
|
+
bottom: Math.round(rect.bottom),
|
310
|
+
left: Math.round(rect.left)
|
311
|
+
};
|
312
|
+
});
|
313
|
+
var nextIndex = findNextRectangleIndex(rects, rects[index], event.key);
|
314
|
+
if (nextIndex === -1) {
|
315
|
+
var indexDiff = event.key === 'ArrowUp' || event.key === 'ArrowLeft' ? -1 : 1;
|
316
|
+
nextIndex = index + indexDiff;
|
317
|
+
}
|
318
|
+
(_this$state$items$nex = _this.state.items[nextIndex]) === null || _this$state$items$nex === void 0 ? void 0 : _this$state$items$nex.node.focus();
|
319
|
+
});
|
240
320
|
}
|
241
321
|
});
|
242
322
|
_defineProperty(_assertThisInitialized(_this), "handleItemFocus", function (index) {
|
243
323
|
if (!_this.state.dragging) return;
|
244
324
|
_this.setState({
|
245
|
-
|
325
|
+
dragOver: index,
|
326
|
+
keyboardDraggingIndex: index
|
246
327
|
});
|
328
|
+
_this.updateItemScaling();
|
247
329
|
});
|
248
330
|
_defineProperty(_assertThisInitialized(_this), "makeItemDragStartHandler", function (index) {
|
249
331
|
return function () {
|
@@ -313,7 +395,7 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
313
395
|
var itemIndex = customFocus;
|
314
396
|
if (typeof itemIndex === 'string') {
|
315
397
|
itemIndex = _this.state.items.findIndex(function (item) {
|
316
|
-
return (item === null || item === void 0 ? void 0 : item.id) ===
|
398
|
+
return (item === null || item === void 0 ? void 0 : item.id) === customFocus;
|
317
399
|
});
|
318
400
|
}
|
319
401
|
if (itemIndex === -1 || typeof itemIndex !== 'number') return undefined;
|
@@ -322,6 +404,21 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
322
404
|
return _this;
|
323
405
|
}
|
324
406
|
_createClass(DragAndDropRoot, [{
|
407
|
+
key: "preview",
|
408
|
+
get: function get() {
|
409
|
+
var _this$state$dragging2;
|
410
|
+
var dragging = (_this$state$dragging2 = this.state.dragging) === null || _this$state$dragging2 === void 0 ? void 0 : _this$state$dragging2.index;
|
411
|
+
var dragOver = this.state.dragOver;
|
412
|
+
if (typeof dragging !== 'number' || typeof dragOver !== 'number') return {};
|
413
|
+
var result = {};
|
414
|
+
var shift = dragging < dragOver ? 1 : -1;
|
415
|
+
for (var i = dragging; i !== dragOver; i += shift) {
|
416
|
+
result[i] = i + shift;
|
417
|
+
}
|
418
|
+
result[dragOver] = dragging;
|
419
|
+
return result;
|
420
|
+
}
|
421
|
+
}, {
|
325
422
|
key: "getDraggableProps",
|
326
423
|
value: function getDraggableProps(_, index) {
|
327
424
|
return {
|
@@ -334,10 +431,13 @@ var DragAndDropRoot = /*#__PURE__*/function (_Component) {
|
|
334
431
|
onMouseMove: this.handleItemMouseMove,
|
335
432
|
onKeyDown: this.makeItemKeyDownHandler(index),
|
336
433
|
onFocus: this.makeItemFocusHandler(index),
|
337
|
-
dropPreview: index === this.state.
|
434
|
+
dropPreview: index === this.state.dragOver,
|
435
|
+
keyboardDragging: index === this.state.keyboardDraggingIndex,
|
436
|
+
reversedScaling: this.state.reversedScaling,
|
338
437
|
dark: this.asProps.theme === 'dark',
|
339
438
|
swapPreview: this.getSwapPreview(index),
|
340
|
-
hideHoverEffect: this.state.hideHoverEffect
|
439
|
+
hideHoverEffect: this.state.hideHoverEffect,
|
440
|
+
animatedScaling: index === this.state.animatedScaling
|
341
441
|
};
|
342
442
|
}
|
343
443
|
}, {
|
@@ -434,10 +534,61 @@ var Draggable = function Draggable(props) {
|
|
434
534
|
return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SDraggable, _ref5.cn("SDraggable", _objectSpread({}, _assignProps2({
|
435
535
|
"ref": ref,
|
436
536
|
"draggable": !noDrag,
|
437
|
-
"tabIndex": 0,
|
438
537
|
"placement": placement
|
439
538
|
}, _ref2))), swapPreview ? swapPreview : /*#__PURE__*/React.createElement(Children, _ref5.cn("Children", {})));
|
440
539
|
};
|
540
|
+
Draggable.enhance = [keyboardFocusEnhance()];
|
541
|
+
var findNextRectangleIndex = function findNextRectangleIndex(rectangles, current, direction) {
|
542
|
+
var candidate = null;
|
543
|
+
var minDistance = Infinity;
|
544
|
+
for (var i = 0; i < rectangles.length; i++) {
|
545
|
+
var rect = rectangles[i];
|
546
|
+
if (!rect) continue;
|
547
|
+
if (rect === current) continue;
|
548
|
+
var verticallyOverlaps = current.top <= rect.bottom && current.bottom >= rect.top;
|
549
|
+
var horizontallyOverlaps = current.left <= rect.right && current.right >= rect.left;
|
550
|
+
if (!verticallyOverlaps && !horizontallyOverlaps) continue;
|
551
|
+
switch (direction) {
|
552
|
+
case 'ArrowRight':
|
553
|
+
{
|
554
|
+
if (!verticallyOverlaps) continue;
|
555
|
+
var distance = rect.left - current.right;
|
556
|
+
if (distance < 0 || distance >= minDistance) continue;
|
557
|
+
candidate = rect;
|
558
|
+
minDistance = distance;
|
559
|
+
break;
|
560
|
+
}
|
561
|
+
case 'ArrowLeft':
|
562
|
+
{
|
563
|
+
if (!verticallyOverlaps) continue;
|
564
|
+
var _distance = current.left - rect.right;
|
565
|
+
if (_distance < 0 || _distance >= minDistance) continue;
|
566
|
+
candidate = rect;
|
567
|
+
minDistance = _distance;
|
568
|
+
break;
|
569
|
+
}
|
570
|
+
case 'ArrowUp':
|
571
|
+
{
|
572
|
+
if (!horizontallyOverlaps) continue;
|
573
|
+
var _distance2 = current.top - rect.bottom;
|
574
|
+
if (_distance2 < 0 || _distance2 >= minDistance) continue;
|
575
|
+
candidate = rect;
|
576
|
+
minDistance = _distance2;
|
577
|
+
break;
|
578
|
+
}
|
579
|
+
case 'ArrowDown':
|
580
|
+
{
|
581
|
+
if (!horizontallyOverlaps) continue;
|
582
|
+
var _distance3 = rect.top - current.bottom;
|
583
|
+
if (_distance3 < 0 || _distance3 >= minDistance) continue;
|
584
|
+
candidate = rect;
|
585
|
+
minDistance = _distance3;
|
586
|
+
break;
|
587
|
+
}
|
588
|
+
}
|
589
|
+
}
|
590
|
+
return rectangles.indexOf(candidate);
|
591
|
+
};
|
441
592
|
var DropZone = function DropZone(props) {
|
442
593
|
var _ref3 = arguments[0],
|
443
594
|
_ref6;
|