elseware-ui 3.0.8 → 3.0.10
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 +132 -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 +291 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +291 -60
- 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/index.native.js +16 -13
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +16 -13
- package/dist/index.native.mjs.map +1 -1
- 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
|
@@ -6425,9 +6425,21 @@ function Button({
|
|
|
6425
6425
|
}
|
|
6426
6426
|
var Button_web_default = Button;
|
|
6427
6427
|
|
|
6428
|
+
// src/data/styles/shared.styles.tsx
|
|
6429
|
+
var inputShapes = shapes;
|
|
6430
|
+
var inputInlineInsetClassName = "left-3";
|
|
6431
|
+
var inputInlinePaddingXClassName = "px-3";
|
|
6432
|
+
var inputRootClassName = "relative w-full";
|
|
6433
|
+
var inputFrameClassName = `relative h-14 w-full overflow-hidden border bg-white/95 ${inputInlinePaddingXClassName} dark:bg-eui-primary-300/10`;
|
|
6434
|
+
var inputFrameIdleClassName = "border-gray-300 hover:border-gray-400 dark:border-eui-dark-300 dark:hover:border-eui-dark-200";
|
|
6435
|
+
var inputFrameActiveClassName = "border-eui-secondary-600";
|
|
6436
|
+
var inputFrameErrorClassName = "border-eui-danger-500";
|
|
6437
|
+
var inputFrameDisabledClassName = "cursor-not-allowed opacity-60";
|
|
6438
|
+
var inputControlClassName = "w-full bg-transparent pt-5 pb-2 text-base font-normal text-gray-950 dark:text-gray-300";
|
|
6439
|
+
|
|
6428
6440
|
// src/components/data-entry/input/input-label/base/InputLabel.styles.ts
|
|
6429
6441
|
var inputLabelStaticClassName = "pointer-events-none select-none px-0 text-[13.5px] leading-none text-[#6B7280]";
|
|
6430
|
-
var inputLabelBaseClassName =
|
|
6442
|
+
var inputLabelBaseClassName = `pointer-events-none absolute ${inputInlineInsetClassName} z-10 select-none bg-transparent px-0 font-medium leading-none`;
|
|
6431
6443
|
var inputLabelTransitionClassName = "transition-all duration-200 ease-out";
|
|
6432
6444
|
var inputLabelRestingClassName = "top-[18px] translate-y-0 text-base leading-none text-[#6B7280]";
|
|
6433
6445
|
var inputLabelFloatingClassName = "top-1.5 translate-y-0 text-xs leading-none text-[#6B7280]";
|
|
@@ -7233,7 +7245,7 @@ var Transition = {
|
|
|
7233
7245
|
};
|
|
7234
7246
|
|
|
7235
7247
|
// src/components/data-entry/input/input-response/base/InputResponse.styles.ts
|
|
7236
|
-
var inputResponseBaseClassName =
|
|
7248
|
+
var inputResponseBaseClassName = `${inputInlinePaddingXClassName} pt-1.5 text-sm font-medium`;
|
|
7237
7249
|
var inputResponseVariants = textVariants;
|
|
7238
7250
|
function InputResponse({
|
|
7239
7251
|
name: name2,
|
|
@@ -7282,16 +7294,6 @@ function useInputFieldState(props) {
|
|
|
7282
7294
|
};
|
|
7283
7295
|
}
|
|
7284
7296
|
|
|
7285
|
-
// src/data/styles/shared.styles.tsx
|
|
7286
|
-
var inputShapes = shapes;
|
|
7287
|
-
var inputRootClassName = "relative w-full";
|
|
7288
|
-
var inputFrameClassName = "relative h-14 w-full overflow-hidden border bg-white/95 px-3 dark:bg-eui-primary-300/10";
|
|
7289
|
-
var inputFrameIdleClassName = "border-gray-300 hover:border-gray-400 dark:border-eui-dark-300 dark:hover:border-eui-dark-200";
|
|
7290
|
-
var inputFrameActiveClassName = "border-eui-secondary-600";
|
|
7291
|
-
var inputFrameErrorClassName = "border-eui-danger-500";
|
|
7292
|
-
var inputFrameDisabledClassName = "cursor-not-allowed opacity-60";
|
|
7293
|
-
var inputControlClassName = "w-full bg-transparent pt-5 pb-2 text-base font-medium text-gray-950 dark:text-gray-50";
|
|
7294
|
-
|
|
7295
7297
|
// src/components/data-entry/input/input/web/Input.web.styles.ts
|
|
7296
7298
|
var webInputControlClassName = "placeholder-transparent outline-none transition-all duration-200 ease-out";
|
|
7297
7299
|
var webPasswordToggleClassName = "absolute right-3 top-[18px] cursor-pointer text-xl text-eui-dark-200 transition-colors duration-180 hover:text-eui-secondary-700";
|
|
@@ -9051,6 +9053,24 @@ function StarRatingInput({
|
|
|
9051
9053
|
);
|
|
9052
9054
|
}
|
|
9053
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
|
+
}
|
|
9054
9074
|
function useResolvedSelectConfig({
|
|
9055
9075
|
label,
|
|
9056
9076
|
placeholder,
|
|
@@ -9070,25 +9090,65 @@ function useSelectFieldState(props) {
|
|
|
9070
9090
|
meta
|
|
9071
9091
|
};
|
|
9072
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
|
+
}
|
|
9073
9119
|
function Select(selectProps) {
|
|
9074
9120
|
const {
|
|
9121
|
+
activeOptionClassName,
|
|
9122
|
+
chevronClassName,
|
|
9075
9123
|
disabled = false,
|
|
9124
|
+
disabledOptionClassName,
|
|
9125
|
+
dropdownClassName,
|
|
9126
|
+
emptyClassName,
|
|
9127
|
+
emptyMessage = "No options available",
|
|
9076
9128
|
id: id2,
|
|
9077
9129
|
inputClassName,
|
|
9078
9130
|
label,
|
|
9079
9131
|
labelClassName,
|
|
9132
|
+
optionClassName,
|
|
9133
|
+
optionContentClassName,
|
|
9080
9134
|
options,
|
|
9081
9135
|
placeholder,
|
|
9082
9136
|
responseClassName,
|
|
9137
|
+
selectedOptionClassName,
|
|
9083
9138
|
shape,
|
|
9084
9139
|
styles,
|
|
9085
9140
|
className,
|
|
9086
9141
|
onBlur,
|
|
9087
9142
|
onFocus,
|
|
9088
|
-
...
|
|
9143
|
+
..._props
|
|
9089
9144
|
} = selectProps;
|
|
9090
|
-
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);
|
|
9091
9149
|
const [focused, setFocused] = React26.useState(false);
|
|
9150
|
+
const [open, setOpen] = React26.useState(false);
|
|
9151
|
+
const [activeIndex, setActiveIndex] = React26.useState(-1);
|
|
9092
9152
|
const { label: resolvedLabel, shape: resolvedShape } = useResolvedSelectConfig({
|
|
9093
9153
|
label,
|
|
9094
9154
|
placeholder,
|
|
@@ -9096,48 +9156,237 @@ function Select(selectProps) {
|
|
|
9096
9156
|
});
|
|
9097
9157
|
const hasError = Boolean(meta.touched && meta.error);
|
|
9098
9158
|
const inputId = id2 ?? field.name;
|
|
9099
|
-
const
|
|
9100
|
-
|
|
9101
|
-
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();
|
|
9102
9200
|
onBlur?.(event);
|
|
9103
9201
|
};
|
|
9104
|
-
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);
|
|
9105
9216
|
setFocused(true);
|
|
9106
|
-
|
|
9217
|
+
window.setTimeout(() => triggerRef.current?.focus(), 0);
|
|
9107
9218
|
};
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
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",
|
|
9111
9287
|
{
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
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,
|
|
9119
9294
|
className: cn(
|
|
9120
9295
|
inputFrameClassName,
|
|
9121
9296
|
inputControlClassName,
|
|
9122
|
-
|
|
9123
|
-
hasError ? inputFrameErrorClassName : focused ? inputFrameActiveClassName : inputFrameIdleClassName,
|
|
9297
|
+
webSelectTriggerClassName,
|
|
9298
|
+
hasError ? inputFrameErrorClassName : focused || open ? inputFrameActiveClassName : inputFrameIdleClassName,
|
|
9124
9299
|
inputShapes[resolvedShape],
|
|
9125
9300
|
disabled && inputFrameDisabledClassName,
|
|
9126
9301
|
className,
|
|
9127
|
-
styles
|
|
9128
|
-
inputClassName
|
|
9302
|
+
styles
|
|
9129
9303
|
),
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
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
|
+
]
|
|
9139
9336
|
}
|
|
9140
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
|
+
) }),
|
|
9141
9390
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9142
9391
|
InputLabel,
|
|
9143
9392
|
{
|
|
@@ -9987,24 +10236,6 @@ function HeaderNav({ data = [], styles }) {
|
|
|
9987
10236
|
);
|
|
9988
10237
|
}
|
|
9989
10238
|
var HeaderNav_default = HeaderNav;
|
|
9990
|
-
function useClickOutside(ref, fun) {
|
|
9991
|
-
React26.useEffect(() => {
|
|
9992
|
-
const listener = (e) => {
|
|
9993
|
-
if (!ref.current || ref.current.contains(e.target)) {
|
|
9994
|
-
return;
|
|
9995
|
-
}
|
|
9996
|
-
if (fun) {
|
|
9997
|
-
fun();
|
|
9998
|
-
}
|
|
9999
|
-
};
|
|
10000
|
-
document.addEventListener("mousedown", listener);
|
|
10001
|
-
document.addEventListener("touchstart", listener);
|
|
10002
|
-
return () => {
|
|
10003
|
-
document.removeEventListener("mousedown", listener);
|
|
10004
|
-
document.removeEventListener("touchstart", listener);
|
|
10005
|
-
};
|
|
10006
|
-
}, [ref, fun]);
|
|
10007
|
-
}
|
|
10008
10239
|
var HeaderNavItemContext = ({
|
|
10009
10240
|
icon,
|
|
10010
10241
|
name: name2,
|