xmlui 0.9.11 → 0.9.12
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/{apiInterceptorWorker-BZP06llg.mjs → apiInterceptorWorker-dYrfbzdh.mjs} +1 -1
- package/dist/core-XLM8cuFP.mjs +7491 -0
- package/dist/{index-CFJ5_K_a.mjs → index-Dh2MThrK.mjs} +1672 -803
- package/dist/index.css +112 -98
- package/dist/language-server-web-worker.mjs +1 -1
- package/dist/language-server.mjs +1 -1
- package/dist/{lint-CiMcsEWf.mjs → lint-Cd70ckJ6.mjs} +84 -94
- package/dist/{parser-mzWvH7dz.mjs → parser-CBXS8ft2.mjs} +19 -17
- package/dist/scripts/bin/build-lib.js +42 -1
- package/dist/scripts/bin/vite-xmlui-plugin.js +2 -22
- package/dist/scripts/bin/viteConfig.js +3 -1
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -20
- package/dist/scripts/src/components/App/App.js +61 -21
- package/dist/scripts/src/components/Button/Button.js +5 -1
- package/dist/scripts/src/components/Button/ButtonNative.js +9 -2
- package/dist/scripts/src/components/Checkbox/Checkbox.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +2 -0
- package/dist/scripts/src/components/Footer/Footer.js +1 -1
- package/dist/scripts/src/components/Form/FormContext.js +2 -0
- package/dist/scripts/src/components/FormItem/FormItemNative.js +9 -0
- package/dist/scripts/src/components/Items/Items.js +2 -1
- package/dist/scripts/src/components/List/List.js +2 -1
- package/dist/scripts/src/components/Markdown/Markdown.js +2 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.js +2 -2
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +85 -0
- package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +395 -0
- package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +35 -0
- package/dist/scripts/src/components/Option/Option.js +2 -1
- package/dist/scripts/src/components/Select/Select.js +8 -0
- package/dist/scripts/src/components/Select/SelectNative.js +24 -10
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -0
- package/dist/scripts/src/components/VisuallyHidden.js +21 -0
- package/dist/scripts/src/components-core/loader/DataLoader.js +110 -3
- package/dist/scripts/src/components-core/loader/Loader.js +29 -7
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +4 -1
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +23 -5
- package/dist/scripts/src/components-core/rendering/Container.js +23 -26
- package/dist/scripts/src/components-core/rendering/StateContainer.js +2 -4
- package/dist/scripts/src/components-core/rendering/reducer.js +6 -5
- package/dist/scripts/src/components-core/utils/extractParam.js +24 -7
- package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +0 -10
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +6 -9
- package/dist/{server-common-DxRVCeIE.mjs → server-common-DW5h7Q34.mjs} +122 -64
- package/dist/style.css +112 -98
- package/dist/xmlui-metadata.mjs +861 -296
- package/dist/xmlui-metadata.umd.js +861 -298
- package/dist/xmlui-parser.d.ts +14 -9
- package/dist/xmlui-parser.mjs +34 -34
- package/dist/xmlui-standalone.umd.js +7204 -5266
- package/dist/xmlui.d.ts +3 -1
- package/dist/xmlui.mjs +1 -1
- package/package.json +5 -5
- package/dist/core-C-osEDc2.mjs +0 -2
package/dist/xmlui-metadata.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, { useRef, useInsertionEffect, useCallback, useContext, useEffect, useLayoutEffect, useState, forwardRef, useMemo, useId, createContext, useDeferredValue, useImperativeHandle,
|
|
3
|
+
import React__default, { useRef, useInsertionEffect, useCallback, useContext, useEffect, useLayoutEffect, useState, forwardRef, useMemo, useId, createContext, useDeferredValue, useImperativeHandle, Children, isValidElement, createElement, cloneElement, Fragment as Fragment$1, memo } from "react";
|
|
4
4
|
import classnames from "classnames";
|
|
5
|
-
import
|
|
5
|
+
import * as VisuallyHidden$1 from "@radix-ui/react-visually-hidden";
|
|
6
|
+
import { VisuallyHidden as VisuallyHidden$2 } from "@radix-ui/react-visually-hidden";
|
|
7
|
+
import { throttle, omitBy, isUndefined, isEmpty, noop as noop$2, isArray, isNumber, isNil, isNaN as isNaN$1, isEqual, union, uniq, orderBy } from "lodash-es";
|
|
6
8
|
import { NavLink as NavLink$1, Link } from "@remix-run/react";
|
|
7
9
|
import { DayPicker } from "react-day-picker";
|
|
8
10
|
import { parse, format, parseISO, isValid } from "date-fns";
|
|
@@ -13,13 +15,13 @@ import produce from "immer";
|
|
|
13
15
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
14
16
|
import { createContext as createContext$1, useContextSelector } from "use-context-selector";
|
|
15
17
|
import * as dropzone from "react-dropzone";
|
|
16
|
-
import * as VisuallyHidden from "@radix-ui/react-visually-hidden";
|
|
17
18
|
import { Portal, Root, Trigger, Value, Icon as Icon$1, Content, ScrollUpButton, Viewport, ScrollDownButton, Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
18
19
|
import { Popover, PopoverTrigger, PopoverContent, Portal as Portal$1 } from "@radix-ui/react-popover";
|
|
19
20
|
import { Command, CommandInput, CommandList, CommandEmpty, CommandItem, CommandGroup } from "cmdk";
|
|
20
21
|
import * as InnerRadioGroup from "@radix-ui/react-radio-group";
|
|
21
22
|
import TextareaAutosize from "react-textarea-autosize";
|
|
22
23
|
import { Root as Root$1, Track, Range, Thumb } from "@radix-ui/react-slider";
|
|
24
|
+
import { NumberFormatter, NumberParser } from "@internationalized/number";
|
|
23
25
|
import { useReactTable, getPaginationRowModel, getCoreRowModel, flexRender } from "@tanstack/react-table";
|
|
24
26
|
import { observeElementOffset, useVirtualizer } from "@tanstack/react-virtual";
|
|
25
27
|
import * as RAccordion from "@radix-ui/react-accordion";
|
|
@@ -66,44 +68,8 @@ const styles$T = {
|
|
|
66
68
|
ghostSecondary,
|
|
67
69
|
ghostAttention
|
|
68
70
|
};
|
|
69
|
-
function createMetadata({
|
|
70
|
-
|
|
71
|
-
shortDescription,
|
|
72
|
-
specializedFrom,
|
|
73
|
-
status,
|
|
74
|
-
props,
|
|
75
|
-
events,
|
|
76
|
-
contextVars,
|
|
77
|
-
apis,
|
|
78
|
-
nonVisual,
|
|
79
|
-
opaque,
|
|
80
|
-
themeVars: themeVars2,
|
|
81
|
-
themeVarDescriptions,
|
|
82
|
-
defaultThemeVars,
|
|
83
|
-
toneSpecificThemeVars,
|
|
84
|
-
allowArbitraryProps,
|
|
85
|
-
docFolder,
|
|
86
|
-
isHtmlTag
|
|
87
|
-
}) {
|
|
88
|
-
return {
|
|
89
|
-
description,
|
|
90
|
-
shortDescription,
|
|
91
|
-
specializedFrom,
|
|
92
|
-
status,
|
|
93
|
-
props,
|
|
94
|
-
events,
|
|
95
|
-
contextVars,
|
|
96
|
-
apis,
|
|
97
|
-
nonVisual,
|
|
98
|
-
opaque,
|
|
99
|
-
themeVars: themeVars2,
|
|
100
|
-
defaultThemeVars,
|
|
101
|
-
themeVarDescriptions,
|
|
102
|
-
toneSpecificThemeVars,
|
|
103
|
-
allowArbitraryProps,
|
|
104
|
-
docFolder,
|
|
105
|
-
isHtmlTag
|
|
106
|
-
};
|
|
71
|
+
function createMetadata(metadata) {
|
|
72
|
+
return metadata;
|
|
107
73
|
}
|
|
108
74
|
function d(description, availableValues, valueType, defaultValue, isValid2, isRequired) {
|
|
109
75
|
return { description, isRequired, availableValues, valueType, defaultValue, isValid: isValid2 };
|
|
@@ -1049,9 +1015,7 @@ function composeRefs(...refs) {
|
|
|
1049
1015
|
}
|
|
1050
1016
|
};
|
|
1051
1017
|
}
|
|
1052
|
-
|
|
1053
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
1054
|
-
}
|
|
1018
|
+
const VisuallyHidden = ({ children, ...props }) => /* @__PURE__ */ jsx(VisuallyHidden$2, { ...props, children });
|
|
1055
1019
|
const defaultProps$g = {
|
|
1056
1020
|
type: "button",
|
|
1057
1021
|
iconPosition: "start",
|
|
@@ -1082,6 +1046,7 @@ const Button = React__default.forwardRef(function Button2({
|
|
|
1082
1046
|
gap,
|
|
1083
1047
|
className,
|
|
1084
1048
|
autoFocus = defaultProps$g.autoFocus,
|
|
1049
|
+
contextualLabel,
|
|
1085
1050
|
...rest
|
|
1086
1051
|
}, ref) {
|
|
1087
1052
|
const innerRef = useRef(null);
|
|
@@ -1129,13 +1094,18 @@ const Button = React__default.forwardRef(function Button2({
|
|
|
1129
1094
|
onFocus,
|
|
1130
1095
|
onBlur,
|
|
1131
1096
|
children: [
|
|
1132
|
-
iconToLeft && icon,
|
|
1097
|
+
icon && iconToLeft && /* @__PURE__ */ jsx(Fragment, { children: icon }),
|
|
1133
1098
|
children,
|
|
1134
|
-
!
|
|
1099
|
+
icon && !children && /* @__PURE__ */ jsx(IconLabel, { icon, accessibleName: contextualLabel }),
|
|
1100
|
+
icon && !iconToLeft && /* @__PURE__ */ jsx(Fragment, { children: icon })
|
|
1135
1101
|
]
|
|
1136
1102
|
}
|
|
1137
1103
|
);
|
|
1138
1104
|
});
|
|
1105
|
+
const IconLabel = ({ icon, accessibleName = "" }) => {
|
|
1106
|
+
const iconProps = icon.props;
|
|
1107
|
+
return /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { children: accessibleName || (iconProps == null ? void 0 : iconProps.name) || (iconProps == null ? void 0 : iconProps.alt) }) });
|
|
1108
|
+
};
|
|
1139
1109
|
const COMP$16 = "Button";
|
|
1140
1110
|
const ButtonMd = createMetadata({
|
|
1141
1111
|
description: "Button is an interactive element that triggers an action when clicked.",
|
|
@@ -1199,6 +1169,10 @@ const ButtonMd = createMetadata({
|
|
|
1199
1169
|
availableValues: alignmentOptionMd,
|
|
1200
1170
|
type: "string",
|
|
1201
1171
|
defaultValue: defaultProps$g.contentPosition
|
|
1172
|
+
},
|
|
1173
|
+
contextualLabel: {
|
|
1174
|
+
description: `This optional value is used to provide an accessible name for the ${COMP$16} in the context of its usage.`,
|
|
1175
|
+
type: "string"
|
|
1202
1176
|
}
|
|
1203
1177
|
},
|
|
1204
1178
|
events: {
|
|
@@ -1870,7 +1844,7 @@ const TextBox = forwardRef(function TextBox2({
|
|
|
1870
1844
|
const handleOnBlur = useCallback(() => {
|
|
1871
1845
|
onBlur == null ? void 0 : onBlur();
|
|
1872
1846
|
}, [onBlur]);
|
|
1873
|
-
const
|
|
1847
|
+
const focus = useCallback(() => {
|
|
1874
1848
|
var _a;
|
|
1875
1849
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
1876
1850
|
}, []);
|
|
@@ -1879,10 +1853,10 @@ const TextBox = forwardRef(function TextBox2({
|
|
|
1879
1853
|
});
|
|
1880
1854
|
useEffect(() => {
|
|
1881
1855
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
1882
|
-
focus
|
|
1856
|
+
focus,
|
|
1883
1857
|
setValue
|
|
1884
1858
|
});
|
|
1885
|
-
}, [
|
|
1859
|
+
}, [focus, registerComponentApi, setValue]);
|
|
1886
1860
|
return /* @__PURE__ */ jsx(
|
|
1887
1861
|
ItemWithLabel,
|
|
1888
1862
|
{
|
|
@@ -1906,7 +1880,7 @@ const TextBox = forwardRef(function TextBox2({
|
|
|
1906
1880
|
[styles$Q.valid]: validationStatus === "valid"
|
|
1907
1881
|
}),
|
|
1908
1882
|
tabIndex: -1,
|
|
1909
|
-
onFocus:
|
|
1883
|
+
onFocus: focus,
|
|
1910
1884
|
children: [
|
|
1911
1885
|
/* @__PURE__ */ jsx(Adornment, { text: startText, iconName: startIcon, className: styles$Q.adornment }),
|
|
1912
1886
|
/* @__PURE__ */ jsx(
|
|
@@ -4044,7 +4018,7 @@ const Toggle = forwardRef(function Toggle2({
|
|
|
4044
4018
|
innerRef.current.indeterminate = indeterminate;
|
|
4045
4019
|
}
|
|
4046
4020
|
}, [indeterminate]);
|
|
4047
|
-
const
|
|
4021
|
+
const focus = useCallback(() => {
|
|
4048
4022
|
var _a;
|
|
4049
4023
|
(_a = innerRef.current) == null ? void 0 : _a.focus();
|
|
4050
4024
|
}, []);
|
|
@@ -4053,10 +4027,10 @@ const Toggle = forwardRef(function Toggle2({
|
|
|
4053
4027
|
});
|
|
4054
4028
|
useEffect(() => {
|
|
4055
4029
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
4056
|
-
focus
|
|
4030
|
+
focus,
|
|
4057
4031
|
setValue
|
|
4058
4032
|
});
|
|
4059
|
-
}, [
|
|
4033
|
+
}, [focus, registerComponentApi, setValue]);
|
|
4060
4034
|
const input2 = useMemo(
|
|
4061
4035
|
() => /* @__PURE__ */ jsx(
|
|
4062
4036
|
"input",
|
|
@@ -4144,6 +4118,7 @@ const CheckboxMd = createMetadata({
|
|
|
4144
4118
|
description: "This property is used to define a custom checkbox input template"
|
|
4145
4119
|
}
|
|
4146
4120
|
},
|
|
4121
|
+
childrenAsTemplate: "inputTemplate",
|
|
4147
4122
|
events: {
|
|
4148
4123
|
gotFocus: dGotFocus(COMP$X),
|
|
4149
4124
|
lostFocus: dLostFocus(COMP$X),
|
|
@@ -4402,7 +4377,7 @@ const DatePicker = forwardRef(function DatePicker2({
|
|
|
4402
4377
|
const handleOnMenuBlur = () => {
|
|
4403
4378
|
setIsMenuFocused(false);
|
|
4404
4379
|
};
|
|
4405
|
-
const
|
|
4380
|
+
const focus = useCallback(() => {
|
|
4406
4381
|
var _a;
|
|
4407
4382
|
(_a = referenceElement == null ? void 0 : referenceElement.current) == null ? void 0 : _a.focus();
|
|
4408
4383
|
}, [referenceElement == null ? void 0 : referenceElement.current]);
|
|
@@ -4412,10 +4387,10 @@ const DatePicker = forwardRef(function DatePicker2({
|
|
|
4412
4387
|
});
|
|
4413
4388
|
useEffect(() => {
|
|
4414
4389
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
4415
|
-
focus
|
|
4390
|
+
focus,
|
|
4416
4391
|
setValue
|
|
4417
4392
|
});
|
|
4418
|
-
}, [
|
|
4393
|
+
}, [focus, registerComponentApi, setValue]);
|
|
4419
4394
|
useEffect(() => {
|
|
4420
4395
|
if (!isButtonFocused && !isMenuFocused) {
|
|
4421
4396
|
onBlur == null ? void 0 : onBlur();
|
|
@@ -4962,7 +4937,7 @@ const FileInput = ({
|
|
|
4962
4937
|
const handleOnBlur = useCallback(() => {
|
|
4963
4938
|
onBlur == null ? void 0 : onBlur();
|
|
4964
4939
|
}, [onBlur]);
|
|
4965
|
-
const
|
|
4940
|
+
const focus = useCallback(() => {
|
|
4966
4941
|
var _a;
|
|
4967
4942
|
(_a = buttonRef.current) == null ? void 0 : _a.focus();
|
|
4968
4943
|
}, []);
|
|
@@ -4991,10 +4966,10 @@ const FileInput = ({
|
|
|
4991
4966
|
});
|
|
4992
4967
|
useEffect(() => {
|
|
4993
4968
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
4994
|
-
focus
|
|
4969
|
+
focus,
|
|
4995
4970
|
open: doOpen
|
|
4996
4971
|
});
|
|
4997
|
-
}, [
|
|
4972
|
+
}, [focus, doOpen, registerComponentApi]);
|
|
4998
4973
|
return /* @__PURE__ */ jsx(
|
|
4999
4974
|
ItemWithLabel,
|
|
5000
4975
|
{
|
|
@@ -5029,7 +5004,7 @@ const FileInput = ({
|
|
|
5029
5004
|
type: "button"
|
|
5030
5005
|
}),
|
|
5031
5006
|
children: [
|
|
5032
|
-
/* @__PURE__ */ jsx(VisuallyHidden.Root, { children: /* @__PURE__ */ jsx(
|
|
5007
|
+
/* @__PURE__ */ jsx(VisuallyHidden$1.Root, { children: /* @__PURE__ */ jsx(
|
|
5033
5008
|
"input",
|
|
5034
5009
|
{
|
|
5035
5010
|
...getInputProps({
|
|
@@ -5669,7 +5644,7 @@ const FooterMd = createMetadata({
|
|
|
5669
5644
|
[`fontSize-${COMP$Q}`]: "$fontSize-small",
|
|
5670
5645
|
[`textColor-${COMP$Q}`]: "$textColor-secondary",
|
|
5671
5646
|
[`maxWidth-content-${COMP$Q}`]: "$maxWidth-content",
|
|
5672
|
-
[`
|
|
5647
|
+
[`borderTop-${COMP$Q}`]: `1px solid $borderColor`,
|
|
5673
5648
|
[`padding-${COMP$Q}`]: "$space-2 $space-4",
|
|
5674
5649
|
light: {
|
|
5675
5650
|
// --- No light-specific theme vars
|
|
@@ -11574,8 +11549,8 @@ const NumberBox = forwardRef(function NumberBox2({
|
|
|
11574
11549
|
if (newValue === void 0) return;
|
|
11575
11550
|
updateValue(newValue, newValue.toString());
|
|
11576
11551
|
}, [valueStrRep, _step, min, max, integersOnly, updateValue, readOnly2]);
|
|
11577
|
-
useLongPress(upButton.current, handleIncStep);
|
|
11578
|
-
useLongPress(downButton.current, handleDecStep);
|
|
11552
|
+
useLongPress$1(upButton.current, handleIncStep);
|
|
11553
|
+
useLongPress$1(downButton.current, handleDecStep);
|
|
11579
11554
|
const handleOnBeforeInput = (event) => {
|
|
11580
11555
|
var _a;
|
|
11581
11556
|
let shouldPreventDefault = false;
|
|
@@ -11705,7 +11680,7 @@ const NumberBox = forwardRef(function NumberBox2({
|
|
|
11705
11680
|
setValueStrRep(mapToRepresentation(value));
|
|
11706
11681
|
onBlur == null ? void 0 : onBlur();
|
|
11707
11682
|
}, [value, onBlur]);
|
|
11708
|
-
const
|
|
11683
|
+
const focus = useCallback(() => {
|
|
11709
11684
|
var _a;
|
|
11710
11685
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
11711
11686
|
}, []);
|
|
@@ -11714,10 +11689,10 @@ const NumberBox = forwardRef(function NumberBox2({
|
|
|
11714
11689
|
});
|
|
11715
11690
|
useEffect(() => {
|
|
11716
11691
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
11717
|
-
focus
|
|
11692
|
+
focus,
|
|
11718
11693
|
setValue
|
|
11719
11694
|
});
|
|
11720
|
-
}, [
|
|
11695
|
+
}, [focus, registerComponentApi, setValue]);
|
|
11721
11696
|
return /* @__PURE__ */ jsx(
|
|
11722
11697
|
ItemWithLabel,
|
|
11723
11698
|
{
|
|
@@ -11816,7 +11791,7 @@ function applyStep(valueStrRep, step, min, max, integersOnly) {
|
|
|
11816
11791
|
}
|
|
11817
11792
|
return clamp(currentValue + step, min, max);
|
|
11818
11793
|
}
|
|
11819
|
-
function useLongPress(elementRef, action, delay = 500) {
|
|
11794
|
+
function useLongPress$1(elementRef, action, delay = 500) {
|
|
11820
11795
|
const timeoutId = useRef(0);
|
|
11821
11796
|
const intervalId = useRef(0);
|
|
11822
11797
|
const savedAction = useRef(action);
|
|
@@ -11852,7 +11827,92 @@ function useLongPress(elementRef, action, delay = 500) {
|
|
|
11852
11827
|
};
|
|
11853
11828
|
}, [elementRef, action, delay]);
|
|
11854
11829
|
}
|
|
11855
|
-
|
|
11830
|
+
function _extends() {
|
|
11831
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
11832
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
11833
|
+
var t = arguments[e];
|
|
11834
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
11835
|
+
}
|
|
11836
|
+
return n;
|
|
11837
|
+
}, _extends.apply(null, arguments);
|
|
11838
|
+
}
|
|
11839
|
+
function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
11840
|
+
if (typeof ref === "function") ref(value);
|
|
11841
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
11842
|
+
}
|
|
11843
|
+
function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
11844
|
+
return (node) => refs.forEach(
|
|
11845
|
+
(ref) => $6ed0406888f73fc4$var$setRef(ref, node)
|
|
11846
|
+
);
|
|
11847
|
+
}
|
|
11848
|
+
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
11849
|
+
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
11850
|
+
}
|
|
11851
|
+
const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
11852
|
+
const { children, ...slotProps } = props;
|
|
11853
|
+
const childrenArray = Children.toArray(children);
|
|
11854
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
11855
|
+
if (slottable) {
|
|
11856
|
+
const newElement = slottable.props.children;
|
|
11857
|
+
const newChildren = childrenArray.map((child) => {
|
|
11858
|
+
if (child === slottable) {
|
|
11859
|
+
if (Children.count(newElement) > 1) return Children.only(null);
|
|
11860
|
+
return /* @__PURE__ */ isValidElement(newElement) ? newElement.props.children : null;
|
|
11861
|
+
} else return child;
|
|
11862
|
+
});
|
|
11863
|
+
return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
11864
|
+
ref: forwardedRef
|
|
11865
|
+
}), /* @__PURE__ */ isValidElement(newElement) ? /* @__PURE__ */ cloneElement(newElement, void 0, newChildren) : null);
|
|
11866
|
+
}
|
|
11867
|
+
return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
11868
|
+
ref: forwardedRef
|
|
11869
|
+
}), children);
|
|
11870
|
+
});
|
|
11871
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
|
|
11872
|
+
const $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
11873
|
+
const { children, ...slotProps } = props;
|
|
11874
|
+
if (/* @__PURE__ */ isValidElement(children)) return /* @__PURE__ */ cloneElement(children, {
|
|
11875
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
11876
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
11877
|
+
});
|
|
11878
|
+
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
11879
|
+
});
|
|
11880
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
|
|
11881
|
+
const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
|
|
11882
|
+
return /* @__PURE__ */ createElement(Fragment$1, null, children);
|
|
11883
|
+
};
|
|
11884
|
+
function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
11885
|
+
return /* @__PURE__ */ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
11886
|
+
}
|
|
11887
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
11888
|
+
const overrideProps = {
|
|
11889
|
+
...childProps
|
|
11890
|
+
};
|
|
11891
|
+
for (const propName in childProps) {
|
|
11892
|
+
const slotPropValue = slotProps[propName];
|
|
11893
|
+
const childPropValue = childProps[propName];
|
|
11894
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
11895
|
+
if (isHandler) {
|
|
11896
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
11897
|
+
childPropValue(...args);
|
|
11898
|
+
slotPropValue(...args);
|
|
11899
|
+
};
|
|
11900
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
11901
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
11902
|
+
...slotPropValue,
|
|
11903
|
+
...childPropValue
|
|
11904
|
+
};
|
|
11905
|
+
else if (propName === "className") overrideProps[propName] = [
|
|
11906
|
+
slotPropValue,
|
|
11907
|
+
childPropValue
|
|
11908
|
+
].filter(Boolean).join(" ");
|
|
11909
|
+
}
|
|
11910
|
+
return {
|
|
11911
|
+
...slotProps,
|
|
11912
|
+
...overrideProps
|
|
11913
|
+
};
|
|
11914
|
+
}
|
|
11915
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
11856
11916
|
"a",
|
|
11857
11917
|
"button",
|
|
11858
11918
|
"div",
|
|
@@ -11870,47 +11930,53 @@ var NODES = [
|
|
|
11870
11930
|
"svg",
|
|
11871
11931
|
"ul"
|
|
11872
11932
|
];
|
|
11873
|
-
|
|
11874
|
-
const
|
|
11875
|
-
const Node = React.forwardRef((props, forwardedRef) => {
|
|
11933
|
+
const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
|
|
11934
|
+
const Node = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
11876
11935
|
const { asChild, ...primitiveProps } = props;
|
|
11877
|
-
const Comp = asChild ?
|
|
11878
|
-
|
|
11936
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
11937
|
+
useEffect(() => {
|
|
11879
11938
|
window[Symbol.for("radix-ui")] = true;
|
|
11880
|
-
}
|
|
11881
|
-
return /* @__PURE__ */
|
|
11939
|
+
}, []);
|
|
11940
|
+
return /* @__PURE__ */ createElement(Comp, _extends({}, primitiveProps, {
|
|
11941
|
+
ref: forwardedRef
|
|
11942
|
+
}));
|
|
11882
11943
|
});
|
|
11883
11944
|
Node.displayName = `Primitive.${node}`;
|
|
11884
|
-
return {
|
|
11945
|
+
return {
|
|
11946
|
+
...primitive,
|
|
11947
|
+
[node]: Node
|
|
11948
|
+
};
|
|
11885
11949
|
}, {});
|
|
11886
|
-
function
|
|
11887
|
-
const callbackRef =
|
|
11888
|
-
|
|
11950
|
+
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
11951
|
+
const callbackRef = useRef(callback);
|
|
11952
|
+
useEffect(() => {
|
|
11889
11953
|
callbackRef.current = callback;
|
|
11890
11954
|
});
|
|
11891
|
-
return
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11955
|
+
return useMemo(
|
|
11956
|
+
() => (...args) => {
|
|
11957
|
+
var _callbackRef$current;
|
|
11958
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
11959
|
+
},
|
|
11960
|
+
[]
|
|
11961
|
+
);
|
|
11895
11962
|
}
|
|
11896
|
-
var
|
|
11897
|
-
var
|
|
11898
|
-
var
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
const
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
const
|
|
11913
|
-
const focusScope = React.useRef({
|
|
11963
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
11964
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
11965
|
+
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
11966
|
+
bubbles: false,
|
|
11967
|
+
cancelable: true
|
|
11968
|
+
};
|
|
11969
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
11970
|
+
const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props;
|
|
11971
|
+
const [container1, setContainer] = useState(null);
|
|
11972
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
11973
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
11974
|
+
const lastFocusedElementRef = useRef(null);
|
|
11975
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
11976
|
+
forwardedRef,
|
|
11977
|
+
(node) => setContainer(node)
|
|
11978
|
+
);
|
|
11979
|
+
const focusScope = useRef({
|
|
11914
11980
|
paused: false,
|
|
11915
11981
|
pause() {
|
|
11916
11982
|
this.paused = true;
|
|
@@ -11919,114 +11985,137 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
11919
11985
|
this.paused = false;
|
|
11920
11986
|
}
|
|
11921
11987
|
}).current;
|
|
11922
|
-
|
|
11988
|
+
useEffect(() => {
|
|
11923
11989
|
if (trapped) {
|
|
11924
|
-
let
|
|
11925
|
-
if (focusScope.paused || !
|
|
11990
|
+
let handleFocusIn = function(event) {
|
|
11991
|
+
if (focusScope.paused || !container1) return;
|
|
11926
11992
|
const target2 = event.target;
|
|
11927
|
-
if (
|
|
11928
|
-
|
|
11929
|
-
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
if (focusScope.paused || !container2) return;
|
|
11993
|
+
if (container1.contains(target2)) lastFocusedElementRef.current = target2;
|
|
11994
|
+
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
11995
|
+
select: true
|
|
11996
|
+
});
|
|
11997
|
+
}, handleFocusOut = function(event) {
|
|
11998
|
+
if (focusScope.paused || !container1) return;
|
|
11934
11999
|
const relatedTarget = event.relatedTarget;
|
|
11935
12000
|
if (relatedTarget === null) return;
|
|
11936
|
-
if (!
|
|
11937
|
-
|
|
11938
|
-
}
|
|
12001
|
+
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
12002
|
+
select: true
|
|
12003
|
+
});
|
|
11939
12004
|
}, handleMutations2 = function(mutations2) {
|
|
11940
12005
|
const focusedElement = document.activeElement;
|
|
11941
12006
|
if (focusedElement !== document.body) return;
|
|
11942
|
-
for (const mutation of mutations2)
|
|
11943
|
-
if (mutation.removedNodes.length > 0) focus(container2);
|
|
11944
|
-
}
|
|
12007
|
+
for (const mutation of mutations2) if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
11945
12008
|
};
|
|
11946
|
-
document.addEventListener("focusin",
|
|
11947
|
-
document.addEventListener("focusout",
|
|
12009
|
+
document.addEventListener("focusin", handleFocusIn);
|
|
12010
|
+
document.addEventListener("focusout", handleFocusOut);
|
|
11948
12011
|
const mutationObserver = new MutationObserver(handleMutations2);
|
|
11949
|
-
if (
|
|
12012
|
+
if (container1) mutationObserver.observe(container1, {
|
|
12013
|
+
childList: true,
|
|
12014
|
+
subtree: true
|
|
12015
|
+
});
|
|
11950
12016
|
return () => {
|
|
11951
|
-
document.removeEventListener("focusin",
|
|
11952
|
-
document.removeEventListener("focusout",
|
|
12017
|
+
document.removeEventListener("focusin", handleFocusIn);
|
|
12018
|
+
document.removeEventListener("focusout", handleFocusOut);
|
|
11953
12019
|
mutationObserver.disconnect();
|
|
11954
12020
|
};
|
|
11955
12021
|
}
|
|
11956
|
-
}, [
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
12022
|
+
}, [
|
|
12023
|
+
trapped,
|
|
12024
|
+
container1,
|
|
12025
|
+
focusScope.paused
|
|
12026
|
+
]);
|
|
12027
|
+
useEffect(() => {
|
|
12028
|
+
if (container1) {
|
|
12029
|
+
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
11960
12030
|
const previouslyFocusedElement = document.activeElement;
|
|
11961
|
-
const hasFocusedCandidate =
|
|
12031
|
+
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
11962
12032
|
if (!hasFocusedCandidate) {
|
|
11963
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
11964
|
-
|
|
11965
|
-
|
|
12033
|
+
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
12034
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
12035
|
+
container1.dispatchEvent(mountEvent);
|
|
11966
12036
|
if (!mountEvent.defaultPrevented) {
|
|
11967
|
-
focusFirst(removeLinks(getTabbableCandidates(
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
12037
|
+
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
12038
|
+
select: true
|
|
12039
|
+
});
|
|
12040
|
+
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
11971
12041
|
}
|
|
11972
12042
|
}
|
|
11973
12043
|
return () => {
|
|
11974
|
-
|
|
12044
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
11975
12045
|
setTimeout(() => {
|
|
11976
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
if (!unmountEvent.defaultPrevented) {
|
|
11980
|
-
|
|
11981
|
-
}
|
|
11982
|
-
|
|
11983
|
-
focusScopesStack.remove(focusScope);
|
|
12046
|
+
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
12047
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
12048
|
+
container1.dispatchEvent(unmountEvent);
|
|
12049
|
+
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
12050
|
+
select: true
|
|
12051
|
+
});
|
|
12052
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
12053
|
+
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
11984
12054
|
}, 0);
|
|
11985
12055
|
};
|
|
11986
12056
|
}
|
|
11987
|
-
}, [
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12057
|
+
}, [
|
|
12058
|
+
container1,
|
|
12059
|
+
onMountAutoFocus,
|
|
12060
|
+
onUnmountAutoFocus,
|
|
12061
|
+
focusScope
|
|
12062
|
+
]);
|
|
12063
|
+
const handleKeyDown = useCallback((event) => {
|
|
12064
|
+
if (!loop && !trapped) return;
|
|
12065
|
+
if (focusScope.paused) return;
|
|
12066
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
12067
|
+
const focusedElement = document.activeElement;
|
|
12068
|
+
if (isTabKey && focusedElement) {
|
|
12069
|
+
const container2 = event.currentTarget;
|
|
12070
|
+
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container2);
|
|
12071
|
+
const hasTabbableElementsInside = first && last;
|
|
12072
|
+
if (!hasTabbableElementsInside) {
|
|
12073
|
+
if (focusedElement === container2) event.preventDefault();
|
|
12074
|
+
} else {
|
|
12075
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
12076
|
+
event.preventDefault();
|
|
12077
|
+
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
12078
|
+
select: true
|
|
12079
|
+
});
|
|
12080
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
12081
|
+
event.preventDefault();
|
|
12082
|
+
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
12083
|
+
select: true
|
|
12084
|
+
});
|
|
12008
12085
|
}
|
|
12009
12086
|
}
|
|
12010
|
-
}
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12087
|
+
}
|
|
12088
|
+
}, [
|
|
12089
|
+
loop,
|
|
12090
|
+
trapped,
|
|
12091
|
+
focusScope.paused
|
|
12092
|
+
]);
|
|
12093
|
+
return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
12094
|
+
tabIndex: -1
|
|
12095
|
+
}, scopeProps, {
|
|
12096
|
+
ref: composedRefs,
|
|
12097
|
+
onKeyDown: handleKeyDown
|
|
12098
|
+
}));
|
|
12014
12099
|
});
|
|
12015
|
-
|
|
12016
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
12100
|
+
function $d3863c46a17e8a28$var$focusFirst(candidates, { select = false } = {}) {
|
|
12017
12101
|
const previouslyFocusedElement = document.activeElement;
|
|
12018
12102
|
for (const candidate of candidates) {
|
|
12019
|
-
focus(candidate, {
|
|
12103
|
+
$d3863c46a17e8a28$var$focus(candidate, {
|
|
12104
|
+
select
|
|
12105
|
+
});
|
|
12020
12106
|
if (document.activeElement !== previouslyFocusedElement) return;
|
|
12021
12107
|
}
|
|
12022
12108
|
}
|
|
12023
|
-
function getTabbableEdges(container2) {
|
|
12024
|
-
const candidates = getTabbableCandidates(container2);
|
|
12025
|
-
const first = findVisible(candidates, container2);
|
|
12026
|
-
const last = findVisible(candidates.reverse(), container2);
|
|
12027
|
-
return [
|
|
12109
|
+
function $d3863c46a17e8a28$var$getTabbableEdges(container2) {
|
|
12110
|
+
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container2);
|
|
12111
|
+
const first = $d3863c46a17e8a28$var$findVisible(candidates, container2);
|
|
12112
|
+
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container2);
|
|
12113
|
+
return [
|
|
12114
|
+
first,
|
|
12115
|
+
last
|
|
12116
|
+
];
|
|
12028
12117
|
}
|
|
12029
|
-
function getTabbableCandidates(container2) {
|
|
12118
|
+
function $d3863c46a17e8a28$var$getTabbableCandidates(container2) {
|
|
12030
12119
|
const nodes = [];
|
|
12031
12120
|
const walker = document.createTreeWalker(container2, NodeFilter.SHOW_ELEMENT, {
|
|
12032
12121
|
acceptNode: (node) => {
|
|
@@ -12038,12 +12127,14 @@ function getTabbableCandidates(container2) {
|
|
|
12038
12127
|
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
12039
12128
|
return nodes;
|
|
12040
12129
|
}
|
|
12041
|
-
function findVisible(elements, container2) {
|
|
12130
|
+
function $d3863c46a17e8a28$var$findVisible(elements, container2) {
|
|
12042
12131
|
for (const element of elements) {
|
|
12043
|
-
if (
|
|
12132
|
+
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
12133
|
+
upTo: container2
|
|
12134
|
+
})) return element;
|
|
12044
12135
|
}
|
|
12045
12136
|
}
|
|
12046
|
-
function isHidden(node, { upTo }) {
|
|
12137
|
+
function $d3863c46a17e8a28$var$isHidden(node, { upTo }) {
|
|
12047
12138
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
12048
12139
|
while (node) {
|
|
12049
12140
|
if (upTo !== void 0 && node === upTo) return false;
|
|
@@ -12052,81 +12143,84 @@ function isHidden(node, { upTo }) {
|
|
|
12052
12143
|
}
|
|
12053
12144
|
return false;
|
|
12054
12145
|
}
|
|
12055
|
-
function isSelectableInput(element) {
|
|
12146
|
+
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
12056
12147
|
return element instanceof HTMLInputElement && "select" in element;
|
|
12057
12148
|
}
|
|
12058
|
-
function focus(element, { select = false } = {}) {
|
|
12149
|
+
function $d3863c46a17e8a28$var$focus(element, { select = false } = {}) {
|
|
12059
12150
|
if (element && element.focus) {
|
|
12060
12151
|
const previouslyFocusedElement = document.activeElement;
|
|
12061
|
-
element.focus({
|
|
12062
|
-
|
|
12063
|
-
|
|
12152
|
+
element.focus({
|
|
12153
|
+
preventScroll: true
|
|
12154
|
+
});
|
|
12155
|
+
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
12064
12156
|
}
|
|
12065
12157
|
}
|
|
12066
|
-
var
|
|
12067
|
-
function createFocusScopesStack() {
|
|
12158
|
+
const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
12159
|
+
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
12068
12160
|
let stack = [];
|
|
12069
12161
|
return {
|
|
12070
12162
|
add(focusScope) {
|
|
12071
12163
|
const activeFocusScope = stack[0];
|
|
12072
|
-
if (focusScope !== activeFocusScope)
|
|
12073
|
-
|
|
12074
|
-
}
|
|
12075
|
-
stack = arrayRemove(stack, focusScope);
|
|
12164
|
+
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
12165
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
12076
12166
|
stack.unshift(focusScope);
|
|
12077
12167
|
},
|
|
12078
12168
|
remove(focusScope) {
|
|
12079
|
-
var
|
|
12080
|
-
stack = arrayRemove(stack, focusScope);
|
|
12081
|
-
(
|
|
12169
|
+
var _stack$;
|
|
12170
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
12171
|
+
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
12082
12172
|
}
|
|
12083
12173
|
};
|
|
12084
12174
|
}
|
|
12085
|
-
function arrayRemove(array, item) {
|
|
12086
|
-
const updatedArray = [
|
|
12175
|
+
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
12176
|
+
const updatedArray = [
|
|
12177
|
+
...array
|
|
12178
|
+
];
|
|
12087
12179
|
const index = updatedArray.indexOf(item);
|
|
12088
|
-
if (index !== -1)
|
|
12089
|
-
updatedArray.splice(index, 1);
|
|
12090
|
-
}
|
|
12180
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
12091
12181
|
return updatedArray;
|
|
12092
12182
|
}
|
|
12093
|
-
function removeLinks(items) {
|
|
12094
|
-
return items.filter(
|
|
12183
|
+
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
12184
|
+
return items.filter(
|
|
12185
|
+
(item) => item.tagName !== "A"
|
|
12186
|
+
);
|
|
12095
12187
|
}
|
|
12096
|
-
const themeVars$m = `'{"Input:fontSize-Select-default": "var(--xmlui-fontSize-Select-default)", "Input:textColor-placeholder-Select-default": "var(--xmlui-textColor-placeholder-Select-default)", "Input:textColor-Select-default": "var(--xmlui-textColor-Select-default)", "Input:fontSize-Select-error": "var(--xmlui-fontSize-Select-error)", "Input:textColor-placeholder-Select-error": "var(--xmlui-textColor-placeholder-Select-error)", "Input:textColor-Select-error": "var(--xmlui-textColor-Select-error)", "Input:fontSize-Select-warning": "var(--xmlui-fontSize-Select-warning)", "Input:textColor-placeholder-Select-warning": "var(--xmlui-textColor-placeholder-Select-warning)", "Input:textColor-Select-warning": "var(--xmlui-textColor-Select-warning)", "Input:fontSize-Select-success": "var(--xmlui-fontSize-Select-success)", "Input:textColor-placeholder-Select-success": "var(--xmlui-textColor-placeholder-Select-success)", "Input:textColor-Select-success": "var(--xmlui-textColor-Select-success)", "Input:borderRadius-Select-default": "var(--xmlui-borderRadius-Select-default)", "Input:borderColor-Select-default": "var(--xmlui-borderColor-Select-default)", "Input:borderWidth-Select-default": "var(--xmlui-borderWidth-Select-default)", "Input:borderStyle-Select-default": "var(--xmlui-borderStyle-Select-default)", "Input:backgroundColor-Select-default": "var(--xmlui-backgroundColor-Select-default)", "Input:boxShadow-Select-default": "var(--xmlui-boxShadow-Select-default)", "Input:borderColor-Select-default--hover": "var(--xmlui-borderColor-Select-default--hover)", "Input:backgroundColor-Select-default--hover": "var(--xmlui-backgroundColor-Select-default--hover)", "Input:boxShadow-Select-default--hover": "var(--xmlui-boxShadow-Select-default--hover)", "Input:textColor-Select-default--hover": "var(--xmlui-textColor-Select-default--hover)", "Input:outlineWidth-Select-default--focus": "var(--xmlui-outlineWidth-Select-default--focus)", "Input:outlineColor-Select-default--focus": "var(--xmlui-outlineColor-Select-default--focus)", "Input:outlineStyle-Select-default--focus": "var(--xmlui-outlineStyle-Select-default--focus)", "Input:outlineOffset-Select-default--focus": "var(--xmlui-outlineOffset-Select-default--focus)", "Input:borderRadius-Select-error": "var(--xmlui-borderRadius-Select-error)", "Input:borderColor-Select-error": "var(--xmlui-borderColor-Select-error)", "Input:borderWidth-Select-error": "var(--xmlui-borderWidth-Select-error)", "Input:borderStyle-Select-error": "var(--xmlui-borderStyle-Select-error)", "Input:backgroundColor-Select-error": "var(--xmlui-backgroundColor-Select-error)", "Input:boxShadow-Select-error": "var(--xmlui-boxShadow-Select-error)", "Input:borderColor-Select-error--hover": "var(--xmlui-borderColor-Select-error--hover)", "Input:backgroundColor-Select-error--hover": "var(--xmlui-backgroundColor-Select-error--hover)", "Input:boxShadow-Select-error--hover": "var(--xmlui-boxShadow-Select-error--hover)", "Input:textColor-Select-error--hover": "var(--xmlui-textColor-Select-error--hover)", "Input:outlineWidth-Select-error--focus": "var(--xmlui-outlineWidth-Select-error--focus)", "Input:outlineColor-Select-error--focus": "var(--xmlui-outlineColor-Select-error--focus)", "Input:outlineStyle-Select-error--focus": "var(--xmlui-outlineStyle-Select-error--focus)", "Input:outlineOffset-Select-error--focus": "var(--xmlui-outlineOffset-Select-error--focus)", "Input:borderRadius-Select-warning": "var(--xmlui-borderRadius-Select-warning)", "Input:borderColor-Select-warning": "var(--xmlui-borderColor-Select-warning)", "Input:borderWidth-Select-warning": "var(--xmlui-borderWidth-Select-warning)", "Input:borderStyle-Select-warning": "var(--xmlui-borderStyle-Select-warning)", "Input:backgroundColor-Select-warning": "var(--xmlui-backgroundColor-Select-warning)", "Input:boxShadow-Select-warning": "var(--xmlui-boxShadow-Select-warning)", "Input:borderColor-Select-warning--hover": "var(--xmlui-borderColor-Select-warning--hover)", "Input:backgroundColor-Select-warning--hover": "var(--xmlui-backgroundColor-Select-warning--hover)", "Input:boxShadow-Select-warning--hover": "var(--xmlui-boxShadow-Select-warning--hover)", "Input:textColor-Select-warning--hover": "var(--xmlui-textColor-Select-warning--hover)", "Input:outlineWidth-Select-warning--focus": "var(--xmlui-outlineWidth-Select-warning--focus)", "Input:outlineColor-Select-warning--focus": "var(--xmlui-outlineColor-Select-warning--focus)", "Input:outlineStyle-Select-warning--focus": "var(--xmlui-outlineStyle-Select-warning--focus)", "Input:outlineOffset-Select-warning--focus": "var(--xmlui-outlineOffset-Select-warning--focus)", "Input:borderRadius-Select-success": "var(--xmlui-borderRadius-Select-success)", "Input:borderColor-Select-success": "var(--xmlui-borderColor-Select-success)", "Input:borderWidth-Select-success": "var(--xmlui-borderWidth-Select-success)", "Input:borderStyle-Select-success": "var(--xmlui-borderStyle-Select-success)", "Input:backgroundColor-Select-success": "var(--xmlui-backgroundColor-Select-success)", "Input:boxShadow-Select-success": "var(--xmlui-boxShadow-Select-success)", "Input:borderColor-Select-success--hover": "var(--xmlui-borderColor-Select-success--hover)", "Input:backgroundColor-Select-success--hover": "var(--xmlui-backgroundColor-Select-success--hover)", "Input:boxShadow-Select-success--hover": "var(--xmlui-boxShadow-Select-success--hover)", "Input:textColor-Select-success--hover": "var(--xmlui-textColor-Select-success--hover)", "Input:outlineWidth-Select-success--focus": "var(--xmlui-outlineWidth-Select-success--focus)", "Input:outlineColor-Select-success--focus": "var(--xmlui-outlineColor-Select-success--focus)", "Input:outlineStyle-Select-success--focus": "var(--xmlui-outlineStyle-Select-success--focus)", "Input:outlineOffset-Select-success--focus": "var(--xmlui-outlineOffset-Select-success--focus)", "opacity-Select--disabled": "var(--xmlui-opacity-Select--disabled)", "Input:backgroundColor-Select--disabled": "var(--xmlui-backgroundColor-Select--disabled)", "Input:textColor-Select--disabled": "var(--xmlui-textColor-Select--disabled)", "Input:borderColor-Select--disabled": "var(--xmlui-borderColor-Select--disabled)", "paddingVertical-Select-badge": "var(--xmlui-paddingVertical-Select-badge)", "paddingHorizontal-Select-badge": "var(--xmlui-paddingHorizontal-Select-badge)", "Input:fontSize-Select-badge": "var(--xmlui-fontSize-Select-badge)", "Input:backgroundColor-Select-badge": "var(--xmlui-backgroundColor-Select-badge)", "Input:textColor-Select-badge": "var(--xmlui-textColor-Select-badge)", "Input:backgroundColor-Select-badge--hover": "var(--xmlui-backgroundColor-Select-badge--hover)", "Input:textColor-Select-badge--hover": "var(--xmlui-textColor-Select-badge--hover)", "Input:backgroundColor-Select-badge--active": "var(--xmlui-backgroundColor-Select-badge--active)", "Input:textColor-Select-badge--active": "var(--xmlui-textColor-Select-badge--active)", "Input:textColor-placeholder-Select": "var(--xmlui-textColor-placeholder-Select)", "Input:backgroundColor-menu-Select": "var(--xmlui-backgroundColor-menu-Select)", "Input:borderRadius-menu-Select": "var(--xmlui-borderRadius-menu-Select)", "Input:boxShadow-menu-Select": "var(--xmlui-boxShadow-menu-Select)", "Input:borderWidth-menu-Select": "var(--xmlui-borderWidth-menu-Select)", "Input:borderColor-menu-Select": "var(--xmlui-borderColor-menu-Select)", "backgroundColor-item-Select": "var(--xmlui-backgroundColor-item-Select)", "backgroundColor-item-Select--hover": "var(--xmlui-backgroundColor-item-Select--hover)", "opacity-text-item-Select--disabled": "var(--xmlui-opacity-text-item-Select--disabled)", "fontSize-Select": "var(--xmlui-fontSize-Select)", "backgroundColor-item-Select--active": "var(--xmlui-backgroundColor-item-Select--active)", "textColor-indicator-Select": "var(--xmlui-textColor-indicator-Select)"}'`;
|
|
12097
|
-
const selectValue = "
|
|
12098
|
-
const error$6 = "
|
|
12099
|
-
const warning$6 = "
|
|
12100
|
-
const valid$6 = "
|
|
12101
|
-
const selectTrigger = "
|
|
12102
|
-
const badgeListContainer = "
|
|
12103
|
-
const badgeList$1 = "
|
|
12104
|
-
const badge$1 = "
|
|
12105
|
-
const actions$1 = "
|
|
12106
|
-
const placeholder = "
|
|
12107
|
-
const emptyList = "
|
|
12108
|
-
const selectScrollUpButton = "
|
|
12109
|
-
const selectScrollDownButton = "
|
|
12110
|
-
const command$1 = "
|
|
12111
|
-
const commandInputContainer = "
|
|
12112
|
-
const commandInput$1 = "
|
|
12113
|
-
const commandList$1 = "
|
|
12114
|
-
const selectContent = "
|
|
12115
|
-
const fadeIn = "
|
|
12116
|
-
const zoomIn = "
|
|
12117
|
-
const fadeOut = "
|
|
12118
|
-
const zoomOut = "
|
|
12119
|
-
const slideInFromTop = "
|
|
12120
|
-
const slideInFromRight = "
|
|
12121
|
-
const slideInFromLeft = "
|
|
12122
|
-
const slideInFromBottom = "
|
|
12123
|
-
const multiComboboxOption = "
|
|
12124
|
-
const
|
|
12125
|
-
const
|
|
12126
|
-
const
|
|
12127
|
-
const
|
|
12128
|
-
const
|
|
12129
|
-
const
|
|
12188
|
+
const themeVars$m = `'{"padding-item-Select": "var(--xmlui-padding-item-Select)", "paddingHorizontal-item-Select": "var(--xmlui-paddingHorizontal-item-Select, var(--xmlui-padding-item-Select))", "paddingVertical-item-Select": "var(--xmlui-paddingVertical-item-Select, var(--xmlui-padding-item-Select))", "paddingLeft-item-Select": "var(--xmlui-paddingLeft-item-Select, var(--xmlui-paddingHorizontal-item-Select, var(--xmlui-padding-item-Select)))", "paddingRight-item-Select": "var(--xmlui-paddingRight-item-Select, var(--xmlui-paddingHorizontal-item-Select, var(--xmlui-padding-item-Select)))", "paddingTop-item-Select": "var(--xmlui-paddingTop-item-Select, var(--xmlui-paddingVertical-item-Select, var(--xmlui-padding-item-Select)))", "paddingBottom-item-Select": "var(--xmlui-paddingBottom-item-Select, var(--xmlui-paddingVertical-item-Select, var(--xmlui-padding-item-Select)))", "Input:fontSize-Select-default": "var(--xmlui-fontSize-Select-default)", "Input:textColor-placeholder-Select-default": "var(--xmlui-textColor-placeholder-Select-default)", "Input:textColor-Select-default": "var(--xmlui-textColor-Select-default)", "Input:fontSize-Select-error": "var(--xmlui-fontSize-Select-error)", "Input:textColor-placeholder-Select-error": "var(--xmlui-textColor-placeholder-Select-error)", "Input:textColor-Select-error": "var(--xmlui-textColor-Select-error)", "Input:fontSize-Select-warning": "var(--xmlui-fontSize-Select-warning)", "Input:textColor-placeholder-Select-warning": "var(--xmlui-textColor-placeholder-Select-warning)", "Input:textColor-Select-warning": "var(--xmlui-textColor-Select-warning)", "Input:fontSize-Select-success": "var(--xmlui-fontSize-Select-success)", "Input:textColor-placeholder-Select-success": "var(--xmlui-textColor-placeholder-Select-success)", "Input:textColor-Select-success": "var(--xmlui-textColor-Select-success)", "Input:borderRadius-Select-default": "var(--xmlui-borderRadius-Select-default)", "Input:borderColor-Select-default": "var(--xmlui-borderColor-Select-default)", "Input:borderWidth-Select-default": "var(--xmlui-borderWidth-Select-default)", "Input:borderStyle-Select-default": "var(--xmlui-borderStyle-Select-default)", "Input:backgroundColor-Select-default": "var(--xmlui-backgroundColor-Select-default)", "Input:boxShadow-Select-default": "var(--xmlui-boxShadow-Select-default)", "Input:borderColor-Select-default--hover": "var(--xmlui-borderColor-Select-default--hover)", "Input:backgroundColor-Select-default--hover": "var(--xmlui-backgroundColor-Select-default--hover)", "Input:boxShadow-Select-default--hover": "var(--xmlui-boxShadow-Select-default--hover)", "Input:textColor-Select-default--hover": "var(--xmlui-textColor-Select-default--hover)", "Input:outlineWidth-Select-default--focus": "var(--xmlui-outlineWidth-Select-default--focus)", "Input:outlineColor-Select-default--focus": "var(--xmlui-outlineColor-Select-default--focus)", "Input:outlineStyle-Select-default--focus": "var(--xmlui-outlineStyle-Select-default--focus)", "Input:outlineOffset-Select-default--focus": "var(--xmlui-outlineOffset-Select-default--focus)", "Input:borderRadius-Select-error": "var(--xmlui-borderRadius-Select-error)", "Input:borderColor-Select-error": "var(--xmlui-borderColor-Select-error)", "Input:borderWidth-Select-error": "var(--xmlui-borderWidth-Select-error)", "Input:borderStyle-Select-error": "var(--xmlui-borderStyle-Select-error)", "Input:backgroundColor-Select-error": "var(--xmlui-backgroundColor-Select-error)", "Input:boxShadow-Select-error": "var(--xmlui-boxShadow-Select-error)", "Input:borderColor-Select-error--hover": "var(--xmlui-borderColor-Select-error--hover)", "Input:backgroundColor-Select-error--hover": "var(--xmlui-backgroundColor-Select-error--hover)", "Input:boxShadow-Select-error--hover": "var(--xmlui-boxShadow-Select-error--hover)", "Input:textColor-Select-error--hover": "var(--xmlui-textColor-Select-error--hover)", "Input:outlineWidth-Select-error--focus": "var(--xmlui-outlineWidth-Select-error--focus)", "Input:outlineColor-Select-error--focus": "var(--xmlui-outlineColor-Select-error--focus)", "Input:outlineStyle-Select-error--focus": "var(--xmlui-outlineStyle-Select-error--focus)", "Input:outlineOffset-Select-error--focus": "var(--xmlui-outlineOffset-Select-error--focus)", "Input:borderRadius-Select-warning": "var(--xmlui-borderRadius-Select-warning)", "Input:borderColor-Select-warning": "var(--xmlui-borderColor-Select-warning)", "Input:borderWidth-Select-warning": "var(--xmlui-borderWidth-Select-warning)", "Input:borderStyle-Select-warning": "var(--xmlui-borderStyle-Select-warning)", "Input:backgroundColor-Select-warning": "var(--xmlui-backgroundColor-Select-warning)", "Input:boxShadow-Select-warning": "var(--xmlui-boxShadow-Select-warning)", "Input:borderColor-Select-warning--hover": "var(--xmlui-borderColor-Select-warning--hover)", "Input:backgroundColor-Select-warning--hover": "var(--xmlui-backgroundColor-Select-warning--hover)", "Input:boxShadow-Select-warning--hover": "var(--xmlui-boxShadow-Select-warning--hover)", "Input:textColor-Select-warning--hover": "var(--xmlui-textColor-Select-warning--hover)", "Input:outlineWidth-Select-warning--focus": "var(--xmlui-outlineWidth-Select-warning--focus)", "Input:outlineColor-Select-warning--focus": "var(--xmlui-outlineColor-Select-warning--focus)", "Input:outlineStyle-Select-warning--focus": "var(--xmlui-outlineStyle-Select-warning--focus)", "Input:outlineOffset-Select-warning--focus": "var(--xmlui-outlineOffset-Select-warning--focus)", "Input:borderRadius-Select-success": "var(--xmlui-borderRadius-Select-success)", "Input:borderColor-Select-success": "var(--xmlui-borderColor-Select-success)", "Input:borderWidth-Select-success": "var(--xmlui-borderWidth-Select-success)", "Input:borderStyle-Select-success": "var(--xmlui-borderStyle-Select-success)", "Input:backgroundColor-Select-success": "var(--xmlui-backgroundColor-Select-success)", "Input:boxShadow-Select-success": "var(--xmlui-boxShadow-Select-success)", "Input:borderColor-Select-success--hover": "var(--xmlui-borderColor-Select-success--hover)", "Input:backgroundColor-Select-success--hover": "var(--xmlui-backgroundColor-Select-success--hover)", "Input:boxShadow-Select-success--hover": "var(--xmlui-boxShadow-Select-success--hover)", "Input:textColor-Select-success--hover": "var(--xmlui-textColor-Select-success--hover)", "Input:outlineWidth-Select-success--focus": "var(--xmlui-outlineWidth-Select-success--focus)", "Input:outlineColor-Select-success--focus": "var(--xmlui-outlineColor-Select-success--focus)", "Input:outlineStyle-Select-success--focus": "var(--xmlui-outlineStyle-Select-success--focus)", "Input:outlineOffset-Select-success--focus": "var(--xmlui-outlineOffset-Select-success--focus)", "opacity-Select--disabled": "var(--xmlui-opacity-Select--disabled)", "Input:backgroundColor-Select--disabled": "var(--xmlui-backgroundColor-Select--disabled)", "Input:textColor-Select--disabled": "var(--xmlui-textColor-Select--disabled)", "Input:borderColor-Select--disabled": "var(--xmlui-borderColor-Select--disabled)", "paddingVertical-Select-badge": "var(--xmlui-paddingVertical-Select-badge)", "paddingHorizontal-Select-badge": "var(--xmlui-paddingHorizontal-Select-badge)", "Input:fontSize-Select-badge": "var(--xmlui-fontSize-Select-badge)", "Input:backgroundColor-Select-badge": "var(--xmlui-backgroundColor-Select-badge)", "Input:textColor-Select-badge": "var(--xmlui-textColor-Select-badge)", "Input:backgroundColor-Select-badge--hover": "var(--xmlui-backgroundColor-Select-badge--hover)", "Input:textColor-Select-badge--hover": "var(--xmlui-textColor-Select-badge--hover)", "Input:backgroundColor-Select-badge--active": "var(--xmlui-backgroundColor-Select-badge--active)", "Input:textColor-Select-badge--active": "var(--xmlui-textColor-Select-badge--active)", "Input:textColor-placeholder-Select": "var(--xmlui-textColor-placeholder-Select)", "Input:backgroundColor-menu-Select": "var(--xmlui-backgroundColor-menu-Select)", "Input:borderRadius-menu-Select": "var(--xmlui-borderRadius-menu-Select)", "Input:boxShadow-menu-Select": "var(--xmlui-boxShadow-menu-Select)", "Input:borderWidth-menu-Select": "var(--xmlui-borderWidth-menu-Select)", "Input:borderColor-menu-Select": "var(--xmlui-borderColor-menu-Select)", "backgroundColor-item-Select": "var(--xmlui-backgroundColor-item-Select)", "backgroundColor-item-Select--hover": "var(--xmlui-backgroundColor-item-Select--hover)", "opacity-text-item-Select--disabled": "var(--xmlui-opacity-text-item-Select--disabled)", "fontSize-Select": "var(--xmlui-fontSize-Select)", "backgroundColor-item-Select--active": "var(--xmlui-backgroundColor-item-Select--active)", "textColor-indicator-Select": "var(--xmlui-textColor-indicator-Select)"}'`;
|
|
12189
|
+
const selectValue = "_selectValue_nwesf_13";
|
|
12190
|
+
const error$6 = "_error_nwesf_21";
|
|
12191
|
+
const warning$6 = "_warning_nwesf_29";
|
|
12192
|
+
const valid$6 = "_valid_nwesf_37";
|
|
12193
|
+
const selectTrigger = "_selectTrigger_nwesf_46";
|
|
12194
|
+
const badgeListContainer = "_badgeListContainer_nwesf_170";
|
|
12195
|
+
const badgeList$1 = "_badgeList_nwesf_170";
|
|
12196
|
+
const badge$1 = "_badge_nwesf_170";
|
|
12197
|
+
const actions$1 = "_actions_nwesf_210";
|
|
12198
|
+
const placeholder = "_placeholder_nwesf_216";
|
|
12199
|
+
const emptyList = "_emptyList_nwesf_221";
|
|
12200
|
+
const selectScrollUpButton = "_selectScrollUpButton_nwesf_231";
|
|
12201
|
+
const selectScrollDownButton = "_selectScrollDownButton_nwesf_240";
|
|
12202
|
+
const command$1 = "_command_nwesf_249";
|
|
12203
|
+
const commandInputContainer = "_commandInputContainer_nwesf_259";
|
|
12204
|
+
const commandInput$1 = "_commandInput_nwesf_259";
|
|
12205
|
+
const commandList$1 = "_commandList_nwesf_284";
|
|
12206
|
+
const selectContent = "_selectContent_nwesf_289";
|
|
12207
|
+
const fadeIn = "_fadeIn_nwesf_1";
|
|
12208
|
+
const zoomIn = "_zoomIn_nwesf_1";
|
|
12209
|
+
const fadeOut = "_fadeOut_nwesf_1";
|
|
12210
|
+
const zoomOut = "_zoomOut_nwesf_1";
|
|
12211
|
+
const slideInFromTop = "_slideInFromTop_nwesf_1";
|
|
12212
|
+
const slideInFromRight = "_slideInFromRight_nwesf_1";
|
|
12213
|
+
const slideInFromLeft = "_slideInFromLeft_nwesf_1";
|
|
12214
|
+
const slideInFromBottom = "_slideInFromBottom_nwesf_1";
|
|
12215
|
+
const multiComboboxOption = "_multiComboboxOption_nwesf_329";
|
|
12216
|
+
const multiComboboxOptionContent = "_multiComboboxOptionContent_nwesf_329";
|
|
12217
|
+
const selectItem = "_selectItem_nwesf_354";
|
|
12218
|
+
const selectItemContent = "_selectItemContent_nwesf_369";
|
|
12219
|
+
const selectItemIndicator = "_selectItemIndicator_nwesf_391";
|
|
12220
|
+
const selectViewport = "_selectViewport_nwesf_402";
|
|
12221
|
+
const selectEmpty = "_selectEmpty_nwesf_408";
|
|
12222
|
+
const loading = "_loading_nwesf_419";
|
|
12223
|
+
const srOnly = "_srOnly_nwesf_423";
|
|
12130
12224
|
const styles$o = {
|
|
12131
12225
|
themeVars: themeVars$m,
|
|
12132
12226
|
selectValue,
|
|
@@ -12156,7 +12250,9 @@ const styles$o = {
|
|
|
12156
12250
|
slideInFromLeft,
|
|
12157
12251
|
slideInFromBottom,
|
|
12158
12252
|
multiComboboxOption,
|
|
12253
|
+
multiComboboxOptionContent,
|
|
12159
12254
|
selectItem,
|
|
12255
|
+
selectItemContent,
|
|
12160
12256
|
selectItemIndicator,
|
|
12161
12257
|
selectViewport,
|
|
12162
12258
|
selectEmpty,
|
|
@@ -12205,7 +12301,7 @@ const SimpleSelect = forwardRef(function SimpleSelect2(props, forwardedRef) {
|
|
|
12205
12301
|
options: options2
|
|
12206
12302
|
} = props;
|
|
12207
12303
|
const ref = forwardedRef ? composeRefs(triggerRef, forwardedRef) : triggerRef;
|
|
12208
|
-
const stringValue = value ? value + "" :
|
|
12304
|
+
const stringValue = value != void 0 ? value + "" : null;
|
|
12209
12305
|
const onValChange = useCallback(
|
|
12210
12306
|
(val) => {
|
|
12211
12307
|
var _a;
|
|
@@ -12216,8 +12312,6 @@ const SimpleSelect = forwardRef(function SimpleSelect2(props, forwardedRef) {
|
|
|
12216
12312
|
},
|
|
12217
12313
|
[onValueChange, options2]
|
|
12218
12314
|
);
|
|
12219
|
-
useEffect(() => {
|
|
12220
|
-
}, []);
|
|
12221
12315
|
return /* @__PURE__ */ jsx(OptionTypeProvider, { Component: SelectOption, children: /* @__PURE__ */ jsxs(Root, { value: stringValue, onValueChange: onValChange, children: [
|
|
12222
12316
|
/* @__PURE__ */ jsxs(
|
|
12223
12317
|
Trigger,
|
|
@@ -12269,6 +12363,7 @@ const Select = forwardRef(function Select2({
|
|
|
12269
12363
|
registerComponentApi,
|
|
12270
12364
|
emptyListTemplate,
|
|
12271
12365
|
optionLabelRenderer,
|
|
12366
|
+
optionRenderer,
|
|
12272
12367
|
valueRenderer,
|
|
12273
12368
|
style,
|
|
12274
12369
|
dropdownHeight,
|
|
@@ -12323,18 +12418,27 @@ const Select = forwardRef(function Select2({
|
|
|
12323
12418
|
updateState({ value: newValue });
|
|
12324
12419
|
onDidChange(newValue);
|
|
12325
12420
|
}, [multiSelect, updateState, onDidChange]);
|
|
12326
|
-
const
|
|
12421
|
+
const focus = useCallback(() => {
|
|
12327
12422
|
referenceElement == null ? void 0 : referenceElement.focus();
|
|
12328
12423
|
}, [referenceElement]);
|
|
12329
12424
|
const setValue = useEvent((newValue) => {
|
|
12330
12425
|
toggleOption(newValue);
|
|
12331
12426
|
});
|
|
12427
|
+
const reset = useEvent(() => {
|
|
12428
|
+
if (initialValue !== void 0) {
|
|
12429
|
+
updateState({ value: initialValue });
|
|
12430
|
+
onDidChange(initialValue);
|
|
12431
|
+
} else {
|
|
12432
|
+
clearValue();
|
|
12433
|
+
}
|
|
12434
|
+
});
|
|
12332
12435
|
useEffect(() => {
|
|
12333
12436
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
12334
|
-
focus
|
|
12335
|
-
setValue
|
|
12437
|
+
focus,
|
|
12438
|
+
setValue,
|
|
12439
|
+
reset
|
|
12336
12440
|
});
|
|
12337
|
-
}, [
|
|
12441
|
+
}, [focus, registerComponentApi, setValue, reset]);
|
|
12338
12442
|
const emptyListNode = useMemo(
|
|
12339
12443
|
() => emptyListTemplate ?? /* @__PURE__ */ jsxs("div", { className: styles$o.selectEmpty, children: [
|
|
12340
12444
|
/* @__PURE__ */ jsx(Icon, { name: "noresult" }),
|
|
@@ -12364,9 +12468,10 @@ const Select = forwardRef(function Select2({
|
|
|
12364
12468
|
multiSelect,
|
|
12365
12469
|
value,
|
|
12366
12470
|
optionLabelRenderer,
|
|
12471
|
+
optionRenderer,
|
|
12367
12472
|
onChange: toggleOption
|
|
12368
12473
|
}),
|
|
12369
|
-
[multiSelect, toggleOption, value, optionLabelRenderer]
|
|
12474
|
+
[multiSelect, toggleOption, value, optionLabelRenderer, optionRenderer]
|
|
12370
12475
|
);
|
|
12371
12476
|
return /* @__PURE__ */ jsx(SelectContext.Provider, { value: selectContextValue, children: /* @__PURE__ */ jsx(OptionContext.Provider, { value: optionContextValue, children: searchable || multiSelect ? /* @__PURE__ */ jsxs(OptionTypeProvider, { Component: HiddenOption, children: [
|
|
12372
12477
|
children,
|
|
@@ -12441,7 +12546,7 @@ const Select = forwardRef(function Select2({
|
|
|
12441
12546
|
]
|
|
12442
12547
|
}
|
|
12443
12548
|
) }),
|
|
12444
|
-
open && /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsx(
|
|
12549
|
+
open && /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsx($d3863c46a17e8a28$export$20e40289641fbbb6, { asChild: true, loop: true, trapped: true, children: /* @__PURE__ */ jsx(
|
|
12445
12550
|
PopoverContent,
|
|
12446
12551
|
{
|
|
12447
12552
|
style: { width, height: dropdownHeight },
|
|
@@ -12517,11 +12622,17 @@ const Select = forwardRef(function Select2({
|
|
|
12517
12622
|
const ComboboxOption = forwardRef(function Combobox(option, forwardedRef) {
|
|
12518
12623
|
const id = useId();
|
|
12519
12624
|
const { label: label2, value, enabled: enabled2 = true, keywords } = option;
|
|
12520
|
-
const {
|
|
12625
|
+
const {
|
|
12626
|
+
value: selectedValue,
|
|
12627
|
+
onChange,
|
|
12628
|
+
multiSelect,
|
|
12629
|
+
optionLabelRenderer,
|
|
12630
|
+
optionRenderer
|
|
12631
|
+
} = useSelect();
|
|
12521
12632
|
const selected2 = useMemo(() => {
|
|
12522
12633
|
return Array.isArray(selectedValue) && multiSelect ? selectedValue.includes(value) : selectedValue === value;
|
|
12523
12634
|
}, [selectedValue, value, multiSelect]);
|
|
12524
|
-
return /* @__PURE__ */
|
|
12635
|
+
return /* @__PURE__ */ jsx(
|
|
12525
12636
|
CommandItem,
|
|
12526
12637
|
{
|
|
12527
12638
|
id,
|
|
@@ -12534,10 +12645,10 @@ const ComboboxOption = forwardRef(function Combobox(option, forwardedRef) {
|
|
|
12534
12645
|
},
|
|
12535
12646
|
"data-state": selected2 ? "checked" : void 0,
|
|
12536
12647
|
keywords,
|
|
12537
|
-
children: [
|
|
12648
|
+
children: /* @__PURE__ */ jsx("div", { className: styles$o.multiComboboxOptionContent, children: optionRenderer ? optionRenderer({ label: label2, value, enabled: enabled2, keywords }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12538
12649
|
optionLabelRenderer ? optionLabelRenderer({ label: label2, value }) : label2,
|
|
12539
12650
|
selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
|
|
12540
|
-
]
|
|
12651
|
+
] }) })
|
|
12541
12652
|
},
|
|
12542
12653
|
id
|
|
12543
12654
|
);
|
|
@@ -12562,15 +12673,19 @@ const SelectOption = React__default.forwardRef(
|
|
|
12562
12673
|
(option, ref) => {
|
|
12563
12674
|
const { value, label: label2, enabled: enabled2 = true } = option;
|
|
12564
12675
|
const { onOptionRemove, onOptionAdd } = useOption();
|
|
12565
|
-
const { optionLabelRenderer } = useSelect();
|
|
12676
|
+
const { optionLabelRenderer, optionRenderer } = useSelect();
|
|
12566
12677
|
useLayoutEffect(() => {
|
|
12567
12678
|
onOptionAdd(option);
|
|
12568
12679
|
return () => onOptionRemove(option);
|
|
12569
12680
|
}, [option, onOptionAdd, onOptionRemove]);
|
|
12570
|
-
return /* @__PURE__ */
|
|
12571
|
-
/* @__PURE__ */ jsx(ItemText, { children:
|
|
12681
|
+
return /* @__PURE__ */ jsx(Item, { ref, className: styles$o.selectItem, value: value + "", disabled: !enabled2, children: /* @__PURE__ */ jsx("div", { className: styles$o.selectItemContent, children: optionRenderer ? optionRenderer({
|
|
12682
|
+
label: /* @__PURE__ */ jsx(ItemText, { children: label2 }),
|
|
12683
|
+
value,
|
|
12684
|
+
enabled: enabled2
|
|
12685
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12686
|
+
/* @__PURE__ */ jsx(ItemText, { className: styles$o.selectItemContent, children: optionLabelRenderer ? optionLabelRenderer({ value, label: label2 }) : label2 }),
|
|
12572
12687
|
/* @__PURE__ */ jsx("span", { className: styles$o.selectItemIndicator, children: /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) }) })
|
|
12573
|
-
] });
|
|
12688
|
+
] }) }) });
|
|
12574
12689
|
}
|
|
12575
12690
|
);
|
|
12576
12691
|
SelectOption.displayName = "SelectOption";
|
|
@@ -12877,7 +12992,7 @@ const TextArea = forwardRef(function TextArea2({
|
|
|
12877
12992
|
setFocused(false);
|
|
12878
12993
|
onBlur == null ? void 0 : onBlur();
|
|
12879
12994
|
};
|
|
12880
|
-
const
|
|
12995
|
+
const focus = useCallback(() => {
|
|
12881
12996
|
setTimeout(() => {
|
|
12882
12997
|
var _a;
|
|
12883
12998
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -12914,11 +13029,11 @@ const TextArea = forwardRef(function TextArea2({
|
|
|
12914
13029
|
}, [value, cursorPosition, inputRef]);
|
|
12915
13030
|
useEffect(() => {
|
|
12916
13031
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
12917
|
-
focus
|
|
13032
|
+
focus,
|
|
12918
13033
|
insert,
|
|
12919
13034
|
setValue
|
|
12920
13035
|
});
|
|
12921
|
-
}, [
|
|
13036
|
+
}, [focus, insert, registerComponentApi, setValue]);
|
|
12922
13037
|
const handleEnter = useCallback(
|
|
12923
13038
|
(e) => {
|
|
12924
13039
|
var _a, _b;
|
|
@@ -13200,7 +13315,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
|
|
|
13200
13315
|
] }),
|
|
13201
13316
|
[emptyListTemplate]
|
|
13202
13317
|
);
|
|
13203
|
-
const
|
|
13318
|
+
const focus = useCallback(() => {
|
|
13204
13319
|
var _a;
|
|
13205
13320
|
(_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
13206
13321
|
}, [inputRef]);
|
|
@@ -13209,10 +13324,10 @@ const AutoComplete = forwardRef(function AutoComplete2({
|
|
|
13209
13324
|
});
|
|
13210
13325
|
useEffect(() => {
|
|
13211
13326
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
13212
|
-
focus
|
|
13327
|
+
focus,
|
|
13213
13328
|
setValue
|
|
13214
13329
|
});
|
|
13215
|
-
}, [
|
|
13330
|
+
}, [focus, registerComponentApi, setValue]);
|
|
13216
13331
|
const optionContextValue = useMemo(
|
|
13217
13332
|
() => ({
|
|
13218
13333
|
onOptionAdd,
|
|
@@ -13583,7 +13698,7 @@ const Slider = forwardRef(
|
|
|
13583
13698
|
const handleOnBlur = useCallback(() => {
|
|
13584
13699
|
onBlur == null ? void 0 : onBlur();
|
|
13585
13700
|
}, [onBlur]);
|
|
13586
|
-
const
|
|
13701
|
+
const focus = useCallback(() => {
|
|
13587
13702
|
var _a;
|
|
13588
13703
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
13589
13704
|
}, []);
|
|
@@ -13592,10 +13707,10 @@ const Slider = forwardRef(
|
|
|
13592
13707
|
});
|
|
13593
13708
|
useEffect(() => {
|
|
13594
13709
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
13595
|
-
focus
|
|
13710
|
+
focus,
|
|
13596
13711
|
setValue
|
|
13597
13712
|
});
|
|
13598
|
-
}, [
|
|
13713
|
+
}, [focus, registerComponentApi, setValue]);
|
|
13599
13714
|
const displayValue = localValue.length > 0 ? localValue : [min];
|
|
13600
13715
|
const valuesText = displayValue.map((v) => valueFormat(v)).join(", ");
|
|
13601
13716
|
const displayLabel = label2 ? showValues ? `${label2} ${valuesText}` : label2 : showValues ? valuesText : "";
|
|
@@ -13736,7 +13851,7 @@ const ColorPicker = forwardRef(
|
|
|
13736
13851
|
const handleOnBlur = useCallback(() => {
|
|
13737
13852
|
onBlur == null ? void 0 : onBlur();
|
|
13738
13853
|
}, [onBlur]);
|
|
13739
|
-
const
|
|
13854
|
+
const focus = useCallback(() => {
|
|
13740
13855
|
var _a;
|
|
13741
13856
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
13742
13857
|
}, []);
|
|
@@ -13745,10 +13860,10 @@ const ColorPicker = forwardRef(
|
|
|
13745
13860
|
});
|
|
13746
13861
|
useEffect(() => {
|
|
13747
13862
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
13748
|
-
focus
|
|
13863
|
+
focus,
|
|
13749
13864
|
setValue
|
|
13750
13865
|
});
|
|
13751
|
-
}, [
|
|
13866
|
+
}, [focus, registerComponentApi, setValue]);
|
|
13752
13867
|
return /* @__PURE__ */ jsx(
|
|
13753
13868
|
ItemWithLabel,
|
|
13754
13869
|
{
|
|
@@ -13899,6 +14014,429 @@ const HelperText = ({ text: text2 = "", status, style }) => {
|
|
|
13899
14014
|
}
|
|
13900
14015
|
);
|
|
13901
14016
|
};
|
|
14017
|
+
const NumberBox22 = forwardRef(function NumberBox222({
|
|
14018
|
+
id,
|
|
14019
|
+
style,
|
|
14020
|
+
value,
|
|
14021
|
+
initialValue,
|
|
14022
|
+
zeroOrPositive = false,
|
|
14023
|
+
min = zeroOrPositive ? 0 : -999999999999999,
|
|
14024
|
+
max = NUMBERBOX_MAX_VALUE,
|
|
14025
|
+
maxFractionDigits = 3,
|
|
14026
|
+
enabled: enabled2 = true,
|
|
14027
|
+
placeholder: placeholder2,
|
|
14028
|
+
step,
|
|
14029
|
+
integersOnly = false,
|
|
14030
|
+
validationStatus = "none",
|
|
14031
|
+
hasSpinBox = true,
|
|
14032
|
+
updateState = noop$1,
|
|
14033
|
+
onDidChange = noop$1,
|
|
14034
|
+
onFocus = noop$1,
|
|
14035
|
+
onBlur = noop$1,
|
|
14036
|
+
registerComponentApi,
|
|
14037
|
+
startText,
|
|
14038
|
+
startIcon,
|
|
14039
|
+
endText,
|
|
14040
|
+
endIcon,
|
|
14041
|
+
autoFocus,
|
|
14042
|
+
readOnly: readOnly2,
|
|
14043
|
+
required: required2,
|
|
14044
|
+
label: label2,
|
|
14045
|
+
labelPosition,
|
|
14046
|
+
labelWidth,
|
|
14047
|
+
labelBreak: labelBreak2
|
|
14048
|
+
}, forwardedRef) {
|
|
14049
|
+
const inputRef = useRef(null);
|
|
14050
|
+
const upButton = useRef(null);
|
|
14051
|
+
const downButton = useRef(null);
|
|
14052
|
+
const locale = "en-US";
|
|
14053
|
+
const formatOptions = useMemo(() => {
|
|
14054
|
+
return {
|
|
14055
|
+
useGrouping: false,
|
|
14056
|
+
minimumFractionDigits: 0,
|
|
14057
|
+
maximumFractionDigits: integersOnly ? 0 : maxFractionDigits
|
|
14058
|
+
};
|
|
14059
|
+
}, [maxFractionDigits, integersOnly]);
|
|
14060
|
+
const formatter = useNumberFormatter(locale, formatOptions);
|
|
14061
|
+
const parser = useNumberParser(locale, formatOptions);
|
|
14062
|
+
min = clamp(
|
|
14063
|
+
toUsableNumber(min, true) ?? (zeroOrPositive ? 0 : -999999999999999),
|
|
14064
|
+
zeroOrPositive ? 0 : -999999999999999,
|
|
14065
|
+
NUMBERBOX_MAX_VALUE
|
|
14066
|
+
);
|
|
14067
|
+
max = clamp(
|
|
14068
|
+
toUsableNumber(max, true) ?? (zeroOrPositive ? 0 : -999999999999999),
|
|
14069
|
+
zeroOrPositive ? 0 : -999999999999999,
|
|
14070
|
+
NUMBERBOX_MAX_VALUE
|
|
14071
|
+
);
|
|
14072
|
+
const initializeValue = useCallback(
|
|
14073
|
+
(value2, defaultValue = "") => {
|
|
14074
|
+
return isEmptyLike(value2) || isNaN$1(parser.parse(value2.toString())) ? defaultValue : formatter.format(clamp(+value2, min, max));
|
|
14075
|
+
},
|
|
14076
|
+
[formatter, parser, min, max]
|
|
14077
|
+
);
|
|
14078
|
+
const [valueStrRep, setValueStrRep] = React__default.useState(initializeValue(value));
|
|
14079
|
+
useLayoutEffect(() => {
|
|
14080
|
+
setValueStrRep(initializeValue(value));
|
|
14081
|
+
}, [value, initializeValue]);
|
|
14082
|
+
const onFixCursorPosition = useCursorCorrection(valueStrRep, inputRef);
|
|
14083
|
+
const _step = toUsableNumber(step, true) ?? DEFAULT_STEP;
|
|
14084
|
+
const inputMode = useMemo(() => {
|
|
14085
|
+
const hasDecimals = formatter.resolvedOptions().maximumFractionDigits > 0;
|
|
14086
|
+
return hasDecimals ? "decimal" : "numeric";
|
|
14087
|
+
}, [formatter]);
|
|
14088
|
+
useEffect(() => {
|
|
14089
|
+
updateState({ value: initialValue }, { initial: true });
|
|
14090
|
+
}, [initialValue, updateState]);
|
|
14091
|
+
const clampInputValue = useCallback(
|
|
14092
|
+
(value2) => {
|
|
14093
|
+
return clamp(value2, min, max);
|
|
14094
|
+
},
|
|
14095
|
+
[min, max]
|
|
14096
|
+
);
|
|
14097
|
+
const clampAndSaveInput = useCallback(
|
|
14098
|
+
(value2) => {
|
|
14099
|
+
if (isEmptyLike(value2)) {
|
|
14100
|
+
updateState({ value: null });
|
|
14101
|
+
return;
|
|
14102
|
+
}
|
|
14103
|
+
value2 = value2.toString();
|
|
14104
|
+
if (!value2.length) {
|
|
14105
|
+
updateState({ value: null });
|
|
14106
|
+
return;
|
|
14107
|
+
}
|
|
14108
|
+
let parsedValue = parser.parse(value2);
|
|
14109
|
+
parsedValue = clampInputValue(parsedValue);
|
|
14110
|
+
if (isNaN$1(parsedValue)) {
|
|
14111
|
+
updateState({ value: value2 });
|
|
14112
|
+
return;
|
|
14113
|
+
}
|
|
14114
|
+
setValueStrRep((lastVal) => {
|
|
14115
|
+
const formatted = formatter.format(parsedValue);
|
|
14116
|
+
if (lastVal !== formatted) {
|
|
14117
|
+
return formatted;
|
|
14118
|
+
}
|
|
14119
|
+
return lastVal;
|
|
14120
|
+
});
|
|
14121
|
+
updateState({ value: parsedValue });
|
|
14122
|
+
},
|
|
14123
|
+
[clampInputValue, updateState, parser, formatter]
|
|
14124
|
+
);
|
|
14125
|
+
const increment = useCallback(() => {
|
|
14126
|
+
if (!enabled2) return;
|
|
14127
|
+
if (readOnly2) return;
|
|
14128
|
+
const currentValue = isEmptyLike(value) || isNaN$1(value) ? "0" : value.toString();
|
|
14129
|
+
const newValue = handleChangingValue(currentValue, parser, "increase", _step, min, max);
|
|
14130
|
+
updateState({ value: newValue });
|
|
14131
|
+
}, [value, enabled2, readOnly2, parser, _step, min, max, updateState]);
|
|
14132
|
+
const decrement = useCallback(() => {
|
|
14133
|
+
if (!enabled2) return;
|
|
14134
|
+
if (readOnly2) return;
|
|
14135
|
+
const currentValue = isEmptyLike(value) || isNaN$1(value) ? "0" : value.toString();
|
|
14136
|
+
const newValue = handleChangingValue(currentValue, parser, "decrease", _step, min, max);
|
|
14137
|
+
updateState({ value: newValue });
|
|
14138
|
+
}, [value, enabled2, readOnly2, parser, _step, min, max, updateState]);
|
|
14139
|
+
useLongPress(upButton.current, increment);
|
|
14140
|
+
useLongPress(downButton.current, decrement);
|
|
14141
|
+
const _onBeforeInput = useCallback(
|
|
14142
|
+
(event) => {
|
|
14143
|
+
const target2 = event.target;
|
|
14144
|
+
const nextValue = parser.parse(
|
|
14145
|
+
target2.value.slice(0, target2.selectionStart ?? void 0) + (event.nativeEvent.data ?? "") + target2.value.slice(target2.selectionEnd ?? void 0)
|
|
14146
|
+
).toString();
|
|
14147
|
+
if (!parser.isValidPartialNumber(nextValue, min, max)) {
|
|
14148
|
+
event.preventDefault();
|
|
14149
|
+
}
|
|
14150
|
+
},
|
|
14151
|
+
[parser, min, max]
|
|
14152
|
+
);
|
|
14153
|
+
const _onChange = useCallback(
|
|
14154
|
+
(event) => {
|
|
14155
|
+
const strValue = event.target.value;
|
|
14156
|
+
let parsed = clampInputValue(parser.parse(event.target.value));
|
|
14157
|
+
if (integersOnly && Number.isInteger(parsed)) {
|
|
14158
|
+
parsed = Math.trunc(parsed);
|
|
14159
|
+
}
|
|
14160
|
+
if (canSynchronizeValue(strValue, locale, formatOptions)) {
|
|
14161
|
+
updateState({ value: parsed });
|
|
14162
|
+
} else {
|
|
14163
|
+
setValueStrRep(strValue);
|
|
14164
|
+
}
|
|
14165
|
+
onFixCursorPosition(event);
|
|
14166
|
+
onDidChange(parsed);
|
|
14167
|
+
},
|
|
14168
|
+
[
|
|
14169
|
+
clampInputValue,
|
|
14170
|
+
parser,
|
|
14171
|
+
onDidChange,
|
|
14172
|
+
locale,
|
|
14173
|
+
formatOptions,
|
|
14174
|
+
onFixCursorPosition,
|
|
14175
|
+
updateState,
|
|
14176
|
+
integersOnly
|
|
14177
|
+
]
|
|
14178
|
+
);
|
|
14179
|
+
const _onFocus = useCallback(() => {
|
|
14180
|
+
onFocus == null ? void 0 : onFocus();
|
|
14181
|
+
}, [onFocus]);
|
|
14182
|
+
const _onBlur = useCallback(
|
|
14183
|
+
(event) => {
|
|
14184
|
+
const value2 = event.target.value;
|
|
14185
|
+
clampAndSaveInput(value2);
|
|
14186
|
+
onBlur();
|
|
14187
|
+
},
|
|
14188
|
+
[clampAndSaveInput, onBlur]
|
|
14189
|
+
);
|
|
14190
|
+
const _onKeyDown = useCallback(
|
|
14191
|
+
(event) => {
|
|
14192
|
+
if (event.key === "Enter") {
|
|
14193
|
+
clampAndSaveInput(value);
|
|
14194
|
+
}
|
|
14195
|
+
if (event.code === "ArrowUp") {
|
|
14196
|
+
event.preventDefault();
|
|
14197
|
+
increment();
|
|
14198
|
+
}
|
|
14199
|
+
if (event.code === "ArrowDown") {
|
|
14200
|
+
event.preventDefault();
|
|
14201
|
+
decrement();
|
|
14202
|
+
}
|
|
14203
|
+
},
|
|
14204
|
+
[clampAndSaveInput, increment, decrement, value]
|
|
14205
|
+
);
|
|
14206
|
+
const focus = useCallback(() => {
|
|
14207
|
+
var _a;
|
|
14208
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
14209
|
+
}, []);
|
|
14210
|
+
useEffect(() => {
|
|
14211
|
+
if (autoFocus) {
|
|
14212
|
+
setTimeout(() => {
|
|
14213
|
+
var _a;
|
|
14214
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
14215
|
+
}, 0);
|
|
14216
|
+
}
|
|
14217
|
+
}, [autoFocus]);
|
|
14218
|
+
const setValue = useEvent((newValue) => {
|
|
14219
|
+
updateState({ value: newValue });
|
|
14220
|
+
});
|
|
14221
|
+
useEffect(() => {
|
|
14222
|
+
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
14223
|
+
focus,
|
|
14224
|
+
setValue
|
|
14225
|
+
});
|
|
14226
|
+
}, [focus, registerComponentApi, setValue]);
|
|
14227
|
+
return /* @__PURE__ */ jsx(
|
|
14228
|
+
ItemWithLabel,
|
|
14229
|
+
{
|
|
14230
|
+
ref: forwardedRef,
|
|
14231
|
+
labelPosition,
|
|
14232
|
+
label: label2,
|
|
14233
|
+
labelWidth,
|
|
14234
|
+
labelBreak: labelBreak2,
|
|
14235
|
+
required: required2,
|
|
14236
|
+
enabled: enabled2,
|
|
14237
|
+
onFocus,
|
|
14238
|
+
onBlur,
|
|
14239
|
+
style,
|
|
14240
|
+
children: /* @__PURE__ */ jsxs(
|
|
14241
|
+
"div",
|
|
14242
|
+
{
|
|
14243
|
+
className: classnames(styles$p.inputRoot, {
|
|
14244
|
+
[styles$p.readOnly]: readOnly2,
|
|
14245
|
+
[styles$p.disabled]: !enabled2,
|
|
14246
|
+
[styles$p.noSpinBox]: !hasSpinBox,
|
|
14247
|
+
[styles$p.error]: validationStatus === "error",
|
|
14248
|
+
[styles$p.warning]: validationStatus === "warning",
|
|
14249
|
+
[styles$p.valid]: validationStatus === "valid"
|
|
14250
|
+
}),
|
|
14251
|
+
tabIndex: -1,
|
|
14252
|
+
onFocus: () => {
|
|
14253
|
+
var _a;
|
|
14254
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
14255
|
+
},
|
|
14256
|
+
children: [
|
|
14257
|
+
/* @__PURE__ */ jsx(Adornment, { text: startText, iconName: startIcon, className: styles$p.adornment }),
|
|
14258
|
+
/* @__PURE__ */ jsx(
|
|
14259
|
+
"input",
|
|
14260
|
+
{
|
|
14261
|
+
id,
|
|
14262
|
+
ref: inputRef,
|
|
14263
|
+
type: "text",
|
|
14264
|
+
placeholder: placeholder2,
|
|
14265
|
+
required: required2,
|
|
14266
|
+
readOnly: readOnly2,
|
|
14267
|
+
disabled: !enabled2,
|
|
14268
|
+
inputMode,
|
|
14269
|
+
className: classnames(styles$p.input),
|
|
14270
|
+
value: valueStrRep,
|
|
14271
|
+
min,
|
|
14272
|
+
max,
|
|
14273
|
+
autoFocus,
|
|
14274
|
+
onBeforeInput: _onBeforeInput,
|
|
14275
|
+
onChange: _onChange,
|
|
14276
|
+
onFocus: _onFocus,
|
|
14277
|
+
onBlur: _onBlur,
|
|
14278
|
+
onKeyDown: _onKeyDown
|
|
14279
|
+
}
|
|
14280
|
+
),
|
|
14281
|
+
/* @__PURE__ */ jsx(Adornment, { text: endText, iconName: endIcon, className: styles$p.adornment }),
|
|
14282
|
+
hasSpinBox && /* @__PURE__ */ jsxs("div", { className: styles$p.spinnerBox, children: [
|
|
14283
|
+
/* @__PURE__ */ jsx(
|
|
14284
|
+
Button,
|
|
14285
|
+
{
|
|
14286
|
+
"data-spinner": "up",
|
|
14287
|
+
type: "button",
|
|
14288
|
+
variant: "ghost",
|
|
14289
|
+
themeColor: "secondary",
|
|
14290
|
+
tabIndex: -1,
|
|
14291
|
+
className: styles$p.spinnerButton,
|
|
14292
|
+
disabled: !enabled2 || readOnly2,
|
|
14293
|
+
ref: upButton,
|
|
14294
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "chevronup", size: "sm" })
|
|
14295
|
+
}
|
|
14296
|
+
),
|
|
14297
|
+
/* @__PURE__ */ jsx(
|
|
14298
|
+
Button,
|
|
14299
|
+
{
|
|
14300
|
+
"data-spinner": "down",
|
|
14301
|
+
type: "button",
|
|
14302
|
+
tabIndex: -1,
|
|
14303
|
+
variant: "ghost",
|
|
14304
|
+
themeColor: "secondary",
|
|
14305
|
+
className: styles$p.spinnerButton,
|
|
14306
|
+
disabled: !enabled2 || readOnly2,
|
|
14307
|
+
ref: downButton,
|
|
14308
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown", size: "sm" })
|
|
14309
|
+
}
|
|
14310
|
+
)
|
|
14311
|
+
] })
|
|
14312
|
+
]
|
|
14313
|
+
}
|
|
14314
|
+
)
|
|
14315
|
+
}
|
|
14316
|
+
);
|
|
14317
|
+
});
|
|
14318
|
+
function useNumberFormatter(locale, options2) {
|
|
14319
|
+
return useMemo(() => {
|
|
14320
|
+
return new NumberFormatter(locale, options2);
|
|
14321
|
+
}, [locale, options2]);
|
|
14322
|
+
}
|
|
14323
|
+
function useNumberParser(locale, options2) {
|
|
14324
|
+
return useMemo(() => {
|
|
14325
|
+
return new NumberParser(locale, options2);
|
|
14326
|
+
}, [locale, options2]);
|
|
14327
|
+
}
|
|
14328
|
+
function useLongPress(elementRef, action, delay = 500) {
|
|
14329
|
+
const timeoutId = useRef(0);
|
|
14330
|
+
const intervalId = useRef(0);
|
|
14331
|
+
const savedAction = useRef(action);
|
|
14332
|
+
useEffect(() => {
|
|
14333
|
+
savedAction.current = action;
|
|
14334
|
+
}, [action]);
|
|
14335
|
+
useEffect(() => {
|
|
14336
|
+
const onMouseDown = () => {
|
|
14337
|
+
var _a;
|
|
14338
|
+
(_a = savedAction.current) == null ? void 0 : _a.call(savedAction);
|
|
14339
|
+
timeoutId.current = window.setTimeout(() => {
|
|
14340
|
+
intervalId.current = window.setInterval(() => {
|
|
14341
|
+
var _a2;
|
|
14342
|
+
(_a2 = savedAction.current) == null ? void 0 : _a2.call(savedAction);
|
|
14343
|
+
}, 100);
|
|
14344
|
+
}, delay);
|
|
14345
|
+
};
|
|
14346
|
+
const onMouseUp = () => {
|
|
14347
|
+
clearTimeout(timeoutId.current);
|
|
14348
|
+
clearInterval(intervalId.current);
|
|
14349
|
+
};
|
|
14350
|
+
const onMouseOut = () => {
|
|
14351
|
+
clearTimeout(timeoutId.current);
|
|
14352
|
+
clearInterval(intervalId.current);
|
|
14353
|
+
};
|
|
14354
|
+
elementRef == null ? void 0 : elementRef.addEventListener("mousedown", onMouseDown);
|
|
14355
|
+
elementRef == null ? void 0 : elementRef.addEventListener("mouseup", onMouseUp);
|
|
14356
|
+
elementRef == null ? void 0 : elementRef.addEventListener("mouseout", onMouseOut);
|
|
14357
|
+
return () => {
|
|
14358
|
+
elementRef == null ? void 0 : elementRef.removeEventListener("mousedown", onMouseDown);
|
|
14359
|
+
elementRef == null ? void 0 : elementRef.removeEventListener("mouseup", onMouseUp);
|
|
14360
|
+
elementRef == null ? void 0 : elementRef.removeEventListener("mouseout", onMouseOut);
|
|
14361
|
+
};
|
|
14362
|
+
}, [elementRef, action, delay]);
|
|
14363
|
+
}
|
|
14364
|
+
function handleChangingValue(value, parser, type, step = 1, min = -999999999999999, max = NUMBERBOX_MAX_VALUE) {
|
|
14365
|
+
const currentInputValue = parser.parse(value ?? "");
|
|
14366
|
+
if (isNaN$1(currentInputValue)) {
|
|
14367
|
+
return min ?? 0;
|
|
14368
|
+
}
|
|
14369
|
+
if (type === "increase") {
|
|
14370
|
+
return clamp(currentInputValue + (step ?? 1), min, max);
|
|
14371
|
+
} else {
|
|
14372
|
+
return clamp(currentInputValue - (step ?? 1), min, max);
|
|
14373
|
+
}
|
|
14374
|
+
}
|
|
14375
|
+
function canSynchronizeValue(value, locale, options2) {
|
|
14376
|
+
if (value.trim() === "") return true;
|
|
14377
|
+
if (isNaN$1(value)) return false;
|
|
14378
|
+
if (hasLeadingZeros(value, locale, options2)) return false;
|
|
14379
|
+
if (isFloatWithTrailingZeros(value, locale, options2)) return false;
|
|
14380
|
+
if (overMaximumFractionDigits(value, locale, options2)) return false;
|
|
14381
|
+
return true;
|
|
14382
|
+
}
|
|
14383
|
+
function hasLeadingZeros(input2, locale = "en-US", options2) {
|
|
14384
|
+
var _a, _b;
|
|
14385
|
+
const formatter = new Intl.NumberFormat(locale, options2);
|
|
14386
|
+
const parts = formatter.formatToParts(1234.5);
|
|
14387
|
+
const group = ((_a = parts.find((p) => p.type === "group")) == null ? void 0 : _a.value) || "";
|
|
14388
|
+
const decimal = ((_b = parts.find((p) => p.type === "decimal")) == null ? void 0 : _b.value) || "";
|
|
14389
|
+
const normalized = (group === "" ? input2 : input2.replace(new RegExp(`\\${group}`, "g"), "")).replace(decimal, ".");
|
|
14390
|
+
if (!/^-?\d*\.?\d*$/.test(normalized)) return false;
|
|
14391
|
+
const [integer, fraction] = normalized.split(".");
|
|
14392
|
+
if (!fraction) {
|
|
14393
|
+
return integer.length > 1 && integer.startsWith("0");
|
|
14394
|
+
}
|
|
14395
|
+
const leadingIntegerZeros = integer.startsWith("0") && integer.length >= 1;
|
|
14396
|
+
const leadingFractionZeros = (fraction.match(/^0+/) || [""])[0].length >= 2;
|
|
14397
|
+
return leadingIntegerZeros || leadingFractionZeros;
|
|
14398
|
+
}
|
|
14399
|
+
function isFloatWithTrailingZeros(input2, locale = "en-US", options2) {
|
|
14400
|
+
var _a, _b;
|
|
14401
|
+
const formatter = new Intl.NumberFormat(locale, options2);
|
|
14402
|
+
const parts = formatter.formatToParts(1234.5);
|
|
14403
|
+
const group = ((_a = parts.find((p) => p.type === "group")) == null ? void 0 : _a.value) || "";
|
|
14404
|
+
const decimal = ((_b = parts.find((p) => p.type === "decimal")) == null ? void 0 : _b.value) || ".";
|
|
14405
|
+
const normalized = (group === "" ? input2 : input2.replace(new RegExp(`\\${group}`, "g"), "")).replace(decimal, ".");
|
|
14406
|
+
if (!/^-?\d*\.?\d*$/.test(normalized)) return false;
|
|
14407
|
+
if (!normalized.includes(".")) return false;
|
|
14408
|
+
const [_, fraction] = normalized.split(".");
|
|
14409
|
+
if (!fraction || fraction.length === 0) return true;
|
|
14410
|
+
return /0+$/.test(fraction);
|
|
14411
|
+
}
|
|
14412
|
+
function overMaximumFractionDigits(input2, locale = "en-US", options2) {
|
|
14413
|
+
var _a, _b;
|
|
14414
|
+
const formatter = new Intl.NumberFormat(locale, options2);
|
|
14415
|
+
const parts = formatter.formatToParts(1234.5);
|
|
14416
|
+
const group = ((_a = parts.find((p) => p.type === "group")) == null ? void 0 : _a.value) || "";
|
|
14417
|
+
const decimal = ((_b = parts.find((p) => p.type === "decimal")) == null ? void 0 : _b.value) || "";
|
|
14418
|
+
const normalized = (group === "" ? input2 : input2.replace(new RegExp(`\\${group}`, "g"), "")).replace(decimal, ".");
|
|
14419
|
+
if (!/^-?\d*\.?\d*$/.test(normalized)) return false;
|
|
14420
|
+
const [_, fraction] = normalized.split(".");
|
|
14421
|
+
if (!fraction) {
|
|
14422
|
+
return false;
|
|
14423
|
+
}
|
|
14424
|
+
return fraction.length > options2.maximumFractionDigits;
|
|
14425
|
+
}
|
|
14426
|
+
function useCursorCorrection(value, inputRef) {
|
|
14427
|
+
const position = useRef({
|
|
14428
|
+
beforeStart: 0,
|
|
14429
|
+
beforeEnd: 0
|
|
14430
|
+
});
|
|
14431
|
+
useLayoutEffect(() => {
|
|
14432
|
+
inputRef.current.setSelectionRange(position.current.beforeStart, position.current.beforeEnd);
|
|
14433
|
+
}, [value]);
|
|
14434
|
+
const onInputChange = (event) => {
|
|
14435
|
+
position.current.beforeStart = event.target.selectionStart;
|
|
14436
|
+
position.current.beforeEnd = event.target.selectionEnd;
|
|
14437
|
+
};
|
|
14438
|
+
return onInputChange;
|
|
14439
|
+
}
|
|
13902
14440
|
const DEFAULT_LABEL_POSITIONS = {
|
|
13903
14441
|
checkbox: "end"
|
|
13904
14442
|
};
|
|
@@ -14044,6 +14582,23 @@ memo(function FormItem2({
|
|
|
14044
14582
|
);
|
|
14045
14583
|
break;
|
|
14046
14584
|
}
|
|
14585
|
+
case "integer2":
|
|
14586
|
+
case "number2": {
|
|
14587
|
+
formControl = /* @__PURE__ */ jsx(
|
|
14588
|
+
NumberBox22,
|
|
14589
|
+
{
|
|
14590
|
+
...rest,
|
|
14591
|
+
value,
|
|
14592
|
+
updateState: onStateChange,
|
|
14593
|
+
registerComponentApi,
|
|
14594
|
+
enabled: isEnabled2,
|
|
14595
|
+
min: validations.minValue,
|
|
14596
|
+
max: validations.maxValue,
|
|
14597
|
+
integersOnly: type === "integer2"
|
|
14598
|
+
}
|
|
14599
|
+
);
|
|
14600
|
+
break;
|
|
14601
|
+
}
|
|
14047
14602
|
case "switch":
|
|
14048
14603
|
case "checkbox": {
|
|
14049
14604
|
formControl = /* @__PURE__ */ jsx(
|
|
@@ -14588,6 +15143,7 @@ const ItemsMd = createMetadata({
|
|
|
14588
15143
|
},
|
|
14589
15144
|
itemTemplate: dComponent("The component template to display a single item")
|
|
14590
15145
|
},
|
|
15146
|
+
childrenAsTemplate: "itemTemplate",
|
|
14591
15147
|
contextVars: {
|
|
14592
15148
|
$item: dComponent(
|
|
14593
15149
|
"This value represents the current iteration item while the component renders its children."
|
|
@@ -14717,6 +15273,7 @@ const ListMd = createMetadata({
|
|
|
14717
15273
|
defaultValue: true
|
|
14718
15274
|
}
|
|
14719
15275
|
},
|
|
15276
|
+
childrenAsTemplate: "itemTemplate",
|
|
14720
15277
|
apis: {
|
|
14721
15278
|
scrollToTop: d("This method scrolls the list to the top."),
|
|
14722
15279
|
scrollToBottom: d("This method scrolls the list to the bottom."),
|
|
@@ -14737,7 +15294,7 @@ const LogoMd = createMetadata({
|
|
|
14737
15294
|
status: "experimental",
|
|
14738
15295
|
description: `The \`${COMP$H}\` component represents a logo or a brand symbol. Usually, you use this component in the [\`AppHeader\`](./AppHeader.mdx#logotemplate).`
|
|
14739
15296
|
});
|
|
14740
|
-
const themeVars$f = `'{"accentColor-Blockquote": "var(--xmlui-accentColor-Blockquote)", "accentWidth-Blockquote": "var(--xmlui-accentWidth-Blockquote)", "backgroundColor-
|
|
15297
|
+
const themeVars$f = `'{"accentColor-Blockquote": "var(--xmlui-accentColor-Blockquote)", "accentWidth-Blockquote": "var(--xmlui-accentWidth-Blockquote)", "backgroundColor-Blockquote": "var(--xmlui-backgroundColor-Blockquote)", "paddingLeft-Blockquote": "var(--xmlui-paddingLeft-Blockquote)", "borderRadius-Blockquote": "var(--xmlui-borderRadius-Blockquote)", "marginTop-Blockquote": "var(--xmlui-marginTop-Blockquote)", "marginBottom-Blockquote": "var(--xmlui-marginBottom-Blockquote)", "backgroundColor-Admonition": "var(--xmlui-backgroundColor-Admonition)", "paddingLeft-Admonition": "var(--xmlui-paddingLeft-Admonition)", "borderRadius-Admonition": "var(--xmlui-borderRadius-Admonition)", "iconSize-Admonition": "var(--xmlui-iconSize-Admonition)", "marginTop-Admonition": "var(--xmlui-marginTop-Admonition)", "marginBottom-Admonition": "var(--xmlui-marginBottom-Admonition)", "marginLeft-Admonition-content": "var(--xmlui-marginLeft-Admonition-content)", "marginTop-HtmlVideo": "var(--xmlui-marginTop-HtmlVideo)", "marginBottom-HtmlVideo": "var(--xmlui-marginBottom-HtmlVideo)"}'`;
|
|
14741
15298
|
const styles$g = {
|
|
14742
15299
|
themeVars: themeVars$f
|
|
14743
15300
|
};
|
|
@@ -14778,11 +15335,13 @@ const MarkdownMd = createMetadata({
|
|
|
14778
15335
|
}
|
|
14779
15336
|
},
|
|
14780
15337
|
defaultThemeVars: {
|
|
15338
|
+
"backgroundColor-Admonition": "$color-warn-300",
|
|
14781
15339
|
"borderRadius-Admonition": "$space-4",
|
|
14782
15340
|
"iconSize-Admonition": "1.5rem",
|
|
14783
15341
|
"padding-Admonition": "1rem",
|
|
14784
15342
|
"marginBottom-Admonition": "1rem",
|
|
14785
15343
|
"marginLeft-Admonition-content": ".5rem",
|
|
15344
|
+
"backgroundColor-Blockquote": "$color-warn-200",
|
|
14786
15345
|
"accentWidth-Blockquote": "3px",
|
|
14787
15346
|
"accentColor-Blockquote": "$color-surface-500",
|
|
14788
15347
|
"padding-Blockquote": ".5rem",
|
|
@@ -15161,9 +15720,9 @@ const NavPanelMd = createMetadata({
|
|
|
15161
15720
|
},
|
|
15162
15721
|
themeVars: parseScssVar(styles$H.themeVars),
|
|
15163
15722
|
defaultThemeVars: {
|
|
15164
|
-
[`backgroundColor-${COMP$C}`]: "
|
|
15723
|
+
[`backgroundColor-${COMP$C}`]: "$backgroundColor",
|
|
15165
15724
|
[`border-${COMP$C}`]: "0px solid $borderColor",
|
|
15166
|
-
[`paddingHorizontal-${COMP$C}`]: "
|
|
15725
|
+
[`paddingHorizontal-${COMP$C}`]: "0",
|
|
15167
15726
|
[`paddingVertical-logo-${COMP$C}`]: "$space-4",
|
|
15168
15727
|
[`paddingHorizontal-logo-${COMP$C}`]: "$space-4",
|
|
15169
15728
|
[`marginBottom-logo-${COMP$C}`]: "$space-4",
|
|
@@ -15521,6 +16080,9 @@ const SelectMd = createMetadata({
|
|
|
15521
16080
|
optionLabelTemplate: dComponent(
|
|
15522
16081
|
`This property allows replacing the default template to display an option in the dropdown list.`
|
|
15523
16082
|
),
|
|
16083
|
+
optionTemplate: dComponent(
|
|
16084
|
+
`This property allows replacing the default template to display an option in the dropdown list.`
|
|
16085
|
+
),
|
|
15524
16086
|
valueTemplate: dComponent(
|
|
15525
16087
|
`This property allows replacing the default template to display a selected value when multiple selections (\`multiSelect\` is \`true\`) are enabled.`
|
|
15526
16088
|
),
|
|
@@ -15545,7 +16107,8 @@ const SelectMd = createMetadata({
|
|
|
15545
16107
|
apis: {
|
|
15546
16108
|
focus: dFocus(COMP$t),
|
|
15547
16109
|
setValue: dSetValueApi(),
|
|
15548
|
-
value: dValue()
|
|
16110
|
+
value: dValue(),
|
|
16111
|
+
reset: d(`This method resets the component to its initial value, or clears the selection if no initial value was provided.`)
|
|
15549
16112
|
},
|
|
15550
16113
|
contextVars: {
|
|
15551
16114
|
$item: d(`This property represents the value of an item in the dropdown list.`),
|
|
@@ -15568,6 +16131,8 @@ const SelectMd = createMetadata({
|
|
|
15568
16131
|
[`fontSize-${COMP$t}-badge`]: "$fontSize-small",
|
|
15569
16132
|
[`paddingHorizontal-${COMP$t}-badge`]: "$space-1",
|
|
15570
16133
|
[`paddingVertical-${COMP$t}-badge`]: "$space-1",
|
|
16134
|
+
[`paddingHorizontal-item-${COMP$t}`]: "$space-2",
|
|
16135
|
+
[`paddingVertical-item-${COMP$t}`]: "$space-2",
|
|
15571
16136
|
[`opacity-text-item-${COMP$t}--disabled`]: "0.5",
|
|
15572
16137
|
[`opacity-${COMP$t}--disabled`]: "0.5",
|
|
15573
16138
|
[`backgroundColor-${COMP$t}-badge--hover`]: "$color-primary-400",
|
|
@@ -17607,52 +18172,61 @@ const APICallMd = createMetadata({
|
|
|
17607
18172
|
const COMP$a = "DataSource";
|
|
17608
18173
|
const DataSourceMd = createMetadata({
|
|
17609
18174
|
status: "stable",
|
|
17610
|
-
description: `The \`${COMP$a}\` component manages fetching data from
|
|
18175
|
+
description: `The \`${COMP$a}\` component manages fetching data from an API endpoint. This component automatically manages the complexity of the fetch operation and caching. To manipulate data on the backend, use the [\`APICall\`](./APICall.mdx) component.`,
|
|
17611
18176
|
props: {
|
|
17612
18177
|
method: {
|
|
17613
|
-
description: `
|
|
18178
|
+
description: `Set the HTTP method.`,
|
|
17614
18179
|
defaultValue: "get",
|
|
17615
18180
|
availableValues: httpMethodNames
|
|
17616
18181
|
},
|
|
17617
|
-
|
|
17618
|
-
description: `
|
|
18182
|
+
id: {
|
|
18183
|
+
description: `Set the ID used by other components to access the retrieved data in the \`value\`property of a \`DataSource\`, or status info in the \`loaded\` and \`error\` properties.`,
|
|
17619
18184
|
isRequired: true,
|
|
17620
18185
|
valueType: "string"
|
|
17621
18186
|
},
|
|
17622
|
-
|
|
17623
|
-
description: `
|
|
18187
|
+
url: {
|
|
18188
|
+
description: `Set the URL.`,
|
|
18189
|
+
isRequired: true,
|
|
17624
18190
|
valueType: "string"
|
|
17625
18191
|
},
|
|
17626
18192
|
body: {
|
|
17627
|
-
description: `
|
|
18193
|
+
description: `Set the request body. The object you pass is serialized as a JSON string.`,
|
|
18194
|
+
valueType: "any"
|
|
18195
|
+
},
|
|
18196
|
+
rawBody: {
|
|
18197
|
+
description: `Set the request body with no serialization. Use it to send a payload that has already been serialized to a JSON string.`,
|
|
18198
|
+
valueType: "string"
|
|
17628
18199
|
},
|
|
17629
18200
|
queryParams: {
|
|
17630
|
-
description: `
|
|
18201
|
+
description: `Append key/value pairs to the URL.`,
|
|
18202
|
+
valueType: "any"
|
|
17631
18203
|
},
|
|
17632
18204
|
headers: {
|
|
17633
|
-
description: `
|
|
18205
|
+
description: `Set request headers. Pass an object whose keys are header names and values are header values.`,
|
|
18206
|
+
valueType: "any"
|
|
17634
18207
|
},
|
|
17635
18208
|
pollIntervalInSeconds: {
|
|
17636
|
-
description: `
|
|
18209
|
+
description: `Set the interval for periodic data fetching. If the data changes on refresh, XMLUI will re-render components that refer directly or indirectly to the \`DataSource\`. `,
|
|
17637
18210
|
valueType: "number"
|
|
17638
18211
|
},
|
|
17639
18212
|
inProgressNotificationMessage: {
|
|
17640
|
-
description: `
|
|
18213
|
+
description: `Set the message to display when the data fetch is in progress.`,
|
|
17641
18214
|
valueType: "string"
|
|
17642
18215
|
},
|
|
17643
18216
|
completedNotificationMessage: {
|
|
17644
|
-
description: `
|
|
18217
|
+
description: `Set the message to display when the data fetch completes.`,
|
|
17645
18218
|
valueType: "string"
|
|
17646
18219
|
},
|
|
17647
18220
|
errorNotificationMessage: {
|
|
17648
|
-
description: `
|
|
18221
|
+
description: `Set the message to display when the there is an error.`,
|
|
17649
18222
|
valueType: "string"
|
|
17650
18223
|
},
|
|
17651
18224
|
resultSelector: {
|
|
17652
|
-
description: `
|
|
18225
|
+
description: `Set an object key to extract a subset of the response data.`,
|
|
18226
|
+
valueType: "string"
|
|
17653
18227
|
},
|
|
17654
18228
|
transformResult: {
|
|
17655
|
-
description:
|
|
18229
|
+
description: `Set a function to perform a final transformation of the response data.`
|
|
17656
18230
|
},
|
|
17657
18231
|
prevPageSelector: {
|
|
17658
18232
|
description: `When using \`${COMP$a}\` with paging, the response may contain information about the previous and next page. This property defines the selector that extracts the previous page information from the response deserialized to an object.`
|
|
@@ -18473,7 +19047,7 @@ function parseXmlUiMarkup(text2) {
|
|
|
18473
19047
|
}
|
|
18474
19048
|
}
|
|
18475
19049
|
if (eat(SyntaxKind.Equal)) {
|
|
18476
|
-
if (!eat(SyntaxKind.StringLiteral)
|
|
19050
|
+
if (!eat(SyntaxKind.StringLiteral)) {
|
|
18477
19051
|
const attrFollowWithoutIdent = [SyntaxKind.NodeEnd, SyntaxKind.NodeClose];
|
|
18478
19052
|
errRecover(Diag_Attr_Value_Expected, attrFollowWithoutIdent);
|
|
18479
19053
|
}
|
|
@@ -19503,7 +20077,6 @@ function nodeToComponentDef(node, originalGetText, fileId) {
|
|
|
19503
20077
|
const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
|
|
19504
20078
|
const attrs = getAttributes(node2);
|
|
19505
20079
|
desugarKeyOnlyAttrs(attrs);
|
|
19506
|
-
desugarQuotelessAttrs(attrs, getText);
|
|
19507
20080
|
parseEscapeCharactersInAttrValues(attrs);
|
|
19508
20081
|
parseEscapeCharactersInContent(childNodes);
|
|
19509
20082
|
mergeConsecutiveTexts(childNodes, shouldCollapseWhitespace);
|
|
@@ -19872,15 +20445,6 @@ function desugarKeyOnlyAttrs(attrs) {
|
|
|
19872
20445
|
}
|
|
19873
20446
|
}
|
|
19874
20447
|
}
|
|
19875
|
-
function desugarQuotelessAttrs(attrs, getText) {
|
|
19876
|
-
var _a, _b, _c;
|
|
19877
|
-
for (let attr of attrs) {
|
|
19878
|
-
const attrValue = (_a = attr.children) == null ? void 0 : _a[2];
|
|
19879
|
-
if (((_c = (_b = attr.children) == null ? void 0 : _b[2]) == null ? void 0 : _c.kind) === SyntaxKind.Identifier) {
|
|
19880
|
-
attrValue.text = '"' + getText(attrValue) + '"';
|
|
19881
|
-
}
|
|
19882
|
-
}
|
|
19883
|
-
}
|
|
19884
20448
|
function addToNamespaces(namespaceStack, comp, nsKey, value) {
|
|
19885
20449
|
let nsCommaSeparated = value.split(":");
|
|
19886
20450
|
if (nsCommaSeparated.length > 2) {
|
|
@@ -19952,7 +20516,7 @@ function getNamespaceResolvedComponentName(node, getText, namespaceStack) {
|
|
|
19952
20516
|
}
|
|
19953
20517
|
return resolvedNamespace + "." + name;
|
|
19954
20518
|
}
|
|
19955
|
-
function xmlUiMarkupToComponent(source, fileId = 0
|
|
20519
|
+
function xmlUiMarkupToComponent(source, fileId = 0) {
|
|
19956
20520
|
const { parse: parse2, getText } = createXmlUiParser(source);
|
|
19957
20521
|
const { node, errors } = parse2();
|
|
19958
20522
|
if (errors.length > 0) {
|
|
@@ -20480,7 +21044,8 @@ const OptionMd = createMetadata({
|
|
|
20480
21044
|
),
|
|
20481
21045
|
enabled: dEnabled(),
|
|
20482
21046
|
optionTemplate: d("This property is used to define a custom option template")
|
|
20483
|
-
}
|
|
21047
|
+
},
|
|
21048
|
+
childrenAsTemplate: "optionTemplate"
|
|
20484
21049
|
});
|
|
20485
21050
|
const OptionNative = memo((props) => {
|
|
20486
21051
|
const OptionType = useOptionType();
|