elseware-ui 3.0.9 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +126 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +316 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +316 -61
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +2 -2
- package/dist/index.native.d.ts +2 -2
- package/dist/{resolveGlobalConfigs-C0BREpe1.d.mts → resolveGlobalConfigs-BdBJw5_w.d.mts} +10 -1
- package/dist/{resolveGlobalConfigs-C0BREpe1.d.ts → resolveGlobalConfigs-BdBJw5_w.d.ts} +10 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, SelectHTMLAttributes, InputHTMLAttributes, JSX, Dispatch, SetStateAction, ImgHTMLAttributes, ComponentPropsWithoutRef, HTMLAttributes, TdHTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, FC, ComponentType, MouseEvent, HTMLAttributeAnchorTarget, BlockquoteHTMLAttributes, AnchorHTMLAttributes, OlHTMLAttributes, LiHTMLAttributes, DetailsHTMLAttributes, ClassAttributes, TextareaHTMLAttributes, FocusEventHandler, MutableRefObject } from 'react';
|
|
3
|
-
import { y as BaseComponentProps, V as Variant, A as Appearance, z as Shape, G as Size, O as OctilePosition, H as TitleBannerLevel, L as ListBulletType, J as ListDirection, K as ListAlign, M as CurrencyCode, P as SpinnerType, Q as SpinnerDirection, R as TextDecoration, B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, U as Shape$1, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps, W as ToastStatus, X as ToastPosition, Y as Target, Z as TextVariant, _ as Decoration, $ as RouteTabMode, a0 as Variant$1 } from './resolveGlobalConfigs-
|
|
4
|
-
export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, a1 as CardinalPosition, l as CheckboxColumns, m as CheckboxOption, a2 as CornerPosition, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, a3 as HorizontalPosition, a4 as HyperRefTarget, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, a5 as VerticalPosition, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-
|
|
3
|
+
import { y as BaseComponentProps, V as Variant, A as Appearance, z as Shape, G as Size, O as OctilePosition, H as TitleBannerLevel, L as ListBulletType, J as ListDirection, K as ListAlign, M as CurrencyCode, P as SpinnerType, Q as SpinnerDirection, R as TextDecoration, B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, U as Shape$1, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps, W as ToastStatus, X as ToastPosition, Y as Target, Z as TextVariant, _ as Decoration, $ as RouteTabMode, a0 as Variant$1 } from './resolveGlobalConfigs-BdBJw5_w.mjs';
|
|
4
|
+
export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, a1 as CardinalPosition, l as CheckboxColumns, m as CheckboxOption, a2 as CornerPosition, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, a3 as HorizontalPosition, a4 as HyperRefTarget, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, a5 as VerticalPosition, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-BdBJw5_w.mjs';
|
|
5
5
|
import * as d3 from 'd3';
|
|
6
6
|
import * as formik from 'formik';
|
|
7
7
|
import { FormikValues, FieldHookConfig } from 'formik';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, SelectHTMLAttributes, InputHTMLAttributes, JSX, Dispatch, SetStateAction, ImgHTMLAttributes, ComponentPropsWithoutRef, HTMLAttributes, TdHTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, FC, ComponentType, MouseEvent, HTMLAttributeAnchorTarget, BlockquoteHTMLAttributes, AnchorHTMLAttributes, OlHTMLAttributes, LiHTMLAttributes, DetailsHTMLAttributes, ClassAttributes, TextareaHTMLAttributes, FocusEventHandler, MutableRefObject } from 'react';
|
|
3
|
-
import { y as BaseComponentProps, V as Variant, A as Appearance, z as Shape, G as Size, O as OctilePosition, H as TitleBannerLevel, L as ListBulletType, J as ListDirection, K as ListAlign, M as CurrencyCode, P as SpinnerType, Q as SpinnerDirection, R as TextDecoration, B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, U as Shape$1, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps, W as ToastStatus, X as ToastPosition, Y as Target, Z as TextVariant, _ as Decoration, $ as RouteTabMode, a0 as Variant$1 } from './resolveGlobalConfigs-
|
|
4
|
-
export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, a1 as CardinalPosition, l as CheckboxColumns, m as CheckboxOption, a2 as CornerPosition, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, a3 as HorizontalPosition, a4 as HyperRefTarget, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, a5 as VerticalPosition, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-
|
|
3
|
+
import { y as BaseComponentProps, V as Variant, A as Appearance, z as Shape, G as Size, O as OctilePosition, H as TitleBannerLevel, L as ListBulletType, J as ListDirection, K as ListAlign, M as CurrencyCode, P as SpinnerType, Q as SpinnerDirection, R as TextDecoration, B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, U as Shape$1, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps, W as ToastStatus, X as ToastPosition, Y as Target, Z as TextVariant, _ as Decoration, $ as RouteTabMode, a0 as Variant$1 } from './resolveGlobalConfigs-BdBJw5_w.js';
|
|
4
|
+
export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, a1 as CardinalPosition, l as CheckboxColumns, m as CheckboxOption, a2 as CornerPosition, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, a3 as HorizontalPosition, a4 as HyperRefTarget, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, a5 as VerticalPosition, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-BdBJw5_w.js';
|
|
5
5
|
import * as d3 from 'd3';
|
|
6
6
|
import * as formik from 'formik';
|
|
7
7
|
import { FormikValues, FieldHookConfig } from 'formik';
|
package/dist/index.js
CHANGED
|
@@ -9053,6 +9053,24 @@ function StarRatingInput({
|
|
|
9053
9053
|
);
|
|
9054
9054
|
}
|
|
9055
9055
|
var StarRatingInput_default = StarRatingInput;
|
|
9056
|
+
function useClickOutside(ref, fun) {
|
|
9057
|
+
React26.useEffect(() => {
|
|
9058
|
+
const listener = (e) => {
|
|
9059
|
+
if (!ref.current || ref.current.contains(e.target)) {
|
|
9060
|
+
return;
|
|
9061
|
+
}
|
|
9062
|
+
if (fun) {
|
|
9063
|
+
fun();
|
|
9064
|
+
}
|
|
9065
|
+
};
|
|
9066
|
+
document.addEventListener("mousedown", listener);
|
|
9067
|
+
document.addEventListener("touchstart", listener);
|
|
9068
|
+
return () => {
|
|
9069
|
+
document.removeEventListener("mousedown", listener);
|
|
9070
|
+
document.removeEventListener("touchstart", listener);
|
|
9071
|
+
};
|
|
9072
|
+
}, [ref, fun]);
|
|
9073
|
+
}
|
|
9056
9074
|
function useResolvedSelectConfig({
|
|
9057
9075
|
label,
|
|
9058
9076
|
placeholder,
|
|
@@ -9072,25 +9090,65 @@ function useSelectFieldState(props) {
|
|
|
9072
9090
|
meta
|
|
9073
9091
|
};
|
|
9074
9092
|
}
|
|
9093
|
+
|
|
9094
|
+
// src/components/data-entry/select/web/Select.web.styles.ts
|
|
9095
|
+
var webSelectTriggerClassName = "flex items-center justify-between gap-3 text-left outline-none transition-all duration-200 ease-out";
|
|
9096
|
+
var webSelectValueClassName = "block min-w-0 flex-1 truncate text-base font-normal text-gray-950 dark:text-gray-300";
|
|
9097
|
+
var webSelectPlaceholderClassName = "text-gray-500 dark:text-gray-400";
|
|
9098
|
+
var webSelectChevronClassName = "pointer-events-none shrink-0 text-base text-gray-500 transition-transform duration-150 ease-out dark:text-gray-400";
|
|
9099
|
+
var webSelectChevronOpenClassName = "rotate-180";
|
|
9100
|
+
var webSelectDropdownClassName = "absolute left-0 right-0 top-full z-30 mt-2 overflow-hidden rounded-md border border-gray-200 bg-white shadow-xl shadow-black/10 ring-1 ring-black/5 dark:border-eui-dark-300 dark:bg-eui-dark-500 dark:shadow-black/30 dark:ring-white/10";
|
|
9101
|
+
var webSelectListClassName = "max-h-[228px] overflow-y-auto py-1";
|
|
9102
|
+
var webSelectOptionClassName = "flex min-h-11 w-full items-center px-3 py-2 text-left text-sm font-medium text-gray-800 outline-none transition-colors duration-120 ease-out dark:text-gray-100";
|
|
9103
|
+
var webSelectOptionHoverClassName = "hover:bg-gray-100 focus:bg-gray-100 dark:hover:bg-eui-dark-400 dark:focus:bg-eui-dark-400";
|
|
9104
|
+
var webSelectOptionSelectedClassName = "bg-eui-secondary-500/10 text-eui-secondary-700 dark:bg-eui-secondary-500/15 dark:text-eui-secondary-300";
|
|
9105
|
+
var webSelectOptionActiveClassName = "bg-gray-100 dark:bg-eui-dark-400";
|
|
9106
|
+
var webSelectOptionDisabledClassName = "cursor-not-allowed opacity-45 hover:bg-transparent focus:bg-transparent dark:hover:bg-transparent dark:focus:bg-transparent";
|
|
9107
|
+
var webSelectOptionContentClassName = "min-w-0 flex-1 truncate";
|
|
9108
|
+
var webSelectEmptyClassName = "px-3 py-3 text-sm font-medium text-gray-500 dark:text-gray-400";
|
|
9109
|
+
function getEnabledOptionIndex(options, startIndex = 0, direction = 1) {
|
|
9110
|
+
if (!options.length) return -1;
|
|
9111
|
+
for (let offset = 0; offset < options.length; offset += 1) {
|
|
9112
|
+
const index3 = (startIndex + offset * direction + options.length) % options.length;
|
|
9113
|
+
if (!options[index3]?.disabled) {
|
|
9114
|
+
return index3;
|
|
9115
|
+
}
|
|
9116
|
+
}
|
|
9117
|
+
return -1;
|
|
9118
|
+
}
|
|
9075
9119
|
function Select(selectProps) {
|
|
9076
9120
|
const {
|
|
9121
|
+
activeOptionClassName,
|
|
9122
|
+
chevronClassName,
|
|
9077
9123
|
disabled = false,
|
|
9124
|
+
disabledOptionClassName,
|
|
9125
|
+
dropdownClassName,
|
|
9126
|
+
emptyClassName,
|
|
9127
|
+
emptyMessage = "No options available",
|
|
9078
9128
|
id: id2,
|
|
9079
9129
|
inputClassName,
|
|
9080
9130
|
label,
|
|
9081
9131
|
labelClassName,
|
|
9132
|
+
optionClassName,
|
|
9133
|
+
optionContentClassName,
|
|
9082
9134
|
options,
|
|
9083
9135
|
placeholder,
|
|
9084
9136
|
responseClassName,
|
|
9137
|
+
selectedOptionClassName,
|
|
9085
9138
|
shape,
|
|
9086
9139
|
styles,
|
|
9087
9140
|
className,
|
|
9088
9141
|
onBlur,
|
|
9089
9142
|
onFocus,
|
|
9090
|
-
...
|
|
9143
|
+
..._props
|
|
9091
9144
|
} = selectProps;
|
|
9092
|
-
const
|
|
9145
|
+
const rootRef = React26.useRef(null);
|
|
9146
|
+
const triggerRef = React26.useRef(null);
|
|
9147
|
+
const reactId = React26.useId();
|
|
9148
|
+
const { field, helpers, meta } = useSelectFieldState(selectProps);
|
|
9093
9149
|
const [focused, setFocused] = React26.useState(false);
|
|
9150
|
+
const [open, setOpen] = React26.useState(false);
|
|
9151
|
+
const [activeIndex, setActiveIndex] = React26.useState(-1);
|
|
9094
9152
|
const { label: resolvedLabel, shape: resolvedShape } = useResolvedSelectConfig({
|
|
9095
9153
|
label,
|
|
9096
9154
|
placeholder,
|
|
@@ -9098,48 +9156,237 @@ function Select(selectProps) {
|
|
|
9098
9156
|
});
|
|
9099
9157
|
const hasError = Boolean(meta.touched && meta.error);
|
|
9100
9158
|
const inputId = id2 ?? field.name;
|
|
9101
|
-
const
|
|
9102
|
-
|
|
9103
|
-
field.
|
|
9159
|
+
const listboxId = `${reactId}-${field.name}-listbox`;
|
|
9160
|
+
const selectedIndex = options.findIndex(
|
|
9161
|
+
(option) => option.value === field.value
|
|
9162
|
+
);
|
|
9163
|
+
const selectedOption = selectedIndex >= 0 ? options[selectedIndex] : null;
|
|
9164
|
+
const selectedOptionDisabled = Boolean(selectedOption?.disabled);
|
|
9165
|
+
const selectedLabel = selectedOption?.label ?? "";
|
|
9166
|
+
const hasValue = Boolean(selectedOption);
|
|
9167
|
+
const resolvedActiveIndex = activeIndex >= 0 ? activeIndex : getEnabledOptionIndex(options);
|
|
9168
|
+
const openOptions = React26.useCallback(() => {
|
|
9169
|
+
if (disabled) return;
|
|
9170
|
+
const initialIndex = selectedIndex >= 0 && !selectedOptionDisabled ? selectedIndex : getEnabledOptionIndex(options);
|
|
9171
|
+
setFocused(true);
|
|
9172
|
+
setOpen(true);
|
|
9173
|
+
setActiveIndex(initialIndex);
|
|
9174
|
+
}, [disabled, options, selectedIndex, selectedOptionDisabled]);
|
|
9175
|
+
const closeOptions = React26.useCallback(
|
|
9176
|
+
(markTouched = true, keepFocused = false) => {
|
|
9177
|
+
setOpen(false);
|
|
9178
|
+
setActiveIndex(-1);
|
|
9179
|
+
setFocused(keepFocused);
|
|
9180
|
+
if (markTouched) {
|
|
9181
|
+
void helpers.setTouched(true);
|
|
9182
|
+
}
|
|
9183
|
+
},
|
|
9184
|
+
[helpers]
|
|
9185
|
+
);
|
|
9186
|
+
useClickOutside(rootRef, () => {
|
|
9187
|
+
if (open) {
|
|
9188
|
+
closeOptions();
|
|
9189
|
+
}
|
|
9190
|
+
});
|
|
9191
|
+
const handleButtonFocus = (event) => {
|
|
9192
|
+
setFocused(true);
|
|
9193
|
+
onFocus?.(event);
|
|
9194
|
+
};
|
|
9195
|
+
const handleRootBlur = (event) => {
|
|
9196
|
+
if (event.relatedTarget instanceof Node && rootRef.current?.contains(event.relatedTarget)) {
|
|
9197
|
+
return;
|
|
9198
|
+
}
|
|
9199
|
+
closeOptions();
|
|
9104
9200
|
onBlur?.(event);
|
|
9105
9201
|
};
|
|
9106
|
-
const
|
|
9202
|
+
const handleToggle = () => {
|
|
9203
|
+
if (disabled) return;
|
|
9204
|
+
if (open) {
|
|
9205
|
+
closeOptions(true, true);
|
|
9206
|
+
return;
|
|
9207
|
+
}
|
|
9208
|
+
openOptions();
|
|
9209
|
+
};
|
|
9210
|
+
const handleSelect = (option) => {
|
|
9211
|
+
if (disabled || option.disabled) return;
|
|
9212
|
+
void helpers.setValue(option.value);
|
|
9213
|
+
void helpers.setTouched(true);
|
|
9214
|
+
setOpen(false);
|
|
9215
|
+
setActiveIndex(-1);
|
|
9107
9216
|
setFocused(true);
|
|
9108
|
-
|
|
9217
|
+
window.setTimeout(() => triggerRef.current?.focus(), 0);
|
|
9109
9218
|
};
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9219
|
+
const setNextActiveIndex = (direction) => {
|
|
9220
|
+
const nextIndex = getEnabledOptionIndex(
|
|
9221
|
+
options,
|
|
9222
|
+
resolvedActiveIndex + direction,
|
|
9223
|
+
direction
|
|
9224
|
+
);
|
|
9225
|
+
setActiveIndex(nextIndex);
|
|
9226
|
+
};
|
|
9227
|
+
const handleKeyDown = (event) => {
|
|
9228
|
+
switch (event.key) {
|
|
9229
|
+
case "ArrowDown":
|
|
9230
|
+
event.preventDefault();
|
|
9231
|
+
if (!open) {
|
|
9232
|
+
openOptions();
|
|
9233
|
+
return;
|
|
9234
|
+
}
|
|
9235
|
+
setNextActiveIndex(1);
|
|
9236
|
+
return;
|
|
9237
|
+
case "ArrowUp":
|
|
9238
|
+
event.preventDefault();
|
|
9239
|
+
if (!open) {
|
|
9240
|
+
openOptions();
|
|
9241
|
+
return;
|
|
9242
|
+
}
|
|
9243
|
+
setNextActiveIndex(-1);
|
|
9244
|
+
return;
|
|
9245
|
+
case "Home":
|
|
9246
|
+
if (open) {
|
|
9247
|
+
event.preventDefault();
|
|
9248
|
+
setActiveIndex(getEnabledOptionIndex(options));
|
|
9249
|
+
}
|
|
9250
|
+
return;
|
|
9251
|
+
case "End":
|
|
9252
|
+
if (open) {
|
|
9253
|
+
event.preventDefault();
|
|
9254
|
+
setActiveIndex(
|
|
9255
|
+
getEnabledOptionIndex(options, options.length - 1, -1)
|
|
9256
|
+
);
|
|
9257
|
+
}
|
|
9258
|
+
return;
|
|
9259
|
+
case "Enter":
|
|
9260
|
+
case " ":
|
|
9261
|
+
event.preventDefault();
|
|
9262
|
+
if (!open) {
|
|
9263
|
+
openOptions();
|
|
9264
|
+
return;
|
|
9265
|
+
}
|
|
9266
|
+
if (resolvedActiveIndex >= 0) {
|
|
9267
|
+
handleSelect(options[resolvedActiveIndex]);
|
|
9268
|
+
}
|
|
9269
|
+
return;
|
|
9270
|
+
case "Escape":
|
|
9271
|
+
if (open) {
|
|
9272
|
+
event.preventDefault();
|
|
9273
|
+
closeOptions(true, true);
|
|
9274
|
+
}
|
|
9275
|
+
return;
|
|
9276
|
+
case "Tab":
|
|
9277
|
+
closeOptions();
|
|
9278
|
+
return;
|
|
9279
|
+
default:
|
|
9280
|
+
return;
|
|
9281
|
+
}
|
|
9282
|
+
};
|
|
9283
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: inputRootClassName, onBlur: handleRootBlur, children: [
|
|
9284
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { name: field.name, type: "hidden", value: field.value ?? "" }),
|
|
9285
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9286
|
+
"button",
|
|
9113
9287
|
{
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
onFocus: handleFocus,
|
|
9288
|
+
"aria-activedescendant": open && resolvedActiveIndex >= 0 ? `${listboxId}-option-${resolvedActiveIndex}` : void 0,
|
|
9289
|
+
"aria-controls": listboxId,
|
|
9290
|
+
"aria-disabled": disabled || void 0,
|
|
9291
|
+
"aria-expanded": open,
|
|
9292
|
+
"aria-haspopup": "listbox",
|
|
9293
|
+
"aria-invalid": hasError || void 0,
|
|
9121
9294
|
className: cn(
|
|
9122
9295
|
inputFrameClassName,
|
|
9123
9296
|
inputControlClassName,
|
|
9124
|
-
|
|
9125
|
-
hasError ? inputFrameErrorClassName : focused ? inputFrameActiveClassName : inputFrameIdleClassName,
|
|
9297
|
+
webSelectTriggerClassName,
|
|
9298
|
+
hasError ? inputFrameErrorClassName : focused || open ? inputFrameActiveClassName : inputFrameIdleClassName,
|
|
9126
9299
|
inputShapes[resolvedShape],
|
|
9127
9300
|
disabled && inputFrameDisabledClassName,
|
|
9128
9301
|
className,
|
|
9129
|
-
styles
|
|
9130
|
-
inputClassName
|
|
9302
|
+
styles
|
|
9131
9303
|
),
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9304
|
+
disabled,
|
|
9305
|
+
id: inputId,
|
|
9306
|
+
onClick: handleToggle,
|
|
9307
|
+
onFocus: handleButtonFocus,
|
|
9308
|
+
onKeyDown: handleKeyDown,
|
|
9309
|
+
ref: triggerRef,
|
|
9310
|
+
role: "combobox",
|
|
9311
|
+
type: "button",
|
|
9312
|
+
children: [
|
|
9313
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9314
|
+
"span",
|
|
9315
|
+
{
|
|
9316
|
+
className: cn(
|
|
9317
|
+
webSelectValueClassName,
|
|
9318
|
+
!hasValue && webSelectPlaceholderClassName,
|
|
9319
|
+
inputClassName
|
|
9320
|
+
),
|
|
9321
|
+
children: hasValue ? selectedLabel : ""
|
|
9322
|
+
}
|
|
9323
|
+
),
|
|
9324
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9325
|
+
index_js$3.BsChevronDown,
|
|
9326
|
+
{
|
|
9327
|
+
"aria-hidden": "true",
|
|
9328
|
+
className: cn(
|
|
9329
|
+
webSelectChevronClassName,
|
|
9330
|
+
open && webSelectChevronOpenClassName,
|
|
9331
|
+
chevronClassName
|
|
9332
|
+
)
|
|
9333
|
+
}
|
|
9334
|
+
)
|
|
9335
|
+
]
|
|
9141
9336
|
}
|
|
9142
9337
|
),
|
|
9338
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransitionDropdown_default, { visibility: open, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9339
|
+
"div",
|
|
9340
|
+
{
|
|
9341
|
+
"aria-label": resolvedLabel,
|
|
9342
|
+
className: cn(webSelectDropdownClassName, dropdownClassName),
|
|
9343
|
+
id: listboxId,
|
|
9344
|
+
role: "listbox",
|
|
9345
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: webSelectListClassName, children: options.length > 0 ? options.map((option, index3) => {
|
|
9346
|
+
const selected = option.value === field.value;
|
|
9347
|
+
const active = index3 === resolvedActiveIndex;
|
|
9348
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9349
|
+
"button",
|
|
9350
|
+
{
|
|
9351
|
+
"aria-disabled": option.disabled || void 0,
|
|
9352
|
+
"aria-selected": selected,
|
|
9353
|
+
className: cn(
|
|
9354
|
+
webSelectOptionClassName,
|
|
9355
|
+
!option.disabled && webSelectOptionHoverClassName,
|
|
9356
|
+
selected && webSelectOptionSelectedClassName,
|
|
9357
|
+
active && webSelectOptionActiveClassName,
|
|
9358
|
+
option.disabled && webSelectOptionDisabledClassName,
|
|
9359
|
+
selected && selectedOptionClassName,
|
|
9360
|
+
active && activeOptionClassName,
|
|
9361
|
+
option.disabled && disabledOptionClassName,
|
|
9362
|
+
optionClassName
|
|
9363
|
+
),
|
|
9364
|
+
disabled: option.disabled,
|
|
9365
|
+
id: `${listboxId}-option-${index3}`,
|
|
9366
|
+
onClick: () => handleSelect(option),
|
|
9367
|
+
onMouseEnter: () => {
|
|
9368
|
+
if (!option.disabled) {
|
|
9369
|
+
setActiveIndex(index3);
|
|
9370
|
+
}
|
|
9371
|
+
},
|
|
9372
|
+
role: "option",
|
|
9373
|
+
type: "button",
|
|
9374
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9375
|
+
"span",
|
|
9376
|
+
{
|
|
9377
|
+
className: cn(
|
|
9378
|
+
webSelectOptionContentClassName,
|
|
9379
|
+
optionContentClassName
|
|
9380
|
+
),
|
|
9381
|
+
children: option.label
|
|
9382
|
+
}
|
|
9383
|
+
)
|
|
9384
|
+
},
|
|
9385
|
+
option.value
|
|
9386
|
+
);
|
|
9387
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(webSelectEmptyClassName, emptyClassName), children: emptyMessage }) })
|
|
9388
|
+
}
|
|
9389
|
+
) }),
|
|
9143
9390
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9144
9391
|
InputLabel,
|
|
9145
9392
|
{
|
|
@@ -9989,24 +10236,6 @@ function HeaderNav({ data = [], styles }) {
|
|
|
9989
10236
|
);
|
|
9990
10237
|
}
|
|
9991
10238
|
var HeaderNav_default = HeaderNav;
|
|
9992
|
-
function useClickOutside(ref, fun) {
|
|
9993
|
-
React26.useEffect(() => {
|
|
9994
|
-
const listener = (e) => {
|
|
9995
|
-
if (!ref.current || ref.current.contains(e.target)) {
|
|
9996
|
-
return;
|
|
9997
|
-
}
|
|
9998
|
-
if (fun) {
|
|
9999
|
-
fun();
|
|
10000
|
-
}
|
|
10001
|
-
};
|
|
10002
|
-
document.addEventListener("mousedown", listener);
|
|
10003
|
-
document.addEventListener("touchstart", listener);
|
|
10004
|
-
return () => {
|
|
10005
|
-
document.removeEventListener("mousedown", listener);
|
|
10006
|
-
document.removeEventListener("touchstart", listener);
|
|
10007
|
-
};
|
|
10008
|
-
}, [ref, fun]);
|
|
10009
|
-
}
|
|
10010
10239
|
var HeaderNavItemContext = ({
|
|
10011
10240
|
icon,
|
|
10012
10241
|
name: name2,
|
|
@@ -13886,19 +14115,6 @@ var Flag = ({
|
|
|
13886
14115
|
);
|
|
13887
14116
|
};
|
|
13888
14117
|
|
|
13889
|
-
// src/components/data-display/graphs/layouts/registry.ts
|
|
13890
|
-
var registry = /* @__PURE__ */ new Map();
|
|
13891
|
-
var registerLayout = (type2, executor) => {
|
|
13892
|
-
registry.set(type2, executor);
|
|
13893
|
-
};
|
|
13894
|
-
var getLayout = (type2) => {
|
|
13895
|
-
const layout = registry.get(type2);
|
|
13896
|
-
if (!layout) {
|
|
13897
|
-
throw new Error(`Layout "${type2}" not registered`);
|
|
13898
|
-
}
|
|
13899
|
-
return layout;
|
|
13900
|
-
};
|
|
13901
|
-
|
|
13902
14118
|
// node_modules/d3-dispatch/src/dispatch.js
|
|
13903
14119
|
var noop = { value: () => {
|
|
13904
14120
|
} };
|
|
@@ -16882,6 +17098,45 @@ function createTreeLayout(nodes, edges, width, height) {
|
|
|
16882
17098
|
};
|
|
16883
17099
|
});
|
|
16884
17100
|
}
|
|
17101
|
+
|
|
17102
|
+
// src/components/data-display/graphs/layouts/registry.ts
|
|
17103
|
+
var registry = /* @__PURE__ */ new Map();
|
|
17104
|
+
var defaultLayoutsRegistered = false;
|
|
17105
|
+
var registerLayout = (type2, executor) => {
|
|
17106
|
+
registry.set(type2, executor);
|
|
17107
|
+
};
|
|
17108
|
+
var registerDefaultLayouts = () => {
|
|
17109
|
+
if (defaultLayoutsRegistered) return;
|
|
17110
|
+
registerLayout("force", ({ nodes, edges, width, height, onTick }) => {
|
|
17111
|
+
const sim = createForceLayout(nodes, edges, width, height);
|
|
17112
|
+
sim.on("tick", () => {
|
|
17113
|
+
onTick?.([...nodes]);
|
|
17114
|
+
});
|
|
17115
|
+
return {
|
|
17116
|
+
type: "simulation",
|
|
17117
|
+
stop: () => sim.stop()
|
|
17118
|
+
};
|
|
17119
|
+
});
|
|
17120
|
+
registerLayout("grid", ({ nodes, width, height, onTick }) => {
|
|
17121
|
+
const result = createGridLayout(nodes, width, height);
|
|
17122
|
+
onTick?.(result);
|
|
17123
|
+
return { type: "static" };
|
|
17124
|
+
});
|
|
17125
|
+
registerLayout("tree", ({ nodes, edges, width, height, onTick }) => {
|
|
17126
|
+
const result = createTreeLayout(nodes, edges, width, height);
|
|
17127
|
+
onTick?.(result);
|
|
17128
|
+
return { type: "static" };
|
|
17129
|
+
});
|
|
17130
|
+
defaultLayoutsRegistered = true;
|
|
17131
|
+
};
|
|
17132
|
+
var getLayout = (type2) => {
|
|
17133
|
+
registerDefaultLayouts();
|
|
17134
|
+
const layout = registry.get(type2);
|
|
17135
|
+
if (!layout) {
|
|
17136
|
+
throw new Error(`Layout "${type2}" not registered`);
|
|
17137
|
+
}
|
|
17138
|
+
return layout;
|
|
17139
|
+
};
|
|
16885
17140
|
var NODE_SIZE = 48;
|
|
16886
17141
|
var GraphNode = ({ node: node2, renderCustom }) => {
|
|
16887
17142
|
if (node2.x === void 0 || node2.y === void 0) return null;
|