@vuu-ui/vuu-filters 0.8.10-debug → 0.8.11-debug
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/index.js +1460 -646
- package/cjs/index.js.map +4 -4
- package/esm/index.js +1430 -581
- package/esm/index.js.map +4 -4
- package/index.css +608 -2
- package/index.css.map +3 -3
- package/package.json +10 -10
- package/types/{vuu-filters/src/filter-bar → filter-bar}/FilterBar.d.ts +1 -2
- package/types/{vuu-filters/src/filter-bar → filter-bar}/useFilterBar.d.ts +4 -3
- package/types/{vuu-filters/src/filter-bar → filter-bar}/useFilters.d.ts +1 -1
- package/types/{vuu-filters/src/filter-builder-menu → filter-builder-menu}/FilterBuilderMenu.d.ts +1 -1
- package/types/filter-clause/ExpandoCombobox.d.ts +9 -0
- package/types/{vuu-filters/src/filter-clause → filter-clause}/filterClauseTypes.d.ts +1 -1
- package/types/{vuu-filters/src/filter-clause → filter-clause}/useFilterClauseEditor.d.ts +8 -4
- package/types/vuu-filters/src/filter-clause/ExpandoCombobox.d.ts +0 -10
- package/types/vuu-popups/src/dialog/Dialog.d.ts +0 -8
- package/types/vuu-popups/src/dialog/index.d.ts +0 -1
- package/types/vuu-popups/src/index.d.ts +0 -8
- package/types/vuu-popups/src/menu/ContextMenu.d.ts +0 -16
- package/types/vuu-popups/src/menu/MenuList.d.ts +0 -43
- package/types/vuu-popups/src/menu/context-menu-provider.d.ts +0 -10
- package/types/vuu-popups/src/menu/index.d.ts +0 -4
- package/types/vuu-popups/src/menu/key-code.d.ts +0 -12
- package/types/vuu-popups/src/menu/list-dom-utils.d.ts +0 -4
- package/types/vuu-popups/src/menu/use-cascade.d.ts +0 -25
- package/types/vuu-popups/src/menu/use-items-with-ids-next.d.ts +0 -13
- package/types/vuu-popups/src/menu/use-keyboard-navigation.d.ts +0 -27
- package/types/vuu-popups/src/menu/useContextMenu.d.ts +0 -20
- package/types/vuu-popups/src/menu/utils.d.ts +0 -2
- package/types/vuu-popups/src/popup/Popup.d.ts +0 -10
- package/types/vuu-popups/src/popup/index.d.ts +0 -3
- package/types/vuu-popups/src/popup/popup-service.d.ts +0 -59
- package/types/vuu-popups/src/popup/useAnchoredPosition.d.ts +0 -12
- package/types/vuu-popups/src/popup-menu/PopupMenu.d.ts +0 -16
- package/types/vuu-popups/src/popup-menu/index.d.ts +0 -1
- package/types/vuu-popups/src/portal/Portal.d.ts +0 -30
- package/types/vuu-popups/src/portal/index.d.ts +0 -1
- package/types/vuu-popups/src/portal-deprecated/PortalDeprecated.d.ts +0 -8
- package/types/vuu-popups/src/portal-deprecated/index.d.ts +0 -3
- package/types/vuu-popups/src/portal-deprecated/portal-utils.d.ts +0 -1
- package/types/vuu-popups/src/portal-deprecated/render-portal.d.ts +0 -10
- package/types/vuu-popups/src/prompt/Prompt.d.ts +0 -14
- package/types/vuu-popups/src/prompt/index.d.ts +0 -1
- package/types/vuu-popups/src/tooltip/Tooltip.d.ts +0 -12
- package/types/vuu-popups/src/tooltip/index.d.ts +0 -2
- package/types/vuu-popups/src/tooltip/useAnchoredPosition.d.ts +0 -12
- package/types/vuu-popups/src/tooltip/useTooltip.d.ts +0 -16
- /package/types/{vuu-filters/src/column-filter → column-filter}/utils.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-bar → filter-bar}/index.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-builder-menu → filter-builder-menu}/index.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/CloseButton.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/FilterClauseEditor.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/FilterMenu.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/FilterMenuOptions.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/NumericInput.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/TextInput.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/index.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-clause → filter-clause}/operator-utils.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/FilterInput.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/FilterLanguage.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/filterInfo.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/highlighting.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/index.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/theme.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/useCodeMirrorEditor.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/useFilterAutoComplete.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-input → filter-input}/useFilterSuggestionProvider.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-pill → filter-pill}/FilterPill.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-pill → filter-pill}/index.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-pill-menu → filter-pill-menu}/FilterPillMenu.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-pill-menu → filter-pill-menu}/FilterPillMenuOptions.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-pill-menu → filter-pill-menu}/index.d.ts +0 -0
- /package/types/{vuu-filters/src/filter-utils.d.ts → filter-utils.d.ts} +0 -0
- /package/types/{vuu-filters/src/index.d.ts → index.d.ts} +0 -0
- /package/types/{vuu-filters/src/local-config.d.ts → local-config.d.ts} +0 -0
- /package/types/{vuu-filters/src/use-filter-config.d.ts → use-filter-config.d.ts} +0 -0
- /package/types/{vuu-filters/src/use-rest-config.d.ts → use-rest-config.d.ts} +0 -0
package/esm/index.js
CHANGED
|
@@ -199,14 +199,14 @@ var isDrawer = (component) => component.type === Drawer_default;
|
|
|
199
199
|
var isVertical = ({ props: { position = "left" } }) => position.match(/top|bottom/);
|
|
200
200
|
var DockLayout = (props) => {
|
|
201
201
|
const { children, className: classNameProp, id, style } = props;
|
|
202
|
-
const
|
|
202
|
+
const classBase20 = "vuuDockLayout";
|
|
203
203
|
const [drawers, content] = partition(children, isDrawer);
|
|
204
204
|
const [verticalDrawers, horizontalDrawers] = partition(drawers, isVertical);
|
|
205
205
|
const orientation = verticalDrawers.length === 0 ? "horizontal" : horizontalDrawers.length === 0 ? "vertical" : "both";
|
|
206
|
-
const className = (0, import_classnames2.default)(
|
|
206
|
+
const className = (0, import_classnames2.default)(classBase20, classNameProp, `${classBase20}-${orientation}`);
|
|
207
207
|
return /* @__PURE__ */ jsxs2("div", { className, id, style, children: [
|
|
208
208
|
drawers,
|
|
209
|
-
/* @__PURE__ */ jsx2("div", { className: `${
|
|
209
|
+
/* @__PURE__ */ jsx2("div", { className: `${classBase20}-content`, children: content })
|
|
210
210
|
] });
|
|
211
211
|
};
|
|
212
212
|
DockLayout.displayName = "DockLayout";
|
|
@@ -228,9 +228,9 @@ import React2, { isValidElement } from "react";
|
|
|
228
228
|
// ../vuu-layout/src/utils/propUtils.ts
|
|
229
229
|
var NO_PROPS = {};
|
|
230
230
|
var getProp = (component, propName) => {
|
|
231
|
-
var
|
|
231
|
+
var _a2;
|
|
232
232
|
const props = getProps(component);
|
|
233
|
-
return (
|
|
233
|
+
return (_a2 = props[propName]) != null ? _a2 : props[`data-${propName}`];
|
|
234
234
|
};
|
|
235
235
|
var getProps = (component) => (component == null ? void 0 : component.props) || component || NO_PROPS;
|
|
236
236
|
|
|
@@ -531,8 +531,8 @@ var DropTargetCanvas = class {
|
|
|
531
531
|
dragState
|
|
532
532
|
);
|
|
533
533
|
if (targetDropOutline) {
|
|
534
|
-
const { l, t, r, b, tabLeft, tabWidth, tabHeight, guideLines } = targetDropOutline;
|
|
535
|
-
const w =
|
|
534
|
+
const { l, t, r: r2, b, tabLeft, tabWidth, tabHeight, guideLines } = targetDropOutline;
|
|
535
|
+
const w = r2 - l;
|
|
536
536
|
const h = b - t;
|
|
537
537
|
if (this.currentPath) {
|
|
538
538
|
const path2 = document.getElementById("vuu-drop-outline");
|
|
@@ -554,7 +554,7 @@ var DropTargetCanvas = class {
|
|
|
554
554
|
var cssShiftRight = "transition:margin-left .4s ease-out;margin-left: 63px";
|
|
555
555
|
var cssShiftBack = "transition:margin-left .4s ease-out;margin-left: 0px";
|
|
556
556
|
function moveExistingTabs(dropTarget) {
|
|
557
|
-
var
|
|
557
|
+
var _a2, _b;
|
|
558
558
|
const { AFTER, BEFORE } = RelativeDropPosition;
|
|
559
559
|
const {
|
|
560
560
|
clientRect: { Stack: Stack4 },
|
|
@@ -568,7 +568,7 @@ function moveExistingTabs(dropTarget) {
|
|
|
568
568
|
if (Stack4 && tab && tab.positionRelativeToTab !== AFTER) {
|
|
569
569
|
const tabOffset = tab.positionRelativeToTab === BEFORE ? 1 : 2;
|
|
570
570
|
const selector = `:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${tab.index + tabOffset})`;
|
|
571
|
-
tabEl = (
|
|
571
|
+
tabEl = (_a2 = document.getElementById(id)) == null ? void 0 : _a2.querySelector(selector);
|
|
572
572
|
if (tabEl) {
|
|
573
573
|
if (_shiftedTab === null || _shiftedTab !== tabEl) {
|
|
574
574
|
tabEl.style.cssText = cssShiftRight;
|
|
@@ -725,12 +725,12 @@ var Splitter = React3.memo(function Splitter2({
|
|
|
725
725
|
[column, index, onDrag]
|
|
726
726
|
);
|
|
727
727
|
const handleMouseUp = useCallback2(() => {
|
|
728
|
-
var
|
|
728
|
+
var _a2;
|
|
729
729
|
window.removeEventListener("mousemove", handleMouseMove, false);
|
|
730
730
|
window.removeEventListener("mouseup", handleMouseUp, false);
|
|
731
731
|
onDragEnd();
|
|
732
732
|
setActive(false);
|
|
733
|
-
(
|
|
733
|
+
(_a2 = rootRef.current) == null ? void 0 : _a2.focus();
|
|
734
734
|
}, [handleMouseMove, onDragEnd, setActive]);
|
|
735
735
|
const handleMouseDown = useCallback2(
|
|
736
736
|
(e) => {
|
|
@@ -744,11 +744,11 @@ var Splitter = React3.memo(function Splitter2({
|
|
|
744
744
|
[column, handleMouseMove, handleMouseUp, index, onDragStart, setActive]
|
|
745
745
|
);
|
|
746
746
|
const handleClick = () => {
|
|
747
|
-
var
|
|
747
|
+
var _a2;
|
|
748
748
|
if (ignoreClick.current) {
|
|
749
749
|
ignoreClick.current = false;
|
|
750
750
|
} else {
|
|
751
|
-
(
|
|
751
|
+
(_a2 = rootRef.current) == null ? void 0 : _a2.focus();
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
const handleBlur = () => {
|
|
@@ -823,9 +823,9 @@ var getBreakPointValues = (breakPoints2, component) => {
|
|
|
823
823
|
};
|
|
824
824
|
var gatherChildMeta = (children, dimension3, breakPoints2) => {
|
|
825
825
|
return children.map((child, index) => {
|
|
826
|
-
var
|
|
826
|
+
var _a2;
|
|
827
827
|
const resizeable = getProp(child, "resizeable");
|
|
828
|
-
const { [dimension3]: intrinsicSize } = (
|
|
828
|
+
const { [dimension3]: intrinsicSize } = (_a2 = getIntrinsicSize(child)) != null ? _a2 : NO_INTRINSIC_SIZE;
|
|
829
829
|
const flexOpen = hasUnboundedFlexStyle(child);
|
|
830
830
|
if (breakPoints2) {
|
|
831
831
|
return {
|
|
@@ -940,8 +940,8 @@ var useSplitterResizing = ({
|
|
|
940
940
|
);
|
|
941
941
|
if (participants) {
|
|
942
942
|
participants.forEach((index2) => {
|
|
943
|
-
var
|
|
944
|
-
const el = (
|
|
943
|
+
var _a2;
|
|
944
|
+
const el = (_a2 = rootRef.current) == null ? void 0 : _a2.childNodes[index2];
|
|
945
945
|
if (el) {
|
|
946
946
|
const { size, minSize } = measureElement(el, dimension3);
|
|
947
947
|
contentMeta[index2].currentSize = size;
|
|
@@ -950,8 +950,8 @@ var useSplitterResizing = ({
|
|
|
950
950
|
});
|
|
951
951
|
if (bystanders) {
|
|
952
952
|
bystanders.forEach((index2) => {
|
|
953
|
-
var
|
|
954
|
-
const el = (
|
|
953
|
+
var _a2;
|
|
954
|
+
const el = (_a2 = rootRef.current) == null ? void 0 : _a2.childNodes[index2];
|
|
955
955
|
if (el) {
|
|
956
956
|
const { [dimension3]: size } = el.getBoundingClientRect();
|
|
957
957
|
contentMeta[index2].flexBasis = size;
|
|
@@ -1749,10 +1749,10 @@ import {
|
|
|
1749
1749
|
useState as useState5
|
|
1750
1750
|
} from "react";
|
|
1751
1751
|
var useViewActionDispatcher = (id, root, viewPath, dropTargets) => {
|
|
1752
|
-
var
|
|
1752
|
+
var _a2;
|
|
1753
1753
|
const { loadSessionState, purgeSessionState, purgeState, saveSessionState } = usePersistentState();
|
|
1754
1754
|
const [contributions, setContributions] = useState5(
|
|
1755
|
-
(
|
|
1755
|
+
(_a2 = loadSessionState(id, "contributions")) != null ? _a2 : []
|
|
1756
1756
|
);
|
|
1757
1757
|
const dispatchLayoutAction = useLayoutProviderDispatch();
|
|
1758
1758
|
const updateContributions = useCallback11(
|
|
@@ -1787,9 +1787,9 @@ var useViewActionDispatcher = (id, root, viewPath, dropTargets) => {
|
|
|
1787
1787
|
]);
|
|
1788
1788
|
const handleMouseDown = useCallback11(
|
|
1789
1789
|
async (evt, index, preDragActivity) => {
|
|
1790
|
-
var
|
|
1790
|
+
var _a3;
|
|
1791
1791
|
evt.stopPropagation();
|
|
1792
|
-
const dragRect = (
|
|
1792
|
+
const dragRect = (_a3 = root.current) == null ? void 0 : _a3.getBoundingClientRect();
|
|
1793
1793
|
return new Promise((resolve, reject) => {
|
|
1794
1794
|
dispatchLayoutAction({
|
|
1795
1795
|
type: "drag-start",
|
|
@@ -1807,13 +1807,13 @@ var useViewActionDispatcher = (id, root, viewPath, dropTargets) => {
|
|
|
1807
1807
|
);
|
|
1808
1808
|
const dispatchAction = useCallback11(
|
|
1809
1809
|
async (action, evt) => {
|
|
1810
|
-
var
|
|
1810
|
+
var _a3;
|
|
1811
1811
|
const { type } = action;
|
|
1812
1812
|
switch (type) {
|
|
1813
1813
|
case "maximize":
|
|
1814
1814
|
case "minimize":
|
|
1815
1815
|
case "restore":
|
|
1816
|
-
return dispatchLayoutAction({ type, path: (
|
|
1816
|
+
return dispatchLayoutAction({ type, path: (_a3 = action.path) != null ? _a3 : viewPath });
|
|
1817
1817
|
case "remove":
|
|
1818
1818
|
return handleRemove();
|
|
1819
1819
|
case "mousedown":
|
|
@@ -1875,8 +1875,8 @@ var useView = ({
|
|
|
1875
1875
|
);
|
|
1876
1876
|
const title = useMemo5(
|
|
1877
1877
|
() => {
|
|
1878
|
-
var
|
|
1879
|
-
return (
|
|
1878
|
+
var _a2;
|
|
1879
|
+
return (_a2 = loadState("view-title")) != null ? _a2 : titleProp;
|
|
1880
1880
|
},
|
|
1881
1881
|
[loadState, titleProp]
|
|
1882
1882
|
);
|
|
@@ -1979,9 +1979,9 @@ import React13, { useContext as useContext2 } from "react";
|
|
|
1979
1979
|
var NO_CONTEXT = { dispatch: null };
|
|
1980
1980
|
var ViewContext = React13.createContext(NO_CONTEXT);
|
|
1981
1981
|
var useViewDispatch = () => {
|
|
1982
|
-
var
|
|
1982
|
+
var _a2;
|
|
1983
1983
|
const context = useContext2(ViewContext);
|
|
1984
|
-
return (
|
|
1984
|
+
return (_a2 = context == null ? void 0 : context.dispatch) != null ? _a2 : null;
|
|
1985
1985
|
};
|
|
1986
1986
|
|
|
1987
1987
|
// ../vuu-layout/src/layout-view/View.tsx
|
|
@@ -2142,8 +2142,8 @@ var Header = ({
|
|
|
2142
2142
|
const viewDispatch = useViewDispatch();
|
|
2143
2143
|
const handleClose = (evt) => viewDispatch == null ? void 0 : viewDispatch({ type: "remove" }, evt);
|
|
2144
2144
|
const handleTitleMouseDown = () => {
|
|
2145
|
-
var
|
|
2146
|
-
(
|
|
2145
|
+
var _a2;
|
|
2146
|
+
(_a2 = labelFieldRef.current) == null ? void 0 : _a2.focus();
|
|
2147
2147
|
};
|
|
2148
2148
|
const handleButtonMouseDown = (evt) => {
|
|
2149
2149
|
evt.stopPropagation();
|
|
@@ -2163,7 +2163,7 @@ var Header = ({
|
|
|
2163
2163
|
}
|
|
2164
2164
|
};
|
|
2165
2165
|
const handleExitEditMode = (originalValue = "", finalValue = "", allowDeactivation = true, editCancelled = false) => {
|
|
2166
|
-
var
|
|
2166
|
+
var _a2;
|
|
2167
2167
|
setEditing(false);
|
|
2168
2168
|
if (editCancelled) {
|
|
2169
2169
|
setValue(originalValue);
|
|
@@ -2172,7 +2172,7 @@ var Header = ({
|
|
|
2172
2172
|
onEditTitle == null ? void 0 : onEditTitle(finalValue);
|
|
2173
2173
|
}
|
|
2174
2174
|
if (allowDeactivation === false) {
|
|
2175
|
-
(
|
|
2175
|
+
(_a2 = labelFieldRef.current) == null ? void 0 : _a2.focus();
|
|
2176
2176
|
}
|
|
2177
2177
|
};
|
|
2178
2178
|
const handleMouseDown = (e) => {
|
|
@@ -2239,21 +2239,815 @@ var Header = ({
|
|
|
2239
2239
|
);
|
|
2240
2240
|
};
|
|
2241
2241
|
|
|
2242
|
-
// ../vuu-layout/src/
|
|
2242
|
+
// ../vuu-layout/src/layout-persistence/data.ts
|
|
2243
|
+
var defaultLayout = {
|
|
2244
|
+
type: "Stack",
|
|
2245
|
+
id: "main-tabs",
|
|
2246
|
+
props: {
|
|
2247
|
+
className: "vuuShell-mainTabs",
|
|
2248
|
+
TabstripProps: {
|
|
2249
|
+
allowAddTab: true,
|
|
2250
|
+
allowRenameTab: true,
|
|
2251
|
+
animateSelectionThumb: false,
|
|
2252
|
+
location: "main-tab",
|
|
2253
|
+
allowCloseTab: true
|
|
2254
|
+
},
|
|
2255
|
+
preserve: true,
|
|
2256
|
+
active: 0
|
|
2257
|
+
},
|
|
2258
|
+
children: [
|
|
2259
|
+
{
|
|
2260
|
+
props: {
|
|
2261
|
+
id: "tab1",
|
|
2262
|
+
className: "vuuShell-Placeholder"
|
|
2263
|
+
},
|
|
2264
|
+
type: "Placeholder"
|
|
2265
|
+
}
|
|
2266
|
+
]
|
|
2267
|
+
};
|
|
2268
|
+
|
|
2269
|
+
// ../vuu-layout/src/layout-persistence/LocalLayoutPersistenceManager.ts
|
|
2270
|
+
import { getUniqueId as getUniqueId3 } from "@vuu-ui/vuu-utils";
|
|
2271
|
+
var metadataSaveLocation = "layouts/metadata";
|
|
2272
|
+
var layoutsSaveLocation = "layouts/layouts";
|
|
2273
|
+
var LocalLayoutPersistenceManager = class {
|
|
2274
|
+
createLayout(metadata, layout) {
|
|
2275
|
+
return new Promise((resolve) => {
|
|
2276
|
+
console.log(
|
|
2277
|
+
`Saving layout as ${metadata.name} to group ${metadata.group}...`
|
|
2278
|
+
);
|
|
2279
|
+
Promise.all([this.loadLayouts(), this.loadMetadata()]).then(
|
|
2280
|
+
([existingLayouts, existingMetadata]) => {
|
|
2281
|
+
const id = getUniqueId3();
|
|
2282
|
+
this.appendAndPersist(
|
|
2283
|
+
id,
|
|
2284
|
+
metadata,
|
|
2285
|
+
layout,
|
|
2286
|
+
existingLayouts,
|
|
2287
|
+
existingMetadata
|
|
2288
|
+
);
|
|
2289
|
+
resolve(id);
|
|
2290
|
+
}
|
|
2291
|
+
);
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
updateLayout(id, newMetadata, newLayout) {
|
|
2295
|
+
return new Promise((resolve, reject) => {
|
|
2296
|
+
this.validateIds(id).then(() => Promise.all([this.loadLayouts(), this.loadMetadata()])).then(([existingLayouts, existingMetadata]) => {
|
|
2297
|
+
const layouts = existingLayouts.filter((layout) => layout.id !== id);
|
|
2298
|
+
const metadata = existingMetadata.filter(
|
|
2299
|
+
(metadata2) => metadata2.id !== id
|
|
2300
|
+
);
|
|
2301
|
+
this.appendAndPersist(id, newMetadata, newLayout, layouts, metadata);
|
|
2302
|
+
resolve();
|
|
2303
|
+
}).catch((e) => reject(e));
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
deleteLayout(id) {
|
|
2307
|
+
return new Promise((resolve, reject) => {
|
|
2308
|
+
this.validateIds(id).then(() => Promise.all([this.loadLayouts(), this.loadMetadata()])).then(([existingLayouts, existingMetadata]) => {
|
|
2309
|
+
const layouts = existingLayouts.filter((layout) => layout.id !== id);
|
|
2310
|
+
const metadata = existingMetadata.filter(
|
|
2311
|
+
(metadata2) => metadata2.id !== id
|
|
2312
|
+
);
|
|
2313
|
+
this.saveLayoutsWithMetadata(layouts, metadata);
|
|
2314
|
+
resolve();
|
|
2315
|
+
}).catch((e) => reject(e));
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2318
|
+
loadLayout(id) {
|
|
2319
|
+
return new Promise((resolve, reject) => {
|
|
2320
|
+
this.validateId(id, "layout").then(() => this.loadLayouts()).then((existingLayouts) => {
|
|
2321
|
+
const layouts = existingLayouts.find(
|
|
2322
|
+
(layout) => layout.id === id
|
|
2323
|
+
);
|
|
2324
|
+
resolve(layouts.json);
|
|
2325
|
+
}).catch((e) => reject(e));
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
loadMetadata() {
|
|
2329
|
+
return new Promise((resolve) => {
|
|
2330
|
+
const metadata = getLocalEntity(metadataSaveLocation);
|
|
2331
|
+
resolve(metadata || []);
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
loadApplicationLayout() {
|
|
2335
|
+
return new Promise((resolve) => {
|
|
2336
|
+
const applicationLayout = getLocalEntity("api/vui");
|
|
2337
|
+
if (applicationLayout) {
|
|
2338
|
+
resolve(applicationLayout);
|
|
2339
|
+
} else {
|
|
2340
|
+
resolve(defaultLayout);
|
|
2341
|
+
}
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
saveApplicationLayout(layout) {
|
|
2345
|
+
return new Promise((resolve, reject) => {
|
|
2346
|
+
const savedLayout = saveLocalEntity("api/vui", layout);
|
|
2347
|
+
if (savedLayout) {
|
|
2348
|
+
resolve();
|
|
2349
|
+
} else {
|
|
2350
|
+
reject(new Error("Layout failed to save"));
|
|
2351
|
+
}
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
loadLayouts() {
|
|
2355
|
+
return new Promise((resolve) => {
|
|
2356
|
+
const layouts = getLocalEntity(layoutsSaveLocation);
|
|
2357
|
+
resolve(layouts || []);
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
appendAndPersist(newId, newMetadata, newLayout, existingLayouts, existingMetadata) {
|
|
2361
|
+
existingLayouts.push({ id: newId, json: newLayout });
|
|
2362
|
+
existingMetadata.push({ id: newId, ...newMetadata });
|
|
2363
|
+
this.saveLayoutsWithMetadata(existingLayouts, existingMetadata);
|
|
2364
|
+
}
|
|
2365
|
+
saveLayoutsWithMetadata(layouts, metadata) {
|
|
2366
|
+
saveLocalEntity(layoutsSaveLocation, layouts);
|
|
2367
|
+
saveLocalEntity(metadataSaveLocation, metadata);
|
|
2368
|
+
}
|
|
2369
|
+
// Ensures that there is exactly one Layout entry and exactly one Metadata
|
|
2370
|
+
// entry in local storage corresponding to the provided ID.
|
|
2371
|
+
async validateIds(id) {
|
|
2372
|
+
return Promise.all([
|
|
2373
|
+
this.validateId(id, "metadata").catch((error2) => error2.message),
|
|
2374
|
+
this.validateId(id, "layout").catch((error2) => error2.message)
|
|
2375
|
+
]).then((errorMessages) => {
|
|
2376
|
+
const combinedMessage = errorMessages.filter((msg) => msg !== void 0).join("; ");
|
|
2377
|
+
if (combinedMessage) {
|
|
2378
|
+
throw new Error(combinedMessage);
|
|
2379
|
+
}
|
|
2380
|
+
});
|
|
2381
|
+
}
|
|
2382
|
+
// Ensures that there is exactly one element (Layout or Metadata) in local
|
|
2383
|
+
// storage corresponding to the provided ID.
|
|
2384
|
+
validateId(id, dataType) {
|
|
2385
|
+
return new Promise((resolve, reject) => {
|
|
2386
|
+
const loadFunc = dataType === "metadata" ? this.loadMetadata : this.loadLayouts;
|
|
2387
|
+
loadFunc().then((array) => {
|
|
2388
|
+
const count = array.filter((element) => element.id === id).length;
|
|
2389
|
+
switch (count) {
|
|
2390
|
+
case 1: {
|
|
2391
|
+
resolve();
|
|
2392
|
+
break;
|
|
2393
|
+
}
|
|
2394
|
+
case 0: {
|
|
2395
|
+
reject(new Error(`No ${dataType} with ID ${id}`));
|
|
2396
|
+
break;
|
|
2397
|
+
}
|
|
2398
|
+
default:
|
|
2399
|
+
reject(new Error(`Non-unique ${dataType} with ID ${id}`));
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
|
|
2406
|
+
// ../vuu-shell/src/connection-status/ConnectionStatusIcon.tsx
|
|
2407
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
2408
|
+
import React15, { useEffect as useEffect3, useState as useState8 } from "react";
|
|
2409
|
+
import { Fragment, jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2410
|
+
|
|
2411
|
+
// ../vuu-shell/src/density-switch/DensitySwitch.tsx
|
|
2412
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
2413
|
+
import { Dropdown } from "@salt-ds/lab";
|
|
2414
|
+
import { useCallback as useCallback15 } from "react";
|
|
2415
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2416
|
+
|
|
2417
|
+
// ../vuu-shell/src/feature/Feature.tsx
|
|
2418
|
+
import React17, { Suspense, useEffect as useEffect4 } from "react";
|
|
2419
|
+
|
|
2420
|
+
// ../vuu-shell/src/feature/FeatureErrorBoundary.tsx
|
|
2421
|
+
import React16 from "react";
|
|
2422
|
+
import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2423
|
+
var FeatureErrorBoundary = class extends React16.Component {
|
|
2424
|
+
constructor(props) {
|
|
2425
|
+
super(props);
|
|
2426
|
+
this.state = { errorMessage: null };
|
|
2427
|
+
}
|
|
2428
|
+
static getDerivedStateFromError(error2) {
|
|
2429
|
+
return { errorMessage: error2.message };
|
|
2430
|
+
}
|
|
2431
|
+
componentDidCatch(error2, errorInfo) {
|
|
2432
|
+
console.log(`error creating component at ${this.props.url}`);
|
|
2433
|
+
console.log(error2, errorInfo);
|
|
2434
|
+
}
|
|
2435
|
+
render() {
|
|
2436
|
+
if (this.state.errorMessage) {
|
|
2437
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
2438
|
+
/* @__PURE__ */ jsx18("h1", { children: "An error occured while creating component." }),
|
|
2439
|
+
/* @__PURE__ */ jsx18("p", { children: this.state.errorMessage })
|
|
2440
|
+
] });
|
|
2441
|
+
}
|
|
2442
|
+
return this.props.children;
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2445
|
+
|
|
2446
|
+
// ../vuu-shell/src/feature/Loader.tsx
|
|
2447
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2448
|
+
var Loader = () => /* @__PURE__ */ jsx19("div", { className: "hwLoader", children: "loading" });
|
|
2449
|
+
|
|
2450
|
+
// ../vuu-shell/src/feature/css-module-loader.ts
|
|
2451
|
+
var importCSS = async (path) => {
|
|
2452
|
+
const container = new CSSStyleSheet();
|
|
2453
|
+
return fetch(path).then((x) => x.text()).then((x) => container.replace(x));
|
|
2454
|
+
};
|
|
2455
|
+
|
|
2456
|
+
// ../vuu-shell/src/feature/Feature.tsx
|
|
2457
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2458
|
+
var componentsMap = /* @__PURE__ */ new Map();
|
|
2459
|
+
var useCachedFeature = (url) => {
|
|
2460
|
+
useEffect4(
|
|
2461
|
+
() => () => {
|
|
2462
|
+
componentsMap.delete(url);
|
|
2463
|
+
},
|
|
2464
|
+
[url]
|
|
2465
|
+
);
|
|
2466
|
+
if (!componentsMap.has(url)) {
|
|
2467
|
+
componentsMap.set(
|
|
2468
|
+
url,
|
|
2469
|
+
React17.lazy(() => import(
|
|
2470
|
+
/* @vite-ignore */
|
|
2471
|
+
url
|
|
2472
|
+
))
|
|
2473
|
+
);
|
|
2474
|
+
}
|
|
2475
|
+
const lazyFeature = componentsMap.get(url);
|
|
2476
|
+
if (!lazyFeature) {
|
|
2477
|
+
throw Error(`Unable to load Lazy Feature at url ${url}`);
|
|
2478
|
+
} else {
|
|
2479
|
+
return lazyFeature;
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2482
|
+
function RawFeature({
|
|
2483
|
+
url,
|
|
2484
|
+
css,
|
|
2485
|
+
ComponentProps: params,
|
|
2486
|
+
...props
|
|
2487
|
+
}) {
|
|
2488
|
+
if (css) {
|
|
2489
|
+
importCSS(css).then((styleSheet) => {
|
|
2490
|
+
document.adoptedStyleSheets = [
|
|
2491
|
+
...document.adoptedStyleSheets,
|
|
2492
|
+
styleSheet
|
|
2493
|
+
];
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
const LazyFeature = useCachedFeature(url);
|
|
2497
|
+
return /* @__PURE__ */ jsx20(FeatureErrorBoundary, { url, children: /* @__PURE__ */ jsx20(Suspense, { fallback: /* @__PURE__ */ jsx20(Loader, {}), children: /* @__PURE__ */ jsx20(LazyFeature, { ...props, ...params }) }) });
|
|
2498
|
+
}
|
|
2499
|
+
var Feature = React17.memo(RawFeature);
|
|
2500
|
+
Feature.displayName = "Feature";
|
|
2501
|
+
registerComponent("Feature", Feature, "view");
|
|
2502
|
+
|
|
2503
|
+
// ../vuu-shell/src/layout-management/SaveLayoutPanel.tsx
|
|
2504
|
+
import { useEffect as useEffect5, useState as useState9 } from "react";
|
|
2505
|
+
import { Input, Button as Button3, FormField, FormFieldLabel, Text } from "@salt-ds/core";
|
|
2506
|
+
import { ComboBox, Checkbox, RadioButton } from "@vuu-ui/vuu-ui-controls";
|
|
2507
|
+
import { formatDate, takeScreenshot } from "@vuu-ui/vuu-utils";
|
|
2508
|
+
import { jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2509
|
+
var classBase9 = "saveLayoutPanel";
|
|
2510
|
+
var formField = `${classBase9}-formField`;
|
|
2511
|
+
|
|
2512
|
+
// ../vuu-shell/src/layout-management/LayoutList.tsx
|
|
2513
|
+
import { List } from "@vuu-ui/vuu-ui-controls";
|
|
2514
|
+
|
|
2515
|
+
// ../vuu-shell/src/layout-management/useLayoutManager.tsx
|
|
2516
|
+
import React18, { useState as useState10, useCallback as useCallback16, useContext as useContext3, useEffect as useEffect6 } from "react";
|
|
2517
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2518
|
+
var persistenceManager = new LocalLayoutPersistenceManager();
|
|
2519
|
+
var LayoutManagementContext = React18.createContext({
|
|
2520
|
+
layoutMetadata: [],
|
|
2521
|
+
saveLayout: () => {
|
|
2522
|
+
},
|
|
2523
|
+
applicationLayout: defaultLayout,
|
|
2524
|
+
saveApplicationLayout: () => {
|
|
2525
|
+
},
|
|
2526
|
+
loadLayoutById: () => defaultLayout
|
|
2527
|
+
});
|
|
2528
|
+
|
|
2529
|
+
// ../vuu-shell/src/layout-management/LayoutList.tsx
|
|
2530
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2531
|
+
|
|
2532
|
+
// ../vuu-icons/src/VuuLogo.tsx
|
|
2533
|
+
import { memo } from "react";
|
|
2534
|
+
import { jsx as jsx24, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2535
|
+
var VuuLogo = memo(() => {
|
|
2536
|
+
return /* @__PURE__ */ jsxs8(
|
|
2537
|
+
"svg",
|
|
2538
|
+
{
|
|
2539
|
+
width: "44",
|
|
2540
|
+
height: "45",
|
|
2541
|
+
viewBox: "0 0 44 45",
|
|
2542
|
+
fill: "none",
|
|
2543
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2544
|
+
children: [
|
|
2545
|
+
/* @__PURE__ */ jsxs8("g", { clipPath: "url(#clip0_217_6990)", children: [
|
|
2546
|
+
/* @__PURE__ */ jsx24(
|
|
2547
|
+
"path",
|
|
2548
|
+
{
|
|
2549
|
+
d: "M39.8642 15.5509L35.9196 7.58974L34.3369 6.85464L24.6235 22.0825L39.1628 30.618L42.3152 25.6347L39.8642 15.5509Z",
|
|
2550
|
+
fill: "url(#paint0_linear_217_6990)"
|
|
2551
|
+
}
|
|
2552
|
+
),
|
|
2553
|
+
/* @__PURE__ */ jsx24(
|
|
2554
|
+
"path",
|
|
2555
|
+
{
|
|
2556
|
+
d: "M42.6246 24.8716C41.9199 25.9157 40.9625 26.824 39.767 27.4905C38.424 28.2396 36.9563 28.597 35.5081 28.597C32.7541 28.597 30.0715 27.3094 28.4466 24.9855L15.772 3.90967L15.7655 3.9206C13.3615 0.137431 8.25372 -1.13143 4.24754 1.10507C0.178173 3.37435 -1.20852 8.39359 1.14854 12.3125L18.3445 40.9095C19.1108 42.1846 20.1816 43.1834 21.4144 43.8764C21.4241 43.8826 21.4338 43.8889 21.4435 43.8951C21.4484 43.8982 21.4549 43.9013 21.4597 43.9045C22.0332 44.2228 22.6423 44.471 23.2725 44.6536C23.3194 44.6677 23.368 44.6817 23.415 44.6942C23.6418 44.7551 23.8702 44.8097 24.1019 44.8534C24.1456 44.8612 24.1894 44.8659 24.2331 44.8737C24.4194 44.9049 24.6073 44.9314 24.7952 44.9501C24.8698 44.9579 24.9443 44.9658 25.0188 44.9704C25.2342 44.9876 25.4497 44.9985 25.6668 45.0001C25.6781 45.0001 25.6895 45.0001 25.6992 45.0001C25.7024 45.0001 25.704 45.0001 25.7073 45.0001C25.7105 45.0001 25.7121 45.0001 25.7154 45.0001C25.9503 45.0001 26.1868 44.9876 26.4217 44.9689C26.4751 44.9642 26.5286 44.9595 26.5837 44.9533C26.8137 44.9299 27.0438 44.9002 27.2738 44.8596C27.277 44.8596 27.2803 44.8596 27.2835 44.8596C27.5362 44.8144 27.7889 44.7551 28.0384 44.6864C28.0546 44.6817 28.0692 44.677 28.0854 44.6723C28.4483 44.5709 28.8063 44.4445 29.1594 44.2931C29.1659 44.29 29.174 44.2868 29.1805 44.2837C29.4494 44.1682 29.7151 44.0418 29.9759 43.8967C30.24 43.75 30.491 43.5908 30.7308 43.4206C30.9398 43.2739 31.1407 43.1179 31.3367 42.9524C31.5748 42.7495 31.8 42.5373 32.009 42.3141C32.1661 42.1471 32.3168 41.9723 32.4609 41.7913C32.5079 41.732 32.5517 41.6711 32.5954 41.6118C32.6942 41.4807 32.7882 41.3465 32.8789 41.2091C32.9259 41.1373 32.9728 41.0671 33.0182 40.9953C33.036 40.9672 33.0555 40.9407 33.0717 40.9126L42.7153 24.8763H42.6214L42.6246 24.8716Z",
|
|
2557
|
+
fill: "url(#paint1_linear_217_6990)"
|
|
2558
|
+
}
|
|
2559
|
+
),
|
|
2560
|
+
/* @__PURE__ */ jsx24(
|
|
2561
|
+
"path",
|
|
2562
|
+
{
|
|
2563
|
+
d: "M42.8402 16.4218L42.1112 15.2232L38.9636 9.58433L37.504 7.19644C37.2286 6.56123 36.579 6.11331 35.8176 6.11331C34.8083 6.11331 33.9919 6.90147 33.9919 7.87223C33.9919 8.20154 34.0907 8.50432 34.2543 8.76808L34.2349 8.78056L39.9048 18.0808C40.5884 19.2186 40.7715 20.5437 40.4199 21.8141C40.0684 23.0845 39.226 24.1458 38.045 24.806C37.2675 25.2398 36.3846 25.4693 35.4936 25.4693C33.6727 25.4693 31.9766 24.5281 31.0662 23.0143L22.9161 9.63271H22.9323L19.4899 3.90958L19.4834 3.92051C19.4235 3.8253 19.3538 3.73947 19.2907 3.64738L19.1935 3.48663C19.1935 3.48663 19.1854 3.49131 19.1821 3.49443C17.5654 1.27666 14.9799 0.0390178 12.3118 0.00936427V0H7.91199V0.02185C10.9851 -0.184164 14.0582 1.23296 15.7656 3.92051L15.7721 3.90958L28.4451 24.987C30.0699 27.3093 32.7542 28.5985 35.5066 28.5985C36.9548 28.5985 38.4225 28.2426 39.7655 27.4919C40.961 26.8255 41.9168 25.9156 42.6231 24.8731H42.717L42.6846 24.9261C43.1366 24.2347 43.4833 23.4731 43.7068 22.6615C44.2916 20.5452 43.9871 18.3352 42.8369 16.4234L42.8402 16.4218Z",
|
|
2564
|
+
fill: "#F37880"
|
|
2565
|
+
}
|
|
2566
|
+
),
|
|
2567
|
+
/* @__PURE__ */ jsxs8("g", { opacity: "0.86", children: [
|
|
2568
|
+
/* @__PURE__ */ jsx24(
|
|
2569
|
+
"path",
|
|
2570
|
+
{
|
|
2571
|
+
d: "M34.2332 8.78212L39.9031 18.0824C40.5868 19.2202 40.7698 20.5452 40.4183 21.8156C40.2044 22.5897 39.8059 23.2858 39.2616 23.8617C39.9744 23.2343 40.4879 22.4243 40.7423 21.5035C41.0938 20.2331 40.9107 18.908 40.2271 17.7703L34.5572 8.46998L34.5767 8.4575C34.413 8.19374 34.3142 7.89096 34.3142 7.56165C34.3142 7.15586 34.4584 6.78285 34.6982 6.48476C34.2672 6.80626 33.9902 7.30881 33.9902 7.87379C33.9902 8.2031 34.0891 8.50588 34.2527 8.76964L34.2332 8.78212Z",
|
|
2572
|
+
fill: "white"
|
|
2573
|
+
}
|
|
2574
|
+
),
|
|
2575
|
+
/* @__PURE__ */ jsx24(
|
|
2576
|
+
"path",
|
|
2577
|
+
{
|
|
2578
|
+
d: "M42.6917 24.9169L42.6863 24.9256C42.6863 24.9256 42.6899 24.9187 42.6935 24.9152C42.6935 24.9152 42.6935 24.9152 42.6935 24.9169H42.6917Z",
|
|
2579
|
+
fill: "white"
|
|
2580
|
+
}
|
|
2581
|
+
),
|
|
2582
|
+
/* @__PURE__ */ jsx24(
|
|
2583
|
+
"path",
|
|
2584
|
+
{
|
|
2585
|
+
d: "M40.0911 27.1798C38.7481 27.9289 37.2804 28.2863 35.8322 28.2863C33.0782 28.2863 30.3955 26.9988 28.7707 24.6749L16.0961 3.59744L16.0896 3.60837C14.9281 1.78077 13.1364 0.543128 11.1422 0H7.91199V0.02185C10.9851 -0.184164 14.0582 1.23296 15.7656 3.92051L15.7721 3.90958L28.4451 24.987C30.0699 27.3093 32.7542 28.5985 35.5066 28.5985C36.9548 28.5985 38.4225 28.2426 39.7655 27.4919C40.4815 27.0924 41.1084 26.6055 41.6511 26.0561C41.1862 26.479 40.6662 26.8583 40.0894 27.1798H40.0911Z",
|
|
2586
|
+
fill: "white"
|
|
2587
|
+
}
|
|
2588
|
+
)
|
|
2589
|
+
] })
|
|
2590
|
+
] }),
|
|
2591
|
+
/* @__PURE__ */ jsxs8("defs", { children: [
|
|
2592
|
+
/* @__PURE__ */ jsxs8(
|
|
2593
|
+
"linearGradient",
|
|
2594
|
+
{
|
|
2595
|
+
id: "paint0_linear_217_6990",
|
|
2596
|
+
x1: "24.6235",
|
|
2597
|
+
y1: "18.7363",
|
|
2598
|
+
x2: "42.3152",
|
|
2599
|
+
y2: "18.7363",
|
|
2600
|
+
gradientUnits: "userSpaceOnUse",
|
|
2601
|
+
children: [
|
|
2602
|
+
/* @__PURE__ */ jsx24("stop", { stopColor: "#4906A5" }),
|
|
2603
|
+
/* @__PURE__ */ jsx24("stop", { offset: "1", stopColor: "#D3423A" })
|
|
2604
|
+
]
|
|
2605
|
+
}
|
|
2606
|
+
),
|
|
2607
|
+
/* @__PURE__ */ jsxs8(
|
|
2608
|
+
"linearGradient",
|
|
2609
|
+
{
|
|
2610
|
+
id: "paint1_linear_217_6990",
|
|
2611
|
+
x1: "-2.35794e-05",
|
|
2612
|
+
y1: "22.5009",
|
|
2613
|
+
x2: "42.7186",
|
|
2614
|
+
y2: "22.5009",
|
|
2615
|
+
gradientUnits: "userSpaceOnUse",
|
|
2616
|
+
children: [
|
|
2617
|
+
/* @__PURE__ */ jsx24("stop", { stopColor: "#7C06A5" }),
|
|
2618
|
+
/* @__PURE__ */ jsx24("stop", { offset: "1", stopColor: "#D3423A" })
|
|
2619
|
+
]
|
|
2620
|
+
}
|
|
2621
|
+
),
|
|
2622
|
+
/* @__PURE__ */ jsx24("clipPath", { id: "clip0_217_6990", children: /* @__PURE__ */ jsx24("rect", { width: "44", height: "45", fill: "white" }) })
|
|
2623
|
+
] })
|
|
2624
|
+
]
|
|
2625
|
+
}
|
|
2626
|
+
);
|
|
2627
|
+
});
|
|
2628
|
+
VuuLogo.displayName = "VuuLogo";
|
|
2629
|
+
|
|
2630
|
+
// ../vuu-shell/src/left-nav/LeftNav.tsx
|
|
2631
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
2632
|
+
import { Tab, Tabstrip } from "@vuu-ui/vuu-ui-controls";
|
|
2633
|
+
import { useCallback as useCallback17, useState as useState11 } from "react";
|
|
2634
|
+
|
|
2635
|
+
// ../vuu-shell/src/feature-list/FeatureList.tsx
|
|
2636
|
+
import { jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2637
|
+
|
|
2638
|
+
// ../vuu-shell/src/theme-provider/ThemeProvider.tsx
|
|
2639
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
2640
|
+
import {
|
|
2641
|
+
createContext as createContext2,
|
|
2642
|
+
isValidElement as isValidElement4,
|
|
2643
|
+
cloneElement as cloneElement5,
|
|
2644
|
+
useContext as useContext4
|
|
2645
|
+
} from "react";
|
|
2646
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2647
|
+
var DEFAULT_DENSITY = "medium";
|
|
2648
|
+
var DEFAULT_THEME = "salt-theme";
|
|
2649
|
+
var DEFAULT_THEME_MODE = "light";
|
|
2650
|
+
var ThemeContext = createContext2({
|
|
2651
|
+
density: "high",
|
|
2652
|
+
theme: "vuu",
|
|
2653
|
+
themeMode: "light"
|
|
2654
|
+
});
|
|
2655
|
+
var createThemedChildren = (children, theme, themeMode, density) => {
|
|
2656
|
+
var _a2;
|
|
2657
|
+
if (isValidElement4(children)) {
|
|
2658
|
+
return cloneElement5(children, {
|
|
2659
|
+
className: (0, import_classnames13.default)(
|
|
2660
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2661
|
+
(_a2 = children.props) == null ? void 0 : _a2.className,
|
|
2662
|
+
`${theme}-theme`,
|
|
2663
|
+
`${theme}-density-${density}`
|
|
2664
|
+
),
|
|
2665
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2666
|
+
// @ts-expect-error
|
|
2667
|
+
"data-mode": themeMode
|
|
2668
|
+
});
|
|
2669
|
+
} else {
|
|
2670
|
+
console.warn(
|
|
2671
|
+
`
|
|
2672
|
+
ThemeProvider can only apply CSS classes for theming to a single nested child element of the ThemeProvider.
|
|
2673
|
+
Wrap elements with a single container`
|
|
2674
|
+
);
|
|
2675
|
+
return children;
|
|
2676
|
+
}
|
|
2677
|
+
};
|
|
2678
|
+
var ThemeProvider = ({
|
|
2679
|
+
applyThemeClasses = false,
|
|
2680
|
+
children,
|
|
2681
|
+
theme: themeProp,
|
|
2682
|
+
themeMode: themeModeProp,
|
|
2683
|
+
density: densityProp
|
|
2684
|
+
}) => {
|
|
2685
|
+
var _a2, _b, _c;
|
|
2686
|
+
const {
|
|
2687
|
+
density: inheritedDensity,
|
|
2688
|
+
themeMode: inheritedThemeMode,
|
|
2689
|
+
theme: inheritedTheme
|
|
2690
|
+
} = useContext4(ThemeContext);
|
|
2691
|
+
const density = (_a2 = densityProp != null ? densityProp : inheritedDensity) != null ? _a2 : DEFAULT_DENSITY;
|
|
2692
|
+
const themeMode = (_b = themeModeProp != null ? themeModeProp : inheritedThemeMode) != null ? _b : DEFAULT_THEME_MODE;
|
|
2693
|
+
const theme = (_c = themeProp != null ? themeProp : inheritedTheme) != null ? _c : DEFAULT_THEME;
|
|
2694
|
+
const themedChildren = applyThemeClasses ? createThemedChildren(children, theme, themeMode, density) : children;
|
|
2695
|
+
return /* @__PURE__ */ jsx26(ThemeContext.Provider, { value: { themeMode, density, theme }, children: themedChildren });
|
|
2696
|
+
};
|
|
2697
|
+
ThemeProvider.displayName = "ThemeProvider";
|
|
2698
|
+
|
|
2699
|
+
// ../vuu-shell/src/left-nav/LeftNav.tsx
|
|
2700
|
+
import { jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2701
|
+
|
|
2702
|
+
// ../vuu-shell/src/login/LoginPanel.tsx
|
|
2703
|
+
import { useState as useState12 } from "react";
|
|
2704
|
+
import { Button as Button4, FormField as FormField2, FormFieldLabel as FormFieldLabel2, Input as Input2 } from "@salt-ds/core";
|
|
2705
|
+
import { jsx as jsx28, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2706
|
+
|
|
2707
|
+
// ../vuu-shell/src/login/login-utils.ts
|
|
2708
|
+
import { getCookieValue } from "@vuu-ui/vuu-utils";
|
|
2709
|
+
var getAuthModeFromCookies = () => {
|
|
2710
|
+
const mode = getCookieValue("vuu-auth-mode");
|
|
2711
|
+
return mode != null ? mode : "";
|
|
2712
|
+
};
|
|
2713
|
+
var getDefaultLoginUrl = () => {
|
|
2714
|
+
const authMode = getAuthModeFromCookies();
|
|
2715
|
+
return authMode === "login" ? "login.html" : "demo.html";
|
|
2716
|
+
};
|
|
2717
|
+
var redirectToLogin = (loginUrl = getDefaultLoginUrl()) => {
|
|
2718
|
+
window.location.href = loginUrl;
|
|
2719
|
+
};
|
|
2720
|
+
var logout = (loginUrl) => {
|
|
2721
|
+
document.cookie = "vuu-username= ; expires = Thu, 01 Jan 1970 00:00:00 GMT";
|
|
2722
|
+
document.cookie = "vuu-auth-token= ; expires = Thu, 01 Jan 1970 00:00:00 GMT";
|
|
2723
|
+
redirectToLogin(loginUrl);
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
// ../vuu-shell/src/session-editing-form/SessionEditingForm.tsx
|
|
2727
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
2728
|
+
import {
|
|
2729
|
+
useCallback as useCallback18,
|
|
2730
|
+
useEffect as useEffect7,
|
|
2731
|
+
useMemo as useMemo7,
|
|
2732
|
+
useRef as useRef12,
|
|
2733
|
+
useState as useState13
|
|
2734
|
+
} from "react";
|
|
2735
|
+
import { useIdMemo } from "@salt-ds/core";
|
|
2736
|
+
import { Button as Button5 } from "@salt-ds/core";
|
|
2737
|
+
import {
|
|
2738
|
+
hasAction,
|
|
2739
|
+
isErrorResponse,
|
|
2740
|
+
RemoteDataSource
|
|
2741
|
+
} from "@vuu-ui/vuu-data";
|
|
2742
|
+
import {
|
|
2743
|
+
buildColumnMap,
|
|
2744
|
+
isValidNumber,
|
|
2745
|
+
shallowEquals
|
|
2746
|
+
} from "@vuu-ui/vuu-utils";
|
|
2747
|
+
import { jsx as jsx29, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2748
|
+
|
|
2749
|
+
// ../vuu-shell/src/shell.tsx
|
|
2750
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
2751
|
+
import { connectToServer } from "@vuu-ui/vuu-data";
|
|
2752
|
+
import {
|
|
2753
|
+
useCallback as useCallback24,
|
|
2754
|
+
useEffect as useEffect9,
|
|
2755
|
+
useRef as useRef14
|
|
2756
|
+
} from "react";
|
|
2757
|
+
|
|
2758
|
+
// ../vuu-shell/src/app-header/AppHeader.tsx
|
|
2759
|
+
import { useCallback as useCallback21 } from "react";
|
|
2760
|
+
|
|
2761
|
+
// ../vuu-shell/src/user-profile/UserProfile.tsx
|
|
2762
|
+
import { Button as Button7 } from "@salt-ds/core";
|
|
2763
|
+
import { DropdownBase } from "@salt-ds/lab";
|
|
2764
|
+
|
|
2765
|
+
// ../../node_modules/@salt-ds/icons/dist-es/icon/Icon.js
|
|
2766
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2243
2767
|
import { forwardRef as forwardRef6 } from "react";
|
|
2244
2768
|
|
|
2769
|
+
// ../../node_modules/@salt-ds/icons/node_modules/clsx/dist/clsx.mjs
|
|
2770
|
+
function r(e) {
|
|
2771
|
+
var t, f, n = "";
|
|
2772
|
+
if ("string" == typeof e || "number" == typeof e)
|
|
2773
|
+
n += e;
|
|
2774
|
+
else if ("object" == typeof e)
|
|
2775
|
+
if (Array.isArray(e))
|
|
2776
|
+
for (t = 0; t < e.length; t++)
|
|
2777
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
2778
|
+
else
|
|
2779
|
+
for (t in e)
|
|
2780
|
+
e[t] && (n && (n += " "), n += t);
|
|
2781
|
+
return n;
|
|
2782
|
+
}
|
|
2783
|
+
function clsx() {
|
|
2784
|
+
for (var e, t, f = 0, n = ""; f < arguments.length; )
|
|
2785
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
2786
|
+
return n;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
// ../../node_modules/@salt-ds/window/dist-es/WindowProvider.js
|
|
2790
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2791
|
+
import { createContext as createContext3, useContext as useContext5 } from "react";
|
|
2792
|
+
var WindowContext = createContext3(
|
|
2793
|
+
typeof window !== "undefined" ? window : null
|
|
2794
|
+
);
|
|
2795
|
+
if (true) {
|
|
2796
|
+
WindowContext.displayName = "WindowContext";
|
|
2797
|
+
}
|
|
2798
|
+
function useWindow() {
|
|
2799
|
+
return useContext5(WindowContext);
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
// ../../node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js
|
|
2803
|
+
import * as React20 from "react";
|
|
2804
|
+
|
|
2805
|
+
// ../../node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js
|
|
2806
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2807
|
+
import { createContext as createContext4, useMemo as useMemo8, useContext as useContext6 } from "react";
|
|
2808
|
+
var InsertionPointContext = createContext4(null);
|
|
2809
|
+
if (true) {
|
|
2810
|
+
InsertionPointContext.displayName = "InsertionPointContext";
|
|
2811
|
+
}
|
|
2812
|
+
function useInsertionPoint() {
|
|
2813
|
+
const value = useContext6(InsertionPointContext);
|
|
2814
|
+
return value;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
// ../../node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js
|
|
2818
|
+
var _a;
|
|
2819
|
+
var maybeUseInsertionEffect = (_a = React20[`${"useInsertionEffect"}${""}`]) != null ? _a : React20.useLayoutEffect;
|
|
2820
|
+
var windowSheetsMap = /* @__PURE__ */ new WeakMap();
|
|
2821
|
+
function useComponentCssInjection({
|
|
2822
|
+
testId,
|
|
2823
|
+
css,
|
|
2824
|
+
window: targetWindow
|
|
2825
|
+
}) {
|
|
2826
|
+
const insertionPoint = useInsertionPoint();
|
|
2827
|
+
maybeUseInsertionEffect(() => {
|
|
2828
|
+
var _a2, _b;
|
|
2829
|
+
if (!targetWindow) {
|
|
2830
|
+
return;
|
|
2831
|
+
}
|
|
2832
|
+
const sheetsMap = (_a2 = windowSheetsMap.get(targetWindow)) != null ? _a2 : /* @__PURE__ */ new Map();
|
|
2833
|
+
const styleMap = (_b = sheetsMap.get(css)) != null ? _b : { styleElement: null, count: 0 };
|
|
2834
|
+
if (styleMap.styleElement == null) {
|
|
2835
|
+
styleMap.styleElement = targetWindow.document.createElement("style");
|
|
2836
|
+
styleMap.styleElement.setAttribute("type", "text/css");
|
|
2837
|
+
styleMap.styleElement.setAttribute("data-salt-style", testId || "");
|
|
2838
|
+
styleMap.styleElement.textContent = css;
|
|
2839
|
+
styleMap.count = 1;
|
|
2840
|
+
targetWindow.document.head.insertBefore(
|
|
2841
|
+
styleMap.styleElement,
|
|
2842
|
+
insertionPoint || targetWindow.document.head.firstChild
|
|
2843
|
+
);
|
|
2844
|
+
} else {
|
|
2845
|
+
styleMap.styleElement.textContent = css;
|
|
2846
|
+
styleMap.count++;
|
|
2847
|
+
}
|
|
2848
|
+
sheetsMap.set(css, styleMap);
|
|
2849
|
+
windowSheetsMap.set(targetWindow, sheetsMap);
|
|
2850
|
+
return () => {
|
|
2851
|
+
const sheetsMap2 = windowSheetsMap.get(targetWindow);
|
|
2852
|
+
const styleMap2 = sheetsMap2 == null ? void 0 : sheetsMap2.get(css);
|
|
2853
|
+
if (styleMap2 == null ? void 0 : styleMap2.styleElement) {
|
|
2854
|
+
styleMap2.count--;
|
|
2855
|
+
if (styleMap2.count < 1) {
|
|
2856
|
+
targetWindow.document.head.removeChild(styleMap2.styleElement);
|
|
2857
|
+
styleMap2.styleElement = null;
|
|
2858
|
+
sheetsMap2 == null ? void 0 : sheetsMap2.delete(css);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
};
|
|
2862
|
+
}, [testId, css, targetWindow]);
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
// ../../node_modules/@salt-ds/icons/dist-es/icon/Icon.css.js
|
|
2866
|
+
var css_248z = "/* Style applied to the root element */\n.saltIcon {\n --icon-color: var(--saltIcon-color, var(--salt-text-secondary-foreground));\n --icon-size-multiplier: var(--saltIcon-size-multiplier, 1);\n --icon-base-size: var(--salt-icon-size-base, 12px);\n /**\n * Icon size will be the multiplier (an integer from the size prop) * the base size (set by the theme per density)\n * Icons should never be smaller than 12px for readability so we've added a max() to enforce this\n * Consumers can use --saltIcon-size variable to override this rule as an escape hatch\n */\n --icon-size: var(--saltIcon-size, max(calc(var(--icon-base-size) * var(--icon-size-multiplier)), 12px));\n}\n\n.saltIcon {\n fill: var(--saltIcon-color, var(--icon-color));\n display: inline-block;\n margin: var(--saltIcon-margin, 0);\n position: relative;\n width: var(--icon-size);\n height: var(--icon-size);\n min-width: var(--icon-size);\n min-height: var(--icon-size);\n}\n\n.saltIcon:hover {\n --icon-color: var(--saltIcon-color-hover, var(--salt-text-secondary-foreground));\n}\n\n.saltIcon:active {\n --icon-color: var(--saltIcon-color-active, var(--salt-text-secondary-foreground));\n}\n";
|
|
2867
|
+
|
|
2868
|
+
// ../../node_modules/@salt-ds/icons/dist-es/icon/Icon.js
|
|
2869
|
+
var makePrefixer = (prefix) => (...names) => [prefix, ...names].join("-");
|
|
2870
|
+
var withBaseName = makePrefixer("saltIcon");
|
|
2871
|
+
var DEFAULT_ICON_SIZE = 1;
|
|
2872
|
+
var Icon = forwardRef6(function Icon2({ children, className, size = DEFAULT_ICON_SIZE, style: styleProp, ...rest }, ref) {
|
|
2873
|
+
const targetWindow = useWindow();
|
|
2874
|
+
useComponentCssInjection({
|
|
2875
|
+
testId: "salt-icon",
|
|
2876
|
+
css: css_248z,
|
|
2877
|
+
window: targetWindow
|
|
2878
|
+
});
|
|
2879
|
+
const style = {
|
|
2880
|
+
...styleProp,
|
|
2881
|
+
"--saltIcon-size-multiplier": `${size}`
|
|
2882
|
+
};
|
|
2883
|
+
return /* @__PURE__ */ jsx32("svg", {
|
|
2884
|
+
className: clsx(withBaseName(), className),
|
|
2885
|
+
style,
|
|
2886
|
+
role: "img",
|
|
2887
|
+
...rest,
|
|
2888
|
+
ref,
|
|
2889
|
+
children: /* @__PURE__ */ jsx32("g", {
|
|
2890
|
+
"aria-hidden": true,
|
|
2891
|
+
children
|
|
2892
|
+
})
|
|
2893
|
+
});
|
|
2894
|
+
});
|
|
2895
|
+
|
|
2896
|
+
// ../../node_modules/@salt-ds/icons/dist-es/components/Export.js
|
|
2897
|
+
import { jsxs as jsxs13, jsx as jsx33 } from "react/jsx-runtime";
|
|
2898
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
2899
|
+
var ExportIcon = forwardRef7(
|
|
2900
|
+
function ExportIcon2(props, ref) {
|
|
2901
|
+
return /* @__PURE__ */ jsxs13(Icon, {
|
|
2902
|
+
"data-testid": "ExportIcon",
|
|
2903
|
+
"aria-label": "export",
|
|
2904
|
+
viewBox: "0 0 12 12",
|
|
2905
|
+
ref,
|
|
2906
|
+
...props,
|
|
2907
|
+
children: [
|
|
2908
|
+
/* @__PURE__ */ jsx33("path", {
|
|
2909
|
+
d: "M5 1H1v10h4v-1H2V2h3V1Z"
|
|
2910
|
+
}),
|
|
2911
|
+
/* @__PURE__ */ jsx33("path", {
|
|
2912
|
+
d: "M3 5h5V3l4 3-4 3V7H3V5Z"
|
|
2913
|
+
})
|
|
2914
|
+
]
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
);
|
|
2918
|
+
|
|
2919
|
+
// ../vuu-shell/src/user-profile/UserPanel.tsx
|
|
2920
|
+
import { formatDate as formatDate2 } from "@vuu-ui/vuu-utils";
|
|
2921
|
+
import { List as List2, ListItem } from "@salt-ds/lab";
|
|
2922
|
+
import { Button as Button6 } from "@salt-ds/core";
|
|
2923
|
+
import {
|
|
2924
|
+
forwardRef as forwardRef8,
|
|
2925
|
+
useCallback as useCallback19,
|
|
2926
|
+
useEffect as useEffect8,
|
|
2927
|
+
useState as useState14
|
|
2928
|
+
} from "react";
|
|
2929
|
+
|
|
2930
|
+
// ../vuu-shell/src/get-layout-history.ts
|
|
2931
|
+
var getLayoutHistory = async (user) => {
|
|
2932
|
+
const history = await fetch(`api/vui/${user.username}`, {}).then((response) => {
|
|
2933
|
+
return response.ok ? response.json() : null;
|
|
2934
|
+
}).catch(() => {
|
|
2935
|
+
console.log("error getting history");
|
|
2936
|
+
});
|
|
2937
|
+
return history;
|
|
2938
|
+
};
|
|
2939
|
+
|
|
2940
|
+
// ../vuu-shell/src/user-profile/UserPanel.tsx
|
|
2941
|
+
import { jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2942
|
+
var byLastUpdate = ({ lastUpdate: l1 }, { lastUpdate: l2 }) => {
|
|
2943
|
+
return l2 === l1 ? 0 : l2 < l1 ? -1 : 1;
|
|
2944
|
+
};
|
|
2945
|
+
var HistoryListItem = (props) => {
|
|
2946
|
+
return /* @__PURE__ */ jsx34(ListItem, { ...props });
|
|
2947
|
+
};
|
|
2948
|
+
var UserPanel = forwardRef8(function UserPanel2({ loginUrl, onNavigate, user, layoutId = "latest" }, forwardedRef) {
|
|
2949
|
+
const [history, setHistory] = useState14([]);
|
|
2950
|
+
useEffect8(() => {
|
|
2951
|
+
async function getHistory() {
|
|
2952
|
+
const history2 = await getLayoutHistory(user);
|
|
2953
|
+
const sortedHistory = history2.filter((item) => item.id !== "latest").sort(byLastUpdate).map(({ id, lastUpdate }) => ({
|
|
2954
|
+
lastUpdate,
|
|
2955
|
+
id,
|
|
2956
|
+
label: `Saved at ${formatDate2(new Date(lastUpdate), "kk:mm:ss")}`
|
|
2957
|
+
}));
|
|
2958
|
+
console.log({ sortedHistory });
|
|
2959
|
+
setHistory(sortedHistory);
|
|
2960
|
+
}
|
|
2961
|
+
getHistory();
|
|
2962
|
+
}, [user]);
|
|
2963
|
+
const handleHisorySelected = useCallback19(
|
|
2964
|
+
(evt, selected2) => {
|
|
2965
|
+
if (selected2) {
|
|
2966
|
+
onNavigate(selected2.id);
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2969
|
+
[onNavigate]
|
|
2970
|
+
);
|
|
2971
|
+
const handleLogout = useCallback19(() => {
|
|
2972
|
+
logout(loginUrl);
|
|
2973
|
+
}, [loginUrl]);
|
|
2974
|
+
const selected = history.length === 0 ? null : layoutId === "latest" ? history[0] : history.find((i) => i.id === layoutId);
|
|
2975
|
+
return /* @__PURE__ */ jsxs14("div", { className: "vuuUserPanel", ref: forwardedRef, children: [
|
|
2976
|
+
/* @__PURE__ */ jsx34(
|
|
2977
|
+
List2,
|
|
2978
|
+
{
|
|
2979
|
+
ListItem: HistoryListItem,
|
|
2980
|
+
className: "vuuUserPanel-history",
|
|
2981
|
+
onSelect: handleHisorySelected,
|
|
2982
|
+
selected,
|
|
2983
|
+
source: history
|
|
2984
|
+
}
|
|
2985
|
+
),
|
|
2986
|
+
/* @__PURE__ */ jsx34("div", { className: "vuuUserPanel-buttonBar", children: /* @__PURE__ */ jsxs14(Button6, { "aria-label": "logout", onClick: handleLogout, children: [
|
|
2987
|
+
/* @__PURE__ */ jsx34(ExportIcon, {}),
|
|
2988
|
+
" Logout"
|
|
2989
|
+
] }) })
|
|
2990
|
+
] });
|
|
2991
|
+
});
|
|
2992
|
+
|
|
2993
|
+
// ../vuu-shell/src/user-profile/UserProfile.tsx
|
|
2994
|
+
import { jsx as jsx35, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2995
|
+
|
|
2996
|
+
// ../vuu-shell/src/theme-switch/ThemeSwitch.tsx
|
|
2997
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
2998
|
+
import { ToggleButton, ToggleButtonGroup, useControlled as useControlled2 } from "@salt-ds/core";
|
|
2999
|
+
import { useCallback as useCallback20 } from "react";
|
|
3000
|
+
import { jsx as jsx36, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3001
|
+
|
|
3002
|
+
// ../vuu-shell/src/app-header/AppHeader.tsx
|
|
3003
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
3004
|
+
import { jsx as jsx37, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3005
|
+
|
|
3006
|
+
// ../vuu-shell/src/shell.tsx
|
|
3007
|
+
import { logger } from "@vuu-ui/vuu-utils";
|
|
3008
|
+
|
|
3009
|
+
// ../vuu-shell/src/shell-layouts/context-panel/ContextPanel.tsx
|
|
3010
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
3011
|
+
import { Button as Button8 } from "@salt-ds/core";
|
|
3012
|
+
import { useCallback as useCallback22, useMemo as useMemo9 } from "react";
|
|
3013
|
+
import { jsx as jsx38, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3014
|
+
|
|
3015
|
+
// ../vuu-shell/src/shell-layouts/useFullHeightLeftPanel.tsx
|
|
3016
|
+
import { jsx as jsx39, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3017
|
+
|
|
3018
|
+
// ../vuu-shell/src/shell-layouts/useInlayLeftPanel.tsx
|
|
3019
|
+
import { useCallback as useCallback23, useRef as useRef13, useState as useState15 } from "react";
|
|
3020
|
+
import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3021
|
+
|
|
3022
|
+
// ../vuu-shell/src/shell.tsx
|
|
3023
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3024
|
+
var { error } = logger("Shell");
|
|
3025
|
+
|
|
3026
|
+
// ../vuu-shell/src/ShellContextProvider.tsx
|
|
3027
|
+
import { createContext as createContext5, useContext as useContext7 } from "react";
|
|
3028
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3029
|
+
var defaultConfig = {};
|
|
3030
|
+
var ShellContext = createContext5(defaultConfig);
|
|
3031
|
+
|
|
3032
|
+
// ../vuu-layout/src/layout-persistence/useLayoutContextMenuItems.tsx
|
|
3033
|
+
import { useCallback as useCallback25, useMemo as useMemo10, useState as useState16 } from "react";
|
|
3034
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3035
|
+
|
|
3036
|
+
// ../vuu-layout/src/measured-container/MeasuredContainer.tsx
|
|
3037
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
3038
|
+
|
|
2245
3039
|
// ../vuu-layout/src/measured-container/useMeasuredContainer.ts
|
|
2246
|
-
import { isValidNumber } from "@vuu-ui/vuu-utils";
|
|
3040
|
+
import { isValidNumber as isValidNumber2 } from "@vuu-ui/vuu-utils";
|
|
2247
3041
|
import {
|
|
2248
|
-
useCallback as
|
|
2249
|
-
useEffect as
|
|
2250
|
-
useMemo as
|
|
2251
|
-
useRef as
|
|
2252
|
-
useState as
|
|
3042
|
+
useCallback as useCallback27,
|
|
3043
|
+
useEffect as useEffect11,
|
|
3044
|
+
useMemo as useMemo11,
|
|
3045
|
+
useRef as useRef16,
|
|
3046
|
+
useState as useState17
|
|
2253
3047
|
} from "react";
|
|
2254
3048
|
|
|
2255
3049
|
// ../vuu-layout/src/measured-container/useResizeObserver.ts
|
|
2256
|
-
import { useCallback as
|
|
3050
|
+
import { useCallback as useCallback26, useEffect as useEffect10, useRef as useRef15 } from "react";
|
|
2257
3051
|
var observedMap2 = /* @__PURE__ */ new Map();
|
|
2258
3052
|
var getTargetSize2 = (element, size, dimension3) => {
|
|
2259
3053
|
switch (dimension3) {
|
|
@@ -2304,8 +3098,8 @@ var resizeObserver2 = new ResizeObserver((entries) => {
|
|
|
2304
3098
|
}
|
|
2305
3099
|
});
|
|
2306
3100
|
function useResizeObserver2(ref, dimensions, onResize, reportInitialSize = false) {
|
|
2307
|
-
const dimensionsRef =
|
|
2308
|
-
const measure =
|
|
3101
|
+
const dimensionsRef = useRef15(dimensions);
|
|
3102
|
+
const measure = useCallback26((target) => {
|
|
2309
3103
|
const { width, height } = target.getBoundingClientRect();
|
|
2310
3104
|
const { clientWidth: contentWidth, clientHeight: contentHeight } = target;
|
|
2311
3105
|
return dimensionsRef.current.reduce(
|
|
@@ -2320,7 +3114,7 @@ function useResizeObserver2(ref, dimensions, onResize, reportInitialSize = false
|
|
|
2320
3114
|
{}
|
|
2321
3115
|
);
|
|
2322
3116
|
}, []);
|
|
2323
|
-
|
|
3117
|
+
useEffect10(() => {
|
|
2324
3118
|
const target = ref.current;
|
|
2325
3119
|
async function registerObserver() {
|
|
2326
3120
|
observedMap2.set(target, { measurements: {} });
|
|
@@ -2357,7 +3151,7 @@ function useResizeObserver2(ref, dimensions, onResize, reportInitialSize = false
|
|
|
2357
3151
|
}
|
|
2358
3152
|
};
|
|
2359
3153
|
}, [measure, ref]);
|
|
2360
|
-
|
|
3154
|
+
useEffect10(() => {
|
|
2361
3155
|
const target = ref.current;
|
|
2362
3156
|
const record = observedMap2.get(target);
|
|
2363
3157
|
if (record) {
|
|
@@ -2379,7 +3173,7 @@ var NO_MEASUREMENT2 = [];
|
|
|
2379
3173
|
var isNumber = (val) => Number.isFinite(val);
|
|
2380
3174
|
var FULL_SIZE = { height: "100%", width: "100%" };
|
|
2381
3175
|
var getInitialCssSize = (height, width) => {
|
|
2382
|
-
if (
|
|
3176
|
+
if (isValidNumber2(height) && isValidNumber2(width)) {
|
|
2383
3177
|
return {
|
|
2384
3178
|
height: `${height}px`,
|
|
2385
3179
|
width: `${width}px`
|
|
@@ -2394,7 +3188,7 @@ var getInitialCssSize = (height, width) => {
|
|
|
2394
3188
|
}
|
|
2395
3189
|
};
|
|
2396
3190
|
var getInitialInnerSize = (height, width) => {
|
|
2397
|
-
if (
|
|
3191
|
+
if (isValidNumber2(height) && isValidNumber2(width)) {
|
|
2398
3192
|
return {
|
|
2399
3193
|
height,
|
|
2400
3194
|
width
|
|
@@ -2408,8 +3202,8 @@ var useMeasuredContainer = ({
|
|
|
2408
3202
|
onResize: onResizeProp,
|
|
2409
3203
|
width
|
|
2410
3204
|
}) => {
|
|
2411
|
-
const containerRef =
|
|
2412
|
-
const [size, setSize] =
|
|
3205
|
+
const containerRef = useRef16(null);
|
|
3206
|
+
const [size, setSize] = useState17({
|
|
2413
3207
|
css: getInitialCssSize(height, width),
|
|
2414
3208
|
inner: getInitialInnerSize(height, width),
|
|
2415
3209
|
outer: {
|
|
@@ -2420,15 +3214,15 @@ var useMeasuredContainer = ({
|
|
|
2420
3214
|
const fixedHeight = typeof height === "number";
|
|
2421
3215
|
const fixedWidth = typeof width === "number";
|
|
2422
3216
|
const dimensions = fixedHeight && fixedWidth ? NO_MEASUREMENT2 : fixedHeight ? WidthOnly : fixedWidth ? HeightOnly : ClientWidthHeight;
|
|
2423
|
-
|
|
3217
|
+
useMemo11(() => {
|
|
2424
3218
|
setSize((currentSize) => {
|
|
2425
3219
|
const { inner, outer } = currentSize;
|
|
2426
|
-
if (
|
|
3220
|
+
if (isValidNumber2(height) && isValidNumber2(width) && inner && outer) {
|
|
2427
3221
|
const { height: innerHeight, width: innerWidth } = inner;
|
|
2428
3222
|
const { height: outerHeight, width: outerWidth } = outer;
|
|
2429
3223
|
if (outerHeight !== height || outerWidth !== width) {
|
|
2430
|
-
const heightDiff =
|
|
2431
|
-
const widthDiff =
|
|
3224
|
+
const heightDiff = isValidNumber2(outerHeight) ? outerHeight - innerHeight : 0;
|
|
3225
|
+
const widthDiff = isValidNumber2(outerWidth) ? outerWidth - innerWidth : 0;
|
|
2432
3226
|
return {
|
|
2433
3227
|
...currentSize,
|
|
2434
3228
|
outer: { height, width },
|
|
@@ -2439,7 +3233,7 @@ var useMeasuredContainer = ({
|
|
|
2439
3233
|
return currentSize;
|
|
2440
3234
|
});
|
|
2441
3235
|
}, [height, width]);
|
|
2442
|
-
const onResize =
|
|
3236
|
+
const onResize = useCallback27(
|
|
2443
3237
|
({ clientWidth, clientHeight }) => {
|
|
2444
3238
|
const { css, inner, outer } = size;
|
|
2445
3239
|
let newState = size;
|
|
@@ -2477,7 +3271,7 @@ var useMeasuredContainer = ({
|
|
|
2477
3271
|
},
|
|
2478
3272
|
[defaultHeight, defaultWidth, fixedHeight, fixedWidth, height, size, width]
|
|
2479
3273
|
);
|
|
2480
|
-
|
|
3274
|
+
useEffect11(() => {
|
|
2481
3275
|
if (size.inner) {
|
|
2482
3276
|
onResizeProp == null ? void 0 : onResizeProp(size.inner);
|
|
2483
3277
|
}
|
|
@@ -2492,11 +3286,11 @@ var useMeasuredContainer = ({
|
|
|
2492
3286
|
};
|
|
2493
3287
|
|
|
2494
3288
|
// ../vuu-layout/src/measured-container/MeasuredContainer.tsx
|
|
2495
|
-
var
|
|
3289
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
2496
3290
|
import { useForkRef as useForkRef4 } from "@salt-ds/core";
|
|
2497
|
-
import { jsx as
|
|
3291
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2498
3292
|
var baseClass = "vuuMeasuredContainer";
|
|
2499
|
-
var MeasuredContainer =
|
|
3293
|
+
var MeasuredContainer = forwardRef9(function MeasuredContainer2({
|
|
2500
3294
|
children,
|
|
2501
3295
|
className,
|
|
2502
3296
|
height,
|
|
@@ -2525,19 +3319,19 @@ var MeasuredContainer = forwardRef6(function MeasuredContainer2({
|
|
|
2525
3319
|
};
|
|
2526
3320
|
};
|
|
2527
3321
|
const forkedRef = useForkRef4(containerRef, forwardedRef);
|
|
2528
|
-
return unmeasured ? /* @__PURE__ */
|
|
3322
|
+
return unmeasured ? /* @__PURE__ */ jsx44(
|
|
2529
3323
|
"div",
|
|
2530
3324
|
{
|
|
2531
3325
|
...htmlAttributes,
|
|
2532
|
-
className: (0,
|
|
3326
|
+
className: (0, import_classnames20.default)(baseClass, `${baseClass}-ummeasured`),
|
|
2533
3327
|
style: getStyle2(),
|
|
2534
3328
|
ref: containerRef
|
|
2535
3329
|
}
|
|
2536
|
-
) : /* @__PURE__ */
|
|
3330
|
+
) : /* @__PURE__ */ jsx44(
|
|
2537
3331
|
"div",
|
|
2538
3332
|
{
|
|
2539
3333
|
...htmlAttributes,
|
|
2540
|
-
className: (0,
|
|
3334
|
+
className: (0, import_classnames20.default)(baseClass, className),
|
|
2541
3335
|
ref: forkedRef,
|
|
2542
3336
|
style: getStyle2(),
|
|
2543
3337
|
children
|
|
@@ -2547,15 +3341,15 @@ var MeasuredContainer = forwardRef6(function MeasuredContainer2({
|
|
|
2547
3341
|
|
|
2548
3342
|
// ../vuu-layout/src/overflow-container/OverflowContainer.tsx
|
|
2549
3343
|
import { PopupMenu } from "@vuu-ui/vuu-popups";
|
|
2550
|
-
var
|
|
2551
|
-
import
|
|
2552
|
-
forwardRef as
|
|
3344
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
3345
|
+
import React21, {
|
|
3346
|
+
forwardRef as forwardRef10
|
|
2553
3347
|
} from "react";
|
|
2554
3348
|
|
|
2555
3349
|
// ../vuu-layout/src/overflow-container/useOverflowContainer.ts
|
|
2556
3350
|
import { useDragDropNext as useDragDrop } from "@vuu-ui/vuu-ui-controls";
|
|
2557
|
-
import { isValidNumber as
|
|
2558
|
-
import { useCallback as
|
|
3351
|
+
import { isValidNumber as isValidNumber3, MEASURES } from "@vuu-ui/vuu-utils";
|
|
3352
|
+
import { useCallback as useCallback28, useMemo as useMemo12, useRef as useRef17, useState as useState18 } from "react";
|
|
2559
3353
|
|
|
2560
3354
|
// ../vuu-layout/src/overflow-container/overflow-utils.ts
|
|
2561
3355
|
import { getElementByDataIndex } from "@vuu-ui/vuu-utils";
|
|
@@ -2641,8 +3435,8 @@ var applyOverflowClassToWrappedItems = (container, overflowedItems) => {
|
|
|
2641
3435
|
var maxPriority = (priority, { overflowPriority }) => Math.max(priority, parseInt(overflowPriority));
|
|
2642
3436
|
var minPriority = (priority, { overflowPriority }) => Math.min(priority, parseInt(overflowPriority));
|
|
2643
3437
|
var overflowIndicatorHasWrappedButShouldNotHave = (wrappedItems) => {
|
|
2644
|
-
var
|
|
2645
|
-
return wrappedItems.length > 1 && ((
|
|
3438
|
+
var _a2;
|
|
3439
|
+
return wrappedItems.length > 1 && ((_a2 = wrappedItems.at(-1)) == null ? void 0 : _a2.index) === "overflow";
|
|
2646
3440
|
};
|
|
2647
3441
|
var getHighestPriorityItem = (overflowItems) => {
|
|
2648
3442
|
let [highestPriorityItem] = overflowItems;
|
|
@@ -2655,7 +3449,7 @@ var getHighestPriorityItem = (overflowItems) => {
|
|
|
2655
3449
|
return highestPriorityItem;
|
|
2656
3450
|
};
|
|
2657
3451
|
var highPriorityItemsHaveWrappedButShouldNotHave = (nonWrappedItems, wrappedItems) => {
|
|
2658
|
-
var
|
|
3452
|
+
var _a2;
|
|
2659
3453
|
const minNonwrappedPriority = nonWrappedItems.reduce(
|
|
2660
3454
|
minPriority,
|
|
2661
3455
|
Number.MAX_SAFE_INTEGER
|
|
@@ -2664,7 +3458,7 @@ var highPriorityItemsHaveWrappedButShouldNotHave = (nonWrappedItems, wrappedItem
|
|
|
2664
3458
|
if (maxwrappedPriority > minNonwrappedPriority) {
|
|
2665
3459
|
return true;
|
|
2666
3460
|
} else {
|
|
2667
|
-
return wrappedItems.length > 1 && ((
|
|
3461
|
+
return wrappedItems.length > 1 && ((_a2 = wrappedItems.at(-1)) == null ? void 0 : _a2.index) === "overflow";
|
|
2668
3462
|
}
|
|
2669
3463
|
};
|
|
2670
3464
|
var correctForWrappedOverflowIndicator = (container, overflowedItems) => new Promise((resolve) => {
|
|
@@ -2815,10 +3609,16 @@ var useOverflowContainer = ({
|
|
|
2815
3609
|
onSwitchWrappedItemIntoView,
|
|
2816
3610
|
orientation = "horizontal"
|
|
2817
3611
|
}) => {
|
|
2818
|
-
const [container, setContainer] =
|
|
2819
|
-
const wrappedItemsRef =
|
|
2820
|
-
const containerRef =
|
|
2821
|
-
const
|
|
3612
|
+
const [container, setContainer] = useState18(null);
|
|
3613
|
+
const wrappedItemsRef = useRef17(NO_WRAPPED_ITEMS);
|
|
3614
|
+
const containerRef = useRef17(null);
|
|
3615
|
+
const setOverflowTabIndex = useCallback28((tabIndex) => {
|
|
3616
|
+
var _a2;
|
|
3617
|
+
if (containerRef.current) {
|
|
3618
|
+
(_a2 = containerRef.current.querySelector(".vuuOverflowContainer-OverflowIndicator button")) == null ? void 0 : _a2.setAttribute("tabindex", tabIndex);
|
|
3619
|
+
}
|
|
3620
|
+
}, []);
|
|
3621
|
+
const handleResize = useCallback28(async () => {
|
|
2822
3622
|
if (container) {
|
|
2823
3623
|
let [nonWrapped, wrapped] = getNonWrappedAndWrappedItems(
|
|
2824
3624
|
container,
|
|
@@ -2840,11 +3640,16 @@ var useOverflowContainer = ({
|
|
|
2840
3640
|
wrapped = NO_WRAPPED_ITEMS;
|
|
2841
3641
|
}
|
|
2842
3642
|
}
|
|
3643
|
+
if (wrappedItemsRef.current.length === 0 && wrapped.length > 0) {
|
|
3644
|
+
setOverflowTabIndex("0");
|
|
3645
|
+
} else if (wrappedItemsRef.current.length > 0 && wrapped.length === 0) {
|
|
3646
|
+
setOverflowTabIndex("-1");
|
|
3647
|
+
}
|
|
2843
3648
|
wrappedItemsRef.current = wrapped;
|
|
2844
3649
|
}
|
|
2845
|
-
}, [container, orientation]);
|
|
3650
|
+
}, [container, orientation, setOverflowTabIndex]);
|
|
2846
3651
|
const hasOverflowItem = (opt) => typeof opt === "object" && opt !== null && "overflowItem" in opt;
|
|
2847
|
-
const [menuBuilder, menuActionHandler] =
|
|
3652
|
+
const [menuBuilder, menuActionHandler] = useMemo12(() => {
|
|
2848
3653
|
return [
|
|
2849
3654
|
() => {
|
|
2850
3655
|
const { current: menuItems } = wrappedItemsRef;
|
|
@@ -2869,14 +3674,14 @@ var useOverflowContainer = ({
|
|
|
2869
3674
|
}
|
|
2870
3675
|
];
|
|
2871
3676
|
}, [container, onSwitchWrappedItemIntoView]);
|
|
2872
|
-
const resizeObserver3 =
|
|
3677
|
+
const resizeObserver3 = useMemo12(() => {
|
|
2873
3678
|
const { sizeProp } = MEASURES[orientation];
|
|
2874
3679
|
let currentSize = 0;
|
|
2875
3680
|
return new ResizeObserver((entries) => {
|
|
2876
3681
|
for (const entry of entries) {
|
|
2877
3682
|
const { [sizeProp]: actualSize } = entry.contentRect;
|
|
2878
3683
|
const size = Math.round(actualSize);
|
|
2879
|
-
if (
|
|
3684
|
+
if (isValidNumber3(size) && currentSize !== size) {
|
|
2880
3685
|
currentSize = size;
|
|
2881
3686
|
handleResize();
|
|
2882
3687
|
}
|
|
@@ -2886,15 +3691,15 @@ var useOverflowContainer = ({
|
|
|
2886
3691
|
useLayoutEffectSkipFirst(() => {
|
|
2887
3692
|
handleResize();
|
|
2888
3693
|
}, [handleResize, itemCount]);
|
|
2889
|
-
|
|
3694
|
+
useMemo12(() => {
|
|
2890
3695
|
if (container) {
|
|
2891
3696
|
resizeObserver3.observe(container);
|
|
2892
3697
|
}
|
|
2893
3698
|
}, [container, resizeObserver3]);
|
|
2894
|
-
const callbackRef =
|
|
3699
|
+
const callbackRef = useCallback28((el) => {
|
|
2895
3700
|
setContainer(containerRef.current = el);
|
|
2896
3701
|
}, []);
|
|
2897
|
-
const handleDrop =
|
|
3702
|
+
const handleDrop = useCallback28(
|
|
2898
3703
|
(fromIndex, toIndex) => {
|
|
2899
3704
|
onMoveItem == null ? void 0 : onMoveItem(fromIndex, toIndex);
|
|
2900
3705
|
},
|
|
@@ -2920,9 +3725,9 @@ var useOverflowContainer = ({
|
|
|
2920
3725
|
};
|
|
2921
3726
|
|
|
2922
3727
|
// ../vuu-layout/src/overflow-container/OverflowContainer.tsx
|
|
2923
|
-
import { jsx as
|
|
2924
|
-
var
|
|
2925
|
-
var WrapContainer =
|
|
3728
|
+
import { jsx as jsx45, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3729
|
+
var classBase10 = "vuuOverflowContainer";
|
|
3730
|
+
var WrapContainer = React21.memo(
|
|
2926
3731
|
({
|
|
2927
3732
|
allowDragDrop,
|
|
2928
3733
|
children,
|
|
@@ -2950,16 +3755,13 @@ var WrapContainer = React15.memo(
|
|
|
2950
3755
|
onSwitchWrappedItemIntoView,
|
|
2951
3756
|
orientation
|
|
2952
3757
|
});
|
|
2953
|
-
console.log(
|
|
2954
|
-
`Overflow container WRAPPER ${React15.Children.count(children)} children`
|
|
2955
|
-
);
|
|
2956
3758
|
const height = orientation === "vertical" ? "100%" : `${heightProp}px`;
|
|
2957
3759
|
const style = {
|
|
2958
3760
|
"--overflow-container-height": `${height}`
|
|
2959
3761
|
};
|
|
2960
|
-
const className = (0,
|
|
2961
|
-
[`${
|
|
2962
|
-
[`${
|
|
3762
|
+
const className = (0, import_classnames21.default)(`${classBase10}-wrapContainer`, classNameProp, {
|
|
3763
|
+
[`${classBase10}-horizontal`]: orientation === "horizontal",
|
|
3764
|
+
[`${classBase10}-vertical`]: orientation === "vertical"
|
|
2963
3765
|
});
|
|
2964
3766
|
const content = childElements.map((childEl, i) => {
|
|
2965
3767
|
const {
|
|
@@ -2968,10 +3770,10 @@ var WrapContainer = React15.memo(
|
|
|
2968
3770
|
id: itemId = `${id}-${i}`,
|
|
2969
3771
|
label = `Item ${i + 1}`
|
|
2970
3772
|
} = childEl.props;
|
|
2971
|
-
return /* @__PURE__ */
|
|
3773
|
+
return /* @__PURE__ */ jsx45(
|
|
2972
3774
|
"div",
|
|
2973
3775
|
{
|
|
2974
|
-
className: (0,
|
|
3776
|
+
className: (0, import_classnames21.default)(`${classBase10}-item`, {
|
|
2975
3777
|
"vuuDraggable-dragAway": draggedItemIndex === i
|
|
2976
3778
|
}),
|
|
2977
3779
|
"data-index": i,
|
|
@@ -2985,31 +3787,32 @@ var WrapContainer = React15.memo(
|
|
|
2985
3787
|
i
|
|
2986
3788
|
);
|
|
2987
3789
|
});
|
|
2988
|
-
const overflowIndicator = /* @__PURE__ */
|
|
3790
|
+
const overflowIndicator = /* @__PURE__ */ jsx45(
|
|
2989
3791
|
"div",
|
|
2990
3792
|
{
|
|
2991
|
-
className: `${
|
|
3793
|
+
className: `${classBase10}-OverflowIndicator`,
|
|
2992
3794
|
"data-index": "overflow",
|
|
2993
|
-
children: /* @__PURE__ */
|
|
3795
|
+
children: /* @__PURE__ */ jsx45(
|
|
2994
3796
|
PopupMenu,
|
|
2995
3797
|
{
|
|
2996
3798
|
icon: overflowIcon,
|
|
2997
3799
|
menuBuilder,
|
|
2998
|
-
menuActionHandler
|
|
3800
|
+
menuActionHandler,
|
|
3801
|
+
tabIndex: -1
|
|
2999
3802
|
}
|
|
3000
3803
|
)
|
|
3001
3804
|
},
|
|
3002
3805
|
"overflow"
|
|
3003
3806
|
);
|
|
3004
3807
|
content.push(overflowIndicator);
|
|
3005
|
-
return /* @__PURE__ */
|
|
3808
|
+
return /* @__PURE__ */ jsxs22("div", { className, ref: rootRef, style, children: [
|
|
3006
3809
|
content,
|
|
3007
3810
|
draggable
|
|
3008
3811
|
] });
|
|
3009
3812
|
}
|
|
3010
3813
|
);
|
|
3011
3814
|
WrapContainer.displayName = "OverflowContainer.InnerContainer";
|
|
3012
|
-
var OverflowContainer =
|
|
3815
|
+
var OverflowContainer = forwardRef10(function OverflowContainer2({
|
|
3013
3816
|
allowDragDrop = false,
|
|
3014
3817
|
children,
|
|
3015
3818
|
className,
|
|
@@ -3023,15 +3826,14 @@ var OverflowContainer = forwardRef7(function OverflowContainer2({
|
|
|
3023
3826
|
...htmlAttributes
|
|
3024
3827
|
}, forwardedRef) {
|
|
3025
3828
|
const id = useId(idProp);
|
|
3026
|
-
|
|
3027
|
-
return /* @__PURE__ */ jsx17(
|
|
3829
|
+
return /* @__PURE__ */ jsx45(
|
|
3028
3830
|
"div",
|
|
3029
3831
|
{
|
|
3030
3832
|
...htmlAttributes,
|
|
3031
|
-
className: (0,
|
|
3833
|
+
className: (0, import_classnames21.default)((0, import_classnames21.default)(classBase10, className)),
|
|
3032
3834
|
id,
|
|
3033
3835
|
ref: forwardedRef,
|
|
3034
|
-
children: /* @__PURE__ */
|
|
3836
|
+
children: /* @__PURE__ */ jsx45(
|
|
3035
3837
|
WrapContainer,
|
|
3036
3838
|
{
|
|
3037
3839
|
allowDragDrop,
|
|
@@ -3050,21 +3852,21 @@ var OverflowContainer = forwardRef7(function OverflowContainer2({
|
|
|
3050
3852
|
});
|
|
3051
3853
|
|
|
3052
3854
|
// ../vuu-layout/src/palette/Palette.tsx
|
|
3053
|
-
var
|
|
3855
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
3054
3856
|
import { uuid as uuid5 } from "@vuu-ui/vuu-utils";
|
|
3055
|
-
import { List, ListItem } from "@vuu-ui/vuu-ui-controls";
|
|
3857
|
+
import { List as List3, ListItem as ListItem2 } from "@vuu-ui/vuu-ui-controls";
|
|
3056
3858
|
import {
|
|
3057
|
-
cloneElement as
|
|
3058
|
-
memo
|
|
3859
|
+
cloneElement as cloneElement6,
|
|
3860
|
+
memo as memo2
|
|
3059
3861
|
} from "react";
|
|
3060
|
-
import { jsx as
|
|
3862
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3061
3863
|
var clonePaletteItem = (paletteItem) => {
|
|
3062
3864
|
const dolly = paletteItem.cloneNode(true);
|
|
3063
3865
|
dolly.id = "";
|
|
3064
3866
|
delete dolly.dataset.idx;
|
|
3065
3867
|
return dolly;
|
|
3066
3868
|
};
|
|
3067
|
-
var PaletteItem =
|
|
3869
|
+
var PaletteItem = memo2(
|
|
3068
3870
|
({
|
|
3069
3871
|
className,
|
|
3070
3872
|
children: component,
|
|
@@ -3074,10 +3876,10 @@ var PaletteItem = memo(
|
|
|
3074
3876
|
closeable,
|
|
3075
3877
|
...props
|
|
3076
3878
|
}) => {
|
|
3077
|
-
return /* @__PURE__ */
|
|
3078
|
-
|
|
3879
|
+
return /* @__PURE__ */ jsx46(
|
|
3880
|
+
ListItem2,
|
|
3079
3881
|
{
|
|
3080
|
-
className: (0,
|
|
3882
|
+
className: (0, import_classnames22.default)("vuuPaletteItem", className),
|
|
3081
3883
|
"data-draggable": true,
|
|
3082
3884
|
"data-icon": "draggable",
|
|
3083
3885
|
...props
|
|
@@ -3095,19 +3897,19 @@ var Palette = ({
|
|
|
3095
3897
|
...props
|
|
3096
3898
|
}) => {
|
|
3097
3899
|
const dispatch = useLayoutProviderDispatch();
|
|
3098
|
-
const
|
|
3900
|
+
const classBase20 = "vuuPalette";
|
|
3099
3901
|
function handleMouseDown(evt) {
|
|
3100
|
-
var
|
|
3902
|
+
var _a2, _b;
|
|
3101
3903
|
const target = evt.target;
|
|
3102
3904
|
const listItemElement = target.closest(".vuuPaletteItem");
|
|
3103
|
-
const idx = parseInt((_b = (
|
|
3905
|
+
const idx = parseInt((_b = (_a2 = listItemElement.dataset) == null ? void 0 : _a2.index) != null ? _b : "-1");
|
|
3104
3906
|
const {
|
|
3105
3907
|
props: { caption, children: payload, template, ...props2 }
|
|
3106
3908
|
} = children[idx];
|
|
3107
3909
|
const { height, left, top, width } = listItemElement.getBoundingClientRect();
|
|
3108
3910
|
const id = uuid5();
|
|
3109
3911
|
const identifiers = { id, key: id };
|
|
3110
|
-
const component = template ? payload : /* @__PURE__ */
|
|
3912
|
+
const component = template ? payload : /* @__PURE__ */ jsx46(MemoView, { ...ViewProps2, ...identifiers, ...props2, title: props2.label, children: payload });
|
|
3111
3913
|
dispatch({
|
|
3112
3914
|
dragRect: {
|
|
3113
3915
|
left,
|
|
@@ -3131,15 +3933,15 @@ var Palette = ({
|
|
|
3131
3933
|
type: "drag-start"
|
|
3132
3934
|
});
|
|
3133
3935
|
}
|
|
3134
|
-
return /* @__PURE__ */
|
|
3135
|
-
|
|
3936
|
+
return /* @__PURE__ */ jsx46(
|
|
3937
|
+
List3,
|
|
3136
3938
|
{
|
|
3137
3939
|
...props,
|
|
3138
|
-
className: (0,
|
|
3940
|
+
className: (0, import_classnames22.default)(classBase20, className, `${classBase20}-${orientation}`),
|
|
3139
3941
|
itemHeight,
|
|
3140
3942
|
selected: null,
|
|
3141
3943
|
children: children.map(
|
|
3142
|
-
(child, idx) => child.type === PaletteItem ?
|
|
3944
|
+
(child, idx) => child.type === PaletteItem ? cloneElement6(child, {
|
|
3143
3945
|
key: idx,
|
|
3144
3946
|
onMouseDown: handleMouseDown
|
|
3145
3947
|
}) : child
|
|
@@ -3150,26 +3952,26 @@ var Palette = ({
|
|
|
3150
3952
|
registerComponent("Palette", Palette, "view");
|
|
3151
3953
|
|
|
3152
3954
|
// ../vuu-layout/src/stack/Stack.tsx
|
|
3153
|
-
var
|
|
3955
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
3154
3956
|
import {
|
|
3155
|
-
Tab,
|
|
3156
|
-
Tabstrip
|
|
3957
|
+
Tab as Tab2,
|
|
3958
|
+
Tabstrip as Tabstrip2
|
|
3157
3959
|
} from "@vuu-ui/vuu-ui-controls";
|
|
3158
|
-
import
|
|
3159
|
-
forwardRef as
|
|
3160
|
-
useCallback as
|
|
3960
|
+
import React22, {
|
|
3961
|
+
forwardRef as forwardRef11,
|
|
3962
|
+
useCallback as useCallback29
|
|
3161
3963
|
} from "react";
|
|
3162
|
-
import { jsx as
|
|
3163
|
-
var
|
|
3964
|
+
import { jsx as jsx47, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3965
|
+
var classBase11 = "Tabs";
|
|
3164
3966
|
var getDefaultTabIcon = () => void 0;
|
|
3165
3967
|
var getDefaultTabLabel = (component, tabIndex) => {
|
|
3166
|
-
var
|
|
3167
|
-
return (_d = (_c = (
|
|
3968
|
+
var _a2, _b, _c, _d;
|
|
3969
|
+
return (_d = (_c = (_a2 = component.props) == null ? void 0 : _a2.title) != null ? _c : (_b = component.props) == null ? void 0 : _b["data-tab-title"]) != null ? _d : `Tab ${tabIndex + 1}`;
|
|
3168
3970
|
};
|
|
3169
3971
|
var getChildElements = (children) => {
|
|
3170
3972
|
const elements = [];
|
|
3171
|
-
|
|
3172
|
-
if (
|
|
3973
|
+
React22.Children.forEach(children, (child) => {
|
|
3974
|
+
if (React22.isValidElement(child)) {
|
|
3173
3975
|
elements.push(child);
|
|
3174
3976
|
} else {
|
|
3175
3977
|
console.warn(`Stack has unexpected child element type`);
|
|
@@ -3182,7 +3984,7 @@ var DefaultTabstripProps = {
|
|
|
3182
3984
|
allowCloseTab: false,
|
|
3183
3985
|
allowRenameTab: false
|
|
3184
3986
|
};
|
|
3185
|
-
var Stack =
|
|
3987
|
+
var Stack = forwardRef11(function Stack2({
|
|
3186
3988
|
active = 0,
|
|
3187
3989
|
children,
|
|
3188
3990
|
className: classNameProp,
|
|
@@ -3200,26 +4002,26 @@ var Stack = forwardRef8(function Stack2({
|
|
|
3200
4002
|
style,
|
|
3201
4003
|
TabstripProps: TabstripProps2 = DefaultTabstripProps
|
|
3202
4004
|
}, ref) {
|
|
3203
|
-
var
|
|
4005
|
+
var _a2;
|
|
3204
4006
|
const id = useId(idProp);
|
|
3205
4007
|
const {
|
|
3206
4008
|
allowCloseTab,
|
|
3207
4009
|
allowRenameTab,
|
|
3208
4010
|
className: tabstripClassName
|
|
3209
4011
|
} = TabstripProps2;
|
|
3210
|
-
const handleExitEditMode =
|
|
4012
|
+
const handleExitEditMode = useCallback29(
|
|
3211
4013
|
(_oldText, newText, _allowDeactivation, tabIndex) => {
|
|
3212
4014
|
onTabEdit == null ? void 0 : onTabEdit(tabIndex, newText);
|
|
3213
4015
|
},
|
|
3214
4016
|
[onTabEdit]
|
|
3215
4017
|
);
|
|
3216
4018
|
const activeChild = () => {
|
|
3217
|
-
var
|
|
3218
|
-
if (
|
|
4019
|
+
var _a3;
|
|
4020
|
+
if (React22.isValidElement(children)) {
|
|
3219
4021
|
return children;
|
|
3220
4022
|
}
|
|
3221
4023
|
if (Array.isArray(children)) {
|
|
3222
|
-
return (
|
|
4024
|
+
return (_a3 = children[active]) != null ? _a3 : null;
|
|
3223
4025
|
}
|
|
3224
4026
|
return null;
|
|
3225
4027
|
};
|
|
@@ -3229,8 +4031,8 @@ var Stack = forwardRef8(function Stack2({
|
|
|
3229
4031
|
id: childId = `${id}-${idx}`,
|
|
3230
4032
|
"data-tab-location": tabLocation
|
|
3231
4033
|
} = child2.props;
|
|
3232
|
-
return /* @__PURE__ */
|
|
3233
|
-
|
|
4034
|
+
return /* @__PURE__ */ jsx47(
|
|
4035
|
+
Tab2,
|
|
3234
4036
|
{
|
|
3235
4037
|
ariaControls: childId,
|
|
3236
4038
|
"data-icon": getTabIcon(child2, idx),
|
|
@@ -3247,24 +4049,24 @@ var Stack = forwardRef8(function Stack2({
|
|
|
3247
4049
|
const child = activeChild();
|
|
3248
4050
|
const isHorizontal = showTabs === "left" || showTabs === "right";
|
|
3249
4051
|
const tabstripOrientation = isHorizontal ? "vertical" : "horizontal";
|
|
3250
|
-
return /* @__PURE__ */
|
|
4052
|
+
return /* @__PURE__ */ jsxs23(
|
|
3251
4053
|
"div",
|
|
3252
4054
|
{
|
|
3253
|
-
className: (0,
|
|
3254
|
-
[`${
|
|
4055
|
+
className: (0, import_classnames23.default)(classBase11, classNameProp, {
|
|
4056
|
+
[`${classBase11}-horizontal`]: isHorizontal
|
|
3255
4057
|
}),
|
|
3256
4058
|
style,
|
|
3257
4059
|
id,
|
|
3258
4060
|
ref,
|
|
3259
4061
|
children: [
|
|
3260
|
-
showTabs ? /* @__PURE__ */
|
|
3261
|
-
|
|
4062
|
+
showTabs ? /* @__PURE__ */ jsx47(
|
|
4063
|
+
Tabstrip2,
|
|
3262
4064
|
{
|
|
3263
4065
|
...TabstripProps2,
|
|
3264
|
-
activeTabIndex: (
|
|
4066
|
+
activeTabIndex: (_a2 = TabstripProps2 == null ? void 0 : TabstripProps2.activeTabIndex) != null ? _a2 : child === null ? -1 : active,
|
|
3265
4067
|
allowDragDrop: TabstripProps2.allowDragDrop !== false,
|
|
3266
4068
|
animateSelectionThumb: true,
|
|
3267
|
-
className: (0,
|
|
4069
|
+
className: (0, import_classnames23.default)("vuuTabHeader", tabstripClassName),
|
|
3268
4070
|
keyBoardActivation,
|
|
3269
4071
|
onActiveChange: onTabSelectionChanged,
|
|
3270
4072
|
onAddTab,
|
|
@@ -3284,9 +4086,9 @@ Stack.displayName = "Stack";
|
|
|
3284
4086
|
|
|
3285
4087
|
// ../vuu-layout/src/stack/StackLayout.tsx
|
|
3286
4088
|
import { useIdMemo as useId3 } from "@salt-ds/core";
|
|
3287
|
-
import
|
|
3288
|
-
import { jsx as
|
|
3289
|
-
var defaultCreateNewChild = (index) => /* @__PURE__ */
|
|
4089
|
+
import React23, { useCallback as useCallback30, useRef as useRef18 } from "react";
|
|
4090
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4091
|
+
var defaultCreateNewChild = (index) => /* @__PURE__ */ jsx48(
|
|
3290
4092
|
MemoView,
|
|
3291
4093
|
{
|
|
3292
4094
|
resizeable: true,
|
|
@@ -3294,12 +4096,12 @@ var defaultCreateNewChild = (index) => /* @__PURE__ */ jsx20(
|
|
|
3294
4096
|
style: { flexGrow: 1, flexShrink: 0, flexBasis: 0 },
|
|
3295
4097
|
header: true,
|
|
3296
4098
|
closeable: true,
|
|
3297
|
-
children: /* @__PURE__ */
|
|
4099
|
+
children: /* @__PURE__ */ jsx48(Component_default, { style: { flex: 1 } })
|
|
3298
4100
|
}
|
|
3299
4101
|
);
|
|
3300
4102
|
var StackLayout = (props) => {
|
|
3301
|
-
var
|
|
3302
|
-
const ref =
|
|
4103
|
+
var _a2;
|
|
4104
|
+
const ref = useRef18(null);
|
|
3303
4105
|
const dispatch = useLayoutProviderDispatch();
|
|
3304
4106
|
const { loadState } = usePersistentState();
|
|
3305
4107
|
const {
|
|
@@ -3313,14 +4115,14 @@ var StackLayout = (props) => {
|
|
|
3313
4115
|
const id = useId3(idProp);
|
|
3314
4116
|
const [dispatchViewAction] = useViewActionDispatcher(id, ref, path);
|
|
3315
4117
|
const createNewChildFromContext = useLayoutCreateNewChild();
|
|
3316
|
-
const createNewChild = (
|
|
4118
|
+
const createNewChild = (_a2 = createNewChildProp != null ? createNewChildProp : createNewChildFromContext) != null ? _a2 : defaultCreateNewChild;
|
|
3317
4119
|
const handleTabSelection = (nextIdx) => {
|
|
3318
4120
|
if (path) {
|
|
3319
4121
|
dispatch({ type: "switch-tab", id, path, nextIdx });
|
|
3320
4122
|
onTabSelectionChanged == null ? void 0 : onTabSelectionChanged(nextIdx);
|
|
3321
4123
|
}
|
|
3322
4124
|
};
|
|
3323
|
-
const handleTabClose =
|
|
4125
|
+
const handleTabClose = useCallback30(
|
|
3324
4126
|
(tabIndex) => {
|
|
3325
4127
|
if (Array.isArray(children)) {
|
|
3326
4128
|
const {
|
|
@@ -3331,9 +4133,9 @@ var StackLayout = (props) => {
|
|
|
3331
4133
|
},
|
|
3332
4134
|
[children, dispatch]
|
|
3333
4135
|
);
|
|
3334
|
-
const handleTabAdd =
|
|
4136
|
+
const handleTabAdd = useCallback30(() => {
|
|
3335
4137
|
if (path) {
|
|
3336
|
-
const tabIndex =
|
|
4138
|
+
const tabIndex = React23.Children.count(children);
|
|
3337
4139
|
const component = createNewChild(tabIndex);
|
|
3338
4140
|
dispatch({
|
|
3339
4141
|
type: "add",
|
|
@@ -3342,7 +4144,7 @@ var StackLayout = (props) => {
|
|
|
3342
4144
|
});
|
|
3343
4145
|
}
|
|
3344
4146
|
}, [children, createNewChild, dispatch, path]);
|
|
3345
|
-
const handleMoveTab =
|
|
4147
|
+
const handleMoveTab = useCallback30(
|
|
3346
4148
|
(fromIndex, toIndex) => {
|
|
3347
4149
|
if (path) {
|
|
3348
4150
|
dispatch({
|
|
@@ -3376,7 +4178,7 @@ var StackLayout = (props) => {
|
|
|
3376
4178
|
const { id: id2, title } = component.props;
|
|
3377
4179
|
return loadState(id2, "view-title") || title || `Tab ${idx + 1}`;
|
|
3378
4180
|
};
|
|
3379
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsx48(
|
|
3380
4182
|
Stack,
|
|
3381
4183
|
{
|
|
3382
4184
|
...restProps,
|
|
@@ -3396,26 +4198,26 @@ StackLayout.displayName = "Stack";
|
|
|
3396
4198
|
registerComponent("Stack", StackLayout, "container");
|
|
3397
4199
|
|
|
3398
4200
|
// ../vuu-layout/src/toolbar/Toolbar.tsx
|
|
3399
|
-
var
|
|
3400
|
-
import
|
|
4201
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
4202
|
+
import React24, { useMemo as useMemo13, useRef as useRef21 } from "react";
|
|
3401
4203
|
|
|
3402
4204
|
// ../vuu-layout/src/toolbar/useToolbar.ts
|
|
3403
|
-
import { isValidNumber as
|
|
4205
|
+
import { isValidNumber as isValidNumber4 } from "@vuu-ui/vuu-utils";
|
|
3404
4206
|
import {
|
|
3405
|
-
useCallback as
|
|
3406
|
-
useRef as
|
|
4207
|
+
useCallback as useCallback33,
|
|
4208
|
+
useRef as useRef20
|
|
3407
4209
|
} from "react";
|
|
3408
4210
|
|
|
3409
4211
|
// ../vuu-layout/src/toolbar/useKeyboardNavigation.ts
|
|
3410
|
-
import { useControlled as
|
|
4212
|
+
import { useControlled as useControlled3 } from "@salt-ds/core";
|
|
3411
4213
|
import {
|
|
3412
4214
|
dispatchMouseEvent,
|
|
3413
4215
|
getFocusableElement
|
|
3414
4216
|
} from "@vuu-ui/vuu-utils";
|
|
3415
4217
|
import {
|
|
3416
|
-
useCallback as
|
|
3417
|
-
useRef as
|
|
3418
|
-
useState as
|
|
4218
|
+
useCallback as useCallback31,
|
|
4219
|
+
useRef as useRef19,
|
|
4220
|
+
useState as useState19
|
|
3419
4221
|
} from "react";
|
|
3420
4222
|
import {
|
|
3421
4223
|
ArrowDown,
|
|
@@ -3488,23 +4290,23 @@ var useKeyboardNavigation = ({
|
|
|
3488
4290
|
selectedIndex: selectedItemIndex = []
|
|
3489
4291
|
}) => {
|
|
3490
4292
|
const manualActivation = keyBoardActivation === "manual";
|
|
3491
|
-
const mouseClickPending =
|
|
3492
|
-
const focusedRef =
|
|
3493
|
-
const [hasFocus, setHasFocus] =
|
|
3494
|
-
const [, forceRefresh] =
|
|
3495
|
-
const [highlightedIdx, _setHighlightedIdx] =
|
|
4293
|
+
const mouseClickPending = useRef19(false);
|
|
4294
|
+
const focusedRef = useRef19(-1);
|
|
4295
|
+
const [hasFocus, setHasFocus] = useState19(false);
|
|
4296
|
+
const [, forceRefresh] = useState19({});
|
|
4297
|
+
const [highlightedIdx, _setHighlightedIdx] = useControlled3({
|
|
3496
4298
|
controlled: highlightedIdxProp,
|
|
3497
4299
|
default: defaultHighlightedIdx,
|
|
3498
4300
|
name: "UseKeyboardNavigation"
|
|
3499
4301
|
});
|
|
3500
|
-
const setHighlightedIdx =
|
|
4302
|
+
const setHighlightedIdx = useCallback31(
|
|
3501
4303
|
(value) => {
|
|
3502
4304
|
_setHighlightedIdx(focusedRef.current = value);
|
|
3503
4305
|
},
|
|
3504
4306
|
[_setHighlightedIdx]
|
|
3505
4307
|
);
|
|
3506
|
-
const keyboardNavigation =
|
|
3507
|
-
const focusItem =
|
|
4308
|
+
const keyboardNavigation = useRef19(false);
|
|
4309
|
+
const focusItem = useCallback31(
|
|
3508
4310
|
(itemIndex, immediateFocus = false, withKeyboard, delay = 70) => {
|
|
3509
4311
|
setHighlightedIdx(itemIndex);
|
|
3510
4312
|
if (withKeyboard === true && !keyboardNavigation.current) {
|
|
@@ -3545,14 +4347,14 @@ var useKeyboardNavigation = ({
|
|
|
3545
4347
|
}
|
|
3546
4348
|
}
|
|
3547
4349
|
};
|
|
3548
|
-
const getIndexCount =
|
|
4350
|
+
const getIndexCount = useCallback31(
|
|
3549
4351
|
() => {
|
|
3550
|
-
var
|
|
3551
|
-
return (_b = (
|
|
4352
|
+
var _a2, _b;
|
|
4353
|
+
return (_b = (_a2 = containerRef.current) == null ? void 0 : _a2.querySelectorAll(`[data-index]`).length) != null ? _b : 0;
|
|
3552
4354
|
},
|
|
3553
4355
|
[containerRef]
|
|
3554
4356
|
);
|
|
3555
|
-
const nextFocusableItemIdx =
|
|
4357
|
+
const nextFocusableItemIdx = useCallback31(
|
|
3556
4358
|
(direction = "fwd", idx) => {
|
|
3557
4359
|
const indexCount = getIndexCount();
|
|
3558
4360
|
const index = typeof idx === "number" ? idx : indexCount;
|
|
@@ -3572,7 +4374,7 @@ var useKeyboardNavigation = ({
|
|
|
3572
4374
|
},
|
|
3573
4375
|
[containerRef, getIndexCount]
|
|
3574
4376
|
);
|
|
3575
|
-
const navigateChildItems =
|
|
4377
|
+
const navigateChildItems = useCallback31(
|
|
3576
4378
|
(e, forceFocusVisible = false) => {
|
|
3577
4379
|
const direction = navigation[orientation][e.key];
|
|
3578
4380
|
const nextIdx = nextFocusableItemIdx(direction, highlightedIdx);
|
|
@@ -3594,21 +4396,21 @@ var useKeyboardNavigation = ({
|
|
|
3594
4396
|
orientation
|
|
3595
4397
|
]
|
|
3596
4398
|
);
|
|
3597
|
-
const highlightedItemHasMenu =
|
|
4399
|
+
const highlightedItemHasMenu = useCallback31(() => {
|
|
3598
4400
|
const el = getElementByPosition(containerRef.current, highlightedIdx);
|
|
3599
4401
|
if (el) {
|
|
3600
4402
|
return el.querySelector(".vuuPopupMenu") != null;
|
|
3601
4403
|
}
|
|
3602
4404
|
return false;
|
|
3603
4405
|
}, [containerRef, highlightedIdx]);
|
|
3604
|
-
const highlightedItemInEditState =
|
|
4406
|
+
const highlightedItemInEditState = useCallback31(() => {
|
|
3605
4407
|
const el = getElementByPosition(containerRef.current, highlightedIdx);
|
|
3606
4408
|
if (el) {
|
|
3607
4409
|
return el.querySelector(".vuuEditableLabel-input") != null;
|
|
3608
4410
|
}
|
|
3609
4411
|
return false;
|
|
3610
4412
|
}, [containerRef, highlightedIdx]);
|
|
3611
|
-
const activateItemMenu =
|
|
4413
|
+
const activateItemMenu = useCallback31(() => {
|
|
3612
4414
|
const el = getElementByPosition(containerRef.current, highlightedIdx);
|
|
3613
4415
|
const menuEl = el == null ? void 0 : el.querySelector(".vuuPopupMenu");
|
|
3614
4416
|
if (menuEl) {
|
|
@@ -3616,7 +4418,7 @@ var useKeyboardNavigation = ({
|
|
|
3616
4418
|
}
|
|
3617
4419
|
return false;
|
|
3618
4420
|
}, [containerRef, highlightedIdx]);
|
|
3619
|
-
const handleKeyDown =
|
|
4421
|
+
const handleKeyDown = useCallback31(
|
|
3620
4422
|
(e) => {
|
|
3621
4423
|
if (getIndexCount() > 0 && isNavigationKey(e.key, orientation)) {
|
|
3622
4424
|
e.preventDefault();
|
|
@@ -3642,7 +4444,7 @@ var useKeyboardNavigation = ({
|
|
|
3642
4444
|
const handleItemClick = (_, itemIndex) => {
|
|
3643
4445
|
setHighlightedIdx(itemIndex);
|
|
3644
4446
|
};
|
|
3645
|
-
const handleFocus =
|
|
4447
|
+
const handleFocus = useCallback31(() => {
|
|
3646
4448
|
if (!hasFocus) {
|
|
3647
4449
|
setHasFocus(true);
|
|
3648
4450
|
if (!mouseClickPending.current) {
|
|
@@ -3652,7 +4454,7 @@ var useKeyboardNavigation = ({
|
|
|
3652
4454
|
}
|
|
3653
4455
|
}
|
|
3654
4456
|
}, [hasFocus]);
|
|
3655
|
-
const handleContainerMouseDown =
|
|
4457
|
+
const handleContainerMouseDown = useCallback31(() => {
|
|
3656
4458
|
if (!hasFocus) {
|
|
3657
4459
|
mouseClickPending.current = true;
|
|
3658
4460
|
}
|
|
@@ -3694,9 +4496,9 @@ import {
|
|
|
3694
4496
|
allowMultipleSelection,
|
|
3695
4497
|
deselectionIsAllowed,
|
|
3696
4498
|
selectionIsDisallowed,
|
|
3697
|
-
useControlled as
|
|
4499
|
+
useControlled as useControlled4
|
|
3698
4500
|
} from "@vuu-ui/vuu-ui-controls";
|
|
3699
|
-
import { useCallback as
|
|
4501
|
+
import { useCallback as useCallback32 } from "react";
|
|
3700
4502
|
var defaultSelectionKeys = ["Enter", " "];
|
|
3701
4503
|
var NO_SELECTION_HANDLERS = {};
|
|
3702
4504
|
var useSelection = ({
|
|
@@ -3708,17 +4510,17 @@ var useSelection = ({
|
|
|
3708
4510
|
selected: selectedProp,
|
|
3709
4511
|
selectionStrategy
|
|
3710
4512
|
}) => {
|
|
3711
|
-
const [selected, setSelected, isControlled] =
|
|
4513
|
+
const [selected, setSelected, isControlled] = useControlled4({
|
|
3712
4514
|
controlled: selectedProp,
|
|
3713
4515
|
default: defaultSelected != null ? defaultSelected : [],
|
|
3714
4516
|
name: "useSelection",
|
|
3715
4517
|
state: "selected"
|
|
3716
4518
|
});
|
|
3717
|
-
const isSelectionEvent =
|
|
4519
|
+
const isSelectionEvent = useCallback32(
|
|
3718
4520
|
(evt) => defaultSelectionKeys.includes(evt.key),
|
|
3719
4521
|
[]
|
|
3720
4522
|
);
|
|
3721
|
-
const selectItem =
|
|
4523
|
+
const selectItem = useCallback32(
|
|
3722
4524
|
(itemIndex, specialKey = false) => {
|
|
3723
4525
|
const newSelected = allowMultipleSelection(selectionStrategy, specialKey) ? selected.concat(itemIndex) : [itemIndex];
|
|
3724
4526
|
setSelected(newSelected);
|
|
@@ -3726,7 +4528,7 @@ var useSelection = ({
|
|
|
3726
4528
|
},
|
|
3727
4529
|
[onSelectionChange, selected, selectionStrategy, setSelected]
|
|
3728
4530
|
);
|
|
3729
|
-
const deselectItem =
|
|
4531
|
+
const deselectItem = useCallback32(
|
|
3730
4532
|
(itemIndex, specialKey = false) => {
|
|
3731
4533
|
const newSelected = selectionStrategy === "deselectable" || selectionStrategy === "multiple-special-key" && !specialKey ? [] : selected.filter((index) => index !== itemIndex);
|
|
3732
4534
|
setSelected(newSelected);
|
|
@@ -3734,7 +4536,7 @@ var useSelection = ({
|
|
|
3734
4536
|
},
|
|
3735
4537
|
[onSelectionChange, selected, selectionStrategy, setSelected]
|
|
3736
4538
|
);
|
|
3737
|
-
const handleKeyDown =
|
|
4539
|
+
const handleKeyDown = useCallback32(
|
|
3738
4540
|
(e) => {
|
|
3739
4541
|
if (isSelectionEvent(e) && isSelectableElement(e.target)) {
|
|
3740
4542
|
if (!selected.includes(highlightedIdx)) {
|
|
@@ -3757,7 +4559,7 @@ var useSelection = ({
|
|
|
3757
4559
|
deselectItem
|
|
3758
4560
|
]
|
|
3759
4561
|
);
|
|
3760
|
-
const handleClick =
|
|
4562
|
+
const handleClick = useCallback32(
|
|
3761
4563
|
(e, itemIndex) => {
|
|
3762
4564
|
const element = getClosestIndexItem(e.target);
|
|
3763
4565
|
if (isSelectableElement(element)) {
|
|
@@ -3792,8 +4594,8 @@ var useToolbar = ({
|
|
|
3792
4594
|
orientation,
|
|
3793
4595
|
selectionStrategy
|
|
3794
4596
|
}) => {
|
|
3795
|
-
var
|
|
3796
|
-
const lastSelection =
|
|
4597
|
+
var _a2;
|
|
4598
|
+
const lastSelection = useRef20(activeItemIndexProp);
|
|
3797
4599
|
const {
|
|
3798
4600
|
focusItem: keyboardHookFocusItem,
|
|
3799
4601
|
highlightedIdx,
|
|
@@ -3805,7 +4607,7 @@ var useToolbar = ({
|
|
|
3805
4607
|
containerRef,
|
|
3806
4608
|
keyBoardActivation: "manual",
|
|
3807
4609
|
orientation,
|
|
3808
|
-
selectedIndex: (
|
|
4610
|
+
selectedIndex: (_a2 = lastSelection.current) != null ? _a2 : []
|
|
3809
4611
|
});
|
|
3810
4612
|
const {
|
|
3811
4613
|
activateItem: selectionHookActivateItem,
|
|
@@ -3821,14 +4623,14 @@ var useToolbar = ({
|
|
|
3821
4623
|
selectionStrategy
|
|
3822
4624
|
});
|
|
3823
4625
|
lastSelection.current = selectionHookSelected;
|
|
3824
|
-
const handleClick =
|
|
4626
|
+
const handleClick = useCallback33(
|
|
3825
4627
|
(evt) => {
|
|
3826
|
-
var
|
|
4628
|
+
var _a3;
|
|
3827
4629
|
const target = evt.target;
|
|
3828
4630
|
const toolbarItem = target.closest("[data-index]");
|
|
3829
4631
|
if (toolbarItem) {
|
|
3830
|
-
const index = parseInt((
|
|
3831
|
-
if (index !== -1 &&
|
|
4632
|
+
const index = parseInt((_a3 = toolbarItem.dataset.index) != null ? _a3 : "-1");
|
|
4633
|
+
if (index !== -1 && isValidNumber4(index)) {
|
|
3832
4634
|
keyboardHookHandleClick(evt, index);
|
|
3833
4635
|
onClick == null ? void 0 : onClick(evt, index);
|
|
3834
4636
|
}
|
|
@@ -3836,7 +4638,7 @@ var useToolbar = ({
|
|
|
3836
4638
|
},
|
|
3837
4639
|
[keyboardHookHandleClick, onClick]
|
|
3838
4640
|
);
|
|
3839
|
-
const handleKeyDown =
|
|
4641
|
+
const handleKeyDown = useCallback33(
|
|
3840
4642
|
(evt) => {
|
|
3841
4643
|
keyboardHookHandleKeyDown(evt);
|
|
3842
4644
|
if (!evt.defaultPrevented) {
|
|
@@ -3845,7 +4647,7 @@ var useToolbar = ({
|
|
|
3845
4647
|
},
|
|
3846
4648
|
[keyboardHookHandleKeyDown, onKeyDown]
|
|
3847
4649
|
);
|
|
3848
|
-
const onSwitchWrappedItemIntoView =
|
|
4650
|
+
const onSwitchWrappedItemIntoView = useCallback33(
|
|
3849
4651
|
(item) => {
|
|
3850
4652
|
const index = parseInt(item.index);
|
|
3851
4653
|
if (!isNaN(index)) {
|
|
@@ -3874,8 +4676,8 @@ var useToolbar = ({
|
|
|
3874
4676
|
import {
|
|
3875
4677
|
forwardCallbackProps
|
|
3876
4678
|
} from "@vuu-ui/vuu-ui-controls";
|
|
3877
|
-
import { jsx as
|
|
3878
|
-
var
|
|
4679
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
4680
|
+
var classBase12 = "vuuToolbar";
|
|
3879
4681
|
var Toolbar = ({
|
|
3880
4682
|
activeItemIndex: activeItemIndexProp,
|
|
3881
4683
|
defaultActiveItemIndex,
|
|
@@ -3887,7 +4689,7 @@ var Toolbar = ({
|
|
|
3887
4689
|
selectionStrategy = "none",
|
|
3888
4690
|
...props
|
|
3889
4691
|
}) => {
|
|
3890
|
-
const rootRef =
|
|
4692
|
+
const rootRef = useRef21(null);
|
|
3891
4693
|
const { activeItemIndex, focusVisible, itemProps, ...toolbarHook } = useToolbar({
|
|
3892
4694
|
activeItemIndex: activeItemIndexProp,
|
|
3893
4695
|
defaultActiveItemIndex,
|
|
@@ -3897,8 +4699,8 @@ var Toolbar = ({
|
|
|
3897
4699
|
selectionStrategy
|
|
3898
4700
|
});
|
|
3899
4701
|
const id = useId(idProp);
|
|
3900
|
-
const className = (0,
|
|
3901
|
-
const items =
|
|
4702
|
+
const className = (0, import_classnames24.default)(classBase12, `${classBase12}-${orientation}`, classNameProp);
|
|
4703
|
+
const items = useMemo13(
|
|
3902
4704
|
() => asReactElements(children).map((child, index) => {
|
|
3903
4705
|
const {
|
|
3904
4706
|
id: itemId = `${id}-tab-${index}`,
|
|
@@ -3906,9 +4708,9 @@ var Toolbar = ({
|
|
|
3906
4708
|
...ownProps
|
|
3907
4709
|
} = child.props;
|
|
3908
4710
|
const selected = activeItemIndex.includes(index);
|
|
3909
|
-
return
|
|
4711
|
+
return React24.cloneElement(child, {
|
|
3910
4712
|
...forwardCallbackProps(ownProps, itemProps),
|
|
3911
|
-
className: (0,
|
|
4713
|
+
className: (0, import_classnames24.default)("vuuToolbarItem", itemClassName, {
|
|
3912
4714
|
vuuFocusVisible: focusVisible === index
|
|
3913
4715
|
}),
|
|
3914
4716
|
"data-overflow-priority": selected ? "1" : void 0,
|
|
@@ -3920,12 +4722,12 @@ var Toolbar = ({
|
|
|
3920
4722
|
}),
|
|
3921
4723
|
[activeItemIndex, children, focusVisible, id, itemProps]
|
|
3922
4724
|
);
|
|
3923
|
-
return /* @__PURE__ */
|
|
4725
|
+
return /* @__PURE__ */ jsx49(
|
|
3924
4726
|
OverflowContainer,
|
|
3925
4727
|
{
|
|
3926
4728
|
...props,
|
|
3927
4729
|
...toolbarHook.containerProps,
|
|
3928
|
-
className: (0,
|
|
4730
|
+
className: (0, import_classnames24.default)(classBase12, className),
|
|
3929
4731
|
...props,
|
|
3930
4732
|
ref: rootRef,
|
|
3931
4733
|
children: items
|
|
@@ -3934,46 +4736,45 @@ var Toolbar = ({
|
|
|
3934
4736
|
};
|
|
3935
4737
|
|
|
3936
4738
|
// ../vuu-layout/src/tools/config-wrapper/ConfigWrapper.tsx
|
|
3937
|
-
import
|
|
3938
|
-
import { jsx as
|
|
4739
|
+
import React25, { useState as useState20 } from "react";
|
|
4740
|
+
import { jsx as jsx50, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3939
4741
|
|
|
3940
4742
|
// ../vuu-layout/src/tools/devtools-box/layout-configurator.jsx
|
|
3941
|
-
import { FormField, Input } from "@salt-ds/core";
|
|
3942
|
-
import { jsx as
|
|
4743
|
+
import { FormField as FormField3, Input as Input3 } from "@salt-ds/core";
|
|
4744
|
+
import { jsx as jsx51, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3943
4745
|
var CSS_DIGIT = "(\\d+)(?:px)?";
|
|
3944
4746
|
var CSS_MEASURE = `^(?:${CSS_DIGIT}(?:\\s${CSS_DIGIT}(?:\\s${CSS_DIGIT}(?:\\s${CSS_DIGIT})?)?)?)$`;
|
|
3945
4747
|
var CSS_REX = new RegExp(CSS_MEASURE);
|
|
3946
4748
|
|
|
3947
4749
|
// ../vuu-layout/src/tools/devtools-tree/layout-tree-viewer.jsx
|
|
3948
|
-
var
|
|
3949
|
-
import
|
|
4750
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
4751
|
+
import React26 from "react";
|
|
3950
4752
|
import { Tree } from "@vuu-ui/vuu-ui-controls";
|
|
3951
|
-
import { jsx as
|
|
4753
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3952
4754
|
|
|
3953
4755
|
// src/filter-bar/FilterBar.tsx
|
|
3954
|
-
var
|
|
4756
|
+
var import_classnames30 = __toESM(require_classnames(), 1);
|
|
3955
4757
|
import { Prompt } from "@vuu-ui/vuu-popups";
|
|
3956
|
-
import { Button as
|
|
3957
|
-
import { useRef as
|
|
4758
|
+
import { Button as Button10 } from "@salt-ds/core";
|
|
4759
|
+
import { useRef as useRef28 } from "react";
|
|
3958
4760
|
|
|
3959
4761
|
// src/filter-builder-menu/FilterBuilderMenu.tsx
|
|
3960
|
-
import { useCallback as
|
|
4762
|
+
import { useCallback as useCallback34, useRef as useRef22 } from "react";
|
|
3961
4763
|
import { PopupComponent as Popup, Portal } from "@vuu-ui/vuu-popups";
|
|
3962
|
-
import { List as
|
|
3963
|
-
import { Fragment, jsx as
|
|
3964
|
-
var
|
|
4764
|
+
import { List as List4, ListItem as ListItem3 } from "@vuu-ui/vuu-ui-controls";
|
|
4765
|
+
import { Fragment as Fragment4, jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4766
|
+
var classBase13 = "vuuFilterBuilderMenu";
|
|
3965
4767
|
var FilterBuilderMenu = ({ onMenuAction }) => {
|
|
3966
|
-
const ref =
|
|
3967
|
-
const listRef =
|
|
4768
|
+
const ref = useRef22(null);
|
|
4769
|
+
const listRef = useCallback34((el) => {
|
|
3968
4770
|
if (el) {
|
|
3969
|
-
|
|
4771
|
+
requestAnimationFrame(() => {
|
|
4772
|
+
el.focus();
|
|
4773
|
+
});
|
|
3970
4774
|
}
|
|
3971
4775
|
}, []);
|
|
3972
|
-
const handleSelect =
|
|
4776
|
+
const handleSelect = useCallback34(
|
|
3973
4777
|
(evt, selected) => {
|
|
3974
|
-
console.log({
|
|
3975
|
-
selected
|
|
3976
|
-
});
|
|
3977
4778
|
const {
|
|
3978
4779
|
props: { "data-action": action }
|
|
3979
4780
|
} = selected;
|
|
@@ -3981,12 +4782,12 @@ var FilterBuilderMenu = ({ onMenuAction }) => {
|
|
|
3981
4782
|
},
|
|
3982
4783
|
[onMenuAction]
|
|
3983
4784
|
);
|
|
3984
|
-
return /* @__PURE__ */
|
|
3985
|
-
/* @__PURE__ */
|
|
3986
|
-
/* @__PURE__ */
|
|
3987
|
-
|
|
4785
|
+
return /* @__PURE__ */ jsxs26(Fragment4, { children: [
|
|
4786
|
+
/* @__PURE__ */ jsx53("span", { className: `${classBase13}-trigger`, ref }),
|
|
4787
|
+
/* @__PURE__ */ jsx53(Portal, { children: /* @__PURE__ */ jsx53(Popup, { anchorElement: ref, placement: "right", children: /* @__PURE__ */ jsxs26(
|
|
4788
|
+
List4,
|
|
3988
4789
|
{
|
|
3989
|
-
className: `${
|
|
4790
|
+
className: `${classBase13}List`,
|
|
3990
4791
|
defaultHighlightedIndex: 1,
|
|
3991
4792
|
itemHeight: 22,
|
|
3992
4793
|
ref: listRef,
|
|
@@ -3994,9 +4795,9 @@ var FilterBuilderMenu = ({ onMenuAction }) => {
|
|
|
3994
4795
|
style: { position: "relative" },
|
|
3995
4796
|
width: 100,
|
|
3996
4797
|
children: [
|
|
3997
|
-
/* @__PURE__ */
|
|
3998
|
-
/* @__PURE__ */
|
|
3999
|
-
/* @__PURE__ */
|
|
4798
|
+
/* @__PURE__ */ jsx53(ListItem3, { "data-action": "apply-save", className: "vuuMenuButton", children: "APPLY AND SAVE" }),
|
|
4799
|
+
/* @__PURE__ */ jsx53(ListItem3, { "data-action": "and-clause", children: "AND" }),
|
|
4800
|
+
/* @__PURE__ */ jsx53(ListItem3, { "data-action": "or-clause", children: "OR" })
|
|
4000
4801
|
]
|
|
4001
4802
|
}
|
|
4002
4803
|
) }) })
|
|
@@ -4004,46 +4805,65 @@ var FilterBuilderMenu = ({ onMenuAction }) => {
|
|
|
4004
4805
|
};
|
|
4005
4806
|
|
|
4006
4807
|
// src/filter-clause/ExpandoCombobox.tsx
|
|
4007
|
-
var
|
|
4808
|
+
var import_classnames26 = __toESM(require_classnames(), 1);
|
|
4008
4809
|
import { itemToString as defaultToString } from "@vuu-ui/vuu-utils";
|
|
4009
|
-
import { ComboBox } from "@vuu-ui/vuu-ui-controls";
|
|
4010
4810
|
import {
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4811
|
+
ComboBox as ComboBox2
|
|
4812
|
+
} from "@vuu-ui/vuu-ui-controls";
|
|
4813
|
+
import {
|
|
4814
|
+
forwardRef as forwardRef12,
|
|
4815
|
+
useCallback as useCallback35,
|
|
4816
|
+
useMemo as useMemo14,
|
|
4817
|
+
useRef as useRef23,
|
|
4818
|
+
useState as useState21
|
|
4016
4819
|
} from "react";
|
|
4017
|
-
import { jsx as
|
|
4018
|
-
var
|
|
4820
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
4821
|
+
var classBase14 = "vuuExpandoCombobox";
|
|
4019
4822
|
var NO_INPUT_PROPS = {};
|
|
4020
|
-
var ExpandoCombobox =
|
|
4021
|
-
allowMultipleSelection: allowMultipleSelection2 = false,
|
|
4823
|
+
var ExpandoCombobox = forwardRef12(function ExpandoCombobox2({
|
|
4022
4824
|
className: classNameProp,
|
|
4023
4825
|
InputProps: InputPropsProp = NO_INPUT_PROPS,
|
|
4024
4826
|
ListProps: ListPropsProp,
|
|
4025
4827
|
onInputChange,
|
|
4026
4828
|
onSelectionChange,
|
|
4829
|
+
selectionStrategy,
|
|
4830
|
+
style,
|
|
4027
4831
|
value = "",
|
|
4028
4832
|
...props
|
|
4029
4833
|
}, forwardedRef) {
|
|
4030
|
-
const [text, setText] =
|
|
4834
|
+
const [text, setText] = useState21(value);
|
|
4031
4835
|
const { itemToString = defaultToString } = props;
|
|
4032
|
-
const initialValue =
|
|
4033
|
-
const
|
|
4836
|
+
const initialValue = useRef23(value);
|
|
4837
|
+
const itemsToString = useCallback35(
|
|
4838
|
+
(items) => {
|
|
4839
|
+
const [first, ...rest] = items;
|
|
4840
|
+
if (rest.length) {
|
|
4841
|
+
return `${itemToString(first)} + ${rest.length}`;
|
|
4842
|
+
} else {
|
|
4843
|
+
return itemToString(first);
|
|
4844
|
+
}
|
|
4845
|
+
},
|
|
4846
|
+
[itemToString]
|
|
4847
|
+
);
|
|
4848
|
+
const handleInputChange = useCallback35(
|
|
4034
4849
|
(evt) => {
|
|
4035
4850
|
const { value: value2 } = evt.target;
|
|
4851
|
+
console.log(`onInputChange ${value2}`);
|
|
4036
4852
|
setText(value2);
|
|
4037
4853
|
onInputChange == null ? void 0 : onInputChange(evt);
|
|
4038
4854
|
},
|
|
4039
4855
|
[onInputChange]
|
|
4040
4856
|
);
|
|
4041
|
-
const
|
|
4857
|
+
const handleSetSelectedText = useCallback35((text2) => {
|
|
4858
|
+
console.log(`handleSetSelectedText ${text2}`);
|
|
4859
|
+
setText(text2);
|
|
4860
|
+
}, []);
|
|
4861
|
+
const [InputProps, ListProps] = useMemo14(() => {
|
|
4042
4862
|
const { inputProps, ...restInputProps } = InputPropsProp;
|
|
4043
4863
|
return [
|
|
4044
4864
|
{
|
|
4045
4865
|
...restInputProps,
|
|
4046
|
-
className: `${
|
|
4866
|
+
className: `${classBase14}-Input`,
|
|
4047
4867
|
endAdornment: null,
|
|
4048
4868
|
inputProps: {
|
|
4049
4869
|
...inputProps,
|
|
@@ -4053,7 +4873,7 @@ var ExpandoCombobox = forwardRef9(function ExpandoCombobox2({
|
|
|
4053
4873
|
},
|
|
4054
4874
|
{
|
|
4055
4875
|
...ListPropsProp,
|
|
4056
|
-
className: (0,
|
|
4876
|
+
className: (0, import_classnames26.default)("vuuMenuList", ListPropsProp == null ? void 0 : ListPropsProp.className),
|
|
4057
4877
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4058
4878
|
// @ts-ignore
|
|
4059
4879
|
"data-mode": "light",
|
|
@@ -4065,41 +4885,46 @@ var ExpandoCombobox = forwardRef9(function ExpandoCombobox2({
|
|
|
4065
4885
|
}
|
|
4066
4886
|
];
|
|
4067
4887
|
}, [InputPropsProp, handleInputChange, ListPropsProp]);
|
|
4068
|
-
const handleSelectionChange =
|
|
4069
|
-
(evt,
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4888
|
+
const handleSelectionChange = useCallback35(
|
|
4889
|
+
(evt, selected) => {
|
|
4890
|
+
if (Array.isArray(selected)) {
|
|
4891
|
+
onSelectionChange == null ? void 0 : onSelectionChange(
|
|
4892
|
+
null,
|
|
4893
|
+
selected
|
|
4894
|
+
);
|
|
4895
|
+
} else if (selected) {
|
|
4896
|
+
setText(itemToString(selected));
|
|
4897
|
+
onSelectionChange == null ? void 0 : onSelectionChange(
|
|
4898
|
+
null,
|
|
4899
|
+
selected
|
|
4900
|
+
);
|
|
4901
|
+
}
|
|
4073
4902
|
},
|
|
4074
4903
|
[itemToString, onSelectionChange]
|
|
4075
4904
|
);
|
|
4076
|
-
const
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
return /* @__PURE__ */ jsx26(
|
|
4905
|
+
const popupProps = {
|
|
4906
|
+
minWidth: 102
|
|
4907
|
+
};
|
|
4908
|
+
return /* @__PURE__ */ jsx54(
|
|
4081
4909
|
"div",
|
|
4082
4910
|
{
|
|
4083
|
-
className: (0,
|
|
4911
|
+
className: (0, import_classnames26.default)(classBase14, classNameProp),
|
|
4084
4912
|
"data-text": text,
|
|
4085
4913
|
ref: forwardedRef,
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
...props,
|
|
4090
|
-
defaultValue: initialValue.current,
|
|
4091
|
-
ListProps,
|
|
4092
|
-
InputProps,
|
|
4093
|
-
onSelectionChange: handleSelectionChange
|
|
4094
|
-
}
|
|
4095
|
-
) : /* @__PURE__ */ jsx26(
|
|
4096
|
-
ComboBox,
|
|
4914
|
+
style,
|
|
4915
|
+
children: /* @__PURE__ */ jsx54(
|
|
4916
|
+
ComboBox2,
|
|
4097
4917
|
{
|
|
4098
4918
|
...props,
|
|
4919
|
+
PopupProps: popupProps,
|
|
4099
4920
|
defaultValue: initialValue.current,
|
|
4921
|
+
fullWidth: true,
|
|
4100
4922
|
ListProps,
|
|
4101
4923
|
InputProps,
|
|
4102
|
-
|
|
4924
|
+
itemsToString,
|
|
4925
|
+
onSelectionChange: handleSelectionChange,
|
|
4926
|
+
onSetSelectedText: handleSetSelectedText,
|
|
4927
|
+
selectionStrategy
|
|
4103
4928
|
}
|
|
4104
4929
|
)
|
|
4105
4930
|
}
|
|
@@ -4107,14 +4932,14 @@ var ExpandoCombobox = forwardRef9(function ExpandoCombobox2({
|
|
|
4107
4932
|
});
|
|
4108
4933
|
|
|
4109
4934
|
// src/filter-clause/FilterClauseEditor.tsx
|
|
4110
|
-
var
|
|
4111
|
-
import { useCallback as
|
|
4935
|
+
var import_classnames27 = __toESM(require_classnames(), 1);
|
|
4936
|
+
import { useCallback as useCallback39 } from "react";
|
|
4112
4937
|
|
|
4113
4938
|
// src/filter-clause/CloseButton.tsx
|
|
4114
|
-
import { Button as
|
|
4115
|
-
import { jsx as
|
|
4116
|
-
var CloseButton = ({ className, onClick }) => /* @__PURE__ */
|
|
4117
|
-
|
|
4939
|
+
import { Button as Button9 } from "@salt-ds/core";
|
|
4940
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4941
|
+
var CloseButton = ({ className, onClick }) => /* @__PURE__ */ jsx55(
|
|
4942
|
+
Button9,
|
|
4118
4943
|
{
|
|
4119
4944
|
className,
|
|
4120
4945
|
"data-icon": "close",
|
|
@@ -4125,14 +4950,14 @@ var CloseButton = ({ className, onClick }) => /* @__PURE__ */ jsx27(
|
|
|
4125
4950
|
|
|
4126
4951
|
// src/filter-clause/NumericInput.tsx
|
|
4127
4952
|
import {
|
|
4128
|
-
forwardRef as
|
|
4129
|
-
useState as
|
|
4130
|
-
useCallback as
|
|
4953
|
+
forwardRef as forwardRef13,
|
|
4954
|
+
useState as useState22,
|
|
4955
|
+
useCallback as useCallback36
|
|
4131
4956
|
} from "react";
|
|
4132
4957
|
import { ExpandoInput } from "@vuu-ui/vuu-ui-controls";
|
|
4133
|
-
import { isValidNumber as
|
|
4134
|
-
import { jsx as
|
|
4135
|
-
var NumericInput =
|
|
4958
|
+
import { isValidNumber as isValidNumber5 } from "@vuu-ui/vuu-utils";
|
|
4959
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4960
|
+
var NumericInput = forwardRef13(function NumericInput2({
|
|
4136
4961
|
InputProps,
|
|
4137
4962
|
className,
|
|
4138
4963
|
column,
|
|
@@ -4141,30 +4966,30 @@ var NumericInput = forwardRef10(function NumericInput2({
|
|
|
4141
4966
|
// operator,
|
|
4142
4967
|
value: valueProp
|
|
4143
4968
|
}, forwardedRef) {
|
|
4144
|
-
const [value, setValue] =
|
|
4145
|
-
|
|
4969
|
+
const [value, setValue] = useState22(
|
|
4970
|
+
isValidNumber5(valueProp) ? valueProp.toString() : ""
|
|
4146
4971
|
);
|
|
4147
|
-
const handleChange =
|
|
4972
|
+
const handleChange = useCallback36((evt) => {
|
|
4148
4973
|
const { value: value2 } = evt.target;
|
|
4149
4974
|
const numericValue = parseFloat(value2);
|
|
4150
|
-
if (
|
|
4975
|
+
if (isValidNumber5(numericValue)) {
|
|
4151
4976
|
console.log("its valid");
|
|
4152
4977
|
}
|
|
4153
4978
|
setValue(value2);
|
|
4154
4979
|
}, []);
|
|
4155
|
-
const handleKeyDown =
|
|
4980
|
+
const handleKeyDown = useCallback36(
|
|
4156
4981
|
(evt) => {
|
|
4157
4982
|
if (evt.key === "Enter") {
|
|
4158
4983
|
const { value: value2 } = evt.target;
|
|
4159
4984
|
const numericValue = parseFloat(value2);
|
|
4160
|
-
if (
|
|
4985
|
+
if (isValidNumber5(numericValue)) {
|
|
4161
4986
|
onInputComplete(numericValue);
|
|
4162
4987
|
}
|
|
4163
4988
|
}
|
|
4164
4989
|
},
|
|
4165
4990
|
[onInputComplete]
|
|
4166
4991
|
);
|
|
4167
|
-
return /* @__PURE__ */
|
|
4992
|
+
return /* @__PURE__ */ jsx56(
|
|
4168
4993
|
ExpandoInput,
|
|
4169
4994
|
{
|
|
4170
4995
|
...InputProps,
|
|
@@ -4193,40 +5018,49 @@ var getOperators = (column) => {
|
|
|
4193
5018
|
|
|
4194
5019
|
// src/filter-clause/TextInput.tsx
|
|
4195
5020
|
import {
|
|
4196
|
-
forwardRef as
|
|
4197
|
-
useCallback as
|
|
4198
|
-
useEffect as
|
|
4199
|
-
useMemo as
|
|
4200
|
-
useState as
|
|
5021
|
+
forwardRef as forwardRef14,
|
|
5022
|
+
useCallback as useCallback37,
|
|
5023
|
+
useEffect as useEffect12,
|
|
5024
|
+
useMemo as useMemo15,
|
|
5025
|
+
useState as useState23
|
|
4201
5026
|
} from "react";
|
|
4202
5027
|
import {
|
|
4203
5028
|
useTypeaheadSuggestions
|
|
4204
5029
|
} from "@vuu-ui/vuu-data-react";
|
|
4205
|
-
import {
|
|
4206
|
-
|
|
4207
|
-
|
|
5030
|
+
import {
|
|
5031
|
+
ExpandoInput as ExpandoInput2
|
|
5032
|
+
} from "@vuu-ui/vuu-ui-controls";
|
|
5033
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5034
|
+
var TextInput = forwardRef14(function TextInput2({
|
|
4208
5035
|
InputProps: InputPropsProp = {},
|
|
4209
5036
|
className,
|
|
4210
5037
|
column,
|
|
4211
|
-
filterClause,
|
|
4212
5038
|
onInputComplete,
|
|
4213
5039
|
operator,
|
|
4214
5040
|
suggestionProvider = useTypeaheadSuggestions,
|
|
4215
5041
|
table,
|
|
4216
5042
|
value
|
|
4217
5043
|
}, forwardedRef) {
|
|
4218
|
-
const [valueInputValue, setValueInputValue] =
|
|
4219
|
-
const [typeaheadValues, setTypeaheadValues] =
|
|
5044
|
+
const [valueInputValue, setValueInputValue] = useState23(value != null ? value : "");
|
|
5045
|
+
const [typeaheadValues, setTypeaheadValues] = useState23([]);
|
|
4220
5046
|
const getSuggestions = suggestionProvider();
|
|
4221
|
-
const
|
|
5047
|
+
const handleSingleValueSelectionChange = useCallback37(
|
|
5048
|
+
(evt, value2) => onInputComplete(value2),
|
|
5049
|
+
[onInputComplete]
|
|
5050
|
+
);
|
|
5051
|
+
const handleMultiValueSelectionChange = useCallback37(
|
|
4222
5052
|
(evt, value2) => {
|
|
4223
|
-
|
|
5053
|
+
if (value2.length === 1) {
|
|
5054
|
+
onInputComplete(value2[0]);
|
|
5055
|
+
} else if (value2.length > 1) {
|
|
5056
|
+
onInputComplete(value2);
|
|
5057
|
+
}
|
|
4224
5058
|
},
|
|
4225
5059
|
[onInputComplete]
|
|
4226
5060
|
);
|
|
4227
|
-
|
|
5061
|
+
useEffect12(() => {
|
|
4228
5062
|
}, [column]);
|
|
4229
|
-
|
|
5063
|
+
useEffect12(() => {
|
|
4230
5064
|
if (table) {
|
|
4231
5065
|
const params = valueInputValue ? [table, column.name, valueInputValue] : [table, column.name];
|
|
4232
5066
|
getSuggestions(params).then((suggestions) => {
|
|
@@ -4236,11 +5070,11 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4236
5070
|
});
|
|
4237
5071
|
}
|
|
4238
5072
|
}, [table, column, valueInputValue, getSuggestions]);
|
|
4239
|
-
const handleInputChange =
|
|
5073
|
+
const handleInputChange = useCallback37((evt) => {
|
|
4240
5074
|
const { value: value2 } = evt.target;
|
|
4241
5075
|
setValueInputValue(value2);
|
|
4242
5076
|
}, []);
|
|
4243
|
-
const InputProps =
|
|
5077
|
+
const InputProps = useMemo15(() => {
|
|
4244
5078
|
if (operator === "starts" || operator === "ends") {
|
|
4245
5079
|
const { inputProps, ...restInputProps } = InputPropsProp;
|
|
4246
5080
|
return {
|
|
@@ -4248,13 +5082,13 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4248
5082
|
inputProps: {
|
|
4249
5083
|
...inputProps,
|
|
4250
5084
|
onKeyDown: (evt) => {
|
|
4251
|
-
var
|
|
5085
|
+
var _a2;
|
|
4252
5086
|
if (evt.key === "Enter" && valueInputValue !== "") {
|
|
4253
5087
|
evt.stopPropagation();
|
|
4254
5088
|
evt.preventDefault();
|
|
4255
5089
|
onInputComplete(valueInputValue);
|
|
4256
5090
|
} else {
|
|
4257
|
-
(
|
|
5091
|
+
(_a2 = inputProps == null ? void 0 : inputProps.onKeyDown) == null ? void 0 : _a2.call(inputProps, evt);
|
|
4258
5092
|
}
|
|
4259
5093
|
}
|
|
4260
5094
|
}
|
|
@@ -4263,10 +5097,10 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4263
5097
|
return InputPropsProp;
|
|
4264
5098
|
}
|
|
4265
5099
|
}, [InputPropsProp, onInputComplete, operator, valueInputValue]);
|
|
4266
|
-
const getValueInputField =
|
|
5100
|
+
const getValueInputField = useCallback37(() => {
|
|
4267
5101
|
switch (operator) {
|
|
4268
5102
|
case "in":
|
|
4269
|
-
return /* @__PURE__ */
|
|
5103
|
+
return /* @__PURE__ */ jsx57(
|
|
4270
5104
|
ExpandoCombobox,
|
|
4271
5105
|
{
|
|
4272
5106
|
InputProps,
|
|
@@ -4274,13 +5108,14 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4274
5108
|
initialHighlightedIndex: 0,
|
|
4275
5109
|
source: typeaheadValues,
|
|
4276
5110
|
onInputChange: handleInputChange,
|
|
4277
|
-
onSelectionChange:
|
|
5111
|
+
onSelectionChange: handleMultiValueSelectionChange,
|
|
4278
5112
|
ref: forwardedRef,
|
|
5113
|
+
selectionStrategy: "multiple",
|
|
4279
5114
|
value
|
|
4280
5115
|
}
|
|
4281
5116
|
);
|
|
4282
5117
|
case "starts":
|
|
4283
|
-
return /* @__PURE__ */
|
|
5118
|
+
return /* @__PURE__ */ jsx57(
|
|
4284
5119
|
ExpandoCombobox,
|
|
4285
5120
|
{
|
|
4286
5121
|
InputProps,
|
|
@@ -4293,13 +5128,13 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4293
5128
|
initialHighlightedIndex: 0,
|
|
4294
5129
|
source: typeaheadValues,
|
|
4295
5130
|
onInputChange: handleInputChange,
|
|
4296
|
-
onSelectionChange:
|
|
5131
|
+
onSelectionChange: handleSingleValueSelectionChange,
|
|
4297
5132
|
ref: forwardedRef,
|
|
4298
5133
|
value
|
|
4299
5134
|
}
|
|
4300
5135
|
);
|
|
4301
5136
|
case "ends":
|
|
4302
|
-
return /* @__PURE__ */
|
|
5137
|
+
return /* @__PURE__ */ jsx57(
|
|
4303
5138
|
ExpandoInput2,
|
|
4304
5139
|
{
|
|
4305
5140
|
...InputProps,
|
|
@@ -4310,15 +5145,16 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4310
5145
|
}
|
|
4311
5146
|
);
|
|
4312
5147
|
default:
|
|
4313
|
-
return /* @__PURE__ */
|
|
5148
|
+
return /* @__PURE__ */ jsx57(
|
|
4314
5149
|
ExpandoCombobox,
|
|
4315
5150
|
{
|
|
4316
5151
|
InputProps,
|
|
4317
5152
|
className,
|
|
4318
5153
|
initialHighlightedIndex: 0,
|
|
4319
5154
|
source: typeaheadValues,
|
|
5155
|
+
title: "value",
|
|
4320
5156
|
onInputChange: handleInputChange,
|
|
4321
|
-
onSelectionChange:
|
|
5157
|
+
onSelectionChange: handleSingleValueSelectionChange,
|
|
4322
5158
|
ref: forwardedRef,
|
|
4323
5159
|
value
|
|
4324
5160
|
}
|
|
@@ -4330,9 +5166,10 @@ var TextInput = forwardRef11(function TextInput2({
|
|
|
4330
5166
|
className,
|
|
4331
5167
|
typeaheadValues,
|
|
4332
5168
|
handleInputChange,
|
|
4333
|
-
|
|
5169
|
+
handleMultiValueSelectionChange,
|
|
4334
5170
|
forwardedRef,
|
|
4335
5171
|
value,
|
|
5172
|
+
handleSingleValueSelectionChange,
|
|
4336
5173
|
valueInputValue
|
|
4337
5174
|
]);
|
|
4338
5175
|
return getValueInputField();
|
|
@@ -4346,26 +5183,43 @@ import {
|
|
|
4346
5183
|
} from "@vuu-ui/vuu-utils";
|
|
4347
5184
|
import { getColumnByName } from "@vuu-ui/vuu-data";
|
|
4348
5185
|
import {
|
|
4349
|
-
useCallback as
|
|
4350
|
-
|
|
4351
|
-
|
|
5186
|
+
useCallback as useCallback38,
|
|
5187
|
+
useEffect as useEffect13,
|
|
5188
|
+
useMemo as useMemo16,
|
|
5189
|
+
useRef as useRef24,
|
|
5190
|
+
useState as useState24
|
|
4352
5191
|
} from "react";
|
|
4353
5192
|
var cursorAtTextStart = (input) => input.selectionStart === 0;
|
|
4354
5193
|
var cursorAtTextEnd = (input) => input.selectionStart === input.value.length;
|
|
4355
5194
|
var getFieldName = (field) => (field == null ? void 0 : field.classList.contains("vuuFilterClauseColumn")) ? "column" : (field == null ? void 0 : field.classList.contains("vuuFilterClauseOperator")) ? "operator" : "value";
|
|
5195
|
+
var getFocusedField = () => {
|
|
5196
|
+
var _a2;
|
|
5197
|
+
return (_a2 = document.activeElement) == null ? void 0 : _a2.closest(".vuuFilterClauseField");
|
|
5198
|
+
};
|
|
5199
|
+
var focusNextFocusableElement = (direction = "fwd") => {
|
|
5200
|
+
var _a2;
|
|
5201
|
+
const activeField = getFocusedField();
|
|
5202
|
+
const filterClause = activeField == null ? void 0 : activeField.closest(".vuuFilterClause");
|
|
5203
|
+
if ((filterClause == null ? void 0 : filterClause.lastChild) === activeField) {
|
|
5204
|
+
requestAnimationFrame(() => {
|
|
5205
|
+
focusNextFocusableElement();
|
|
5206
|
+
});
|
|
5207
|
+
} else {
|
|
5208
|
+
const nextField = direction === "fwd" ? activeField.nextElementSibling : activeField.previousElementSibling;
|
|
5209
|
+
(_a2 = nextField == null ? void 0 : nextField.querySelector("input")) == null ? void 0 : _a2.focus();
|
|
5210
|
+
}
|
|
5211
|
+
};
|
|
4356
5212
|
var focusNextElement = () => {
|
|
4357
|
-
|
|
4358
|
-
const filterClauseField = (_a = document.activeElement) == null ? void 0 : _a.closest(
|
|
4359
|
-
".vuuFilterClauseField"
|
|
4360
|
-
);
|
|
5213
|
+
const filterClauseField = getFocusedField();
|
|
4361
5214
|
const filterClause = filterClauseField == null ? void 0 : filterClauseField.closest(".vuuFilterClause");
|
|
4362
5215
|
if (filterClause && filterClauseField) {
|
|
4363
5216
|
if (filterClauseField.classList.contains("vuuFilterClauseValue")) {
|
|
4364
|
-
console.log("focus on clear button");
|
|
4365
5217
|
const clearButton = filterClause.querySelector(
|
|
4366
5218
|
".vuuFilterClause-closeButton"
|
|
4367
5219
|
);
|
|
4368
5220
|
clearButton == null ? void 0 : clearButton.focus();
|
|
5221
|
+
} else {
|
|
5222
|
+
focusNextFocusableElement();
|
|
4369
5223
|
}
|
|
4370
5224
|
}
|
|
4371
5225
|
};
|
|
@@ -4383,6 +5237,7 @@ var navigateToNextInputIfAtBoundary = (evt) => {
|
|
|
4383
5237
|
const nextField = field.previousSibling;
|
|
4384
5238
|
const nextInput = nextField == null ? void 0 : nextField.querySelector("input");
|
|
4385
5239
|
evt.preventDefault();
|
|
5240
|
+
console.log("%cfocus nextInput", "color:green;font-weight:bold");
|
|
4386
5241
|
nextInput == null ? void 0 : nextInput.focus();
|
|
4387
5242
|
requestAnimationFrame(() => {
|
|
4388
5243
|
nextInput == null ? void 0 : nextInput.select();
|
|
@@ -4422,43 +5277,59 @@ var useFilterClauseEditor = ({
|
|
|
4422
5277
|
onChange,
|
|
4423
5278
|
tableSchema
|
|
4424
5279
|
}) => {
|
|
4425
|
-
const
|
|
4426
|
-
const
|
|
5280
|
+
const columnRef = useRef24(null);
|
|
5281
|
+
const operatorRef = useRef24(null);
|
|
5282
|
+
const valueRef = useRef24(null);
|
|
5283
|
+
const [selectedColumn, setSelectedColumn] = useState24(getColumnByName(tableSchema, filterClause.column));
|
|
5284
|
+
const [operator, _setOperator] = useState24(
|
|
4427
5285
|
filterClause.op
|
|
4428
5286
|
);
|
|
4429
|
-
const
|
|
5287
|
+
const setOperator = useCallback38((op) => {
|
|
5288
|
+
_setOperator(op);
|
|
5289
|
+
}, []);
|
|
5290
|
+
const [value, setValue] = useState24(
|
|
4430
5291
|
getFilterClauseValue(filterClause)
|
|
4431
5292
|
);
|
|
4432
|
-
const handleSelectionChangeColumn =
|
|
5293
|
+
const handleSelectionChangeColumn = useCallback38(
|
|
4433
5294
|
(evt, column) => {
|
|
4434
5295
|
setSelectedColumn(column != null ? column : void 0);
|
|
4435
5296
|
setOperator(void 0);
|
|
4436
5297
|
setValue(void 0);
|
|
5298
|
+
focusNextElement();
|
|
4437
5299
|
},
|
|
4438
|
-
[]
|
|
5300
|
+
[setOperator]
|
|
4439
5301
|
);
|
|
4440
|
-
const handleSelectionChangeOperator =
|
|
4441
|
-
(evt,
|
|
4442
|
-
const op =
|
|
5302
|
+
const handleSelectionChangeOperator = useCallback38(
|
|
5303
|
+
(evt, selected) => {
|
|
5304
|
+
const op = selected;
|
|
4443
5305
|
if (op === void 0 || isValidFilterClauseOp(op)) {
|
|
4444
5306
|
setOperator(op);
|
|
5307
|
+
focusNextElement();
|
|
4445
5308
|
} else {
|
|
4446
5309
|
throw Error(
|
|
4447
5310
|
`FilterClauseEditor, invalid value ${op} for filter clause`
|
|
4448
5311
|
);
|
|
4449
5312
|
}
|
|
4450
5313
|
},
|
|
4451
|
-
[]
|
|
5314
|
+
[setOperator]
|
|
4452
5315
|
);
|
|
4453
|
-
const handleChangeValue =
|
|
5316
|
+
const handleChangeValue = useCallback38(
|
|
4454
5317
|
(value2) => {
|
|
4455
5318
|
setValue(value2);
|
|
4456
5319
|
if (value2 !== null && value2 !== "") {
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
5320
|
+
if (Array.isArray(value2)) {
|
|
5321
|
+
onChange({
|
|
5322
|
+
column: selectedColumn == null ? void 0 : selectedColumn.name,
|
|
5323
|
+
op: operator,
|
|
5324
|
+
values: value2
|
|
5325
|
+
});
|
|
5326
|
+
} else {
|
|
5327
|
+
onChange({
|
|
5328
|
+
column: selectedColumn == null ? void 0 : selectedColumn.name,
|
|
5329
|
+
op: operator,
|
|
5330
|
+
value: value2
|
|
5331
|
+
});
|
|
5332
|
+
}
|
|
4462
5333
|
requestAnimationFrame(() => {
|
|
4463
5334
|
focusNextElement();
|
|
4464
5335
|
});
|
|
@@ -4466,7 +5337,7 @@ var useFilterClauseEditor = ({
|
|
|
4466
5337
|
},
|
|
4467
5338
|
[onChange, operator, selectedColumn == null ? void 0 : selectedColumn.name]
|
|
4468
5339
|
);
|
|
4469
|
-
const handleKeyDownInput =
|
|
5340
|
+
const handleKeyDownInput = useCallback38(
|
|
4470
5341
|
(evt) => {
|
|
4471
5342
|
if (["ArrowLeft", "ArrowRight"].includes(evt.key)) {
|
|
4472
5343
|
navigateToNextInputIfAtBoundary(evt);
|
|
@@ -4476,7 +5347,7 @@ var useFilterClauseEditor = ({
|
|
|
4476
5347
|
},
|
|
4477
5348
|
[operator]
|
|
4478
5349
|
);
|
|
4479
|
-
const InputProps =
|
|
5350
|
+
const InputProps = useMemo16(
|
|
4480
5351
|
() => ({
|
|
4481
5352
|
inputProps: {
|
|
4482
5353
|
onKeyDown: handleKeyDownInput
|
|
@@ -4484,20 +5355,28 @@ var useFilterClauseEditor = ({
|
|
|
4484
5355
|
}),
|
|
4485
5356
|
[handleKeyDownInput]
|
|
4486
5357
|
);
|
|
5358
|
+
useEffect13(() => {
|
|
5359
|
+
var _a2;
|
|
5360
|
+
const columnInput = (_a2 = columnRef.current) == null ? void 0 : _a2.querySelector("input");
|
|
5361
|
+
columnInput == null ? void 0 : columnInput.focus();
|
|
5362
|
+
}, []);
|
|
4487
5363
|
return {
|
|
4488
5364
|
InputProps,
|
|
5365
|
+
columnRef,
|
|
4489
5366
|
onChangeValue: handleChangeValue,
|
|
4490
5367
|
onSelectionChangeColumn: handleSelectionChangeColumn,
|
|
4491
5368
|
onSelectionChangeOperator: handleSelectionChangeOperator,
|
|
4492
5369
|
operator,
|
|
5370
|
+
operatorRef,
|
|
4493
5371
|
selectedColumn,
|
|
4494
|
-
value
|
|
5372
|
+
value,
|
|
5373
|
+
valueRef
|
|
4495
5374
|
};
|
|
4496
5375
|
};
|
|
4497
5376
|
|
|
4498
5377
|
// src/filter-clause/FilterClauseEditor.tsx
|
|
4499
|
-
import { jsx as
|
|
4500
|
-
var
|
|
5378
|
+
import { jsx as jsx58, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5379
|
+
var classBase15 = "vuuFilterClause";
|
|
4501
5380
|
var FilterClauseEditor = ({
|
|
4502
5381
|
className,
|
|
4503
5382
|
onChange,
|
|
@@ -4507,53 +5386,36 @@ var FilterClauseEditor = ({
|
|
|
4507
5386
|
tableSchema,
|
|
4508
5387
|
...htmlAttributes
|
|
4509
5388
|
}) => {
|
|
4510
|
-
var
|
|
5389
|
+
var _a2;
|
|
4511
5390
|
const { table, columns } = tableSchema;
|
|
4512
|
-
const columnRef = useRef22(null);
|
|
4513
|
-
const operatorRef = useRef22(null);
|
|
4514
|
-
const valueRef = useRef22(null);
|
|
4515
5391
|
const {
|
|
4516
5392
|
InputProps,
|
|
5393
|
+
columnRef,
|
|
4517
5394
|
onChangeValue,
|
|
4518
5395
|
onSelectionChangeColumn,
|
|
4519
5396
|
onSelectionChangeOperator,
|
|
4520
5397
|
operator,
|
|
5398
|
+
operatorRef,
|
|
4521
5399
|
selectedColumn,
|
|
4522
|
-
value
|
|
5400
|
+
value,
|
|
5401
|
+
valueRef
|
|
4523
5402
|
} = useFilterClauseEditor({
|
|
4524
5403
|
filterClause,
|
|
4525
5404
|
onChange,
|
|
4526
5405
|
tableSchema
|
|
4527
5406
|
});
|
|
4528
|
-
|
|
4529
|
-
var _a2;
|
|
4530
|
-
if (selectedColumn === void 0) {
|
|
4531
|
-
const columnInput = (_a2 = columnRef.current) == null ? void 0 : _a2.querySelector("input");
|
|
4532
|
-
columnInput == null ? void 0 : columnInput.focus();
|
|
4533
|
-
} else if (selectedColumn !== void 0 && operator === void 0 && operatorRef.current) {
|
|
4534
|
-
const operatorInput = operatorRef.current.querySelector("input");
|
|
4535
|
-
operatorInput == null ? void 0 : operatorInput.focus();
|
|
4536
|
-
}
|
|
4537
|
-
}, [operator, selectedColumn]);
|
|
4538
|
-
useEffect6(() => {
|
|
4539
|
-
if (operator !== void 0 && value === void 0 && valueRef.current) {
|
|
4540
|
-
console.log(`Looks like operator has changed, is now ${operator}`);
|
|
4541
|
-
const valueInput = valueRef.current.querySelector("input");
|
|
4542
|
-
valueInput == null ? void 0 : valueInput.focus();
|
|
4543
|
-
}
|
|
4544
|
-
}, [operator, value]);
|
|
4545
|
-
const getInputElement = useCallback28(() => {
|
|
5407
|
+
const getInputElement = useCallback39(() => {
|
|
4546
5408
|
if (selectedColumn === null || operator === void 0) {
|
|
4547
5409
|
return null;
|
|
4548
5410
|
}
|
|
4549
5411
|
switch (selectedColumn == null ? void 0 : selectedColumn.serverDataType) {
|
|
4550
5412
|
case "string":
|
|
4551
5413
|
case "char":
|
|
4552
|
-
return /* @__PURE__ */
|
|
5414
|
+
return /* @__PURE__ */ jsx58(
|
|
4553
5415
|
TextInput,
|
|
4554
5416
|
{
|
|
4555
5417
|
InputProps,
|
|
4556
|
-
className: (0,
|
|
5418
|
+
className: (0, import_classnames27.default)(`${classBase15}Field`, `${classBase15}Value`),
|
|
4557
5419
|
column: selectedColumn,
|
|
4558
5420
|
filterClause,
|
|
4559
5421
|
onInputComplete: onChangeValue,
|
|
@@ -4567,11 +5429,11 @@ var FilterClauseEditor = ({
|
|
|
4567
5429
|
case "int":
|
|
4568
5430
|
case "long":
|
|
4569
5431
|
case "double":
|
|
4570
|
-
return /* @__PURE__ */
|
|
5432
|
+
return /* @__PURE__ */ jsx58(
|
|
4571
5433
|
NumericInput,
|
|
4572
5434
|
{
|
|
4573
5435
|
InputProps,
|
|
4574
|
-
className: (0,
|
|
5436
|
+
className: (0, import_classnames27.default)(`${classBase15}Field`, `${classBase15}Value`),
|
|
4575
5437
|
column: selectedColumn,
|
|
4576
5438
|
filterClause,
|
|
4577
5439
|
onInputComplete: onChangeValue,
|
|
@@ -4592,30 +5454,33 @@ var FilterClauseEditor = ({
|
|
|
4592
5454
|
InputProps,
|
|
4593
5455
|
filterClause,
|
|
4594
5456
|
onChangeValue,
|
|
5457
|
+
valueRef,
|
|
4595
5458
|
suggestionProvider,
|
|
4596
5459
|
table,
|
|
4597
5460
|
value
|
|
4598
5461
|
]);
|
|
4599
|
-
return /* @__PURE__ */
|
|
4600
|
-
/* @__PURE__ */
|
|
5462
|
+
return /* @__PURE__ */ jsxs27("div", { className: (0, import_classnames27.default)(classBase15, className), ...htmlAttributes, tabIndex: 0, children: [
|
|
5463
|
+
/* @__PURE__ */ jsx58(
|
|
4601
5464
|
ExpandoCombobox,
|
|
4602
5465
|
{
|
|
5466
|
+
title: "column",
|
|
4603
5467
|
InputProps,
|
|
4604
|
-
className: (0,
|
|
5468
|
+
className: (0, import_classnames27.default)(`${classBase15}Field`, `${classBase15}Column`),
|
|
4605
5469
|
initialHighlightedIndex: 0,
|
|
4606
5470
|
itemToString: (column) => column.name,
|
|
4607
5471
|
ref: columnRef,
|
|
4608
5472
|
source: columns,
|
|
4609
5473
|
onSelectionChange: onSelectionChangeColumn,
|
|
4610
|
-
value: (
|
|
5474
|
+
value: (_a2 = selectedColumn == null ? void 0 : selectedColumn.name) != null ? _a2 : ""
|
|
4611
5475
|
}
|
|
4612
5476
|
),
|
|
4613
|
-
(selectedColumn == null ? void 0 : selectedColumn.name) ? /* @__PURE__ */
|
|
5477
|
+
(selectedColumn == null ? void 0 : selectedColumn.name) ? /* @__PURE__ */ jsx58(
|
|
4614
5478
|
ExpandoCombobox,
|
|
4615
5479
|
{
|
|
5480
|
+
title: "operator",
|
|
4616
5481
|
InputProps,
|
|
4617
|
-
className: (0,
|
|
4618
|
-
[`${
|
|
5482
|
+
className: (0, import_classnames27.default)(`${classBase15}Field`, `${classBase15}Operator`, {
|
|
5483
|
+
[`${classBase15}Operator-hidden`]: selectedColumn === null
|
|
4619
5484
|
}),
|
|
4620
5485
|
initialHighlightedIndex: 0,
|
|
4621
5486
|
ref: operatorRef,
|
|
@@ -4625,20 +5490,20 @@ var FilterClauseEditor = ({
|
|
|
4625
5490
|
}
|
|
4626
5491
|
) : null,
|
|
4627
5492
|
getInputElement(),
|
|
4628
|
-
value !== void 0 ? /* @__PURE__ */
|
|
5493
|
+
value !== void 0 ? /* @__PURE__ */ jsx58(CloseButton, { className: `${classBase15}-closeButton`, onClick: onClose }) : null
|
|
4629
5494
|
] });
|
|
4630
5495
|
};
|
|
4631
5496
|
|
|
4632
5497
|
// src/filter-pill/FilterPill.tsx
|
|
4633
|
-
var
|
|
5498
|
+
var import_classnames29 = __toESM(require_classnames(), 1);
|
|
4634
5499
|
import { EditableLabel as EditableLabel2 } from "@vuu-ui/vuu-ui-controls";
|
|
4635
5500
|
import { filterAsQuery, isMultiClauseFilter as isMultiClauseFilter2 } from "@vuu-ui/vuu-utils";
|
|
4636
|
-
import { useCallback as
|
|
5501
|
+
import { useCallback as useCallback40, useRef as useRef26 } from "react";
|
|
4637
5502
|
|
|
4638
5503
|
// src/filter-pill-menu/FilterPillMenu.tsx
|
|
4639
|
-
var
|
|
5504
|
+
var import_classnames28 = __toESM(require_classnames(), 1);
|
|
4640
5505
|
import { PopupMenu as PopupMenu2 } from "@vuu-ui/vuu-popups";
|
|
4641
|
-
import { useMemo as
|
|
5506
|
+
import { useMemo as useMemo17 } from "react";
|
|
4642
5507
|
|
|
4643
5508
|
// src/filter-pill-menu/FilterPillMenuOptions.ts
|
|
4644
5509
|
var closeCommand = (options) => ({
|
|
@@ -4667,8 +5532,8 @@ var editCommand = (options) => ({
|
|
|
4667
5532
|
});
|
|
4668
5533
|
|
|
4669
5534
|
// src/filter-pill-menu/FilterPillMenu.tsx
|
|
4670
|
-
import { jsx as
|
|
4671
|
-
var
|
|
5535
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
5536
|
+
var classBase16 = "vuuFilterPillMenu";
|
|
4672
5537
|
var FilterPillMenu = ({
|
|
4673
5538
|
allowClose = true,
|
|
4674
5539
|
allowDelete = true,
|
|
@@ -4679,7 +5544,7 @@ var FilterPillMenu = ({
|
|
|
4679
5544
|
onMenuAction,
|
|
4680
5545
|
onMenuClose
|
|
4681
5546
|
}) => {
|
|
4682
|
-
const [menuBuilder, menuOptions] =
|
|
5547
|
+
const [menuBuilder, menuOptions] = useMemo17(
|
|
4683
5548
|
() => [
|
|
4684
5549
|
(_location, options) => {
|
|
4685
5550
|
const menuItems = [];
|
|
@@ -4703,13 +5568,13 @@ var FilterPillMenu = ({
|
|
|
4703
5568
|
],
|
|
4704
5569
|
[allowClose, allowDelete, allowEdit, allowRename, filter]
|
|
4705
5570
|
);
|
|
4706
|
-
return /* @__PURE__ */
|
|
5571
|
+
return /* @__PURE__ */ jsx59(
|
|
4707
5572
|
PopupMenu2,
|
|
4708
5573
|
{
|
|
4709
|
-
className:
|
|
5574
|
+
className: classBase16,
|
|
4710
5575
|
menuBuilder,
|
|
4711
5576
|
menuActionHandler: onMenuAction,
|
|
4712
|
-
menuLocation: (0,
|
|
5577
|
+
menuLocation: (0, import_classnames28.default)("filter", location),
|
|
4713
5578
|
menuOptions,
|
|
4714
5579
|
onMenuClose,
|
|
4715
5580
|
tabIndex: -1
|
|
@@ -4782,7 +5647,7 @@ var replaceClause = (existingFilter, clause) => {
|
|
|
4782
5647
|
}
|
|
4783
5648
|
};
|
|
4784
5649
|
var addFilter = (existingFilter, filter, { combineWith = AND } = DEFAULT_ADD_FILTER_OPTS) => {
|
|
4785
|
-
var
|
|
5650
|
+
var _a2;
|
|
4786
5651
|
if (includesNoValues(filter)) {
|
|
4787
5652
|
if (isMultiClauseFilter(filter)) {
|
|
4788
5653
|
} else {
|
|
@@ -4793,7 +5658,7 @@ var addFilter = (existingFilter, filter, { combineWith = AND } = DEFAULT_ADD_FIL
|
|
|
4793
5658
|
} else if (includesAllValues(filter)) {
|
|
4794
5659
|
if (isMultiClauseFilter(filter)) {
|
|
4795
5660
|
}
|
|
4796
|
-
return removeFilterForColumn(existingFilter, { name: (
|
|
5661
|
+
return removeFilterForColumn(existingFilter, { name: (_a2 = filter.column) != null ? _a2 : "" });
|
|
4797
5662
|
}
|
|
4798
5663
|
if (!existingFilter) {
|
|
4799
5664
|
return filter;
|
|
@@ -5041,8 +5906,8 @@ var getNumericFilter = (column, op, value) => {
|
|
|
5041
5906
|
};
|
|
5042
5907
|
|
|
5043
5908
|
// src/filter-pill/FilterPill.tsx
|
|
5044
|
-
import { jsx as
|
|
5045
|
-
var
|
|
5909
|
+
import { jsx as jsx60, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5910
|
+
var classBase17 = "vuuFilterPill";
|
|
5046
5911
|
var getFilterLabel = (filter) => {
|
|
5047
5912
|
if (filter.name) {
|
|
5048
5913
|
return filter.name;
|
|
@@ -5063,12 +5928,12 @@ var FilterPill = ({
|
|
|
5063
5928
|
showMenu = true,
|
|
5064
5929
|
...htmlAttributes
|
|
5065
5930
|
}) => {
|
|
5066
|
-
const rootRef =
|
|
5067
|
-
const handleEnterEditMode =
|
|
5931
|
+
const rootRef = useRef26(null);
|
|
5932
|
+
const handleEnterEditMode = useCallback40(() => {
|
|
5068
5933
|
onBeginEdit == null ? void 0 : onBeginEdit(filter);
|
|
5069
5934
|
}, [filter, onBeginEdit]);
|
|
5070
5935
|
const label = getFilterLabel(filter);
|
|
5071
|
-
const handleMenuClose =
|
|
5936
|
+
const handleMenuClose = useCallback40((reason) => {
|
|
5072
5937
|
if ((reason == null ? void 0 : reason.type) === "escape") {
|
|
5073
5938
|
requestAnimationFrame(() => {
|
|
5074
5939
|
if (rootRef.current) {
|
|
@@ -5077,15 +5942,15 @@ var FilterPill = ({
|
|
|
5077
5942
|
});
|
|
5078
5943
|
}
|
|
5079
5944
|
}, []);
|
|
5080
|
-
return /* @__PURE__ */
|
|
5945
|
+
return /* @__PURE__ */ jsxs28(
|
|
5081
5946
|
"div",
|
|
5082
5947
|
{
|
|
5083
5948
|
...htmlAttributes,
|
|
5084
|
-
className: (0,
|
|
5949
|
+
className: (0, import_classnames29.default)(classBase17, classNameProp),
|
|
5085
5950
|
"data-text": label,
|
|
5086
5951
|
ref: rootRef,
|
|
5087
5952
|
children: [
|
|
5088
|
-
editable && onExitEditMode ? /* @__PURE__ */
|
|
5953
|
+
editable && onExitEditMode ? /* @__PURE__ */ jsx60(
|
|
5089
5954
|
EditableLabel2,
|
|
5090
5955
|
{
|
|
5091
5956
|
defaultValue: label,
|
|
@@ -5093,8 +5958,8 @@ var FilterPill = ({
|
|
|
5093
5958
|
onExitEditMode
|
|
5094
5959
|
},
|
|
5095
5960
|
label
|
|
5096
|
-
) : /* @__PURE__ */
|
|
5097
|
-
showMenu && onMenuAction ? /* @__PURE__ */
|
|
5961
|
+
) : /* @__PURE__ */ jsx60("span", { className: `${classBase17}-label`, children: label }),
|
|
5962
|
+
showMenu && onMenuAction ? /* @__PURE__ */ jsx60(
|
|
5098
5963
|
FilterPillMenu,
|
|
5099
5964
|
{
|
|
5100
5965
|
filter,
|
|
@@ -5110,27 +5975,28 @@ var FilterPill = ({
|
|
|
5110
5975
|
// src/filter-bar/useFilterBar.ts
|
|
5111
5976
|
import { dispatchMouseEvent as dispatchMouseEvent2, filterAsQuery as filterAsQuery2 } from "@vuu-ui/vuu-utils";
|
|
5112
5977
|
import {
|
|
5113
|
-
useCallback as
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5978
|
+
useCallback as useCallback42,
|
|
5979
|
+
useEffect as useEffect15,
|
|
5980
|
+
useMemo as useMemo18,
|
|
5981
|
+
useRef as useRef27,
|
|
5982
|
+
useState as useState25
|
|
5117
5983
|
} from "react";
|
|
5118
5984
|
|
|
5119
5985
|
// src/filter-bar/useFilters.ts
|
|
5120
|
-
import { useControlled as
|
|
5121
|
-
import { useCallback as
|
|
5986
|
+
import { useControlled as useControlled5 } from "@vuu-ui/vuu-ui-controls";
|
|
5987
|
+
import { useCallback as useCallback41 } from "react";
|
|
5122
5988
|
var useFilters = ({
|
|
5123
5989
|
defaultFilters,
|
|
5124
5990
|
filters: filtersProp,
|
|
5125
5991
|
onFiltersChanged
|
|
5126
5992
|
}) => {
|
|
5127
|
-
const [filters, setFilters] =
|
|
5993
|
+
const [filters, setFilters] = useControlled5({
|
|
5128
5994
|
controlled: filtersProp,
|
|
5129
5995
|
default: defaultFilters != null ? defaultFilters : [],
|
|
5130
5996
|
name: "useFilters",
|
|
5131
5997
|
state: "Filters"
|
|
5132
5998
|
});
|
|
5133
|
-
const handleAddFilter =
|
|
5999
|
+
const handleAddFilter = useCallback41(
|
|
5134
6000
|
(filter) => {
|
|
5135
6001
|
const index = filters.length;
|
|
5136
6002
|
const newFilters = filters.concat(filter);
|
|
@@ -5140,7 +6006,7 @@ var useFilters = ({
|
|
|
5140
6006
|
},
|
|
5141
6007
|
[filters, onFiltersChanged, setFilters]
|
|
5142
6008
|
);
|
|
5143
|
-
const handleDeleteFilter =
|
|
6009
|
+
const handleDeleteFilter = useCallback41(
|
|
5144
6010
|
(filter) => {
|
|
5145
6011
|
let index = -1;
|
|
5146
6012
|
const newFilters = filters.filter((f, i) => {
|
|
@@ -5157,7 +6023,7 @@ var useFilters = ({
|
|
|
5157
6023
|
},
|
|
5158
6024
|
[filters, onFiltersChanged, setFilters]
|
|
5159
6025
|
);
|
|
5160
|
-
const handleRenameFilter =
|
|
6026
|
+
const handleRenameFilter = useCallback41(
|
|
5161
6027
|
(filter, name) => {
|
|
5162
6028
|
let index = -1;
|
|
5163
6029
|
const newFilters = filters.map((f, i) => {
|
|
@@ -5174,7 +6040,7 @@ var useFilters = ({
|
|
|
5174
6040
|
},
|
|
5175
6041
|
[filters, onFiltersChanged, setFilters]
|
|
5176
6042
|
);
|
|
5177
|
-
const handleChangeFilter =
|
|
6043
|
+
const handleChangeFilter = useCallback41(
|
|
5178
6044
|
(filter) => {
|
|
5179
6045
|
let index = -1;
|
|
5180
6046
|
const newFilters = filters.map((f, i) => {
|
|
@@ -5206,16 +6072,15 @@ var useFilterBar = ({
|
|
|
5206
6072
|
activeFilterIndex: activeFilterIdexProp = [],
|
|
5207
6073
|
containerRef,
|
|
5208
6074
|
filters: filtersProp,
|
|
5209
|
-
onActiveChange,
|
|
5210
6075
|
onApplyFilter,
|
|
5211
6076
|
onFiltersChanged,
|
|
5212
6077
|
showMenu: showMenuProp
|
|
5213
6078
|
}) => {
|
|
5214
|
-
const editingFilter =
|
|
5215
|
-
const [activeFilterIndex, setActiveFilterIndex] =
|
|
5216
|
-
const [showMenu, setShowMenu] =
|
|
5217
|
-
const [editFilter, setEditFilter] =
|
|
5218
|
-
const [promptProps, setPromptProps] =
|
|
6079
|
+
const editingFilter = useRef27();
|
|
6080
|
+
const [activeFilterIndex, setActiveFilterIndex] = useState25(activeFilterIdexProp);
|
|
6081
|
+
const [showMenu, setShowMenu] = useState25(showMenuProp);
|
|
6082
|
+
const [editFilter, setEditFilter] = useState25();
|
|
6083
|
+
const [promptProps, setPromptProps] = useState25(null);
|
|
5219
6084
|
const {
|
|
5220
6085
|
filters,
|
|
5221
6086
|
onAddFilter,
|
|
@@ -5226,11 +6091,11 @@ var useFilterBar = ({
|
|
|
5226
6091
|
filters: filtersProp,
|
|
5227
6092
|
onFiltersChanged
|
|
5228
6093
|
});
|
|
5229
|
-
const editPillLabel =
|
|
6094
|
+
const editPillLabel = useCallback42(
|
|
5230
6095
|
(index) => {
|
|
5231
6096
|
requestAnimationFrame(() => {
|
|
5232
|
-
var
|
|
5233
|
-
const pills = (
|
|
6097
|
+
var _a2;
|
|
6098
|
+
const pills = (_a2 = containerRef.current) == null ? void 0 : _a2.querySelectorAll(
|
|
5234
6099
|
".vuuFilterPill"
|
|
5235
6100
|
);
|
|
5236
6101
|
if (pills == null ? void 0 : pills[index]) {
|
|
@@ -5245,11 +6110,11 @@ var useFilterBar = ({
|
|
|
5245
6110
|
},
|
|
5246
6111
|
[containerRef]
|
|
5247
6112
|
);
|
|
5248
|
-
const focusFilterClause =
|
|
6113
|
+
const focusFilterClause = useCallback42(
|
|
5249
6114
|
(index = 0) => {
|
|
5250
6115
|
requestAnimationFrame(() => {
|
|
5251
|
-
var
|
|
5252
|
-
const input = (
|
|
6116
|
+
var _a2;
|
|
6117
|
+
const input = (_a2 = containerRef.current) == null ? void 0 : _a2.querySelector(
|
|
5253
6118
|
".vuuFilterClause .saltInput-input"
|
|
5254
6119
|
);
|
|
5255
6120
|
if (input) {
|
|
@@ -5259,11 +6124,11 @@ var useFilterBar = ({
|
|
|
5259
6124
|
},
|
|
5260
6125
|
[containerRef]
|
|
5261
6126
|
);
|
|
5262
|
-
const focusFilterPill =
|
|
6127
|
+
const focusFilterPill = useCallback42(
|
|
5263
6128
|
(index) => {
|
|
5264
6129
|
requestAnimationFrame(() => {
|
|
5265
|
-
var
|
|
5266
|
-
const target = typeof index === "number" ? (
|
|
6130
|
+
var _a2, _b;
|
|
6131
|
+
const target = typeof index === "number" ? (_a2 = containerRef.current) == null ? void 0 : _a2.querySelector(
|
|
5267
6132
|
`.vuuOverflowContainer-item[data-index="${index}"] .vuuFilterPill`
|
|
5268
6133
|
) : (_b = containerRef.current) == null ? void 0 : _b.querySelector(
|
|
5269
6134
|
".vuuFilterPill[tabindex]"
|
|
@@ -5275,7 +6140,7 @@ var useFilterBar = ({
|
|
|
5275
6140
|
},
|
|
5276
6141
|
[containerRef]
|
|
5277
6142
|
);
|
|
5278
|
-
const applyFilter =
|
|
6143
|
+
const applyFilter = useCallback42(
|
|
5279
6144
|
(filter) => {
|
|
5280
6145
|
const filterQuery = filter ? filterAsQuery2(filter) : "";
|
|
5281
6146
|
onApplyFilter({
|
|
@@ -5285,30 +6150,7 @@ var useFilterBar = ({
|
|
|
5285
6150
|
},
|
|
5286
6151
|
[onApplyFilter]
|
|
5287
6152
|
);
|
|
5288
|
-
const
|
|
5289
|
-
(activeIndices) => {
|
|
5290
|
-
if (activeIndices.length > 0) {
|
|
5291
|
-
const activeFilters = activeIndices.map(
|
|
5292
|
-
(index) => filters[index]
|
|
5293
|
-
);
|
|
5294
|
-
if (activeFilters.length === 1) {
|
|
5295
|
-
const [filter] = activeFilters;
|
|
5296
|
-
applyFilter(filter);
|
|
5297
|
-
} else {
|
|
5298
|
-
applyFilter({
|
|
5299
|
-
op: "and",
|
|
5300
|
-
filters: activeFilters
|
|
5301
|
-
});
|
|
5302
|
-
}
|
|
5303
|
-
} else {
|
|
5304
|
-
applyFilter();
|
|
5305
|
-
}
|
|
5306
|
-
setActiveFilterIndex(activeIndices);
|
|
5307
|
-
onActiveChange == null ? void 0 : onActiveChange(activeIndices);
|
|
5308
|
-
},
|
|
5309
|
-
[applyFilter, filters, onActiveChange]
|
|
5310
|
-
);
|
|
5311
|
-
const deleteConfirmed = useCallback31(
|
|
6153
|
+
const deleteConfirmed = useCallback42(
|
|
5312
6154
|
(filter) => {
|
|
5313
6155
|
const indexOfFilter = filters.indexOf(filter);
|
|
5314
6156
|
if (activeFilterIndex.includes(indexOfFilter)) {
|
|
@@ -5318,8 +6160,8 @@ var useFilterBar = ({
|
|
|
5318
6160
|
}
|
|
5319
6161
|
const indexOfDeletedFilter = onDeleteFilter == null ? void 0 : onDeleteFilter(filter);
|
|
5320
6162
|
if (activeFilterIndex.includes(indexOfDeletedFilter)) {
|
|
5321
|
-
|
|
5322
|
-
|
|
6163
|
+
setActiveFilterIndex(
|
|
6164
|
+
(indices) => indices.filter((i) => i !== indexOfDeletedFilter)
|
|
5323
6165
|
);
|
|
5324
6166
|
}
|
|
5325
6167
|
requestAnimationFrame(() => {
|
|
@@ -5328,15 +6170,9 @@ var useFilterBar = ({
|
|
|
5328
6170
|
}
|
|
5329
6171
|
});
|
|
5330
6172
|
},
|
|
5331
|
-
[
|
|
5332
|
-
activeFilterIndex,
|
|
5333
|
-
filters,
|
|
5334
|
-
focusFilterPill,
|
|
5335
|
-
handleFilterActivation,
|
|
5336
|
-
onDeleteFilter
|
|
5337
|
-
]
|
|
6173
|
+
[activeFilterIndex, filters, focusFilterPill, onDeleteFilter]
|
|
5338
6174
|
);
|
|
5339
|
-
const getDeletePrompt =
|
|
6175
|
+
const getDeletePrompt = useMemo18(
|
|
5340
6176
|
() => (filter) => {
|
|
5341
6177
|
const close = () => {
|
|
5342
6178
|
setPromptProps(null);
|
|
@@ -5358,7 +6194,7 @@ var useFilterBar = ({
|
|
|
5358
6194
|
},
|
|
5359
6195
|
[deleteConfirmed, focusFilterPill]
|
|
5360
6196
|
);
|
|
5361
|
-
const deleteFilter =
|
|
6197
|
+
const deleteFilter = useCallback42(
|
|
5362
6198
|
(filter, withPrompt) => {
|
|
5363
6199
|
if (withPrompt) {
|
|
5364
6200
|
setPromptProps(getDeletePrompt(filter));
|
|
@@ -5368,10 +6204,10 @@ var useFilterBar = ({
|
|
|
5368
6204
|
},
|
|
5369
6205
|
[deleteConfirmed, getDeletePrompt]
|
|
5370
6206
|
);
|
|
5371
|
-
const handleBeginEditFilterName =
|
|
6207
|
+
const handleBeginEditFilterName = useCallback42((filter) => {
|
|
5372
6208
|
editingFilter.current = filter;
|
|
5373
6209
|
}, []);
|
|
5374
|
-
const handleExitEditFilterName =
|
|
6210
|
+
const handleExitEditFilterName = useCallback42(
|
|
5375
6211
|
(_, editedValue = "") => {
|
|
5376
6212
|
if (editingFilter.current) {
|
|
5377
6213
|
const indexOfEditedFilter = onRenameFilter(
|
|
@@ -5384,7 +6220,7 @@ var useFilterBar = ({
|
|
|
5384
6220
|
},
|
|
5385
6221
|
[focusFilterPill, onRenameFilter]
|
|
5386
6222
|
);
|
|
5387
|
-
const handlePillMenuAction =
|
|
6223
|
+
const handlePillMenuAction = useCallback42(
|
|
5388
6224
|
({ menuId, options }) => {
|
|
5389
6225
|
switch (menuId) {
|
|
5390
6226
|
case "delete-filter": {
|
|
@@ -5411,7 +6247,7 @@ var useFilterBar = ({
|
|
|
5411
6247
|
},
|
|
5412
6248
|
[deleteFilter, editPillLabel, filters, focusFilterClause]
|
|
5413
6249
|
);
|
|
5414
|
-
const handleMenuAction =
|
|
6250
|
+
const handleMenuAction = useCallback42(
|
|
5415
6251
|
({ menuId }) => {
|
|
5416
6252
|
switch (menuId) {
|
|
5417
6253
|
case "apply-save": {
|
|
@@ -5423,11 +6259,10 @@ var useFilterBar = ({
|
|
|
5423
6259
|
editPillLabel(indexOfNewFilter);
|
|
5424
6260
|
}
|
|
5425
6261
|
setEditFilter(void 0);
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
6262
|
+
setActiveFilterIndex(
|
|
6263
|
+
(indices) => indices.includes(indexOfNewFilter) ? indices : indices.concat(indexOfNewFilter)
|
|
6264
|
+
);
|
|
5429
6265
|
setShowMenu(false);
|
|
5430
|
-
applyFilter(newFilter);
|
|
5431
6266
|
return true;
|
|
5432
6267
|
}
|
|
5433
6268
|
case "and-clause":
|
|
@@ -5446,20 +6281,36 @@ var useFilterBar = ({
|
|
|
5446
6281
|
return false;
|
|
5447
6282
|
}
|
|
5448
6283
|
},
|
|
5449
|
-
[
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
6284
|
+
[editFilter, editPillLabel, onAddFilter, onChangeFilter]
|
|
6285
|
+
);
|
|
6286
|
+
useEffect15(() => {
|
|
6287
|
+
if (activeFilterIndex.length > 0) {
|
|
6288
|
+
const activeFilters = activeFilterIndex.map(
|
|
6289
|
+
(index) => filters[index]
|
|
6290
|
+
);
|
|
6291
|
+
if (activeFilters.length === 1) {
|
|
6292
|
+
const [filter] = activeFilters;
|
|
6293
|
+
applyFilter(filter);
|
|
6294
|
+
} else {
|
|
6295
|
+
applyFilter({
|
|
6296
|
+
op: "and",
|
|
6297
|
+
filters: activeFilters
|
|
6298
|
+
});
|
|
6299
|
+
}
|
|
6300
|
+
} else {
|
|
6301
|
+
applyFilter();
|
|
6302
|
+
}
|
|
6303
|
+
}, [activeFilterIndex, applyFilter, filters]);
|
|
6304
|
+
const handleChangeActiveFilterIndex = useCallback42(
|
|
6305
|
+
(itemIndex) => {
|
|
6306
|
+
setActiveFilterIndex(itemIndex);
|
|
6307
|
+
},
|
|
6308
|
+
[]
|
|
5458
6309
|
);
|
|
5459
|
-
const handleClickAddFilter =
|
|
6310
|
+
const handleClickAddFilter = useCallback42(() => {
|
|
5460
6311
|
setEditFilter({});
|
|
5461
6312
|
}, []);
|
|
5462
|
-
const handleClickRemoveFilter =
|
|
6313
|
+
const handleClickRemoveFilter = useCallback42(() => {
|
|
5463
6314
|
setEditFilter(void 0);
|
|
5464
6315
|
}, []);
|
|
5465
6316
|
const pillProps = {
|
|
@@ -5468,12 +6319,13 @@ var useFilterBar = ({
|
|
|
5468
6319
|
onExitEditMode: handleExitEditFilterName
|
|
5469
6320
|
};
|
|
5470
6321
|
const handleChangeFilterClause = (filterClause) => {
|
|
6322
|
+
console.log({ filterClause });
|
|
5471
6323
|
if (filterClause !== void 0) {
|
|
5472
6324
|
setEditFilter((filter) => replaceClause(filter, filterClause));
|
|
5473
6325
|
setShowMenu(true);
|
|
5474
6326
|
}
|
|
5475
6327
|
};
|
|
5476
|
-
const onKeyDown =
|
|
6328
|
+
const onKeyDown = useCallback42(
|
|
5477
6329
|
(evt) => {
|
|
5478
6330
|
if (evt.key === "Escape" && editFilter !== void 0) {
|
|
5479
6331
|
setEditFilter(void 0);
|
|
@@ -5487,10 +6339,10 @@ var useFilterBar = ({
|
|
|
5487
6339
|
activeFilterIndex,
|
|
5488
6340
|
editFilter,
|
|
5489
6341
|
filters,
|
|
6342
|
+
onChangeActiveFilterIndex: handleChangeActiveFilterIndex,
|
|
5490
6343
|
onClickAddFilter: handleClickAddFilter,
|
|
5491
6344
|
onClickRemoveFilter: handleClickRemoveFilter,
|
|
5492
6345
|
onChangeFilterClause: handleChangeFilterClause,
|
|
5493
|
-
onFilterActivation: handleFilterActivation,
|
|
5494
6346
|
onKeyDown,
|
|
5495
6347
|
onMenuAction: handleMenuAction,
|
|
5496
6348
|
pillProps,
|
|
@@ -5500,22 +6352,21 @@ var useFilterBar = ({
|
|
|
5500
6352
|
};
|
|
5501
6353
|
|
|
5502
6354
|
// src/filter-bar/FilterBar.tsx
|
|
5503
|
-
import { jsx as
|
|
6355
|
+
import { jsx as jsx61, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5504
6356
|
import { createElement } from "react";
|
|
5505
|
-
var
|
|
6357
|
+
var classBase18 = "vuuFilterBar";
|
|
5506
6358
|
var FilterBar = ({
|
|
5507
|
-
activeFilterIndex: activeFilterIndexProp,
|
|
6359
|
+
activeFilterIndex: activeFilterIndexProp = [],
|
|
5508
6360
|
FilterClauseEditorProps: FilterClauseEditorProps2,
|
|
5509
6361
|
className: classNameProp,
|
|
5510
6362
|
filters: filtersProp,
|
|
5511
|
-
onActiveChange,
|
|
5512
6363
|
onApplyFilter,
|
|
5513
6364
|
onFiltersChanged,
|
|
5514
6365
|
showMenu: showMenuProp = false,
|
|
5515
6366
|
tableSchema,
|
|
5516
6367
|
...htmlAttributes
|
|
5517
6368
|
}) => {
|
|
5518
|
-
const rootRef =
|
|
6369
|
+
const rootRef = useRef28(null);
|
|
5519
6370
|
const {
|
|
5520
6371
|
activeFilterIndex,
|
|
5521
6372
|
editFilter,
|
|
@@ -5523,7 +6374,7 @@ var FilterBar = ({
|
|
|
5523
6374
|
onClickAddFilter,
|
|
5524
6375
|
onClickRemoveFilter,
|
|
5525
6376
|
onChangeFilterClause,
|
|
5526
|
-
|
|
6377
|
+
onChangeActiveFilterIndex,
|
|
5527
6378
|
onKeyDown,
|
|
5528
6379
|
onMenuAction,
|
|
5529
6380
|
pillProps,
|
|
@@ -5533,14 +6384,13 @@ var FilterBar = ({
|
|
|
5533
6384
|
activeFilterIndex: activeFilterIndexProp,
|
|
5534
6385
|
containerRef: rootRef,
|
|
5535
6386
|
filters: filtersProp,
|
|
5536
|
-
onActiveChange,
|
|
5537
6387
|
onApplyFilter,
|
|
5538
6388
|
onFiltersChanged,
|
|
5539
6389
|
showMenu: showMenuProp
|
|
5540
6390
|
});
|
|
5541
|
-
const className = (0,
|
|
5542
|
-
[`${
|
|
5543
|
-
[`${
|
|
6391
|
+
const className = (0, import_classnames30.default)(classBase18, classNameProp, {
|
|
6392
|
+
[`${classBase18}-display`]: editFilter === void 0,
|
|
6393
|
+
[`${classBase18}-edit`]: editFilter !== void 0
|
|
5544
6394
|
});
|
|
5545
6395
|
const onClose = () => console.log("Closing filter component");
|
|
5546
6396
|
const getChildren2 = () => {
|
|
@@ -5551,19 +6401,6 @@ var FilterBar = ({
|
|
|
5551
6401
|
/* @__PURE__ */ createElement(FilterPill, { ...pillProps, filter, key: `filter-${i}` })
|
|
5552
6402
|
);
|
|
5553
6403
|
});
|
|
5554
|
-
items.push(
|
|
5555
|
-
/* @__PURE__ */ jsx33(
|
|
5556
|
-
Button4,
|
|
5557
|
-
{
|
|
5558
|
-
className: `${classBase17}-add`,
|
|
5559
|
-
"data-icon": "plus",
|
|
5560
|
-
"data-selectable": false,
|
|
5561
|
-
onClick: onClickAddFilter,
|
|
5562
|
-
variant: "primary"
|
|
5563
|
-
},
|
|
5564
|
-
"filter-add"
|
|
5565
|
-
)
|
|
5566
|
-
);
|
|
5567
6404
|
return items;
|
|
5568
6405
|
} else if (editFilter) {
|
|
5569
6406
|
const filterClauses2 = filterClauses(editFilter);
|
|
@@ -5584,14 +6421,14 @@ var FilterBar = ({
|
|
|
5584
6421
|
});
|
|
5585
6422
|
if (showMenu) {
|
|
5586
6423
|
items.push(
|
|
5587
|
-
/* @__PURE__ */
|
|
6424
|
+
/* @__PURE__ */ jsx61(FilterBuilderMenu, { onMenuAction }, "menu")
|
|
5588
6425
|
);
|
|
5589
6426
|
}
|
|
5590
6427
|
items.push(
|
|
5591
|
-
/* @__PURE__ */
|
|
5592
|
-
|
|
6428
|
+
/* @__PURE__ */ jsx61(
|
|
6429
|
+
Button10,
|
|
5593
6430
|
{
|
|
5594
|
-
className: `${
|
|
6431
|
+
className: `${classBase18}-remove`,
|
|
5595
6432
|
"data-align": "right",
|
|
5596
6433
|
"data-icon": "cross",
|
|
5597
6434
|
onClick: onClickRemoveFilter,
|
|
@@ -5603,7 +6440,7 @@ var FilterBar = ({
|
|
|
5603
6440
|
return items;
|
|
5604
6441
|
}
|
|
5605
6442
|
};
|
|
5606
|
-
return /* @__PURE__ */
|
|
6443
|
+
return /* @__PURE__ */ jsxs29(
|
|
5607
6444
|
"div",
|
|
5608
6445
|
{
|
|
5609
6446
|
...htmlAttributes,
|
|
@@ -5611,18 +6448,30 @@ var FilterBar = ({
|
|
|
5611
6448
|
onKeyDown,
|
|
5612
6449
|
ref: rootRef,
|
|
5613
6450
|
children: [
|
|
5614
|
-
/* @__PURE__ */
|
|
5615
|
-
/* @__PURE__ */
|
|
6451
|
+
/* @__PURE__ */ jsx61("span", { className: `${classBase18}-icon`, "data-icon": "tune" }),
|
|
6452
|
+
/* @__PURE__ */ jsx61(
|
|
5616
6453
|
Toolbar,
|
|
5617
6454
|
{
|
|
5618
6455
|
activeItemIndex: activeFilterIndex,
|
|
5619
6456
|
height: 26,
|
|
5620
|
-
onActiveChange:
|
|
6457
|
+
onActiveChange: onChangeActiveFilterIndex,
|
|
5621
6458
|
selectionStrategy: "multiple-special-key",
|
|
5622
6459
|
children: getChildren2()
|
|
5623
6460
|
}
|
|
5624
6461
|
),
|
|
5625
|
-
|
|
6462
|
+
editFilter === void 0 ? /* @__PURE__ */ jsx61(
|
|
6463
|
+
Button10,
|
|
6464
|
+
{
|
|
6465
|
+
className: `${classBase18}-add`,
|
|
6466
|
+
"data-icon": "plus",
|
|
6467
|
+
"data-selectable": false,
|
|
6468
|
+
onClick: onClickAddFilter,
|
|
6469
|
+
tabIndex: 0,
|
|
6470
|
+
variant: "primary"
|
|
6471
|
+
},
|
|
6472
|
+
"filter-add"
|
|
6473
|
+
) : null,
|
|
6474
|
+
promptProps ? /* @__PURE__ */ jsx61(
|
|
5626
6475
|
Prompt,
|
|
5627
6476
|
{
|
|
5628
6477
|
...promptProps,
|
|
@@ -5639,7 +6488,7 @@ var FilterBar = ({
|
|
|
5639
6488
|
};
|
|
5640
6489
|
|
|
5641
6490
|
// src/filter-input/FilterInput.tsx
|
|
5642
|
-
import { Button as
|
|
6491
|
+
import { Button as Button11 } from "@salt-ds/core";
|
|
5643
6492
|
|
|
5644
6493
|
// src/filter-input/useCodeMirrorEditor.ts
|
|
5645
6494
|
import {
|
|
@@ -6069,7 +6918,7 @@ function enterUnfinishedNodesBefore(node, pos) {
|
|
|
6069
6918
|
return node;
|
|
6070
6919
|
}
|
|
6071
6920
|
function resolveNode(node, pos, side, overlays) {
|
|
6072
|
-
var
|
|
6921
|
+
var _a2;
|
|
6073
6922
|
while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) {
|
|
6074
6923
|
let parent = !overlays && node instanceof TreeNode && node.index < 0 ? null : node.parent;
|
|
6075
6924
|
if (!parent)
|
|
@@ -6079,7 +6928,7 @@ function resolveNode(node, pos, side, overlays) {
|
|
|
6079
6928
|
let mode = overlays ? 0 : IterMode.IgnoreOverlays;
|
|
6080
6929
|
if (overlays)
|
|
6081
6930
|
for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) {
|
|
6082
|
-
if (scan instanceof TreeNode && scan.index < 0 && ((
|
|
6931
|
+
if (scan instanceof TreeNode && scan.index < 0 && ((_a2 = parent.enter(pos, side, mode)) === null || _a2 === void 0 ? void 0 : _a2.from) != scan.from)
|
|
6083
6932
|
node = parent;
|
|
6084
6933
|
}
|
|
6085
6934
|
for (; ; ) {
|
|
@@ -6229,8 +7078,8 @@ var TreeNode = class {
|
|
|
6229
7078
|
return enterUnfinishedNodesBefore(this, pos);
|
|
6230
7079
|
}
|
|
6231
7080
|
getChild(type, before = null, after = null) {
|
|
6232
|
-
let
|
|
6233
|
-
return
|
|
7081
|
+
let r2 = getChildren(this, type, before, after);
|
|
7082
|
+
return r2.length ? r2[0] : null;
|
|
6234
7083
|
}
|
|
6235
7084
|
getChildren(type, before = null, after = null) {
|
|
6236
7085
|
return getChildren(this, type, before, after);
|
|
@@ -6408,8 +7257,8 @@ var BufferNode = class {
|
|
|
6408
7257
|
return this.context.buffer.childString(this.index);
|
|
6409
7258
|
}
|
|
6410
7259
|
getChild(type, before = null, after = null) {
|
|
6411
|
-
let
|
|
6412
|
-
return
|
|
7260
|
+
let r2 = getChildren(this, type, before, after);
|
|
7261
|
+
return r2.length ? r2[0] : null;
|
|
6413
7262
|
}
|
|
6414
7263
|
getChildren(type, before = null, after = null) {
|
|
6415
7264
|
return getChildren(this, type, before, after);
|
|
@@ -6723,7 +7572,7 @@ function hasChild(tree) {
|
|
|
6723
7572
|
return tree.children.some((ch) => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch));
|
|
6724
7573
|
}
|
|
6725
7574
|
function buildTree(data) {
|
|
6726
|
-
var
|
|
7575
|
+
var _a2;
|
|
6727
7576
|
let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data;
|
|
6728
7577
|
let cursor = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer;
|
|
6729
7578
|
let types = nodeSet.types;
|
|
@@ -6889,7 +7738,7 @@ function buildTree(data) {
|
|
|
6889
7738
|
let children = [], positions = [];
|
|
6890
7739
|
while (cursor.pos > 0)
|
|
6891
7740
|
takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1);
|
|
6892
|
-
let length = (
|
|
7741
|
+
let length = (_a2 = data.length) !== null && _a2 !== void 0 ? _a2 : children.length ? positions[0] + children[0].length : 0;
|
|
6893
7742
|
return new Tree2(types[data.topID], children.reverse(), positions.reverse(), length);
|
|
6894
7743
|
}
|
|
6895
7744
|
var nodeSizeCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -6958,7 +7807,7 @@ var Parser = class {
|
|
|
6958
7807
|
startParse(input, fragments, ranges) {
|
|
6959
7808
|
if (typeof input == "string")
|
|
6960
7809
|
input = new StringInput(input);
|
|
6961
|
-
ranges = !ranges ? [new Range(0, input.length)] : ranges.length ? ranges.map((
|
|
7810
|
+
ranges = !ranges ? [new Range(0, input.length)] : ranges.length ? ranges.map((r2) => new Range(r2.from, r2.to)) : [new Range(0, 0)];
|
|
6962
7811
|
return this.createParse(input, fragments || [], ranges);
|
|
6963
7812
|
}
|
|
6964
7813
|
/// Run a full parse, returning the resulting tree.
|
|
@@ -7013,8 +7862,8 @@ var Stack3 = class {
|
|
|
7013
7862
|
// Start an empty stack
|
|
7014
7863
|
/// @internal
|
|
7015
7864
|
static start(p, state, pos = 0) {
|
|
7016
|
-
let
|
|
7017
|
-
return new Stack3(p, [], state, pos, pos, 0, [], 0,
|
|
7865
|
+
let cx31 = p.parser.context;
|
|
7866
|
+
return new Stack3(p, [], state, pos, pos, 0, [], 0, cx31 ? new StackContext(cx31, cx31.start) : null, 0, null);
|
|
7018
7867
|
}
|
|
7019
7868
|
/// The stack's current [context](#lr.ContextTracker) value, if
|
|
7020
7869
|
/// any. Its type will depend on the context tracker's type
|
|
@@ -7033,7 +7882,7 @@ var Stack3 = class {
|
|
|
7033
7882
|
// Apply a reduce action
|
|
7034
7883
|
/// @internal
|
|
7035
7884
|
reduce(action) {
|
|
7036
|
-
var
|
|
7885
|
+
var _a2;
|
|
7037
7886
|
let depth = action >> 19, type = action & 65535;
|
|
7038
7887
|
let { parser: parser2 } = this.p;
|
|
7039
7888
|
let dPrec = parser2.dynamicPrecedence(type);
|
|
@@ -7048,7 +7897,7 @@ var Stack3 = class {
|
|
|
7048
7897
|
}
|
|
7049
7898
|
let base = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0);
|
|
7050
7899
|
let start2 = base ? this.stack[base - 2] : this.p.ranges[0].from, size = this.reducePos - start2;
|
|
7051
|
-
if (size >= 2e3 && !((
|
|
7900
|
+
if (size >= 2e3 && !((_a2 = this.p.parser.nodeSet.types[type]) === null || _a2 === void 0 ? void 0 : _a2.isAnonymous)) {
|
|
7052
7901
|
if (start2 == this.p.lastBigReductionStart) {
|
|
7053
7902
|
this.p.bigReductionCount++;
|
|
7054
7903
|
this.p.lastBigReductionSize = size;
|
|
@@ -7707,11 +8556,11 @@ var InputStream = class {
|
|
|
7707
8556
|
if (from >= this.range.from && to <= this.range.to)
|
|
7708
8557
|
return this.input.read(from, to);
|
|
7709
8558
|
let result = "";
|
|
7710
|
-
for (let
|
|
7711
|
-
if (
|
|
8559
|
+
for (let r2 of this.ranges) {
|
|
8560
|
+
if (r2.from >= to)
|
|
7712
8561
|
break;
|
|
7713
|
-
if (
|
|
7714
|
-
result += this.input.read(Math.max(
|
|
8562
|
+
if (r2.to > from)
|
|
8563
|
+
result += this.input.read(Math.max(r2.from, from), Math.min(r2.to, to));
|
|
7715
8564
|
}
|
|
7716
8565
|
return result;
|
|
7717
8566
|
}
|
|
@@ -8342,7 +9191,7 @@ var LRParser = class extends Parser {
|
|
|
8342
9191
|
this.minRepeatTerm = nodeNames.length;
|
|
8343
9192
|
for (let i = 0; i < spec.repeatNodeCount; i++)
|
|
8344
9193
|
nodeNames.push("");
|
|
8345
|
-
let topTerms = Object.keys(spec.topRules).map((
|
|
9194
|
+
let topTerms = Object.keys(spec.topRules).map((r2) => spec.topRules[r2][1]);
|
|
8346
9195
|
let nodeProps = [];
|
|
8347
9196
|
for (let i = 0; i < nodeNames.length; i++)
|
|
8348
9197
|
nodeProps.push([]);
|
|
@@ -8522,13 +9371,13 @@ var LRParser = class extends Parser {
|
|
|
8522
9371
|
}
|
|
8523
9372
|
if (config.tokenizers)
|
|
8524
9373
|
copy.tokenizers = this.tokenizers.map((t) => {
|
|
8525
|
-
let found = config.tokenizers.find((
|
|
9374
|
+
let found = config.tokenizers.find((r2) => r2.from == t);
|
|
8526
9375
|
return found ? found.to : t;
|
|
8527
9376
|
});
|
|
8528
9377
|
if (config.specializers) {
|
|
8529
9378
|
copy.specializers = this.specializers.slice();
|
|
8530
9379
|
copy.specializerSpecs = this.specializerSpecs.map((s, i) => {
|
|
8531
|
-
let found = config.specializers.find((
|
|
9380
|
+
let found = config.specializers.find((r2) => r2.from == s.external);
|
|
8532
9381
|
if (!found)
|
|
8533
9382
|
return s;
|
|
8534
9383
|
let spec = Object.assign(Object.assign({}, s), { external: found.to });
|
|
@@ -8688,14 +9537,14 @@ var FilterExpression = class {
|
|
|
8688
9537
|
}
|
|
8689
9538
|
}
|
|
8690
9539
|
setValue(value, filter = __privateGet(this, _filter)) {
|
|
8691
|
-
var
|
|
9540
|
+
var _a2;
|
|
8692
9541
|
if (isMultiClauseFilter3(filter)) {
|
|
8693
9542
|
const target = filter.filters.at(-1);
|
|
8694
9543
|
if (target) {
|
|
8695
9544
|
this.setValue(value, target);
|
|
8696
9545
|
}
|
|
8697
9546
|
} else if (isMultiValueFilter3(filter)) {
|
|
8698
|
-
(
|
|
9547
|
+
(_a2 = filter.values) != null ? _a2 : filter.values = [];
|
|
8699
9548
|
filter.values.push(value);
|
|
8700
9549
|
} else if (isSingleValueFilter3(filter)) {
|
|
8701
9550
|
filter.value = value;
|
|
@@ -8760,8 +9609,8 @@ var walkTree = (tree, source) => {
|
|
|
8760
9609
|
var strictParser = parser.configure({ strict: true });
|
|
8761
9610
|
|
|
8762
9611
|
// src/filter-input/useCodeMirrorEditor.ts
|
|
8763
|
-
var
|
|
8764
|
-
import { useEffect as
|
|
9612
|
+
var import_classnames31 = __toESM(require_classnames(), 1);
|
|
9613
|
+
import { useEffect as useEffect16, useMemo as useMemo19, useRef as useRef29 } from "react";
|
|
8765
9614
|
|
|
8766
9615
|
// src/filter-input/FilterLanguage.ts
|
|
8767
9616
|
import {
|
|
@@ -8879,7 +9728,7 @@ import {
|
|
|
8879
9728
|
getValue,
|
|
8880
9729
|
syntaxTree
|
|
8881
9730
|
} from "@vuu-ui/vuu-codemirror";
|
|
8882
|
-
import { useCallback as
|
|
9731
|
+
import { useCallback as useCallback43 } from "react";
|
|
8883
9732
|
var getOperator = (node, state) => {
|
|
8884
9733
|
let maybeColumnNode = node.prevSibling || node.parent;
|
|
8885
9734
|
while (maybeColumnNode && !["Column", "Operator", "In"].includes(maybeColumnNode.name)) {
|
|
@@ -8949,7 +9798,7 @@ var getSetValues = (node, state) => {
|
|
|
8949
9798
|
return values;
|
|
8950
9799
|
};
|
|
8951
9800
|
var useAutoComplete = (suggestionProvider, onSubmit, existingFilter) => {
|
|
8952
|
-
const makeSuggestions =
|
|
9801
|
+
const makeSuggestions = useCallback43(
|
|
8953
9802
|
async (context, suggestionType, optionalArgs = {}) => {
|
|
8954
9803
|
const { startsWith = "" } = optionalArgs;
|
|
8955
9804
|
const options = await suggestionProvider.getSuggestions(
|
|
@@ -8960,11 +9809,11 @@ var useAutoComplete = (suggestionProvider, onSubmit, existingFilter) => {
|
|
|
8960
9809
|
},
|
|
8961
9810
|
[suggestionProvider]
|
|
8962
9811
|
);
|
|
8963
|
-
return
|
|
9812
|
+
return useCallback43(
|
|
8964
9813
|
async (context) => {
|
|
8965
|
-
var
|
|
9814
|
+
var _a2, _b;
|
|
8966
9815
|
const { state, pos } = context;
|
|
8967
|
-
const word = (
|
|
9816
|
+
const word = (_a2 = context.matchBefore(/\w*/)) != null ? _a2 : {
|
|
8968
9817
|
from: 0,
|
|
8969
9818
|
to: 0,
|
|
8970
9819
|
text: void 0
|
|
@@ -9126,7 +9975,7 @@ var getView = (ref) => {
|
|
|
9126
9975
|
return ref.current;
|
|
9127
9976
|
};
|
|
9128
9977
|
var getOptionClass = (completion) => {
|
|
9129
|
-
return (0,
|
|
9978
|
+
return (0, import_classnames31.default)("vuuSuggestion", {
|
|
9130
9979
|
vuuIllustration: completion.isIllustration
|
|
9131
9980
|
});
|
|
9132
9981
|
};
|
|
@@ -9144,15 +9993,15 @@ var useCodeMirrorEditor = ({
|
|
|
9144
9993
|
onSubmitFilter,
|
|
9145
9994
|
suggestionProvider
|
|
9146
9995
|
}) => {
|
|
9147
|
-
const editorRef =
|
|
9148
|
-
const onSubmit =
|
|
9149
|
-
const viewRef =
|
|
9996
|
+
const editorRef = useRef29(null);
|
|
9997
|
+
const onSubmit = useRef29(noop);
|
|
9998
|
+
const viewRef = useRef29();
|
|
9150
9999
|
const completionFn = useAutoComplete(
|
|
9151
10000
|
suggestionProvider,
|
|
9152
10001
|
onSubmit,
|
|
9153
10002
|
existingFilter
|
|
9154
10003
|
);
|
|
9155
|
-
const [createState, clearInput] =
|
|
10004
|
+
const [createState, clearInput] = useMemo19(() => {
|
|
9156
10005
|
const parseFilter2 = () => {
|
|
9157
10006
|
const view = getView(viewRef);
|
|
9158
10007
|
const source = view.state.doc.toString();
|
|
@@ -9227,7 +10076,7 @@ var useCodeMirrorEditor = ({
|
|
|
9227
10076
|
};
|
|
9228
10077
|
return [createState2, clearInput2];
|
|
9229
10078
|
}, [completionFn, onSubmitFilter]);
|
|
9230
|
-
|
|
10079
|
+
useEffect16(() => {
|
|
9231
10080
|
if (!editorRef.current) {
|
|
9232
10081
|
throw Error("editor not in dom");
|
|
9233
10082
|
}
|
|
@@ -9236,16 +10085,16 @@ var useCodeMirrorEditor = ({
|
|
|
9236
10085
|
parent: editorRef.current
|
|
9237
10086
|
});
|
|
9238
10087
|
return () => {
|
|
9239
|
-
var
|
|
9240
|
-
(
|
|
10088
|
+
var _a2;
|
|
10089
|
+
(_a2 = viewRef.current) == null ? void 0 : _a2.destroy();
|
|
9241
10090
|
};
|
|
9242
10091
|
}, [completionFn, createState]);
|
|
9243
10092
|
return { editorRef, clearInput };
|
|
9244
10093
|
};
|
|
9245
10094
|
|
|
9246
10095
|
// src/filter-input/FilterInput.tsx
|
|
9247
|
-
import { jsx as
|
|
9248
|
-
var
|
|
10096
|
+
import { jsx as jsx62, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10097
|
+
var classBase19 = "vuuFilterInput";
|
|
9249
10098
|
var FilterInput = ({
|
|
9250
10099
|
existingFilter,
|
|
9251
10100
|
iconName = "filter",
|
|
@@ -9259,20 +10108,20 @@ var FilterInput = ({
|
|
|
9259
10108
|
onSubmitFilter,
|
|
9260
10109
|
suggestionProvider
|
|
9261
10110
|
});
|
|
9262
|
-
return /* @__PURE__ */
|
|
9263
|
-
/* @__PURE__ */
|
|
9264
|
-
|
|
10111
|
+
return /* @__PURE__ */ jsxs30("div", { ...props, className: classBase19, children: [
|
|
10112
|
+
/* @__PURE__ */ jsx62(
|
|
10113
|
+
Button11,
|
|
9265
10114
|
{
|
|
9266
|
-
className: `${
|
|
10115
|
+
className: `${classBase19}-FilterButton`,
|
|
9267
10116
|
"data-icon": iconName,
|
|
9268
10117
|
tabIndex: -1
|
|
9269
10118
|
}
|
|
9270
10119
|
),
|
|
9271
|
-
/* @__PURE__ */
|
|
9272
|
-
/* @__PURE__ */
|
|
9273
|
-
|
|
10120
|
+
/* @__PURE__ */ jsx62("div", { className: `${classBase19}-Editor`, ref: editorRef }),
|
|
10121
|
+
/* @__PURE__ */ jsx62(
|
|
10122
|
+
Button11,
|
|
9274
10123
|
{
|
|
9275
|
-
className: `${
|
|
10124
|
+
className: `${classBase19}-ClearButton`,
|
|
9276
10125
|
"data-icon": "close-circle",
|
|
9277
10126
|
onClick: clearInput
|
|
9278
10127
|
}
|
|
@@ -9293,7 +10142,7 @@ import {
|
|
|
9293
10142
|
getTypeaheadParams,
|
|
9294
10143
|
useTypeaheadSuggestions as useTypeaheadSuggestions2
|
|
9295
10144
|
} from "@vuu-ui/vuu-data-react";
|
|
9296
|
-
import { useCallback as
|
|
10145
|
+
import { useCallback as useCallback44, useRef as useRef30 } from "react";
|
|
9297
10146
|
|
|
9298
10147
|
// src/filter-input/filterInfo.ts
|
|
9299
10148
|
import { createEl } from "@vuu-ui/vuu-utils";
|
|
@@ -9389,9 +10238,9 @@ var useFilterSuggestionProvider = ({
|
|
|
9389
10238
|
table,
|
|
9390
10239
|
typeaheadHook: useTypeahead = useTypeaheadSuggestions2
|
|
9391
10240
|
}) => {
|
|
9392
|
-
const latestSuggestionsRef =
|
|
10241
|
+
const latestSuggestionsRef = useRef30();
|
|
9393
10242
|
const getTypeaheadSuggestions = useTypeahead();
|
|
9394
|
-
const getSuggestions =
|
|
10243
|
+
const getSuggestions = useCallback44(
|
|
9395
10244
|
async (suggestionType, options = NONE) => {
|
|
9396
10245
|
const {
|
|
9397
10246
|
columnName,
|
|
@@ -9481,7 +10330,7 @@ var useFilterSuggestionProvider = ({
|
|
|
9481
10330
|
},
|
|
9482
10331
|
[columns, getTypeaheadSuggestions, namedFilters, saveOptions, table]
|
|
9483
10332
|
);
|
|
9484
|
-
const isPartialMatch =
|
|
10333
|
+
const isPartialMatch = useCallback44(
|
|
9485
10334
|
async (valueType, columnName, pattern) => {
|
|
9486
10335
|
const suggestions = (
|
|
9487
10336
|
// latestSuggestions && latestSuggestions.length > 0
|