@deadragdoll/reactnu 0.1.49 → 0.1.56
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/README.md +2 -0
- package/dist/components/DragDrop/NuDragDropProvider.d.ts +46 -0
- package/dist/components/DragDrop/index.d.ts +1 -0
- package/dist/components/IconGrid/NuIconGrid.d.ts +10 -3
- package/dist/components/ListBox/ListBox.d.ts +11 -2
- package/dist/components/ListBox/internals/ListBoxGroupView.d.ts +4 -1
- package/dist/components/ListBox/internals/ListBoxItemView.d.ts +4 -1
- package/dist/components/MainMenu/MainMenu.types.d.ts +3 -0
- package/dist/components/TreeListView/TreeListView.d.ts +11 -2
- package/dist/components/TreeListView/internals/TreeListViewRow.d.ts +4 -1
- package/dist/components/Window/Window.d.ts +8 -2
- package/dist/components/Window/internals/WindowTitleBar.d.ts +3 -2
- package/dist/index.cjs +1136 -837
- package/dist/index.d.ts +1 -0
- package/dist/index.js +979 -679
- package/dist/styles.css +40 -2
- package/dist/windowing/WindowBar.d.ts +2 -0
- package/dist/windowing/windowing.types.d.ts +10 -0
- package/docs/API_REFERENCE.md +9 -0
- package/docs/COMPONENT_INDEX.md +2 -0
- package/docs/GETTING_STARTED.md +2 -1
- package/docs/IconGrid.md +5 -0
- package/docs/ListBox.md +7 -0
- package/docs/MainMenu.md +1 -0
- package/docs/NuDragDropProvider.md +43 -0
- package/docs/NuThemeProvider.md +1 -1
- package/docs/NuWindowProvider.md +72 -0
- package/docs/TreeListView.md +7 -0
- package/docs/Window.md +19 -0
- package/docs/WindowBar.md +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/Desktop/Desktop.tsx
|
|
2
2
|
import {
|
|
3
3
|
Fragment as Fragment4,
|
|
4
|
-
useContext as
|
|
4
|
+
useContext as useContext8,
|
|
5
5
|
useState as useState10
|
|
6
6
|
} from "react";
|
|
7
7
|
|
|
@@ -375,6 +375,7 @@ function MainMenuList({
|
|
|
375
375
|
) : isChecked ? /* @__PURE__ */ jsx3(NuGlyph, { name: "check-mark" }) : null
|
|
376
376
|
}
|
|
377
377
|
) : null,
|
|
378
|
+
isPopupRow ? /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", className: "nu-main-menu__icon", children: item.icon }) : null,
|
|
378
379
|
/* @__PURE__ */ jsx3("span", { className: "nu-main-menu__label", children: renderItemLabel(item) }),
|
|
379
380
|
isPopupRow ? /* @__PURE__ */ jsx3("span", { className: "nu-main-menu__shortcut", children: resolveItemShortcut(item) }) : null,
|
|
380
381
|
isPopupRow ? /* @__PURE__ */ jsx3("span", { className: "nu-main-menu__submenu-arrow", children: hasChildren ? "\u25B6" : "" }) : null
|
|
@@ -662,10 +663,10 @@ function toggleMenuCheckedInTree(items, id) {
|
|
|
662
663
|
}
|
|
663
664
|
|
|
664
665
|
// src/appHost/NuAppHostProvider.tsx
|
|
665
|
-
import { useMemo as
|
|
666
|
+
import { useMemo as useMemo5, useState as useState6 } from "react";
|
|
666
667
|
|
|
667
668
|
// src/windowing/internals/MdiWindowPickerDialog.tsx
|
|
668
|
-
import { useMemo as
|
|
669
|
+
import { useMemo as useMemo4, useState as useState5 } from "react";
|
|
669
670
|
|
|
670
671
|
// src/components/Button/Button.tsx
|
|
671
672
|
import {
|
|
@@ -826,11 +827,11 @@ function Button({
|
|
|
826
827
|
import {
|
|
827
828
|
forwardRef,
|
|
828
829
|
useCallback as useCallback2,
|
|
829
|
-
useEffect as
|
|
830
|
+
useEffect as useEffect4,
|
|
830
831
|
useId,
|
|
831
832
|
useImperativeHandle,
|
|
832
|
-
useMemo as
|
|
833
|
-
useRef as
|
|
833
|
+
useMemo as useMemo3,
|
|
834
|
+
useRef as useRef4,
|
|
834
835
|
useState as useState4
|
|
835
836
|
} from "react";
|
|
836
837
|
|
|
@@ -902,15 +903,245 @@ function ListBoxCategoryView({ category }) {
|
|
|
902
903
|
// src/components/ListBox/internals/ListBoxItemView.tsx
|
|
903
904
|
import { memo } from "react";
|
|
904
905
|
|
|
905
|
-
// src/components/
|
|
906
|
+
// src/components/DragDrop/NuDragDropProvider.tsx
|
|
907
|
+
import {
|
|
908
|
+
createContext,
|
|
909
|
+
useContext,
|
|
910
|
+
useEffect as useEffect3,
|
|
911
|
+
useMemo as useMemo2,
|
|
912
|
+
useRef as useRef3
|
|
913
|
+
} from "react";
|
|
914
|
+
|
|
915
|
+
// src/components/_shared/themePortal.ts
|
|
916
|
+
function getThemePortalStyle(anchor) {
|
|
917
|
+
if (typeof window === "undefined") {
|
|
918
|
+
return void 0;
|
|
919
|
+
}
|
|
920
|
+
const themeRoot = anchor?.closest(".nu-theme-root");
|
|
921
|
+
if (!themeRoot) {
|
|
922
|
+
return void 0;
|
|
923
|
+
}
|
|
924
|
+
const computed = window.getComputedStyle(themeRoot);
|
|
925
|
+
const style = {
|
|
926
|
+
color: computed.color,
|
|
927
|
+
fontFamily: computed.fontFamily,
|
|
928
|
+
fontSize: computed.fontSize
|
|
929
|
+
};
|
|
930
|
+
for (const propertyName of computed) {
|
|
931
|
+
if (propertyName.startsWith("--nu-")) {
|
|
932
|
+
style[propertyName] = computed.getPropertyValue(propertyName).trim();
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return style;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// src/components/DragDrop/NuDragDropProvider.tsx
|
|
906
939
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
940
|
+
var DRAG_THRESHOLD = 3;
|
|
941
|
+
function createDragPreview(sourceElement) {
|
|
942
|
+
const rect = sourceElement.getBoundingClientRect();
|
|
943
|
+
const preview = sourceElement.cloneNode(true);
|
|
944
|
+
preview.removeAttribute("id");
|
|
945
|
+
preview.setAttribute("aria-hidden", "true");
|
|
946
|
+
Object.assign(preview.style, {
|
|
947
|
+
height: `${rect.height}px`,
|
|
948
|
+
left: `${rect.left}px`,
|
|
949
|
+
margin: "0",
|
|
950
|
+
opacity: "0.85",
|
|
951
|
+
pointerEvents: "none",
|
|
952
|
+
position: "fixed",
|
|
953
|
+
top: `${rect.top}px`,
|
|
954
|
+
width: `${rect.width}px`,
|
|
955
|
+
zIndex: "2147483647"
|
|
956
|
+
});
|
|
957
|
+
const themeStyle = getThemePortalStyle(sourceElement);
|
|
958
|
+
Object.entries(themeStyle ?? {}).forEach(([property, value]) => {
|
|
959
|
+
if (value !== void 0) {
|
|
960
|
+
preview.style.setProperty(property, String(value));
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
document.body.append(preview);
|
|
964
|
+
return preview;
|
|
965
|
+
}
|
|
966
|
+
function createController() {
|
|
967
|
+
const targets = /* @__PURE__ */ new Map();
|
|
968
|
+
let activeDrag = null;
|
|
969
|
+
function findTarget(clientX, clientY) {
|
|
970
|
+
const elementAtPoint = document.elementFromPoint(clientX, clientY);
|
|
971
|
+
let candidate = elementAtPoint;
|
|
972
|
+
while (candidate) {
|
|
973
|
+
const target = targets.get(candidate);
|
|
974
|
+
if (target) {
|
|
975
|
+
return target;
|
|
976
|
+
}
|
|
977
|
+
candidate = candidate.parentElement;
|
|
978
|
+
}
|
|
979
|
+
return Array.from(targets.values()).reverse().find((target) => {
|
|
980
|
+
const rect = target.element.getBoundingClientRect();
|
|
981
|
+
return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
function clearActiveDrag() {
|
|
985
|
+
activeDrag?.preview.remove();
|
|
986
|
+
activeDrag = null;
|
|
987
|
+
}
|
|
988
|
+
return {
|
|
989
|
+
beginDrag(item, sourceElement, sourceType) {
|
|
990
|
+
clearActiveDrag();
|
|
991
|
+
activeDrag = {
|
|
992
|
+
item,
|
|
993
|
+
preview: createDragPreview(sourceElement),
|
|
994
|
+
sourceElement,
|
|
995
|
+
sourceType
|
|
996
|
+
};
|
|
997
|
+
},
|
|
998
|
+
cancelDrag: clearActiveDrag,
|
|
999
|
+
dropAt(clientX, clientY) {
|
|
1000
|
+
const currentDrag = activeDrag;
|
|
1001
|
+
if (!currentDrag) {
|
|
1002
|
+
return false;
|
|
1003
|
+
}
|
|
1004
|
+
const target = findTarget(clientX, clientY);
|
|
1005
|
+
clearActiveDrag();
|
|
1006
|
+
if (!target || target.element === currentDrag.sourceElement) {
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
if (target.accepts?.(currentDrag.item) === false) {
|
|
1010
|
+
return false;
|
|
1011
|
+
}
|
|
1012
|
+
return target.onDrop(currentDrag.item, {
|
|
1013
|
+
clientX,
|
|
1014
|
+
clientY,
|
|
1015
|
+
source: {
|
|
1016
|
+
element: currentDrag.sourceElement,
|
|
1017
|
+
type: currentDrag.sourceType
|
|
1018
|
+
},
|
|
1019
|
+
target: { element: target.element, type: target.type }
|
|
1020
|
+
}) !== false;
|
|
1021
|
+
},
|
|
1022
|
+
moveDrag(clientX, clientY) {
|
|
1023
|
+
const currentDrag = activeDrag;
|
|
1024
|
+
if (!currentDrag) {
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
const rect = currentDrag.sourceElement.getBoundingClientRect();
|
|
1028
|
+
currentDrag.preview.style.left = `${Math.round(clientX - rect.width / 2)}px`;
|
|
1029
|
+
currentDrag.preview.style.top = `${Math.round(clientY - rect.height / 2)}px`;
|
|
1030
|
+
},
|
|
1031
|
+
registerTarget(element, options) {
|
|
1032
|
+
targets.set(element, { ...options, element });
|
|
1033
|
+
return () => targets.delete(element);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
var fallbackController = createController();
|
|
1038
|
+
var NuDragDropContext = createContext(null);
|
|
1039
|
+
function NuDragDropProvider({ children }) {
|
|
1040
|
+
const controller = useMemo2(() => createController(), []);
|
|
1041
|
+
return /* @__PURE__ */ jsx8(NuDragDropContext.Provider, { value: controller, children });
|
|
1042
|
+
}
|
|
1043
|
+
function useNuDragDrop() {
|
|
1044
|
+
return useContext(NuDragDropContext) ?? fallbackController;
|
|
1045
|
+
}
|
|
1046
|
+
function useNuDropTarget(element, options) {
|
|
1047
|
+
const controller = useNuDragDrop();
|
|
1048
|
+
useEffect3(() => {
|
|
1049
|
+
if (!element || !options) {
|
|
1050
|
+
return void 0;
|
|
1051
|
+
}
|
|
1052
|
+
return controller.registerTarget(element, options);
|
|
1053
|
+
}, [controller, element, options]);
|
|
1054
|
+
}
|
|
1055
|
+
function useNuDragSource({
|
|
1056
|
+
disabled = false,
|
|
1057
|
+
getItem,
|
|
1058
|
+
onDropAccepted,
|
|
1059
|
+
sourceType
|
|
1060
|
+
}) {
|
|
1061
|
+
const controller = useNuDragDrop();
|
|
1062
|
+
const stateRef = useRef3({
|
|
1063
|
+
dragging: false,
|
|
1064
|
+
pointerId: -1,
|
|
1065
|
+
sourceElement: null,
|
|
1066
|
+
startX: 0,
|
|
1067
|
+
startY: 0
|
|
1068
|
+
});
|
|
1069
|
+
const state = stateRef.current;
|
|
1070
|
+
function stop(event, shouldDrop) {
|
|
1071
|
+
if (state.pointerId !== event.pointerId) {
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
1075
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
1076
|
+
}
|
|
1077
|
+
state.pointerId = -1;
|
|
1078
|
+
if (state.dragging && shouldDrop && controller.dropAt(event.clientX, event.clientY)) {
|
|
1079
|
+
onDropAccepted?.();
|
|
1080
|
+
} else if (state.dragging) {
|
|
1081
|
+
controller.cancelDrag();
|
|
1082
|
+
}
|
|
1083
|
+
state.dragging = false;
|
|
1084
|
+
state.sourceElement = null;
|
|
1085
|
+
}
|
|
1086
|
+
return {
|
|
1087
|
+
onPointerCancel(event) {
|
|
1088
|
+
stop(event, false);
|
|
1089
|
+
},
|
|
1090
|
+
onPointerDown(event) {
|
|
1091
|
+
if (disabled || event.button !== 0) {
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
if (event.target instanceof HTMLElement && event.target.closest("button, input, select, textarea, a")) {
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
state.dragging = false;
|
|
1098
|
+
state.pointerId = event.pointerId;
|
|
1099
|
+
state.sourceElement = event.currentTarget;
|
|
1100
|
+
state.startX = event.clientX;
|
|
1101
|
+
state.startY = event.clientY;
|
|
1102
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
1103
|
+
},
|
|
1104
|
+
onPointerMove(event) {
|
|
1105
|
+
if (state.pointerId !== event.pointerId || !state.sourceElement) {
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
if (!state.dragging) {
|
|
1109
|
+
const distance = Math.max(
|
|
1110
|
+
Math.abs(event.clientX - state.startX),
|
|
1111
|
+
Math.abs(event.clientY - state.startY)
|
|
1112
|
+
);
|
|
1113
|
+
if (distance < DRAG_THRESHOLD) {
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
const item = getItem();
|
|
1117
|
+
if (!item) {
|
|
1118
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
1119
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
1120
|
+
}
|
|
1121
|
+
state.pointerId = -1;
|
|
1122
|
+
state.sourceElement = null;
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
state.dragging = true;
|
|
1126
|
+
controller.beginDrag(item, state.sourceElement, sourceType);
|
|
1127
|
+
}
|
|
1128
|
+
controller.moveDrag(event.clientX, event.clientY);
|
|
1129
|
+
},
|
|
1130
|
+
onPointerUp(event) {
|
|
1131
|
+
stop(event, true);
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// src/components/ListBox/internals/ListBoxCheckControl.tsx
|
|
1137
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
907
1138
|
function ListBoxCheckControl({
|
|
908
1139
|
isChecked,
|
|
909
1140
|
onActivate,
|
|
910
1141
|
onToggleCheck,
|
|
911
1142
|
uncheckedShape
|
|
912
1143
|
}) {
|
|
913
|
-
return /* @__PURE__ */
|
|
1144
|
+
return /* @__PURE__ */ jsx9(
|
|
914
1145
|
"button",
|
|
915
1146
|
{
|
|
916
1147
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -922,13 +1153,13 @@ function ListBoxCheckControl({
|
|
|
922
1153
|
onToggleCheck();
|
|
923
1154
|
},
|
|
924
1155
|
type: "button",
|
|
925
|
-
children: /* @__PURE__ */
|
|
1156
|
+
children: /* @__PURE__ */ jsx9(
|
|
926
1157
|
"span",
|
|
927
1158
|
{
|
|
928
1159
|
"aria-hidden": "true",
|
|
929
1160
|
className: "nu-listbox__check-box",
|
|
930
1161
|
"data-unchecked-shape": uncheckedShape,
|
|
931
|
-
children: isChecked ? /* @__PURE__ */
|
|
1162
|
+
children: isChecked ? /* @__PURE__ */ jsx9(NuGlyph, { className: "nu-listbox__check-indicator", name: "check-mark" }) : null
|
|
932
1163
|
}
|
|
933
1164
|
)
|
|
934
1165
|
}
|
|
@@ -936,9 +1167,10 @@ function ListBoxCheckControl({
|
|
|
936
1167
|
}
|
|
937
1168
|
|
|
938
1169
|
// src/components/ListBox/internals/ListBoxItemView.tsx
|
|
939
|
-
import { jsx as
|
|
1170
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
940
1171
|
function ListBoxItemViewInner({
|
|
941
1172
|
group,
|
|
1173
|
+
getDragItem,
|
|
942
1174
|
isActive,
|
|
943
1175
|
isChecked,
|
|
944
1176
|
isSelected,
|
|
@@ -947,11 +1179,18 @@ function ListBoxItemViewInner({
|
|
|
947
1179
|
onActivate,
|
|
948
1180
|
onPopupMenu,
|
|
949
1181
|
onDoubleClick,
|
|
1182
|
+
onDragOut,
|
|
950
1183
|
onToggleCheck,
|
|
951
1184
|
registerItemRef,
|
|
952
1185
|
rightCheckBox,
|
|
953
1186
|
uncheckedShape
|
|
954
1187
|
}) {
|
|
1188
|
+
const dragSource = useNuDragSource({
|
|
1189
|
+
disabled: item.disabled || !getDragItem,
|
|
1190
|
+
getItem: () => getDragItem?.(item, group) ?? false,
|
|
1191
|
+
onDropAccepted: () => onDragOut?.(item, group),
|
|
1192
|
+
sourceType: "listbox-item"
|
|
1193
|
+
});
|
|
955
1194
|
function handleActivate() {
|
|
956
1195
|
if (!item.disabled) {
|
|
957
1196
|
onActivate(item, group, itemId);
|
|
@@ -970,7 +1209,7 @@ function ListBoxItemViewInner({
|
|
|
970
1209
|
function handleToggleCheck() {
|
|
971
1210
|
onToggleCheck(itemId);
|
|
972
1211
|
}
|
|
973
|
-
const checkControl = item.checkable ? /* @__PURE__ */
|
|
1212
|
+
const checkControl = item.checkable ? /* @__PURE__ */ jsx10(
|
|
974
1213
|
ListBoxCheckControl,
|
|
975
1214
|
{
|
|
976
1215
|
isChecked,
|
|
@@ -997,6 +1236,10 @@ function ListBoxItemViewInner({
|
|
|
997
1236
|
onClick: handleActivate,
|
|
998
1237
|
onContextMenu: onPopupMenu ? handleContextMenu : void 0,
|
|
999
1238
|
onDoubleClick: handleDoubleClick,
|
|
1239
|
+
onPointerCancel: dragSource.onPointerCancel,
|
|
1240
|
+
onPointerDown: dragSource.onPointerDown,
|
|
1241
|
+
onPointerMove: dragSource.onPointerMove,
|
|
1242
|
+
onPointerUp: dragSource.onPointerUp,
|
|
1000
1243
|
ref: (node) => registerItemRef(itemId, node),
|
|
1001
1244
|
role: "option",
|
|
1002
1245
|
children: [
|
|
@@ -1004,7 +1247,7 @@ function ListBoxItemViewInner({
|
|
|
1004
1247
|
rightCheckBox ? null : checkControl,
|
|
1005
1248
|
renderLabel(item.name, "nu-listbox__item-label")
|
|
1006
1249
|
] }),
|
|
1007
|
-
item.details ? /* @__PURE__ */
|
|
1250
|
+
item.details ? /* @__PURE__ */ jsx10("span", { className: "nu-listbox__item-details", children: item.details }) : null,
|
|
1008
1251
|
rightCheckBox ? checkControl : null
|
|
1009
1252
|
]
|
|
1010
1253
|
}
|
|
@@ -1013,14 +1256,16 @@ function ListBoxItemViewInner({
|
|
|
1013
1256
|
var ListBoxItemView = memo(ListBoxItemViewInner);
|
|
1014
1257
|
|
|
1015
1258
|
// src/components/ListBox/internals/ListBoxGroupView.tsx
|
|
1016
|
-
import { jsx as
|
|
1259
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1017
1260
|
function ListBoxGroupView({
|
|
1018
1261
|
group,
|
|
1019
1262
|
groupIndex,
|
|
1263
|
+
getDragItem,
|
|
1020
1264
|
isItemChecked,
|
|
1021
1265
|
listboxId,
|
|
1022
1266
|
onActivateItem,
|
|
1023
1267
|
onDoubleClickItem,
|
|
1268
|
+
onItemDragOut,
|
|
1024
1269
|
onPopupMenuItem,
|
|
1025
1270
|
onToggleItemCheck,
|
|
1026
1271
|
registerItemRef,
|
|
@@ -1030,7 +1275,7 @@ function ListBoxGroupView({
|
|
|
1030
1275
|
uncheckedShape
|
|
1031
1276
|
}) {
|
|
1032
1277
|
return /* @__PURE__ */ jsxs7("div", { className: "nu-listbox__group", role: "group", children: [
|
|
1033
|
-
group.category ? /* @__PURE__ */
|
|
1278
|
+
group.category ? /* @__PURE__ */ jsx11(ListBoxCategoryView, { category: group.category }) : null,
|
|
1034
1279
|
group.items.map((item, itemIndex) => {
|
|
1035
1280
|
const itemId = buildListBoxItemId(
|
|
1036
1281
|
listboxId,
|
|
@@ -1042,10 +1287,11 @@ function ListBoxGroupView({
|
|
|
1042
1287
|
const isSelected = selectedId ? item.id === selectedId : item.selected;
|
|
1043
1288
|
const isActive = resolvedActiveId === itemId;
|
|
1044
1289
|
const isChecked = isItemChecked(item);
|
|
1045
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ jsx11(
|
|
1046
1291
|
ListBoxItemView,
|
|
1047
1292
|
{
|
|
1048
1293
|
group,
|
|
1294
|
+
getDragItem,
|
|
1049
1295
|
isActive,
|
|
1050
1296
|
isChecked,
|
|
1051
1297
|
isSelected: Boolean(isSelected),
|
|
@@ -1053,6 +1299,7 @@ function ListBoxGroupView({
|
|
|
1053
1299
|
itemId,
|
|
1054
1300
|
onActivate: onActivateItem,
|
|
1055
1301
|
onDoubleClick: onDoubleClickItem,
|
|
1302
|
+
onDragOut: onItemDragOut,
|
|
1056
1303
|
onPopupMenu: onPopupMenuItem,
|
|
1057
1304
|
onToggleCheck: onToggleItemCheck,
|
|
1058
1305
|
registerItemRef,
|
|
@@ -1066,38 +1313,52 @@ function ListBoxGroupView({
|
|
|
1066
1313
|
}
|
|
1067
1314
|
|
|
1068
1315
|
// src/components/ListBox/ListBox.tsx
|
|
1069
|
-
import { jsx as
|
|
1316
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1070
1317
|
function ListBoxInner({
|
|
1318
|
+
acceptsDrop,
|
|
1071
1319
|
className,
|
|
1072
1320
|
data,
|
|
1073
1321
|
checkedIds,
|
|
1074
1322
|
emptyText = "No items",
|
|
1323
|
+
getDragItem,
|
|
1075
1324
|
onPopupMenu,
|
|
1076
1325
|
onItemCheckChange,
|
|
1077
1326
|
onItemDoubleClick,
|
|
1327
|
+
onItemDragOut,
|
|
1078
1328
|
onItemSelect,
|
|
1329
|
+
onDrop,
|
|
1079
1330
|
rightCheckBox = false,
|
|
1080
1331
|
selectedId,
|
|
1081
1332
|
uncheckedShape = "box",
|
|
1082
1333
|
...props
|
|
1083
1334
|
}, ref) {
|
|
1084
1335
|
const hasItems = data.some((group) => group.items.length > 0);
|
|
1085
|
-
const rootRef =
|
|
1336
|
+
const rootRef = useRef4(null);
|
|
1337
|
+
const [rootElement, setRootElement] = useState4(null);
|
|
1086
1338
|
const listboxId = useId();
|
|
1087
|
-
const itemRefs =
|
|
1088
|
-
const flattenedItems =
|
|
1339
|
+
const itemRefs = useRef4({});
|
|
1340
|
+
const flattenedItems = useMemo3(
|
|
1089
1341
|
() => flattenListBoxData(data, listboxId),
|
|
1090
1342
|
[data, listboxId]
|
|
1091
1343
|
);
|
|
1092
|
-
const selectableItems =
|
|
1344
|
+
const selectableItems = useMemo3(
|
|
1093
1345
|
() => flattenedItems.filter(({ item }) => !item.disabled),
|
|
1094
1346
|
[flattenedItems]
|
|
1095
1347
|
);
|
|
1096
1348
|
const [activeId, setActiveId] = useState4(
|
|
1097
1349
|
() => getInitialActiveId(selectableItems, selectedId)
|
|
1098
1350
|
);
|
|
1351
|
+
const dropTargetOptions = useMemo3(
|
|
1352
|
+
() => onDrop ? { accepts: acceptsDrop, onDrop, type: "listbox" } : void 0,
|
|
1353
|
+
[acceptsDrop, onDrop]
|
|
1354
|
+
);
|
|
1355
|
+
useNuDropTarget(rootElement, dropTargetOptions);
|
|
1356
|
+
const setRootRef = useCallback2((node) => {
|
|
1357
|
+
rootRef.current = node;
|
|
1358
|
+
setRootElement(node);
|
|
1359
|
+
}, []);
|
|
1099
1360
|
const resolvedActiveId = activeId && selectableItems.some((entry) => entry.itemId === activeId) ? activeId : getInitialActiveId(selectableItems, selectedId);
|
|
1100
|
-
|
|
1361
|
+
useEffect4(() => {
|
|
1101
1362
|
if (!resolvedActiveId) {
|
|
1102
1363
|
return;
|
|
1103
1364
|
}
|
|
@@ -1244,7 +1505,7 @@ function ListBoxInner({
|
|
|
1244
1505
|
break;
|
|
1245
1506
|
}
|
|
1246
1507
|
}
|
|
1247
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ jsx12(
|
|
1248
1509
|
"div",
|
|
1249
1510
|
{
|
|
1250
1511
|
...props,
|
|
@@ -1252,18 +1513,20 @@ function ListBoxInner({
|
|
|
1252
1513
|
className: ["nu-listbox", className].filter(Boolean).join(" "),
|
|
1253
1514
|
"data-right-checkbox": rightCheckBox || void 0,
|
|
1254
1515
|
onKeyDown: handleKeyDown,
|
|
1255
|
-
ref:
|
|
1516
|
+
ref: setRootRef,
|
|
1256
1517
|
role: "listbox",
|
|
1257
1518
|
tabIndex: 0,
|
|
1258
|
-
children: hasItems ? data.map((group, groupIndex) => /* @__PURE__ */
|
|
1519
|
+
children: hasItems ? data.map((group, groupIndex) => /* @__PURE__ */ jsx12(
|
|
1259
1520
|
ListBoxGroupView,
|
|
1260
1521
|
{
|
|
1261
1522
|
group,
|
|
1262
1523
|
groupIndex,
|
|
1263
1524
|
isItemChecked,
|
|
1525
|
+
getDragItem,
|
|
1264
1526
|
listboxId,
|
|
1265
1527
|
onActivateItem: activateItem,
|
|
1266
1528
|
onDoubleClickItem: onItemDoubleClick,
|
|
1529
|
+
onItemDragOut,
|
|
1267
1530
|
onPopupMenuItem: handleItemPopupMenu,
|
|
1268
1531
|
onToggleItemCheck: toggleItemCheck,
|
|
1269
1532
|
registerItemRef,
|
|
@@ -1273,14 +1536,14 @@ function ListBoxInner({
|
|
|
1273
1536
|
uncheckedShape
|
|
1274
1537
|
},
|
|
1275
1538
|
`${group.category?.text ?? "group"}-${groupIndex}`
|
|
1276
|
-
)) : /* @__PURE__ */
|
|
1539
|
+
)) : /* @__PURE__ */ jsx12("div", { className: "nu-listbox__empty", children: emptyText })
|
|
1277
1540
|
}
|
|
1278
1541
|
);
|
|
1279
1542
|
}
|
|
1280
1543
|
var ListBox = forwardRef(ListBoxInner);
|
|
1281
1544
|
|
|
1282
1545
|
// src/components/Stack/Stack.tsx
|
|
1283
|
-
import { jsx as
|
|
1546
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1284
1547
|
function resolveFlexAlign(align) {
|
|
1285
1548
|
if (align === "start") {
|
|
1286
1549
|
return "flex-start";
|
|
@@ -1309,7 +1572,7 @@ function Stack({
|
|
|
1309
1572
|
style,
|
|
1310
1573
|
...props
|
|
1311
1574
|
}) {
|
|
1312
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ jsx13(
|
|
1313
1576
|
"div",
|
|
1314
1577
|
{
|
|
1315
1578
|
...props,
|
|
@@ -1329,7 +1592,7 @@ function Stack({
|
|
|
1329
1592
|
}
|
|
1330
1593
|
|
|
1331
1594
|
// src/windowing/internals/MdiWindowPickerDialog.tsx
|
|
1332
|
-
import { jsx as
|
|
1595
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1333
1596
|
function isPickerEligibleWindow(windowEntry) {
|
|
1334
1597
|
if (windowEntry.mode === "window") {
|
|
1335
1598
|
return true;
|
|
@@ -1363,7 +1626,7 @@ function MdiWindowPickerDialog({
|
|
|
1363
1626
|
onClose,
|
|
1364
1627
|
windows
|
|
1365
1628
|
}) {
|
|
1366
|
-
const resolvedWindows =
|
|
1629
|
+
const resolvedWindows = useMemo4(
|
|
1367
1630
|
() => windows.filter(
|
|
1368
1631
|
(windowEntry) => isPickerEligibleWindow(windowEntry) && (!domain || windowEntry.domain === domain)
|
|
1369
1632
|
),
|
|
@@ -1383,7 +1646,7 @@ function MdiWindowPickerDialog({
|
|
|
1383
1646
|
onClose();
|
|
1384
1647
|
}
|
|
1385
1648
|
return /* @__PURE__ */ jsxs8(Stack, { gap: "md", children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ jsx14(
|
|
1387
1650
|
ListBox,
|
|
1388
1651
|
{
|
|
1389
1652
|
data: [
|
|
@@ -1392,6 +1655,7 @@ function MdiWindowPickerDialog({
|
|
|
1392
1655
|
items: resolvedWindows.map((windowEntry, index) => ({
|
|
1393
1656
|
id: windowEntry.id,
|
|
1394
1657
|
name: {
|
|
1658
|
+
icon: windowEntry.icon,
|
|
1395
1659
|
text: `${index + 1} ${formatPickerWindowTitle(windows, windowEntry)}`
|
|
1396
1660
|
},
|
|
1397
1661
|
selected: windowEntry.id === activeWindowId
|
|
@@ -1418,14 +1682,14 @@ function MdiWindowPickerDialog({
|
|
|
1418
1682
|
}
|
|
1419
1683
|
),
|
|
1420
1684
|
/* @__PURE__ */ jsxs8(Stack, { direction: "row", gap: "sm", children: [
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx14(Button, { defaultFocused: true, onClick: handleActivate, children: "Activate" }),
|
|
1686
|
+
/* @__PURE__ */ jsx14(Button, { onClick: onClose, variant: "secondary", children: "Cancel" })
|
|
1423
1687
|
] })
|
|
1424
1688
|
] });
|
|
1425
1689
|
}
|
|
1426
1690
|
|
|
1427
1691
|
// src/windowing/mdiMenu.tsx
|
|
1428
|
-
import { jsx as
|
|
1692
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1429
1693
|
var MDI_HOST_ID = "mdi.host";
|
|
1430
1694
|
function createMdiDivider(id) {
|
|
1431
1695
|
return {
|
|
@@ -1464,7 +1728,7 @@ function openMdiWindowPicker(bridge) {
|
|
|
1464
1728
|
bridge.openDialog({
|
|
1465
1729
|
appModal: true,
|
|
1466
1730
|
border: "double",
|
|
1467
|
-
content: ({ close }) => /* @__PURE__ */
|
|
1731
|
+
content: ({ close }) => /* @__PURE__ */ jsx15(
|
|
1468
1732
|
MdiWindowPickerDialog,
|
|
1469
1733
|
{
|
|
1470
1734
|
activeWindowId,
|
|
@@ -1507,6 +1771,7 @@ function buildStandardMdiMenuItems(bridge) {
|
|
|
1507
1771
|
...mdiWindows.map((windowEntry, index) => ({
|
|
1508
1772
|
checked: windowEntry.id === activeWindowId,
|
|
1509
1773
|
id: `mdi.window.${windowEntry.id}`,
|
|
1774
|
+
icon: windowEntry.icon,
|
|
1510
1775
|
onSelect: () => bridge?.activateWindow(windowEntry.id),
|
|
1511
1776
|
text: `${index + 1} ${windowEntry.title}`
|
|
1512
1777
|
})),
|
|
@@ -1551,12 +1816,12 @@ function resolveMdiMainMenuItems(items, bridge) {
|
|
|
1551
1816
|
}
|
|
1552
1817
|
|
|
1553
1818
|
// src/appHost/appHostContext.ts
|
|
1554
|
-
import { createContext, useContext } from "react";
|
|
1555
|
-
var AppHostMenuContext =
|
|
1819
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
1820
|
+
var AppHostMenuContext = createContext2(
|
|
1556
1821
|
null
|
|
1557
1822
|
);
|
|
1558
1823
|
function useAppHostMenu() {
|
|
1559
|
-
const context =
|
|
1824
|
+
const context = useContext2(AppHostMenuContext);
|
|
1560
1825
|
if (!context) {
|
|
1561
1826
|
throw new Error("useAppHostMenu must be used within a NuAppHostProvider.");
|
|
1562
1827
|
}
|
|
@@ -1581,7 +1846,7 @@ function useAppHostMenu() {
|
|
|
1581
1846
|
}
|
|
1582
1847
|
|
|
1583
1848
|
// src/appHost/NuAppHostProvider.tsx
|
|
1584
|
-
import { jsx as
|
|
1849
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1585
1850
|
function NuAppHostProvider({
|
|
1586
1851
|
children,
|
|
1587
1852
|
renderMenu = true
|
|
@@ -1590,11 +1855,11 @@ function NuAppHostProvider({
|
|
|
1590
1855
|
const [windowBridge, setWindowBridge] = useState6(
|
|
1591
1856
|
null
|
|
1592
1857
|
);
|
|
1593
|
-
const resolvedMainMenu =
|
|
1858
|
+
const resolvedMainMenu = useMemo5(
|
|
1594
1859
|
() => resolveMdiMainMenuItems(menuState.mainMenu, windowBridge),
|
|
1595
1860
|
[menuState.mainMenu, windowBridge]
|
|
1596
1861
|
);
|
|
1597
|
-
const contextValue =
|
|
1862
|
+
const contextValue = useMemo5(
|
|
1598
1863
|
() => ({
|
|
1599
1864
|
...menuState,
|
|
1600
1865
|
setWindowBridge,
|
|
@@ -1603,7 +1868,7 @@ function NuAppHostProvider({
|
|
|
1603
1868
|
[menuState, windowBridge]
|
|
1604
1869
|
);
|
|
1605
1870
|
return /* @__PURE__ */ jsxs9(AppHostMenuContext.Provider, { value: contextValue, children: [
|
|
1606
|
-
renderMenu && hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */
|
|
1871
|
+
renderMenu && hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */ jsx16(MainMenu, { items: resolvedMainMenu }) : null,
|
|
1607
1872
|
children
|
|
1608
1873
|
] });
|
|
1609
1874
|
}
|
|
@@ -1612,27 +1877,27 @@ function NuAppHostProvider({
|
|
|
1612
1877
|
import {
|
|
1613
1878
|
Fragment as Fragment3,
|
|
1614
1879
|
useCallback as useCallback3,
|
|
1615
|
-
useContext as
|
|
1616
|
-
useEffect as
|
|
1617
|
-
useMemo as
|
|
1618
|
-
useRef as
|
|
1880
|
+
useContext as useContext7,
|
|
1881
|
+
useEffect as useEffect6,
|
|
1882
|
+
useMemo as useMemo7,
|
|
1883
|
+
useRef as useRef7,
|
|
1619
1884
|
useState as useState9
|
|
1620
1885
|
} from "react";
|
|
1621
1886
|
|
|
1622
1887
|
// src/components/Window/Window.tsx
|
|
1623
1888
|
import {
|
|
1624
1889
|
memo as memo2,
|
|
1625
|
-
useContext as
|
|
1890
|
+
useContext as useContext5,
|
|
1626
1891
|
useLayoutEffect,
|
|
1627
|
-
useMemo as
|
|
1628
|
-
useRef as
|
|
1892
|
+
useMemo as useMemo6,
|
|
1893
|
+
useRef as useRef5
|
|
1629
1894
|
} from "react";
|
|
1630
1895
|
|
|
1631
1896
|
// src/components/Window/internals/WindowStatusBar.tsx
|
|
1632
1897
|
import { Children } from "react";
|
|
1633
1898
|
|
|
1634
1899
|
// src/components/Window/StatusBarItem.tsx
|
|
1635
|
-
import { jsx as
|
|
1900
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1636
1901
|
function StatusBarItem({
|
|
1637
1902
|
align = "start",
|
|
1638
1903
|
children,
|
|
@@ -1640,7 +1905,7 @@ function StatusBarItem({
|
|
|
1640
1905
|
grow = false,
|
|
1641
1906
|
...props
|
|
1642
1907
|
}) {
|
|
1643
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ jsx17(
|
|
1644
1909
|
"span",
|
|
1645
1910
|
{
|
|
1646
1911
|
...props,
|
|
@@ -1656,7 +1921,7 @@ function StatusBarItem({
|
|
|
1656
1921
|
}
|
|
1657
1922
|
|
|
1658
1923
|
// src/components/Window/internals/WindowStatusBar.tsx
|
|
1659
|
-
import { jsx as
|
|
1924
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1660
1925
|
function WindowStatusBar({
|
|
1661
1926
|
children,
|
|
1662
1927
|
onResizeStart,
|
|
@@ -1672,15 +1937,15 @@ function WindowStatusBar({
|
|
|
1672
1937
|
{
|
|
1673
1938
|
className: ["nu-window__status-bar", statusBarClassName].filter(Boolean).join(" "),
|
|
1674
1939
|
children: [
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
resizable ? /* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ jsx18("span", { className: "nu-window__status-bar-items", children: hasCustomItems ? resolvedChildren : resolvedChildren.map((child, index) => /* @__PURE__ */ jsx18(StatusBarItem, { grow: index === 0, children: child }, `status-item-${index}`)) }),
|
|
1941
|
+
resizable ? /* @__PURE__ */ jsx18(
|
|
1677
1942
|
"button",
|
|
1678
1943
|
{
|
|
1679
1944
|
"aria-label": "Resize window",
|
|
1680
1945
|
className: "nu-window__resize-handle",
|
|
1681
1946
|
onPointerDown: onResizeStart,
|
|
1682
1947
|
type: "button",
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1948
|
+
children: /* @__PURE__ */ jsx18(NuGlyph, { name: "window-resize" })
|
|
1684
1949
|
}
|
|
1685
1950
|
) : null
|
|
1686
1951
|
]
|
|
@@ -1689,18 +1954,18 @@ function WindowStatusBar({
|
|
|
1689
1954
|
}
|
|
1690
1955
|
|
|
1691
1956
|
// src/components/Window/WindowTitleButton.tsx
|
|
1692
|
-
import { jsx as
|
|
1957
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1693
1958
|
function renderWindowTriangleGlyph(icon) {
|
|
1694
1959
|
const glyphNameByIcon = {
|
|
1695
1960
|
maximize: "window-maximize",
|
|
1696
1961
|
minimize: "window-minimize",
|
|
1697
1962
|
restore: "window-restore"
|
|
1698
1963
|
};
|
|
1699
|
-
return /* @__PURE__ */
|
|
1964
|
+
return /* @__PURE__ */ jsx19(NuGlyph, { className: "nu-window__title-glyph", name: glyphNameByIcon[icon] });
|
|
1700
1965
|
}
|
|
1701
1966
|
function renderTitleButtonIcon(icon) {
|
|
1702
1967
|
if (icon === "close") {
|
|
1703
|
-
return /* @__PURE__ */
|
|
1968
|
+
return /* @__PURE__ */ jsx19(NuGlyph, { className: "nu-window__title-glyph", name: "window-close" });
|
|
1704
1969
|
}
|
|
1705
1970
|
if (icon === "minimize" || icon === "maximize" || icon === "restore") {
|
|
1706
1971
|
return renderWindowTriangleGlyph(
|
|
@@ -1719,7 +1984,7 @@ function WindowTitleButton({
|
|
|
1719
1984
|
variant = icon === "close" ? "close" : "default",
|
|
1720
1985
|
...props
|
|
1721
1986
|
}) {
|
|
1722
|
-
return /* @__PURE__ */
|
|
1987
|
+
return /* @__PURE__ */ jsx19(
|
|
1723
1988
|
"button",
|
|
1724
1989
|
{
|
|
1725
1990
|
...props,
|
|
@@ -1741,9 +2006,10 @@ function WindowTitleButton({
|
|
|
1741
2006
|
}
|
|
1742
2007
|
|
|
1743
2008
|
// src/components/Window/internals/WindowTitleBar.tsx
|
|
1744
|
-
import { jsx as
|
|
2009
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1745
2010
|
function WindowTitleBar({
|
|
1746
2011
|
draggable,
|
|
2012
|
+
icon,
|
|
1747
2013
|
onDragStart,
|
|
1748
2014
|
titleButtons,
|
|
1749
2015
|
title
|
|
@@ -1759,8 +2025,9 @@ function WindowTitleBar({
|
|
|
1759
2025
|
"--nu-window-title-controls-width": controlsWidth
|
|
1760
2026
|
},
|
|
1761
2027
|
children: [
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
|
|
2028
|
+
/* @__PURE__ */ jsx20("span", { "aria-hidden": true, className: "nu-window__title-icon", children: icon }),
|
|
2029
|
+
/* @__PURE__ */ jsx20("span", { className: "nu-window__title", children: renderMnemonicText(title) }),
|
|
2030
|
+
titleButtons.length > 0 ? /* @__PURE__ */ jsx20("span", { className: "nu-window__title-controls", children: titleButtons.map((button, index) => /* @__PURE__ */ jsx20(
|
|
1764
2031
|
WindowTitleButton,
|
|
1765
2032
|
{
|
|
1766
2033
|
ariaLabel: button.ariaLabel,
|
|
@@ -1817,10 +2084,10 @@ function useWindowTitleButtons({
|
|
|
1817
2084
|
}
|
|
1818
2085
|
|
|
1819
2086
|
// src/windowing/windowContext.ts
|
|
1820
|
-
import { createContext as
|
|
1821
|
-
var NuWindowContext =
|
|
2087
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
2088
|
+
var NuWindowContext = createContext3(null);
|
|
1822
2089
|
function useNuWindowManager() {
|
|
1823
|
-
const context =
|
|
2090
|
+
const context = useContext3(NuWindowContext);
|
|
1824
2091
|
if (!context) {
|
|
1825
2092
|
throw new Error(
|
|
1826
2093
|
"useNuWindowManager must be used within a NuWindowProvider."
|
|
@@ -1830,10 +2097,10 @@ function useNuWindowManager() {
|
|
|
1830
2097
|
}
|
|
1831
2098
|
|
|
1832
2099
|
// src/components/Window/windowMenuContext.ts
|
|
1833
|
-
import { createContext as
|
|
1834
|
-
var WindowMenuContext =
|
|
2100
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
2101
|
+
var WindowMenuContext = createContext4(null);
|
|
1835
2102
|
function useWindowMenu() {
|
|
1836
|
-
const context =
|
|
2103
|
+
const context = useContext4(WindowMenuContext);
|
|
1837
2104
|
if (!context) {
|
|
1838
2105
|
throw new Error("useWindowMenu must be used within a Window menu scope.");
|
|
1839
2106
|
}
|
|
@@ -1841,7 +2108,7 @@ function useWindowMenu() {
|
|
|
1841
2108
|
}
|
|
1842
2109
|
|
|
1843
2110
|
// src/components/Window/Window.tsx
|
|
1844
|
-
import { jsx as
|
|
2111
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1845
2112
|
function getWindowLayerBounds(node) {
|
|
1846
2113
|
const parentNode = node.parentElement;
|
|
1847
2114
|
if (!parentNode) {
|
|
@@ -1859,16 +2126,23 @@ function getWindowGeometry(node) {
|
|
|
1859
2126
|
width: rect.width
|
|
1860
2127
|
};
|
|
1861
2128
|
}
|
|
2129
|
+
function getValidAspectRatio(value) {
|
|
2130
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
2131
|
+
}
|
|
1862
2132
|
function WindowInner({
|
|
1863
2133
|
active = true,
|
|
2134
|
+
aspectRatio,
|
|
1864
2135
|
bodyClassName,
|
|
1865
2136
|
border = "single",
|
|
1866
2137
|
children,
|
|
1867
2138
|
className,
|
|
1868
2139
|
closeable = true,
|
|
1869
2140
|
draggable,
|
|
2141
|
+
icon,
|
|
1870
2142
|
maximizable,
|
|
1871
2143
|
maximized = false,
|
|
2144
|
+
minHeight,
|
|
2145
|
+
minWidth,
|
|
1872
2146
|
minimizable,
|
|
1873
2147
|
minimized = false,
|
|
1874
2148
|
mode = "dialog",
|
|
@@ -1889,18 +2163,19 @@ function WindowInner({
|
|
|
1889
2163
|
title,
|
|
1890
2164
|
...props
|
|
1891
2165
|
}) {
|
|
1892
|
-
const windowRef =
|
|
1893
|
-
const dragFrameRef =
|
|
1894
|
-
const dragPositionRef =
|
|
1895
|
-
const resizeFrameRef =
|
|
1896
|
-
const resizeSizeRef =
|
|
2166
|
+
const windowRef = useRef5(null);
|
|
2167
|
+
const dragFrameRef = useRef5(null);
|
|
2168
|
+
const dragPositionRef = useRef5(null);
|
|
2169
|
+
const resizeFrameRef = useRef5(null);
|
|
2170
|
+
const resizeSizeRef = useRef5(null);
|
|
1897
2171
|
const menuState = useMainMenuState();
|
|
1898
|
-
const windowManager =
|
|
2172
|
+
const windowManager = useContext5(NuWindowContext);
|
|
1899
2173
|
const isDraggable = draggable ?? mode === "window";
|
|
1900
|
-
const
|
|
2174
|
+
const resolvedAspectRatio = getValidAspectRatio(aspectRatio);
|
|
2175
|
+
const isMaximizable = resolvedAspectRatio === void 0 && (maximizable ?? mode === "window");
|
|
1901
2176
|
const isMinimizable = minimizable ?? mode === "window";
|
|
1902
2177
|
const isResizable = resizable ?? mode === "window";
|
|
1903
|
-
const mdiBridge =
|
|
2178
|
+
const mdiBridge = useMemo6(
|
|
1904
2179
|
() => ({
|
|
1905
2180
|
activateWindow: windowManager?.activateWindow ?? (() => void 0),
|
|
1906
2181
|
openDialog: windowManager?.openDialog ?? (() => ""),
|
|
@@ -1908,7 +2183,7 @@ function WindowInner({
|
|
|
1908
2183
|
}),
|
|
1909
2184
|
[windowManager?.activateWindow, windowManager?.openDialog, windowManager?.windows]
|
|
1910
2185
|
);
|
|
1911
|
-
const resolvedMainMenu =
|
|
2186
|
+
const resolvedMainMenu = useMemo6(
|
|
1912
2187
|
() => resolveMdiMainMenuItems(menuState.mainMenu, mdiBridge),
|
|
1913
2188
|
[menuState.mainMenu, mdiBridge]
|
|
1914
2189
|
);
|
|
@@ -2047,22 +2322,16 @@ function WindowInner({
|
|
|
2047
2322
|
} = getWindowGeometry(windowNode);
|
|
2048
2323
|
const layerBounds = getWindowLayerBounds(windowNode);
|
|
2049
2324
|
const computedStyle = window.getComputedStyle(windowNode);
|
|
2050
|
-
const
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
);
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
(layerBounds?.width ?? window.innerWidth) - left
|
|
2061
|
-
);
|
|
2062
|
-
const maxHeight = Math.max(
|
|
2063
|
-
minHeight,
|
|
2064
|
-
(layerBounds?.height ?? window.innerHeight) - top
|
|
2065
|
-
);
|
|
2325
|
+
const minWidth2 = Number.parseFloat(computedStyle.minWidth || "0") || 0;
|
|
2326
|
+
const minHeight2 = Number.parseFloat(computedStyle.minHeight || "0") || 0;
|
|
2327
|
+
const availableWidth = (layerBounds?.width ?? window.innerWidth) - left;
|
|
2328
|
+
const availableHeight = (layerBounds?.height ?? window.innerHeight) - top;
|
|
2329
|
+
const ratioMinWidth = resolvedAspectRatio ? Math.max(minWidth2, minHeight2 * resolvedAspectRatio) : minWidth2;
|
|
2330
|
+
const maxWidth = resolvedAspectRatio ? Math.max(
|
|
2331
|
+
ratioMinWidth,
|
|
2332
|
+
Math.min(availableWidth, availableHeight * resolvedAspectRatio)
|
|
2333
|
+
) : Math.max(minWidth2, availableWidth);
|
|
2334
|
+
const maxHeight = resolvedAspectRatio ? maxWidth / resolvedAspectRatio : Math.max(minHeight2, availableHeight);
|
|
2066
2335
|
const hadTransform = computedStyle.transform !== "none";
|
|
2067
2336
|
let didResize = false;
|
|
2068
2337
|
if (hadTransform) {
|
|
@@ -2087,14 +2356,16 @@ function WindowInner({
|
|
|
2087
2356
|
resizeFrameRef.current = window.requestAnimationFrame(flushResize);
|
|
2088
2357
|
}
|
|
2089
2358
|
function handlePointerMove(moveEvent) {
|
|
2090
|
-
const
|
|
2359
|
+
const widthDelta = moveEvent.clientX - startClientX;
|
|
2360
|
+
const heightDelta = moveEvent.clientY - startClientY;
|
|
2361
|
+
const nextWidth = resolvedAspectRatio ? Math.min(
|
|
2091
2362
|
maxWidth,
|
|
2092
|
-
Math.max(
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
);
|
|
2363
|
+
Math.max(
|
|
2364
|
+
ratioMinWidth,
|
|
2365
|
+
startWidth + (Math.abs(widthDelta) >= Math.abs(heightDelta * resolvedAspectRatio) ? widthDelta : heightDelta * resolvedAspectRatio)
|
|
2366
|
+
)
|
|
2367
|
+
) : Math.min(maxWidth, Math.max(minWidth2, startWidth + widthDelta));
|
|
2368
|
+
const nextHeight = resolvedAspectRatio ? nextWidth / resolvedAspectRatio : Math.min(maxHeight, Math.max(minHeight2, startHeight + heightDelta));
|
|
2098
2369
|
didResize = true;
|
|
2099
2370
|
scheduleResize({
|
|
2100
2371
|
height: nextHeight,
|
|
@@ -2134,16 +2405,20 @@ function WindowInner({
|
|
|
2134
2405
|
"data-mode": mode,
|
|
2135
2406
|
onPointerDownCapture: handleRootPointerDownCapture,
|
|
2136
2407
|
ref: windowRef,
|
|
2137
|
-
style
|
|
2408
|
+
style: {
|
|
2409
|
+
...style,
|
|
2410
|
+
minHeight: minHeight ?? style?.minHeight ?? 120,
|
|
2411
|
+
minWidth: minWidth ?? style?.minWidth ?? 240
|
|
2412
|
+
},
|
|
2138
2413
|
children: [
|
|
2139
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ jsx21(
|
|
2140
2415
|
"span",
|
|
2141
2416
|
{
|
|
2142
2417
|
"aria-hidden": true,
|
|
2143
2418
|
className: "nu-window__shadow nu-window__shadow--right"
|
|
2144
2419
|
}
|
|
2145
2420
|
),
|
|
2146
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ jsx21(
|
|
2147
2422
|
"span",
|
|
2148
2423
|
{
|
|
2149
2424
|
"aria-hidden": true,
|
|
@@ -2151,17 +2426,18 @@ function WindowInner({
|
|
|
2151
2426
|
}
|
|
2152
2427
|
),
|
|
2153
2428
|
/* @__PURE__ */ jsxs12(WindowMenuContext.Provider, { value: menuState, children: [
|
|
2154
|
-
/* @__PURE__ */
|
|
2429
|
+
/* @__PURE__ */ jsx21(
|
|
2155
2430
|
WindowTitleBar,
|
|
2156
2431
|
{
|
|
2157
2432
|
draggable: isDraggable,
|
|
2433
|
+
icon,
|
|
2158
2434
|
onDragStart: handleTitlePointerDown,
|
|
2159
2435
|
title,
|
|
2160
2436
|
titleButtons: resolvedTitleButtons
|
|
2161
2437
|
}
|
|
2162
2438
|
),
|
|
2163
|
-
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */
|
|
2164
|
-
/* @__PURE__ */
|
|
2439
|
+
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */ jsx21(MainMenu, { items: resolvedMainMenu }) : null,
|
|
2440
|
+
/* @__PURE__ */ jsx21(
|
|
2165
2441
|
"div",
|
|
2166
2442
|
{
|
|
2167
2443
|
className: [
|
|
@@ -2172,7 +2448,7 @@ function WindowInner({
|
|
|
2172
2448
|
children
|
|
2173
2449
|
}
|
|
2174
2450
|
),
|
|
2175
|
-
mode === "window" && (statusBar || isResizable) ? /* @__PURE__ */
|
|
2451
|
+
mode === "window" && (statusBar || isResizable) ? /* @__PURE__ */ jsx21(
|
|
2176
2452
|
WindowStatusBar,
|
|
2177
2453
|
{
|
|
2178
2454
|
onResizeStart: handleResizePointerDown,
|
|
@@ -2189,9 +2465,9 @@ function WindowInner({
|
|
|
2189
2465
|
var Window = memo2(WindowInner);
|
|
2190
2466
|
|
|
2191
2467
|
// src/windowing/AppBarHost.tsx
|
|
2192
|
-
import { jsx as
|
|
2468
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2193
2469
|
function AppBarHost({ children, inline = false }) {
|
|
2194
|
-
return /* @__PURE__ */
|
|
2470
|
+
return /* @__PURE__ */ jsx22(
|
|
2195
2471
|
"aside",
|
|
2196
2472
|
{
|
|
2197
2473
|
className: [
|
|
@@ -2207,7 +2483,7 @@ function AppBarHost({ children, inline = false }) {
|
|
|
2207
2483
|
}
|
|
2208
2484
|
|
|
2209
2485
|
// src/windowing/WindowBar.tsx
|
|
2210
|
-
import { useContext as
|
|
2486
|
+
import { useContext as useContext6 } from "react";
|
|
2211
2487
|
|
|
2212
2488
|
// src/windowing/AppBarItem.tsx
|
|
2213
2489
|
import {
|
|
@@ -2281,7 +2557,7 @@ function AppBarItem(props) {
|
|
|
2281
2557
|
}
|
|
2282
2558
|
|
|
2283
2559
|
// src/windowing/WindowBar.tsx
|
|
2284
|
-
import { jsx as
|
|
2560
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2285
2561
|
function buildWindowBarGroups(items) {
|
|
2286
2562
|
const groups = [];
|
|
2287
2563
|
const groupsByDomain = /* @__PURE__ */ new Map();
|
|
@@ -2290,6 +2566,7 @@ function buildWindowBarGroups(items) {
|
|
|
2290
2566
|
groups.push({
|
|
2291
2567
|
active: Boolean(item.active),
|
|
2292
2568
|
id: item.id,
|
|
2569
|
+
icon: item.icon,
|
|
2293
2570
|
items: [item],
|
|
2294
2571
|
label: item.title
|
|
2295
2572
|
});
|
|
@@ -2301,6 +2578,7 @@ function buildWindowBarGroups(items) {
|
|
|
2301
2578
|
active: Boolean(item.active),
|
|
2302
2579
|
domain: item.domain,
|
|
2303
2580
|
id: item.id,
|
|
2581
|
+
icon: item.icon,
|
|
2304
2582
|
items: [item],
|
|
2305
2583
|
label: item.title
|
|
2306
2584
|
};
|
|
@@ -2310,12 +2588,18 @@ function buildWindowBarGroups(items) {
|
|
|
2310
2588
|
}
|
|
2311
2589
|
existingGroup.items.push(item);
|
|
2312
2590
|
existingGroup.active = existingGroup.active || Boolean(item.active);
|
|
2591
|
+
if (item.active) {
|
|
2592
|
+
existingGroup.icon = item.icon;
|
|
2593
|
+
}
|
|
2313
2594
|
existingGroup.label = `${item.domain} (${existingGroup.items.length})`;
|
|
2314
2595
|
});
|
|
2315
2596
|
return groups;
|
|
2316
2597
|
}
|
|
2598
|
+
function getGroupIcon(group) {
|
|
2599
|
+
return group.items.find((item) => item.active)?.icon ?? group.icon;
|
|
2600
|
+
}
|
|
2317
2601
|
function WindowBar({ items, onActivateWindow }) {
|
|
2318
|
-
const windowManager =
|
|
2602
|
+
const windowManager = useContext6(NuWindowContext);
|
|
2319
2603
|
const groups = buildWindowBarGroups(items);
|
|
2320
2604
|
function activateGroup(group) {
|
|
2321
2605
|
if (group.items.length <= 1) {
|
|
@@ -2333,7 +2617,7 @@ function WindowBar({ items, onActivateWindow }) {
|
|
|
2333
2617
|
const dialogDefinition = {
|
|
2334
2618
|
appModal: true,
|
|
2335
2619
|
border: "double",
|
|
2336
|
-
content: ({ close }) => /* @__PURE__ */
|
|
2620
|
+
content: ({ close }) => /* @__PURE__ */ jsx23(
|
|
2337
2621
|
MdiWindowPickerDialog,
|
|
2338
2622
|
{
|
|
2339
2623
|
activeWindowId: activeGroupWindowId,
|
|
@@ -2354,17 +2638,23 @@ function WindowBar({ items, onActivateWindow }) {
|
|
|
2354
2638
|
};
|
|
2355
2639
|
windowManager.openDialog(dialogDefinition);
|
|
2356
2640
|
}
|
|
2357
|
-
return /* @__PURE__ */
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2641
|
+
return /* @__PURE__ */ jsx23("div", { className: "nu-window-bar", role: "group", "aria-label": "Open windows", children: groups.map((group) => {
|
|
2642
|
+
const icon = getGroupIcon(group);
|
|
2643
|
+
return /* @__PURE__ */ jsxs13(
|
|
2644
|
+
AppBarItem,
|
|
2645
|
+
{
|
|
2646
|
+
active: group.active,
|
|
2647
|
+
className: "nu-window-bar__item",
|
|
2648
|
+
interactive: true,
|
|
2649
|
+
onClick: () => activateGroup(group),
|
|
2650
|
+
children: [
|
|
2651
|
+
icon ? /* @__PURE__ */ jsx23("span", { "aria-hidden": true, className: "nu-window-bar__icon", children: icon }) : null,
|
|
2652
|
+
group.label
|
|
2653
|
+
]
|
|
2654
|
+
},
|
|
2655
|
+
group.id
|
|
2656
|
+
);
|
|
2657
|
+
}) });
|
|
2368
2658
|
}
|
|
2369
2659
|
|
|
2370
2660
|
// src/windowing/dialogHelpers.tsx
|
|
@@ -2372,12 +2662,12 @@ import { useState as useState8 } from "react";
|
|
|
2372
2662
|
|
|
2373
2663
|
// src/components/TextField/TextField.tsx
|
|
2374
2664
|
import {
|
|
2375
|
-
useEffect as
|
|
2665
|
+
useEffect as useEffect5,
|
|
2376
2666
|
useId as useId2,
|
|
2377
|
-
useRef as
|
|
2667
|
+
useRef as useRef6,
|
|
2378
2668
|
useState as useState7
|
|
2379
2669
|
} from "react";
|
|
2380
|
-
import { jsx as
|
|
2670
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2381
2671
|
function TextField({
|
|
2382
2672
|
className,
|
|
2383
2673
|
debounceMs = 0,
|
|
@@ -2398,12 +2688,12 @@ function TextField({
|
|
|
2398
2688
|
const fieldId = id ?? generatedId;
|
|
2399
2689
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
2400
2690
|
const isControlled = value !== void 0;
|
|
2401
|
-
const hasMountedRef =
|
|
2691
|
+
const hasMountedRef = useRef6(false);
|
|
2402
2692
|
const [uncontrolledValue, setUncontrolledValue] = useState7(
|
|
2403
2693
|
() => defaultValue == null ? "" : String(defaultValue)
|
|
2404
2694
|
);
|
|
2405
2695
|
const resolvedValue = isControlled ? value == null ? "" : String(value) : uncontrolledValue;
|
|
2406
|
-
|
|
2696
|
+
useEffect5(() => {
|
|
2407
2697
|
if (!onDebouncedChange) {
|
|
2408
2698
|
return;
|
|
2409
2699
|
}
|
|
@@ -2428,14 +2718,14 @@ function TextField({
|
|
|
2428
2718
|
}
|
|
2429
2719
|
onChange?.(event);
|
|
2430
2720
|
}
|
|
2431
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsxs14(
|
|
2432
2722
|
"label",
|
|
2433
2723
|
{
|
|
2434
2724
|
className: cx("nu-text-field", slotClassNames?.root, className),
|
|
2435
2725
|
htmlFor: fieldId,
|
|
2436
2726
|
style: slotStyles?.root,
|
|
2437
2727
|
children: [
|
|
2438
|
-
/* @__PURE__ */
|
|
2728
|
+
/* @__PURE__ */ jsx24(
|
|
2439
2729
|
"span",
|
|
2440
2730
|
{
|
|
2441
2731
|
className: cx("nu-text-field__label", slotClassNames?.label),
|
|
@@ -2443,13 +2733,13 @@ function TextField({
|
|
|
2443
2733
|
children: renderMnemonicText(label)
|
|
2444
2734
|
}
|
|
2445
2735
|
),
|
|
2446
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsxs14(
|
|
2447
2737
|
"span",
|
|
2448
2738
|
{
|
|
2449
2739
|
className: cx("nu-text-field__slot", slotClassNames?.slot),
|
|
2450
2740
|
style: slotStyles?.slot,
|
|
2451
2741
|
children: [
|
|
2452
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ jsx24(
|
|
2453
2743
|
"span",
|
|
2454
2744
|
{
|
|
2455
2745
|
"aria-hidden": "true",
|
|
@@ -2458,7 +2748,7 @@ function TextField({
|
|
|
2458
2748
|
children: "["
|
|
2459
2749
|
}
|
|
2460
2750
|
),
|
|
2461
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ jsx24(
|
|
2462
2752
|
"span",
|
|
2463
2753
|
{
|
|
2464
2754
|
className: cx(
|
|
@@ -2466,7 +2756,7 @@ function TextField({
|
|
|
2466
2756
|
slotClassNames?.inputShell
|
|
2467
2757
|
),
|
|
2468
2758
|
style: slotStyles?.inputShell,
|
|
2469
|
-
children: /* @__PURE__ */
|
|
2759
|
+
children: /* @__PURE__ */ jsx24(
|
|
2470
2760
|
"input",
|
|
2471
2761
|
{
|
|
2472
2762
|
...props,
|
|
@@ -2485,7 +2775,7 @@ function TextField({
|
|
|
2485
2775
|
)
|
|
2486
2776
|
}
|
|
2487
2777
|
),
|
|
2488
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsx24(
|
|
2489
2779
|
"span",
|
|
2490
2780
|
{
|
|
2491
2781
|
"aria-hidden": "true",
|
|
@@ -2497,7 +2787,7 @@ function TextField({
|
|
|
2497
2787
|
]
|
|
2498
2788
|
}
|
|
2499
2789
|
),
|
|
2500
|
-
hint ? /* @__PURE__ */
|
|
2790
|
+
hint ? /* @__PURE__ */ jsx24(
|
|
2501
2791
|
"span",
|
|
2502
2792
|
{
|
|
2503
2793
|
className: cx("nu-text-field__hint", slotClassNames?.hint),
|
|
@@ -2512,7 +2802,7 @@ function TextField({
|
|
|
2512
2802
|
}
|
|
2513
2803
|
|
|
2514
2804
|
// src/components/View/NuView.tsx
|
|
2515
|
-
import { jsx as
|
|
2805
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2516
2806
|
function NuView({
|
|
2517
2807
|
children,
|
|
2518
2808
|
className,
|
|
@@ -2521,7 +2811,7 @@ function NuView({
|
|
|
2521
2811
|
scroll = "auto",
|
|
2522
2812
|
...props
|
|
2523
2813
|
}) {
|
|
2524
|
-
return /* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ jsx25(
|
|
2525
2815
|
"div",
|
|
2526
2816
|
{
|
|
2527
2817
|
...props,
|
|
@@ -2535,7 +2825,7 @@ function NuView({
|
|
|
2535
2825
|
}
|
|
2536
2826
|
|
|
2537
2827
|
// src/windowing/dialogHelpers.tsx
|
|
2538
|
-
import { jsx as
|
|
2828
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2539
2829
|
function getPresetButtons(preset) {
|
|
2540
2830
|
switch (preset) {
|
|
2541
2831
|
case "ok-cancel":
|
|
@@ -2638,8 +2928,8 @@ function MessageBoxDialogContent({
|
|
|
2638
2928
|
const bodyStyle = kind === "error" ? {
|
|
2639
2929
|
background: "var(--nu-color-button-danger)"
|
|
2640
2930
|
} : void 0;
|
|
2641
|
-
return /* @__PURE__ */
|
|
2642
|
-
/* @__PURE__ */
|
|
2931
|
+
return /* @__PURE__ */ jsx26(NuView, { padding: "cell", style: bodyStyle, children: /* @__PURE__ */ jsxs15(Stack, { gap: "md", children: [
|
|
2932
|
+
/* @__PURE__ */ jsx26(
|
|
2643
2933
|
"div",
|
|
2644
2934
|
{
|
|
2645
2935
|
style: tone ? {
|
|
@@ -2648,8 +2938,8 @@ function MessageBoxDialogContent({
|
|
|
2648
2938
|
children: message
|
|
2649
2939
|
}
|
|
2650
2940
|
),
|
|
2651
|
-
/* @__PURE__ */
|
|
2652
|
-
ok ? /* @__PURE__ */
|
|
2941
|
+
/* @__PURE__ */ jsxs15(Stack, { direction: "row", gap: "sm", justify: "center", children: [
|
|
2942
|
+
ok ? /* @__PURE__ */ jsx26(
|
|
2653
2943
|
Button,
|
|
2654
2944
|
{
|
|
2655
2945
|
className: "nu-dialog-helper__button",
|
|
@@ -2658,7 +2948,7 @@ function MessageBoxDialogContent({
|
|
|
2658
2948
|
children: okLabel
|
|
2659
2949
|
}
|
|
2660
2950
|
) : null,
|
|
2661
|
-
yes ? /* @__PURE__ */
|
|
2951
|
+
yes ? /* @__PURE__ */ jsx26(
|
|
2662
2952
|
Button,
|
|
2663
2953
|
{
|
|
2664
2954
|
className: "nu-dialog-helper__button",
|
|
@@ -2667,7 +2957,7 @@ function MessageBoxDialogContent({
|
|
|
2667
2957
|
children: yesLabel
|
|
2668
2958
|
}
|
|
2669
2959
|
) : null,
|
|
2670
|
-
no ? /* @__PURE__ */
|
|
2960
|
+
no ? /* @__PURE__ */ jsx26(
|
|
2671
2961
|
Button,
|
|
2672
2962
|
{
|
|
2673
2963
|
className: "nu-dialog-helper__button",
|
|
@@ -2676,7 +2966,7 @@ function MessageBoxDialogContent({
|
|
|
2676
2966
|
children: noLabel
|
|
2677
2967
|
}
|
|
2678
2968
|
) : null,
|
|
2679
|
-
cancel ? /* @__PURE__ */
|
|
2969
|
+
cancel ? /* @__PURE__ */ jsx26(
|
|
2680
2970
|
Button,
|
|
2681
2971
|
{
|
|
2682
2972
|
className: "nu-dialog-helper__button",
|
|
@@ -2698,8 +2988,8 @@ function InputBoxDialogContent({
|
|
|
2698
2988
|
placeholder
|
|
2699
2989
|
}) {
|
|
2700
2990
|
const [value, setValue] = useState8(defaultValue ?? "");
|
|
2701
|
-
return /* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ jsx26(NuView, { padding: "cell", children: /* @__PURE__ */ jsxs15(Stack, { gap: "md", children: [
|
|
2992
|
+
/* @__PURE__ */ jsx26(
|
|
2703
2993
|
TextField,
|
|
2704
2994
|
{
|
|
2705
2995
|
autoFocus: true,
|
|
@@ -2710,8 +3000,8 @@ function InputBoxDialogContent({
|
|
|
2710
3000
|
placeholder
|
|
2711
3001
|
}
|
|
2712
3002
|
),
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ jsxs15(Stack, { direction: "row", gap: "sm", justify: "center", children: [
|
|
3004
|
+
/* @__PURE__ */ jsx26(
|
|
2715
3005
|
Button,
|
|
2716
3006
|
{
|
|
2717
3007
|
className: "nu-dialog-helper__button",
|
|
@@ -2720,7 +3010,7 @@ function InputBoxDialogContent({
|
|
|
2720
3010
|
children: okLabel
|
|
2721
3011
|
}
|
|
2722
3012
|
),
|
|
2723
|
-
/* @__PURE__ */
|
|
3013
|
+
/* @__PURE__ */ jsx26(
|
|
2724
3014
|
Button,
|
|
2725
3015
|
{
|
|
2726
3016
|
className: "nu-dialog-helper__button",
|
|
@@ -2734,7 +3024,7 @@ function InputBoxDialogContent({
|
|
|
2734
3024
|
}
|
|
2735
3025
|
|
|
2736
3026
|
// src/windowing/NuWindowProvider.tsx
|
|
2737
|
-
import { jsx as
|
|
3027
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2738
3028
|
function getDefaultWindowStyle(mode, index) {
|
|
2739
3029
|
const offset = index * 18;
|
|
2740
3030
|
return {
|
|
@@ -2809,6 +3099,7 @@ function buildWindowRecord(definition, currentWindows, windowBoundsById, creatio
|
|
|
2809
3099
|
ownerCenteredStyle,
|
|
2810
3100
|
index
|
|
2811
3101
|
);
|
|
3102
|
+
const hasAspectRatio = typeof definition.aspectRatio === "number" && Number.isFinite(definition.aspectRatio) && definition.aspectRatio > 0;
|
|
2812
3103
|
return {
|
|
2813
3104
|
...definition,
|
|
2814
3105
|
appModal,
|
|
@@ -2817,18 +3108,18 @@ function buildWindowRecord(definition, currentWindows, windowBoundsById, creatio
|
|
|
2817
3108
|
creationOrder,
|
|
2818
3109
|
draggable: mode === "window",
|
|
2819
3110
|
id,
|
|
2820
|
-
maximizable: definition.maximizable ?? mode === "window",
|
|
3111
|
+
maximizable: !hasAspectRatio && (definition.maximizable ?? mode === "window"),
|
|
2821
3112
|
modalOwnerId,
|
|
2822
3113
|
minimizable: definition.minimizable ?? mode === "window",
|
|
2823
3114
|
mode,
|
|
2824
3115
|
resizable: definition.resizable ?? mode === "window",
|
|
2825
|
-
restoreStyle: savedWindowState.restoreStyle,
|
|
3116
|
+
restoreStyle: hasAspectRatio ? void 0 : savedWindowState.restoreStyle,
|
|
2826
3117
|
title: resolveManagedWindowTitle(currentWindows, titleBase),
|
|
2827
3118
|
titleBase,
|
|
2828
3119
|
style: {
|
|
2829
3120
|
...savedWindowState.style
|
|
2830
3121
|
},
|
|
2831
|
-
maximized: savedWindowState.maximized,
|
|
3122
|
+
maximized: hasAspectRatio ? false : savedWindowState.maximized,
|
|
2832
3123
|
minimized: savedWindowState.minimized
|
|
2833
3124
|
};
|
|
2834
3125
|
}
|
|
@@ -2878,12 +3169,12 @@ function NuWindowProvider({
|
|
|
2878
3169
|
onAppModalChange,
|
|
2879
3170
|
renderAppBar = false
|
|
2880
3171
|
}) {
|
|
2881
|
-
const creationOrderRef =
|
|
2882
|
-
const idRef =
|
|
2883
|
-
const windowBoundsByIdRef =
|
|
3172
|
+
const creationOrderRef = useRef7(0);
|
|
3173
|
+
const idRef = useRef7(0);
|
|
3174
|
+
const windowBoundsByIdRef = useRef7({});
|
|
2884
3175
|
const [windows, setWindows] = useState9([]);
|
|
2885
3176
|
const [windowBoundsById, setWindowBoundsById] = useState9({});
|
|
2886
|
-
const appHostMenuContext =
|
|
3177
|
+
const appHostMenuContext = useContext7(AppHostMenuContext);
|
|
2887
3178
|
const nextId = useCallback3(() => {
|
|
2888
3179
|
idRef.current += 1;
|
|
2889
3180
|
return `nu-window-${idRef.current}`;
|
|
@@ -3043,7 +3334,7 @@ function NuWindowProvider({
|
|
|
3043
3334
|
const toggleWindowMaximized = useCallback3((id) => {
|
|
3044
3335
|
setWindows(
|
|
3045
3336
|
(currentWindows) => currentWindows.map((windowEntry) => {
|
|
3046
|
-
if (windowEntry.id !== id) {
|
|
3337
|
+
if (windowEntry.id !== id || !windowEntry.maximizable) {
|
|
3047
3338
|
return windowEntry;
|
|
3048
3339
|
}
|
|
3049
3340
|
if (windowEntry.maximized) {
|
|
@@ -3128,7 +3419,7 @@ function NuWindowProvider({
|
|
|
3128
3419
|
openDialog({
|
|
3129
3420
|
appModal: options.appModal ?? true,
|
|
3130
3421
|
closeable: true,
|
|
3131
|
-
content: ({ close }) => /* @__PURE__ */
|
|
3422
|
+
content: ({ close }) => /* @__PURE__ */ jsx27(
|
|
3132
3423
|
MessageBoxDialogContent,
|
|
3133
3424
|
{
|
|
3134
3425
|
cancel: buttons.cancel,
|
|
@@ -3171,7 +3462,7 @@ function NuWindowProvider({
|
|
|
3171
3462
|
openDialog({
|
|
3172
3463
|
appModal: options.appModal ?? true,
|
|
3173
3464
|
closeable: true,
|
|
3174
|
-
content: ({ close }) => /* @__PURE__ */
|
|
3465
|
+
content: ({ close }) => /* @__PURE__ */ jsx27(
|
|
3175
3466
|
InputBoxDialogContent,
|
|
3176
3467
|
{
|
|
3177
3468
|
cancelLabel: options.cancelLabel ?? "&Cancel",
|
|
@@ -3209,21 +3500,32 @@ function NuWindowProvider({
|
|
|
3209
3500
|
const topmostAppModalIndex = findTopmostAppModalIndex(visibleWindows);
|
|
3210
3501
|
const topmostAppModalId = topmostAppModalIndex >= 0 ? visibleWindows[topmostAppModalIndex]?.id : void 0;
|
|
3211
3502
|
const activeWindowId = topmostAppModalIndex >= 0 ? visibleWindows[topmostAppModalIndex]?.id : visibleWindows[visibleWindows.length - 1]?.id;
|
|
3503
|
+
const activeWindow = activeWindowId ? windows.find((windowEntry) => windowEntry.id === activeWindowId) : void 0;
|
|
3504
|
+
const activeActivationGroup = topmostAppModalIndex >= 0 ? void 0 : activeWindow?.activationGroup;
|
|
3212
3505
|
const hasAppModal = topmostAppModalIndex >= 0;
|
|
3213
|
-
const
|
|
3506
|
+
const isWindowActive = useCallback3(
|
|
3507
|
+
(windowEntry) => windowEntry.id === activeWindowId || activeActivationGroup !== void 0 && windowEntry.activationGroup === activeActivationGroup,
|
|
3508
|
+
[activeActivationGroup, activeWindowId]
|
|
3509
|
+
);
|
|
3510
|
+
const windowsInfo = useMemo7(
|
|
3214
3511
|
() => [...windows].sort(
|
|
3215
3512
|
(leftWindow, rightWindow) => leftWindow.creationOrder - rightWindow.creationOrder
|
|
3216
3513
|
).map((windowEntry) => ({
|
|
3217
|
-
active: windowEntry
|
|
3514
|
+
active: isWindowActive(windowEntry),
|
|
3515
|
+
activationGroup: windowEntry.activationGroup,
|
|
3516
|
+
aspectRatio: windowEntry.aspectRatio,
|
|
3218
3517
|
bodyClassName: windowEntry.bodyClassName,
|
|
3219
3518
|
appModal: windowEntry.appModal,
|
|
3220
3519
|
border: windowEntry.border,
|
|
3221
3520
|
className: windowEntry.className,
|
|
3222
3521
|
closeable: windowEntry.closeable,
|
|
3223
3522
|
domain: windowEntry.domain,
|
|
3523
|
+
icon: windowEntry.icon,
|
|
3224
3524
|
id: windowEntry.id,
|
|
3225
3525
|
maximizable: windowEntry.maximizable,
|
|
3226
3526
|
maximized: windowEntry.maximized,
|
|
3527
|
+
minHeight: windowEntry.minHeight,
|
|
3528
|
+
minWidth: windowEntry.minWidth,
|
|
3227
3529
|
modal: windowEntry.modalOwnerId ?? false,
|
|
3228
3530
|
minimizable: windowEntry.minimizable,
|
|
3229
3531
|
minimized: windowEntry.minimized,
|
|
@@ -3234,9 +3536,9 @@ function NuWindowProvider({
|
|
|
3234
3536
|
title: windowEntry.title,
|
|
3235
3537
|
titleButtons: windowEntry.titleButtons
|
|
3236
3538
|
})),
|
|
3237
|
-
[
|
|
3539
|
+
[isWindowActive, windows]
|
|
3238
3540
|
);
|
|
3239
|
-
const mdiBridge =
|
|
3541
|
+
const mdiBridge = useMemo7(
|
|
3240
3542
|
() => ({
|
|
3241
3543
|
activateWindow,
|
|
3242
3544
|
openDialog,
|
|
@@ -3244,7 +3546,7 @@ function NuWindowProvider({
|
|
|
3244
3546
|
}),
|
|
3245
3547
|
[activateWindow, openDialog, windowsInfo]
|
|
3246
3548
|
);
|
|
3247
|
-
const contextValue =
|
|
3549
|
+
const contextValue = useMemo7(
|
|
3248
3550
|
() => ({
|
|
3249
3551
|
activateWindow,
|
|
3250
3552
|
bringToFront,
|
|
@@ -3274,13 +3576,13 @@ function NuWindowProvider({
|
|
|
3274
3576
|
windowsInfo
|
|
3275
3577
|
]
|
|
3276
3578
|
);
|
|
3277
|
-
|
|
3579
|
+
useEffect6(() => {
|
|
3278
3580
|
if (!appHostMenuContext) {
|
|
3279
3581
|
return;
|
|
3280
3582
|
}
|
|
3281
3583
|
appHostMenuContext.setWindowBridge(mdiBridge);
|
|
3282
3584
|
}, [appHostMenuContext, mdiBridge]);
|
|
3283
|
-
|
|
3585
|
+
useEffect6(() => {
|
|
3284
3586
|
if (!appHostMenuContext) {
|
|
3285
3587
|
return;
|
|
3286
3588
|
}
|
|
@@ -3288,13 +3590,13 @@ function NuWindowProvider({
|
|
|
3288
3590
|
appHostMenuContext.setWindowBridge(null);
|
|
3289
3591
|
};
|
|
3290
3592
|
}, [appHostMenuContext]);
|
|
3291
|
-
|
|
3593
|
+
useEffect6(() => {
|
|
3292
3594
|
onAppModalChange?.(hasAppModal);
|
|
3293
3595
|
}, [hasAppModal, onAppModalChange]);
|
|
3294
|
-
return /* @__PURE__ */
|
|
3596
|
+
return /* @__PURE__ */ jsx27(NuWindowContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs16("div", { className: ["nu-window-host", className].filter(Boolean).join(" "), children: [
|
|
3295
3597
|
children,
|
|
3296
|
-
/* @__PURE__ */
|
|
3297
|
-
const isActiveWindow = windowEntry
|
|
3598
|
+
/* @__PURE__ */ jsx27("div", { className: "nu-window-layer", children: renderWindows.map((windowEntry) => {
|
|
3599
|
+
const isActiveWindow = isWindowActive(windowEntry);
|
|
3298
3600
|
const stackIndex = stackIndexById.get(windowEntry.id);
|
|
3299
3601
|
const isTopmostAppModal = windowEntry.id === topmostAppModalId;
|
|
3300
3602
|
const ownerBounds = windowEntry.modalOwnerId ? windowBoundsById[windowEntry.modalOwnerId] : void 0;
|
|
@@ -3322,30 +3624,34 @@ function NuWindowProvider({
|
|
|
3322
3624
|
update: handleUpdate
|
|
3323
3625
|
};
|
|
3324
3626
|
const content = typeof windowEntry.content === "function" ? windowEntry.content(controls) : windowEntry.content;
|
|
3325
|
-
return /* @__PURE__ */
|
|
3326
|
-
isTopmostAppModal ? /* @__PURE__ */
|
|
3627
|
+
return /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3628
|
+
isTopmostAppModal ? /* @__PURE__ */ jsx27(
|
|
3327
3629
|
"div",
|
|
3328
3630
|
{
|
|
3329
3631
|
className: "nu-window-layer__modal-backdrop",
|
|
3330
3632
|
style: { zIndex: visibleWindows.length + 1 }
|
|
3331
3633
|
}
|
|
3332
|
-
) : ownerBackdropStyle ? /* @__PURE__ */
|
|
3634
|
+
) : ownerBackdropStyle ? /* @__PURE__ */ jsx27(
|
|
3333
3635
|
"div",
|
|
3334
3636
|
{
|
|
3335
3637
|
className: "nu-window-layer__modal-backdrop",
|
|
3336
3638
|
style: ownerBackdropStyle
|
|
3337
3639
|
}
|
|
3338
3640
|
) : null,
|
|
3339
|
-
/* @__PURE__ */
|
|
3641
|
+
/* @__PURE__ */ jsx27(
|
|
3340
3642
|
Window,
|
|
3341
3643
|
{
|
|
3342
3644
|
active: isActiveWindow,
|
|
3645
|
+
aspectRatio: windowEntry.aspectRatio,
|
|
3343
3646
|
bodyClassName: windowEntry.bodyClassName,
|
|
3344
3647
|
border: windowEntry.border,
|
|
3345
3648
|
className: windowEntry.className,
|
|
3346
3649
|
closeable: windowEntry.closeable,
|
|
3347
3650
|
draggable: windowEntry.draggable,
|
|
3651
|
+
icon: windowEntry.icon,
|
|
3348
3652
|
maximizable: windowEntry.maximizable,
|
|
3653
|
+
minHeight: windowEntry.minHeight,
|
|
3654
|
+
minWidth: windowEntry.minWidth,
|
|
3349
3655
|
minimizable: windowEntry.minimizable,
|
|
3350
3656
|
maximized: windowEntry.maximized,
|
|
3351
3657
|
minimized: windowEntry.minimized,
|
|
@@ -3369,13 +3675,14 @@ function NuWindowProvider({
|
|
|
3369
3675
|
)
|
|
3370
3676
|
] }, windowEntry.id);
|
|
3371
3677
|
}) }),
|
|
3372
|
-
renderAppBar ? /* @__PURE__ */
|
|
3678
|
+
renderAppBar ? /* @__PURE__ */ jsx27(AppBarHost, { children: /* @__PURE__ */ jsx27(
|
|
3373
3679
|
WindowBar,
|
|
3374
3680
|
{
|
|
3375
3681
|
items: windowsInfo.map((windowEntry) => ({
|
|
3376
3682
|
active: windowEntry.active,
|
|
3377
3683
|
domain: windowEntry.domain,
|
|
3378
3684
|
id: windowEntry.id,
|
|
3685
|
+
icon: windowEntry.icon,
|
|
3379
3686
|
minimized: windowEntry.minimized,
|
|
3380
3687
|
title: windowEntry.title
|
|
3381
3688
|
})),
|
|
@@ -3386,11 +3693,11 @@ function NuWindowProvider({
|
|
|
3386
3693
|
}
|
|
3387
3694
|
|
|
3388
3695
|
// src/components/Desktop/Desktop.tsx
|
|
3389
|
-
import { jsx as
|
|
3696
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3390
3697
|
function DesktopWindowRegion({ appBar, children }) {
|
|
3391
|
-
return /* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
appBar ? /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
3699
|
+
/* @__PURE__ */ jsx28("div", { className: "nu-desktop__workspace", children }),
|
|
3700
|
+
appBar ? /* @__PURE__ */ jsx28("div", { className: "nu-desktop__app-bar", children: appBar }) : null
|
|
3394
3701
|
] });
|
|
3395
3702
|
}
|
|
3396
3703
|
function NuDesktop({
|
|
@@ -3401,11 +3708,11 @@ function NuDesktop({
|
|
|
3401
3708
|
...props
|
|
3402
3709
|
}) {
|
|
3403
3710
|
const [hasAppModal, setHasAppModal] = useState10(false);
|
|
3404
|
-
const appHostContext =
|
|
3711
|
+
const appHostContext = useContext8(AppHostMenuContext);
|
|
3405
3712
|
if (appHostContext) {
|
|
3406
3713
|
throw new Error("NuDesktop should not be nested inside another app host.");
|
|
3407
3714
|
}
|
|
3408
|
-
return /* @__PURE__ */
|
|
3715
|
+
return /* @__PURE__ */ jsx28(NuAppHostProvider, { renderMenu: false, children: /* @__PURE__ */ jsx28(
|
|
3409
3716
|
NuDesktopShell,
|
|
3410
3717
|
{
|
|
3411
3718
|
appBar: appBar ?? appBarContent,
|
|
@@ -3425,7 +3732,7 @@ function NuDesktopShell({
|
|
|
3425
3732
|
onAppModalChange,
|
|
3426
3733
|
props
|
|
3427
3734
|
}) {
|
|
3428
|
-
const appHostContext =
|
|
3735
|
+
const appHostContext = useContext8(AppHostMenuContext);
|
|
3429
3736
|
if (!appHostContext) {
|
|
3430
3737
|
throw new Error("NuDesktop must be used within a NuAppHostProvider.");
|
|
3431
3738
|
}
|
|
@@ -3433,21 +3740,21 @@ function NuDesktopShell({
|
|
|
3433
3740
|
appHostContext.mainMenu,
|
|
3434
3741
|
appHostContext.windowBridge
|
|
3435
3742
|
);
|
|
3436
|
-
return /* @__PURE__ */
|
|
3743
|
+
return /* @__PURE__ */ jsxs17(
|
|
3437
3744
|
"div",
|
|
3438
3745
|
{
|
|
3439
3746
|
...props,
|
|
3440
3747
|
className: ["nu-desktop", className].filter(Boolean).join(" "),
|
|
3441
3748
|
"data-modal-active": hasAppModal || void 0,
|
|
3442
3749
|
children: [
|
|
3443
|
-
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */
|
|
3444
|
-
/* @__PURE__ */
|
|
3750
|
+
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */ jsx28("div", { className: "nu-desktop__menu", children: /* @__PURE__ */ jsx28(MainMenu, { items: resolvedMainMenu }) }) : null,
|
|
3751
|
+
/* @__PURE__ */ jsx28(
|
|
3445
3752
|
NuWindowProvider,
|
|
3446
3753
|
{
|
|
3447
3754
|
className: "nu-desktop__window-region",
|
|
3448
3755
|
onAppModalChange,
|
|
3449
3756
|
renderAppBar: false,
|
|
3450
|
-
children: /* @__PURE__ */
|
|
3757
|
+
children: /* @__PURE__ */ jsx28(DesktopWindowRegion, { appBar, children })
|
|
3451
3758
|
}
|
|
3452
3759
|
)
|
|
3453
3760
|
]
|
|
@@ -3456,7 +3763,7 @@ function NuDesktopShell({
|
|
|
3456
3763
|
}
|
|
3457
3764
|
|
|
3458
3765
|
// src/components/Dashboard/Dashboard.tsx
|
|
3459
|
-
import { jsx as
|
|
3766
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3460
3767
|
function resolveDashboardGap(gap) {
|
|
3461
3768
|
if (typeof gap === "number") {
|
|
3462
3769
|
return `${gap}px`;
|
|
@@ -3477,7 +3784,7 @@ function Dashboard({
|
|
|
3477
3784
|
const resolvedGap = resolveDashboardGap(gap);
|
|
3478
3785
|
if (layout === "lanes") {
|
|
3479
3786
|
const lanes = Array.from({ length: laneCount }, (_, index) => index + 1);
|
|
3480
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ jsx29(
|
|
3481
3788
|
"div",
|
|
3482
3789
|
{
|
|
3483
3790
|
...props,
|
|
@@ -3489,7 +3796,7 @@ function Dashboard({
|
|
|
3489
3796
|
"--nu-dashboard-gap": resolvedGap,
|
|
3490
3797
|
"--nu-dashboard-lane-count": laneCount
|
|
3491
3798
|
},
|
|
3492
|
-
children: lanes.map((lane) => /* @__PURE__ */
|
|
3799
|
+
children: lanes.map((lane) => /* @__PURE__ */ jsx29("div", { className: "nu-dashboard__lane", children: items.filter((item) => (item.lane ?? 1) === lane).map((item) => /* @__PURE__ */ jsx29(
|
|
3493
3800
|
"div",
|
|
3494
3801
|
{
|
|
3495
3802
|
className: "nu-dashboard__cell",
|
|
@@ -3501,14 +3808,14 @@ function Dashboard({
|
|
|
3501
3808
|
minWidth: item.minWidth,
|
|
3502
3809
|
width: item.width
|
|
3503
3810
|
},
|
|
3504
|
-
children: /* @__PURE__ */
|
|
3811
|
+
children: /* @__PURE__ */ jsx29("div", { className: "nu-dashboard__content", children: item.content })
|
|
3505
3812
|
},
|
|
3506
3813
|
item.id
|
|
3507
3814
|
)) }, lane))
|
|
3508
3815
|
}
|
|
3509
3816
|
);
|
|
3510
3817
|
}
|
|
3511
|
-
return /* @__PURE__ */
|
|
3818
|
+
return /* @__PURE__ */ jsx29(
|
|
3512
3819
|
"div",
|
|
3513
3820
|
{
|
|
3514
3821
|
...props,
|
|
@@ -3519,7 +3826,7 @@ function Dashboard({
|
|
|
3519
3826
|
"--nu-dashboard-column-count": columnCount,
|
|
3520
3827
|
"--nu-dashboard-gap": resolvedGap
|
|
3521
3828
|
},
|
|
3522
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3829
|
+
children: items.map((item) => /* @__PURE__ */ jsx29(
|
|
3523
3830
|
"div",
|
|
3524
3831
|
{
|
|
3525
3832
|
className: "nu-dashboard__cell",
|
|
@@ -3533,7 +3840,7 @@ function Dashboard({
|
|
|
3533
3840
|
minWidth: item.minWidth,
|
|
3534
3841
|
width: item.width
|
|
3535
3842
|
},
|
|
3536
|
-
children: /* @__PURE__ */
|
|
3843
|
+
children: /* @__PURE__ */ jsx29("div", { className: "nu-dashboard__content", children: item.content })
|
|
3537
3844
|
},
|
|
3538
3845
|
item.id
|
|
3539
3846
|
))
|
|
@@ -3543,7 +3850,7 @@ function Dashboard({
|
|
|
3543
3850
|
|
|
3544
3851
|
// src/components/CheckBox/CheckBox.tsx
|
|
3545
3852
|
import { useId as useId3, useState as useState11 } from "react";
|
|
3546
|
-
import { jsx as
|
|
3853
|
+
import { jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3547
3854
|
function CheckBox({
|
|
3548
3855
|
checked,
|
|
3549
3856
|
className,
|
|
@@ -3570,19 +3877,19 @@ function CheckBox({
|
|
|
3570
3877
|
}
|
|
3571
3878
|
onCheckedChange?.(event.target.checked, event);
|
|
3572
3879
|
}
|
|
3573
|
-
return /* @__PURE__ */
|
|
3880
|
+
return /* @__PURE__ */ jsxs18(
|
|
3574
3881
|
"label",
|
|
3575
3882
|
{
|
|
3576
3883
|
className: cx("nu-check-box", slotClassNames?.root, className),
|
|
3577
3884
|
style: slotStyles?.root,
|
|
3578
3885
|
children: [
|
|
3579
|
-
/* @__PURE__ */
|
|
3886
|
+
/* @__PURE__ */ jsxs18(
|
|
3580
3887
|
"span",
|
|
3581
3888
|
{
|
|
3582
3889
|
className: cx("nu-check-box__main", slotClassNames?.main),
|
|
3583
3890
|
style: slotStyles?.main,
|
|
3584
3891
|
children: [
|
|
3585
|
-
/* @__PURE__ */
|
|
3892
|
+
/* @__PURE__ */ jsx30(
|
|
3586
3893
|
"input",
|
|
3587
3894
|
{
|
|
3588
3895
|
...props,
|
|
@@ -3596,19 +3903,19 @@ function CheckBox({
|
|
|
3596
3903
|
type: "checkbox"
|
|
3597
3904
|
}
|
|
3598
3905
|
),
|
|
3599
|
-
/* @__PURE__ */
|
|
3906
|
+
/* @__PURE__ */ jsx30(
|
|
3600
3907
|
"span",
|
|
3601
3908
|
{
|
|
3602
3909
|
"aria-hidden": "true",
|
|
3603
3910
|
className: cx("nu-check-box__control", slotClassNames?.control),
|
|
3604
3911
|
style: slotStyles?.control,
|
|
3605
|
-
children: /* @__PURE__ */
|
|
3912
|
+
children: /* @__PURE__ */ jsx30(
|
|
3606
3913
|
"span",
|
|
3607
3914
|
{
|
|
3608
3915
|
className: cx("nu-check-box__box", slotClassNames?.box),
|
|
3609
3916
|
"data-unchecked-shape": uncheckedShape,
|
|
3610
3917
|
style: slotStyles?.box,
|
|
3611
|
-
children: resolvedChecked ? /* @__PURE__ */
|
|
3918
|
+
children: resolvedChecked ? /* @__PURE__ */ jsx30(
|
|
3612
3919
|
NuGlyph,
|
|
3613
3920
|
{
|
|
3614
3921
|
className: cx("nu-check-box__mark", slotClassNames?.mark),
|
|
@@ -3620,7 +3927,7 @@ function CheckBox({
|
|
|
3620
3927
|
)
|
|
3621
3928
|
}
|
|
3622
3929
|
),
|
|
3623
|
-
/* @__PURE__ */
|
|
3930
|
+
/* @__PURE__ */ jsx30(
|
|
3624
3931
|
"span",
|
|
3625
3932
|
{
|
|
3626
3933
|
className: cx("nu-check-box__label", slotClassNames?.label),
|
|
@@ -3631,7 +3938,7 @@ function CheckBox({
|
|
|
3631
3938
|
]
|
|
3632
3939
|
}
|
|
3633
3940
|
),
|
|
3634
|
-
hint ? /* @__PURE__ */
|
|
3941
|
+
hint ? /* @__PURE__ */ jsx30(
|
|
3635
3942
|
"span",
|
|
3636
3943
|
{
|
|
3637
3944
|
className: cx("nu-check-box__hint", slotClassNames?.hint),
|
|
@@ -3647,29 +3954,29 @@ function CheckBox({
|
|
|
3647
3954
|
|
|
3648
3955
|
// src/components/Dropdown/Dropdown.tsx
|
|
3649
3956
|
import {
|
|
3650
|
-
useEffect as
|
|
3957
|
+
useEffect as useEffect7,
|
|
3651
3958
|
useId as useId4,
|
|
3652
|
-
useMemo as
|
|
3653
|
-
useRef as
|
|
3959
|
+
useMemo as useMemo8,
|
|
3960
|
+
useRef as useRef8,
|
|
3654
3961
|
useState as useState12
|
|
3655
3962
|
} from "react";
|
|
3656
3963
|
import { createPortal } from "react-dom";
|
|
3657
3964
|
|
|
3658
3965
|
// src/components/_shared/ControlOpener.tsx
|
|
3659
|
-
import { jsx as
|
|
3966
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3660
3967
|
function ControlOpener(props) {
|
|
3661
3968
|
const { children, className, glyphClassName, glyphStyle, style } = props;
|
|
3662
3969
|
if (props.as === "button") {
|
|
3663
3970
|
const { as: _as2, type = "button", ...buttonProps } = props;
|
|
3664
3971
|
void _as2;
|
|
3665
|
-
return /* @__PURE__ */
|
|
3972
|
+
return /* @__PURE__ */ jsx31(
|
|
3666
3973
|
"button",
|
|
3667
3974
|
{
|
|
3668
3975
|
...buttonProps,
|
|
3669
3976
|
className: cx("nu-control-opener", className),
|
|
3670
3977
|
style,
|
|
3671
3978
|
type,
|
|
3672
|
-
children: children ?? /* @__PURE__ */
|
|
3979
|
+
children: children ?? /* @__PURE__ */ jsx31(
|
|
3673
3980
|
NuGlyph,
|
|
3674
3981
|
{
|
|
3675
3982
|
className: cx("nu-control-opener__glyph", glyphClassName),
|
|
@@ -3682,14 +3989,14 @@ function ControlOpener(props) {
|
|
|
3682
3989
|
}
|
|
3683
3990
|
const { ariaHidden = false, as: _as, ...spanProps } = props;
|
|
3684
3991
|
void _as;
|
|
3685
|
-
return /* @__PURE__ */
|
|
3992
|
+
return /* @__PURE__ */ jsx31(
|
|
3686
3993
|
"span",
|
|
3687
3994
|
{
|
|
3688
3995
|
...spanProps,
|
|
3689
3996
|
"aria-hidden": ariaHidden,
|
|
3690
3997
|
className: cx("nu-control-opener", className),
|
|
3691
3998
|
style,
|
|
3692
|
-
children: children ?? /* @__PURE__ */
|
|
3999
|
+
children: children ?? /* @__PURE__ */ jsx31(
|
|
3693
4000
|
NuGlyph,
|
|
3694
4001
|
{
|
|
3695
4002
|
className: cx("nu-control-opener__glyph", glyphClassName),
|
|
@@ -3805,7 +4112,7 @@ function usePopupPosition({
|
|
|
3805
4112
|
}
|
|
3806
4113
|
|
|
3807
4114
|
// src/components/Dropdown/Dropdown.tsx
|
|
3808
|
-
import { jsx as
|
|
4115
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3809
4116
|
function flattenDropdownOptions(data) {
|
|
3810
4117
|
const options = [];
|
|
3811
4118
|
data.forEach((group) => {
|
|
@@ -3854,13 +4161,13 @@ function Dropdown({
|
|
|
3854
4161
|
style,
|
|
3855
4162
|
...props
|
|
3856
4163
|
}) {
|
|
3857
|
-
const rootRef =
|
|
3858
|
-
const triggerRef =
|
|
3859
|
-
const fieldRef =
|
|
3860
|
-
const popupRef =
|
|
3861
|
-
const popupListRef =
|
|
4164
|
+
const rootRef = useRef8(null);
|
|
4165
|
+
const triggerRef = useRef8(null);
|
|
4166
|
+
const fieldRef = useRef8(null);
|
|
4167
|
+
const popupRef = useRef8(null);
|
|
4168
|
+
const popupListRef = useRef8(null);
|
|
3862
4169
|
const [open, setOpen] = useState12(false);
|
|
3863
|
-
const options =
|
|
4170
|
+
const options = useMemo8(() => flattenDropdownOptions(data), [data]);
|
|
3864
4171
|
const generatedId = useId4();
|
|
3865
4172
|
const fieldId = `${generatedId}-dropdown`;
|
|
3866
4173
|
const labelId = `${fieldId}-label`;
|
|
@@ -3868,16 +4175,16 @@ function Dropdown({
|
|
|
3868
4175
|
const isControlled = value !== void 0;
|
|
3869
4176
|
const [uncontrolledValue, setUncontrolledValue] = useState12(() => getInitialValue(options, defaultValue));
|
|
3870
4177
|
const resolvedValue = isControlled ? value : uncontrolledValue;
|
|
3871
|
-
const selectedOption =
|
|
4178
|
+
const selectedOption = useMemo8(
|
|
3872
4179
|
() => findSelectedOption(options, resolvedValue),
|
|
3873
4180
|
[options, resolvedValue]
|
|
3874
4181
|
);
|
|
3875
|
-
const selectableOptions =
|
|
4182
|
+
const selectableOptions = useMemo8(
|
|
3876
4183
|
() => options.filter((option) => !option.item.disabled),
|
|
3877
4184
|
[options]
|
|
3878
4185
|
);
|
|
3879
4186
|
const displayText = selectedOption?.item.name.text ?? placeholder;
|
|
3880
|
-
|
|
4187
|
+
useEffect7(() => {
|
|
3881
4188
|
if (!open) {
|
|
3882
4189
|
return;
|
|
3883
4190
|
}
|
|
@@ -3905,7 +4212,7 @@ function Dropdown({
|
|
|
3905
4212
|
open,
|
|
3906
4213
|
popupRef
|
|
3907
4214
|
});
|
|
3908
|
-
|
|
4215
|
+
useEffect7(() => {
|
|
3909
4216
|
if (!open) {
|
|
3910
4217
|
return;
|
|
3911
4218
|
}
|
|
@@ -3971,7 +4278,7 @@ function Dropdown({
|
|
|
3971
4278
|
break;
|
|
3972
4279
|
}
|
|
3973
4280
|
}
|
|
3974
|
-
return /* @__PURE__ */
|
|
4281
|
+
return /* @__PURE__ */ jsxs19(
|
|
3975
4282
|
"div",
|
|
3976
4283
|
{
|
|
3977
4284
|
...props,
|
|
@@ -3979,7 +4286,7 @@ function Dropdown({
|
|
|
3979
4286
|
ref: rootRef,
|
|
3980
4287
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
3981
4288
|
children: [
|
|
3982
|
-
/* @__PURE__ */
|
|
4289
|
+
/* @__PURE__ */ jsx32(
|
|
3983
4290
|
"span",
|
|
3984
4291
|
{
|
|
3985
4292
|
className: cx("nu-dropdown__label", slotClassNames?.label),
|
|
@@ -3988,7 +4295,7 @@ function Dropdown({
|
|
|
3988
4295
|
children: renderMnemonicText(label)
|
|
3989
4296
|
}
|
|
3990
4297
|
),
|
|
3991
|
-
/* @__PURE__ */
|
|
4298
|
+
/* @__PURE__ */ jsx32(
|
|
3992
4299
|
"button",
|
|
3993
4300
|
{
|
|
3994
4301
|
"aria-describedby": hintId,
|
|
@@ -4006,20 +4313,20 @@ function Dropdown({
|
|
|
4006
4313
|
},
|
|
4007
4314
|
style: slotStyles?.trigger,
|
|
4008
4315
|
type: "button",
|
|
4009
|
-
children: /* @__PURE__ */
|
|
4316
|
+
children: /* @__PURE__ */ jsxs19(
|
|
4010
4317
|
"span",
|
|
4011
4318
|
{
|
|
4012
4319
|
className: cx("nu-dropdown__slot", slotClassNames?.slot),
|
|
4013
4320
|
style: slotStyles?.slot,
|
|
4014
4321
|
children: [
|
|
4015
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ jsxs19(
|
|
4016
4323
|
"span",
|
|
4017
4324
|
{
|
|
4018
4325
|
className: cx("nu-dropdown__field", slotClassNames?.field),
|
|
4019
4326
|
ref: fieldRef,
|
|
4020
4327
|
style: slotStyles?.field,
|
|
4021
4328
|
children: [
|
|
4022
|
-
/* @__PURE__ */
|
|
4329
|
+
/* @__PURE__ */ jsx32(
|
|
4023
4330
|
"span",
|
|
4024
4331
|
{
|
|
4025
4332
|
"aria-hidden": "true",
|
|
@@ -4028,7 +4335,7 @@ function Dropdown({
|
|
|
4028
4335
|
children: "["
|
|
4029
4336
|
}
|
|
4030
4337
|
),
|
|
4031
|
-
/* @__PURE__ */
|
|
4338
|
+
/* @__PURE__ */ jsx32(
|
|
4032
4339
|
"span",
|
|
4033
4340
|
{
|
|
4034
4341
|
className: cx(
|
|
@@ -4036,7 +4343,7 @@ function Dropdown({
|
|
|
4036
4343
|
slotClassNames?.valueShell
|
|
4037
4344
|
),
|
|
4038
4345
|
style: slotStyles?.valueShell,
|
|
4039
|
-
children: /* @__PURE__ */
|
|
4346
|
+
children: /* @__PURE__ */ jsx32(
|
|
4040
4347
|
"span",
|
|
4041
4348
|
{
|
|
4042
4349
|
className: cx("nu-dropdown__value", slotClassNames?.value),
|
|
@@ -4046,7 +4353,7 @@ function Dropdown({
|
|
|
4046
4353
|
)
|
|
4047
4354
|
}
|
|
4048
4355
|
),
|
|
4049
|
-
/* @__PURE__ */
|
|
4356
|
+
/* @__PURE__ */ jsx32(
|
|
4050
4357
|
"span",
|
|
4051
4358
|
{
|
|
4052
4359
|
"aria-hidden": "true",
|
|
@@ -4058,7 +4365,7 @@ function Dropdown({
|
|
|
4058
4365
|
]
|
|
4059
4366
|
}
|
|
4060
4367
|
),
|
|
4061
|
-
/* @__PURE__ */
|
|
4368
|
+
/* @__PURE__ */ jsx32(
|
|
4062
4369
|
ControlOpener,
|
|
4063
4370
|
{
|
|
4064
4371
|
ariaHidden: true,
|
|
@@ -4069,7 +4376,7 @@ function Dropdown({
|
|
|
4069
4376
|
slotClassNames?.arrowShell
|
|
4070
4377
|
),
|
|
4071
4378
|
style: slotStyles?.arrowShell,
|
|
4072
|
-
children: /* @__PURE__ */
|
|
4379
|
+
children: /* @__PURE__ */ jsx32(
|
|
4073
4380
|
NuGlyph,
|
|
4074
4381
|
{
|
|
4075
4382
|
className: cx(
|
|
@@ -4088,7 +4395,7 @@ function Dropdown({
|
|
|
4088
4395
|
)
|
|
4089
4396
|
}
|
|
4090
4397
|
),
|
|
4091
|
-
hint ? /* @__PURE__ */
|
|
4398
|
+
hint ? /* @__PURE__ */ jsx32(
|
|
4092
4399
|
"span",
|
|
4093
4400
|
{
|
|
4094
4401
|
className: cx("nu-dropdown__hint", slotClassNames?.hint),
|
|
@@ -4098,7 +4405,7 @@ function Dropdown({
|
|
|
4098
4405
|
}
|
|
4099
4406
|
) : null,
|
|
4100
4407
|
open && typeof document !== "undefined" ? createPortal(
|
|
4101
|
-
/* @__PURE__ */
|
|
4408
|
+
/* @__PURE__ */ jsx32(
|
|
4102
4409
|
"div",
|
|
4103
4410
|
{
|
|
4104
4411
|
className: cx("nu-dropdown__popup", slotClassNames?.popup),
|
|
@@ -4107,7 +4414,7 @@ function Dropdown({
|
|
|
4107
4414
|
{ left: 0, top: 0, visibility: "hidden", width: 0 },
|
|
4108
4415
|
slotStyles?.popup
|
|
4109
4416
|
),
|
|
4110
|
-
children: /* @__PURE__ */
|
|
4417
|
+
children: /* @__PURE__ */ jsx32(
|
|
4111
4418
|
"div",
|
|
4112
4419
|
{
|
|
4113
4420
|
className: cx(
|
|
@@ -4116,7 +4423,7 @@ function Dropdown({
|
|
|
4116
4423
|
),
|
|
4117
4424
|
ref: popupListRef,
|
|
4118
4425
|
style: slotStyles?.popupShell,
|
|
4119
|
-
children: /* @__PURE__ */
|
|
4426
|
+
children: /* @__PURE__ */ jsx32(
|
|
4120
4427
|
ListBox,
|
|
4121
4428
|
{
|
|
4122
4429
|
className: cx(
|
|
@@ -4149,7 +4456,7 @@ function Dropdown({
|
|
|
4149
4456
|
}
|
|
4150
4457
|
|
|
4151
4458
|
// src/components/Frame/Frame.tsx
|
|
4152
|
-
import { jsx as
|
|
4459
|
+
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4153
4460
|
function Frame({
|
|
4154
4461
|
children,
|
|
4155
4462
|
className,
|
|
@@ -4170,7 +4477,7 @@ function Frame({
|
|
|
4170
4477
|
}) {
|
|
4171
4478
|
const resolvedTitleContent = titleContent ?? (title ? renderMnemonicText(title) : null);
|
|
4172
4479
|
const hasTitleShell = Boolean(titleStart || resolvedTitleContent || titleEnd);
|
|
4173
|
-
return /* @__PURE__ */
|
|
4480
|
+
return /* @__PURE__ */ jsxs20(
|
|
4174
4481
|
"section",
|
|
4175
4482
|
{
|
|
4176
4483
|
...props,
|
|
@@ -4187,13 +4494,13 @@ function Frame({
|
|
|
4187
4494
|
...slotStyles?.root
|
|
4188
4495
|
},
|
|
4189
4496
|
children: [
|
|
4190
|
-
hasTitleShell ? /* @__PURE__ */
|
|
4497
|
+
hasTitleShell ? /* @__PURE__ */ jsxs20(
|
|
4191
4498
|
"span",
|
|
4192
4499
|
{
|
|
4193
4500
|
className: cx("nu-frame__title", slotClassNames?.title),
|
|
4194
4501
|
style: mergeSlotStyle(titleStyle, slotStyles?.title),
|
|
4195
4502
|
children: [
|
|
4196
|
-
titleStart ? /* @__PURE__ */
|
|
4503
|
+
titleStart ? /* @__PURE__ */ jsx33(
|
|
4197
4504
|
"span",
|
|
4198
4505
|
{
|
|
4199
4506
|
className: cx(
|
|
@@ -4204,7 +4511,7 @@ function Frame({
|
|
|
4204
4511
|
children: titleStart
|
|
4205
4512
|
}
|
|
4206
4513
|
) : null,
|
|
4207
|
-
resolvedTitleContent ? /* @__PURE__ */
|
|
4514
|
+
resolvedTitleContent ? /* @__PURE__ */ jsx33(
|
|
4208
4515
|
"span",
|
|
4209
4516
|
{
|
|
4210
4517
|
className: cx(
|
|
@@ -4215,7 +4522,7 @@ function Frame({
|
|
|
4215
4522
|
children: resolvedTitleContent
|
|
4216
4523
|
}
|
|
4217
4524
|
) : null,
|
|
4218
|
-
titleEnd ? /* @__PURE__ */
|
|
4525
|
+
titleEnd ? /* @__PURE__ */ jsx33(
|
|
4219
4526
|
"span",
|
|
4220
4527
|
{
|
|
4221
4528
|
className: cx("nu-frame__title-end", slotClassNames?.titleEnd),
|
|
@@ -4226,7 +4533,7 @@ function Frame({
|
|
|
4226
4533
|
]
|
|
4227
4534
|
}
|
|
4228
4535
|
) : null,
|
|
4229
|
-
/* @__PURE__ */
|
|
4536
|
+
/* @__PURE__ */ jsx33(
|
|
4230
4537
|
"div",
|
|
4231
4538
|
{
|
|
4232
4539
|
className: cx("nu-frame__body", slotClassNames?.body),
|
|
@@ -4240,7 +4547,7 @@ function Frame({
|
|
|
4240
4547
|
}
|
|
4241
4548
|
|
|
4242
4549
|
// src/components/Info/Info.tsx
|
|
4243
|
-
import { jsx as
|
|
4550
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4244
4551
|
function Info({
|
|
4245
4552
|
accentColor,
|
|
4246
4553
|
children,
|
|
@@ -4249,7 +4556,7 @@ function Info({
|
|
|
4249
4556
|
style,
|
|
4250
4557
|
...props
|
|
4251
4558
|
}) {
|
|
4252
|
-
return /* @__PURE__ */
|
|
4559
|
+
return /* @__PURE__ */ jsx34(
|
|
4253
4560
|
"div",
|
|
4254
4561
|
{
|
|
4255
4562
|
...props,
|
|
@@ -4273,7 +4580,7 @@ function InfoAccent({
|
|
|
4273
4580
|
upper = false,
|
|
4274
4581
|
...props
|
|
4275
4582
|
}) {
|
|
4276
|
-
return /* @__PURE__ */
|
|
4583
|
+
return /* @__PURE__ */ jsx34(
|
|
4277
4584
|
"span",
|
|
4278
4585
|
{
|
|
4279
4586
|
...props,
|
|
@@ -4290,48 +4597,22 @@ function InfoAccent({
|
|
|
4290
4597
|
|
|
4291
4598
|
// src/components/IconGrid/NuIconGrid.tsx
|
|
4292
4599
|
import {
|
|
4293
|
-
useEffect as useEffect8,
|
|
4294
4600
|
useLayoutEffect as useLayoutEffect4,
|
|
4295
|
-
useMemo as
|
|
4296
|
-
useRef as
|
|
4601
|
+
useMemo as useMemo9,
|
|
4602
|
+
useRef as useRef10,
|
|
4297
4603
|
useState as useState15
|
|
4298
4604
|
} from "react";
|
|
4299
4605
|
|
|
4300
4606
|
// src/components/PopupMenu/PopupMenu.tsx
|
|
4301
4607
|
import {
|
|
4302
4608
|
useCallback as useCallback4,
|
|
4303
|
-
useEffect as
|
|
4609
|
+
useEffect as useEffect8,
|
|
4304
4610
|
useLayoutEffect as useLayoutEffect3,
|
|
4305
|
-
useRef as
|
|
4611
|
+
useRef as useRef9,
|
|
4306
4612
|
useState as useState13
|
|
4307
4613
|
} from "react";
|
|
4308
4614
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4309
|
-
|
|
4310
|
-
// src/components/_shared/themePortal.ts
|
|
4311
|
-
function getThemePortalStyle(anchor) {
|
|
4312
|
-
if (typeof window === "undefined") {
|
|
4313
|
-
return void 0;
|
|
4314
|
-
}
|
|
4315
|
-
const themeRoot = anchor?.closest(".nu-theme-root");
|
|
4316
|
-
if (!themeRoot) {
|
|
4317
|
-
return void 0;
|
|
4318
|
-
}
|
|
4319
|
-
const computed = window.getComputedStyle(themeRoot);
|
|
4320
|
-
const style = {
|
|
4321
|
-
color: computed.color,
|
|
4322
|
-
fontFamily: computed.fontFamily,
|
|
4323
|
-
fontSize: computed.fontSize
|
|
4324
|
-
};
|
|
4325
|
-
for (const propertyName of computed) {
|
|
4326
|
-
if (propertyName.startsWith("--nu-")) {
|
|
4327
|
-
style[propertyName] = computed.getPropertyValue(propertyName).trim();
|
|
4328
|
-
}
|
|
4329
|
-
}
|
|
4330
|
-
return style;
|
|
4331
|
-
}
|
|
4332
|
-
|
|
4333
|
-
// src/components/PopupMenu/PopupMenu.tsx
|
|
4334
|
-
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4615
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4335
4616
|
function hasVisibleChildren2(item) {
|
|
4336
4617
|
return Boolean(item.items?.some((child) => !child.hidden));
|
|
4337
4618
|
}
|
|
@@ -4372,7 +4653,7 @@ function PopupMenu({
|
|
|
4372
4653
|
uncheckedShape = "box",
|
|
4373
4654
|
...props
|
|
4374
4655
|
}) {
|
|
4375
|
-
const rootRef =
|
|
4656
|
+
const rootRef = useRef9(null);
|
|
4376
4657
|
const [activePath, setActivePath] = useState13([]);
|
|
4377
4658
|
const [uncontrolledOpen, setUncontrolledOpen] = useState13(defaultOpen);
|
|
4378
4659
|
const isControlled = open !== void 0;
|
|
@@ -4390,7 +4671,7 @@ function PopupMenu({
|
|
|
4390
4671
|
},
|
|
4391
4672
|
[isControlled, onOpenChange]
|
|
4392
4673
|
);
|
|
4393
|
-
|
|
4674
|
+
useEffect8(() => {
|
|
4394
4675
|
if (!resolvedOpen) {
|
|
4395
4676
|
return;
|
|
4396
4677
|
}
|
|
@@ -4465,7 +4746,7 @@ function PopupMenu({
|
|
|
4465
4746
|
return null;
|
|
4466
4747
|
}
|
|
4467
4748
|
return createPortal2(
|
|
4468
|
-
/* @__PURE__ */
|
|
4749
|
+
/* @__PURE__ */ jsx35(
|
|
4469
4750
|
"div",
|
|
4470
4751
|
{
|
|
4471
4752
|
...props,
|
|
@@ -4481,7 +4762,7 @@ function PopupMenu({
|
|
|
4481
4762
|
top: 0,
|
|
4482
4763
|
visibility: "hidden"
|
|
4483
4764
|
},
|
|
4484
|
-
children: /* @__PURE__ */
|
|
4765
|
+
children: /* @__PURE__ */ jsx35("div", { className: "nu-popup-menu__shell", children: /* @__PURE__ */ jsx35(
|
|
4485
4766
|
MainMenuList,
|
|
4486
4767
|
{
|
|
4487
4768
|
activePath,
|
|
@@ -4543,10 +4824,10 @@ function usePopupMenu() {
|
|
|
4543
4824
|
}
|
|
4544
4825
|
|
|
4545
4826
|
// src/components/IconGrid/iconContext.ts
|
|
4546
|
-
import { createContext as
|
|
4547
|
-
var NuIconContext =
|
|
4827
|
+
import { createContext as createContext5, useContext as useContext9 } from "react";
|
|
4828
|
+
var NuIconContext = createContext5(null);
|
|
4548
4829
|
function useNuIconContext() {
|
|
4549
|
-
const context =
|
|
4830
|
+
const context = useContext9(NuIconContext);
|
|
4550
4831
|
if (!context) {
|
|
4551
4832
|
throw new Error("useNuIconManager must be used within a NuIconProvider.");
|
|
4552
4833
|
}
|
|
@@ -4560,8 +4841,8 @@ function useNuIconGridContext() {
|
|
|
4560
4841
|
}
|
|
4561
4842
|
|
|
4562
4843
|
// src/components/IconGrid/NuIconGrid.tsx
|
|
4563
|
-
import { Fragment as Fragment5, jsx as
|
|
4564
|
-
var
|
|
4844
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4845
|
+
var DRAG_THRESHOLD2 = 3;
|
|
4565
4846
|
var gridRegistrations = /* @__PURE__ */ new Map();
|
|
4566
4847
|
function clamp2(value, minimum, maximum) {
|
|
4567
4848
|
return Math.min(Math.max(value, minimum), maximum);
|
|
@@ -4609,60 +4890,24 @@ function getTransferredPosition(targetGrid, iconElement, clientX, clientY) {
|
|
|
4609
4890
|
)
|
|
4610
4891
|
};
|
|
4611
4892
|
}
|
|
4612
|
-
function createDragPreview(iconElement) {
|
|
4613
|
-
const rect = iconElement.getBoundingClientRect();
|
|
4614
|
-
const preview = iconElement.cloneNode(true);
|
|
4615
|
-
preview.removeAttribute("id");
|
|
4616
|
-
preview.setAttribute("aria-hidden", "true");
|
|
4617
|
-
preview.setAttribute("disabled", "");
|
|
4618
|
-
preview.setAttribute("tabindex", "-1");
|
|
4619
|
-
Object.assign(preview.style, {
|
|
4620
|
-
height: `${rect.height}px`,
|
|
4621
|
-
left: `${rect.left}px`,
|
|
4622
|
-
margin: "0",
|
|
4623
|
-
opacity: window.getComputedStyle(iconElement).getPropertyValue("--nu-icon-grid-icon-drag-preview-opacity").trim() || "0.85",
|
|
4624
|
-
pointerEvents: "none",
|
|
4625
|
-
position: "fixed",
|
|
4626
|
-
top: `${rect.top}px`,
|
|
4627
|
-
width: `${rect.width}px`,
|
|
4628
|
-
zIndex: "2147483647"
|
|
4629
|
-
});
|
|
4630
|
-
const themeStyle = getThemePortalStyle(iconElement);
|
|
4631
|
-
Object.entries(themeStyle ?? {}).forEach(([property, value]) => {
|
|
4632
|
-
if (value !== void 0) {
|
|
4633
|
-
preview.style.setProperty(property, String(value));
|
|
4634
|
-
}
|
|
4635
|
-
});
|
|
4636
|
-
document.body.append(preview);
|
|
4637
|
-
return preview;
|
|
4638
|
-
}
|
|
4639
|
-
function moveDragPreview(preview, iconElement, clientX, clientY) {
|
|
4640
|
-
const rect = iconElement.getBoundingClientRect();
|
|
4641
|
-
preview.style.left = `${Math.round(clientX - rect.width / 2)}px`;
|
|
4642
|
-
preview.style.top = `${Math.round(clientY - rect.height / 2)}px`;
|
|
4643
|
-
}
|
|
4644
4893
|
function NuIconGridItem({
|
|
4645
4894
|
gridElement,
|
|
4646
4895
|
icon,
|
|
4896
|
+
onDragOut,
|
|
4647
4897
|
onIconMoveOut
|
|
4648
4898
|
}) {
|
|
4649
4899
|
const manager = useNuIconGridContext();
|
|
4900
|
+
const dragDrop = useNuDragDrop();
|
|
4650
4901
|
const contextMenu = usePopupMenu();
|
|
4651
|
-
const dragStartRef =
|
|
4652
|
-
const isDraggingRef =
|
|
4653
|
-
const dragPreviewRef = useRef9(null);
|
|
4902
|
+
const dragStartRef = useRef10(void 0);
|
|
4903
|
+
const isDraggingRef = useRef10(false);
|
|
4654
4904
|
const [isDragging, setIsDragging] = useState15(false);
|
|
4655
|
-
const suppressClickRef =
|
|
4656
|
-
const latestPositionRef =
|
|
4905
|
+
const suppressClickRef = useRef10(false);
|
|
4906
|
+
const latestPositionRef = useRef10(icon.position);
|
|
4657
4907
|
const contextMenuItems = resolveIconContextMenuItems(
|
|
4658
4908
|
icon.contextMenuItems,
|
|
4659
4909
|
icon
|
|
4660
4910
|
);
|
|
4661
|
-
function removeDragPreview() {
|
|
4662
|
-
dragPreviewRef.current?.remove();
|
|
4663
|
-
dragPreviewRef.current = null;
|
|
4664
|
-
}
|
|
4665
|
-
useEffect8(() => removeDragPreview, []);
|
|
4666
4911
|
function handlePointerDown(event) {
|
|
4667
4912
|
if (event.button !== 0 || icon.disabled) {
|
|
4668
4913
|
return;
|
|
@@ -4685,22 +4930,19 @@ function NuIconGridItem({
|
|
|
4685
4930
|
}
|
|
4686
4931
|
const deltaX = event.clientX - dragStart.clientX;
|
|
4687
4932
|
const deltaY = event.clientY - dragStart.clientY;
|
|
4688
|
-
if (!isDraggingRef.current && Math.max(Math.abs(deltaX), Math.abs(deltaY)) <
|
|
4933
|
+
if (!isDraggingRef.current && Math.max(Math.abs(deltaX), Math.abs(deltaY)) < DRAG_THRESHOLD2) {
|
|
4689
4934
|
return;
|
|
4690
4935
|
}
|
|
4691
4936
|
if (!isDraggingRef.current) {
|
|
4692
4937
|
isDraggingRef.current = true;
|
|
4693
4938
|
setIsDragging(true);
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
if (dragPreviewRef.current) {
|
|
4697
|
-
moveDragPreview(
|
|
4698
|
-
dragPreviewRef.current,
|
|
4939
|
+
dragDrop.beginDrag(
|
|
4940
|
+
{ data: icon, id: icon.id, type: "icon" },
|
|
4699
4941
|
event.currentTarget,
|
|
4700
|
-
|
|
4701
|
-
event.clientY
|
|
4942
|
+
"icon-grid"
|
|
4702
4943
|
);
|
|
4703
4944
|
}
|
|
4945
|
+
dragDrop.moveDrag(event.clientX, event.clientY);
|
|
4704
4946
|
const gridRect = gridElement.getBoundingClientRect();
|
|
4705
4947
|
const iconRect = event.currentTarget.getBoundingClientRect();
|
|
4706
4948
|
const position = {
|
|
@@ -4730,7 +4972,6 @@ function NuIconGridItem({
|
|
|
4730
4972
|
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
4731
4973
|
}
|
|
4732
4974
|
dragStartRef.current = void 0;
|
|
4733
|
-
removeDragPreview();
|
|
4734
4975
|
if (!isDraggingRef.current) {
|
|
4735
4976
|
return;
|
|
4736
4977
|
}
|
|
@@ -4738,6 +4979,12 @@ function NuIconGridItem({
|
|
|
4738
4979
|
isDraggingRef.current = false;
|
|
4739
4980
|
setIsDragging(false);
|
|
4740
4981
|
if (event.type === "pointercancel" || !gridElement) {
|
|
4982
|
+
dragDrop.cancelDrag();
|
|
4983
|
+
return;
|
|
4984
|
+
}
|
|
4985
|
+
if (dragDrop.dropAt(event.clientX, event.clientY)) {
|
|
4986
|
+
manager.removeIcon(icon.id);
|
|
4987
|
+
onDragOut?.({ data: icon, id: icon.id, type: "icon" });
|
|
4741
4988
|
return;
|
|
4742
4989
|
}
|
|
4743
4990
|
const targetRegistration = findGridRegistrationAtPoint(
|
|
@@ -4808,8 +5055,8 @@ function NuIconGridItem({
|
|
|
4808
5055
|
manager.selectIcon(icon.id);
|
|
4809
5056
|
contextMenu.openAtElement(event.currentTarget);
|
|
4810
5057
|
}
|
|
4811
|
-
return /* @__PURE__ */
|
|
4812
|
-
/* @__PURE__ */
|
|
5058
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
5059
|
+
/* @__PURE__ */ jsxs21(
|
|
4813
5060
|
"button",
|
|
4814
5061
|
{
|
|
4815
5062
|
"aria-haspopup": contextMenuItems.length > 0 ? "menu" : void 0,
|
|
@@ -4828,12 +5075,12 @@ function NuIconGridItem({
|
|
|
4828
5075
|
style: { left: icon.position.x, top: icon.position.y },
|
|
4829
5076
|
type: "button",
|
|
4830
5077
|
children: [
|
|
4831
|
-
/* @__PURE__ */
|
|
4832
|
-
/* @__PURE__ */
|
|
5078
|
+
/* @__PURE__ */ jsx36("span", { "aria-hidden": "true", className: "nu-icon-grid__glyph", children: typeof icon.icon === "string" ? /* @__PURE__ */ jsx36("img", { alt: "", draggable: false, src: icon.icon }) : icon.icon }),
|
|
5079
|
+
/* @__PURE__ */ jsx36("span", { className: "nu-icon-grid__label", children: renderMnemonicText(icon.label) })
|
|
4833
5080
|
]
|
|
4834
5081
|
}
|
|
4835
5082
|
),
|
|
4836
|
-
/* @__PURE__ */
|
|
5083
|
+
/* @__PURE__ */ jsx36(
|
|
4837
5084
|
PopupMenu,
|
|
4838
5085
|
{
|
|
4839
5086
|
anchor: contextMenu.anchor,
|
|
@@ -4846,26 +5093,38 @@ function NuIconGridItem({
|
|
|
4846
5093
|
}
|
|
4847
5094
|
function NuIconGrid({
|
|
4848
5095
|
accepts,
|
|
5096
|
+
acceptsDrop,
|
|
4849
5097
|
className,
|
|
4850
5098
|
contextMenuItems: contextMenuItemsSource,
|
|
4851
5099
|
defaultArrangeMode,
|
|
4852
5100
|
dropTarget = false,
|
|
5101
|
+
onDragOut,
|
|
4853
5102
|
onIconDrop,
|
|
4854
5103
|
onIconMoveOut,
|
|
5104
|
+
onDrop,
|
|
4855
5105
|
onContextMenu,
|
|
4856
5106
|
onPointerDown,
|
|
4857
5107
|
...props
|
|
4858
5108
|
}) {
|
|
4859
5109
|
const [gridElement, setGridElement] = useState15(null);
|
|
4860
5110
|
const manager = useNuIconGridContext();
|
|
4861
|
-
const hasAppliedDefaultArrangementRef =
|
|
5111
|
+
const hasAppliedDefaultArrangementRef = useRef10(false);
|
|
4862
5112
|
const arrangeIcons = manager.arrangeIcons;
|
|
4863
5113
|
const setGridSize = manager.setGridSize;
|
|
4864
5114
|
const contextMenu = usePopupMenu();
|
|
4865
|
-
const contextMenuItems =
|
|
5115
|
+
const contextMenuItems = useMemo9(
|
|
4866
5116
|
() => resolveGridContextMenuItems(contextMenuItemsSource, manager),
|
|
4867
5117
|
[contextMenuItemsSource, manager]
|
|
4868
5118
|
);
|
|
5119
|
+
const sharedDropTargetOptions = useMemo9(
|
|
5120
|
+
() => onDrop ? {
|
|
5121
|
+
accepts: (item) => item.type !== "icon" && acceptsDrop?.(item) !== false,
|
|
5122
|
+
onDrop,
|
|
5123
|
+
type: "icon-grid"
|
|
5124
|
+
} : void 0,
|
|
5125
|
+
[acceptsDrop, onDrop]
|
|
5126
|
+
);
|
|
5127
|
+
useNuDropTarget(gridElement, sharedDropTargetOptions);
|
|
4869
5128
|
useLayoutEffect4(() => {
|
|
4870
5129
|
if (!gridElement) {
|
|
4871
5130
|
return;
|
|
@@ -4911,7 +5170,7 @@ function NuIconGrid({
|
|
|
4911
5170
|
manager.selectIcon(null);
|
|
4912
5171
|
contextMenu.openAtPoint(event.clientX, event.clientY, event.currentTarget);
|
|
4913
5172
|
}
|
|
4914
|
-
return /* @__PURE__ */
|
|
5173
|
+
return /* @__PURE__ */ jsxs21(
|
|
4915
5174
|
"div",
|
|
4916
5175
|
{
|
|
4917
5176
|
...props,
|
|
@@ -4930,16 +5189,17 @@ function NuIconGrid({
|
|
|
4930
5189
|
ref: setGridElement,
|
|
4931
5190
|
role: "group",
|
|
4932
5191
|
children: [
|
|
4933
|
-
manager.icons.map((icon) => /* @__PURE__ */
|
|
5192
|
+
manager.icons.map((icon) => /* @__PURE__ */ jsx36(
|
|
4934
5193
|
NuIconGridItem,
|
|
4935
5194
|
{
|
|
4936
5195
|
gridElement,
|
|
4937
5196
|
icon,
|
|
5197
|
+
onDragOut,
|
|
4938
5198
|
onIconMoveOut
|
|
4939
5199
|
},
|
|
4940
5200
|
icon.id
|
|
4941
5201
|
)),
|
|
4942
|
-
/* @__PURE__ */
|
|
5202
|
+
/* @__PURE__ */ jsx36(
|
|
4943
5203
|
PopupMenu,
|
|
4944
5204
|
{
|
|
4945
5205
|
anchor: contextMenu.anchor,
|
|
@@ -4956,11 +5216,11 @@ function NuIconGrid({
|
|
|
4956
5216
|
// src/components/IconGrid/NuIconProvider.tsx
|
|
4957
5217
|
import {
|
|
4958
5218
|
useCallback as useCallback5,
|
|
4959
|
-
useMemo as
|
|
4960
|
-
useRef as
|
|
5219
|
+
useMemo as useMemo10,
|
|
5220
|
+
useRef as useRef11,
|
|
4961
5221
|
useState as useState16
|
|
4962
5222
|
} from "react";
|
|
4963
|
-
import { jsx as
|
|
5223
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4964
5224
|
var GRID_PADDING = 12;
|
|
4965
5225
|
var ICON_CELL_HEIGHT = 104;
|
|
4966
5226
|
var ICON_CELL_WIDTH = 104;
|
|
@@ -5025,8 +5285,8 @@ function NuIconProvider({
|
|
|
5025
5285
|
children,
|
|
5026
5286
|
defaultIcons = []
|
|
5027
5287
|
}) {
|
|
5028
|
-
const idRef =
|
|
5029
|
-
const gridSizeRef =
|
|
5288
|
+
const idRef = useRef11(defaultIcons.length);
|
|
5289
|
+
const gridSizeRef = useRef11({ height: 0, width: 0 });
|
|
5030
5290
|
const [icons, setIcons] = useState16(
|
|
5031
5291
|
() => getInitialIcons(defaultIcons)
|
|
5032
5292
|
);
|
|
@@ -5085,7 +5345,7 @@ function NuIconProvider({
|
|
|
5085
5345
|
const setGridSize = useCallback5((size) => {
|
|
5086
5346
|
gridSizeRef.current = size;
|
|
5087
5347
|
}, []);
|
|
5088
|
-
const contextValue =
|
|
5348
|
+
const contextValue = useMemo10(
|
|
5089
5349
|
() => ({
|
|
5090
5350
|
addIcon,
|
|
5091
5351
|
arrangeIcons,
|
|
@@ -5108,19 +5368,19 @@ function NuIconProvider({
|
|
|
5108
5368
|
updateIcon
|
|
5109
5369
|
]
|
|
5110
5370
|
);
|
|
5111
|
-
return /* @__PURE__ */
|
|
5371
|
+
return /* @__PURE__ */ jsx37(NuIconContext.Provider, { value: contextValue, children });
|
|
5112
5372
|
}
|
|
5113
5373
|
|
|
5114
5374
|
// src/components/ComboBox/ComboBox.tsx
|
|
5115
5375
|
import {
|
|
5116
5376
|
useEffect as useEffect9,
|
|
5117
5377
|
useId as useId5,
|
|
5118
|
-
useMemo as
|
|
5119
|
-
useRef as
|
|
5378
|
+
useMemo as useMemo11,
|
|
5379
|
+
useRef as useRef12,
|
|
5120
5380
|
useState as useState17
|
|
5121
5381
|
} from "react";
|
|
5122
5382
|
import { createPortal as createPortal3 } from "react-dom";
|
|
5123
|
-
import { jsx as
|
|
5383
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5124
5384
|
function flattenComboBoxOptions(data) {
|
|
5125
5385
|
const options = [];
|
|
5126
5386
|
data.forEach((group) => {
|
|
@@ -5161,16 +5421,16 @@ function ComboBox({
|
|
|
5161
5421
|
value,
|
|
5162
5422
|
...props
|
|
5163
5423
|
}) {
|
|
5164
|
-
const rootRef =
|
|
5165
|
-
const inputRef =
|
|
5166
|
-
const fieldRef =
|
|
5167
|
-
const popupRef =
|
|
5424
|
+
const rootRef = useRef12(null);
|
|
5425
|
+
const inputRef = useRef12(null);
|
|
5426
|
+
const fieldRef = useRef12(null);
|
|
5427
|
+
const popupRef = useRef12(null);
|
|
5168
5428
|
const generatedId = useId5();
|
|
5169
5429
|
const fieldId = `${generatedId}-combo-box`;
|
|
5170
5430
|
const labelId = `${fieldId}-label`;
|
|
5171
5431
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
5172
5432
|
const [open, setOpen] = useState17(false);
|
|
5173
|
-
const options =
|
|
5433
|
+
const options = useMemo11(() => flattenComboBoxOptions(data), [data]);
|
|
5174
5434
|
const isValueControlled = value !== void 0;
|
|
5175
5435
|
const isInputControlled = inputValueProp !== void 0;
|
|
5176
5436
|
const [uncontrolledValue, setUncontrolledValue] = useState17(() => defaultValue);
|
|
@@ -5179,13 +5439,13 @@ function ComboBox({
|
|
|
5179
5439
|
() => defaultInputValue ?? initialSelectedOption?.item.name.text ?? ""
|
|
5180
5440
|
);
|
|
5181
5441
|
const resolvedValue = isValueControlled ? value : uncontrolledValue;
|
|
5182
|
-
const selectedOption =
|
|
5442
|
+
const selectedOption = useMemo11(
|
|
5183
5443
|
() => findComboBoxOption(options, resolvedValue),
|
|
5184
5444
|
[options, resolvedValue]
|
|
5185
5445
|
);
|
|
5186
5446
|
const resolvedInputValue = isInputControlled ? inputValueProp ?? "" : uncontrolledInputValue;
|
|
5187
5447
|
const normalizedFilter = resolvedInputValue.trim().toLowerCase();
|
|
5188
|
-
const filteredData =
|
|
5448
|
+
const filteredData = useMemo11(() => {
|
|
5189
5449
|
if (!normalizedFilter) {
|
|
5190
5450
|
return data;
|
|
5191
5451
|
}
|
|
@@ -5196,7 +5456,7 @@ function ComboBox({
|
|
|
5196
5456
|
)
|
|
5197
5457
|
})).filter((group) => group.items.length > 0);
|
|
5198
5458
|
}, [data, normalizedFilter]);
|
|
5199
|
-
const filteredOptions =
|
|
5459
|
+
const filteredOptions = useMemo11(
|
|
5200
5460
|
() => flattenComboBoxOptions(filteredData).filter(
|
|
5201
5461
|
(option) => !option.item.disabled
|
|
5202
5462
|
),
|
|
@@ -5280,7 +5540,7 @@ function ComboBox({
|
|
|
5280
5540
|
break;
|
|
5281
5541
|
}
|
|
5282
5542
|
}
|
|
5283
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ jsxs22(
|
|
5284
5544
|
"div",
|
|
5285
5545
|
{
|
|
5286
5546
|
...props,
|
|
@@ -5288,7 +5548,7 @@ function ComboBox({
|
|
|
5288
5548
|
ref: rootRef,
|
|
5289
5549
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
5290
5550
|
children: [
|
|
5291
|
-
/* @__PURE__ */
|
|
5551
|
+
/* @__PURE__ */ jsx38(
|
|
5292
5552
|
"label",
|
|
5293
5553
|
{
|
|
5294
5554
|
className: cx("nu-combo-box__label", slotClassNames?.label),
|
|
@@ -5298,20 +5558,20 @@ function ComboBox({
|
|
|
5298
5558
|
children: renderMnemonicText(label)
|
|
5299
5559
|
}
|
|
5300
5560
|
),
|
|
5301
|
-
/* @__PURE__ */
|
|
5561
|
+
/* @__PURE__ */ jsxs22(
|
|
5302
5562
|
"span",
|
|
5303
5563
|
{
|
|
5304
5564
|
className: cx("nu-combo-box__slot", slotClassNames?.slot),
|
|
5305
5565
|
style: slotStyles?.slot,
|
|
5306
5566
|
children: [
|
|
5307
|
-
/* @__PURE__ */
|
|
5567
|
+
/* @__PURE__ */ jsxs22(
|
|
5308
5568
|
"span",
|
|
5309
5569
|
{
|
|
5310
5570
|
className: cx("nu-combo-box__field", slotClassNames?.field),
|
|
5311
5571
|
ref: fieldRef,
|
|
5312
5572
|
style: slotStyles?.field,
|
|
5313
5573
|
children: [
|
|
5314
|
-
/* @__PURE__ */
|
|
5574
|
+
/* @__PURE__ */ jsx38(
|
|
5315
5575
|
"span",
|
|
5316
5576
|
{
|
|
5317
5577
|
"aria-hidden": "true",
|
|
@@ -5320,7 +5580,7 @@ function ComboBox({
|
|
|
5320
5580
|
children: "["
|
|
5321
5581
|
}
|
|
5322
5582
|
),
|
|
5323
|
-
/* @__PURE__ */
|
|
5583
|
+
/* @__PURE__ */ jsx38(
|
|
5324
5584
|
"span",
|
|
5325
5585
|
{
|
|
5326
5586
|
className: cx(
|
|
@@ -5328,7 +5588,7 @@ function ComboBox({
|
|
|
5328
5588
|
slotClassNames?.inputShell
|
|
5329
5589
|
),
|
|
5330
5590
|
style: slotStyles?.inputShell,
|
|
5331
|
-
children: /* @__PURE__ */
|
|
5591
|
+
children: /* @__PURE__ */ jsx38(
|
|
5332
5592
|
"input",
|
|
5333
5593
|
{
|
|
5334
5594
|
"aria-autocomplete": "list",
|
|
@@ -5355,7 +5615,7 @@ function ComboBox({
|
|
|
5355
5615
|
)
|
|
5356
5616
|
}
|
|
5357
5617
|
),
|
|
5358
|
-
/* @__PURE__ */
|
|
5618
|
+
/* @__PURE__ */ jsx38(
|
|
5359
5619
|
"span",
|
|
5360
5620
|
{
|
|
5361
5621
|
"aria-hidden": "true",
|
|
@@ -5367,7 +5627,7 @@ function ComboBox({
|
|
|
5367
5627
|
]
|
|
5368
5628
|
}
|
|
5369
5629
|
),
|
|
5370
|
-
/* @__PURE__ */
|
|
5630
|
+
/* @__PURE__ */ jsx38(
|
|
5371
5631
|
ControlOpener,
|
|
5372
5632
|
{
|
|
5373
5633
|
"aria-label": open ? "Collapse list" : "Expand list",
|
|
@@ -5385,7 +5645,7 @@ function ComboBox({
|
|
|
5385
5645
|
]
|
|
5386
5646
|
}
|
|
5387
5647
|
),
|
|
5388
|
-
hint ? /* @__PURE__ */
|
|
5648
|
+
hint ? /* @__PURE__ */ jsx38(
|
|
5389
5649
|
"span",
|
|
5390
5650
|
{
|
|
5391
5651
|
className: cx("nu-combo-box__hint", slotClassNames?.hint),
|
|
@@ -5395,7 +5655,7 @@ function ComboBox({
|
|
|
5395
5655
|
}
|
|
5396
5656
|
) : null,
|
|
5397
5657
|
open && popupRoot ? createPortal3(
|
|
5398
|
-
/* @__PURE__ */
|
|
5658
|
+
/* @__PURE__ */ jsx38(
|
|
5399
5659
|
"div",
|
|
5400
5660
|
{
|
|
5401
5661
|
className: cx("nu-combo-box__popup", slotClassNames?.popup),
|
|
@@ -5405,12 +5665,12 @@ function ComboBox({
|
|
|
5405
5665
|
themePortalStyle,
|
|
5406
5666
|
slotStyles?.popup
|
|
5407
5667
|
),
|
|
5408
|
-
children: /* @__PURE__ */
|
|
5668
|
+
children: /* @__PURE__ */ jsx38(
|
|
5409
5669
|
"div",
|
|
5410
5670
|
{
|
|
5411
5671
|
className: cx("nu-combo-box__listbox", slotClassNames?.listbox),
|
|
5412
5672
|
style: slotStyles?.listbox,
|
|
5413
|
-
children: /* @__PURE__ */
|
|
5673
|
+
children: /* @__PURE__ */ jsx38(
|
|
5414
5674
|
ListBox,
|
|
5415
5675
|
{
|
|
5416
5676
|
data: filteredData,
|
|
@@ -5443,7 +5703,7 @@ function ComboBox({
|
|
|
5443
5703
|
import {
|
|
5444
5704
|
Fragment as Fragment6
|
|
5445
5705
|
} from "react";
|
|
5446
|
-
import { jsx as
|
|
5706
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5447
5707
|
var COMMAND_BUTTON_GLYPH_NAMES = /* @__PURE__ */ new Set([
|
|
5448
5708
|
"check-fill",
|
|
5449
5709
|
"check-mark",
|
|
@@ -5484,7 +5744,7 @@ function CommandButton({
|
|
|
5484
5744
|
const hasMenu = menuItems.length > 0;
|
|
5485
5745
|
const showCaret = dropdown || hasMenu;
|
|
5486
5746
|
const resolvedToggled = toggled ?? pressed;
|
|
5487
|
-
const resolvedIcon = typeof icon === "string" && isCommandButtonGlyphName(icon) ? /* @__PURE__ */
|
|
5747
|
+
const resolvedIcon = typeof icon === "string" && isCommandButtonGlyphName(icon) ? /* @__PURE__ */ jsx39(NuGlyph, { name: icon }) : icon ?? null;
|
|
5488
5748
|
function handleClick(event) {
|
|
5489
5749
|
onClick?.(event);
|
|
5490
5750
|
if (event.defaultPrevented || !hasMenu) {
|
|
@@ -5492,8 +5752,8 @@ function CommandButton({
|
|
|
5492
5752
|
}
|
|
5493
5753
|
popupMenu.openFromClick(event);
|
|
5494
5754
|
}
|
|
5495
|
-
return /* @__PURE__ */
|
|
5496
|
-
/* @__PURE__ */
|
|
5755
|
+
return /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
5756
|
+
/* @__PURE__ */ jsxs23(
|
|
5497
5757
|
"button",
|
|
5498
5758
|
{
|
|
5499
5759
|
...props,
|
|
@@ -5509,7 +5769,7 @@ function CommandButton({
|
|
|
5509
5769
|
type,
|
|
5510
5770
|
onClick: handleClick,
|
|
5511
5771
|
children: [
|
|
5512
|
-
resolvedIcon ? /* @__PURE__ */
|
|
5772
|
+
resolvedIcon ? /* @__PURE__ */ jsx39(
|
|
5513
5773
|
"span",
|
|
5514
5774
|
{
|
|
5515
5775
|
className: cx(
|
|
@@ -5521,7 +5781,7 @@ function CommandButton({
|
|
|
5521
5781
|
children: resolvedIcon
|
|
5522
5782
|
}
|
|
5523
5783
|
) : null,
|
|
5524
|
-
children ? /* @__PURE__ */
|
|
5784
|
+
children ? /* @__PURE__ */ jsx39(
|
|
5525
5785
|
"span",
|
|
5526
5786
|
{
|
|
5527
5787
|
className: cx(
|
|
@@ -5533,7 +5793,7 @@ function CommandButton({
|
|
|
5533
5793
|
children: renderMnemonicNode(children)
|
|
5534
5794
|
}
|
|
5535
5795
|
) : null,
|
|
5536
|
-
showCaret ? /* @__PURE__ */
|
|
5796
|
+
showCaret ? /* @__PURE__ */ jsx39(
|
|
5537
5797
|
"span",
|
|
5538
5798
|
{
|
|
5539
5799
|
className: cx(
|
|
@@ -5542,13 +5802,13 @@ function CommandButton({
|
|
|
5542
5802
|
slotClassNames?.caret
|
|
5543
5803
|
),
|
|
5544
5804
|
style: slotStyles?.caret,
|
|
5545
|
-
children: /* @__PURE__ */
|
|
5805
|
+
children: /* @__PURE__ */ jsx39(NuGlyph, { name: "dropdown-arrow" })
|
|
5546
5806
|
}
|
|
5547
5807
|
) : null
|
|
5548
5808
|
]
|
|
5549
5809
|
}
|
|
5550
5810
|
),
|
|
5551
|
-
hasMenu ? /* @__PURE__ */
|
|
5811
|
+
hasMenu ? /* @__PURE__ */ jsx39(
|
|
5552
5812
|
PopupMenu,
|
|
5553
5813
|
{
|
|
5554
5814
|
anchor: popupMenu.anchor,
|
|
@@ -5563,8 +5823,8 @@ function CommandButton({
|
|
|
5563
5823
|
}
|
|
5564
5824
|
|
|
5565
5825
|
// src/components/CrtGlitch/CrtGlitch.tsx
|
|
5566
|
-
import { useEffect as useEffect10, useId as useId6, useRef as
|
|
5567
|
-
import { jsx as
|
|
5826
|
+
import { useEffect as useEffect10, useId as useId6, useRef as useRef13 } from "react";
|
|
5827
|
+
import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5568
5828
|
var DEFAULT_INTERVAL_MS = 3e3;
|
|
5569
5829
|
var DEFAULT_DURATION_MS = 2500;
|
|
5570
5830
|
var DEFAULT_TOP_LEVEL_RATIO = 1 / 3;
|
|
@@ -5590,12 +5850,12 @@ function NuCrtGlitch({
|
|
|
5590
5850
|
topLevelRatio = DEFAULT_TOP_LEVEL_RATIO
|
|
5591
5851
|
}) {
|
|
5592
5852
|
const filterId = useId6().replace(/:/g, "");
|
|
5593
|
-
const turbulenceRef =
|
|
5594
|
-
const warpRef =
|
|
5595
|
-
const rOffsetRef =
|
|
5596
|
-
const bOffsetRef =
|
|
5597
|
-
const rafRef =
|
|
5598
|
-
const targetElRef =
|
|
5853
|
+
const turbulenceRef = useRef13(null);
|
|
5854
|
+
const warpRef = useRef13(null);
|
|
5855
|
+
const rOffsetRef = useRef13(null);
|
|
5856
|
+
const bOffsetRef = useRef13(null);
|
|
5857
|
+
const rafRef = useRef13(null);
|
|
5858
|
+
const targetElRef = useRef13(null);
|
|
5599
5859
|
useEffect10(() => {
|
|
5600
5860
|
if (!enabled) {
|
|
5601
5861
|
return;
|
|
@@ -5698,7 +5958,7 @@ function NuCrtGlitch({
|
|
|
5698
5958
|
}
|
|
5699
5959
|
};
|
|
5700
5960
|
}, [durationMs, enabled, filterId, intervalMs, targetSelector, topLevelRatio]);
|
|
5701
|
-
return /* @__PURE__ */
|
|
5961
|
+
return /* @__PURE__ */ jsx40("svg", { "aria-hidden": "true", height: "0", style: { position: "absolute" }, width: "0", children: /* @__PURE__ */ jsx40("defs", { children: /* @__PURE__ */ jsxs24(
|
|
5702
5962
|
"filter",
|
|
5703
5963
|
{
|
|
5704
5964
|
"color-interpolation-filters": "sRGB",
|
|
@@ -5708,7 +5968,7 @@ function NuCrtGlitch({
|
|
|
5708
5968
|
x: "-15%",
|
|
5709
5969
|
y: "-5%",
|
|
5710
5970
|
children: [
|
|
5711
|
-
/* @__PURE__ */
|
|
5971
|
+
/* @__PURE__ */ jsx40(
|
|
5712
5972
|
"feTurbulence",
|
|
5713
5973
|
{
|
|
5714
5974
|
baseFrequency: "0.001 0.045",
|
|
@@ -5719,7 +5979,7 @@ function NuCrtGlitch({
|
|
|
5719
5979
|
type: "turbulence"
|
|
5720
5980
|
}
|
|
5721
5981
|
),
|
|
5722
|
-
/* @__PURE__ */
|
|
5982
|
+
/* @__PURE__ */ jsx40(
|
|
5723
5983
|
"feDisplacementMap",
|
|
5724
5984
|
{
|
|
5725
5985
|
in: "SourceGraphic",
|
|
@@ -5731,8 +5991,8 @@ function NuCrtGlitch({
|
|
|
5731
5991
|
yChannelSelector: "A"
|
|
5732
5992
|
}
|
|
5733
5993
|
),
|
|
5734
|
-
/* @__PURE__ */
|
|
5735
|
-
/* @__PURE__ */
|
|
5994
|
+
/* @__PURE__ */ jsx40("feOffset", { dx: 0, dy: 0, in: "warped", ref: rOffsetRef, result: "rOff" }),
|
|
5995
|
+
/* @__PURE__ */ jsx40(
|
|
5736
5996
|
"feColorMatrix",
|
|
5737
5997
|
{
|
|
5738
5998
|
in: "rOff",
|
|
@@ -5741,7 +6001,7 @@ function NuCrtGlitch({
|
|
|
5741
6001
|
values: "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"
|
|
5742
6002
|
}
|
|
5743
6003
|
),
|
|
5744
|
-
/* @__PURE__ */
|
|
6004
|
+
/* @__PURE__ */ jsx40(
|
|
5745
6005
|
"feColorMatrix",
|
|
5746
6006
|
{
|
|
5747
6007
|
in: "warped",
|
|
@@ -5750,8 +6010,8 @@ function NuCrtGlitch({
|
|
|
5750
6010
|
values: "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0"
|
|
5751
6011
|
}
|
|
5752
6012
|
),
|
|
5753
|
-
/* @__PURE__ */
|
|
5754
|
-
/* @__PURE__ */
|
|
6013
|
+
/* @__PURE__ */ jsx40("feOffset", { dx: 0, dy: 0, in: "warped", ref: bOffsetRef, result: "bOff" }),
|
|
6014
|
+
/* @__PURE__ */ jsx40(
|
|
5755
6015
|
"feColorMatrix",
|
|
5756
6016
|
{
|
|
5757
6017
|
in: "bOff",
|
|
@@ -5760,8 +6020,8 @@ function NuCrtGlitch({
|
|
|
5760
6020
|
values: "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0"
|
|
5761
6021
|
}
|
|
5762
6022
|
),
|
|
5763
|
-
/* @__PURE__ */
|
|
5764
|
-
/* @__PURE__ */
|
|
6023
|
+
/* @__PURE__ */ jsx40("feBlend", { in: "rOnly", in2: "gOnly", mode: "screen", result: "rg" }),
|
|
6024
|
+
/* @__PURE__ */ jsx40("feBlend", { in: "rg", in2: "bOnly", mode: "screen" })
|
|
5765
6025
|
]
|
|
5766
6026
|
}
|
|
5767
6027
|
) }) });
|
|
@@ -5773,8 +6033,8 @@ import {
|
|
|
5773
6033
|
useCallback as useCallback6,
|
|
5774
6034
|
useEffect as useEffect11,
|
|
5775
6035
|
useImperativeHandle as useImperativeHandle2,
|
|
5776
|
-
useMemo as
|
|
5777
|
-
useRef as
|
|
6036
|
+
useMemo as useMemo12,
|
|
6037
|
+
useRef as useRef14,
|
|
5778
6038
|
useState as useState18
|
|
5779
6039
|
} from "react";
|
|
5780
6040
|
|
|
@@ -5813,14 +6073,14 @@ function renderListViewCellValue(row, column) {
|
|
|
5813
6073
|
import { memo as memo3 } from "react";
|
|
5814
6074
|
|
|
5815
6075
|
// src/components/ListView/internals/ListViewCheckControl.tsx
|
|
5816
|
-
import { jsx as
|
|
6076
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5817
6077
|
function ListViewCheckControl({
|
|
5818
6078
|
isChecked,
|
|
5819
6079
|
onActivate,
|
|
5820
6080
|
onToggleCheck,
|
|
5821
6081
|
uncheckedShape
|
|
5822
6082
|
}) {
|
|
5823
|
-
return /* @__PURE__ */
|
|
6083
|
+
return /* @__PURE__ */ jsx41(
|
|
5824
6084
|
"button",
|
|
5825
6085
|
{
|
|
5826
6086
|
"aria-label": isChecked ? "Uncheck row" : "Check row",
|
|
@@ -5833,13 +6093,13 @@ function ListViewCheckControl({
|
|
|
5833
6093
|
onToggleCheck();
|
|
5834
6094
|
},
|
|
5835
6095
|
type: "button",
|
|
5836
|
-
children: /* @__PURE__ */
|
|
6096
|
+
children: /* @__PURE__ */ jsx41(
|
|
5837
6097
|
"span",
|
|
5838
6098
|
{
|
|
5839
6099
|
"aria-hidden": "true",
|
|
5840
6100
|
className: "nu-list-view__check-box",
|
|
5841
6101
|
"data-unchecked-shape": uncheckedShape,
|
|
5842
|
-
children: isChecked ? /* @__PURE__ */
|
|
6102
|
+
children: isChecked ? /* @__PURE__ */ jsx41(
|
|
5843
6103
|
NuGlyph,
|
|
5844
6104
|
{
|
|
5845
6105
|
className: "nu-list-view__check-indicator",
|
|
@@ -5853,7 +6113,7 @@ function ListViewCheckControl({
|
|
|
5853
6113
|
}
|
|
5854
6114
|
|
|
5855
6115
|
// src/components/ListView/internals/ListViewRow.tsx
|
|
5856
|
-
import { jsx as
|
|
6116
|
+
import { jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5857
6117
|
function ListViewRowInner({
|
|
5858
6118
|
columns,
|
|
5859
6119
|
isActive,
|
|
@@ -5884,7 +6144,7 @@ function ListViewRowInner({
|
|
|
5884
6144
|
function handleToggleCheck() {
|
|
5885
6145
|
onToggleCheck(rowId);
|
|
5886
6146
|
}
|
|
5887
|
-
return /* @__PURE__ */
|
|
6147
|
+
return /* @__PURE__ */ jsxs25(
|
|
5888
6148
|
"div",
|
|
5889
6149
|
{
|
|
5890
6150
|
"aria-disabled": row.disabled || void 0,
|
|
@@ -5905,7 +6165,7 @@ function ListViewRowInner({
|
|
|
5905
6165
|
"--nu-list-view-columns": templateColumns
|
|
5906
6166
|
},
|
|
5907
6167
|
children: [
|
|
5908
|
-
showCheckBox ? /* @__PURE__ */
|
|
6168
|
+
showCheckBox ? /* @__PURE__ */ jsx42("span", { className: "nu-list-view__check-cell", role: "gridcell", children: /* @__PURE__ */ jsx42(
|
|
5909
6169
|
ListViewCheckControl,
|
|
5910
6170
|
{
|
|
5911
6171
|
isChecked,
|
|
@@ -5914,7 +6174,7 @@ function ListViewRowInner({
|
|
|
5914
6174
|
uncheckedShape
|
|
5915
6175
|
}
|
|
5916
6176
|
) }) : null,
|
|
5917
|
-
columns.map((column) => /* @__PURE__ */
|
|
6177
|
+
columns.map((column) => /* @__PURE__ */ jsx42(
|
|
5918
6178
|
"span",
|
|
5919
6179
|
{
|
|
5920
6180
|
className: [
|
|
@@ -5934,7 +6194,7 @@ function ListViewRowInner({
|
|
|
5934
6194
|
var ListViewRow = memo3(ListViewRowInner);
|
|
5935
6195
|
|
|
5936
6196
|
// src/components/ListView/ListView.tsx
|
|
5937
|
-
import { jsx as
|
|
6197
|
+
import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5938
6198
|
function ListViewInner({
|
|
5939
6199
|
activeRowId: activeRowIdProp,
|
|
5940
6200
|
checkedIds,
|
|
@@ -5952,9 +6212,9 @@ function ListViewInner({
|
|
|
5952
6212
|
uncheckedShape = "box",
|
|
5953
6213
|
...props
|
|
5954
6214
|
}, ref) {
|
|
5955
|
-
const rootRef =
|
|
5956
|
-
const rowRefs =
|
|
5957
|
-
const selectableRows =
|
|
6215
|
+
const rootRef = useRef14(null);
|
|
6216
|
+
const rowRefs = useRef14({});
|
|
6217
|
+
const selectableRows = useMemo12(
|
|
5958
6218
|
() => data.filter((row) => !row.disabled),
|
|
5959
6219
|
[data]
|
|
5960
6220
|
);
|
|
@@ -5964,7 +6224,7 @@ function ListViewInner({
|
|
|
5964
6224
|
);
|
|
5965
6225
|
const activeRowId = activeRowIdProp !== void 0 ? activeRowIdProp : uncontrolledActiveRowId;
|
|
5966
6226
|
const resolvedActiveRowId = activeRowId && selectableRows.some((row) => row.id === activeRowId) ? activeRowId : getInitialActiveRowId(selectableRows, selectedId);
|
|
5967
|
-
const templateColumns =
|
|
6227
|
+
const templateColumns = useMemo12(() => {
|
|
5968
6228
|
const checkboxColumn = showCheckBox ? "var(--nu-glyph-cell-size)" : null;
|
|
5969
6229
|
const dataColumns = columns.map(
|
|
5970
6230
|
(column) => column.width ?? "minmax(0, 1fr)"
|
|
@@ -6102,7 +6362,7 @@ function ListViewInner({
|
|
|
6102
6362
|
break;
|
|
6103
6363
|
}
|
|
6104
6364
|
}
|
|
6105
|
-
return /* @__PURE__ */
|
|
6365
|
+
return /* @__PURE__ */ jsxs26(
|
|
6106
6366
|
"div",
|
|
6107
6367
|
{
|
|
6108
6368
|
...props,
|
|
@@ -6113,7 +6373,7 @@ function ListViewInner({
|
|
|
6113
6373
|
role: "grid",
|
|
6114
6374
|
tabIndex: 0,
|
|
6115
6375
|
children: [
|
|
6116
|
-
/* @__PURE__ */
|
|
6376
|
+
/* @__PURE__ */ jsxs26(
|
|
6117
6377
|
"div",
|
|
6118
6378
|
{
|
|
6119
6379
|
className: "nu-list-view__header",
|
|
@@ -6122,8 +6382,8 @@ function ListViewInner({
|
|
|
6122
6382
|
"--nu-list-view-columns": templateColumns
|
|
6123
6383
|
},
|
|
6124
6384
|
children: [
|
|
6125
|
-
showCheckBox ? /* @__PURE__ */
|
|
6126
|
-
columns.map((column) => /* @__PURE__ */
|
|
6385
|
+
showCheckBox ? /* @__PURE__ */ jsx43("span", { className: "nu-list-view__header-cell", role: "columnheader" }) : null,
|
|
6386
|
+
columns.map((column) => /* @__PURE__ */ jsx43(
|
|
6127
6387
|
"span",
|
|
6128
6388
|
{
|
|
6129
6389
|
className: [
|
|
@@ -6139,7 +6399,7 @@ function ListViewInner({
|
|
|
6139
6399
|
]
|
|
6140
6400
|
}
|
|
6141
6401
|
),
|
|
6142
|
-
/* @__PURE__ */
|
|
6402
|
+
/* @__PURE__ */ jsx43("div", { className: "nu-list-view__body", children: data.length > 0 ? data.map((row) => /* @__PURE__ */ jsx43(
|
|
6143
6403
|
ListViewRow,
|
|
6144
6404
|
{
|
|
6145
6405
|
columns,
|
|
@@ -6156,7 +6416,7 @@ function ListViewInner({
|
|
|
6156
6416
|
uncheckedShape
|
|
6157
6417
|
},
|
|
6158
6418
|
row.id
|
|
6159
|
-
)) : /* @__PURE__ */
|
|
6419
|
+
)) : /* @__PURE__ */ jsx43("div", { className: "nu-list-view__empty", children: emptyText }) })
|
|
6160
6420
|
]
|
|
6161
6421
|
}
|
|
6162
6422
|
);
|
|
@@ -6167,8 +6427,8 @@ var ListView = forwardRef2(ListViewInner);
|
|
|
6167
6427
|
import {
|
|
6168
6428
|
useEffect as useEffect12,
|
|
6169
6429
|
useId as useId7,
|
|
6170
|
-
useMemo as
|
|
6171
|
-
useRef as
|
|
6430
|
+
useMemo as useMemo13,
|
|
6431
|
+
useRef as useRef15,
|
|
6172
6432
|
useState as useState19
|
|
6173
6433
|
} from "react";
|
|
6174
6434
|
|
|
@@ -6334,7 +6594,7 @@ function getMaskedFieldState(mask, rawValue) {
|
|
|
6334
6594
|
}
|
|
6335
6595
|
|
|
6336
6596
|
// src/components/MaskedField/MaskedField.tsx
|
|
6337
|
-
import { jsx as
|
|
6597
|
+
import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6338
6598
|
function MaskedField({
|
|
6339
6599
|
"aria-invalid": ariaInvalid,
|
|
6340
6600
|
className,
|
|
@@ -6357,7 +6617,7 @@ function MaskedField({
|
|
|
6357
6617
|
const fieldId = id ?? generatedId;
|
|
6358
6618
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
6359
6619
|
const isControlled = value !== void 0;
|
|
6360
|
-
const hasMountedRef =
|
|
6620
|
+
const hasMountedRef = useRef15(false);
|
|
6361
6621
|
const [uncontrolledValue, setUncontrolledValue] = useState19(
|
|
6362
6622
|
() => defaultValue == null ? "" : getMaskedFieldState(mask, String(defaultValue)).formattedValue
|
|
6363
6623
|
);
|
|
@@ -6367,7 +6627,7 @@ function MaskedField({
|
|
|
6367
6627
|
rawResolvedValue
|
|
6368
6628
|
);
|
|
6369
6629
|
const resolvedAriaInvalid = ariaInvalid ?? (isInvalid ? true : void 0);
|
|
6370
|
-
const maskInputMode =
|
|
6630
|
+
const maskInputMode = useMemo13(
|
|
6371
6631
|
() => props.inputMode === void 0 ? getTextMaskInputMode(mask) : void 0,
|
|
6372
6632
|
[mask, props.inputMode]
|
|
6373
6633
|
);
|
|
@@ -6406,7 +6666,7 @@ function MaskedField({
|
|
|
6406
6666
|
}
|
|
6407
6667
|
onChange?.(event);
|
|
6408
6668
|
}
|
|
6409
|
-
return /* @__PURE__ */
|
|
6669
|
+
return /* @__PURE__ */ jsxs27(
|
|
6410
6670
|
"label",
|
|
6411
6671
|
{
|
|
6412
6672
|
className: cx(
|
|
@@ -6418,7 +6678,7 @@ function MaskedField({
|
|
|
6418
6678
|
htmlFor: fieldId,
|
|
6419
6679
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
6420
6680
|
children: [
|
|
6421
|
-
/* @__PURE__ */
|
|
6681
|
+
/* @__PURE__ */ jsx44(
|
|
6422
6682
|
"span",
|
|
6423
6683
|
{
|
|
6424
6684
|
className: cx("nu-masked-field__label", slotClassNames?.label),
|
|
@@ -6426,13 +6686,13 @@ function MaskedField({
|
|
|
6426
6686
|
children: renderMnemonicText(label)
|
|
6427
6687
|
}
|
|
6428
6688
|
),
|
|
6429
|
-
/* @__PURE__ */
|
|
6689
|
+
/* @__PURE__ */ jsxs27(
|
|
6430
6690
|
"span",
|
|
6431
6691
|
{
|
|
6432
6692
|
className: cx("nu-masked-field__slot", slotClassNames?.slot),
|
|
6433
6693
|
style: slotStyles?.slot,
|
|
6434
6694
|
children: [
|
|
6435
|
-
/* @__PURE__ */
|
|
6695
|
+
/* @__PURE__ */ jsx44(
|
|
6436
6696
|
"span",
|
|
6437
6697
|
{
|
|
6438
6698
|
"aria-hidden": "true",
|
|
@@ -6441,7 +6701,7 @@ function MaskedField({
|
|
|
6441
6701
|
children: "["
|
|
6442
6702
|
}
|
|
6443
6703
|
),
|
|
6444
|
-
/* @__PURE__ */
|
|
6704
|
+
/* @__PURE__ */ jsx44(
|
|
6445
6705
|
"span",
|
|
6446
6706
|
{
|
|
6447
6707
|
className: cx(
|
|
@@ -6449,7 +6709,7 @@ function MaskedField({
|
|
|
6449
6709
|
slotClassNames?.inputShell
|
|
6450
6710
|
),
|
|
6451
6711
|
style: slotStyles?.inputShell,
|
|
6452
|
-
children: /* @__PURE__ */
|
|
6712
|
+
children: /* @__PURE__ */ jsx44(
|
|
6453
6713
|
"input",
|
|
6454
6714
|
{
|
|
6455
6715
|
...props,
|
|
@@ -6467,7 +6727,7 @@ function MaskedField({
|
|
|
6467
6727
|
)
|
|
6468
6728
|
}
|
|
6469
6729
|
),
|
|
6470
|
-
/* @__PURE__ */
|
|
6730
|
+
/* @__PURE__ */ jsx44(
|
|
6471
6731
|
"span",
|
|
6472
6732
|
{
|
|
6473
6733
|
"aria-hidden": "true",
|
|
@@ -6479,7 +6739,7 @@ function MaskedField({
|
|
|
6479
6739
|
]
|
|
6480
6740
|
}
|
|
6481
6741
|
),
|
|
6482
|
-
hint ? /* @__PURE__ */
|
|
6742
|
+
hint ? /* @__PURE__ */ jsx44(
|
|
6483
6743
|
"span",
|
|
6484
6744
|
{
|
|
6485
6745
|
className: cx("nu-masked-field__hint", slotClassNames?.hint),
|
|
@@ -6497,7 +6757,7 @@ function MaskedField({
|
|
|
6497
6757
|
import {
|
|
6498
6758
|
useState as useState20
|
|
6499
6759
|
} from "react";
|
|
6500
|
-
import { jsx as
|
|
6760
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
6501
6761
|
function Memo({
|
|
6502
6762
|
background,
|
|
6503
6763
|
className,
|
|
@@ -6527,7 +6787,7 @@ function Memo({
|
|
|
6527
6787
|
onValueChange?.(event.target.value);
|
|
6528
6788
|
onChange?.(event);
|
|
6529
6789
|
}
|
|
6530
|
-
return /* @__PURE__ */
|
|
6790
|
+
return /* @__PURE__ */ jsx45(
|
|
6531
6791
|
"div",
|
|
6532
6792
|
{
|
|
6533
6793
|
className: ["nu-memo", className].filter(Boolean).join(" "),
|
|
@@ -6540,7 +6800,7 @@ function Memo({
|
|
|
6540
6800
|
"--nu-memo-focus-text": focusTextColor,
|
|
6541
6801
|
"--nu-memo-text": textColor
|
|
6542
6802
|
},
|
|
6543
|
-
children: /* @__PURE__ */
|
|
6803
|
+
children: /* @__PURE__ */ jsx45("div", { className: "nu-memo__viewport", children: /* @__PURE__ */ jsx45(
|
|
6544
6804
|
"textarea",
|
|
6545
6805
|
{
|
|
6546
6806
|
...props,
|
|
@@ -6556,11 +6816,11 @@ function Memo({
|
|
|
6556
6816
|
// src/components/PageControl/PageControl.tsx
|
|
6557
6817
|
import {
|
|
6558
6818
|
useId as useId8,
|
|
6559
|
-
useMemo as
|
|
6560
|
-
useRef as
|
|
6819
|
+
useMemo as useMemo14,
|
|
6820
|
+
useRef as useRef16,
|
|
6561
6821
|
useState as useState21
|
|
6562
6822
|
} from "react";
|
|
6563
|
-
import { jsx as
|
|
6823
|
+
import { jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6564
6824
|
function PageControl({
|
|
6565
6825
|
activePageId: activePageIdProp,
|
|
6566
6826
|
className,
|
|
@@ -6574,12 +6834,12 @@ function PageControl({
|
|
|
6574
6834
|
}) {
|
|
6575
6835
|
const generatedId = useId8();
|
|
6576
6836
|
const isControlled = activePageIdProp !== void 0;
|
|
6577
|
-
const tabRefs =
|
|
6837
|
+
const tabRefs = useRef16({});
|
|
6578
6838
|
const [uncontrolledActivePageId, setUncontrolledActivePageId] = useState21(
|
|
6579
6839
|
() => defaultActivePageId ?? pages.find((page) => !page.disabled)?.id ?? pages[0]?.id
|
|
6580
6840
|
);
|
|
6581
6841
|
const activePageId = isControlled ? activePageIdProp : uncontrolledActivePageId;
|
|
6582
|
-
const resolvedActivePage =
|
|
6842
|
+
const resolvedActivePage = useMemo14(() => {
|
|
6583
6843
|
const byId = pages.find(
|
|
6584
6844
|
(page) => page.id === activePageId && !page.disabled
|
|
6585
6845
|
);
|
|
@@ -6645,7 +6905,7 @@ function PageControl({
|
|
|
6645
6905
|
break;
|
|
6646
6906
|
}
|
|
6647
6907
|
}
|
|
6648
|
-
return /* @__PURE__ */
|
|
6908
|
+
return /* @__PURE__ */ jsxs28(
|
|
6649
6909
|
"div",
|
|
6650
6910
|
{
|
|
6651
6911
|
...props,
|
|
@@ -6656,7 +6916,7 @@ function PageControl({
|
|
|
6656
6916
|
slotStyles?.root
|
|
6657
6917
|
),
|
|
6658
6918
|
children: [
|
|
6659
|
-
/* @__PURE__ */
|
|
6919
|
+
/* @__PURE__ */ jsx46(
|
|
6660
6920
|
"div",
|
|
6661
6921
|
{
|
|
6662
6922
|
className: cx("nu-page-control__tabs", slotClassNames?.tabs),
|
|
@@ -6667,7 +6927,7 @@ function PageControl({
|
|
|
6667
6927
|
const isActive = page.id === resolvedActivePage?.id;
|
|
6668
6928
|
const panelId = `${generatedId}-panel-${page.id}`;
|
|
6669
6929
|
const tabId = `${generatedId}-tab-${page.id}`;
|
|
6670
|
-
return /* @__PURE__ */
|
|
6930
|
+
return /* @__PURE__ */ jsx46(
|
|
6671
6931
|
"button",
|
|
6672
6932
|
{
|
|
6673
6933
|
"aria-controls": panelId,
|
|
@@ -6691,7 +6951,7 @@ function PageControl({
|
|
|
6691
6951
|
})
|
|
6692
6952
|
}
|
|
6693
6953
|
),
|
|
6694
|
-
/* @__PURE__ */
|
|
6954
|
+
/* @__PURE__ */ jsx46(
|
|
6695
6955
|
"div",
|
|
6696
6956
|
{
|
|
6697
6957
|
"aria-labelledby": resolvedActivePage ? `${generatedId}-tab-${resolvedActivePage.id}` : void 0,
|
|
@@ -6708,7 +6968,7 @@ function PageControl({
|
|
|
6708
6968
|
}
|
|
6709
6969
|
|
|
6710
6970
|
// src/components/Panel/Panel.tsx
|
|
6711
|
-
import { jsx as
|
|
6971
|
+
import { jsx as jsx47, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6712
6972
|
function Panel({
|
|
6713
6973
|
children,
|
|
6714
6974
|
className,
|
|
@@ -6719,14 +6979,14 @@ function Panel({
|
|
|
6719
6979
|
title,
|
|
6720
6980
|
...props
|
|
6721
6981
|
}) {
|
|
6722
|
-
return /* @__PURE__ */
|
|
6982
|
+
return /* @__PURE__ */ jsxs29(
|
|
6723
6983
|
"section",
|
|
6724
6984
|
{
|
|
6725
6985
|
...props,
|
|
6726
6986
|
className: cx("nu-panel", slotClassNames?.root, className),
|
|
6727
6987
|
style: mergeSlotStyle(props.style, slotStyles?.root),
|
|
6728
6988
|
children: [
|
|
6729
|
-
title ? /* @__PURE__ */
|
|
6989
|
+
title ? /* @__PURE__ */ jsx47(
|
|
6730
6990
|
"header",
|
|
6731
6991
|
{
|
|
6732
6992
|
className: cx("nu-panel__header", slotClassNames?.header),
|
|
@@ -6734,7 +6994,7 @@ function Panel({
|
|
|
6734
6994
|
children: renderMnemonicText(title)
|
|
6735
6995
|
}
|
|
6736
6996
|
) : null,
|
|
6737
|
-
/* @__PURE__ */
|
|
6997
|
+
/* @__PURE__ */ jsx47(
|
|
6738
6998
|
"div",
|
|
6739
6999
|
{
|
|
6740
7000
|
className: cx(
|
|
@@ -6746,7 +7006,7 @@ function Panel({
|
|
|
6746
7006
|
children
|
|
6747
7007
|
}
|
|
6748
7008
|
),
|
|
6749
|
-
footer ? /* @__PURE__ */
|
|
7009
|
+
footer ? /* @__PURE__ */ jsx47(
|
|
6750
7010
|
"footer",
|
|
6751
7011
|
{
|
|
6752
7012
|
className: cx("nu-panel__footer", slotClassNames?.footer),
|
|
@@ -6762,11 +7022,11 @@ function Panel({
|
|
|
6762
7022
|
// src/components/PropertyGrid/PropertyGrid.tsx
|
|
6763
7023
|
import {
|
|
6764
7024
|
useId as useId9,
|
|
6765
|
-
useMemo as
|
|
6766
|
-
useRef as
|
|
7025
|
+
useMemo as useMemo15,
|
|
7026
|
+
useRef as useRef17,
|
|
6767
7027
|
useState as useState22
|
|
6768
7028
|
} from "react";
|
|
6769
|
-
import { jsx as
|
|
7029
|
+
import { jsx as jsx48, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6770
7030
|
function collectGroupIds(entries) {
|
|
6771
7031
|
const groupIds = /* @__PURE__ */ new Set();
|
|
6772
7032
|
function visit(nextEntries) {
|
|
@@ -6874,23 +7134,23 @@ function PropertyGrid({
|
|
|
6874
7134
|
...props
|
|
6875
7135
|
}) {
|
|
6876
7136
|
const editorIdPrefix = useId9();
|
|
6877
|
-
const rowButtonRefs =
|
|
6878
|
-
const groupIds =
|
|
7137
|
+
const rowButtonRefs = useRef17({});
|
|
7138
|
+
const groupIds = useMemo15(() => collectGroupIds(entries), [entries]);
|
|
6879
7139
|
const isExpandedControlled = expandedIdsProp !== void 0;
|
|
6880
7140
|
const isActiveControlled = activeIdProp !== void 0;
|
|
6881
7141
|
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = useState22(() => getInitialExpandedIds(entries, defaultExpandedIds));
|
|
6882
7142
|
const resolvedExpandedIds = expandedIdsProp ?? uncontrolledExpandedIds;
|
|
6883
|
-
const expandedIdSet =
|
|
7143
|
+
const expandedIdSet = useMemo15(
|
|
6884
7144
|
() => new Set(
|
|
6885
7145
|
resolvedExpandedIds.filter((expandedId) => groupIds.has(expandedId))
|
|
6886
7146
|
),
|
|
6887
7147
|
[groupIds, resolvedExpandedIds]
|
|
6888
7148
|
);
|
|
6889
|
-
const rows =
|
|
7149
|
+
const rows = useMemo15(
|
|
6890
7150
|
() => collectVisibleRows(entries, expandedIdSet),
|
|
6891
7151
|
[entries, expandedIdSet]
|
|
6892
7152
|
);
|
|
6893
|
-
const interactiveRows =
|
|
7153
|
+
const interactiveRows = useMemo15(() => collectInteractiveRows(rows), [rows]);
|
|
6894
7154
|
const [uncontrolledActiveId, setUncontrolledActiveId] = useState22(() => getInitialActiveId2(interactiveRows, defaultActiveId));
|
|
6895
7155
|
const requestedActiveId = isActiveControlled ? activeIdProp : uncontrolledActiveId;
|
|
6896
7156
|
const resolvedActiveId = requestedActiveId && interactiveRows.some((row) => row.id === requestedActiveId) ? requestedActiveId : interactiveRows[0]?.id;
|
|
@@ -7010,7 +7270,7 @@ function PropertyGrid({
|
|
|
7010
7270
|
const nextExpandedIds = expandedIdSet.has(entry.id) ? resolvedExpandedIds.filter((expandedId) => expandedId !== entry.id) : [...resolvedExpandedIds, entry.id];
|
|
7011
7271
|
updateExpandedIds(nextExpandedIds);
|
|
7012
7272
|
}
|
|
7013
|
-
return /* @__PURE__ */
|
|
7273
|
+
return /* @__PURE__ */ jsx48(
|
|
7014
7274
|
"div",
|
|
7015
7275
|
{
|
|
7016
7276
|
...props,
|
|
@@ -7021,13 +7281,13 @@ function PropertyGrid({
|
|
|
7021
7281
|
...style,
|
|
7022
7282
|
"--nu-property-grid-label-width": labelWidth
|
|
7023
7283
|
},
|
|
7024
|
-
children: /* @__PURE__ */
|
|
7284
|
+
children: /* @__PURE__ */ jsx48("div", { className: "nu-property-grid__body", children: rows.map((row) => {
|
|
7025
7285
|
if (row.type === "section") {
|
|
7026
|
-
return /* @__PURE__ */
|
|
7286
|
+
return /* @__PURE__ */ jsx48("div", { className: "nu-property-grid__section", children: renderMnemonicText(row.entry.title) }, row.entry.id);
|
|
7027
7287
|
}
|
|
7028
7288
|
if (row.type === "group") {
|
|
7029
7289
|
const isExpanded = expandedIdSet.has(row.entry.id);
|
|
7030
|
-
return /* @__PURE__ */
|
|
7290
|
+
return /* @__PURE__ */ jsxs30(
|
|
7031
7291
|
"div",
|
|
7032
7292
|
{
|
|
7033
7293
|
className: "nu-property-grid__row",
|
|
@@ -7036,7 +7296,7 @@ function PropertyGrid({
|
|
|
7036
7296
|
"data-expanded": isExpanded || void 0,
|
|
7037
7297
|
"data-group": true,
|
|
7038
7298
|
children: [
|
|
7039
|
-
/* @__PURE__ */
|
|
7299
|
+
/* @__PURE__ */ jsx48(
|
|
7040
7300
|
"button",
|
|
7041
7301
|
{
|
|
7042
7302
|
className: "nu-property-grid__label nu-property-grid__label-button",
|
|
@@ -7056,32 +7316,32 @@ function PropertyGrid({
|
|
|
7056
7316
|
"--nu-property-grid-depth": row.depth
|
|
7057
7317
|
},
|
|
7058
7318
|
type: "button",
|
|
7059
|
-
children: /* @__PURE__ */
|
|
7060
|
-
/* @__PURE__ */
|
|
7319
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "nu-property-grid__lead", children: [
|
|
7320
|
+
/* @__PURE__ */ jsx48("span", { className: "nu-property-grid__expander", children: /* @__PURE__ */ jsx48(
|
|
7061
7321
|
NuGlyph,
|
|
7062
7322
|
{
|
|
7063
7323
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
7064
7324
|
}
|
|
7065
7325
|
) }),
|
|
7066
|
-
/* @__PURE__ */
|
|
7326
|
+
/* @__PURE__ */ jsx48("span", { className: "nu-property-grid__label-text", children: renderMnemonicText(row.entry.label) })
|
|
7067
7327
|
] })
|
|
7068
7328
|
}
|
|
7069
7329
|
),
|
|
7070
|
-
/* @__PURE__ */
|
|
7330
|
+
/* @__PURE__ */ jsx48("div", { className: "nu-property-grid__editor", children: row.entry.summary ? /* @__PURE__ */ jsx48("div", { className: "nu-property-grid__control", children: row.entry.summary }) : null })
|
|
7071
7331
|
]
|
|
7072
7332
|
},
|
|
7073
7333
|
row.entry.id
|
|
7074
7334
|
);
|
|
7075
7335
|
}
|
|
7076
7336
|
const editorId = `${editorIdPrefix}-editor-${row.entry.id}`;
|
|
7077
|
-
return /* @__PURE__ */
|
|
7337
|
+
return /* @__PURE__ */ jsxs30(
|
|
7078
7338
|
"div",
|
|
7079
7339
|
{
|
|
7080
7340
|
className: "nu-property-grid__row",
|
|
7081
7341
|
"data-active": resolvedActiveId === row.entry.id || void 0,
|
|
7082
7342
|
"data-disabled": row.entry.disabled || void 0,
|
|
7083
7343
|
children: [
|
|
7084
|
-
/* @__PURE__ */
|
|
7344
|
+
/* @__PURE__ */ jsx48(
|
|
7085
7345
|
"button",
|
|
7086
7346
|
{
|
|
7087
7347
|
className: "nu-property-grid__label nu-property-grid__label-button",
|
|
@@ -7101,21 +7361,21 @@ function PropertyGrid({
|
|
|
7101
7361
|
"--nu-property-grid-depth": row.depth
|
|
7102
7362
|
},
|
|
7103
7363
|
type: "button",
|
|
7104
|
-
children: /* @__PURE__ */
|
|
7105
|
-
/* @__PURE__ */
|
|
7106
|
-
/* @__PURE__ */
|
|
7364
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "nu-property-grid__lead", children: [
|
|
7365
|
+
/* @__PURE__ */ jsx48("span", { className: "nu-property-grid__expander-placeholder" }),
|
|
7366
|
+
/* @__PURE__ */ jsx48("span", { className: "nu-property-grid__label-text", children: renderMnemonicText(row.entry.label) })
|
|
7107
7367
|
] })
|
|
7108
7368
|
}
|
|
7109
7369
|
),
|
|
7110
|
-
/* @__PURE__ */
|
|
7370
|
+
/* @__PURE__ */ jsxs30(
|
|
7111
7371
|
"div",
|
|
7112
7372
|
{
|
|
7113
7373
|
className: "nu-property-grid__editor",
|
|
7114
7374
|
id: editorId,
|
|
7115
7375
|
onFocusCapture: () => updateActiveId(row.entry.id),
|
|
7116
7376
|
children: [
|
|
7117
|
-
/* @__PURE__ */
|
|
7118
|
-
row.entry.hint ? /* @__PURE__ */
|
|
7377
|
+
/* @__PURE__ */ jsx48("div", { className: "nu-property-grid__control", children: row.entry.content }),
|
|
7378
|
+
row.entry.hint ? /* @__PURE__ */ jsx48("div", { className: "nu-property-grid__hint", children: row.entry.hint }) : null
|
|
7119
7379
|
]
|
|
7120
7380
|
}
|
|
7121
7381
|
)
|
|
@@ -7129,7 +7389,7 @@ function PropertyGrid({
|
|
|
7129
7389
|
}
|
|
7130
7390
|
|
|
7131
7391
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
7132
|
-
import { jsx as
|
|
7392
|
+
import { jsx as jsx49, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7133
7393
|
function clamp3(value, min, max) {
|
|
7134
7394
|
return Math.min(max, Math.max(min, value));
|
|
7135
7395
|
}
|
|
@@ -7153,7 +7413,7 @@ function ProgressBar({
|
|
|
7153
7413
|
const clampedValue = clamp3(value, min, safeMax);
|
|
7154
7414
|
const percent = Math.round((clampedValue - min) / (safeMax - min) * 100);
|
|
7155
7415
|
const renderedValue = valueRenderer ? valueRenderer(percent, clampedValue, min, safeMax) : `${percent}%`;
|
|
7156
|
-
return /* @__PURE__ */
|
|
7416
|
+
return /* @__PURE__ */ jsxs31(
|
|
7157
7417
|
"div",
|
|
7158
7418
|
{
|
|
7159
7419
|
...props,
|
|
@@ -7165,7 +7425,7 @@ function ProgressBar({
|
|
|
7165
7425
|
role: "progressbar",
|
|
7166
7426
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7167
7427
|
children: [
|
|
7168
|
-
label ? /* @__PURE__ */
|
|
7428
|
+
label ? /* @__PURE__ */ jsx49(
|
|
7169
7429
|
"span",
|
|
7170
7430
|
{
|
|
7171
7431
|
className: cx("nu-progress-bar__label", slotClassNames?.label),
|
|
@@ -7173,7 +7433,7 @@ function ProgressBar({
|
|
|
7173
7433
|
children: renderMnemonicText(label)
|
|
7174
7434
|
}
|
|
7175
7435
|
) : null,
|
|
7176
|
-
/* @__PURE__ */
|
|
7436
|
+
/* @__PURE__ */ jsxs31(
|
|
7177
7437
|
"div",
|
|
7178
7438
|
{
|
|
7179
7439
|
className: cx("nu-progress-bar__track", slotClassNames?.track),
|
|
@@ -7184,7 +7444,7 @@ function ProgressBar({
|
|
|
7184
7444
|
slotStyles?.track
|
|
7185
7445
|
),
|
|
7186
7446
|
children: [
|
|
7187
|
-
/* @__PURE__ */
|
|
7447
|
+
/* @__PURE__ */ jsx49(
|
|
7188
7448
|
"div",
|
|
7189
7449
|
{
|
|
7190
7450
|
className: cx("nu-progress-bar__fill", slotClassNames?.fill),
|
|
@@ -7197,7 +7457,7 @@ function ProgressBar({
|
|
|
7197
7457
|
)
|
|
7198
7458
|
}
|
|
7199
7459
|
),
|
|
7200
|
-
showValue ? /* @__PURE__ */
|
|
7460
|
+
showValue ? /* @__PURE__ */ jsx49(
|
|
7201
7461
|
"span",
|
|
7202
7462
|
{
|
|
7203
7463
|
className: cx("nu-progress-bar__value", slotClassNames?.value),
|
|
@@ -7208,7 +7468,7 @@ function ProgressBar({
|
|
|
7208
7468
|
]
|
|
7209
7469
|
}
|
|
7210
7470
|
),
|
|
7211
|
-
hint ? /* @__PURE__ */
|
|
7471
|
+
hint ? /* @__PURE__ */ jsx49(
|
|
7212
7472
|
"span",
|
|
7213
7473
|
{
|
|
7214
7474
|
className: cx("nu-progress-bar__hint", slotClassNames?.hint),
|
|
@@ -7223,7 +7483,7 @@ function ProgressBar({
|
|
|
7223
7483
|
|
|
7224
7484
|
// src/components/RadioGroup/RadioButton.tsx
|
|
7225
7485
|
import { useId as useId10, useState as useState23 } from "react";
|
|
7226
|
-
import { jsx as
|
|
7486
|
+
import { jsx as jsx50, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7227
7487
|
function RadioButton({
|
|
7228
7488
|
checked,
|
|
7229
7489
|
className,
|
|
@@ -7247,9 +7507,9 @@ function RadioButton({
|
|
|
7247
7507
|
}
|
|
7248
7508
|
onCheckedChange?.(event.target.checked, event);
|
|
7249
7509
|
}
|
|
7250
|
-
return /* @__PURE__ */
|
|
7251
|
-
/* @__PURE__ */
|
|
7252
|
-
/* @__PURE__ */
|
|
7510
|
+
return /* @__PURE__ */ jsxs32("label", { className: ["nu-radio-button", className].filter(Boolean).join(" "), children: [
|
|
7511
|
+
/* @__PURE__ */ jsxs32("span", { className: "nu-radio-button__main", children: [
|
|
7512
|
+
/* @__PURE__ */ jsx50(
|
|
7253
7513
|
"input",
|
|
7254
7514
|
{
|
|
7255
7515
|
...props,
|
|
@@ -7262,19 +7522,19 @@ function RadioButton({
|
|
|
7262
7522
|
type: "radio"
|
|
7263
7523
|
}
|
|
7264
7524
|
),
|
|
7265
|
-
/* @__PURE__ */
|
|
7266
|
-
/* @__PURE__ */
|
|
7267
|
-
resolvedChecked ? /* @__PURE__ */
|
|
7525
|
+
/* @__PURE__ */ jsx50("span", { "aria-hidden": "true", className: "nu-radio-button__control", children: /* @__PURE__ */ jsxs32("span", { className: "nu-radio-button__disc", children: [
|
|
7526
|
+
/* @__PURE__ */ jsx50(NuGlyph, { className: "nu-radio-button__ring", name: "radio-ring" }),
|
|
7527
|
+
resolvedChecked ? /* @__PURE__ */ jsx50(NuGlyph, { className: "nu-radio-button__fill", name: "radio-fill" }) : null
|
|
7268
7528
|
] }) }),
|
|
7269
|
-
/* @__PURE__ */
|
|
7529
|
+
/* @__PURE__ */ jsx50("span", { className: "nu-radio-button__label", children: renderMnemonicText(label) })
|
|
7270
7530
|
] }),
|
|
7271
|
-
hint ? /* @__PURE__ */
|
|
7531
|
+
hint ? /* @__PURE__ */ jsx50("span", { className: "nu-radio-button__hint", id: hintId, children: hint }) : null
|
|
7272
7532
|
] });
|
|
7273
7533
|
}
|
|
7274
7534
|
|
|
7275
7535
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
7276
7536
|
import { useId as useId11, useState as useState24 } from "react";
|
|
7277
|
-
import { jsx as
|
|
7537
|
+
import { jsx as jsx51, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7278
7538
|
function RadioGroup({
|
|
7279
7539
|
className,
|
|
7280
7540
|
defaultValue,
|
|
@@ -7301,7 +7561,7 @@ function RadioGroup({
|
|
|
7301
7561
|
}
|
|
7302
7562
|
onValueChange?.(nextValue);
|
|
7303
7563
|
}
|
|
7304
|
-
return /* @__PURE__ */
|
|
7564
|
+
return /* @__PURE__ */ jsxs33(
|
|
7305
7565
|
"fieldset",
|
|
7306
7566
|
{
|
|
7307
7567
|
...props,
|
|
@@ -7309,7 +7569,7 @@ function RadioGroup({
|
|
|
7309
7569
|
className: cx("nu-radio-group", slotClassNames?.root, className),
|
|
7310
7570
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7311
7571
|
children: [
|
|
7312
|
-
label ? /* @__PURE__ */
|
|
7572
|
+
label ? /* @__PURE__ */ jsx51(
|
|
7313
7573
|
"legend",
|
|
7314
7574
|
{
|
|
7315
7575
|
className: cx("nu-radio-group__label", slotClassNames?.label),
|
|
@@ -7317,12 +7577,12 @@ function RadioGroup({
|
|
|
7317
7577
|
children: renderMnemonicText(label)
|
|
7318
7578
|
}
|
|
7319
7579
|
) : null,
|
|
7320
|
-
/* @__PURE__ */
|
|
7580
|
+
/* @__PURE__ */ jsx51(
|
|
7321
7581
|
"div",
|
|
7322
7582
|
{
|
|
7323
7583
|
className: cx("nu-radio-group__options", slotClassNames?.options),
|
|
7324
7584
|
style: slotStyles?.options,
|
|
7325
|
-
children: options.map((option) => /* @__PURE__ */
|
|
7585
|
+
children: options.map((option) => /* @__PURE__ */ jsx51(
|
|
7326
7586
|
RadioButton,
|
|
7327
7587
|
{
|
|
7328
7588
|
checked: resolvedValue === option.value,
|
|
@@ -7341,7 +7601,7 @@ function RadioGroup({
|
|
|
7341
7601
|
))
|
|
7342
7602
|
}
|
|
7343
7603
|
),
|
|
7344
|
-
hint ? /* @__PURE__ */
|
|
7604
|
+
hint ? /* @__PURE__ */ jsx51(
|
|
7345
7605
|
"span",
|
|
7346
7606
|
{
|
|
7347
7607
|
className: cx("nu-radio-group__hint", slotClassNames?.hint),
|
|
@@ -7356,14 +7616,14 @@ function RadioGroup({
|
|
|
7356
7616
|
}
|
|
7357
7617
|
|
|
7358
7618
|
// src/components/ReportCell/ReportCell.tsx
|
|
7359
|
-
import { jsx as
|
|
7619
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
7360
7620
|
function ReportCell({
|
|
7361
7621
|
align = "start",
|
|
7362
7622
|
className,
|
|
7363
7623
|
tone = "default",
|
|
7364
7624
|
...props
|
|
7365
7625
|
}) {
|
|
7366
|
-
return /* @__PURE__ */
|
|
7626
|
+
return /* @__PURE__ */ jsx52(
|
|
7367
7627
|
"span",
|
|
7368
7628
|
{
|
|
7369
7629
|
...props,
|
|
@@ -7381,12 +7641,12 @@ function ReportCell({
|
|
|
7381
7641
|
import {
|
|
7382
7642
|
useEffect as useEffect13,
|
|
7383
7643
|
useId as useId12,
|
|
7384
|
-
useMemo as
|
|
7385
|
-
useRef as
|
|
7644
|
+
useMemo as useMemo16,
|
|
7645
|
+
useRef as useRef18,
|
|
7386
7646
|
useState as useState25
|
|
7387
7647
|
} from "react";
|
|
7388
7648
|
import { createPortal as createPortal4 } from "react-dom";
|
|
7389
|
-
import { jsx as
|
|
7649
|
+
import { jsx as jsx53, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7390
7650
|
function resolveSearchBoxPortalRoot() {
|
|
7391
7651
|
return document.body;
|
|
7392
7652
|
}
|
|
@@ -7414,11 +7674,11 @@ function SearchBox({
|
|
|
7414
7674
|
style,
|
|
7415
7675
|
...props
|
|
7416
7676
|
}) {
|
|
7417
|
-
const rootRef =
|
|
7418
|
-
const fieldRef =
|
|
7419
|
-
const inputRef =
|
|
7420
|
-
const popupRef =
|
|
7421
|
-
const requestIdRef =
|
|
7677
|
+
const rootRef = useRef18(null);
|
|
7678
|
+
const fieldRef = useRef18(null);
|
|
7679
|
+
const inputRef = useRef18(null);
|
|
7680
|
+
const popupRef = useRef18(null);
|
|
7681
|
+
const requestIdRef = useRef18(0);
|
|
7422
7682
|
const generatedId = useId12();
|
|
7423
7683
|
const fieldId = `${generatedId}-search-box`;
|
|
7424
7684
|
const labelId = `${fieldId}-label`;
|
|
@@ -7431,7 +7691,7 @@ function SearchBox({
|
|
|
7431
7691
|
const [selectedValue, setSelectedValue] = useState25(null);
|
|
7432
7692
|
const normalizedQuery = (isQueryControlled ? queryProp : uncontrolledQuery) ?? "";
|
|
7433
7693
|
const trimmedQuery = normalizedQuery.trim();
|
|
7434
|
-
const resultOptions =
|
|
7694
|
+
const resultOptions = useMemo16(() => {
|
|
7435
7695
|
return results.map((item, index) => ({
|
|
7436
7696
|
item,
|
|
7437
7697
|
listBoxItem: {
|
|
@@ -7445,7 +7705,7 @@ function SearchBox({
|
|
|
7445
7705
|
value: getItemId(item, index)
|
|
7446
7706
|
}));
|
|
7447
7707
|
}, [getItemDetails, getItemDisabled, getItemId, getItemText, results]);
|
|
7448
|
-
const listBoxData =
|
|
7708
|
+
const listBoxData = useMemo16(
|
|
7449
7709
|
() => [
|
|
7450
7710
|
{
|
|
7451
7711
|
category: null,
|
|
@@ -7536,15 +7796,15 @@ function SearchBox({
|
|
|
7536
7796
|
}
|
|
7537
7797
|
function renderPopupContent() {
|
|
7538
7798
|
if (status === "loading") {
|
|
7539
|
-
return /* @__PURE__ */
|
|
7799
|
+
return /* @__PURE__ */ jsx53("div", { className: "nu-search-box__status", children: loadingText });
|
|
7540
7800
|
}
|
|
7541
7801
|
if (status === "error") {
|
|
7542
|
-
return /* @__PURE__ */
|
|
7802
|
+
return /* @__PURE__ */ jsx53("div", { className: "nu-search-box__status", children: errorText });
|
|
7543
7803
|
}
|
|
7544
7804
|
if (trimmedQuery.length < minQueryLength) {
|
|
7545
|
-
return /* @__PURE__ */
|
|
7805
|
+
return /* @__PURE__ */ jsx53("div", { className: "nu-search-box__status", children: idleText });
|
|
7546
7806
|
}
|
|
7547
|
-
return /* @__PURE__ */
|
|
7807
|
+
return /* @__PURE__ */ jsx53("div", { className: "nu-search-box__listbox", children: /* @__PURE__ */ jsx53(
|
|
7548
7808
|
ListBox,
|
|
7549
7809
|
{
|
|
7550
7810
|
data: listBoxData,
|
|
@@ -7581,7 +7841,7 @@ function SearchBox({
|
|
|
7581
7841
|
break;
|
|
7582
7842
|
}
|
|
7583
7843
|
}
|
|
7584
|
-
return /* @__PURE__ */
|
|
7844
|
+
return /* @__PURE__ */ jsxs34(
|
|
7585
7845
|
"div",
|
|
7586
7846
|
{
|
|
7587
7847
|
...props,
|
|
@@ -7589,10 +7849,10 @@ function SearchBox({
|
|
|
7589
7849
|
ref: rootRef,
|
|
7590
7850
|
style,
|
|
7591
7851
|
children: [
|
|
7592
|
-
/* @__PURE__ */
|
|
7593
|
-
/* @__PURE__ */
|
|
7594
|
-
/* @__PURE__ */
|
|
7595
|
-
/* @__PURE__ */
|
|
7852
|
+
/* @__PURE__ */ jsx53("label", { className: "nu-search-box__label", htmlFor: fieldId, id: labelId, children: renderMnemonicText(label) }),
|
|
7853
|
+
/* @__PURE__ */ jsxs34("span", { className: "nu-search-box__slot", ref: fieldRef, children: [
|
|
7854
|
+
/* @__PURE__ */ jsx53("span", { "aria-hidden": "true", className: "nu-search-box__bracket", children: "[" }),
|
|
7855
|
+
/* @__PURE__ */ jsx53("span", { className: "nu-search-box__input-shell", children: /* @__PURE__ */ jsx53(
|
|
7596
7856
|
"input",
|
|
7597
7857
|
{
|
|
7598
7858
|
"aria-autocomplete": "list",
|
|
@@ -7617,11 +7877,11 @@ function SearchBox({
|
|
|
7617
7877
|
value: normalizedQuery
|
|
7618
7878
|
}
|
|
7619
7879
|
) }),
|
|
7620
|
-
/* @__PURE__ */
|
|
7880
|
+
/* @__PURE__ */ jsx53("span", { "aria-hidden": "true", className: "nu-search-box__bracket", children: "]" })
|
|
7621
7881
|
] }),
|
|
7622
|
-
hint ? /* @__PURE__ */
|
|
7882
|
+
hint ? /* @__PURE__ */ jsx53("span", { className: "nu-search-box__hint", id: hintId, children: hint }) : null,
|
|
7623
7883
|
open && popupRoot ? createPortal4(
|
|
7624
|
-
/* @__PURE__ */
|
|
7884
|
+
/* @__PURE__ */ jsx53(
|
|
7625
7885
|
"div",
|
|
7626
7886
|
{
|
|
7627
7887
|
className: "nu-search-box__popup",
|
|
@@ -7641,10 +7901,10 @@ function SearchBox({
|
|
|
7641
7901
|
// src/components/SpinBox/SpinBox.tsx
|
|
7642
7902
|
import {
|
|
7643
7903
|
useId as useId13,
|
|
7644
|
-
useMemo as
|
|
7904
|
+
useMemo as useMemo17,
|
|
7645
7905
|
useState as useState26
|
|
7646
7906
|
} from "react";
|
|
7647
|
-
import { jsx as
|
|
7907
|
+
import { jsx as jsx54, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7648
7908
|
function clampSpinValue(value, min, max) {
|
|
7649
7909
|
let nextValue = value;
|
|
7650
7910
|
if (min !== void 0) {
|
|
@@ -7749,22 +8009,22 @@ function SpinBox({
|
|
|
7749
8009
|
}
|
|
7750
8010
|
onKeyDown?.(event);
|
|
7751
8011
|
}
|
|
7752
|
-
const decrementDisabled =
|
|
8012
|
+
const decrementDisabled = useMemo17(
|
|
7753
8013
|
() => disabled || min !== void 0 && numericValue <= min,
|
|
7754
8014
|
[disabled, min, numericValue]
|
|
7755
8015
|
);
|
|
7756
|
-
const incrementDisabled =
|
|
8016
|
+
const incrementDisabled = useMemo17(
|
|
7757
8017
|
() => disabled || max !== void 0 && numericValue >= max,
|
|
7758
8018
|
[disabled, max, numericValue]
|
|
7759
8019
|
);
|
|
7760
|
-
return /* @__PURE__ */
|
|
8020
|
+
return /* @__PURE__ */ jsxs35(
|
|
7761
8021
|
"label",
|
|
7762
8022
|
{
|
|
7763
8023
|
className: cx("nu-spin-box", slotClassNames?.root, className),
|
|
7764
8024
|
htmlFor: fieldId,
|
|
7765
8025
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7766
8026
|
children: [
|
|
7767
|
-
/* @__PURE__ */
|
|
8027
|
+
/* @__PURE__ */ jsx54(
|
|
7768
8028
|
"span",
|
|
7769
8029
|
{
|
|
7770
8030
|
className: cx("nu-spin-box__label", slotClassNames?.label),
|
|
@@ -7772,13 +8032,13 @@ function SpinBox({
|
|
|
7772
8032
|
children: renderMnemonicText(label)
|
|
7773
8033
|
}
|
|
7774
8034
|
),
|
|
7775
|
-
/* @__PURE__ */
|
|
8035
|
+
/* @__PURE__ */ jsxs35(
|
|
7776
8036
|
"span",
|
|
7777
8037
|
{
|
|
7778
8038
|
className: cx("nu-spin-box__slot", slotClassNames?.slot),
|
|
7779
8039
|
style: slotStyles?.slot,
|
|
7780
8040
|
children: [
|
|
7781
|
-
/* @__PURE__ */
|
|
8041
|
+
/* @__PURE__ */ jsx54(
|
|
7782
8042
|
"span",
|
|
7783
8043
|
{
|
|
7784
8044
|
"aria-hidden": "true",
|
|
@@ -7787,12 +8047,12 @@ function SpinBox({
|
|
|
7787
8047
|
children: "["
|
|
7788
8048
|
}
|
|
7789
8049
|
),
|
|
7790
|
-
/* @__PURE__ */
|
|
8050
|
+
/* @__PURE__ */ jsx54(
|
|
7791
8051
|
"span",
|
|
7792
8052
|
{
|
|
7793
8053
|
className: cx("nu-spin-box__input-shell", slotClassNames?.inputShell),
|
|
7794
8054
|
style: slotStyles?.inputShell,
|
|
7795
|
-
children: /* @__PURE__ */
|
|
8055
|
+
children: /* @__PURE__ */ jsx54(
|
|
7796
8056
|
"input",
|
|
7797
8057
|
{
|
|
7798
8058
|
...props,
|
|
@@ -7811,7 +8071,7 @@ function SpinBox({
|
|
|
7811
8071
|
)
|
|
7812
8072
|
}
|
|
7813
8073
|
),
|
|
7814
|
-
/* @__PURE__ */
|
|
8074
|
+
/* @__PURE__ */ jsx54(
|
|
7815
8075
|
"span",
|
|
7816
8076
|
{
|
|
7817
8077
|
"aria-hidden": "true",
|
|
@@ -7820,13 +8080,13 @@ function SpinBox({
|
|
|
7820
8080
|
children: "]"
|
|
7821
8081
|
}
|
|
7822
8082
|
),
|
|
7823
|
-
/* @__PURE__ */
|
|
8083
|
+
/* @__PURE__ */ jsxs35(
|
|
7824
8084
|
"span",
|
|
7825
8085
|
{
|
|
7826
8086
|
className: cx("nu-spin-box__controls", slotClassNames?.controls),
|
|
7827
8087
|
style: slotStyles?.controls,
|
|
7828
8088
|
children: [
|
|
7829
|
-
/* @__PURE__ */
|
|
8089
|
+
/* @__PURE__ */ jsx54(
|
|
7830
8090
|
"button",
|
|
7831
8091
|
{
|
|
7832
8092
|
className: cx("nu-spin-box__button", slotClassNames?.button),
|
|
@@ -7837,7 +8097,7 @@ function SpinBox({
|
|
|
7837
8097
|
children: "-"
|
|
7838
8098
|
}
|
|
7839
8099
|
),
|
|
7840
|
-
/* @__PURE__ */
|
|
8100
|
+
/* @__PURE__ */ jsx54(
|
|
7841
8101
|
"button",
|
|
7842
8102
|
{
|
|
7843
8103
|
className: cx("nu-spin-box__button", slotClassNames?.button),
|
|
@@ -7854,7 +8114,7 @@ function SpinBox({
|
|
|
7854
8114
|
]
|
|
7855
8115
|
}
|
|
7856
8116
|
),
|
|
7857
|
-
hint ? /* @__PURE__ */
|
|
8117
|
+
hint ? /* @__PURE__ */ jsx54(
|
|
7858
8118
|
"span",
|
|
7859
8119
|
{
|
|
7860
8120
|
className: cx("nu-spin-box__hint", slotClassNames?.hint),
|
|
@@ -7872,10 +8132,10 @@ function SpinBox({
|
|
|
7872
8132
|
import {
|
|
7873
8133
|
useEffect as useEffect14,
|
|
7874
8134
|
useId as useId14,
|
|
7875
|
-
useRef as
|
|
8135
|
+
useRef as useRef19,
|
|
7876
8136
|
useState as useState27
|
|
7877
8137
|
} from "react";
|
|
7878
|
-
import { jsx as
|
|
8138
|
+
import { jsx as jsx55, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7879
8139
|
function clamp4(value, min, max) {
|
|
7880
8140
|
return Math.min(max, Math.max(min, value));
|
|
7881
8141
|
}
|
|
@@ -7909,9 +8169,9 @@ function Splitter({
|
|
|
7909
8169
|
const [uncontrolledValue, setUncontrolledValue] = useState27(
|
|
7910
8170
|
clamp4(getSavedValue() ?? defaultValue, min, max)
|
|
7911
8171
|
);
|
|
7912
|
-
const rootRef =
|
|
7913
|
-
const dragFrameRef =
|
|
7914
|
-
const dragValueRef =
|
|
8172
|
+
const rootRef = useRef19(null);
|
|
8173
|
+
const dragFrameRef = useRef19(null);
|
|
8174
|
+
const dragValueRef = useRef19(null);
|
|
7915
8175
|
const activeValue = clamp4(
|
|
7916
8176
|
(isControlled ? value : uncontrolledValue) ?? defaultValue,
|
|
7917
8177
|
min,
|
|
@@ -8030,7 +8290,7 @@ function Splitter({
|
|
|
8030
8290
|
commitValue(max);
|
|
8031
8291
|
}
|
|
8032
8292
|
}
|
|
8033
|
-
return /* @__PURE__ */
|
|
8293
|
+
return /* @__PURE__ */ jsxs36(
|
|
8034
8294
|
"div",
|
|
8035
8295
|
{
|
|
8036
8296
|
...props,
|
|
@@ -8042,8 +8302,8 @@ function Splitter({
|
|
|
8042
8302
|
"--nu-splitter-value": `${activeValue * 100}%`
|
|
8043
8303
|
},
|
|
8044
8304
|
children: [
|
|
8045
|
-
/* @__PURE__ */
|
|
8046
|
-
/* @__PURE__ */
|
|
8305
|
+
/* @__PURE__ */ jsx55("div", { className: "nu-splitter__pane", id: firstPaneId, children: first }),
|
|
8306
|
+
/* @__PURE__ */ jsx55(
|
|
8047
8307
|
"div",
|
|
8048
8308
|
{
|
|
8049
8309
|
"aria-controls": `${firstPaneId} ${secondPaneId}`,
|
|
@@ -8056,7 +8316,7 @@ function Splitter({
|
|
|
8056
8316
|
onPointerDown: handlePointerDown,
|
|
8057
8317
|
role: "separator",
|
|
8058
8318
|
tabIndex: 0,
|
|
8059
|
-
children: /* @__PURE__ */
|
|
8319
|
+
children: /* @__PURE__ */ jsx55(
|
|
8060
8320
|
"span",
|
|
8061
8321
|
{
|
|
8062
8322
|
"aria-hidden": "true",
|
|
@@ -8066,7 +8326,7 @@ function Splitter({
|
|
|
8066
8326
|
)
|
|
8067
8327
|
}
|
|
8068
8328
|
),
|
|
8069
|
-
/* @__PURE__ */
|
|
8329
|
+
/* @__PURE__ */ jsx55("div", { className: "nu-splitter__pane", id: secondPaneId, children: second })
|
|
8070
8330
|
]
|
|
8071
8331
|
}
|
|
8072
8332
|
);
|
|
@@ -8076,11 +8336,11 @@ function Splitter({
|
|
|
8076
8336
|
import {
|
|
8077
8337
|
useEffect as useEffect15,
|
|
8078
8338
|
useId as useId15,
|
|
8079
|
-
useMemo as
|
|
8080
|
-
useRef as
|
|
8339
|
+
useMemo as useMemo18,
|
|
8340
|
+
useRef as useRef20,
|
|
8081
8341
|
useState as useState28
|
|
8082
8342
|
} from "react";
|
|
8083
|
-
import { jsx as
|
|
8343
|
+
import { jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
8084
8344
|
function clamp5(value, min, max) {
|
|
8085
8345
|
return Math.min(max, Math.max(min, value));
|
|
8086
8346
|
}
|
|
@@ -8127,10 +8387,10 @@ function TickBar({
|
|
|
8127
8387
|
);
|
|
8128
8388
|
const [uncontrolledValue, setUncontrolledValue] = useState28(initialValue);
|
|
8129
8389
|
const [dragging, setDragging] = useState28(false);
|
|
8130
|
-
const trackRef =
|
|
8390
|
+
const trackRef = useRef20(null);
|
|
8131
8391
|
const resolvedValue = isControlled ? clamp5(snapToStep(value ?? initialValue, min, safeStep), min, safeMax) : uncontrolledValue;
|
|
8132
8392
|
const ratio = safeMax === min ? 0 : (resolvedValue - min) / (safeMax - min);
|
|
8133
|
-
const derivedTickCount =
|
|
8393
|
+
const derivedTickCount = useMemo18(() => {
|
|
8134
8394
|
if (tickCount !== void 0) {
|
|
8135
8395
|
return Math.max(2, tickCount);
|
|
8136
8396
|
}
|
|
@@ -8216,7 +8476,7 @@ function TickBar({
|
|
|
8216
8476
|
}
|
|
8217
8477
|
onKeyDown?.(event);
|
|
8218
8478
|
}
|
|
8219
|
-
return /* @__PURE__ */
|
|
8479
|
+
return /* @__PURE__ */ jsxs37(
|
|
8220
8480
|
"div",
|
|
8221
8481
|
{
|
|
8222
8482
|
...props,
|
|
@@ -8229,7 +8489,7 @@ function TickBar({
|
|
|
8229
8489
|
slotStyles?.root
|
|
8230
8490
|
),
|
|
8231
8491
|
children: [
|
|
8232
|
-
label ? /* @__PURE__ */
|
|
8492
|
+
label ? /* @__PURE__ */ jsx56(
|
|
8233
8493
|
"span",
|
|
8234
8494
|
{
|
|
8235
8495
|
className: cx("nu-tick-bar__label", slotClassNames?.label),
|
|
@@ -8237,13 +8497,13 @@ function TickBar({
|
|
|
8237
8497
|
children: renderMnemonicText(label)
|
|
8238
8498
|
}
|
|
8239
8499
|
) : null,
|
|
8240
|
-
/* @__PURE__ */
|
|
8500
|
+
/* @__PURE__ */ jsxs37(
|
|
8241
8501
|
"div",
|
|
8242
8502
|
{
|
|
8243
8503
|
className: cx("nu-tick-bar__slot", slotClassNames?.slot),
|
|
8244
8504
|
style: slotStyles?.slot,
|
|
8245
8505
|
children: [
|
|
8246
|
-
/* @__PURE__ */
|
|
8506
|
+
/* @__PURE__ */ jsxs37(
|
|
8247
8507
|
"div",
|
|
8248
8508
|
{
|
|
8249
8509
|
"aria-describedby": hintId,
|
|
@@ -8285,19 +8545,19 @@ function TickBar({
|
|
|
8285
8545
|
style: slotStyles?.track,
|
|
8286
8546
|
tabIndex: disabled ? -1 : 0,
|
|
8287
8547
|
children: [
|
|
8288
|
-
/* @__PURE__ */
|
|
8548
|
+
/* @__PURE__ */ jsx56(
|
|
8289
8549
|
"div",
|
|
8290
8550
|
{
|
|
8291
8551
|
className: cx("nu-tick-bar__rail", slotClassNames?.rail),
|
|
8292
8552
|
style: slotStyles?.rail
|
|
8293
8553
|
}
|
|
8294
8554
|
),
|
|
8295
|
-
/* @__PURE__ */
|
|
8555
|
+
/* @__PURE__ */ jsx56(
|
|
8296
8556
|
"div",
|
|
8297
8557
|
{
|
|
8298
8558
|
className: cx("nu-tick-bar__ticks", slotClassNames?.ticks),
|
|
8299
8559
|
style: slotStyles?.ticks,
|
|
8300
|
-
children: Array.from({ length: derivedTickCount }, (_, index) => /* @__PURE__ */
|
|
8560
|
+
children: Array.from({ length: derivedTickCount }, (_, index) => /* @__PURE__ */ jsx56(
|
|
8301
8561
|
"span",
|
|
8302
8562
|
{
|
|
8303
8563
|
"aria-hidden": "true",
|
|
@@ -8308,7 +8568,7 @@ function TickBar({
|
|
|
8308
8568
|
))
|
|
8309
8569
|
}
|
|
8310
8570
|
),
|
|
8311
|
-
/* @__PURE__ */
|
|
8571
|
+
/* @__PURE__ */ jsx56(
|
|
8312
8572
|
"div",
|
|
8313
8573
|
{
|
|
8314
8574
|
"aria-hidden": "true",
|
|
@@ -8326,7 +8586,7 @@ function TickBar({
|
|
|
8326
8586
|
]
|
|
8327
8587
|
}
|
|
8328
8588
|
),
|
|
8329
|
-
showValue ? /* @__PURE__ */
|
|
8589
|
+
showValue ? /* @__PURE__ */ jsx56(
|
|
8330
8590
|
"span",
|
|
8331
8591
|
{
|
|
8332
8592
|
className: cx("nu-tick-bar__value", slotClassNames?.value),
|
|
@@ -8337,7 +8597,7 @@ function TickBar({
|
|
|
8337
8597
|
]
|
|
8338
8598
|
}
|
|
8339
8599
|
),
|
|
8340
|
-
hint ? /* @__PURE__ */
|
|
8600
|
+
hint ? /* @__PURE__ */ jsx56(
|
|
8341
8601
|
"span",
|
|
8342
8602
|
{
|
|
8343
8603
|
className: cx("nu-tick-bar__hint", slotClassNames?.hint),
|
|
@@ -8352,7 +8612,7 @@ function TickBar({
|
|
|
8352
8612
|
}
|
|
8353
8613
|
|
|
8354
8614
|
// src/components/ToolBar/ToolBar.tsx
|
|
8355
|
-
import { jsx as
|
|
8615
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
8356
8616
|
function ToolBar({
|
|
8357
8617
|
children,
|
|
8358
8618
|
className,
|
|
@@ -8362,7 +8622,7 @@ function ToolBar({
|
|
|
8362
8622
|
wrap = false,
|
|
8363
8623
|
...props
|
|
8364
8624
|
}) {
|
|
8365
|
-
return /* @__PURE__ */
|
|
8625
|
+
return /* @__PURE__ */ jsx57(
|
|
8366
8626
|
"div",
|
|
8367
8627
|
{
|
|
8368
8628
|
...props,
|
|
@@ -8381,7 +8641,7 @@ function ToolButton({
|
|
|
8381
8641
|
slotStyles,
|
|
8382
8642
|
...props
|
|
8383
8643
|
}) {
|
|
8384
|
-
return /* @__PURE__ */
|
|
8644
|
+
return /* @__PURE__ */ jsx57(
|
|
8385
8645
|
CommandButton,
|
|
8386
8646
|
{
|
|
8387
8647
|
...props,
|
|
@@ -8411,7 +8671,7 @@ function ToolDropButton({
|
|
|
8411
8671
|
uncheckedShape,
|
|
8412
8672
|
...props
|
|
8413
8673
|
}) {
|
|
8414
|
-
return /* @__PURE__ */
|
|
8674
|
+
return /* @__PURE__ */ jsx57(
|
|
8415
8675
|
CommandButton,
|
|
8416
8676
|
{
|
|
8417
8677
|
...props,
|
|
@@ -8437,7 +8697,7 @@ function ToolDropButton({
|
|
|
8437
8697
|
);
|
|
8438
8698
|
}
|
|
8439
8699
|
function ToolSeparator({ className, ...props }) {
|
|
8440
|
-
return /* @__PURE__ */
|
|
8700
|
+
return /* @__PURE__ */ jsx57(
|
|
8441
8701
|
"div",
|
|
8442
8702
|
{
|
|
8443
8703
|
...props,
|
|
@@ -8459,8 +8719,8 @@ import {
|
|
|
8459
8719
|
useEffect as useEffect16,
|
|
8460
8720
|
useId as useId16,
|
|
8461
8721
|
useImperativeHandle as useImperativeHandle3,
|
|
8462
|
-
useMemo as
|
|
8463
|
-
useRef as
|
|
8722
|
+
useMemo as useMemo19,
|
|
8723
|
+
useRef as useRef21,
|
|
8464
8724
|
useState as useState29
|
|
8465
8725
|
} from "react";
|
|
8466
8726
|
|
|
@@ -8559,7 +8819,7 @@ function collectVisibleTreeItems(items, expandedIds, depth = 0, guideMask = [],
|
|
|
8559
8819
|
|
|
8560
8820
|
// src/components/TreeView/internals/TreeViewItem.tsx
|
|
8561
8821
|
import { memo as memo4 } from "react";
|
|
8562
|
-
import { jsx as
|
|
8822
|
+
import { jsx as jsx58, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8563
8823
|
function areTreeViewGuideArraysEqual(previousArray, nextArray) {
|
|
8564
8824
|
if (previousArray.length !== nextArray.length) {
|
|
8565
8825
|
return false;
|
|
@@ -8633,8 +8893,8 @@ function TreeViewItemInner({
|
|
|
8633
8893
|
handleActivate();
|
|
8634
8894
|
onToggleItemCheck?.(item, !isChecked);
|
|
8635
8895
|
}
|
|
8636
|
-
return /* @__PURE__ */
|
|
8637
|
-
/* @__PURE__ */
|
|
8896
|
+
return /* @__PURE__ */ jsxs38("div", { className: "nu-tree-view__row", role: "none", children: [
|
|
8897
|
+
/* @__PURE__ */ jsxs38(
|
|
8638
8898
|
"div",
|
|
8639
8899
|
{
|
|
8640
8900
|
"aria-checked": isCheckable ? isChecked : void 0,
|
|
@@ -8653,8 +8913,8 @@ function TreeViewItemInner({
|
|
|
8653
8913
|
ref: (node) => registerItemRef(itemId, node),
|
|
8654
8914
|
role: "treeitem",
|
|
8655
8915
|
children: [
|
|
8656
|
-
/* @__PURE__ */
|
|
8657
|
-
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */
|
|
8916
|
+
/* @__PURE__ */ jsxs38("span", { "aria-hidden": "true", className: "nu-tree-view__prefix", children: [
|
|
8917
|
+
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ jsx58(
|
|
8658
8918
|
"span",
|
|
8659
8919
|
{
|
|
8660
8920
|
className: "nu-tree-view__guide",
|
|
@@ -8665,7 +8925,7 @@ function TreeViewItemInner({
|
|
|
8665
8925
|
},
|
|
8666
8926
|
`${itemId}-guide-${guideIndex}`
|
|
8667
8927
|
)),
|
|
8668
|
-
/* @__PURE__ */
|
|
8928
|
+
/* @__PURE__ */ jsxs38(
|
|
8669
8929
|
"span",
|
|
8670
8930
|
{
|
|
8671
8931
|
className: "nu-tree-view__lead",
|
|
@@ -8673,19 +8933,19 @@ function TreeViewItemInner({
|
|
|
8673
8933
|
"--nu-tree-view-origin-offset": originOffset
|
|
8674
8934
|
},
|
|
8675
8935
|
children: [
|
|
8676
|
-
depth > 0 ? /* @__PURE__ */
|
|
8936
|
+
depth > 0 ? /* @__PURE__ */ jsx58(
|
|
8677
8937
|
"span",
|
|
8678
8938
|
{
|
|
8679
8939
|
className: "nu-tree-view__branch",
|
|
8680
8940
|
"data-branch": hasNextSibling ? "tee" : "elbow"
|
|
8681
8941
|
}
|
|
8682
8942
|
) : null,
|
|
8683
|
-
hasChildren ? /* @__PURE__ */
|
|
8943
|
+
hasChildren ? /* @__PURE__ */ jsx58(
|
|
8684
8944
|
"span",
|
|
8685
8945
|
{
|
|
8686
8946
|
className: "nu-tree-view__expander",
|
|
8687
8947
|
"data-connector": depth > 0 ? "lead" : void 0,
|
|
8688
|
-
children: /* @__PURE__ */
|
|
8948
|
+
children: /* @__PURE__ */ jsx58(
|
|
8689
8949
|
"button",
|
|
8690
8950
|
{
|
|
8691
8951
|
"aria-label": isExpanded ? "Collapse item" : "Expand item",
|
|
@@ -8693,7 +8953,7 @@ function TreeViewItemInner({
|
|
|
8693
8953
|
onClick: handleToggleExpanded,
|
|
8694
8954
|
tabIndex: -1,
|
|
8695
8955
|
type: "button",
|
|
8696
|
-
children: /* @__PURE__ */
|
|
8956
|
+
children: /* @__PURE__ */ jsx58(
|
|
8697
8957
|
NuGlyph,
|
|
8698
8958
|
{
|
|
8699
8959
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
@@ -8702,7 +8962,7 @@ function TreeViewItemInner({
|
|
|
8702
8962
|
}
|
|
8703
8963
|
)
|
|
8704
8964
|
}
|
|
8705
|
-
) : depth > 0 ? /* @__PURE__ */
|
|
8965
|
+
) : depth > 0 ? /* @__PURE__ */ jsx58(
|
|
8706
8966
|
"span",
|
|
8707
8967
|
{
|
|
8708
8968
|
className: "nu-tree-view__expander-placeholder",
|
|
@@ -8713,8 +8973,8 @@ function TreeViewItemInner({
|
|
|
8713
8973
|
}
|
|
8714
8974
|
)
|
|
8715
8975
|
] }),
|
|
8716
|
-
/* @__PURE__ */
|
|
8717
|
-
isCheckable ? /* @__PURE__ */
|
|
8976
|
+
/* @__PURE__ */ jsxs38("span", { className: "nu-tree-view__content", children: [
|
|
8977
|
+
isCheckable ? /* @__PURE__ */ jsx58("span", { className: "nu-tree-view__check-slot", children: /* @__PURE__ */ jsx58(
|
|
8718
8978
|
"button",
|
|
8719
8979
|
{
|
|
8720
8980
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -8722,12 +8982,12 @@ function TreeViewItemInner({
|
|
|
8722
8982
|
onClick: handleToggleChecked,
|
|
8723
8983
|
tabIndex: -1,
|
|
8724
8984
|
type: "button",
|
|
8725
|
-
children: /* @__PURE__ */
|
|
8985
|
+
children: /* @__PURE__ */ jsx58(
|
|
8726
8986
|
"span",
|
|
8727
8987
|
{
|
|
8728
8988
|
className: "nu-tree-view__check-box",
|
|
8729
8989
|
"data-unchecked-shape": uncheckedShape,
|
|
8730
|
-
children: isChecked ? /* @__PURE__ */
|
|
8990
|
+
children: isChecked ? /* @__PURE__ */ jsx58(
|
|
8731
8991
|
NuGlyph,
|
|
8732
8992
|
{
|
|
8733
8993
|
className: "nu-tree-view__check-mark",
|
|
@@ -8738,14 +8998,14 @@ function TreeViewItemInner({
|
|
|
8738
8998
|
)
|
|
8739
8999
|
}
|
|
8740
9000
|
) }) : null,
|
|
8741
|
-
item.icon ? /* @__PURE__ */
|
|
8742
|
-
/* @__PURE__ */
|
|
8743
|
-
item.hint ? /* @__PURE__ */
|
|
9001
|
+
item.icon ? /* @__PURE__ */ jsx58("span", { className: "nu-tree-view__icon", children: item.icon }) : null,
|
|
9002
|
+
/* @__PURE__ */ jsx58("span", { className: "nu-tree-view__title", children: item.title }),
|
|
9003
|
+
item.hint ? /* @__PURE__ */ jsx58("span", { className: "nu-tree-view__hint", children: item.hint }) : null
|
|
8744
9004
|
] })
|
|
8745
9005
|
]
|
|
8746
9006
|
}
|
|
8747
9007
|
),
|
|
8748
|
-
hasChildren && isExpanded ? /* @__PURE__ */
|
|
9008
|
+
hasChildren && isExpanded ? /* @__PURE__ */ jsx58("div", { role: "group", children: (item.children ?? []).map((child, index) => /* @__PURE__ */ jsx58(
|
|
8749
9009
|
TreeViewItem,
|
|
8750
9010
|
{
|
|
8751
9011
|
depth: depth + 1,
|
|
@@ -8781,7 +9041,7 @@ function areTreeViewItemPropsEqual(previousProps, nextProps) {
|
|
|
8781
9041
|
var TreeViewItem = memo4(TreeViewItemInner, areTreeViewItemPropsEqual);
|
|
8782
9042
|
|
|
8783
9043
|
// src/components/TreeView/TreeView.tsx
|
|
8784
|
-
import { jsx as
|
|
9044
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
8785
9045
|
function TreeViewInner({
|
|
8786
9046
|
className,
|
|
8787
9047
|
data,
|
|
@@ -8796,9 +9056,9 @@ function TreeViewInner({
|
|
|
8796
9056
|
uncheckedShape = "box",
|
|
8797
9057
|
...props
|
|
8798
9058
|
}, ref) {
|
|
8799
|
-
const rootRef =
|
|
9059
|
+
const rootRef = useRef21(null);
|
|
8800
9060
|
const treeId = useId16();
|
|
8801
|
-
const itemRefs =
|
|
9061
|
+
const itemRefs = useRef21({});
|
|
8802
9062
|
const isExpandedControlled = expandedIds !== void 0;
|
|
8803
9063
|
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = useState29(() => {
|
|
8804
9064
|
const expandedFromData = collectExpandedTreeIds(data);
|
|
@@ -8809,15 +9069,15 @@ function TreeViewInner({
|
|
|
8809
9069
|
});
|
|
8810
9070
|
const [uncontrolledSelectedId, setUncontrolledSelectedId] = useState29(null);
|
|
8811
9071
|
const resolvedExpandedIds = isExpandedControlled ? expandedIds : uncontrolledExpandedIds;
|
|
8812
|
-
const expandedIdSet =
|
|
9072
|
+
const expandedIdSet = useMemo19(
|
|
8813
9073
|
() => new Set(resolvedExpandedIds),
|
|
8814
9074
|
[resolvedExpandedIds]
|
|
8815
9075
|
);
|
|
8816
|
-
const visibleItems =
|
|
9076
|
+
const visibleItems = useMemo19(
|
|
8817
9077
|
() => collectVisibleTreeItems(data, expandedIdSet),
|
|
8818
9078
|
[data, expandedIdSet]
|
|
8819
9079
|
);
|
|
8820
|
-
const selectableItems =
|
|
9080
|
+
const selectableItems = useMemo19(
|
|
8821
9081
|
() => visibleItems.filter(({ item }) => !item.disabled),
|
|
8822
9082
|
[visibleItems]
|
|
8823
9083
|
);
|
|
@@ -9032,7 +9292,7 @@ function TreeViewInner({
|
|
|
9032
9292
|
setExpandedState
|
|
9033
9293
|
]
|
|
9034
9294
|
);
|
|
9035
|
-
return /* @__PURE__ */
|
|
9295
|
+
return /* @__PURE__ */ jsx59(
|
|
9036
9296
|
"div",
|
|
9037
9297
|
{
|
|
9038
9298
|
...props,
|
|
@@ -9042,7 +9302,7 @@ function TreeViewInner({
|
|
|
9042
9302
|
ref: rootRef,
|
|
9043
9303
|
role: "tree",
|
|
9044
9304
|
tabIndex: 0,
|
|
9045
|
-
children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */
|
|
9305
|
+
children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ jsx59(
|
|
9046
9306
|
TreeViewItem,
|
|
9047
9307
|
{
|
|
9048
9308
|
depth: 0,
|
|
@@ -9062,7 +9322,7 @@ function TreeViewInner({
|
|
|
9062
9322
|
uncheckedShape
|
|
9063
9323
|
},
|
|
9064
9324
|
item.id
|
|
9065
|
-
)) : /* @__PURE__ */
|
|
9325
|
+
)) : /* @__PURE__ */ jsx59("div", { className: "nu-tree-view__empty", children: emptyText })
|
|
9066
9326
|
}
|
|
9067
9327
|
);
|
|
9068
9328
|
}
|
|
@@ -9076,8 +9336,8 @@ import {
|
|
|
9076
9336
|
useId as useId17,
|
|
9077
9337
|
useImperativeHandle as useImperativeHandle4,
|
|
9078
9338
|
useLayoutEffect as useLayoutEffect5,
|
|
9079
|
-
useMemo as
|
|
9080
|
-
useRef as
|
|
9339
|
+
useMemo as useMemo20,
|
|
9340
|
+
useRef as useRef22,
|
|
9081
9341
|
useState as useState30
|
|
9082
9342
|
} from "react";
|
|
9083
9343
|
|
|
@@ -9169,11 +9429,11 @@ function renderTreeListCellValue(item, column) {
|
|
|
9169
9429
|
|
|
9170
9430
|
// src/components/TreeListView/internals/TreeListViewRow.tsx
|
|
9171
9431
|
import { memo as memo5 } from "react";
|
|
9172
|
-
import { Fragment as Fragment7, jsx as
|
|
9432
|
+
import { Fragment as Fragment7, jsx as jsx60, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9173
9433
|
function renderTreeTitleContent(item) {
|
|
9174
|
-
return /* @__PURE__ */
|
|
9175
|
-
/* @__PURE__ */
|
|
9176
|
-
item.hint ? /* @__PURE__ */
|
|
9434
|
+
return /* @__PURE__ */ jsxs39(Fragment7, { children: [
|
|
9435
|
+
/* @__PURE__ */ jsx60("span", { className: "nu-tree-list-view__title", children: item.title }),
|
|
9436
|
+
item.hint ? /* @__PURE__ */ jsx60("span", { className: "nu-tree-list-view__hint", children: item.hint }) : null
|
|
9177
9437
|
] });
|
|
9178
9438
|
}
|
|
9179
9439
|
function renderReportCellContent(item, column, depth, rowIndex, getCellContent) {
|
|
@@ -9213,12 +9473,14 @@ function TreeListViewRowInner({
|
|
|
9213
9473
|
depth,
|
|
9214
9474
|
expandedIdSet,
|
|
9215
9475
|
getCellContent,
|
|
9476
|
+
getDragItem,
|
|
9216
9477
|
guideMask,
|
|
9217
9478
|
guideOffsets,
|
|
9218
9479
|
hasNextSibling,
|
|
9219
9480
|
item,
|
|
9220
9481
|
onActivateItem,
|
|
9221
9482
|
onDoubleClickItem,
|
|
9483
|
+
onItemDragOut,
|
|
9222
9484
|
onPopupMenuItem,
|
|
9223
9485
|
onToggleItemCheck,
|
|
9224
9486
|
onToggleItemExpanded,
|
|
@@ -9240,6 +9502,18 @@ function TreeListViewRowInner({
|
|
|
9240
9502
|
const isSelected = itemId === selectedItemId;
|
|
9241
9503
|
const rowIndex = rowIndexMap.get(itemId) ?? 0;
|
|
9242
9504
|
const leadOffset = depth > 0 && hasChildren ? 1 : 0;
|
|
9505
|
+
const dragContext = {
|
|
9506
|
+
depth,
|
|
9507
|
+
isLeaf: !hasChildren,
|
|
9508
|
+
item,
|
|
9509
|
+
rowIndex
|
|
9510
|
+
};
|
|
9511
|
+
const dragSource = useNuDragSource({
|
|
9512
|
+
disabled: item.disabled || !getDragItem,
|
|
9513
|
+
getItem: () => getDragItem?.(item, dragContext) ?? false,
|
|
9514
|
+
onDropAccepted: () => onItemDragOut?.(item, dragContext),
|
|
9515
|
+
sourceType: "tree-list-item"
|
|
9516
|
+
});
|
|
9243
9517
|
function handleActivate() {
|
|
9244
9518
|
if (item.disabled) {
|
|
9245
9519
|
return;
|
|
@@ -9285,8 +9559,8 @@ function TreeListViewRowInner({
|
|
|
9285
9559
|
handleActivate();
|
|
9286
9560
|
onToggleItemCheck?.(item, !isChecked);
|
|
9287
9561
|
}
|
|
9288
|
-
return /* @__PURE__ */
|
|
9289
|
-
/* @__PURE__ */
|
|
9562
|
+
return /* @__PURE__ */ jsxs39(Fragment7, { children: [
|
|
9563
|
+
/* @__PURE__ */ jsx60(
|
|
9290
9564
|
"div",
|
|
9291
9565
|
{
|
|
9292
9566
|
"aria-disabled": item.disabled || void 0,
|
|
@@ -9304,13 +9578,17 @@ function TreeListViewRowInner({
|
|
|
9304
9578
|
onClick: handleActivate,
|
|
9305
9579
|
onContextMenu: onPopupMenuItem ? handleContextMenu : void 0,
|
|
9306
9580
|
onDoubleClick: handleDoubleClick,
|
|
9581
|
+
onPointerCancel: dragSource.onPointerCancel,
|
|
9582
|
+
onPointerDown: dragSource.onPointerDown,
|
|
9583
|
+
onPointerMove: dragSource.onPointerMove,
|
|
9584
|
+
onPointerUp: dragSource.onPointerUp,
|
|
9307
9585
|
ref: (node) => registerItemRef(itemId, node),
|
|
9308
9586
|
role: "row",
|
|
9309
9587
|
style: {
|
|
9310
9588
|
"--nu-tree-list-view-columns": templateColumns
|
|
9311
9589
|
},
|
|
9312
9590
|
children: columns.map(
|
|
9313
|
-
(column, columnIndex) => column.id === treeColumnId ? /* @__PURE__ */
|
|
9591
|
+
(column, columnIndex) => column.id === treeColumnId ? /* @__PURE__ */ jsxs39(
|
|
9314
9592
|
"span",
|
|
9315
9593
|
{
|
|
9316
9594
|
className: [
|
|
@@ -9322,8 +9600,8 @@ function TreeListViewRowInner({
|
|
|
9322
9600
|
"data-column-id": column.id,
|
|
9323
9601
|
role: "gridcell",
|
|
9324
9602
|
children: [
|
|
9325
|
-
/* @__PURE__ */
|
|
9326
|
-
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */
|
|
9603
|
+
/* @__PURE__ */ jsxs39("span", { "aria-hidden": "true", className: "nu-tree-list-view__prefix", children: [
|
|
9604
|
+
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ jsx60(
|
|
9327
9605
|
"span",
|
|
9328
9606
|
{
|
|
9329
9607
|
className: "nu-tree-list-view__guide",
|
|
@@ -9334,7 +9612,7 @@ function TreeListViewRowInner({
|
|
|
9334
9612
|
},
|
|
9335
9613
|
`${itemId}-guide-${guideIndex}`
|
|
9336
9614
|
)),
|
|
9337
|
-
/* @__PURE__ */
|
|
9615
|
+
/* @__PURE__ */ jsxs39(
|
|
9338
9616
|
"span",
|
|
9339
9617
|
{
|
|
9340
9618
|
className: "nu-tree-list-view__lead",
|
|
@@ -9342,19 +9620,19 @@ function TreeListViewRowInner({
|
|
|
9342
9620
|
"--nu-tree-list-view-origin-offset": originOffset
|
|
9343
9621
|
},
|
|
9344
9622
|
children: [
|
|
9345
|
-
depth > 0 ? /* @__PURE__ */
|
|
9623
|
+
depth > 0 ? /* @__PURE__ */ jsx60(
|
|
9346
9624
|
"span",
|
|
9347
9625
|
{
|
|
9348
9626
|
className: "nu-tree-list-view__branch",
|
|
9349
9627
|
"data-branch": hasNextSibling ? "tee" : "elbow"
|
|
9350
9628
|
}
|
|
9351
9629
|
) : null,
|
|
9352
|
-
hasChildren ? /* @__PURE__ */
|
|
9630
|
+
hasChildren ? /* @__PURE__ */ jsx60(
|
|
9353
9631
|
"span",
|
|
9354
9632
|
{
|
|
9355
9633
|
className: "nu-tree-list-view__expander",
|
|
9356
9634
|
"data-connector": depth > 0 ? "lead" : void 0,
|
|
9357
|
-
children: /* @__PURE__ */
|
|
9635
|
+
children: /* @__PURE__ */ jsx60(
|
|
9358
9636
|
"button",
|
|
9359
9637
|
{
|
|
9360
9638
|
"aria-label": isExpanded ? "Collapse item" : "Expand item",
|
|
@@ -9362,7 +9640,7 @@ function TreeListViewRowInner({
|
|
|
9362
9640
|
onClick: handleToggleExpanded,
|
|
9363
9641
|
tabIndex: -1,
|
|
9364
9642
|
type: "button",
|
|
9365
|
-
children: /* @__PURE__ */
|
|
9643
|
+
children: /* @__PURE__ */ jsx60(
|
|
9366
9644
|
NuGlyph,
|
|
9367
9645
|
{
|
|
9368
9646
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
@@ -9371,7 +9649,7 @@ function TreeListViewRowInner({
|
|
|
9371
9649
|
}
|
|
9372
9650
|
)
|
|
9373
9651
|
}
|
|
9374
|
-
) : depth > 0 ? /* @__PURE__ */
|
|
9652
|
+
) : depth > 0 ? /* @__PURE__ */ jsx60(
|
|
9375
9653
|
"span",
|
|
9376
9654
|
{
|
|
9377
9655
|
className: "nu-tree-list-view__expander-placeholder",
|
|
@@ -9382,8 +9660,8 @@ function TreeListViewRowInner({
|
|
|
9382
9660
|
}
|
|
9383
9661
|
)
|
|
9384
9662
|
] }),
|
|
9385
|
-
/* @__PURE__ */
|
|
9386
|
-
isCheckable ? /* @__PURE__ */
|
|
9663
|
+
/* @__PURE__ */ jsxs39("span", { className: "nu-tree-list-view__tree-content", children: [
|
|
9664
|
+
isCheckable ? /* @__PURE__ */ jsx60("span", { className: "nu-tree-list-view__check-slot", children: /* @__PURE__ */ jsx60(
|
|
9387
9665
|
"button",
|
|
9388
9666
|
{
|
|
9389
9667
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -9391,12 +9669,12 @@ function TreeListViewRowInner({
|
|
|
9391
9669
|
onClick: handleToggleChecked,
|
|
9392
9670
|
tabIndex: -1,
|
|
9393
9671
|
type: "button",
|
|
9394
|
-
children: /* @__PURE__ */
|
|
9672
|
+
children: /* @__PURE__ */ jsx60(
|
|
9395
9673
|
"span",
|
|
9396
9674
|
{
|
|
9397
9675
|
className: "nu-tree-list-view__check-box",
|
|
9398
9676
|
"data-unchecked-shape": uncheckedShape,
|
|
9399
|
-
children: isChecked ? /* @__PURE__ */
|
|
9677
|
+
children: isChecked ? /* @__PURE__ */ jsx60(
|
|
9400
9678
|
NuGlyph,
|
|
9401
9679
|
{
|
|
9402
9680
|
className: "nu-tree-list-view__check-mark",
|
|
@@ -9407,13 +9685,13 @@ function TreeListViewRowInner({
|
|
|
9407
9685
|
)
|
|
9408
9686
|
}
|
|
9409
9687
|
) }) : null,
|
|
9410
|
-
item.icon ? /* @__PURE__ */
|
|
9688
|
+
item.icon ? /* @__PURE__ */ jsx60("span", { className: "nu-tree-list-view__icon", children: item.icon }) : null,
|
|
9411
9689
|
renderTreeTitleContent(item)
|
|
9412
9690
|
] })
|
|
9413
9691
|
]
|
|
9414
9692
|
},
|
|
9415
9693
|
column.id
|
|
9416
|
-
) : /* @__PURE__ */
|
|
9694
|
+
) : /* @__PURE__ */ jsx60(
|
|
9417
9695
|
"span",
|
|
9418
9696
|
{
|
|
9419
9697
|
className: [
|
|
@@ -9436,7 +9714,7 @@ function TreeListViewRowInner({
|
|
|
9436
9714
|
)
|
|
9437
9715
|
}
|
|
9438
9716
|
),
|
|
9439
|
-
hasChildren && isExpanded ? /* @__PURE__ */
|
|
9717
|
+
hasChildren && isExpanded ? /* @__PURE__ */ jsx60("div", { role: "rowgroup", children: (item.children ?? []).map((child, index) => /* @__PURE__ */ jsx60(
|
|
9440
9718
|
TreeListViewRow,
|
|
9441
9719
|
{
|
|
9442
9720
|
activeItemId,
|
|
@@ -9445,12 +9723,14 @@ function TreeListViewRowInner({
|
|
|
9445
9723
|
depth: depth + 1,
|
|
9446
9724
|
expandedIdSet,
|
|
9447
9725
|
getCellContent,
|
|
9726
|
+
getDragItem,
|
|
9448
9727
|
guideMask: [...guideMask, hasNextSibling],
|
|
9449
9728
|
guideOffsets: [...guideOffsets, originOffset],
|
|
9450
9729
|
hasNextSibling: index < (item.children?.length ?? 0) - 1,
|
|
9451
9730
|
item: child,
|
|
9452
9731
|
onActivateItem,
|
|
9453
9732
|
onDoubleClickItem,
|
|
9733
|
+
onItemDragOut,
|
|
9454
9734
|
onPopupMenuItem,
|
|
9455
9735
|
onToggleItemCheck,
|
|
9456
9736
|
onToggleItemExpanded,
|
|
@@ -9481,8 +9761,9 @@ var TreeListViewRow = memo5(
|
|
|
9481
9761
|
);
|
|
9482
9762
|
|
|
9483
9763
|
// src/components/TreeListView/TreeListView.tsx
|
|
9484
|
-
import { jsx as
|
|
9764
|
+
import { jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9485
9765
|
function TreeListViewInner({
|
|
9766
|
+
acceptsDrop,
|
|
9486
9767
|
activeItemId: activeItemIdProp,
|
|
9487
9768
|
checkedIds,
|
|
9488
9769
|
className,
|
|
@@ -9494,21 +9775,25 @@ function TreeListViewInner({
|
|
|
9494
9775
|
defaultExpandedIds,
|
|
9495
9776
|
emptyText = "No items",
|
|
9496
9777
|
expandedIds,
|
|
9778
|
+
getDragItem,
|
|
9497
9779
|
getCellContent,
|
|
9498
9780
|
onActiveItemChange,
|
|
9499
9781
|
onExpandedIdsChange,
|
|
9500
9782
|
onItemCheckChange,
|
|
9501
9783
|
onItemDoubleClick,
|
|
9784
|
+
onItemDragOut,
|
|
9502
9785
|
onItemSelect,
|
|
9786
|
+
onDrop,
|
|
9503
9787
|
selectedId,
|
|
9504
9788
|
uncheckedShape = "box",
|
|
9505
9789
|
...props
|
|
9506
9790
|
}, ref) {
|
|
9507
|
-
const rootRef =
|
|
9791
|
+
const rootRef = useRef22(null);
|
|
9792
|
+
const [rootElement, setRootElement] = useState30(null);
|
|
9508
9793
|
const treeId = useId17();
|
|
9509
|
-
const itemRefs =
|
|
9510
|
-
const resizeFrameRef =
|
|
9511
|
-
const resizeStateRef =
|
|
9794
|
+
const itemRefs = useRef22({});
|
|
9795
|
+
const resizeFrameRef = useRef22(null);
|
|
9796
|
+
const resizeStateRef = useRef22(null);
|
|
9512
9797
|
const isExpandedControlled = expandedIds !== void 0;
|
|
9513
9798
|
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = useState30(() => {
|
|
9514
9799
|
const expandedFromData = collectExpandedTreeListIds(data);
|
|
@@ -9522,15 +9807,15 @@ function TreeListViewInner({
|
|
|
9522
9807
|
const [userColumnWidths, setUserColumnWidths] = useState30({});
|
|
9523
9808
|
const isActiveControlled = activeItemIdProp !== void 0;
|
|
9524
9809
|
const resolvedExpandedIds = isExpandedControlled ? expandedIds : uncontrolledExpandedIds;
|
|
9525
|
-
const expandedIdSet =
|
|
9810
|
+
const expandedIdSet = useMemo20(
|
|
9526
9811
|
() => new Set(resolvedExpandedIds),
|
|
9527
9812
|
[resolvedExpandedIds]
|
|
9528
9813
|
);
|
|
9529
|
-
const visibleItems =
|
|
9814
|
+
const visibleItems = useMemo20(
|
|
9530
9815
|
() => collectVisibleTreeListItems(data, expandedIdSet),
|
|
9531
9816
|
[data, expandedIdSet]
|
|
9532
9817
|
);
|
|
9533
|
-
const selectableItems =
|
|
9818
|
+
const selectableItems = useMemo20(
|
|
9534
9819
|
() => visibleItems.filter(({ item }) => !item.disabled),
|
|
9535
9820
|
[visibleItems]
|
|
9536
9821
|
);
|
|
@@ -9539,7 +9824,7 @@ function TreeListViewInner({
|
|
|
9539
9824
|
const [uncontrolledActiveItemId, setUncontrolledActiveItemId] = useState30(() => defaultActiveItemId ?? resolvedSelectedId);
|
|
9540
9825
|
const activeItemId = activeItemIdProp !== void 0 ? activeItemIdProp : uncontrolledActiveItemId;
|
|
9541
9826
|
const resolvedActiveItemId = activeItemId && selectableItems.some((entry) => entry.itemId === activeItemId) ? activeItemId : resolvedSelectedId;
|
|
9542
|
-
const minColumnWidthById =
|
|
9827
|
+
const minColumnWidthById = useMemo20(
|
|
9543
9828
|
() => Object.fromEntries(
|
|
9544
9829
|
columns.map(
|
|
9545
9830
|
(column) => [column.id, column.minWidth ?? 0]
|
|
@@ -9547,23 +9832,32 @@ function TreeListViewInner({
|
|
|
9547
9832
|
),
|
|
9548
9833
|
[columns]
|
|
9549
9834
|
);
|
|
9550
|
-
const templateColumns =
|
|
9835
|
+
const templateColumns = useMemo20(
|
|
9551
9836
|
() => getTreeListTemplateColumns(columns, {
|
|
9552
9837
|
autoColumnWidths,
|
|
9553
9838
|
userColumnWidths
|
|
9554
9839
|
}),
|
|
9555
9840
|
[autoColumnWidths, columns, userColumnWidths]
|
|
9556
9841
|
);
|
|
9557
|
-
const treeColumnId =
|
|
9842
|
+
const treeColumnId = useMemo20(
|
|
9558
9843
|
() => getTreeListTreeColumnId(columns),
|
|
9559
9844
|
[columns]
|
|
9560
9845
|
);
|
|
9561
|
-
const rowIndexMap =
|
|
9846
|
+
const rowIndexMap = useMemo20(
|
|
9562
9847
|
() => new Map(
|
|
9563
9848
|
visibleItems.map((entry, index) => [entry.itemId, index])
|
|
9564
9849
|
),
|
|
9565
9850
|
[visibleItems]
|
|
9566
9851
|
);
|
|
9852
|
+
const dropTargetOptions = useMemo20(
|
|
9853
|
+
() => onDrop ? { accepts: acceptsDrop, onDrop, type: "tree-list" } : void 0,
|
|
9854
|
+
[acceptsDrop, onDrop]
|
|
9855
|
+
);
|
|
9856
|
+
useNuDropTarget(rootElement, dropTargetOptions);
|
|
9857
|
+
const setRootRef = useCallback8((node) => {
|
|
9858
|
+
rootRef.current = node;
|
|
9859
|
+
setRootElement(node);
|
|
9860
|
+
}, []);
|
|
9567
9861
|
useEffect17(() => {
|
|
9568
9862
|
if (!resolvedActiveItemId) {
|
|
9569
9863
|
return;
|
|
@@ -9911,7 +10205,7 @@ function TreeListViewInner({
|
|
|
9911
10205
|
window.addEventListener("pointermove", handleColumnResizeMove);
|
|
9912
10206
|
window.addEventListener("pointerup", handleColumnResizeEnd);
|
|
9913
10207
|
}
|
|
9914
|
-
return /* @__PURE__ */
|
|
10208
|
+
return /* @__PURE__ */ jsxs40(
|
|
9915
10209
|
"div",
|
|
9916
10210
|
{
|
|
9917
10211
|
...props,
|
|
@@ -9919,11 +10213,11 @@ function TreeListViewInner({
|
|
|
9919
10213
|
className: ["nu-tree-list-view", className].filter(Boolean).join(" "),
|
|
9920
10214
|
"data-version": dataVersion,
|
|
9921
10215
|
onKeyDown: handleKeyDown,
|
|
9922
|
-
ref:
|
|
10216
|
+
ref: setRootRef,
|
|
9923
10217
|
role: "treegrid",
|
|
9924
10218
|
tabIndex: 0,
|
|
9925
10219
|
children: [
|
|
9926
|
-
/* @__PURE__ */
|
|
10220
|
+
/* @__PURE__ */ jsx61(
|
|
9927
10221
|
"div",
|
|
9928
10222
|
{
|
|
9929
10223
|
className: "nu-tree-list-view__header",
|
|
@@ -9931,7 +10225,7 @@ function TreeListViewInner({
|
|
|
9931
10225
|
style: {
|
|
9932
10226
|
"--nu-tree-list-view-columns": templateColumns
|
|
9933
10227
|
},
|
|
9934
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */
|
|
10228
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsxs40(
|
|
9935
10229
|
"span",
|
|
9936
10230
|
{
|
|
9937
10231
|
className: [
|
|
@@ -9942,8 +10236,8 @@ function TreeListViewInner({
|
|
|
9942
10236
|
"data-column-id": column.id,
|
|
9943
10237
|
role: "columnheader",
|
|
9944
10238
|
children: [
|
|
9945
|
-
/* @__PURE__ */
|
|
9946
|
-
column.resizable !== false ? /* @__PURE__ */
|
|
10239
|
+
/* @__PURE__ */ jsx61("span", { className: "nu-tree-list-view__header-label", children: renderMnemonicText(column.title) }),
|
|
10240
|
+
column.resizable !== false ? /* @__PURE__ */ jsx61(
|
|
9947
10241
|
"button",
|
|
9948
10242
|
{
|
|
9949
10243
|
"aria-label": `Resize ${column.title} column`,
|
|
@@ -9959,7 +10253,7 @@ function TreeListViewInner({
|
|
|
9959
10253
|
))
|
|
9960
10254
|
}
|
|
9961
10255
|
),
|
|
9962
|
-
/* @__PURE__ */
|
|
10256
|
+
/* @__PURE__ */ jsx61("div", { className: "nu-tree-list-view__body", children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ jsx61(
|
|
9963
10257
|
TreeListViewRow,
|
|
9964
10258
|
{
|
|
9965
10259
|
activeItemId: resolvedActiveItemId,
|
|
@@ -9968,12 +10262,14 @@ function TreeListViewInner({
|
|
|
9968
10262
|
depth: 0,
|
|
9969
10263
|
expandedIdSet,
|
|
9970
10264
|
getCellContent: getCellContent ? resolveCellContent : void 0,
|
|
10265
|
+
getDragItem,
|
|
9971
10266
|
guideMask: [],
|
|
9972
10267
|
guideOffsets: [],
|
|
9973
10268
|
hasNextSibling: index < data.length - 1,
|
|
9974
10269
|
item,
|
|
9975
10270
|
onActivateItem: activateEntry,
|
|
9976
10271
|
onDoubleClickItem: onItemDoubleClick ? handleItemDoubleClick : void 0,
|
|
10272
|
+
onItemDragOut,
|
|
9977
10273
|
onPopupMenuItem: handleItemPopupMenu,
|
|
9978
10274
|
onToggleItemCheck: handleItemCheckChange,
|
|
9979
10275
|
onToggleItemExpanded: setExpandedState,
|
|
@@ -9987,7 +10283,7 @@ function TreeListViewInner({
|
|
|
9987
10283
|
uncheckedShape
|
|
9988
10284
|
},
|
|
9989
10285
|
item.id
|
|
9990
|
-
)) : /* @__PURE__ */
|
|
10286
|
+
)) : /* @__PURE__ */ jsx61("div", { className: "nu-tree-list-view__empty", children: emptyText }) })
|
|
9991
10287
|
]
|
|
9992
10288
|
}
|
|
9993
10289
|
);
|
|
@@ -9998,7 +10294,7 @@ var TreeListView = forwardRef4(TreeListViewInner);
|
|
|
9998
10294
|
import {
|
|
9999
10295
|
useCallback as useCallback9,
|
|
10000
10296
|
useId as useId18,
|
|
10001
|
-
useMemo as
|
|
10297
|
+
useMemo as useMemo21,
|
|
10002
10298
|
useState as useState31
|
|
10003
10299
|
} from "react";
|
|
10004
10300
|
|
|
@@ -10126,31 +10422,31 @@ var midnightTheme = {
|
|
|
10126
10422
|
shellBackground: "#101722",
|
|
10127
10423
|
appBackground: "#17273b",
|
|
10128
10424
|
appBackgroundAlt: "#0d1724",
|
|
10129
|
-
chromeBackground: "#
|
|
10130
|
-
panelBackground: "#
|
|
10425
|
+
chromeBackground: "#36547d",
|
|
10426
|
+
panelBackground: "#192c43",
|
|
10131
10427
|
panelInsetBackground: "#111e2e",
|
|
10132
|
-
titleBackground: "#
|
|
10133
|
-
menuBackground: "#
|
|
10134
|
-
titleText: "#
|
|
10135
|
-
textPrimary: "#
|
|
10136
|
-
textMuted: "#
|
|
10137
|
-
textInverse: "#
|
|
10138
|
-
mainMenuText: "#
|
|
10139
|
-
textAccent: "#
|
|
10140
|
-
textHotkey: "#
|
|
10141
|
-
buttonFace: "#
|
|
10142
|
-
buttonFaceAlt: "#
|
|
10143
|
-
buttonDanger: "#
|
|
10428
|
+
titleBackground: "#0b2432",
|
|
10429
|
+
menuBackground: "#1c2945",
|
|
10430
|
+
titleText: "#c2d0e5",
|
|
10431
|
+
textPrimary: "#6b9adb",
|
|
10432
|
+
textMuted: "#65a8ec",
|
|
10433
|
+
textInverse: "#b7caf0",
|
|
10434
|
+
mainMenuText: "#b7caf0",
|
|
10435
|
+
textAccent: "#ffcd57",
|
|
10436
|
+
textHotkey: "#fb0404",
|
|
10437
|
+
buttonFace: "#5074af",
|
|
10438
|
+
buttonFaceAlt: "#3c5372",
|
|
10439
|
+
buttonDanger: "#4e0e15",
|
|
10144
10440
|
buttonSuccess: "#3c936d",
|
|
10145
|
-
buttonText: "#
|
|
10441
|
+
buttonText: "#ffffff",
|
|
10146
10442
|
fieldBackground: "#09111c",
|
|
10147
|
-
fieldText: "#
|
|
10148
|
-
borderLight: "#
|
|
10149
|
-
borderDark: "#
|
|
10150
|
-
borderAccent: "#
|
|
10443
|
+
fieldText: "#627b9d",
|
|
10444
|
+
borderLight: "#415776",
|
|
10445
|
+
borderDark: "#1d2134",
|
|
10446
|
+
borderAccent: "#3b5681",
|
|
10151
10447
|
shadowColor: "#070c14",
|
|
10152
10448
|
panelShadowColor: "rgb(7 12 20 / 0.56)",
|
|
10153
|
-
focusColor: "#
|
|
10449
|
+
focusColor: "#af532c",
|
|
10154
10450
|
windowInactiveOverlay: "rgb(7 12 20 / 0.3)",
|
|
10155
10451
|
windowModalBackdrop: "rgb(7 12 20 / 0.48)"
|
|
10156
10452
|
}
|
|
@@ -10279,10 +10575,10 @@ function getNuDesktopPatternStyle(mode) {
|
|
|
10279
10575
|
}
|
|
10280
10576
|
|
|
10281
10577
|
// src/theme/themeContext.ts
|
|
10282
|
-
import { createContext as
|
|
10283
|
-
var NuThemeContext =
|
|
10578
|
+
import { createContext as createContext6, useContext as useContext10 } from "react";
|
|
10579
|
+
var NuThemeContext = createContext6(null);
|
|
10284
10580
|
function useNuTheme() {
|
|
10285
|
-
const context =
|
|
10581
|
+
const context = useContext10(NuThemeContext);
|
|
10286
10582
|
if (!context) {
|
|
10287
10583
|
throw new Error("useNuTheme must be used within a NuThemeProvider.");
|
|
10288
10584
|
}
|
|
@@ -10290,7 +10586,7 @@ function useNuTheme() {
|
|
|
10290
10586
|
}
|
|
10291
10587
|
|
|
10292
10588
|
// src/theme/NuThemeProvider.tsx
|
|
10293
|
-
import { jsx as
|
|
10589
|
+
import { jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
10294
10590
|
function NuThemeProvider({
|
|
10295
10591
|
children,
|
|
10296
10592
|
className,
|
|
@@ -10356,7 +10652,7 @@ function NuThemeProvider({
|
|
|
10356
10652
|
},
|
|
10357
10653
|
[fontSize, onFontSizeChange]
|
|
10358
10654
|
);
|
|
10359
|
-
const contextValue =
|
|
10655
|
+
const contextValue = useMemo21(
|
|
10360
10656
|
() => ({
|
|
10361
10657
|
desktopPatternMode: resolvedDesktopPatternMode,
|
|
10362
10658
|
fontFamily: resolvedFontFamily,
|
|
@@ -10381,7 +10677,7 @@ function NuThemeProvider({
|
|
|
10381
10677
|
handleThemeChange
|
|
10382
10678
|
]
|
|
10383
10679
|
);
|
|
10384
|
-
return /* @__PURE__ */
|
|
10680
|
+
return /* @__PURE__ */ jsx62(NuThemeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs41(
|
|
10385
10681
|
"div",
|
|
10386
10682
|
{
|
|
10387
10683
|
className: ["nu-theme-root", className].filter(Boolean).join(" "),
|
|
@@ -10396,7 +10692,7 @@ function NuThemeProvider({
|
|
|
10396
10692
|
...style
|
|
10397
10693
|
},
|
|
10398
10694
|
children: [
|
|
10399
|
-
crtGlitch ? /* @__PURE__ */
|
|
10695
|
+
crtGlitch ? /* @__PURE__ */ jsx62(NuCrtGlitch, { ...typeof crtGlitch === "object" ? crtGlitch : {} }) : null,
|
|
10400
10696
|
children
|
|
10401
10697
|
]
|
|
10402
10698
|
}
|
|
@@ -10423,6 +10719,7 @@ export {
|
|
|
10423
10719
|
NuAppHostProvider,
|
|
10424
10720
|
NuCrtGlitch,
|
|
10425
10721
|
NuDesktop,
|
|
10722
|
+
NuDragDropProvider,
|
|
10426
10723
|
NuGlyph,
|
|
10427
10724
|
NuIconGrid,
|
|
10428
10725
|
NuIconProvider,
|
|
@@ -10468,6 +10765,9 @@ export {
|
|
|
10468
10765
|
resolveNuTheme,
|
|
10469
10766
|
useAppHostMenu,
|
|
10470
10767
|
useMainMenuState,
|
|
10768
|
+
useNuDragDrop,
|
|
10769
|
+
useNuDragSource,
|
|
10770
|
+
useNuDropTarget,
|
|
10471
10771
|
useNuIconManager,
|
|
10472
10772
|
useNuTheme,
|
|
10473
10773
|
useNuWindowManager,
|