@vuu-ui/vuu-ui-controls 0.13.6 → 0.13.7
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.
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var core = require('@salt-ds/core');
|
|
5
|
-
var
|
|
6
|
-
var react = require('@dnd-kit/react');
|
|
5
|
+
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
|
|
9
8
|
const SortableOption = ({
|
|
@@ -12,7 +11,7 @@ const SortableOption = ({
|
|
|
12
11
|
value,
|
|
13
12
|
...optionProps
|
|
14
13
|
}) => {
|
|
15
|
-
const { ref } =
|
|
14
|
+
const { ref } = vuuUtils.useSortable({ id, index });
|
|
16
15
|
return /* @__PURE__ */ jsxRuntime.jsx(core.Option, { ...optionProps, id, ref, value });
|
|
17
16
|
};
|
|
18
17
|
const SortableList = ({
|
|
@@ -30,7 +29,7 @@ const SortableList = ({
|
|
|
30
29
|
}
|
|
31
30
|
}, 300);
|
|
32
31
|
}, [onReorderListItems]);
|
|
33
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsx(vuuUtils.DragDropProvider, { onDragEnd: handleDragEnd, children: /* @__PURE__ */ jsxRuntime.jsx(core.ListBox, { ...listBoxProps, ref: listRef, children }) });
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
exports.SortableList = SortableList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableList.js","sources":["../../src/sortable-list/SortableList.tsx"],"sourcesContent":["import { ListBox, ListBoxProps, Option, OptionProps } from \"@salt-ds/core\";\nimport { useSortable } from \"@
|
|
1
|
+
{"version":3,"file":"SortableList.js","sources":["../../src/sortable-list/SortableList.tsx"],"sourcesContent":["import { ListBox, ListBoxProps, Option, OptionProps } from \"@salt-ds/core\";\nimport { DragDropProvider, useSortable } from \"@vuu-ui/vuu-utils\";\nimport { useCallback, useRef } from \"react\";\n\nexport const SortableOption = ({\n id,\n index,\n value,\n ...optionProps\n}: OptionProps & { id: string; index: number }) => {\n const { ref } = useSortable({ id, index });\n return <Option {...optionProps} id={id} ref={ref} value={value} />;\n};\n\nexport const SortableList = ({\n children,\n onReorderListItems,\n ...listBoxProps\n}: ListBoxProps & {\n onReorderListItems?: (listItems: unknown[]) => void;\n}) => {\n const listRef = useRef<HTMLDivElement>(null);\n const handleDragEnd = useCallback(() => {\n setTimeout(() => {\n const listItems = listRef.current?.querySelectorAll(\".saltOption\");\n if (listItems) {\n const items = Array.from(listItems).map(({ id }) => id);\n onReorderListItems?.(items);\n }\n }, 300);\n }, [onReorderListItems]);\n\n return (\n <DragDropProvider onDragEnd={handleDragEnd}>\n <ListBox {...listBoxProps} ref={listRef}>\n {children}\n </ListBox>\n </DragDropProvider>\n );\n};\n"],"names":["useSortable","Option","useRef","useCallback","jsx","DragDropProvider","ListBox"],"mappings":";;;;;;;AAIO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAmD,KAAA;AACjD,EAAA,MAAM,EAAE,GAAI,EAAA,GAAIA,qBAAY,EAAE,EAAA,EAAI,OAAO,CAAA;AACzC,EAAA,sCAAQC,WAAQ,EAAA,EAAA,GAAG,WAAa,EAAA,EAAA,EAAQ,KAAU,KAAc,EAAA,CAAA;AAClE;AAEO,MAAM,eAAe,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,kBAAA;AAAA,EACA,GAAG;AACL,CAEM,KAAA;AACJ,EAAM,MAAA,OAAA,GAAUC,aAAuB,IAAI,CAAA;AAC3C,EAAM,MAAA,aAAA,GAAgBC,kBAAY,MAAM;AACtC,IAAA,UAAA,CAAW,MAAM;AACf,MAAA,MAAM,SAAY,GAAA,OAAA,CAAQ,OAAS,EAAA,gBAAA,CAAiB,aAAa,CAAA;AACjE,MAAA,IAAI,SAAW,EAAA;AACb,QAAM,MAAA,KAAA,GAAQ,KAAM,CAAA,IAAA,CAAK,SAAS,CAAA,CAAE,IAAI,CAAC,EAAE,EAAG,EAAA,KAAM,EAAE,CAAA;AACtD,QAAA,kBAAA,GAAqB,KAAK,CAAA;AAAA;AAC5B,OACC,GAAG,CAAA;AAAA,GACR,EAAG,CAAC,kBAAkB,CAAC,CAAA;AAEvB,EACE,uBAAAC,cAAA,CAACC,yBAAiB,EAAA,EAAA,SAAA,EAAW,aAC3B,EAAA,QAAA,kBAAAD,cAAA,CAACE,YAAS,EAAA,EAAA,GAAG,YAAc,EAAA,GAAA,EAAK,OAC7B,EAAA,QAAA,EACH,CACF,EAAA,CAAA;AAEJ;;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Option, ListBox } from '@salt-ds/core';
|
|
3
|
-
import { useSortable } from '@
|
|
4
|
-
import { DragDropProvider } from '@dnd-kit/react';
|
|
3
|
+
import { useSortable, DragDropProvider } from '@vuu-ui/vuu-utils';
|
|
5
4
|
import { useRef, useCallback } from 'react';
|
|
6
5
|
|
|
7
6
|
const SortableOption = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableList.js","sources":["../../src/sortable-list/SortableList.tsx"],"sourcesContent":["import { ListBox, ListBoxProps, Option, OptionProps } from \"@salt-ds/core\";\nimport { useSortable } from \"@
|
|
1
|
+
{"version":3,"file":"SortableList.js","sources":["../../src/sortable-list/SortableList.tsx"],"sourcesContent":["import { ListBox, ListBoxProps, Option, OptionProps } from \"@salt-ds/core\";\nimport { DragDropProvider, useSortable } from \"@vuu-ui/vuu-utils\";\nimport { useCallback, useRef } from \"react\";\n\nexport const SortableOption = ({\n id,\n index,\n value,\n ...optionProps\n}: OptionProps & { id: string; index: number }) => {\n const { ref } = useSortable({ id, index });\n return <Option {...optionProps} id={id} ref={ref} value={value} />;\n};\n\nexport const SortableList = ({\n children,\n onReorderListItems,\n ...listBoxProps\n}: ListBoxProps & {\n onReorderListItems?: (listItems: unknown[]) => void;\n}) => {\n const listRef = useRef<HTMLDivElement>(null);\n const handleDragEnd = useCallback(() => {\n setTimeout(() => {\n const listItems = listRef.current?.querySelectorAll(\".saltOption\");\n if (listItems) {\n const items = Array.from(listItems).map(({ id }) => id);\n onReorderListItems?.(items);\n }\n }, 300);\n }, [onReorderListItems]);\n\n return (\n <DragDropProvider onDragEnd={handleDragEnd}>\n <ListBox {...listBoxProps} ref={listRef}>\n {children}\n </ListBox>\n </DragDropProvider>\n );\n};\n"],"names":[],"mappings":";;;;;AAIO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAmD,KAAA;AACjD,EAAA,MAAM,EAAE,GAAI,EAAA,GAAI,YAAY,EAAE,EAAA,EAAI,OAAO,CAAA;AACzC,EAAA,2BAAQ,MAAQ,EAAA,EAAA,GAAG,WAAa,EAAA,EAAA,EAAQ,KAAU,KAAc,EAAA,CAAA;AAClE;AAEO,MAAM,eAAe,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,kBAAA;AAAA,EACA,GAAG;AACL,CAEM,KAAA;AACJ,EAAM,MAAA,OAAA,GAAU,OAAuB,IAAI,CAAA;AAC3C,EAAM,MAAA,aAAA,GAAgB,YAAY,MAAM;AACtC,IAAA,UAAA,CAAW,MAAM;AACf,MAAA,MAAM,SAAY,GAAA,OAAA,CAAQ,OAAS,EAAA,gBAAA,CAAiB,aAAa,CAAA;AACjE,MAAA,IAAI,SAAW,EAAA;AACb,QAAM,MAAA,KAAA,GAAQ,KAAM,CAAA,IAAA,CAAK,SAAS,CAAA,CAAE,IAAI,CAAC,EAAE,EAAG,EAAA,KAAM,EAAE,CAAA;AACtD,QAAA,kBAAA,GAAqB,KAAK,CAAA;AAAA;AAC5B,OACC,GAAG,CAAA;AAAA,GACR,EAAG,CAAC,kBAAkB,CAAC,CAAA;AAEvB,EACE,uBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,SAAA,EAAW,aAC3B,EAAA,QAAA,kBAAA,GAAA,CAAC,OAAS,EAAA,EAAA,GAAG,YAAc,EAAA,GAAA,EAAK,OAC7B,EAAA,QAAA,EACH,CACF,EAAA,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.
|
|
2
|
+
"version": "0.13.7",
|
|
3
3
|
"description": "VUU UI Controls",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-data-types": "0.13.
|
|
8
|
-
"@vuu-ui/vuu-protocol-types": "0.13.
|
|
9
|
-
"@vuu-ui/vuu-table-types": "0.13.
|
|
7
|
+
"@vuu-ui/vuu-data-types": "0.13.7",
|
|
8
|
+
"@vuu-ui/vuu-protocol-types": "0.13.7",
|
|
9
|
+
"@vuu-ui/vuu-table-types": "0.13.7"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@vuu-ui/vuu-context-menu": "0.13.
|
|
13
|
-
"@vuu-ui/vuu-data-react": "0.13.
|
|
14
|
-
"@vuu-ui/vuu-layout": "0.13.
|
|
15
|
-
"@vuu-ui/vuu-popups": "0.13.
|
|
16
|
-
"@vuu-ui/vuu-table": "0.13.
|
|
17
|
-
"@vuu-ui/vuu-utils": "0.13.
|
|
12
|
+
"@vuu-ui/vuu-context-menu": "0.13.7",
|
|
13
|
+
"@vuu-ui/vuu-data-react": "0.13.7",
|
|
14
|
+
"@vuu-ui/vuu-layout": "0.13.7",
|
|
15
|
+
"@vuu-ui/vuu-popups": "0.13.7",
|
|
16
|
+
"@vuu-ui/vuu-table": "0.13.7",
|
|
17
|
+
"@vuu-ui/vuu-utils": "0.13.7",
|
|
18
18
|
"@salt-ds/core": "1.43.0",
|
|
19
19
|
"@salt-ds/icons": "1.13.2",
|
|
20
20
|
"@salt-ds/styles": "0.2.1",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@internationalized/date": "^3.0.0",
|
|
26
|
-
"@dnd-kit/react": "^0.1.19",
|
|
27
26
|
"@floating-ui/react": "^0.26.28",
|
|
28
27
|
"clsx": "^2.0.0",
|
|
29
28
|
"react": "^19.1.0",
|