@vuu-ui/vuu-layout 0.8.37 → 0.8.38
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/cjs/flexbox/Flexbox.css.js +6 -0
- package/cjs/flexbox/Flexbox.css.js.map +1 -0
- package/cjs/flexbox/Flexbox.js +9 -0
- package/cjs/flexbox/Flexbox.js.map +1 -1
- package/cjs/flexbox/Splitter.css.js +6 -0
- package/cjs/flexbox/Splitter.css.js.map +1 -0
- package/cjs/flexbox/Splitter.js +9 -0
- package/cjs/flexbox/Splitter.js.map +1 -1
- package/cjs/layout-view/View.css.js +6 -0
- package/cjs/layout-view/View.css.js.map +1 -0
- package/cjs/layout-view/View.js +9 -0
- package/cjs/layout-view/View.js.map +1 -1
- package/esm/flexbox/Flexbox.css.js +4 -0
- package/esm/flexbox/Flexbox.css.js.map +1 -0
- package/esm/flexbox/Flexbox.js +9 -0
- package/esm/flexbox/Flexbox.js.map +1 -1
- package/esm/flexbox/Splitter.css.js +4 -0
- package/esm/flexbox/Splitter.css.js.map +1 -0
- package/esm/flexbox/Splitter.js +9 -0
- package/esm/flexbox/Splitter.js.map +1 -1
- package/esm/layout-view/View.css.js +4 -0
- package/esm/layout-view/View.css.js.map +1 -0
- package/esm/layout-view/View.js +9 -0
- package/esm/layout-view/View.js.map +1 -1
- package/package.json +10 -8
- package/types/flexbox/Flexbox.d.ts +0 -1
- package/types/flexbox/Splitter.d.ts +0 -1
- package/types/layout-view/View.d.ts +0 -1
- package/cjs/flexbox/Flexbox.css +0 -45
- package/cjs/flexbox/Splitter.css +0 -148
- package/cjs/layout-view/View.css +0 -62
- package/esm/flexbox/Flexbox.css +0 -45
- package/esm/flexbox/Splitter.css +0 -148
- package/esm/layout-view/View.css +0 -62
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var flexboxCss = ":root {\n --hw-space-unit: 4px;\n --hw-flex-gap: 3;\n --hw-fluid-grid-col-bg: rgba(200, 200, 200, 0.3);\n}\n\n.hwFlexbox {\n background-color: var(--container1-background);\n box-sizing: border-box;\n display: flex;\n gap: calc(var(--spacing) * var(--space));\n min-height: 0;\n min-width: 0;\n overflow: hidden;\n}\n\n.hwFlexbox-column {\n flex-direction: column;\n}\n\n.hwFlexbox-row {\n flex-direction: row;\n}\n\n.hwFlexbox > .Splitter {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n}\n\n.hwFlexbox.full-page {\n height: 100vh;\n width: 100vw;\n}\n\n.flex-fill {\n border-color: red;\n flex: 0;\n flex-grow: 1;\n flex-shrink: 1;\n}\n\n.vuuView.flex-fill {\n border-color: red;\n}\n";
|
|
4
|
+
|
|
5
|
+
module.exports = flexboxCss;
|
|
6
|
+
//# sourceMappingURL=Flexbox.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flexbox.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/cjs/flexbox/Flexbox.js
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var core = require('@salt-ds/core');
|
|
5
|
+
var styles = require('@salt-ds/styles');
|
|
6
|
+
var window = require('@salt-ds/window');
|
|
5
7
|
var cx = require('clsx');
|
|
6
8
|
var React = require('react');
|
|
7
9
|
var useSplitterResizing = require('./useSplitterResizing.js');
|
|
10
|
+
var Flexbox$1 = require('./Flexbox.css.js');
|
|
8
11
|
|
|
9
12
|
const classBase = "hwFlexbox";
|
|
10
13
|
const Flexbox = React.forwardRef(function Flexbox2(props, ref) {
|
|
@@ -26,6 +29,12 @@ const Flexbox = React.forwardRef(function Flexbox2(props, ref) {
|
|
|
26
29
|
style,
|
|
27
30
|
...rest
|
|
28
31
|
} = props;
|
|
32
|
+
const targetWindow = window.useWindow();
|
|
33
|
+
styles.useComponentCssInjection({
|
|
34
|
+
testId: "vuu-flexbox",
|
|
35
|
+
css: Flexbox$1,
|
|
36
|
+
window: targetWindow
|
|
37
|
+
});
|
|
29
38
|
const { content, rootRef } = useSplitterResizing.useSplitterResizing({
|
|
30
39
|
children,
|
|
31
40
|
// cols: colsProp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flexbox.js","sources":["../../src/flexbox/Flexbox.tsx"],"sourcesContent":["import { useForkRef } from \"@salt-ds/core\";\nimport cx from \"clsx\";\nimport { CSSProperties, ForwardedRef, forwardRef } from \"react\";\nimport { FlexboxProps } from \"./flexboxTypes\";\nimport { useSplitterResizing } from \"./useSplitterResizing\";\n\nimport \"./Flexbox.css\";\n\nconst classBase = \"hwFlexbox\";\n\nconst Flexbox = forwardRef(function Flexbox(\n props: FlexboxProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n const {\n breakPoints,\n children,\n // cols: colsProp,\n column,\n className: classNameProp,\n flexFill,\n gap,\n fullPage,\n id,\n onSplitterMoved,\n resizeable,\n row,\n spacing,\n splitterSize,\n style,\n ...rest\n } = props;\n\n const { content, rootRef } = useSplitterResizing({\n children,\n // cols: colsProp,\n onSplitterMoved,\n style,\n });\n\n const className = cx(classBase, classNameProp, {\n [`${classBase}-column`]: column,\n [`${classBase}-row`]: row,\n \"flex-fill\": flexFill,\n \"full-page\": fullPage,\n });\n\n return (\n <div\n {...rest}\n className={className}\n // data-cols={cols}\n data-resizeable={resizeable || undefined}\n id={id}\n ref={useForkRef(rootRef, ref)}\n style={\n {\n ...style,\n gap,\n \"--spacing\": spacing,\n } as CSSProperties\n }\n >\n {content}\n </div>\n );\n});\nFlexbox.displayName = \"Flexbox\";\n\nexport default Flexbox;\n"],"names":["forwardRef","Flexbox","useSplitterResizing","jsx","useForkRef"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Flexbox.js","sources":["../../src/flexbox/Flexbox.tsx"],"sourcesContent":["import { useForkRef } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport { CSSProperties, ForwardedRef, forwardRef } from \"react\";\nimport { FlexboxProps } from \"./flexboxTypes\";\nimport { useSplitterResizing } from \"./useSplitterResizing\";\n\nimport flexboxCss from \"./Flexbox.css\";\n\nconst classBase = \"hwFlexbox\";\n\nconst Flexbox = forwardRef(function Flexbox(\n props: FlexboxProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n const {\n breakPoints,\n children,\n // cols: colsProp,\n column,\n className: classNameProp,\n flexFill,\n gap,\n fullPage,\n id,\n onSplitterMoved,\n resizeable,\n row,\n spacing,\n splitterSize,\n style,\n ...rest\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-flexbox\",\n css: flexboxCss,\n window: targetWindow,\n });\n\n const { content, rootRef } = useSplitterResizing({\n children,\n // cols: colsProp,\n onSplitterMoved,\n style,\n });\n\n const className = cx(classBase, classNameProp, {\n [`${classBase}-column`]: column,\n [`${classBase}-row`]: row,\n \"flex-fill\": flexFill,\n \"full-page\": fullPage,\n });\n\n return (\n <div\n {...rest}\n className={className}\n // data-cols={cols}\n data-resizeable={resizeable || undefined}\n id={id}\n ref={useForkRef(rootRef, ref)}\n style={\n {\n ...style,\n gap,\n \"--spacing\": spacing,\n } as CSSProperties\n }\n >\n {content}\n </div>\n );\n});\nFlexbox.displayName = \"Flexbox\";\n\nexport default Flexbox;\n"],"names":["forwardRef","Flexbox","useWindow","useComponentCssInjection","flexboxCss","useSplitterResizing","jsx","useForkRef"],"mappings":";;;;;;;;;;;AAUA,MAAM,SAAY,GAAA,WAAA,CAAA;AAElB,MAAM,OAAU,GAAAA,gBAAA,CAAW,SAASC,QAAAA,CAClC,OACA,GACA,EAAA;AACA,EAAM,MAAA;AAAA,IACJ,WAAA;AAAA,IACA,QAAA;AAAA;AAAA,IAEA,MAAA;AAAA,IACA,SAAW,EAAA,aAAA;AAAA,IACX,QAAA;AAAA,IACA,GAAA;AAAA,IACA,Q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;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var splitterCss = ".vuuSplitter {\n --splitter-background: var(--salt-separable-secondary-borderColor);\n --splitter-borderColor: var(--salt-separable-secondary-borderColor);\n --splitter-borderStyle: none;\n --splitter-borderWidth: 0;\n --splitter-size: 3px;\n\n align-items: center;\n background-color: var(--splitter-background);\n border-color: var(--splitter-borderColor);\n border-style: var(--splitter-borderStyle);\n border-width: var(--splitter-borderWidth);\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n position: relative;\n outline: none;\n z-index: 1;\n}\n\n.vuuSplitter:hover {\n --splitter-background: var(--salt-separable-primary-borderColor);\n}\n\n.vuuSplitter-active {\n --splitter-background: var(--salt-separable-primary-borderColor);\n}\n\n.vuuSplitter-column {\n cursor: ns-resize;\n height: var(--splitter-size);\n}\n\n.vuuSplitter:not(.vuuSplitter-column) {\n cursor: ew-resize;\n width: var(--splitter-size);\n}\n\n.vuuSplitter:before {\n border: none;\n border-radius: 0;\n content: '';\n display: block;\n padding: 0;\n}\n\n.vuuSplitter-grab-zone {\n position: absolute;\n background-color: rgba(255, 0, 0, 0.01);\n cursor: inherit;\n}\n\n.vuuSplitter-column .vuuSplitter-grab-zone {\n left: 0;\n right: 0;\n top: -5px;\n bottom: -5px;\n}\n\n.vuuSplitter:not(.vuuSplitter-column) .vuuSplitter-grab-zone {\n left: -5px;\n right: -5px;\n top: 0;\n bottom: 0;\n}\n\n.vuuSplitter-active:not(.vuuSplitter-column) .vuuSplitter-grab-zone {\n background-color: rgba(255,255,255,.05);\n left: -150px;\n right: -150px;\n}\n\n\n.vuuSplitter:not(.vuuSplitter-column):before {\n width: 1px;\n height: 10px;\n background: linear-gradient(\n to bottom,\n var(--grey900) 10%,\n transparent 10%,\n transparent 30%,\n var(--grey900) 30%,\n var(--grey900) 40%,\n transparent 40%,\n transparent 60%,\n var(--grey900) 60%,\n var(--grey900) 70%,\n transparent 70%,\n transparent 90%,\n var(--grey900) 90%\n );\n}\n\n.vuuSplitter-active.vuuSplitter-column:before {\n background: linear-gradient(\n to right,\n #ffffff 10%,\n transparent 10%,\n transparent 30%,\n #ffffff 30%,\n #ffffff 40%,\n transparent 40%,\n transparent 60%,\n #ffffff 60%,\n #ffffff 70%,\n transparent 70%,\n transparent 90%,\n #ffffff 90%\n );\n}\n\n.vuuSplitter-active:not(.vuuSplitter-column):before {\n background: linear-gradient(\n to bottom,\n #ffffff 10%,\n transparent 10%,\n transparent 30%,\n #ffffff 30%,\n #ffffff 40%,\n transparent 40%,\n transparent 60%,\n #ffffff 60%,\n #ffffff 70%,\n transparent 70%,\n transparent 90%,\n #ffffff 90%\n );\n}\n\n.vuuSplitter-column:before {\n width: 10px;\n height: 1px;\n background: linear-gradient(\n to right,\n var(--grey900) 10%,\n transparent 10%,\n transparent 30%,\n var(--grey900) 30%,\n var(--grey900) 40%,\n transparent 40%,\n transparent 60%,\n var(--grey900) 60%,\n var(--grey900) 70%,\n transparent 70%,\n transparent 90%,\n var(--grey900) 90%\n );\n}\n";
|
|
4
|
+
|
|
5
|
+
module.exports = splitterCss;
|
|
6
|
+
//# sourceMappingURL=Splitter.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Splitter.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/cjs/flexbox/Splitter.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var styles = require('@salt-ds/styles');
|
|
5
|
+
var window$1 = require('@salt-ds/window');
|
|
4
6
|
var cx = require('clsx');
|
|
5
7
|
var React = require('react');
|
|
8
|
+
var Splitter$1 = require('./Splitter.css.js');
|
|
6
9
|
|
|
7
10
|
const classBase = "vuuSplitter";
|
|
8
11
|
const Splitter = React.memo(function Splitter2({
|
|
@@ -13,6 +16,12 @@ const Splitter = React.memo(function Splitter2({
|
|
|
13
16
|
onDragStart,
|
|
14
17
|
style
|
|
15
18
|
}) {
|
|
19
|
+
const targetWindow = window$1.useWindow();
|
|
20
|
+
styles.useComponentCssInjection({
|
|
21
|
+
testId: "vuu-splitter",
|
|
22
|
+
css: Splitter$1,
|
|
23
|
+
window: targetWindow
|
|
24
|
+
});
|
|
16
25
|
const ignoreClick = React.useRef();
|
|
17
26
|
const rootRef = React.useRef(null);
|
|
18
27
|
const lastPos = React.useRef(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Splitter.js","sources":["../../src/flexbox/Splitter.tsx"],"sourcesContent":["import cx from \"clsx\";\nimport React, {\n HTMLAttributes,\n KeyboardEvent,\n useCallback,\n useRef,\n useState,\n} from \"react\";\n\nimport \"./Splitter.css\";\n\nconst classBase = \"vuuSplitter\";\n\nexport type SplitterDragStartHandler = (index: number) => void;\nexport type SplitterDragHandler = (index: number, distance: number) => void;\nexport type SplitterDragEndHandler = () => void;\n\nexport interface SplitterProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onDrag\" | \"onDragStart\"> {\n //TODO change to alignment (vertical | horizontal)\n column: boolean;\n index: number;\n onDragStart: SplitterDragStartHandler;\n onDrag: SplitterDragHandler;\n onDragEnd: SplitterDragEndHandler;\n}\n\nexport const Splitter = React.memo(function Splitter({\n column,\n index,\n onDrag,\n onDragEnd,\n onDragStart,\n style,\n}: SplitterProps) {\n const ignoreClick = useRef<boolean>();\n const rootRef = useRef<HTMLDivElement>(null);\n const lastPos = useRef<number>(0);\n\n const [active, setActive] = useState(false);\n\n const handleKeyDownDrag = useCallback(\n ({ key, shiftKey }) => {\n const distance = shiftKey ? 10 : 1;\n if (column && key === \"ArrowDown\") {\n onDrag(index, distance);\n } else if (column && key === \"ArrowUp\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowLeft\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowRight\") {\n onDrag(index, distance);\n }\n },\n [column, index, onDrag]\n );\n\n const handleKeyDownInitDrag = useCallback(\n (evt) => {\n const { key } = evt;\n const horizontalMove = key === \"ArrowLeft\" || key === \"ArrowRight\";\n const verticalMove = key === \"ArrowUp\" || key === \"ArrowDown\";\n if ((column && verticalMove) || (!column && horizontalMove)) {\n onDragStart(index);\n handleKeyDownDrag(evt);\n keyDownHandlerRef.current = handleKeyDownDrag;\n }\n },\n [column, handleKeyDownDrag, index, onDragStart]\n );\n\n const keyDownHandlerRef = useRef(handleKeyDownInitDrag);\n const handleKeyDown = (evt: KeyboardEvent) => keyDownHandlerRef.current(evt);\n\n const handleMouseMove = useCallback(\n (e) => {\n ignoreClick.current = true;\n const pos = e[column ? \"clientY\" : \"clientX\"];\n const diff = pos - lastPos.current;\n if (pos && pos !== lastPos.current) {\n onDrag(index, diff);\n }\n lastPos.current = pos;\n },\n [column, index, onDrag]\n );\n\n const handleMouseUp = useCallback(() => {\n window.removeEventListener(\"mousemove\", handleMouseMove, false);\n window.removeEventListener(\"mouseup\", handleMouseUp, false);\n onDragEnd();\n setActive(false);\n rootRef.current?.focus();\n }, [handleMouseMove, onDragEnd, setActive]);\n\n const handleMouseDown = useCallback(\n (e) => {\n lastPos.current = column ? e.clientY : e.clientX;\n onDragStart(index);\n window.addEventListener(\"mousemove\", handleMouseMove, false);\n window.addEventListener(\"mouseup\", handleMouseUp, false);\n e.preventDefault();\n setActive(true);\n },\n [column, handleMouseMove, handleMouseUp, index, onDragStart, setActive]\n );\n\n const handleClick = () => {\n if (ignoreClick.current) {\n ignoreClick.current = false;\n } else {\n rootRef.current?.focus();\n }\n };\n\n const handleBlur = () => {\n keyDownHandlerRef.current = handleKeyDownInitDrag;\n };\n\n const className = cx(classBase, {\n [`${classBase}-active`]: active,\n [`${classBase}-column`]: column,\n });\n return (\n <div\n className={className}\n data-splitter\n ref={rootRef}\n role=\"separator\"\n style={style}\n onBlur={handleBlur}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n tabIndex={0}\n >\n <div className={`${classBase}-grab-zone`} />\n </div>\n );\n});\n"],"names":["Splitter","useRef","useState","useCallback","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Splitter.js","sources":["../../src/flexbox/Splitter.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport React, {\n HTMLAttributes,\n KeyboardEvent,\n useCallback,\n useRef,\n useState,\n} from \"react\";\n\nimport splitterCss from \"./Splitter.css\";\n\nconst classBase = \"vuuSplitter\";\n\nexport type SplitterDragStartHandler = (index: number) => void;\nexport type SplitterDragHandler = (index: number, distance: number) => void;\nexport type SplitterDragEndHandler = () => void;\n\nexport interface SplitterProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onDrag\" | \"onDragStart\"> {\n //TODO change to alignment (vertical | horizontal)\n column: boolean;\n index: number;\n onDragStart: SplitterDragStartHandler;\n onDrag: SplitterDragHandler;\n onDragEnd: SplitterDragEndHandler;\n}\n\nexport const Splitter = React.memo(function Splitter({\n column,\n index,\n onDrag,\n onDragEnd,\n onDragStart,\n style,\n}: SplitterProps) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-splitter\",\n css: splitterCss,\n window: targetWindow,\n });\n\n const ignoreClick = useRef<boolean>();\n const rootRef = useRef<HTMLDivElement>(null);\n const lastPos = useRef<number>(0);\n\n const [active, setActive] = useState(false);\n\n const handleKeyDownDrag = useCallback(\n ({ key, shiftKey }) => {\n const distance = shiftKey ? 10 : 1;\n if (column && key === \"ArrowDown\") {\n onDrag(index, distance);\n } else if (column && key === \"ArrowUp\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowLeft\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowRight\") {\n onDrag(index, distance);\n }\n },\n [column, index, onDrag]\n );\n\n const handleKeyDownInitDrag = useCallback(\n (evt) => {\n const { key } = evt;\n const horizontalMove = key === \"ArrowLeft\" || key === \"ArrowRight\";\n const verticalMove = key === \"ArrowUp\" || key === \"ArrowDown\";\n if ((column && verticalMove) || (!column && horizontalMove)) {\n onDragStart(index);\n handleKeyDownDrag(evt);\n keyDownHandlerRef.current = handleKeyDownDrag;\n }\n },\n [column, handleKeyDownDrag, index, onDragStart]\n );\n\n const keyDownHandlerRef = useRef(handleKeyDownInitDrag);\n const handleKeyDown = (evt: KeyboardEvent) => keyDownHandlerRef.current(evt);\n\n const handleMouseMove = useCallback(\n (e) => {\n ignoreClick.current = true;\n const pos = e[column ? \"clientY\" : \"clientX\"];\n const diff = pos - lastPos.current;\n if (pos && pos !== lastPos.current) {\n onDrag(index, diff);\n }\n lastPos.current = pos;\n },\n [column, index, onDrag]\n );\n\n const handleMouseUp = useCallback(() => {\n window.removeEventListener(\"mousemove\", handleMouseMove, false);\n window.removeEventListener(\"mouseup\", handleMouseUp, false);\n onDragEnd();\n setActive(false);\n rootRef.current?.focus();\n }, [handleMouseMove, onDragEnd, setActive]);\n\n const handleMouseDown = useCallback(\n (e) => {\n lastPos.current = column ? e.clientY : e.clientX;\n onDragStart(index);\n window.addEventListener(\"mousemove\", handleMouseMove, false);\n window.addEventListener(\"mouseup\", handleMouseUp, false);\n e.preventDefault();\n setActive(true);\n },\n [column, handleMouseMove, handleMouseUp, index, onDragStart, setActive]\n );\n\n const handleClick = () => {\n if (ignoreClick.current) {\n ignoreClick.current = false;\n } else {\n rootRef.current?.focus();\n }\n };\n\n const handleBlur = () => {\n keyDownHandlerRef.current = handleKeyDownInitDrag;\n };\n\n const className = cx(classBase, {\n [`${classBase}-active`]: active,\n [`${classBase}-column`]: column,\n });\n return (\n <div\n className={className}\n data-splitter\n ref={rootRef}\n role=\"separator\"\n style={style}\n onBlur={handleBlur}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n tabIndex={0}\n >\n <div className={`${classBase}-grab-zone`} />\n </div>\n );\n});\n"],"names":["Splitter","useWindow","useComponentCssInjection","splitterCss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;AACxB,IAAA,IAAI,YAAY,OAAS,EAAA;AACvB,MAAA,WAAA,CAAY,OAAU,GAAA,KAAA,CAAA;AAAA,KACjB,MAAA;AACL,MAAA,OAAA,CAAQ,SAAS,KAAM,EAAA,CAAA;AAAA,KACzB;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,iBAAA,CAAkB,OAAU,GAAA,qBAAA,CAAA;AAAA,GAC9B,CAAA;AAEA,EAAM,MAAA,SAAA,GAAY,GAAG,SAAW,EAAA;AAAA,IAC9B,CAAC,CAAA,EAAG,SAAS,CAAA,OAAA,CAAS,GAAG,MAAA;AAAA,IACzB,CAAC,CAAA,EAAG,SAAS,CAAA,OAAA,CAAS,GAAG,MAAA;AAAA,GAC1B,CAAA,CAAA;AACD,EACE,uBAAAC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,eAAa,EAAA,IAAA;AAAA,MACb,GAAK,EAAA,OAAA;AAAA,MACL,IAAK,EAAA,WAAA;AAAA,MACL,KAAA;AAAA,MACA,MAAQ,EAAA,UAAA;AAAA,MACR,OAAS,EAAA,WAAA;AAAA,MACT,SAAW,EAAA,aAAA;AAAA,MACX,WAAa,EAAA,eAAA;AAAA,MACb,QAAU,EAAA,CAAA;AAAA,MAEV,QAAC,kBAAAA,cAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,CAAA,EAAG,SAAS,CAAc,UAAA,CAAA,EAAA,CAAA;AAAA,KAAA;AAAA,GAC5C,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var viewCss = ".vuuView {\n border-color: var(--vuuView-borderColor, var(--salt-container-primary-borderColor));\n border-width: var(--vuuView-borderWidth, 1px);\n border-style: var(--vuuView-borderStyle, none);\n\n display: flex;\n flex-direction: column;\n margin: var(--vuuView-margin, 0px);\n min-height: 50px;\n min-width: 50px;\n outline: none;\n overflow: hidden;\n position: relative;\n}\n\n.vuuView.focus-visible:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: dotted cornflowerblue 2px;\n}\n\n.vuuView.dragging {\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n}\n\n.vuuView-main {\n /* height: var(--view-content-height);\n width: var(--view-content-width); */\n display: flex;\n flex-direction: var(--vuuView-flexDirection, column);\n flex-wrap: var(--vuuView-flex-wrap, nowrap);\n flex: 1;\n justify-content: var(--vuuView-justify, flex-start);\n overflow: hidden;\n position: relative;\n}\n\n.vuuView-main > * {\n flex-basis: auto;\n flex-grow: var(--vuuView-flex-grow, 1);\n flex-shrink: var(--vuuView-flex-shrink, 1);\n}\n\n.vuuView-collapsed .vuuView-main {\n display: none;\n}\n\n.vuuView-collapsed + .Splitter {\n display: none;\n}\n\n.vuuView-collapsed .Toolbar-vertical {\n border-right: solid 1px var(--grey40);\n}\n\n.vuuView-collapsed .Toolbar-vertical .toolbar-title {\n display: none;\n}\n";
|
|
4
|
+
|
|
5
|
+
module.exports = viewCss;
|
|
6
|
+
//# sourceMappingURL=View.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"View.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/cjs/layout-view/View.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
5
5
|
var core = require('@salt-ds/core');
|
|
6
|
+
var styles = require('@salt-ds/styles');
|
|
7
|
+
var window = require('@salt-ds/window');
|
|
6
8
|
var cx = require('clsx');
|
|
7
9
|
var React = require('react');
|
|
8
10
|
var Header = require('../layout-header/Header.js');
|
|
@@ -13,6 +15,7 @@ require('../layout-provider/LayoutProviderContext.js');
|
|
|
13
15
|
require('../drag-drop/Draggable.js');
|
|
14
16
|
require('../drag-drop/BoxModel.js');
|
|
15
17
|
var ViewContext = require('../layout-view-actions/ViewContext.js');
|
|
18
|
+
var View$1 = require('./View.css.js');
|
|
16
19
|
|
|
17
20
|
const classBase = "vuuView";
|
|
18
21
|
const getProps = (state, props) => {
|
|
@@ -47,6 +50,12 @@ const View = React.forwardRef(function View2(props, forwardedRef) {
|
|
|
47
50
|
title: titleProp,
|
|
48
51
|
...restProps
|
|
49
52
|
} = props;
|
|
53
|
+
const targetWindow = window.useWindow();
|
|
54
|
+
styles.useComponentCssInjection({
|
|
55
|
+
testId: "vuu-view",
|
|
56
|
+
css: View$1,
|
|
57
|
+
window: targetWindow
|
|
58
|
+
});
|
|
50
59
|
const id = vuuUtils.useId(idProp);
|
|
51
60
|
const rootRef = React.useRef(null);
|
|
52
61
|
const mainRef = React.useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.js","sources":["../../src/layout-view/View.tsx"],"sourcesContent":["import { useId } from \"@vuu-ui/vuu-utils\";\nimport { useForkRef } from \"@salt-ds/core\";\nimport cx from \"clsx\";\nimport React, {\n ForwardedRef,\n forwardRef,\n ReactElement,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Header as VuuHeader } from \"../layout-header/Header\";\nimport { registerComponent } from \"../registry/ComponentRegistry\";\nimport { useView } from \"./useView\";\nimport { useViewResize } from \"./useViewResize\";\nimport { ViewContext, ViewContextAPI } from \"../layout-view-actions\";\nimport { ViewProps } from \"./viewTypes\";\n\nimport \"./View.css\";\n\nconst classBase = \"vuuView\";\n\ntype Props = { [key: string]: unknown };\n\nconst getProps = (state?: Props, props?: Props) => {\n if (state && props) {\n return {\n ...state,\n ...props,\n };\n } else return state || props;\n};\n\n/**\n * View is the leaf-level entity managed by the Vuu layout system. It may represent a component\n * or a group of components. It also offers an API (via useViewContext) for persistence.\n */\nconst View = forwardRef(function View(\n props: ViewProps,\n forwardedRef: ForwardedRef<HTMLDivElement>\n) {\n const {\n Header = VuuHeader,\n children,\n className,\n collapsed,\n closeable,\n \"data-path\": dataPath,\n \"data-resizeable\": dataResizeable,\n dropTargets,\n expanded,\n flexFill,\n id: idProp,\n header,\n orientation = \"horizontal\",\n path = dataPath,\n resize = \"responsive\",\n resizeable = dataResizeable,\n tearOut,\n style = {},\n title: titleProp,\n ...restProps\n } = props;\n\n const id = useId(idProp);\n const rootRef = useRef<HTMLDivElement>(null);\n const mainRef = useRef<HTMLDivElement>(null);\n const [componentProps, _setComponentProps] = useState<Props>();\n const {\n contributions,\n dispatchViewAction,\n load,\n loadSession,\n onConfigChange,\n onEditTitle,\n purge,\n restoredState,\n save,\n saveSession,\n title,\n } = useView({\n id,\n rootRef,\n path,\n dropTargets,\n title: titleProp,\n });\n\n useViewResize({ mainRef, resize, rootRef });\n\n const setComponentProps = useCallback((props?: Props) => {\n _setComponentProps(props);\n }, []);\n\n const getContent = () => {\n if (React.isValidElement(children) && (restoredState || componentProps)) {\n return React.cloneElement(\n children,\n getProps(restoredState, componentProps)\n );\n }\n return children;\n };\n\n const viewContextValue: ViewContextAPI = useMemo(\n () => ({\n dispatch: dispatchViewAction,\n id,\n path,\n title,\n load,\n loadSession,\n onConfigChange,\n purge,\n save,\n saveSession,\n setComponentProps,\n }),\n [\n dispatchViewAction,\n id,\n load,\n loadSession,\n onConfigChange,\n path,\n purge,\n save,\n saveSession,\n setComponentProps,\n title,\n ]\n );\n\n const headerProps = typeof header === \"object\" ? header : {};\n\n return (\n <div\n {...restProps}\n className={cx(classBase, className, {\n [`${classBase}-collapsed`]: collapsed,\n [`${classBase}-expanded`]: expanded,\n [`${classBase}-resize-defer`]: resize === \"defer\",\n })}\n data-resizeable={resizeable}\n id={id}\n ref={useForkRef(forwardedRef, rootRef)}\n style={style}\n tabIndex={-1}\n >\n <ViewContext.Provider value={viewContextValue}>\n {header ? (\n <Header\n {...headerProps}\n collapsed={collapsed}\n contributions={contributions}\n expanded={expanded}\n closeable={closeable}\n onEditTitle={onEditTitle}\n orientation={orientation}\n tearOut={tearOut}\n title={title}\n />\n ) : null}\n <div className={`${classBase}-main`} ref={mainRef}>\n {getContent()}\n </div>\n </ViewContext.Provider>\n </div>\n );\n});\nView.displayName = \"View\";\n\ninterface ViewComponentType {\n (\n props: ViewProps & {\n ref?: ForwardedRef<HTMLDivElement>;\n }\n ): ReactElement<ViewProps>;\n displayName?: string;\n}\n\nconst MemoView = React.memo(View) as ViewComponentType;\n\nMemoView.displayName = \"View\";\n\nregisterComponent(\"View\", MemoView, \"view\");\n\nexport { MemoView as View };\n"],"names":["forwardRef","View","Header","VuuHeader","useId","useRef","useState","useView","useViewResize","useCallback","props","useMemo","jsx","useForkRef","jsxs","ViewContext","registerComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"View.js","sources":["../../src/layout-view/View.tsx"],"sourcesContent":["import { useId } from \"@vuu-ui/vuu-utils\";\nimport { useForkRef } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport React, {\n ForwardedRef,\n forwardRef,\n ReactElement,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Header as VuuHeader } from \"../layout-header/Header\";\nimport { registerComponent } from \"../registry/ComponentRegistry\";\nimport { useView } from \"./useView\";\nimport { useViewResize } from \"./useViewResize\";\nimport { ViewContext, ViewContextAPI } from \"../layout-view-actions\";\nimport { ViewProps } from \"./viewTypes\";\n\nimport viewCss from \"./View.css\";\n\nconst classBase = \"vuuView\";\n\ntype Props = { [key: string]: unknown };\n\nconst getProps = (state?: Props, props?: Props) => {\n if (state && props) {\n return {\n ...state,\n ...props,\n };\n } else return state || props;\n};\n\n/**\n * View is the leaf-level entity managed by the Vuu layout system. It may represent a component\n * or a group of components. It also offers an API (via useViewContext) for persistence.\n */\nconst View = forwardRef(function View(\n props: ViewProps,\n forwardedRef: ForwardedRef<HTMLDivElement>\n) {\n const {\n Header = VuuHeader,\n children,\n className,\n collapsed,\n closeable,\n \"data-path\": dataPath,\n \"data-resizeable\": dataResizeable,\n dropTargets,\n expanded,\n flexFill,\n id: idProp,\n header,\n orientation = \"horizontal\",\n path = dataPath,\n resize = \"responsive\",\n resizeable = dataResizeable,\n tearOut,\n style = {},\n title: titleProp,\n ...restProps\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-view\",\n css: viewCss,\n window: targetWindow,\n });\n\n const id = useId(idProp);\n const rootRef = useRef<HTMLDivElement>(null);\n const mainRef = useRef<HTMLDivElement>(null);\n const [componentProps, _setComponentProps] = useState<Props>();\n const {\n contributions,\n dispatchViewAction,\n load,\n loadSession,\n onConfigChange,\n onEditTitle,\n purge,\n restoredState,\n save,\n saveSession,\n title,\n } = useView({\n id,\n rootRef,\n path,\n dropTargets,\n title: titleProp,\n });\n\n useViewResize({ mainRef, resize, rootRef });\n\n const setComponentProps = useCallback((props?: Props) => {\n _setComponentProps(props);\n }, []);\n\n const getContent = () => {\n if (React.isValidElement(children) && (restoredState || componentProps)) {\n return React.cloneElement(\n children,\n getProps(restoredState, componentProps)\n );\n }\n return children;\n };\n\n const viewContextValue: ViewContextAPI = useMemo(\n () => ({\n dispatch: dispatchViewAction,\n id,\n path,\n title,\n load,\n loadSession,\n onConfigChange,\n purge,\n save,\n saveSession,\n setComponentProps,\n }),\n [\n dispatchViewAction,\n id,\n load,\n loadSession,\n onConfigChange,\n path,\n purge,\n save,\n saveSession,\n setComponentProps,\n title,\n ]\n );\n\n const headerProps = typeof header === \"object\" ? header : {};\n\n return (\n <div\n {...restProps}\n className={cx(classBase, className, {\n [`${classBase}-collapsed`]: collapsed,\n [`${classBase}-expanded`]: expanded,\n [`${classBase}-resize-defer`]: resize === \"defer\",\n })}\n data-resizeable={resizeable}\n id={id}\n ref={useForkRef(forwardedRef, rootRef)}\n style={style}\n tabIndex={-1}\n >\n <ViewContext.Provider value={viewContextValue}>\n {header ? (\n <Header\n {...headerProps}\n collapsed={collapsed}\n contributions={contributions}\n expanded={expanded}\n closeable={closeable}\n onEditTitle={onEditTitle}\n orientation={orientation}\n tearOut={tearOut}\n title={title}\n />\n ) : null}\n <div className={`${classBase}-main`} ref={mainRef}>\n {getContent()}\n </div>\n </ViewContext.Provider>\n </div>\n );\n});\nView.displayName = \"View\";\n\ninterface ViewComponentType {\n (\n props: ViewProps & {\n ref?: ForwardedRef<HTMLDivElement>;\n }\n ): ReactElement<ViewProps>;\n displayName?: string;\n}\n\nconst MemoView = React.memo(View) as ViewComponentType;\n\nMemoView.displayName = \"View\";\n\nregisterComponent(\"View\", MemoView, \"view\");\n\nexport { MemoView as View };\n"],"names":["forwardRef","View","Header","VuuHeader","useWindow","useComponentCssInjection","viewCss","useId","useRef","useState","useView","useViewResize","useCallback","props","useMemo","jsx","useForkRef","jsxs","ViewContext","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,MAAM,SAAY,GAAA,SAAA,CAAA;AAIlB,MAAM,QAAA,GAAW,CAAC,KAAA,EAAe,KAAkB,KAAA;AACjD,EAAA,IAAI,SAAS,KAAO,EAAA;AAClB,IAAO,OAAA;AAAA,MACL,GAAG,KAAA;AAAA,MACH,GAAG,KAAA;AAAA,KACL,CAAA;AAAA,GACF;AAAO,IAAA,OAAO,KAAS,IAAA,KAAA,CAAA;AACzB,CAAA,CAAA;AAMA,MAAM,IAAO,GAAAA,gBAAA,CAAW,SAASC,KAAAA,CAC/B,OACA,YACA,EAAA;AACA,EAAM,MAAA;AAAA,YACJC,QAAS,GAAAC,aAAA;AAAA,IACT,QAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAa,EAAA,QAAA;AAAA,IACb,iBAAmB,EAAA,cAAA;AAAA,IACnB,WAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,EAAI,EAAA,MAAA;AAAA,IACJ,MAAA;AAAA,IACA,WAAc,GAAA,YAAA;AAAA,IACd,IAAO,GAAA,QAAA;AA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;AAAA,MACjB,EAAA;AAAA,MACA,GAAA,EAAKC,eAAW,CAAA,YAAA,EAAc,OAAO,CAAA;AAAA,MACrC,KAAA;AAAA,MACA,QAAU,EAAA,CAAA,CAAA;AAAA,MAEV,QAAC,kBAAAC,eAAA,CAAAC,uBAAA,CAAY,QAAZ,EAAA,EAAqB,OAAO,gBAC1B,EAAA,QAAA,EAAA;AAAA,QACC,MAAA,mBAAAH,cAAA;AAAA,UAACb,QAAA;AAAA,UAAA;AAAA,YACE,GAAG,WAAA;AAAA,YACJ,SAAA;AAAA,YACA,aAAA;AAAA,YACA,QAAA;AAAA,YACA,SAAA;AAAA,YACA,WAAA;AAAA,YACA,WAAA;AAAA,YACA,OAAA;AAAA,YACA,KAAA;AAAA,WAAA;AAAA,SAEA,GAAA,IAAA;AAAA,wBACJa,cAAA,CAAC,SAAI,SAAW,EAAA,CAAA,EAAG,SAAS,CAAS,KAAA,CAAA,EAAA,GAAA,EAAK,OACvC,EAAA,QAAA,EAAA,UAAA,EACH,EAAA,CAAA;AAAA,OACF,EAAA,CAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ,CAAC,CAAA,CAAA;AACD,IAAA,CAAK,WAAc,GAAA,MAAA,CAAA;AAWb,MAAA,QAAA,GAAW,KAAM,CAAA,IAAA,CAAK,IAAI,EAAA;AAEhC,QAAA,CAAS,WAAc,GAAA,MAAA,CAAA;AAEvBI,mCAAkB,CAAA,MAAA,EAAQ,UAAU,MAAM,CAAA;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var flexboxCss = ":root {\n --hw-space-unit: 4px;\n --hw-flex-gap: 3;\n --hw-fluid-grid-col-bg: rgba(200, 200, 200, 0.3);\n}\n\n.hwFlexbox {\n background-color: var(--container1-background);\n box-sizing: border-box;\n display: flex;\n gap: calc(var(--spacing) * var(--space));\n min-height: 0;\n min-width: 0;\n overflow: hidden;\n}\n\n.hwFlexbox-column {\n flex-direction: column;\n}\n\n.hwFlexbox-row {\n flex-direction: row;\n}\n\n.hwFlexbox > .Splitter {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n}\n\n.hwFlexbox.full-page {\n height: 100vh;\n width: 100vw;\n}\n\n.flex-fill {\n border-color: red;\n flex: 0;\n flex-grow: 1;\n flex-shrink: 1;\n}\n\n.vuuView.flex-fill {\n border-color: red;\n}\n";
|
|
2
|
+
|
|
3
|
+
export { flexboxCss as default };
|
|
4
|
+
//# sourceMappingURL=Flexbox.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flexbox.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/esm/flexbox/Flexbox.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useForkRef } from '@salt-ds/core';
|
|
3
|
+
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
4
|
+
import { useWindow } from '@salt-ds/window';
|
|
3
5
|
import cx from 'clsx';
|
|
4
6
|
import { forwardRef } from 'react';
|
|
5
7
|
import { useSplitterResizing } from './useSplitterResizing.js';
|
|
8
|
+
import flexboxCss from './Flexbox.css.js';
|
|
6
9
|
|
|
7
10
|
const classBase = "hwFlexbox";
|
|
8
11
|
const Flexbox = forwardRef(function Flexbox2(props, ref) {
|
|
@@ -24,6 +27,12 @@ const Flexbox = forwardRef(function Flexbox2(props, ref) {
|
|
|
24
27
|
style,
|
|
25
28
|
...rest
|
|
26
29
|
} = props;
|
|
30
|
+
const targetWindow = useWindow();
|
|
31
|
+
useComponentCssInjection({
|
|
32
|
+
testId: "vuu-flexbox",
|
|
33
|
+
css: flexboxCss,
|
|
34
|
+
window: targetWindow
|
|
35
|
+
});
|
|
27
36
|
const { content, rootRef } = useSplitterResizing({
|
|
28
37
|
children,
|
|
29
38
|
// cols: colsProp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flexbox.js","sources":["../../src/flexbox/Flexbox.tsx"],"sourcesContent":["import { useForkRef } from \"@salt-ds/core\";\nimport cx from \"clsx\";\nimport { CSSProperties, ForwardedRef, forwardRef } from \"react\";\nimport { FlexboxProps } from \"./flexboxTypes\";\nimport { useSplitterResizing } from \"./useSplitterResizing\";\n\nimport \"./Flexbox.css\";\n\nconst classBase = \"hwFlexbox\";\n\nconst Flexbox = forwardRef(function Flexbox(\n props: FlexboxProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n const {\n breakPoints,\n children,\n // cols: colsProp,\n column,\n className: classNameProp,\n flexFill,\n gap,\n fullPage,\n id,\n onSplitterMoved,\n resizeable,\n row,\n spacing,\n splitterSize,\n style,\n ...rest\n } = props;\n\n const { content, rootRef } = useSplitterResizing({\n children,\n // cols: colsProp,\n onSplitterMoved,\n style,\n });\n\n const className = cx(classBase, classNameProp, {\n [`${classBase}-column`]: column,\n [`${classBase}-row`]: row,\n \"flex-fill\": flexFill,\n \"full-page\": fullPage,\n });\n\n return (\n <div\n {...rest}\n className={className}\n // data-cols={cols}\n data-resizeable={resizeable || undefined}\n id={id}\n ref={useForkRef(rootRef, ref)}\n style={\n {\n ...style,\n gap,\n \"--spacing\": spacing,\n } as CSSProperties\n }\n >\n {content}\n </div>\n );\n});\nFlexbox.displayName = \"Flexbox\";\n\nexport default Flexbox;\n"],"names":["Flexbox"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Flexbox.js","sources":["../../src/flexbox/Flexbox.tsx"],"sourcesContent":["import { useForkRef } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport { CSSProperties, ForwardedRef, forwardRef } from \"react\";\nimport { FlexboxProps } from \"./flexboxTypes\";\nimport { useSplitterResizing } from \"./useSplitterResizing\";\n\nimport flexboxCss from \"./Flexbox.css\";\n\nconst classBase = \"hwFlexbox\";\n\nconst Flexbox = forwardRef(function Flexbox(\n props: FlexboxProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n const {\n breakPoints,\n children,\n // cols: colsProp,\n column,\n className: classNameProp,\n flexFill,\n gap,\n fullPage,\n id,\n onSplitterMoved,\n resizeable,\n row,\n spacing,\n splitterSize,\n style,\n ...rest\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-flexbox\",\n css: flexboxCss,\n window: targetWindow,\n });\n\n const { content, rootRef } = useSplitterResizing({\n children,\n // cols: colsProp,\n onSplitterMoved,\n style,\n });\n\n const className = cx(classBase, classNameProp, {\n [`${classBase}-column`]: column,\n [`${classBase}-row`]: row,\n \"flex-fill\": flexFill,\n \"full-page\": fullPage,\n });\n\n return (\n <div\n {...rest}\n className={className}\n // data-cols={cols}\n data-resizeable={resizeable || undefined}\n id={id}\n ref={useForkRef(rootRef, ref)}\n style={\n {\n ...style,\n gap,\n \"--spacing\": spacing,\n } as CSSProperties\n }\n >\n {content}\n </div>\n );\n});\nFlexbox.displayName = \"Flexbox\";\n\nexport default Flexbox;\n"],"names":["Flexbox"],"mappings":";;;;;;;;;AAUA,MAAM,SAAY,GAAA,WAAA,CAAA;AAElB,MAAM,OAAU,GAAA,UAAA,CAAW,SAASA,QAAAA,CAClC,OACA,GACA,EAAA;AACA,EAAM,MAAA;AAAA,IACJ,WAAA;AAAA,IACA,QAAA;AAAA;AAAA,IAEA,MAAA;AAAA,IACA,SAAW,EAAA,aAAA;AAAA,IACX,QAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA;AAAA,IACA,EAAA;AAAA,IACA,eAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG,IAAA;AAAA,GACD,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,aAAA;AAAA,IACR,GAAK,EAAA,UAAA;AAAA,IACL,MAAQ,EAAA,YAAA;AAAA,GACT,CAAA,CAAA;AAED,EAAA,MAAM,EAAE,OAAA,EAAS,OAAQ,EAAA,GAAI,mBAAoB,CAAA;AAAA,IAC/C,QAAA;AAAA;AAAA,IAEA,eAAA;AAAA,IACA,KAAA;AAAA,GACD,CAAA,CAAA;AAED,EAAM,MAAA,SAAA,GAAY,EAAG,CAAA,SAAA,EAAW,aAAe,EAAA;AAAA,IAC7C,CAAC,CAAA,EAAG,SAAS,CAAA,OAAA,CAAS,GAAG,MAAA;AAAA,IACzB,CAAC,CAAA,EAAG,SAAS,CAAA,IAAA,CAAM,GAAG,GAAA;AAAA,IACtB,WAAa,EAAA,QAAA;AAAA,IACb,WAAa,EAAA,QAAA;AAAA,GACd,CAAA,CAAA;AAED,EACE,uBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA;AAAA,MAEA,mBAAiB,UAAc,IAAA,KAAA,CAAA;AAAA,MAC/B,EAAA;AAAA,MACA,GAAA,EAAK,UAAW,CAAA,OAAA,EAAS,GAAG,CAAA;AAAA,MAC5B,KACE,EAAA;AAAA,QACE,GAAG,KAAA;AAAA,QACH,GAAA;AAAA,QACA,WAAa,EAAA,OAAA;AAAA,OACf;AAAA,MAGD,QAAA,EAAA,OAAA;AAAA,KAAA;AAAA,GACH,CAAA;AAEJ,CAAC,EAAA;AACD,OAAA,CAAQ,WAAc,GAAA,SAAA;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var splitterCss = ".vuuSplitter {\n --splitter-background: var(--salt-separable-secondary-borderColor);\n --splitter-borderColor: var(--salt-separable-secondary-borderColor);\n --splitter-borderStyle: none;\n --splitter-borderWidth: 0;\n --splitter-size: 3px;\n\n align-items: center;\n background-color: var(--splitter-background);\n border-color: var(--splitter-borderColor);\n border-style: var(--splitter-borderStyle);\n border-width: var(--splitter-borderWidth);\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n position: relative;\n outline: none;\n z-index: 1;\n}\n\n.vuuSplitter:hover {\n --splitter-background: var(--salt-separable-primary-borderColor);\n}\n\n.vuuSplitter-active {\n --splitter-background: var(--salt-separable-primary-borderColor);\n}\n\n.vuuSplitter-column {\n cursor: ns-resize;\n height: var(--splitter-size);\n}\n\n.vuuSplitter:not(.vuuSplitter-column) {\n cursor: ew-resize;\n width: var(--splitter-size);\n}\n\n.vuuSplitter:before {\n border: none;\n border-radius: 0;\n content: '';\n display: block;\n padding: 0;\n}\n\n.vuuSplitter-grab-zone {\n position: absolute;\n background-color: rgba(255, 0, 0, 0.01);\n cursor: inherit;\n}\n\n.vuuSplitter-column .vuuSplitter-grab-zone {\n left: 0;\n right: 0;\n top: -5px;\n bottom: -5px;\n}\n\n.vuuSplitter:not(.vuuSplitter-column) .vuuSplitter-grab-zone {\n left: -5px;\n right: -5px;\n top: 0;\n bottom: 0;\n}\n\n.vuuSplitter-active:not(.vuuSplitter-column) .vuuSplitter-grab-zone {\n background-color: rgba(255,255,255,.05);\n left: -150px;\n right: -150px;\n}\n\n\n.vuuSplitter:not(.vuuSplitter-column):before {\n width: 1px;\n height: 10px;\n background: linear-gradient(\n to bottom,\n var(--grey900) 10%,\n transparent 10%,\n transparent 30%,\n var(--grey900) 30%,\n var(--grey900) 40%,\n transparent 40%,\n transparent 60%,\n var(--grey900) 60%,\n var(--grey900) 70%,\n transparent 70%,\n transparent 90%,\n var(--grey900) 90%\n );\n}\n\n.vuuSplitter-active.vuuSplitter-column:before {\n background: linear-gradient(\n to right,\n #ffffff 10%,\n transparent 10%,\n transparent 30%,\n #ffffff 30%,\n #ffffff 40%,\n transparent 40%,\n transparent 60%,\n #ffffff 60%,\n #ffffff 70%,\n transparent 70%,\n transparent 90%,\n #ffffff 90%\n );\n}\n\n.vuuSplitter-active:not(.vuuSplitter-column):before {\n background: linear-gradient(\n to bottom,\n #ffffff 10%,\n transparent 10%,\n transparent 30%,\n #ffffff 30%,\n #ffffff 40%,\n transparent 40%,\n transparent 60%,\n #ffffff 60%,\n #ffffff 70%,\n transparent 70%,\n transparent 90%,\n #ffffff 90%\n );\n}\n\n.vuuSplitter-column:before {\n width: 10px;\n height: 1px;\n background: linear-gradient(\n to right,\n var(--grey900) 10%,\n transparent 10%,\n transparent 30%,\n var(--grey900) 30%,\n var(--grey900) 40%,\n transparent 40%,\n transparent 60%,\n var(--grey900) 60%,\n var(--grey900) 70%,\n transparent 70%,\n transparent 90%,\n var(--grey900) 90%\n );\n}\n";
|
|
2
|
+
|
|
3
|
+
export { splitterCss as default };
|
|
4
|
+
//# sourceMappingURL=Splitter.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Splitter.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/esm/flexbox/Splitter.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
3
|
+
import { useWindow } from '@salt-ds/window';
|
|
2
4
|
import cx from 'clsx';
|
|
3
5
|
import React, { useRef, useState, useCallback } from 'react';
|
|
6
|
+
import splitterCss from './Splitter.css.js';
|
|
4
7
|
|
|
5
8
|
const classBase = "vuuSplitter";
|
|
6
9
|
const Splitter = React.memo(function Splitter2({
|
|
@@ -11,6 +14,12 @@ const Splitter = React.memo(function Splitter2({
|
|
|
11
14
|
onDragStart,
|
|
12
15
|
style
|
|
13
16
|
}) {
|
|
17
|
+
const targetWindow = useWindow();
|
|
18
|
+
useComponentCssInjection({
|
|
19
|
+
testId: "vuu-splitter",
|
|
20
|
+
css: splitterCss,
|
|
21
|
+
window: targetWindow
|
|
22
|
+
});
|
|
14
23
|
const ignoreClick = useRef();
|
|
15
24
|
const rootRef = useRef(null);
|
|
16
25
|
const lastPos = useRef(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Splitter.js","sources":["../../src/flexbox/Splitter.tsx"],"sourcesContent":["import cx from \"clsx\";\nimport React, {\n HTMLAttributes,\n KeyboardEvent,\n useCallback,\n useRef,\n useState,\n} from \"react\";\n\nimport \"./Splitter.css\";\n\nconst classBase = \"vuuSplitter\";\n\nexport type SplitterDragStartHandler = (index: number) => void;\nexport type SplitterDragHandler = (index: number, distance: number) => void;\nexport type SplitterDragEndHandler = () => void;\n\nexport interface SplitterProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onDrag\" | \"onDragStart\"> {\n //TODO change to alignment (vertical | horizontal)\n column: boolean;\n index: number;\n onDragStart: SplitterDragStartHandler;\n onDrag: SplitterDragHandler;\n onDragEnd: SplitterDragEndHandler;\n}\n\nexport const Splitter = React.memo(function Splitter({\n column,\n index,\n onDrag,\n onDragEnd,\n onDragStart,\n style,\n}: SplitterProps) {\n const ignoreClick = useRef<boolean>();\n const rootRef = useRef<HTMLDivElement>(null);\n const lastPos = useRef<number>(0);\n\n const [active, setActive] = useState(false);\n\n const handleKeyDownDrag = useCallback(\n ({ key, shiftKey }) => {\n const distance = shiftKey ? 10 : 1;\n if (column && key === \"ArrowDown\") {\n onDrag(index, distance);\n } else if (column && key === \"ArrowUp\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowLeft\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowRight\") {\n onDrag(index, distance);\n }\n },\n [column, index, onDrag]\n );\n\n const handleKeyDownInitDrag = useCallback(\n (evt) => {\n const { key } = evt;\n const horizontalMove = key === \"ArrowLeft\" || key === \"ArrowRight\";\n const verticalMove = key === \"ArrowUp\" || key === \"ArrowDown\";\n if ((column && verticalMove) || (!column && horizontalMove)) {\n onDragStart(index);\n handleKeyDownDrag(evt);\n keyDownHandlerRef.current = handleKeyDownDrag;\n }\n },\n [column, handleKeyDownDrag, index, onDragStart]\n );\n\n const keyDownHandlerRef = useRef(handleKeyDownInitDrag);\n const handleKeyDown = (evt: KeyboardEvent) => keyDownHandlerRef.current(evt);\n\n const handleMouseMove = useCallback(\n (e) => {\n ignoreClick.current = true;\n const pos = e[column ? \"clientY\" : \"clientX\"];\n const diff = pos - lastPos.current;\n if (pos && pos !== lastPos.current) {\n onDrag(index, diff);\n }\n lastPos.current = pos;\n },\n [column, index, onDrag]\n );\n\n const handleMouseUp = useCallback(() => {\n window.removeEventListener(\"mousemove\", handleMouseMove, false);\n window.removeEventListener(\"mouseup\", handleMouseUp, false);\n onDragEnd();\n setActive(false);\n rootRef.current?.focus();\n }, [handleMouseMove, onDragEnd, setActive]);\n\n const handleMouseDown = useCallback(\n (e) => {\n lastPos.current = column ? e.clientY : e.clientX;\n onDragStart(index);\n window.addEventListener(\"mousemove\", handleMouseMove, false);\n window.addEventListener(\"mouseup\", handleMouseUp, false);\n e.preventDefault();\n setActive(true);\n },\n [column, handleMouseMove, handleMouseUp, index, onDragStart, setActive]\n );\n\n const handleClick = () => {\n if (ignoreClick.current) {\n ignoreClick.current = false;\n } else {\n rootRef.current?.focus();\n }\n };\n\n const handleBlur = () => {\n keyDownHandlerRef.current = handleKeyDownInitDrag;\n };\n\n const className = cx(classBase, {\n [`${classBase}-active`]: active,\n [`${classBase}-column`]: column,\n });\n return (\n <div\n className={className}\n data-splitter\n ref={rootRef}\n role=\"separator\"\n style={style}\n onBlur={handleBlur}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n tabIndex={0}\n >\n <div className={`${classBase}-grab-zone`} />\n </div>\n );\n});\n"],"names":["Splitter"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Splitter.js","sources":["../../src/flexbox/Splitter.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport React, {\n HTMLAttributes,\n KeyboardEvent,\n useCallback,\n useRef,\n useState,\n} from \"react\";\n\nimport splitterCss from \"./Splitter.css\";\n\nconst classBase = \"vuuSplitter\";\n\nexport type SplitterDragStartHandler = (index: number) => void;\nexport type SplitterDragHandler = (index: number, distance: number) => void;\nexport type SplitterDragEndHandler = () => void;\n\nexport interface SplitterProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onDrag\" | \"onDragStart\"> {\n //TODO change to alignment (vertical | horizontal)\n column: boolean;\n index: number;\n onDragStart: SplitterDragStartHandler;\n onDrag: SplitterDragHandler;\n onDragEnd: SplitterDragEndHandler;\n}\n\nexport const Splitter = React.memo(function Splitter({\n column,\n index,\n onDrag,\n onDragEnd,\n onDragStart,\n style,\n}: SplitterProps) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-splitter\",\n css: splitterCss,\n window: targetWindow,\n });\n\n const ignoreClick = useRef<boolean>();\n const rootRef = useRef<HTMLDivElement>(null);\n const lastPos = useRef<number>(0);\n\n const [active, setActive] = useState(false);\n\n const handleKeyDownDrag = useCallback(\n ({ key, shiftKey }) => {\n const distance = shiftKey ? 10 : 1;\n if (column && key === \"ArrowDown\") {\n onDrag(index, distance);\n } else if (column && key === \"ArrowUp\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowLeft\") {\n onDrag(index, -distance);\n } else if (!column && key === \"ArrowRight\") {\n onDrag(index, distance);\n }\n },\n [column, index, onDrag]\n );\n\n const handleKeyDownInitDrag = useCallback(\n (evt) => {\n const { key } = evt;\n const horizontalMove = key === \"ArrowLeft\" || key === \"ArrowRight\";\n const verticalMove = key === \"ArrowUp\" || key === \"ArrowDown\";\n if ((column && verticalMove) || (!column && horizontalMove)) {\n onDragStart(index);\n handleKeyDownDrag(evt);\n keyDownHandlerRef.current = handleKeyDownDrag;\n }\n },\n [column, handleKeyDownDrag, index, onDragStart]\n );\n\n const keyDownHandlerRef = useRef(handleKeyDownInitDrag);\n const handleKeyDown = (evt: KeyboardEvent) => keyDownHandlerRef.current(evt);\n\n const handleMouseMove = useCallback(\n (e) => {\n ignoreClick.current = true;\n const pos = e[column ? \"clientY\" : \"clientX\"];\n const diff = pos - lastPos.current;\n if (pos && pos !== lastPos.current) {\n onDrag(index, diff);\n }\n lastPos.current = pos;\n },\n [column, index, onDrag]\n );\n\n const handleMouseUp = useCallback(() => {\n window.removeEventListener(\"mousemove\", handleMouseMove, false);\n window.removeEventListener(\"mouseup\", handleMouseUp, false);\n onDragEnd();\n setActive(false);\n rootRef.current?.focus();\n }, [handleMouseMove, onDragEnd, setActive]);\n\n const handleMouseDown = useCallback(\n (e) => {\n lastPos.current = column ? e.clientY : e.clientX;\n onDragStart(index);\n window.addEventListener(\"mousemove\", handleMouseMove, false);\n window.addEventListener(\"mouseup\", handleMouseUp, false);\n e.preventDefault();\n setActive(true);\n },\n [column, handleMouseMove, handleMouseUp, index, onDragStart, setActive]\n );\n\n const handleClick = () => {\n if (ignoreClick.current) {\n ignoreClick.current = false;\n } else {\n rootRef.current?.focus();\n }\n };\n\n const handleBlur = () => {\n keyDownHandlerRef.current = handleKeyDownInitDrag;\n };\n\n const className = cx(classBase, {\n [`${classBase}-active`]: active,\n [`${classBase}-column`]: column,\n });\n return (\n <div\n className={className}\n data-splitter\n ref={rootRef}\n role=\"separator\"\n style={style}\n onBlur={handleBlur}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n tabIndex={0}\n >\n <div className={`${classBase}-grab-zone`} />\n </div>\n );\n});\n"],"names":["Splitter"],"mappings":";;;;;;;AAaA,MAAM,SAAY,GAAA,aAAA,CAAA;AAgBX,MAAM,QAAW,GAAA,KAAA,CAAM,IAAK,CAAA,SAASA,SAAS,CAAA;AAAA,EACnD,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AACF,CAAkB,EAAA;AAChB,EAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,cAAA;AAAA,IACR,GAAK,EAAA,WAAA;AAAA,IACL,MAAQ,EAAA,YAAA;AAAA,GACT,CAAA,CAAA;AAED,EAAA,MA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,CAAA;AACD,EACE,uBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,eAAa,EAAA,IAAA;AAAA,MACb,GAAK,EAAA,OAAA;AAAA,MACL,IAAK,EAAA,WAAA;AAAA,MACL,KAAA;AAAA,MACA,MAAQ,EAAA,UAAA;AAAA,MACR,OAAS,EAAA,WAAA;AAAA,MACT,SAAW,EAAA,aAAA;AAAA,MACX,WAAa,EAAA,eAAA;AAAA,MACb,QAAU,EAAA,CAAA;AAAA,MAEV,QAAC,kBAAA,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,CAAA,EAAG,SAAS,CAAc,UAAA,CAAA,EAAA,CAAA;AAAA,KAAA;AAAA,GAC5C,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var viewCss = ".vuuView {\n border-color: var(--vuuView-borderColor, var(--salt-container-primary-borderColor));\n border-width: var(--vuuView-borderWidth, 1px);\n border-style: var(--vuuView-borderStyle, none);\n\n display: flex;\n flex-direction: column;\n margin: var(--vuuView-margin, 0px);\n min-height: 50px;\n min-width: 50px;\n outline: none;\n overflow: hidden;\n position: relative;\n}\n\n.vuuView.focus-visible:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: dotted cornflowerblue 2px;\n}\n\n.vuuView.dragging {\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n}\n\n.vuuView-main {\n /* height: var(--view-content-height);\n width: var(--view-content-width); */\n display: flex;\n flex-direction: var(--vuuView-flexDirection, column);\n flex-wrap: var(--vuuView-flex-wrap, nowrap);\n flex: 1;\n justify-content: var(--vuuView-justify, flex-start);\n overflow: hidden;\n position: relative;\n}\n\n.vuuView-main > * {\n flex-basis: auto;\n flex-grow: var(--vuuView-flex-grow, 1);\n flex-shrink: var(--vuuView-flex-shrink, 1);\n}\n\n.vuuView-collapsed .vuuView-main {\n display: none;\n}\n\n.vuuView-collapsed + .Splitter {\n display: none;\n}\n\n.vuuView-collapsed .Toolbar-vertical {\n border-right: solid 1px var(--grey40);\n}\n\n.vuuView-collapsed .Toolbar-vertical .toolbar-title {\n display: none;\n}\n";
|
|
2
|
+
|
|
3
|
+
export { viewCss as default };
|
|
4
|
+
//# sourceMappingURL=View.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"View.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/esm/layout-view/View.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useId } from '@vuu-ui/vuu-utils';
|
|
3
3
|
import { useForkRef } from '@salt-ds/core';
|
|
4
|
+
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
5
|
+
import { useWindow } from '@salt-ds/window';
|
|
4
6
|
import cx from 'clsx';
|
|
5
7
|
import React, { forwardRef, useRef, useState, useCallback, useMemo } from 'react';
|
|
6
8
|
import { Header } from '../layout-header/Header.js';
|
|
@@ -11,6 +13,7 @@ import '../layout-provider/LayoutProviderContext.js';
|
|
|
11
13
|
import '../drag-drop/Draggable.js';
|
|
12
14
|
import '../drag-drop/BoxModel.js';
|
|
13
15
|
import { ViewContext } from '../layout-view-actions/ViewContext.js';
|
|
16
|
+
import viewCss from './View.css.js';
|
|
14
17
|
|
|
15
18
|
const classBase = "vuuView";
|
|
16
19
|
const getProps = (state, props) => {
|
|
@@ -45,6 +48,12 @@ const View = forwardRef(function View2(props, forwardedRef) {
|
|
|
45
48
|
title: titleProp,
|
|
46
49
|
...restProps
|
|
47
50
|
} = props;
|
|
51
|
+
const targetWindow = useWindow();
|
|
52
|
+
useComponentCssInjection({
|
|
53
|
+
testId: "vuu-view",
|
|
54
|
+
css: viewCss,
|
|
55
|
+
window: targetWindow
|
|
56
|
+
});
|
|
48
57
|
const id = useId(idProp);
|
|
49
58
|
const rootRef = useRef(null);
|
|
50
59
|
const mainRef = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.js","sources":["../../src/layout-view/View.tsx"],"sourcesContent":["import { useId } from \"@vuu-ui/vuu-utils\";\nimport { useForkRef } from \"@salt-ds/core\";\nimport cx from \"clsx\";\nimport React, {\n ForwardedRef,\n forwardRef,\n ReactElement,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Header as VuuHeader } from \"../layout-header/Header\";\nimport { registerComponent } from \"../registry/ComponentRegistry\";\nimport { useView } from \"./useView\";\nimport { useViewResize } from \"./useViewResize\";\nimport { ViewContext, ViewContextAPI } from \"../layout-view-actions\";\nimport { ViewProps } from \"./viewTypes\";\n\nimport \"./View.css\";\n\nconst classBase = \"vuuView\";\n\ntype Props = { [key: string]: unknown };\n\nconst getProps = (state?: Props, props?: Props) => {\n if (state && props) {\n return {\n ...state,\n ...props,\n };\n } else return state || props;\n};\n\n/**\n * View is the leaf-level entity managed by the Vuu layout system. It may represent a component\n * or a group of components. It also offers an API (via useViewContext) for persistence.\n */\nconst View = forwardRef(function View(\n props: ViewProps,\n forwardedRef: ForwardedRef<HTMLDivElement>\n) {\n const {\n Header = VuuHeader,\n children,\n className,\n collapsed,\n closeable,\n \"data-path\": dataPath,\n \"data-resizeable\": dataResizeable,\n dropTargets,\n expanded,\n flexFill,\n id: idProp,\n header,\n orientation = \"horizontal\",\n path = dataPath,\n resize = \"responsive\",\n resizeable = dataResizeable,\n tearOut,\n style = {},\n title: titleProp,\n ...restProps\n } = props;\n\n const id = useId(idProp);\n const rootRef = useRef<HTMLDivElement>(null);\n const mainRef = useRef<HTMLDivElement>(null);\n const [componentProps, _setComponentProps] = useState<Props>();\n const {\n contributions,\n dispatchViewAction,\n load,\n loadSession,\n onConfigChange,\n onEditTitle,\n purge,\n restoredState,\n save,\n saveSession,\n title,\n } = useView({\n id,\n rootRef,\n path,\n dropTargets,\n title: titleProp,\n });\n\n useViewResize({ mainRef, resize, rootRef });\n\n const setComponentProps = useCallback((props?: Props) => {\n _setComponentProps(props);\n }, []);\n\n const getContent = () => {\n if (React.isValidElement(children) && (restoredState || componentProps)) {\n return React.cloneElement(\n children,\n getProps(restoredState, componentProps)\n );\n }\n return children;\n };\n\n const viewContextValue: ViewContextAPI = useMemo(\n () => ({\n dispatch: dispatchViewAction,\n id,\n path,\n title,\n load,\n loadSession,\n onConfigChange,\n purge,\n save,\n saveSession,\n setComponentProps,\n }),\n [\n dispatchViewAction,\n id,\n load,\n loadSession,\n onConfigChange,\n path,\n purge,\n save,\n saveSession,\n setComponentProps,\n title,\n ]\n );\n\n const headerProps = typeof header === \"object\" ? header : {};\n\n return (\n <div\n {...restProps}\n className={cx(classBase, className, {\n [`${classBase}-collapsed`]: collapsed,\n [`${classBase}-expanded`]: expanded,\n [`${classBase}-resize-defer`]: resize === \"defer\",\n })}\n data-resizeable={resizeable}\n id={id}\n ref={useForkRef(forwardedRef, rootRef)}\n style={style}\n tabIndex={-1}\n >\n <ViewContext.Provider value={viewContextValue}>\n {header ? (\n <Header\n {...headerProps}\n collapsed={collapsed}\n contributions={contributions}\n expanded={expanded}\n closeable={closeable}\n onEditTitle={onEditTitle}\n orientation={orientation}\n tearOut={tearOut}\n title={title}\n />\n ) : null}\n <div className={`${classBase}-main`} ref={mainRef}>\n {getContent()}\n </div>\n </ViewContext.Provider>\n </div>\n );\n});\nView.displayName = \"View\";\n\ninterface ViewComponentType {\n (\n props: ViewProps & {\n ref?: ForwardedRef<HTMLDivElement>;\n }\n ): ReactElement<ViewProps>;\n displayName?: string;\n}\n\nconst MemoView = React.memo(View) as ViewComponentType;\n\nMemoView.displayName = \"View\";\n\nregisterComponent(\"View\", MemoView, \"view\");\n\nexport { MemoView as View };\n"],"names":["View","Header","VuuHeader","props"],"mappings":"
|
|
1
|
+
{"version":3,"file":"View.js","sources":["../../src/layout-view/View.tsx"],"sourcesContent":["import { useId } from \"@vuu-ui/vuu-utils\";\nimport { useForkRef } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport React, {\n ForwardedRef,\n forwardRef,\n ReactElement,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Header as VuuHeader } from \"../layout-header/Header\";\nimport { registerComponent } from \"../registry/ComponentRegistry\";\nimport { useView } from \"./useView\";\nimport { useViewResize } from \"./useViewResize\";\nimport { ViewContext, ViewContextAPI } from \"../layout-view-actions\";\nimport { ViewProps } from \"./viewTypes\";\n\nimport viewCss from \"./View.css\";\n\nconst classBase = \"vuuView\";\n\ntype Props = { [key: string]: unknown };\n\nconst getProps = (state?: Props, props?: Props) => {\n if (state && props) {\n return {\n ...state,\n ...props,\n };\n } else return state || props;\n};\n\n/**\n * View is the leaf-level entity managed by the Vuu layout system. It may represent a component\n * or a group of components. It also offers an API (via useViewContext) for persistence.\n */\nconst View = forwardRef(function View(\n props: ViewProps,\n forwardedRef: ForwardedRef<HTMLDivElement>\n) {\n const {\n Header = VuuHeader,\n children,\n className,\n collapsed,\n closeable,\n \"data-path\": dataPath,\n \"data-resizeable\": dataResizeable,\n dropTargets,\n expanded,\n flexFill,\n id: idProp,\n header,\n orientation = \"horizontal\",\n path = dataPath,\n resize = \"responsive\",\n resizeable = dataResizeable,\n tearOut,\n style = {},\n title: titleProp,\n ...restProps\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-view\",\n css: viewCss,\n window: targetWindow,\n });\n\n const id = useId(idProp);\n const rootRef = useRef<HTMLDivElement>(null);\n const mainRef = useRef<HTMLDivElement>(null);\n const [componentProps, _setComponentProps] = useState<Props>();\n const {\n contributions,\n dispatchViewAction,\n load,\n loadSession,\n onConfigChange,\n onEditTitle,\n purge,\n restoredState,\n save,\n saveSession,\n title,\n } = useView({\n id,\n rootRef,\n path,\n dropTargets,\n title: titleProp,\n });\n\n useViewResize({ mainRef, resize, rootRef });\n\n const setComponentProps = useCallback((props?: Props) => {\n _setComponentProps(props);\n }, []);\n\n const getContent = () => {\n if (React.isValidElement(children) && (restoredState || componentProps)) {\n return React.cloneElement(\n children,\n getProps(restoredState, componentProps)\n );\n }\n return children;\n };\n\n const viewContextValue: ViewContextAPI = useMemo(\n () => ({\n dispatch: dispatchViewAction,\n id,\n path,\n title,\n load,\n loadSession,\n onConfigChange,\n purge,\n save,\n saveSession,\n setComponentProps,\n }),\n [\n dispatchViewAction,\n id,\n load,\n loadSession,\n onConfigChange,\n path,\n purge,\n save,\n saveSession,\n setComponentProps,\n title,\n ]\n );\n\n const headerProps = typeof header === \"object\" ? header : {};\n\n return (\n <div\n {...restProps}\n className={cx(classBase, className, {\n [`${classBase}-collapsed`]: collapsed,\n [`${classBase}-expanded`]: expanded,\n [`${classBase}-resize-defer`]: resize === \"defer\",\n })}\n data-resizeable={resizeable}\n id={id}\n ref={useForkRef(forwardedRef, rootRef)}\n style={style}\n tabIndex={-1}\n >\n <ViewContext.Provider value={viewContextValue}>\n {header ? (\n <Header\n {...headerProps}\n collapsed={collapsed}\n contributions={contributions}\n expanded={expanded}\n closeable={closeable}\n onEditTitle={onEditTitle}\n orientation={orientation}\n tearOut={tearOut}\n title={title}\n />\n ) : null}\n <div className={`${classBase}-main`} ref={mainRef}>\n {getContent()}\n </div>\n </ViewContext.Provider>\n </div>\n );\n});\nView.displayName = \"View\";\n\ninterface ViewComponentType {\n (\n props: ViewProps & {\n ref?: ForwardedRef<HTMLDivElement>;\n }\n ): ReactElement<ViewProps>;\n displayName?: string;\n}\n\nconst MemoView = React.memo(View) as ViewComponentType;\n\nMemoView.displayName = \"View\";\n\nregisterComponent(\"View\", MemoView, \"view\");\n\nexport { MemoView as View };\n"],"names":["View","Header","VuuHeader","props"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,MAAM,SAAY,GAAA,SAAA,CAAA;AAIlB,MAAM,QAAA,GAAW,CAAC,KAAA,EAAe,KAAkB,KAAA;AACjD,EAAA,IAAI,SAAS,KAAO,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AEJ,CAAC,CAAA,CAAA;AACD,IAAA,CAAK,WAAc,GAAA,MAAA,CAAA;AAWb,MAAA,QAAA,GAAW,KAAM,CAAA,IAAA,CAAK,IAAI,EAAA;AAEhC,QAAA,CAAS,WAAc,GAAA,MAAA,CAAA;AAEvB,iBAAkB,CAAA,MAAA,EAAQ,UAAU,MAAM,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
2
|
+
"version": "0.8.38",
|
|
3
3
|
"description": "VUU Layout Components",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@salt-ds/core": "1.17.0",
|
|
9
|
-
"@
|
|
10
|
-
"@
|
|
11
|
-
"@vuu-ui/vuu-
|
|
12
|
-
"@vuu-ui/vuu-
|
|
13
|
-
"@vuu-ui/vuu-
|
|
14
|
-
"@vuu-ui/vuu-
|
|
15
|
-
"@vuu-ui/vuu-
|
|
9
|
+
"@salt-ds/styles": "0.2.1",
|
|
10
|
+
"@salt-ds/window": "0.1.1",
|
|
11
|
+
"@vuu-ui/vuu-data-types": "0.8.38",
|
|
12
|
+
"@vuu-ui/vuu-filters": "0.8.38",
|
|
13
|
+
"@vuu-ui/vuu-popups": "0.8.38",
|
|
14
|
+
"@vuu-ui/vuu-table": "0.8.38",
|
|
15
|
+
"@vuu-ui/vuu-table-extras": "0.8.38",
|
|
16
|
+
"@vuu-ui/vuu-ui-controls": "0.8.38",
|
|
17
|
+
"@vuu-ui/vuu-utils": "0.8.38"
|
|
16
18
|
},
|
|
17
19
|
"peerDependencies": {
|
|
18
20
|
"clsx": "^2.0.0",
|
package/cjs/flexbox/Flexbox.css
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--hw-space-unit: 4px;
|
|
3
|
-
--hw-flex-gap: 3;
|
|
4
|
-
--hw-fluid-grid-col-bg: rgba(200, 200, 200, 0.3);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.hwFlexbox {
|
|
8
|
-
background-color: var(--container1-background);
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
display: flex;
|
|
11
|
-
gap: calc(var(--spacing) * var(--space));
|
|
12
|
-
min-height: 0;
|
|
13
|
-
min-width: 0;
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.hwFlexbox-column {
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.hwFlexbox-row {
|
|
22
|
-
flex-direction: row;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.hwFlexbox > .Splitter {
|
|
26
|
-
flex-basis: auto;
|
|
27
|
-
flex-grow: 0;
|
|
28
|
-
flex-shrink: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.hwFlexbox.full-page {
|
|
32
|
-
height: 100vh;
|
|
33
|
-
width: 100vw;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.flex-fill {
|
|
37
|
-
border-color: red;
|
|
38
|
-
flex: 0;
|
|
39
|
-
flex-grow: 1;
|
|
40
|
-
flex-shrink: 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.vuuView.flex-fill {
|
|
44
|
-
border-color: red;
|
|
45
|
-
}
|
package/cjs/flexbox/Splitter.css
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
.vuuSplitter {
|
|
2
|
-
--splitter-background: var(--salt-separable-secondary-borderColor);
|
|
3
|
-
--splitter-borderColor: var(--salt-separable-secondary-borderColor);
|
|
4
|
-
--splitter-borderStyle: none;
|
|
5
|
-
--splitter-borderWidth: 0;
|
|
6
|
-
--splitter-size: 3px;
|
|
7
|
-
|
|
8
|
-
align-items: center;
|
|
9
|
-
background-color: var(--splitter-background);
|
|
10
|
-
border-color: var(--splitter-borderColor);
|
|
11
|
-
border-style: var(--splitter-borderStyle);
|
|
12
|
-
border-width: var(--splitter-borderWidth);
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
position: relative;
|
|
17
|
-
outline: none;
|
|
18
|
-
z-index: 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.vuuSplitter:hover {
|
|
22
|
-
--splitter-background: var(--salt-separable-primary-borderColor);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.vuuSplitter-active {
|
|
26
|
-
--splitter-background: var(--salt-separable-primary-borderColor);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.vuuSplitter-column {
|
|
30
|
-
cursor: ns-resize;
|
|
31
|
-
height: var(--splitter-size);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.vuuSplitter:not(.vuuSplitter-column) {
|
|
35
|
-
cursor: ew-resize;
|
|
36
|
-
width: var(--splitter-size);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.vuuSplitter:before {
|
|
40
|
-
border: none;
|
|
41
|
-
border-radius: 0;
|
|
42
|
-
content: '';
|
|
43
|
-
display: block;
|
|
44
|
-
padding: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.vuuSplitter-grab-zone {
|
|
48
|
-
position: absolute;
|
|
49
|
-
background-color: rgba(255, 0, 0, 0.01);
|
|
50
|
-
cursor: inherit;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.vuuSplitter-column .vuuSplitter-grab-zone {
|
|
54
|
-
left: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
top: -5px;
|
|
57
|
-
bottom: -5px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.vuuSplitter:not(.vuuSplitter-column) .vuuSplitter-grab-zone {
|
|
61
|
-
left: -5px;
|
|
62
|
-
right: -5px;
|
|
63
|
-
top: 0;
|
|
64
|
-
bottom: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.vuuSplitter-active:not(.vuuSplitter-column) .vuuSplitter-grab-zone {
|
|
68
|
-
background-color: rgba(255,255,255,.05);
|
|
69
|
-
left: -150px;
|
|
70
|
-
right: -150px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.vuuSplitter:not(.vuuSplitter-column):before {
|
|
75
|
-
width: 1px;
|
|
76
|
-
height: 10px;
|
|
77
|
-
background: linear-gradient(
|
|
78
|
-
to bottom,
|
|
79
|
-
var(--grey900) 10%,
|
|
80
|
-
transparent 10%,
|
|
81
|
-
transparent 30%,
|
|
82
|
-
var(--grey900) 30%,
|
|
83
|
-
var(--grey900) 40%,
|
|
84
|
-
transparent 40%,
|
|
85
|
-
transparent 60%,
|
|
86
|
-
var(--grey900) 60%,
|
|
87
|
-
var(--grey900) 70%,
|
|
88
|
-
transparent 70%,
|
|
89
|
-
transparent 90%,
|
|
90
|
-
var(--grey900) 90%
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.vuuSplitter-active.vuuSplitter-column:before {
|
|
95
|
-
background: linear-gradient(
|
|
96
|
-
to right,
|
|
97
|
-
#ffffff 10%,
|
|
98
|
-
transparent 10%,
|
|
99
|
-
transparent 30%,
|
|
100
|
-
#ffffff 30%,
|
|
101
|
-
#ffffff 40%,
|
|
102
|
-
transparent 40%,
|
|
103
|
-
transparent 60%,
|
|
104
|
-
#ffffff 60%,
|
|
105
|
-
#ffffff 70%,
|
|
106
|
-
transparent 70%,
|
|
107
|
-
transparent 90%,
|
|
108
|
-
#ffffff 90%
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.vuuSplitter-active:not(.vuuSplitter-column):before {
|
|
113
|
-
background: linear-gradient(
|
|
114
|
-
to bottom,
|
|
115
|
-
#ffffff 10%,
|
|
116
|
-
transparent 10%,
|
|
117
|
-
transparent 30%,
|
|
118
|
-
#ffffff 30%,
|
|
119
|
-
#ffffff 40%,
|
|
120
|
-
transparent 40%,
|
|
121
|
-
transparent 60%,
|
|
122
|
-
#ffffff 60%,
|
|
123
|
-
#ffffff 70%,
|
|
124
|
-
transparent 70%,
|
|
125
|
-
transparent 90%,
|
|
126
|
-
#ffffff 90%
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.vuuSplitter-column:before {
|
|
131
|
-
width: 10px;
|
|
132
|
-
height: 1px;
|
|
133
|
-
background: linear-gradient(
|
|
134
|
-
to right,
|
|
135
|
-
var(--grey900) 10%,
|
|
136
|
-
transparent 10%,
|
|
137
|
-
transparent 30%,
|
|
138
|
-
var(--grey900) 30%,
|
|
139
|
-
var(--grey900) 40%,
|
|
140
|
-
transparent 40%,
|
|
141
|
-
transparent 60%,
|
|
142
|
-
var(--grey900) 60%,
|
|
143
|
-
var(--grey900) 70%,
|
|
144
|
-
transparent 70%,
|
|
145
|
-
transparent 90%,
|
|
146
|
-
var(--grey900) 90%
|
|
147
|
-
);
|
|
148
|
-
}
|
package/cjs/layout-view/View.css
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
.vuuView {
|
|
2
|
-
border-color: var(--vuuView-borderColor, var(--salt-container-primary-borderColor));
|
|
3
|
-
border-width: var(--vuuView-borderWidth, 1px);
|
|
4
|
-
border-style: var(--vuuView-borderStyle, none);
|
|
5
|
-
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
margin: var(--vuuView-margin, 0px);
|
|
9
|
-
min-height: 50px;
|
|
10
|
-
min-width: 50px;
|
|
11
|
-
outline: none;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
position: relative;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.vuuView.focus-visible:after {
|
|
17
|
-
content: '';
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
right: 0;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
border: dotted cornflowerblue 2px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.vuuView.dragging {
|
|
27
|
-
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.vuuView-main {
|
|
31
|
-
/* height: var(--view-content-height);
|
|
32
|
-
width: var(--view-content-width); */
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: var(--vuuView-flexDirection, column);
|
|
35
|
-
flex-wrap: var(--vuuView-flex-wrap, nowrap);
|
|
36
|
-
flex: 1;
|
|
37
|
-
justify-content: var(--vuuView-justify, flex-start);
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
position: relative;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.vuuView-main > * {
|
|
43
|
-
flex-basis: auto;
|
|
44
|
-
flex-grow: var(--vuuView-flex-grow, 1);
|
|
45
|
-
flex-shrink: var(--vuuView-flex-shrink, 1);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.vuuView-collapsed .vuuView-main {
|
|
49
|
-
display: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.vuuView-collapsed + .Splitter {
|
|
53
|
-
display: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.vuuView-collapsed .Toolbar-vertical {
|
|
57
|
-
border-right: solid 1px var(--grey40);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.vuuView-collapsed .Toolbar-vertical .toolbar-title {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
package/esm/flexbox/Flexbox.css
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--hw-space-unit: 4px;
|
|
3
|
-
--hw-flex-gap: 3;
|
|
4
|
-
--hw-fluid-grid-col-bg: rgba(200, 200, 200, 0.3);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.hwFlexbox {
|
|
8
|
-
background-color: var(--container1-background);
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
display: flex;
|
|
11
|
-
gap: calc(var(--spacing) * var(--space));
|
|
12
|
-
min-height: 0;
|
|
13
|
-
min-width: 0;
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.hwFlexbox-column {
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.hwFlexbox-row {
|
|
22
|
-
flex-direction: row;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.hwFlexbox > .Splitter {
|
|
26
|
-
flex-basis: auto;
|
|
27
|
-
flex-grow: 0;
|
|
28
|
-
flex-shrink: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.hwFlexbox.full-page {
|
|
32
|
-
height: 100vh;
|
|
33
|
-
width: 100vw;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.flex-fill {
|
|
37
|
-
border-color: red;
|
|
38
|
-
flex: 0;
|
|
39
|
-
flex-grow: 1;
|
|
40
|
-
flex-shrink: 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.vuuView.flex-fill {
|
|
44
|
-
border-color: red;
|
|
45
|
-
}
|
package/esm/flexbox/Splitter.css
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
.vuuSplitter {
|
|
2
|
-
--splitter-background: var(--salt-separable-secondary-borderColor);
|
|
3
|
-
--splitter-borderColor: var(--salt-separable-secondary-borderColor);
|
|
4
|
-
--splitter-borderStyle: none;
|
|
5
|
-
--splitter-borderWidth: 0;
|
|
6
|
-
--splitter-size: 3px;
|
|
7
|
-
|
|
8
|
-
align-items: center;
|
|
9
|
-
background-color: var(--splitter-background);
|
|
10
|
-
border-color: var(--splitter-borderColor);
|
|
11
|
-
border-style: var(--splitter-borderStyle);
|
|
12
|
-
border-width: var(--splitter-borderWidth);
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
position: relative;
|
|
17
|
-
outline: none;
|
|
18
|
-
z-index: 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.vuuSplitter:hover {
|
|
22
|
-
--splitter-background: var(--salt-separable-primary-borderColor);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.vuuSplitter-active {
|
|
26
|
-
--splitter-background: var(--salt-separable-primary-borderColor);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.vuuSplitter-column {
|
|
30
|
-
cursor: ns-resize;
|
|
31
|
-
height: var(--splitter-size);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.vuuSplitter:not(.vuuSplitter-column) {
|
|
35
|
-
cursor: ew-resize;
|
|
36
|
-
width: var(--splitter-size);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.vuuSplitter:before {
|
|
40
|
-
border: none;
|
|
41
|
-
border-radius: 0;
|
|
42
|
-
content: '';
|
|
43
|
-
display: block;
|
|
44
|
-
padding: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.vuuSplitter-grab-zone {
|
|
48
|
-
position: absolute;
|
|
49
|
-
background-color: rgba(255, 0, 0, 0.01);
|
|
50
|
-
cursor: inherit;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.vuuSplitter-column .vuuSplitter-grab-zone {
|
|
54
|
-
left: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
top: -5px;
|
|
57
|
-
bottom: -5px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.vuuSplitter:not(.vuuSplitter-column) .vuuSplitter-grab-zone {
|
|
61
|
-
left: -5px;
|
|
62
|
-
right: -5px;
|
|
63
|
-
top: 0;
|
|
64
|
-
bottom: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.vuuSplitter-active:not(.vuuSplitter-column) .vuuSplitter-grab-zone {
|
|
68
|
-
background-color: rgba(255,255,255,.05);
|
|
69
|
-
left: -150px;
|
|
70
|
-
right: -150px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.vuuSplitter:not(.vuuSplitter-column):before {
|
|
75
|
-
width: 1px;
|
|
76
|
-
height: 10px;
|
|
77
|
-
background: linear-gradient(
|
|
78
|
-
to bottom,
|
|
79
|
-
var(--grey900) 10%,
|
|
80
|
-
transparent 10%,
|
|
81
|
-
transparent 30%,
|
|
82
|
-
var(--grey900) 30%,
|
|
83
|
-
var(--grey900) 40%,
|
|
84
|
-
transparent 40%,
|
|
85
|
-
transparent 60%,
|
|
86
|
-
var(--grey900) 60%,
|
|
87
|
-
var(--grey900) 70%,
|
|
88
|
-
transparent 70%,
|
|
89
|
-
transparent 90%,
|
|
90
|
-
var(--grey900) 90%
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.vuuSplitter-active.vuuSplitter-column:before {
|
|
95
|
-
background: linear-gradient(
|
|
96
|
-
to right,
|
|
97
|
-
#ffffff 10%,
|
|
98
|
-
transparent 10%,
|
|
99
|
-
transparent 30%,
|
|
100
|
-
#ffffff 30%,
|
|
101
|
-
#ffffff 40%,
|
|
102
|
-
transparent 40%,
|
|
103
|
-
transparent 60%,
|
|
104
|
-
#ffffff 60%,
|
|
105
|
-
#ffffff 70%,
|
|
106
|
-
transparent 70%,
|
|
107
|
-
transparent 90%,
|
|
108
|
-
#ffffff 90%
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.vuuSplitter-active:not(.vuuSplitter-column):before {
|
|
113
|
-
background: linear-gradient(
|
|
114
|
-
to bottom,
|
|
115
|
-
#ffffff 10%,
|
|
116
|
-
transparent 10%,
|
|
117
|
-
transparent 30%,
|
|
118
|
-
#ffffff 30%,
|
|
119
|
-
#ffffff 40%,
|
|
120
|
-
transparent 40%,
|
|
121
|
-
transparent 60%,
|
|
122
|
-
#ffffff 60%,
|
|
123
|
-
#ffffff 70%,
|
|
124
|
-
transparent 70%,
|
|
125
|
-
transparent 90%,
|
|
126
|
-
#ffffff 90%
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.vuuSplitter-column:before {
|
|
131
|
-
width: 10px;
|
|
132
|
-
height: 1px;
|
|
133
|
-
background: linear-gradient(
|
|
134
|
-
to right,
|
|
135
|
-
var(--grey900) 10%,
|
|
136
|
-
transparent 10%,
|
|
137
|
-
transparent 30%,
|
|
138
|
-
var(--grey900) 30%,
|
|
139
|
-
var(--grey900) 40%,
|
|
140
|
-
transparent 40%,
|
|
141
|
-
transparent 60%,
|
|
142
|
-
var(--grey900) 60%,
|
|
143
|
-
var(--grey900) 70%,
|
|
144
|
-
transparent 70%,
|
|
145
|
-
transparent 90%,
|
|
146
|
-
var(--grey900) 90%
|
|
147
|
-
);
|
|
148
|
-
}
|
package/esm/layout-view/View.css
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
.vuuView {
|
|
2
|
-
border-color: var(--vuuView-borderColor, var(--salt-container-primary-borderColor));
|
|
3
|
-
border-width: var(--vuuView-borderWidth, 1px);
|
|
4
|
-
border-style: var(--vuuView-borderStyle, none);
|
|
5
|
-
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
margin: var(--vuuView-margin, 0px);
|
|
9
|
-
min-height: 50px;
|
|
10
|
-
min-width: 50px;
|
|
11
|
-
outline: none;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
position: relative;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.vuuView.focus-visible:after {
|
|
17
|
-
content: '';
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
right: 0;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
border: dotted cornflowerblue 2px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.vuuView.dragging {
|
|
27
|
-
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.vuuView-main {
|
|
31
|
-
/* height: var(--view-content-height);
|
|
32
|
-
width: var(--view-content-width); */
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: var(--vuuView-flexDirection, column);
|
|
35
|
-
flex-wrap: var(--vuuView-flex-wrap, nowrap);
|
|
36
|
-
flex: 1;
|
|
37
|
-
justify-content: var(--vuuView-justify, flex-start);
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
position: relative;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.vuuView-main > * {
|
|
43
|
-
flex-basis: auto;
|
|
44
|
-
flex-grow: var(--vuuView-flex-grow, 1);
|
|
45
|
-
flex-shrink: var(--vuuView-flex-shrink, 1);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.vuuView-collapsed .vuuView-main {
|
|
49
|
-
display: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.vuuView-collapsed + .Splitter {
|
|
53
|
-
display: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.vuuView-collapsed .Toolbar-vertical {
|
|
57
|
-
border-right: solid 1px var(--grey40);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.vuuView-collapsed .Toolbar-vertical .toolbar-title {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|