@uva-glass/component-library 3.30.1 → 3.31.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/dist/{Lexical.prod-UwAbgYpF.js → Lexical.prod-B84LhBo3.js} +1196 -1224
- package/dist/Lexical.prod-B84LhBo3.js.map +1 -0
- package/dist/{LexicalClipboard.prod-DHIGjydG.js → LexicalClipboard.prod-DLgWWXys.js} +4 -4
- package/dist/{LexicalClipboard.prod-DHIGjydG.js.map → LexicalClipboard.prod-DLgWWXys.js.map} +1 -1
- package/dist/{LexicalLink.prod-Bsa9J7L-.js → LexicalLink.prod-DoU9RL94.js} +3 -3
- package/dist/{LexicalLink.prod-Bsa9J7L-.js.map → LexicalLink.prod-DoU9RL94.js.map} +1 -1
- package/dist/{LexicalList.prod-jxGuZd4b.js → LexicalList.prod-Cw2TK1jY.js} +4 -4
- package/dist/{LexicalList.prod-jxGuZd4b.js.map → LexicalList.prod-Cw2TK1jY.js.map} +1 -1
- package/dist/{LexicalSelection.prod-xk5MiZnZ.js → LexicalSelection.prod-TB5pn9xc.js} +2 -2
- package/dist/{LexicalSelection.prod-xk5MiZnZ.js.map → LexicalSelection.prod-TB5pn9xc.js.map} +1 -1
- package/dist/{LexicalTable.prod-BSjs04iE.js → LexicalTable.prod-9xjyWB0C.js} +4 -4
- package/dist/{LexicalTable.prod-BSjs04iE.js.map → LexicalTable.prod-9xjyWB0C.js.map} +1 -1
- package/dist/{LexicalUtils.prod-cQutjKA3.js → LexicalUtils.prod-CD3xGFhm.js} +2 -2
- package/dist/{LexicalUtils.prod-cQutjKA3.js.map → LexicalUtils.prod-CD3xGFhm.js.map} +1 -1
- package/dist/Sortable.module--kgnzOjW.js +26 -0
- package/dist/Sortable.module--kgnzOjW.js.map +1 -0
- package/dist/SortableProvider-C2T7b-pm.js +153 -0
- package/dist/SortableProvider-C2T7b-pm.js.map +1 -0
- package/dist/{TablePlugin-NmJsn2fm.js → TablePlugin-Dmy98Epb.js} +86 -91
- package/dist/{TablePlugin-NmJsn2fm.js.map → TablePlugin-Dmy98Epb.js.map} +1 -1
- package/dist/assets/Backdrop.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/ClipboardButton.css +1 -1
- package/dist/assets/ExpandableInfoPanel.css +1 -1
- package/dist/assets/FormInput.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputField.css +1 -1
- package/dist/assets/LinkContextMenu.css +1 -1
- package/dist/assets/Notification.css +1 -1
- package/dist/assets/OverlayCloseButton.css +1 -1
- package/dist/assets/OverlayStepBar.css +1 -1
- package/dist/assets/PageOverlay.css +1 -1
- package/dist/assets/Sortable.css +1 -1
- package/dist/assets/VarIndicator.css +1 -1
- package/dist/components/Accordion/Accordion.test.js +3 -3
- package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
- package/dist/components/ActionList/ActionList.test.js +3 -3
- package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
- package/dist/components/Attention/Attention.test.js +2 -2
- package/dist/components/Backdrop/Backdrop.test.js +2 -2
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.test.js +2 -2
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +2 -2
- package/dist/components/Buttons/MenuButton.stories.js +5 -5
- package/dist/components/Buttons/MenuButton.test.js +2 -2
- package/dist/components/Card/Card.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxTree/CheckboxTree.js +58 -59
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +58 -59
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/Chip/Chip.stories.js +5 -5
- package/dist/components/ControlsButton/ControlsButton.stories.js +5 -5
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
- package/dist/components/FormInput/FormInput.js +3 -3
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/HorizontalList/HorizontalList.js +7 -7
- package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +10 -10
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/ModalDialog/ModalDialog.stories.js +8 -8
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +8 -8
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +3 -3
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.js +66 -70
- package/dist/components/MultiSelectBox/MultiSelectBox.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
- package/dist/components/Notification/Notification.stories.js +6 -6
- package/dist/components/Notification/Notification.test.js +2 -2
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +4 -4
- package/dist/components/OverlayStepBar/OverlayStepBar.stories.js +19 -20
- package/dist/components/OverlayStepBar/OverlayStepBar.stories.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +33 -33
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +4 -4
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +3 -3
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RadioTabSelector/RadioTabSelector.js +3 -3
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +3 -3
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +51 -61
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +79 -89
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +19 -19
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +17 -18
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +31 -32
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +10 -10
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js +31 -32
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js +29 -30
- package/dist/components/SelectListbox/components/SelectOption.js.map +1 -1
- package/dist/components/Sortable/Sortable.d.ts +6 -1
- package/dist/components/Sortable/Sortable.js +23 -13
- package/dist/components/Sortable/Sortable.js.map +1 -1
- package/dist/components/Sortable/Sortable.stories.js +13 -12
- package/dist/components/Sortable/Sortable.stories.js.map +1 -1
- package/dist/components/Sortable/SortableProvider.d.ts +2 -1
- package/dist/components/Sortable/SortableProvider.js +1 -1
- package/dist/components/Sortable/components/SortableContainer.d.ts +2 -1
- package/dist/components/Sortable/components/SortableContainer.js +2 -2
- package/dist/components/Sortable/components/SortableHandle.js +1 -1
- package/dist/components/Sortable/components/SortableItem.d.ts +3 -1
- package/dist/components/Sortable/components/SortableItem.js +48 -47
- package/dist/components/Sortable/components/SortableItem.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +3 -3
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/components/hooks/usePositionedFloaters.js +39 -39
- package/dist/components/hooks/usePositionedFloaters.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{helpers-DZIm3MiJ.js → helpers-CMG0anwr.js} +4 -4
- package/dist/{helpers-DZIm3MiJ.js.map → helpers-CMG0anwr.js.map} +1 -1
- package/dist/{index-DV47hRzi.js → index-Br0QepD6.js} +8 -10
- package/dist/{index-DV47hRzi.js.map → index-Br0QepD6.js.map} +1 -1
- package/dist/{index-Di9WPZUe.js → index-C2E9FY6V.js} +9149 -9854
- package/dist/index-C2E9FY6V.js.map +1 -0
- package/dist/{index-PaHiqSUg.js → index-Ds1dMTvJ.js} +29 -29
- package/dist/{index-PaHiqSUg.js.map → index-Ds1dMTvJ.js.map} +1 -1
- package/dist/{index-BVAvx58-.js → index-KJPw-7za.js} +2209 -2280
- package/dist/{index-BVAvx58-.js.map → index-KJPw-7za.js.map} +1 -1
- package/dist/{index-DllfJcv4.js → index-nrPtQ1dv.js} +2 -2
- package/dist/{index-DllfJcv4.js.map → index-nrPtQ1dv.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{react.esm-CFMwGdo5.js → react.esm-BKjCIfbB.js} +373 -374
- package/dist/{react.esm-CFMwGdo5.js.map → react.esm-BKjCIfbB.js.map} +1 -1
- package/dist/setupTests.js +6 -9
- package/dist/setupTests.js.map +1 -1
- package/dist/storybook__react.d.js +2056 -2072
- package/dist/storybook__react.d.js.map +1 -1
- package/package.json +14 -14
- package/dist/Lexical.prod-UwAbgYpF.js.map +0 -1
- package/dist/Sortable.module-CekPNg54.js +0 -23
- package/dist/Sortable.module-CekPNg54.js.map +0 -1
- package/dist/SortableProvider-CwX1lFMa.js +0 -152
- package/dist/SortableProvider-CwX1lFMa.js.map +0 -1
- package/dist/index-Di9WPZUe.js.map +0 -1
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useSelect as
|
|
5
|
-
import { s as
|
|
6
|
-
const
|
|
7
|
-
const i =
|
|
8
|
-
p(
|
|
9
|
-
},
|
|
10
|
-
switch (
|
|
1
|
+
import { jsxs as k, Fragment as D, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "../../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useRef as y, useEffect as m } from "react";
|
|
4
|
+
import { useSelect as O } from "../SelectProvider.js";
|
|
5
|
+
import { s as c } from "../../../SelectListbox.module-yzXaWwsm.js";
|
|
6
|
+
const E = ({ option: l, index: t, dividerAfter: u, children: d }) => {
|
|
7
|
+
const i = y(null), { isOpen: a, activeIndex: e, setActiveIndex: r, selectedValue: n, setSelectedValue: p, setIsOpen: f, options: o } = O(), v = (s) => {
|
|
8
|
+
p(o[s]), f(!1);
|
|
9
|
+
}, w = (s) => {
|
|
10
|
+
switch (s.key) {
|
|
11
11
|
case "Tab":
|
|
12
|
-
|
|
12
|
+
s.preventDefault(), a && f(!1);
|
|
13
13
|
break;
|
|
14
14
|
case "ArrowDown":
|
|
15
15
|
case "ArrowUp":
|
|
16
|
-
if (
|
|
16
|
+
if (s.preventDefault(), !a)
|
|
17
17
|
return;
|
|
18
|
-
|
|
18
|
+
s.key === "ArrowDown" && e < o.length - 1 && r(e + 1), s.key === "ArrowUp" && e > 0 && r(e - 1);
|
|
19
19
|
break;
|
|
20
20
|
case "Enter":
|
|
21
|
-
|
|
21
|
+
s.preventDefault(), o?.length && e > -1 && !o[e].disabled && v(e);
|
|
22
22
|
break;
|
|
23
23
|
case "Escape":
|
|
24
|
-
|
|
24
|
+
a && (s.stopPropagation(), f(!1));
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */ m(
|
|
28
|
+
return m(() => {
|
|
29
|
+
t === e && (a ? i.current?.focus() : i.current?.blur());
|
|
30
|
+
}, [e, t, a]), m(() => {
|
|
31
|
+
n.value === l.value && r(t);
|
|
32
|
+
}, [t, l.value, n.value, r]), /* @__PURE__ */ k(D, { children: [
|
|
33
|
+
/* @__PURE__ */ b(
|
|
35
34
|
"li",
|
|
36
35
|
{
|
|
37
|
-
className:
|
|
38
|
-
[
|
|
39
|
-
[
|
|
36
|
+
className: h(c["select-listbox-option"], {
|
|
37
|
+
[c["select-listbox-option--active"]]: t === e,
|
|
38
|
+
[c["select-listbox-option--divider"]]: t + 1 === u
|
|
40
39
|
}),
|
|
41
40
|
...!l.disabled && {
|
|
42
41
|
onClick: () => p(l),
|
|
43
|
-
onKeyDown:
|
|
42
|
+
onKeyDown: w,
|
|
44
43
|
tabIndex: 0,
|
|
45
44
|
role: "option",
|
|
46
|
-
"aria-selected":
|
|
45
|
+
"aria-selected": n.value === l.value
|
|
47
46
|
},
|
|
48
47
|
ref: i,
|
|
49
|
-
children:
|
|
48
|
+
children: d
|
|
50
49
|
},
|
|
51
50
|
`${l.value}`
|
|
52
51
|
),
|
|
53
|
-
t + 1 === u && /* @__PURE__ */
|
|
52
|
+
t + 1 === u && /* @__PURE__ */ b("div", { className: c["select-listbox-divider"], "aria-hidden": "true" })
|
|
54
53
|
] });
|
|
55
54
|
};
|
|
56
55
|
export {
|
|
57
|
-
|
|
56
|
+
E as SelectOption
|
|
58
57
|
};
|
|
59
58
|
//# sourceMappingURL=SelectOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOption.js","sources":["../../../../src/components/SelectListbox/components/SelectOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { OptionValue } from 'components/SelectListbox/SelectProvider';\n\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\n\nexport interface SelectOptionProps {\n option: OptionValue;\n index: number;\n key: string | number;\n dividerAfter?: number;\n children: ReactNode;\n}\n\nexport const SelectOption = ({ option, index, dividerAfter, children }: SelectOptionProps) => {\n const selectOptionRef = useRef<HTMLLIElement>(null);\n const { isOpen, activeIndex, setActiveIndex, selectedValue, setSelectedValue, setIsOpen, options } = useSelect();\n\n const handleSelectOption = (aIndex: number) => {\n setSelectedValue(options[aIndex]);\n setIsOpen(false);\n };\n\n const onOptionKeyDown = (event: KeyboardEvent<HTMLLIElement>) => {\n switch (event.key) {\n case 'Tab':\n event.preventDefault();\n if (isOpen) {\n setIsOpen(false);\n }\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (!isOpen) {\n return;\n }\n if (event.key === 'ArrowDown' && activeIndex < options.length - 1) {\n setActiveIndex(activeIndex + 1);\n }\n if (event.key === 'ArrowUp' && activeIndex > 0) {\n setActiveIndex(activeIndex - 1);\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (options?.length && activeIndex > -1 && !options[activeIndex].disabled) {\n handleSelectOption(activeIndex);\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n if (index === activeIndex) {\n isOpen ? selectOptionRef.current?.focus() : selectOptionRef.current?.blur();\n }\n }, [activeIndex, index, isOpen]);\n\n useEffect(() => {\n if (selectedValue.value === option.value) {\n setActiveIndex(index);\n }\n }, [index, option.value, selectedValue.value, setActiveIndex]);\n\n return (\n <>\n <li\n className={clsx(styles['select-listbox-option'], {\n [styles['select-listbox-option--active']]: index === activeIndex,\n [styles['select-listbox-option--divider']]: index + 1 === dividerAfter,\n })}\n key={`${option.value}`}\n {...(!option.disabled && {\n onClick: () => setSelectedValue(option),\n onKeyDown: onOptionKeyDown,\n tabIndex: 0,\n role: 'option',\n 'aria-selected': selectedValue.value === option.value,\n })}\n ref={selectOptionRef}\n >\n {children}\n </li>\n {index + 1 === dividerAfter && <div className={styles['select-listbox-divider']} aria-hidden=\"true\" />}\n </>\n );\n};\n"],"names":["SelectOption","option","index","dividerAfter","children","selectOptionRef","useRef","isOpen","activeIndex","setActiveIndex","selectedValue","setSelectedValue","setIsOpen","options","useSelect","handleSelectOption","aIndex","onOptionKeyDown","event","useEffect","
|
|
1
|
+
{"version":3,"file":"SelectOption.js","sources":["../../../../src/components/SelectListbox/components/SelectOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { OptionValue } from 'components/SelectListbox/SelectProvider';\n\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\n\nexport interface SelectOptionProps {\n option: OptionValue;\n index: number;\n key: string | number;\n dividerAfter?: number;\n children: ReactNode;\n}\n\nexport const SelectOption = ({ option, index, dividerAfter, children }: SelectOptionProps) => {\n const selectOptionRef = useRef<HTMLLIElement>(null);\n const { isOpen, activeIndex, setActiveIndex, selectedValue, setSelectedValue, setIsOpen, options } = useSelect();\n\n const handleSelectOption = (aIndex: number) => {\n setSelectedValue(options[aIndex]);\n setIsOpen(false);\n };\n\n const onOptionKeyDown = (event: KeyboardEvent<HTMLLIElement>) => {\n switch (event.key) {\n case 'Tab':\n event.preventDefault();\n if (isOpen) {\n setIsOpen(false);\n }\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (!isOpen) {\n return;\n }\n if (event.key === 'ArrowDown' && activeIndex < options.length - 1) {\n setActiveIndex(activeIndex + 1);\n }\n if (event.key === 'ArrowUp' && activeIndex > 0) {\n setActiveIndex(activeIndex - 1);\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (options?.length && activeIndex > -1 && !options[activeIndex].disabled) {\n handleSelectOption(activeIndex);\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n if (index === activeIndex) {\n isOpen ? selectOptionRef.current?.focus() : selectOptionRef.current?.blur();\n }\n }, [activeIndex, index, isOpen]);\n\n useEffect(() => {\n if (selectedValue.value === option.value) {\n setActiveIndex(index);\n }\n }, [index, option.value, selectedValue.value, setActiveIndex]);\n\n return (\n <>\n <li\n className={clsx(styles['select-listbox-option'], {\n [styles['select-listbox-option--active']]: index === activeIndex,\n [styles['select-listbox-option--divider']]: index + 1 === dividerAfter,\n })}\n key={`${option.value}`}\n {...(!option.disabled && {\n onClick: () => setSelectedValue(option),\n onKeyDown: onOptionKeyDown,\n tabIndex: 0,\n role: 'option',\n 'aria-selected': selectedValue.value === option.value,\n })}\n ref={selectOptionRef}\n >\n {children}\n </li>\n {index + 1 === dividerAfter && <div className={styles['select-listbox-divider']} aria-hidden=\"true\" />}\n </>\n );\n};\n"],"names":["SelectOption","option","index","dividerAfter","children","selectOptionRef","useRef","isOpen","activeIndex","setActiveIndex","selectedValue","setSelectedValue","setIsOpen","options","useSelect","handleSelectOption","aIndex","onOptionKeyDown","event","useEffect","jsxs","Fragment","jsx","clsx","styles"],"mappings":";;;;;AAiBO,MAAMA,IAAe,CAAC,EAAE,QAAAC,GAAQ,OAAAC,GAAO,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAMC,IAAkBC,EAAsB,IAAI,GAC5C,EAAE,QAAAC,GAAQ,aAAAC,GAAa,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,GAAkB,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA,GAE/FC,IAAqB,CAACC,MAAmB;AAC7C,IAAAL,EAAiBE,EAAQG,CAAM,CAAC,GAChCJ,EAAU,EAAK;AAAA,EAAA,GAGXK,IAAkB,CAACC,MAAwC;AAC/D,YAAQA,EAAM,KAAA;AAAA,MACZ,KAAK;AACH,QAAAA,EAAM,eAAA,GACFX,KACFK,EAAU,EAAK;AAEjB;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AAEH,YADAM,EAAM,eAAA,GACF,CAACX;AACH;AAEF,QAAIW,EAAM,QAAQ,eAAeV,IAAcK,EAAQ,SAAS,KAC9DJ,EAAeD,IAAc,CAAC,GAE5BU,EAAM,QAAQ,aAAaV,IAAc,KAC3CC,EAAeD,IAAc,CAAC;AAEhC;AAAA,MACF,KAAK;AACH,QAAAU,EAAM,eAAA,GACFL,GAAS,UAAUL,IAAc,MAAM,CAACK,EAAQL,CAAW,EAAE,YAC/DO,EAAmBP,CAAW;AAEhC;AAAA,MACF,KAAK;AACH,QAAID,MACFW,EAAM,gBAAA,GACNN,EAAU,EAAK;AAEjB;AAAA,IAAA;AAAA,EACJ;AAGF,SAAAO,EAAU,MAAM;AACd,IAAIjB,MAAUM,MACZD,IAASF,EAAgB,SAAS,MAAA,IAAUA,EAAgB,SAAS,KAAA;AAAA,EACvE,GACC,CAACG,GAAaN,GAAOK,CAAM,CAAC,GAE/BY,EAAU,MAAM;AACd,IAAIT,EAAc,UAAUT,EAAO,SACjCQ,EAAeP,CAAK;AAAA,EACtB,GACC,CAACA,GAAOD,EAAO,OAAOS,EAAc,OAAOD,CAAc,CAAC,GAG3D,gBAAAW,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAKC,EAAO,uBAAuB,GAAG;AAAA,UAC/C,CAACA,EAAO,+BAA+B,CAAC,GAAGtB,MAAUM;AAAA,UACrD,CAACgB,EAAO,gCAAgC,CAAC,GAAGtB,IAAQ,MAAMC;AAAA,QAAA,CAC3D;AAAA,QAEA,GAAI,CAACF,EAAO,YAAY;AAAA,UACvB,SAAS,MAAMU,EAAiBV,CAAM;AAAA,UACtC,WAAWgB;AAAA,UACX,UAAU;AAAA,UACV,MAAM;AAAA,UACN,iBAAiBP,EAAc,UAAUT,EAAO;AAAA,QAAA;AAAA,QAElD,KAAKI;AAAA,QAEJ,UAAAD;AAAA,MAAA;AAAA,MAVI,GAAGH,EAAO,KAAK;AAAA,IAAA;AAAA,IAYrBC,IAAQ,MAAMC,KAAgB,gBAAAmB,EAAC,OAAA,EAAI,WAAWE,EAAO,wBAAwB,GAAG,eAAY,OAAA,CAAO;AAAA,EAAA,GACtG;AAEJ;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { SortableItemProps } from './components/SortableItem';
|
|
3
3
|
export type Index = string | number;
|
|
4
|
+
export type SortableItemColors = 'grey-200' | 'white';
|
|
4
5
|
export interface SortableProps {
|
|
5
6
|
/** The elements to show inside the Sortable. */
|
|
6
7
|
children: ReactElement[] | string[];
|
|
@@ -10,7 +11,11 @@ export interface SortableProps {
|
|
|
10
11
|
scrollable?: boolean;
|
|
11
12
|
/** If true, the sorting will be disabled. */
|
|
12
13
|
disabled?: boolean;
|
|
14
|
+
/** Hide the numbers shown next to the sortable elements. */
|
|
15
|
+
hideNumbers?: boolean;
|
|
16
|
+
/** Change the color of the SortableItem wrapper. */
|
|
17
|
+
sortableItemColor?: SortableItemColors;
|
|
13
18
|
/** The callback function that is invoked when new sorting takes place. */
|
|
14
19
|
onSort?: (items: (string | ReactElement)[]) => void;
|
|
15
20
|
}
|
|
16
|
-
export declare const Sortable: ({ children, ItemHandlePlacement, scrollable, disabled, onSort }: SortableProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const Sortable: ({ children, ItemHandlePlacement, scrollable, disabled, onSort, hideNumbers, sortableItemColor, }: SortableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Children as e } from "react";
|
|
3
|
-
import { SortableItem as
|
|
4
|
-
import { S as
|
|
5
|
-
const
|
|
6
|
-
|
|
3
|
+
import { SortableItem as p } from "./components/SortableItem.js";
|
|
4
|
+
import { S as f } from "../../SortableProvider-C2T7b-pm.js";
|
|
5
|
+
const u = ({
|
|
6
|
+
children: r,
|
|
7
|
+
ItemHandlePlacement: m = "left",
|
|
8
|
+
scrollable: a,
|
|
9
|
+
disabled: l,
|
|
10
|
+
onSort: i,
|
|
11
|
+
hideNumbers: s,
|
|
12
|
+
sortableItemColor: b = "grey-200"
|
|
13
|
+
}) => /* @__PURE__ */ o(
|
|
14
|
+
f,
|
|
7
15
|
{
|
|
8
|
-
items:
|
|
16
|
+
items: r,
|
|
9
17
|
scrollable: a,
|
|
18
|
+
hideNumbers: s,
|
|
10
19
|
onSort: i,
|
|
11
|
-
children:
|
|
12
|
-
|
|
20
|
+
children: r.map((n, t) => /* @__PURE__ */ o(
|
|
21
|
+
p,
|
|
13
22
|
{
|
|
14
23
|
handlePlacement: m,
|
|
15
|
-
disabled: l || e.count(
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
disabled: l || e.count(r) <= 1,
|
|
25
|
+
sortableItemColor: b,
|
|
26
|
+
index: t,
|
|
27
|
+
children: n
|
|
18
28
|
},
|
|
19
|
-
`sortable-item-${
|
|
29
|
+
`sortable-item-${t}`
|
|
20
30
|
))
|
|
21
31
|
},
|
|
22
|
-
`sortable-with-children-${e.count(
|
|
32
|
+
`sortable-with-children-${e.count(r)}`
|
|
23
33
|
);
|
|
24
34
|
export {
|
|
25
|
-
|
|
35
|
+
u as Sortable
|
|
26
36
|
};
|
|
27
37
|
//# sourceMappingURL=Sortable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sortable.js","sources":["../../../src/components/Sortable/Sortable.tsx"],"sourcesContent":["import { Children } from 'react';\n\nimport type { ReactElement } from 'react';\nimport type { SortableItemProps } from './components/SortableItem';\n\nimport { SortableItem } from './components/SortableItem';\nimport { SortableProvider } from './SortableProvider';\n\nexport type Index = string | number;\n\nexport interface SortableProps {\n /** The elements to show inside the Sortable. */\n children: ReactElement[] | string[];\n /** The placement of each item Handle (6 dots 2x3). */\n ItemHandlePlacement?: SortableItemProps['handlePlacement'];\n /** If true, a scrollable version of the list will be rendered (max height 21rem/336px). */\n scrollable?: boolean;\n /** If true, the sorting will be disabled. */\n disabled?: boolean;\n /** The callback function that is invoked when new sorting takes place. */\n onSort?: (items: (string | ReactElement)[]) => void;\n}\n\n// A component that renders a list of children that can be sorted with drag and drop.\nexport const Sortable = ({
|
|
1
|
+
{"version":3,"file":"Sortable.js","sources":["../../../src/components/Sortable/Sortable.tsx"],"sourcesContent":["import { Children } from 'react';\n\nimport type { ReactElement } from 'react';\nimport type { SortableItemProps } from './components/SortableItem';\n\nimport { SortableItem } from './components/SortableItem';\nimport { SortableProvider } from './SortableProvider';\n\nexport type Index = string | number;\nexport type SortableItemColors = 'grey-200' | 'white';\n\nexport interface SortableProps {\n /** The elements to show inside the Sortable. */\n children: ReactElement[] | string[];\n /** The placement of each item Handle (6 dots 2x3). */\n ItemHandlePlacement?: SortableItemProps['handlePlacement'];\n /** If true, a scrollable version of the list will be rendered (max height 21rem/336px). */\n scrollable?: boolean;\n /** If true, the sorting will be disabled. */\n disabled?: boolean;\n /** Hide the numbers shown next to the sortable elements. */\n hideNumbers?: boolean;\n /** Change the color of the SortableItem wrapper. */\n sortableItemColor?: SortableItemColors;\n /** The callback function that is invoked when new sorting takes place. */\n onSort?: (items: (string | ReactElement)[]) => void;\n}\n\n// A component that renders a list of children that can be sorted with drag and drop.\nexport const Sortable = ({\n children,\n ItemHandlePlacement = 'left',\n scrollable,\n disabled,\n onSort,\n hideNumbers,\n sortableItemColor = 'grey-200',\n}: SortableProps) => {\n return (\n <SortableProvider\n items={children}\n scrollable={scrollable}\n hideNumbers={hideNumbers}\n onSort={onSort}\n key={`sortable-with-children-${Children.count(children)}`}\n >\n {children.map((child, index) => (\n <SortableItem\n handlePlacement={ItemHandlePlacement}\n disabled={disabled || Children.count(children) <= 1}\n sortableItemColor={sortableItemColor}\n index={index}\n key={`sortable-item-${index}`}\n >\n {child}\n </SortableItem>\n ))}\n </SortableProvider>\n );\n};\n"],"names":["Sortable","children","ItemHandlePlacement","scrollable","disabled","onSort","hideNumbers","sortableItemColor","jsx","SortableProvider","child","index","SortableItem","Children"],"mappings":";;;;AA6BO,MAAMA,IAAW,CAAC;AAAA,EACvB,UAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,OAAOR;AAAA,IACP,YAAAE;AAAA,IACA,aAAAG;AAAA,IACA,QAAAD;AAAA,IAGC,UAAAJ,EAAS,IAAI,CAACS,GAAOC,MACpB,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,iBAAiBV;AAAA,QACjB,UAAUE,KAAYS,EAAS,MAAMZ,CAAQ,KAAK;AAAA,QAClD,mBAAAM;AAAA,QACA,OAAAI;AAAA,QAGC,UAAAD;AAAA,MAAA;AAAA,MAFI,iBAAiBC,CAAK;AAAA,IAAA,CAI9B;AAAA,EAAA;AAAA,EAZI,0BAA0BE,EAAS,MAAMZ,CAAQ,CAAC;AAAA;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m, Fragment as i } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { l as s } from "../../index-C2E9FY6V.js";
|
|
3
3
|
import { Sortable as o } from "./Sortable.js";
|
|
4
|
-
import { InputField as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Button as
|
|
4
|
+
import { InputField as d } from "../InputField/InputField.js";
|
|
5
|
+
import { Icon as c } from "../Icon/Icon.js";
|
|
6
|
+
import { Button as b } from "../Buttons/Button.js";
|
|
7
7
|
import "../Buttons/LinkButton.js";
|
|
8
8
|
import "@react-aria/button";
|
|
9
|
-
const
|
|
9
|
+
const p = `<Sortable onSort={onSortFunction} ItemHandlePlacement={ItemHandlePlacement} scrollable={scrollable}
|
|
10
|
+
disabled={ disabled } hideNumbers={ hideNumbers } sortableItemColor={ sortableItemColor } > { children } </ Sortable > `, j = {
|
|
10
11
|
title: "Organisms/Sortable",
|
|
11
12
|
component: o,
|
|
12
13
|
argTypes: {
|
|
@@ -23,23 +24,23 @@ const b = "<Sortable onSort={onSortFunction} ItemHandlePlacement={ItemHandlePlac
|
|
|
23
24
|
},
|
|
24
25
|
parameters: {
|
|
25
26
|
inspectComponent: o,
|
|
26
|
-
codeString:
|
|
27
|
+
codeString: p
|
|
27
28
|
}
|
|
28
29
|
}, r = {
|
|
29
30
|
ItemHandlePlacement: "left",
|
|
30
31
|
onSort: s()
|
|
31
|
-
},
|
|
32
|
+
}, a = ["Item-1", "Item-2", "Item-3", "Item-4", "Item-5"], n = (l) => /* @__PURE__ */ e(o, { ...l, children: a }), h = n.bind({});
|
|
32
33
|
h.args = {
|
|
33
34
|
...r
|
|
34
35
|
};
|
|
35
|
-
const I =
|
|
36
|
+
const I = n.bind({});
|
|
36
37
|
I.args = {
|
|
37
38
|
...r,
|
|
38
39
|
ItemHandlePlacement: "right"
|
|
39
40
|
};
|
|
40
|
-
const f = (l) => /* @__PURE__ */ e(o, { ...l, children:
|
|
41
|
-
/* @__PURE__ */ e("div", { style: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
42
|
-
/* @__PURE__ */ e(
|
|
41
|
+
const f = (l) => /* @__PURE__ */ e(o, { ...l, children: a.map((t) => /* @__PURE__ */ m(i, { children: [
|
|
42
|
+
/* @__PURE__ */ e("div", { style: { width: "100%" }, children: /* @__PURE__ */ e(d, { id: t, placeholder: t }, t) }),
|
|
43
|
+
/* @__PURE__ */ e(b, { variant: "blank-icon", children: /* @__PURE__ */ e(c, { name: "Trash", color: "#a0002aff" }) })
|
|
43
44
|
] }, t)) }), g = f.bind({});
|
|
44
45
|
g.args = {
|
|
45
46
|
...r
|
|
@@ -47,7 +48,7 @@ g.args = {
|
|
|
47
48
|
export {
|
|
48
49
|
h as SortableExample,
|
|
49
50
|
g as WithComplexChildren,
|
|
50
|
-
|
|
51
|
+
j as default,
|
|
51
52
|
I as withHandleRight
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=Sortable.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sortable.stories.js","sources":["../../../src/components/Sortable/Sortable.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\nimport { Fragment } from 'react/jsx-runtime';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { SortableProps } from './Sortable';\n\nimport { Sortable } from './Sortable';\n\nimport { InputField } from 'components/InputField';\nimport { Icon } from 'components/Icon';\nimport { Button } from 'components/Buttons';\n\nconst codeString
|
|
1
|
+
{"version":3,"file":"Sortable.stories.js","sources":["../../../src/components/Sortable/Sortable.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\nimport { Fragment } from 'react/jsx-runtime';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { SortableProps } from './Sortable';\n\nimport { Sortable } from './Sortable';\n\nimport { InputField } from 'components/InputField';\nimport { Icon } from 'components/Icon';\nimport { Button } from 'components/Buttons';\n\nconst codeString = `<Sortable onSort={onSortFunction} ItemHandlePlacement={ItemHandlePlacement} scrollable={scrollable} \n disabled={ disabled } hideNumbers={ hideNumbers } sortableItemColor={ sortableItemColor } > { children } </ Sortable > `;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Organisms/Sortable',\n component: Sortable,\n argTypes: {\n children: {\n table: {\n disable: true,\n },\n },\n ItemHandlePlacement: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Sortable,\n codeString: codeString,\n },\n} as Meta<SortableProps>;\n\nconst defaultArgs: Partial<SortableProps> = {\n ItemHandlePlacement: 'left',\n onSort: fn(),\n};\n\nconst mockItems = ['Item-1', 'Item-2', 'Item-3', 'Item-4', 'Item-5'];\n\nconst Template: StoryFn<SortableProps> = (args) => <Sortable {...args}>{mockItems}</Sortable>;\n\nexport const SortableExample = Template.bind({});\nSortableExample.args = {\n ...defaultArgs,\n};\n\nexport const withHandleRight = Template.bind({});\nwithHandleRight.args = {\n ...defaultArgs,\n ItemHandlePlacement: 'right',\n};\n\nconst TemplateComplex: StoryFn<SortableProps> = (args) => (\n <Sortable {...args}>\n {mockItems.map((item) => (\n <Fragment key={item}>\n <div style={{ width: '100%' }}>\n <InputField key={item} id={item} placeholder={item} />\n </div>\n <Button variant=\"blank-icon\">\n <Icon name=\"Trash\" color=\"#a0002aff\" />\n </Button>\n </Fragment>\n ))}\n </Sortable>\n);\n\nexport const WithComplexChildren = TemplateComplex.bind({});\nWithComplexChildren.args = {\n ...defaultArgs,\n};\n"],"names":["codeString","Sortable_stories","Sortable","defaultArgs","fn","mockItems","Template","args","SortableExample","withHandleRight","TemplateComplex","jsx","item","jsxs","Fragment","InputField","Button","Icon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AAO;AAAA,EACzB,GAAGf;AACL;"}
|
|
@@ -16,8 +16,9 @@ interface Props {
|
|
|
16
16
|
children: SortableStateType['sortableItems'];
|
|
17
17
|
items: ReactElement[] | string[];
|
|
18
18
|
scrollable?: boolean;
|
|
19
|
+
hideNumbers?: boolean;
|
|
19
20
|
onSort?: (items: (string | ReactElement)[]) => void;
|
|
20
21
|
}
|
|
21
|
-
export declare function SortableProvider({ children, items, scrollable, onSort }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function SortableProvider({ children, items, scrollable, hideNumbers, onSort }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export declare function useSortable(): SortableContextType & SortableStateType;
|
|
23
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "./sortableReducer.js";
|
|
4
|
-
import { S as p, u as a } from "../../SortableProvider-
|
|
4
|
+
import { S as p, u as a } from "../../SortableProvider-C2T7b-pm.js";
|
|
5
5
|
import "./actions.js";
|
|
6
6
|
export {
|
|
7
7
|
p as SortableProvider,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type OnSort = (indices: number[]) => void;
|
|
2
2
|
interface SortableContainerProps {
|
|
3
3
|
scrollable?: boolean;
|
|
4
|
+
hideNumbers?: boolean;
|
|
4
5
|
onSort?: OnSort;
|
|
5
6
|
}
|
|
6
|
-
export declare function SortableContainer({ scrollable, onSort }: SortableContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function SortableContainer({ scrollable, hideNumbers, onSort }: SortableContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import "../../../Sortable.module
|
|
5
|
-
import { a } from "../../../SortableProvider-
|
|
4
|
+
import "../../../Sortable.module--kgnzOjW.js";
|
|
5
|
+
import { a } from "../../../SortableProvider-C2T7b-pm.js";
|
|
6
6
|
export {
|
|
7
7
|
a as SortableContainer
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Icon as e } from "../../Icon/Icon.js";
|
|
3
|
-
import { s as t } from "../../../Sortable.module
|
|
3
|
+
import { s as t } from "../../../Sortable.module--kgnzOjW.js";
|
|
4
4
|
const r = "ontouchstart" in globalThis.document.documentElement;
|
|
5
5
|
function m({ placement: n }) {
|
|
6
6
|
return r ? null : /* @__PURE__ */ o("div", { className: `${t.sortable__handle} ${t[`sortable__handle--${n}`]}`, children: /* @__PURE__ */ o(e, { name: "Dots" }) });
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SortableHandleProps } from './SortableHandle';
|
|
3
|
+
import { SortableItemColors } from 'components/Sortable/Sortable';
|
|
3
4
|
export interface SortableItemProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
handlePlacement: SortableHandleProps['placement'];
|
|
6
7
|
disabled?: boolean;
|
|
8
|
+
sortableItemColor: SortableItemColors;
|
|
7
9
|
index: number;
|
|
8
10
|
}
|
|
9
|
-
export declare function SortableItem({ children, handlePlacement, disabled, index }: SortableItemProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function SortableItem({ children, handlePlacement, disabled, sortableItemColor, index }: SortableItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
import { jsxs as i, jsx as r, Fragment as v } from "react/jsx-runtime";
|
|
2
|
-
import { useState as S, useRef as
|
|
2
|
+
import { useState as S, useRef as Q, useEffect as k } from "react";
|
|
3
|
+
import { c as G } from "../../../clsx-OuTLNxxd.js";
|
|
3
4
|
import { Icon as w } from "../../Icon/Icon.js";
|
|
4
5
|
import { SortableHandle as E } from "./SortableHandle.js";
|
|
5
|
-
import { s as
|
|
6
|
-
import { u as
|
|
7
|
-
const
|
|
6
|
+
import { s as e } from "../../../Sortable.module--kgnzOjW.js";
|
|
7
|
+
import { u as J } from "../../../SortableProvider-C2T7b-pm.js";
|
|
8
|
+
const j = ["Space", "ArrowDown", "ArrowUp"], F = "ontouchstart" in globalThis.document.documentElement, C = new Image(0, 0);
|
|
8
9
|
C.src = // 1px transparent png
|
|
9
10
|
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
|
10
|
-
function
|
|
11
|
+
function q({ children: D, handlePlacement: m, disabled: g, sortableItemColor: N, index: t }) {
|
|
11
12
|
const {
|
|
12
13
|
clone: h,
|
|
13
|
-
dragEnd:
|
|
14
|
+
dragEnd: u,
|
|
14
15
|
draggingSource: c,
|
|
15
16
|
draggingTarget: f,
|
|
16
|
-
dragStart:
|
|
17
|
-
drop:
|
|
17
|
+
dragStart: _,
|
|
18
|
+
drop: T,
|
|
18
19
|
maxIndex: p,
|
|
19
|
-
moveToPosition:
|
|
20
|
-
setClone:
|
|
21
|
-
setDraggingSource:
|
|
22
|
-
} =
|
|
23
|
-
|
|
24
|
-
n.current && globalThis.document.activeElement !== n.current && (
|
|
25
|
-
}, [
|
|
26
|
-
function
|
|
20
|
+
moveToPosition: I,
|
|
21
|
+
setClone: U,
|
|
22
|
+
setDraggingSource: $
|
|
23
|
+
} = J(), [y, A] = S(!1), [K, d] = S(!1), n = Q(null), s = t !== void 0 && t >= 0;
|
|
24
|
+
k(() => {
|
|
25
|
+
n.current && globalThis.document.activeElement !== n.current && (t === f && f === c ? (n.current.focus(), d(!0)) : d(!1));
|
|
26
|
+
}, [t, f, c, $]);
|
|
27
|
+
function R(a) {
|
|
27
28
|
if (a.stopPropagation(), a.dataTransfer.effectAllowed = "move", a.dataTransfer.setDragImage(C, 0, 0), n.current) {
|
|
28
29
|
const o = n.current.cloneNode(!0);
|
|
29
|
-
o.classList.add(
|
|
30
|
+
o.classList.add(e["sortable__sort-item--ghost"]), U(o);
|
|
30
31
|
}
|
|
31
|
-
s &&
|
|
32
|
+
s && _(t), A(!0);
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
34
|
+
function B() {
|
|
35
|
+
y || (h && document.body.removeChild(h), A(!1), u());
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function M(a) {
|
|
37
38
|
const { code: o } = a;
|
|
38
39
|
if (o === "Tab" && c !== void 0) {
|
|
39
|
-
|
|
40
|
+
u();
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
if (
|
|
43
|
+
if (j.includes(o) === !1 || !s) return;
|
|
43
44
|
if (o === "Space") {
|
|
44
|
-
|
|
45
|
+
K ? (d(!1), u()) : (d(!0), _(t));
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
48
|
if (c === void 0) return;
|
|
48
|
-
const l = o === "ArrowUp" ?
|
|
49
|
-
l < 0 || l > p ||
|
|
49
|
+
const l = o === "ArrowUp" ? t - 1 : t + 1;
|
|
50
|
+
l < 0 || l > p || I(l);
|
|
50
51
|
}
|
|
51
52
|
function b(a) {
|
|
52
53
|
if (a.preventDefault(), !s) return;
|
|
53
|
-
|
|
54
|
-
const { direction: o } = a.currentTarget.dataset, l = o === "up" ?
|
|
55
|
-
|
|
54
|
+
_(t);
|
|
55
|
+
const { direction: o } = a.currentTarget.dataset, l = o === "up" ? t - 1 : t + 1;
|
|
56
|
+
T(l);
|
|
56
57
|
}
|
|
57
58
|
return /* @__PURE__ */ i(
|
|
58
59
|
"div",
|
|
59
60
|
{
|
|
60
|
-
className:
|
|
61
|
-
draggable: !
|
|
62
|
-
onDragEnd:
|
|
63
|
-
onDragStart:
|
|
64
|
-
onKeyUpCapture:
|
|
61
|
+
className: G(e["sortable__sort-item"], e[`sortable__sort-item--${N}`]),
|
|
62
|
+
draggable: !g,
|
|
63
|
+
onDragEnd: B,
|
|
64
|
+
onDragStart: R,
|
|
65
|
+
onKeyUpCapture: M,
|
|
65
66
|
ref: n,
|
|
66
67
|
role: "presentation",
|
|
67
68
|
tabIndex: 0,
|
|
@@ -69,36 +70,36 @@ function L({ children: D, handlePlacement: u, disabled: _, index: e }) {
|
|
|
69
70
|
/* @__PURE__ */ i(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
72
|
-
className: `${
|
|
73
|
+
className: `${e["sortable__sort-item__contents"]} ${e[`sortable__sort-item__contents--handle-${m}`]}`,
|
|
73
74
|
children: [
|
|
74
|
-
|
|
75
|
+
m === "left" && /* @__PURE__ */ r(E, { placement: "left" }),
|
|
75
76
|
D,
|
|
76
|
-
|
|
77
|
+
m === "right" && /* @__PURE__ */ r(E, { placement: "right" })
|
|
77
78
|
]
|
|
78
79
|
}
|
|
79
80
|
),
|
|
80
|
-
/* @__PURE__ */ r("div", { className:
|
|
81
|
-
|
|
81
|
+
/* @__PURE__ */ r("div", { className: e["sortable__sort-item__button-container"], "data-touch": F, children: !g && s && /* @__PURE__ */ r(v, { children: s && /* @__PURE__ */ i(v, { children: [
|
|
82
|
+
t > 0 && /* @__PURE__ */ i(
|
|
82
83
|
"button",
|
|
83
84
|
{
|
|
84
|
-
className: `${
|
|
85
|
+
className: `${e["sortable__sort-item__handle"]} ${e["sortable__sort-item__handle--up"]}`,
|
|
85
86
|
"data-direction": "up",
|
|
86
87
|
onClickCapture: b,
|
|
87
88
|
children: [
|
|
88
|
-
/* @__PURE__ */ r("div", { className:
|
|
89
|
-
/* @__PURE__ */ r("span", { className:
|
|
89
|
+
/* @__PURE__ */ r("div", { className: e["sortable__sort-item__handle--icon"], children: /* @__PURE__ */ r(w, { name: "CheveronDown" }) }),
|
|
90
|
+
/* @__PURE__ */ r("span", { className: e["sortable__visually-hidden"], children: "Move up" })
|
|
90
91
|
]
|
|
91
92
|
}
|
|
92
93
|
),
|
|
93
|
-
|
|
94
|
+
t < p && /* @__PURE__ */ i(
|
|
94
95
|
"button",
|
|
95
96
|
{
|
|
96
|
-
className: `${
|
|
97
|
+
className: `${e["sortable__sort-item__handle"]} ${e["sortable__sort-item__handle--down"]}`,
|
|
97
98
|
"data-direction": "down",
|
|
98
99
|
onClickCapture: b,
|
|
99
100
|
children: [
|
|
100
|
-
/* @__PURE__ */ r("div", { className:
|
|
101
|
-
/* @__PURE__ */ r("span", { className:
|
|
101
|
+
/* @__PURE__ */ r("div", { className: e["sortable__sort-item__handle--icon"], children: /* @__PURE__ */ r(w, { name: "CheveronDown" }) }),
|
|
102
|
+
/* @__PURE__ */ r("span", { className: e["sortable__visually-hidden"], children: "Move down" })
|
|
102
103
|
]
|
|
103
104
|
}
|
|
104
105
|
)
|
|
@@ -108,6 +109,6 @@ function L({ children: D, handlePlacement: u, disabled: _, index: e }) {
|
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
111
|
export {
|
|
111
|
-
|
|
112
|
+
q as SortableItem
|
|
112
113
|
};
|
|
113
114
|
//# sourceMappingURL=SortableItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableItem.js","sources":["../../../../src/components/Sortable/components/SortableItem.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { DragEvent, MouseEvent, KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';\nimport type { SortableHandleProps } from './SortableHandle';\n\nimport { Icon } from 'components/Icon';\nimport { SortableHandle } from 'components/Sortable/components/SortableHandle';\nimport styles from 'components/Sortable/Sortable.module.css';\nimport { useSortable } from 'components/Sortable/SortableProvider';\n\nexport interface SortableItemProps {\n children: ReactNode;\n handlePlacement: SortableHandleProps['placement'];\n disabled?: boolean;\n index: number;\n}\n\nconst ACCESS_KEYS = ['Space', 'ArrowDown', 'ArrowUp'];\nconst noSupportTouch = 'ontouchstart' in globalThis.document.documentElement;\nconst dragImage = new Image(0, 0);\n\ndragImage.src =\n // 1px transparent png\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==';\n\nexport function SortableItem({ children, handlePlacement, disabled, index }: SortableItemProps) {\n const {\n clone,\n dragEnd,\n draggingSource,\n draggingTarget,\n dragStart,\n drop,\n maxIndex,\n moveToPosition,\n setClone,\n setDraggingSource,\n } = useSortable();\n const [grabbing, setGrabbing] = useState(false);\n const [moving, setmoving] = useState(false);\n const itemRef = useRef<HTMLDivElement>(null);\n const hasIndex = index !== undefined && index >= 0;\n\n useEffect(() => {\n if (!itemRef.current) return;\n if (globalThis.document.activeElement === itemRef.current) return;\n\n if (index === draggingTarget && draggingTarget === draggingSource) {\n // Manually setting focus after an item has been moved with the keyboard; focus is lost after rerender\n itemRef.current.focus();\n setmoving(true);\n } else {\n setmoving(false);\n }\n }, [index, draggingTarget, draggingSource, setDraggingSource]);\n\n function handleDragStart(event: DragEvent<HTMLDivElement>) {\n event.stopPropagation();\n\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setDragImage(dragImage, 0, 0);\n\n if (itemRef.current) {\n const cloned = itemRef.current.cloneNode(true) as Element;\n\n cloned.classList.add(styles['sortable__sort-item--ghost']);\n\n setClone(cloned);\n }\n\n if (hasIndex) dragStart(index);\n setGrabbing(true);\n }\n\n function handleDragEnd() {\n if (grabbing) return;\n\n if (clone) document.body.removeChild(clone);\n\n setGrabbing(false);\n dragEnd();\n }\n\n function handleKeyUp(event: ReactKeyboardEvent<HTMLDivElement>) {\n const { code } = event;\n\n if (code === 'Tab' && draggingSource !== undefined) {\n dragEnd();\n return;\n }\n\n if (ACCESS_KEYS.includes(code) === false) return;\n\n if (!hasIndex) return;\n\n if (code === 'Space') {\n if (moving) {\n setmoving(false);\n dragEnd();\n } else {\n setmoving(true);\n dragStart(index);\n }\n\n return;\n }\n\n if (draggingSource === undefined) return;\n\n const newTarget = code === 'ArrowUp' ? index - 1 : index + 1;\n\n if (newTarget < 0 || newTarget > maxIndex) return;\n\n moveToPosition(newTarget);\n }\n\n function handleMove(event: MouseEvent<HTMLButtonElement>) {\n event.preventDefault();\n\n if (!hasIndex) return;\n\n dragStart(index);\n\n const { direction } = event.currentTarget.dataset;\n const newTarget = direction === 'up' ? index - 1 : index + 1;\n\n drop(newTarget);\n }\n\n return (\n <div\n className={styles['sortable__sort-item']}\n draggable={!disabled}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n onKeyUpCapture={handleKeyUp}\n ref={itemRef}\n role=\"presentation\"\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n >\n <div\n className={`${styles['sortable__sort-item__contents']} ${styles[`sortable__sort-item__contents--handle-${handlePlacement}`]}`}\n >\n {handlePlacement === 'left' && <SortableHandle placement=\"left\" />}\n {children}\n {handlePlacement === 'right' && <SortableHandle placement=\"right\" />}\n </div>\n\n <div className={styles['sortable__sort-item__button-container']} data-touch={noSupportTouch}>\n {!disabled && hasIndex && (\n <>\n {hasIndex && (\n <>\n {index > 0 && (\n <button\n className={`${styles['sortable__sort-item__handle']} ${styles['sortable__sort-item__handle--up']}`}\n data-direction=\"up\"\n onClickCapture={handleMove}\n >\n <div className={styles['sortable__sort-item__handle--icon']}>\n <Icon name=\"CheveronDown\" />\n </div>\n <span className={styles['sortable__visually-hidden']}>Move up</span>\n </button>\n )}\n\n {index < maxIndex && (\n <button\n className={`${styles['sortable__sort-item__handle']} ${styles['sortable__sort-item__handle--down']}`}\n data-direction=\"down\"\n onClickCapture={handleMove}\n >\n <div className={styles['sortable__sort-item__handle--icon']}>\n <Icon name=\"CheveronDown\" />\n </div>\n <span className={styles['sortable__visually-hidden']}>Move down</span>\n </button>\n )}\n </>\n )}\n </>\n )}\n </div>\n </div>\n );\n}\n"],"names":["ACCESS_KEYS","noSupportTouch","dragImage","SortableItem","children","handlePlacement","disabled","index","clone","dragEnd","draggingSource","draggingTarget","dragStart","drop","maxIndex","moveToPosition","setClone","setDraggingSource","useSortable","grabbing","setGrabbing","useState","moving","setmoving","itemRef","useRef","hasIndex","useEffect","handleDragStart","event","cloned","styles","handleDragEnd","handleKeyUp","code","newTarget","handleMove","direction","jsxs","jsx","SortableHandle","Fragment","Icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortableItem.js","sources":["../../../../src/components/Sortable/components/SortableItem.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { DragEvent, MouseEvent, KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';\nimport type { SortableHandleProps } from './SortableHandle';\nimport type { SortableItemColors } from 'components/Sortable/Sortable';\n\nimport { Icon } from 'components/Icon';\nimport { SortableHandle } from 'components/Sortable/components/SortableHandle';\nimport styles from 'components/Sortable/Sortable.module.css';\nimport { useSortable } from 'components/Sortable/SortableProvider';\n\nexport interface SortableItemProps {\n children: ReactNode;\n handlePlacement: SortableHandleProps['placement'];\n disabled?: boolean;\n sortableItemColor: SortableItemColors;\n index: number;\n}\n\nconst ACCESS_KEYS = ['Space', 'ArrowDown', 'ArrowUp'];\nconst noSupportTouch = 'ontouchstart' in globalThis.document.documentElement;\nconst dragImage = new Image(0, 0);\n\ndragImage.src =\n // 1px transparent png\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==';\n\nexport function SortableItem({ children, handlePlacement, disabled, sortableItemColor, index }: SortableItemProps) {\n const {\n clone,\n dragEnd,\n draggingSource,\n draggingTarget,\n dragStart,\n drop,\n maxIndex,\n moveToPosition,\n setClone,\n setDraggingSource,\n } = useSortable();\n const [grabbing, setGrabbing] = useState(false);\n const [moving, setmoving] = useState(false);\n const itemRef = useRef<HTMLDivElement>(null);\n const hasIndex = index !== undefined && index >= 0;\n\n useEffect(() => {\n if (!itemRef.current) return;\n if (globalThis.document.activeElement === itemRef.current) return;\n\n if (index === draggingTarget && draggingTarget === draggingSource) {\n // Manually setting focus after an item has been moved with the keyboard; focus is lost after rerender\n itemRef.current.focus();\n setmoving(true);\n } else {\n setmoving(false);\n }\n }, [index, draggingTarget, draggingSource, setDraggingSource]);\n\n function handleDragStart(event: DragEvent<HTMLDivElement>) {\n event.stopPropagation();\n\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setDragImage(dragImage, 0, 0);\n\n if (itemRef.current) {\n const cloned = itemRef.current.cloneNode(true) as Element;\n\n cloned.classList.add(styles['sortable__sort-item--ghost']);\n\n setClone(cloned);\n }\n\n if (hasIndex) dragStart(index);\n setGrabbing(true);\n }\n\n function handleDragEnd() {\n if (grabbing) return;\n\n if (clone) document.body.removeChild(clone);\n\n setGrabbing(false);\n dragEnd();\n }\n\n function handleKeyUp(event: ReactKeyboardEvent<HTMLDivElement>) {\n const { code } = event;\n\n if (code === 'Tab' && draggingSource !== undefined) {\n dragEnd();\n return;\n }\n\n if (ACCESS_KEYS.includes(code) === false) return;\n\n if (!hasIndex) return;\n\n if (code === 'Space') {\n if (moving) {\n setmoving(false);\n dragEnd();\n } else {\n setmoving(true);\n dragStart(index);\n }\n\n return;\n }\n\n if (draggingSource === undefined) return;\n\n const newTarget = code === 'ArrowUp' ? index - 1 : index + 1;\n\n if (newTarget < 0 || newTarget > maxIndex) return;\n\n moveToPosition(newTarget);\n }\n\n function handleMove(event: MouseEvent<HTMLButtonElement>) {\n event.preventDefault();\n\n if (!hasIndex) return;\n\n dragStart(index);\n\n const { direction } = event.currentTarget.dataset;\n const newTarget = direction === 'up' ? index - 1 : index + 1;\n\n drop(newTarget);\n }\n\n return (\n <div\n className={clsx(styles['sortable__sort-item'], styles[`sortable__sort-item--${sortableItemColor}`])}\n draggable={!disabled}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n onKeyUpCapture={handleKeyUp}\n ref={itemRef}\n role=\"presentation\"\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n >\n <div\n className={`${styles['sortable__sort-item__contents']} ${styles[`sortable__sort-item__contents--handle-${handlePlacement}`]}`}\n >\n {handlePlacement === 'left' && <SortableHandle placement=\"left\" />}\n {children}\n {handlePlacement === 'right' && <SortableHandle placement=\"right\" />}\n </div>\n\n <div className={styles['sortable__sort-item__button-container']} data-touch={noSupportTouch}>\n {!disabled && hasIndex && (\n <>\n {hasIndex && (\n <>\n {index > 0 && (\n <button\n className={`${styles['sortable__sort-item__handle']} ${styles['sortable__sort-item__handle--up']}`}\n data-direction=\"up\"\n onClickCapture={handleMove}\n >\n <div className={styles['sortable__sort-item__handle--icon']}>\n <Icon name=\"CheveronDown\" />\n </div>\n <span className={styles['sortable__visually-hidden']}>Move up</span>\n </button>\n )}\n\n {index < maxIndex && (\n <button\n className={`${styles['sortable__sort-item__handle']} ${styles['sortable__sort-item__handle--down']}`}\n data-direction=\"down\"\n onClickCapture={handleMove}\n >\n <div className={styles['sortable__sort-item__handle--icon']}>\n <Icon name=\"CheveronDown\" />\n </div>\n <span className={styles['sortable__visually-hidden']}>Move down</span>\n </button>\n )}\n </>\n )}\n </>\n )}\n </div>\n </div>\n );\n}\n"],"names":["ACCESS_KEYS","noSupportTouch","dragImage","SortableItem","children","handlePlacement","disabled","sortableItemColor","index","clone","dragEnd","draggingSource","draggingTarget","dragStart","drop","maxIndex","moveToPosition","setClone","setDraggingSource","useSortable","grabbing","setGrabbing","useState","moving","setmoving","itemRef","useRef","hasIndex","useEffect","handleDragStart","event","cloned","styles","handleDragEnd","handleKeyUp","code","newTarget","handleMove","direction","jsxs","clsx","jsx","SortableHandle","Fragment","Icon"],"mappings":";;;;;;;AAoBA,MAAMA,IAAc,CAAC,SAAS,aAAa,SAAS,GAC9CC,IAAiB,kBAAkB,WAAW,SAAS,iBACvDC,IAAY,IAAI,MAAM,GAAG,CAAC;AAEhCA,EAAU;AAER;AAEK,SAASC,EAAa,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,UAAAC,GAAU,mBA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m-
|
|
2
|
+
import "../../index-Br0QepD6.js";
|
|
3
|
+
import { r as t, s } from "../../react.esm-BKjCIfbB.js";
|
|
4
4
|
import { StatusBadge as a } from "./StatusBage.js";
|
|
5
5
|
describe("StatusBadge", () => {
|
|
6
6
|
it("should render with message", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { l as r } from "../../index-C2E9FY6V.js";
|
|
3
3
|
import { TextArea as e } from "./TextArea.js";
|
|
4
4
|
const l = `
|
|
5
5
|
<TextArea label={label} maxCharacters={maxCharacters} defaultValue={string}/> `, p = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as o, s as t, f as r } from "../../react.esm-
|
|
4
|
-
import {
|
|
2
|
+
import "../../index-Br0QepD6.js";
|
|
3
|
+
import { r as o, s as t, f as r } from "../../react.esm-BKjCIfbB.js";
|
|
4
|
+
import { J as c } from "../../index-C2E9FY6V.js";
|
|
5
5
|
import { TextArea as n } from "./TextArea.js";
|
|
6
6
|
describe("TextArea", () => {
|
|
7
7
|
it("should render correctly with label", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { l } from "../../index-C2E9FY6V.js";
|
|
3
3
|
import { ToggleSwitch as e } from "./ToggleSwitch.js";
|
|
4
4
|
const a = `
|
|
5
5
|
// Has all InputHTMLAttributes props available except "className" and "style"
|