xmlui 0.10.7 → 0.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{index-CTri_fRG.mjs → index-C71PAj7E.mjs} +16456 -16219
- package/dist/lib/index.css +1 -1
- package/dist/{metadata/initMock-DzaOI8sC.mjs → lib/initMock-Bvbl2Pa3.mjs} +119 -113
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-DrEexTX9.mjs → metadata-utils-gIOZMGG7.mjs} +51 -46
- package/dist/lib/{server-common-ddmPKhK6.mjs → server-common-BfCSNpXG.mjs} +4467 -4437
- package/dist/lib/xmlui-parser.d.ts +3 -3
- package/dist/lib/xmlui.d.ts +14 -10
- package/dist/lib/xmlui.mjs +26 -26
- package/dist/metadata/{collectedComponentMetadata-Oj8WR8B1.mjs → collectedComponentMetadata-Dn91__HO.mjs} +18722 -18481
- package/dist/{lib/initMock-abcNyaP8.mjs → metadata/initMock-ghNfStAu.mjs} +119 -113
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +99 -99
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +2 -2
- package/dist/scripts/src/components/App/AppNative.js +6 -7
- package/dist/scripts/src/components/Breakout/BreakoutNative.js +2 -2
- package/dist/scripts/src/components/Button/ButtonNative.js +4 -0
- package/dist/scripts/src/components/Carousel/Carousel.js +13 -20
- package/dist/scripts/src/components/Carousel/CarouselContext.js +11 -2
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +2 -2
- package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +4 -4
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +5 -1
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +3 -3
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +5 -1
- package/dist/scripts/src/components/ComponentProvider.js +2 -0
- package/dist/scripts/src/components/DateInput/DateInput.js +7 -9
- package/dist/scripts/src/components/DateInput/DateInputNative.js +101 -38
- package/dist/scripts/src/components/ExpandableItem/ExpandableItemNative.js +18 -12
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
- package/dist/scripts/src/components/Input/PartialInput.js +28 -3
- package/dist/scripts/src/components/List/ListNative.js +6 -5
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +3 -8
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +2 -2
- package/dist/scripts/src/components/Pagination/Pagination.js +2 -1
- package/dist/scripts/src/components/Slider/Slider.js +10 -8
- package/dist/scripts/src/components/Slider/SliderNative.js +24 -21
- package/dist/scripts/src/components/Table/Table.js +9 -6
- package/dist/scripts/src/components/Table/TableNative.js +18 -13
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +3 -3
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -2
- package/dist/scripts/src/components/TimeInput/TimeInput.js +10 -10
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +87 -38
- package/dist/scripts/src/components/Timer/Timer.js +62 -0
- package/dist/scripts/src/components/Timer/TimerNative.js +179 -0
- package/dist/scripts/src/components/Toggle/Toggle.js +1 -1
- package/dist/scripts/src/components/Tooltip/Tooltip.js +9 -9
- package/dist/scripts/src/components/Tooltip/TooltipNative.js +4 -4
- package/dist/scripts/src/components/abstractions.js +6 -3
- package/dist/scripts/src/components-core/ComponentDecorator.js +3 -2
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +4 -1
- package/dist/scripts/src/components-core/interception/Backend.js +14 -1
- package/dist/scripts/src/components-core/parts.js +0 -4
- package/dist/standalone/xmlui-standalone.es.d.ts +20 -14
- package/dist/standalone/xmlui-standalone.umd.js +265 -265
- package/package.json +1 -1
- package/dist/scripts/src/components-core/ScrollContext.js +0 -11
- package/dist/scripts/src/components-core/utils/audio-utils.js +0 -83
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.timerComponentRenderer = exports.TimerMd = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
6
|
+
const TimerNative_1 = require("./TimerNative");
|
|
7
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
8
|
+
const COMP = "Timer";
|
|
9
|
+
exports.TimerMd = (0, metadata_helpers_1.createMetadata)({
|
|
10
|
+
status: "stable",
|
|
11
|
+
description: "`Timer` is a non-visual component that fires events at regular intervals. " +
|
|
12
|
+
"It can be enabled or disabled and ensures that the timer event handler " +
|
|
13
|
+
"completes before firing the next event.",
|
|
14
|
+
props: {
|
|
15
|
+
enabled: {
|
|
16
|
+
description: "Whether the timer is enabled and should fire events.",
|
|
17
|
+
valueType: "boolean",
|
|
18
|
+
defaultValue: TimerNative_1.defaultProps.enabled,
|
|
19
|
+
},
|
|
20
|
+
interval: {
|
|
21
|
+
description: "The interval in milliseconds between timer events.",
|
|
22
|
+
valueType: "number",
|
|
23
|
+
defaultValue: TimerNative_1.defaultProps.interval,
|
|
24
|
+
},
|
|
25
|
+
initialDelay: {
|
|
26
|
+
description: "The delay in milliseconds before the first timer event.",
|
|
27
|
+
valueType: "number",
|
|
28
|
+
defaultValue: TimerNative_1.defaultProps.initialDelay,
|
|
29
|
+
},
|
|
30
|
+
once: {
|
|
31
|
+
description: "Whether the timer should stop after firing its first tick event.",
|
|
32
|
+
valueType: "boolean",
|
|
33
|
+
defaultValue: TimerNative_1.defaultProps.once,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
events: {
|
|
37
|
+
tick: {
|
|
38
|
+
description: "This event is triggered at each interval when the ${COMP} is enabled.",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
apis: {
|
|
42
|
+
pause: {
|
|
43
|
+
description: "Pauses the timer. The timer can be resumed later from where it left off.",
|
|
44
|
+
signature: "pause()",
|
|
45
|
+
},
|
|
46
|
+
resume: {
|
|
47
|
+
description: "Resumes a paused timer. If the timer is not paused, this method has no effect.",
|
|
48
|
+
signature: "resume()",
|
|
49
|
+
},
|
|
50
|
+
isPaused: {
|
|
51
|
+
description: "Returns whether the timer is currently paused.",
|
|
52
|
+
signature: "isPaused(): boolean",
|
|
53
|
+
},
|
|
54
|
+
isRunning: {
|
|
55
|
+
description: "Returns whether the timer is currently running (enabled and not paused).",
|
|
56
|
+
signature: "isRunning(): boolean",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
exports.timerComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TimerMd, ({ node, extractValue, lookupEventHandler, registerComponentApi }) => {
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(TimerNative_1.Timer, { enabled: extractValue.asOptionalBoolean(node.props.enabled), interval: extractValue.asOptionalNumber(node.props.interval), initialDelay: extractValue.asOptionalNumber(node.props.initialDelay), once: extractValue.asOptionalBoolean(node.props.once), onTick: lookupEventHandler("tick"), registerComponentApi: registerComponentApi }));
|
|
62
|
+
});
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.Timer = exports.defaultProps = void 0;
|
|
24
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
25
|
+
const react_1 = require("react");
|
|
26
|
+
exports.defaultProps = {
|
|
27
|
+
enabled: true,
|
|
28
|
+
interval: 1000,
|
|
29
|
+
once: false,
|
|
30
|
+
initialDelay: 0,
|
|
31
|
+
};
|
|
32
|
+
exports.Timer = (0, react_1.forwardRef)(function Timer(_a, forwardedRef) {
|
|
33
|
+
var { enabled = exports.defaultProps.enabled, interval = exports.defaultProps.interval, once = exports.defaultProps.once, initialDelay = exports.defaultProps.initialDelay, onTick, registerComponentApi, style, className } = _a, rest = __rest(_a, ["enabled", "interval", "once", "initialDelay", "onTick", "registerComponentApi", "style", "className"]);
|
|
34
|
+
const [isPaused, setIsPaused] = (0, react_1.useState)(false);
|
|
35
|
+
const [hasExecutedOnce, setHasExecutedOnce] = (0, react_1.useState)(false);
|
|
36
|
+
const [hasEverStarted, setHasEverStarted] = (0, react_1.useState)(false);
|
|
37
|
+
const intervalRef = (0, react_1.useRef)(null);
|
|
38
|
+
const initialDelayRef = (0, react_1.useRef)(null);
|
|
39
|
+
const handlerRunningRef = (0, react_1.useRef)(false);
|
|
40
|
+
// Refs for current values to ensure handleTick has stable dependencies
|
|
41
|
+
const enabledRef = (0, react_1.useRef)(enabled);
|
|
42
|
+
const isPausedRef = (0, react_1.useRef)(isPaused);
|
|
43
|
+
const intervalRef2 = (0, react_1.useRef)(interval);
|
|
44
|
+
const onTickRef = (0, react_1.useRef)(onTick);
|
|
45
|
+
const onceRef = (0, react_1.useRef)(once);
|
|
46
|
+
const hasExecutedOnceRef = (0, react_1.useRef)(hasExecutedOnce);
|
|
47
|
+
const hasEverStartedRef = (0, react_1.useRef)(hasEverStarted);
|
|
48
|
+
// Update refs when values change
|
|
49
|
+
enabledRef.current = enabled;
|
|
50
|
+
isPausedRef.current = isPaused;
|
|
51
|
+
intervalRef2.current = interval;
|
|
52
|
+
onTickRef.current = onTick;
|
|
53
|
+
onceRef.current = once;
|
|
54
|
+
hasExecutedOnceRef.current = hasExecutedOnce;
|
|
55
|
+
hasEverStartedRef.current = hasEverStarted;
|
|
56
|
+
// Derived state
|
|
57
|
+
const isRunning = enabled && !isPaused && (intervalRef.current !== null || initialDelayRef.current !== null);
|
|
58
|
+
const isInInitialDelay = initialDelayRef.current !== null;
|
|
59
|
+
// Timer API methods
|
|
60
|
+
const pause = (0, react_1.useCallback)(() => {
|
|
61
|
+
// Pause if timer is enabled and currently running (not already paused)
|
|
62
|
+
if (enabled && !isPaused) {
|
|
63
|
+
setIsPaused(true);
|
|
64
|
+
if (intervalRef.current) {
|
|
65
|
+
clearInterval(intervalRef.current);
|
|
66
|
+
intervalRef.current = null;
|
|
67
|
+
}
|
|
68
|
+
if (initialDelayRef.current) {
|
|
69
|
+
clearTimeout(initialDelayRef.current);
|
|
70
|
+
initialDelayRef.current = null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, [enabled, isPaused]);
|
|
74
|
+
const resume = (0, react_1.useCallback)(() => {
|
|
75
|
+
// Resume if timer is enabled and currently paused
|
|
76
|
+
if (enabled && isPaused) {
|
|
77
|
+
setIsPaused(false);
|
|
78
|
+
// The useEffect will handle restarting the timer
|
|
79
|
+
}
|
|
80
|
+
}, [enabled, isPaused]);
|
|
81
|
+
// Create API object once
|
|
82
|
+
const timerApi = (0, react_1.useMemo)(() => ({
|
|
83
|
+
pause,
|
|
84
|
+
resume,
|
|
85
|
+
isPaused: () => isPaused,
|
|
86
|
+
isRunning: () => isRunning && !isPaused,
|
|
87
|
+
}), [pause, resume, isPaused, isRunning]);
|
|
88
|
+
// Register both APIs together
|
|
89
|
+
(0, react_1.useImperativeHandle)(forwardedRef, () => timerApi, [timerApi]);
|
|
90
|
+
(0, react_1.useEffect)(() => {
|
|
91
|
+
if (registerComponentApi) {
|
|
92
|
+
registerComponentApi(timerApi);
|
|
93
|
+
}
|
|
94
|
+
}, [registerComponentApi, timerApi]);
|
|
95
|
+
const handleTick = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
// Check if timer should still be running (enabled, not paused, valid interval)
|
|
97
|
+
if (!enabledRef.current || isPausedRef.current || intervalRef2.current <= 0) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Prevent re-firing if the previous event hasn't completed yet
|
|
101
|
+
if (handlerRunningRef.current) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (onTickRef.current) {
|
|
105
|
+
handlerRunningRef.current = true;
|
|
106
|
+
try {
|
|
107
|
+
yield onTickRef.current();
|
|
108
|
+
// Mark that the timer has actually started executing (for initial delay logic)
|
|
109
|
+
if (!hasEverStartedRef.current) {
|
|
110
|
+
setHasEverStarted(true);
|
|
111
|
+
}
|
|
112
|
+
// If this is a "once" timer and it's the very first execution, mark it as executed
|
|
113
|
+
// After the first execution, the timer becomes a regular timer that can be paused/resumed
|
|
114
|
+
if (onceRef.current && !hasExecutedOnceRef.current) {
|
|
115
|
+
setHasExecutedOnce(true);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
handlerRunningRef.current = false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}), []);
|
|
123
|
+
(0, react_1.useEffect)(() => {
|
|
124
|
+
// Clear any existing timers first
|
|
125
|
+
if (intervalRef.current) {
|
|
126
|
+
clearInterval(intervalRef.current);
|
|
127
|
+
intervalRef.current = null;
|
|
128
|
+
}
|
|
129
|
+
if (initialDelayRef.current) {
|
|
130
|
+
clearTimeout(initialDelayRef.current);
|
|
131
|
+
initialDelayRef.current = null;
|
|
132
|
+
}
|
|
133
|
+
// If "once" is true and the timer has already executed, don't start the timer
|
|
134
|
+
if (once && hasExecutedOnce) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (enabled && !isPaused && interval > 0) {
|
|
138
|
+
// Helper to start the actual timer
|
|
139
|
+
const startTicking = () => {
|
|
140
|
+
intervalRef.current = (once && !hasExecutedOnce)
|
|
141
|
+
? setTimeout(handleTick, interval)
|
|
142
|
+
: setInterval(handleTick, interval);
|
|
143
|
+
};
|
|
144
|
+
// Only apply initial delay if timer has never been started before
|
|
145
|
+
if (initialDelay > 0 && !hasEverStarted) {
|
|
146
|
+
initialDelayRef.current = setTimeout(() => {
|
|
147
|
+
initialDelayRef.current = null;
|
|
148
|
+
startTicking();
|
|
149
|
+
}, initialDelay);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
startTicking();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return () => {
|
|
156
|
+
if (intervalRef.current) {
|
|
157
|
+
clearInterval(intervalRef.current);
|
|
158
|
+
intervalRef.current = null;
|
|
159
|
+
}
|
|
160
|
+
if (initialDelayRef.current) {
|
|
161
|
+
clearTimeout(initialDelayRef.current);
|
|
162
|
+
initialDelayRef.current = null;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}, [enabled, interval, once, hasExecutedOnce, isPaused, initialDelay, hasEverStarted]);
|
|
166
|
+
// Reset state when enabled changes
|
|
167
|
+
(0, react_1.useEffect)(() => {
|
|
168
|
+
if (enabled && once) {
|
|
169
|
+
// Reset hasExecutedOnce when enabled changes from false to true for "once" timers
|
|
170
|
+
setHasExecutedOnce(false);
|
|
171
|
+
}
|
|
172
|
+
if (!enabled) {
|
|
173
|
+
// Reset pause state when timer is disabled
|
|
174
|
+
setIsPaused(false);
|
|
175
|
+
}
|
|
176
|
+
}, [enabled, once]);
|
|
177
|
+
// Timer is a non-visual component
|
|
178
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: forwardedRef, style: Object.assign({ display: "none" }, style), className: className, "data-timer-enabled": enabled, "data-timer-interval": interval, "data-timer-initial-delay": initialDelay, "data-timer-once": once, "data-timer-running": isRunning, "data-timer-paused": isPaused, "data-timer-in-initial-delay": isInInitialDelay, "data-timer-has-executed": hasExecutedOnce }, rest)));
|
|
179
|
+
});
|
|
@@ -139,7 +139,7 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle(_a, forwardedRef) {
|
|
|
139
139
|
}, [focus, registerComponentApi, setValue]);
|
|
140
140
|
const input = (0, react_2.useMemo)(() => {
|
|
141
141
|
const legitValue = transformToLegitValue(value);
|
|
142
|
-
return ((0, jsx_runtime_1.jsx)("input", { id: inputId, ref: innerRef, type: "checkbox", role: variant, checked: legitValue, disabled: !enabled, required: required, readOnly: readOnly, "aria-readonly": readOnly, "aria-checked": indeterminate ? "mixed" : legitValue, "aria-required": required, "aria-disabled": !enabled, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, autoFocus: autoFocus, className: (0, classnames_1.default)(
|
|
142
|
+
return ((0, jsx_runtime_1.jsx)("input", { id: inputId, "data-part-id": parts_1.PART_INPUT, ref: innerRef, type: "checkbox", role: variant, checked: legitValue, disabled: !enabled, required: required, readOnly: readOnly, "aria-readonly": readOnly, "aria-checked": indeterminate ? "mixed" : legitValue, "aria-required": required, "aria-disabled": !enabled, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, autoFocus: autoFocus, className: (0, classnames_1.default)(Toggle_module_scss_1.default.resetAppearance, {
|
|
143
143
|
[Toggle_module_scss_1.default.checkbox]: variant === "checkbox",
|
|
144
144
|
[Toggle_module_scss_1.default.switch]: variant === "switch",
|
|
145
145
|
[Toggle_module_scss_1.default.error]: validationStatus === "error",
|
|
@@ -33,49 +33,49 @@ exports.TooltipMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
33
33
|
delayDuration: {
|
|
34
34
|
description: "The duration from when the mouse enters a tooltip trigger until the tooltip opens (in ms)",
|
|
35
35
|
type: "number",
|
|
36
|
-
defaultValue:
|
|
36
|
+
defaultValue: 700,
|
|
37
37
|
},
|
|
38
38
|
skipDelayDuration: {
|
|
39
39
|
description: "How much time a user has to enter another trigger without incurring a delay again (in ms)",
|
|
40
40
|
type: "number",
|
|
41
|
-
defaultValue:
|
|
41
|
+
defaultValue: 300,
|
|
42
42
|
},
|
|
43
43
|
defaultOpen: {
|
|
44
44
|
description: "The open state of the tooltip when it is initially rendered",
|
|
45
45
|
type: "boolean",
|
|
46
|
-
defaultValue:
|
|
46
|
+
defaultValue: false,
|
|
47
47
|
},
|
|
48
48
|
showArrow: {
|
|
49
49
|
description: "Whether to show the arrow pointing to the trigger element",
|
|
50
50
|
type: "boolean",
|
|
51
|
-
defaultValue:
|
|
51
|
+
defaultValue: false,
|
|
52
52
|
},
|
|
53
53
|
side: {
|
|
54
54
|
description: "The preferred side of the trigger to render against when open",
|
|
55
55
|
type: "string",
|
|
56
56
|
availableValues: ["top", "right", "bottom", "left"],
|
|
57
|
-
defaultValue:
|
|
57
|
+
defaultValue: "top",
|
|
58
58
|
},
|
|
59
59
|
align: {
|
|
60
60
|
description: "The preferred alignment against the trigger",
|
|
61
61
|
type: "string",
|
|
62
62
|
availableValues: ["start", "center", "end"],
|
|
63
|
-
defaultValue:
|
|
63
|
+
defaultValue: "center",
|
|
64
64
|
},
|
|
65
65
|
sideOffset: {
|
|
66
66
|
description: "The distance in pixels from the trigger",
|
|
67
67
|
type: "number",
|
|
68
|
-
defaultValue:
|
|
68
|
+
defaultValue: 4,
|
|
69
69
|
},
|
|
70
70
|
alignOffset: {
|
|
71
71
|
description: "An offset in pixels from the 'start' or 'end' alignment options",
|
|
72
72
|
type: "number",
|
|
73
|
-
defaultValue:
|
|
73
|
+
defaultValue: 0,
|
|
74
74
|
},
|
|
75
75
|
avoidCollisions: {
|
|
76
76
|
description: "When true, overrides the side and align preferences to prevent collisions with boundary edges",
|
|
77
77
|
type: "boolean",
|
|
78
|
-
defaultValue:
|
|
78
|
+
defaultValue: true,
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
events: {},
|
|
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.Tooltip = exports.defaultProps = void 0;
|
|
40
40
|
exports.parseTooltipOptions = parseTooltipOptions;
|
|
41
41
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
+
const react_1 = require("react");
|
|
42
43
|
const RadixTooltip = __importStar(require("@radix-ui/react-tooltip"));
|
|
43
44
|
const lodash_es_1 = require("lodash-es");
|
|
44
45
|
const Tooltip_module_scss_1 = __importDefault(require("./Tooltip.module.scss"));
|
|
@@ -55,12 +56,11 @@ exports.defaultProps = {
|
|
|
55
56
|
alignOffset: 0,
|
|
56
57
|
avoidCollisions: true,
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
+
exports.Tooltip = (0, react_1.forwardRef)(function Tooltip({ text, markdown, tooltipTemplate, delayDuration = exports.defaultProps.delayDuration, skipDelayDuration = exports.defaultProps.skipDelayDuration, defaultOpen = exports.defaultProps.defaultOpen, showArrow = exports.defaultProps.showArrow, side = exports.defaultProps.side, align = exports.defaultProps.align, sideOffset = exports.defaultProps.sideOffset, alignOffset = exports.defaultProps.alignOffset, avoidCollisions = exports.defaultProps.avoidCollisions, children, open, }, ref) {
|
|
59
60
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
60
61
|
const showTooltip = !!(text || markdown || tooltipTemplate);
|
|
61
|
-
return ((0, jsx_runtime_1.jsx)(RadixTooltip.Provider, { delayDuration: delayDuration, skipDelayDuration: skipDelayDuration, children: (0, jsx_runtime_1.jsxs)(RadixTooltip.Root, { defaultOpen: defaultOpen, children: [(0, jsx_runtime_1.jsx)(RadixTooltip.Trigger, { asChild: true, children: children }), (0, jsx_runtime_1.jsx)(RadixTooltip.Portal, { container: root, children: showTooltip && ((0, jsx_runtime_1.jsxs)(RadixTooltip.Content, { className: Tooltip_module_scss_1.default.content, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, avoidCollisions: avoidCollisions, children: [tooltipTemplate ? (tooltipTemplate) : markdown ? ((0, jsx_runtime_1.jsx)(Markdown_1.Markdown, { children: markdown })) : (text), showArrow && (0, jsx_runtime_1.jsx)(RadixTooltip.Arrow, { className: Tooltip_module_scss_1.default.arrow })] })) })] }) }));
|
|
62
|
-
};
|
|
63
|
-
exports.Tooltip = Tooltip;
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(RadixTooltip.Provider, { delayDuration: delayDuration, skipDelayDuration: skipDelayDuration, children: (0, jsx_runtime_1.jsxs)(RadixTooltip.Root, { defaultOpen: defaultOpen, open: open, children: [(0, jsx_runtime_1.jsx)(RadixTooltip.Trigger, { asChild: true, children: children }), (0, jsx_runtime_1.jsx)(RadixTooltip.Portal, { container: root, children: showTooltip && ((0, jsx_runtime_1.jsxs)(RadixTooltip.Content, { ref: ref, className: Tooltip_module_scss_1.default.content, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, avoidCollisions: avoidCollisions, "data-tooltip-container": true, children: [tooltipTemplate ? (tooltipTemplate) : markdown ? ((0, jsx_runtime_1.jsx)(Markdown_1.Markdown, { children: markdown })) : (text), showArrow && (0, jsx_runtime_1.jsx)(RadixTooltip.Arrow, { className: Tooltip_module_scss_1.default.arrow })] })) })] }) }));
|
|
63
|
+
});
|
|
64
64
|
/**
|
|
65
65
|
* Parses tooltip options from any input and returns an object containing only the option properties
|
|
66
66
|
* of Tooltip (excludes non-option properties like text, triggerRef, and children)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.httpMethodNames = exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionValues = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonVariantValues = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.buttonThemeValues = exports.sizeMd = exports.
|
|
3
|
+
exports.httpMethodNames = exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionValues = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonVariantValues = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.buttonThemeValues = exports.sizeMd = exports.sizeValues = exports.viewportSizeNames = exports.viewportSizeMd = exports.LinkTargetMd = exports.LinkTargetNames = void 0;
|
|
4
|
+
exports.isSizeType = isSizeType;
|
|
4
5
|
exports.LinkTargetNames = ["_self", "_blank", "_parent", "_top", "_unfencedTop"];
|
|
5
6
|
exports.LinkTargetMd = [
|
|
6
7
|
{
|
|
@@ -38,14 +39,16 @@ exports.viewportSizeMd = [
|
|
|
38
39
|
];
|
|
39
40
|
exports.viewportSizeNames = Object.keys(exports.viewportSizeMd);
|
|
40
41
|
// --- Available button sizes
|
|
41
|
-
exports.
|
|
42
|
+
exports.sizeValues = ["xs", "sm", "md", "lg"];
|
|
42
43
|
exports.sizeMd = [
|
|
43
44
|
{ value: "xs", description: "Extra small" },
|
|
44
45
|
{ value: "sm", description: "Small" },
|
|
45
46
|
{ value: "md", description: "Medium" },
|
|
46
47
|
{ value: "lg", description: "Large" },
|
|
47
48
|
];
|
|
48
|
-
|
|
49
|
+
function isSizeType(value) {
|
|
50
|
+
return exports.sizeValues.includes(value);
|
|
51
|
+
}
|
|
49
52
|
// --- Available button themes
|
|
50
53
|
exports.buttonThemeValues = ["attention", "primary", "secondary"];
|
|
51
54
|
exports.buttonThemeNames = [...exports.buttonThemeValues];
|
|
@@ -56,11 +56,12 @@ const ComponentDecorator = (0, react_1.forwardRef)((props, forwardedRef) => {
|
|
|
56
56
|
}
|
|
57
57
|
if (node) {
|
|
58
58
|
Object.entries(shallowAttrs).forEach(([key, value]) => {
|
|
59
|
+
var _a, _b;
|
|
59
60
|
if (value !== undefined) {
|
|
60
|
-
node.setAttribute(key, value);
|
|
61
|
+
(_a = node.setAttribute) === null || _a === void 0 ? void 0 : _a.call(node, key, value);
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
63
|
-
node.removeAttribute(key);
|
|
64
|
+
(_b = node.removeAttribute) === null || _b === void 0 ? void 0 : _b.call(node, key);
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
}
|
|
@@ -164,7 +164,10 @@ class ApiInterceptor {
|
|
|
164
164
|
if (ret instanceof File) {
|
|
165
165
|
headers.append("Content-type", ret.type);
|
|
166
166
|
headers.append("Content-Length", ret.size + "");
|
|
167
|
-
|
|
167
|
+
// Properly encode filename for Content-Disposition header
|
|
168
|
+
// Use percent-encoding for non-ASCII characters in filename*
|
|
169
|
+
const encodedFilename = encodeURIComponent(ret.name);
|
|
170
|
+
headers.append("Content-Disposition", `attachment; filename*=UTF-8''${encodedFilename}`);
|
|
168
171
|
return msw_1.HttpResponse.arrayBuffer(yield ret.arrayBuffer(), {
|
|
169
172
|
headers: headers,
|
|
170
173
|
status: successStatusCode,
|
|
@@ -106,7 +106,20 @@ class Backend {
|
|
|
106
106
|
localContext: localContext,
|
|
107
107
|
eventArgs: args,
|
|
108
108
|
appContext: Object.assign(Object.assign(Object.assign({}, date_functions_1.dateFunctions), misc_utils_1.miscellaneousUtils), { delay: misc_1.delay,
|
|
109
|
-
Errors: Errors_1.default, createFile: (...args) =>
|
|
109
|
+
Errors: Errors_1.default, createFile: (...args) => {
|
|
110
|
+
return new File(args[0], args[1], args[2]);
|
|
111
|
+
}, appendBlob: (blob1, blob2) => {
|
|
112
|
+
if (blob1 && blob2) {
|
|
113
|
+
return new Blob([blob1, blob2], { type: blob1.type || blob2.type });
|
|
114
|
+
}
|
|
115
|
+
if (blob1) {
|
|
116
|
+
return blob1;
|
|
117
|
+
}
|
|
118
|
+
if (blob2) {
|
|
119
|
+
return blob2;
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}, getDate: date_utils_1.getDate }),
|
|
110
123
|
});
|
|
111
124
|
yield (0, statementUtils_1.runEventHandlerCode)(src, evalContext);
|
|
112
125
|
return ((_g = (_f = evalContext.mainThread) === null || _f === void 0 ? void 0 : _f.blocks) === null || _g === void 0 ? void 0 : _g.length)
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PART_END_ADORNMENT = exports.PART_START_ADORNMENT = exports.PART_INPUT = exports.PART_LABELED_ITEM = exports.PART_LABEL = void 0;
|
|
4
|
-
exports.partClassName = partClassName;
|
|
5
4
|
exports.PART_LABEL = "label";
|
|
6
5
|
exports.PART_LABELED_ITEM = "labeledItem";
|
|
7
6
|
exports.PART_INPUT = "input";
|
|
8
7
|
exports.PART_START_ADORNMENT = "startAdornment";
|
|
9
8
|
exports.PART_END_ADORNMENT = "endAdornment";
|
|
10
|
-
function partClassName(name) {
|
|
11
|
-
return `_PART_${name}_`;
|
|
12
|
-
}
|
|
@@ -266,6 +266,8 @@ declare type BreakMode = (typeof BreakModeKeys)[number];
|
|
|
266
266
|
|
|
267
267
|
declare const BreakModeKeys: readonly ["normal", "word", "anywhere", "keep", "hyphenate"];
|
|
268
268
|
|
|
269
|
+
declare const Breakout: ({ children, style, ...rest }: Props_6) => JSX_2.Element;
|
|
270
|
+
|
|
269
271
|
declare interface BreakStatement extends ScripNodeBase {
|
|
270
272
|
type: BREAK_STATEMENT;
|
|
271
273
|
}
|
|
@@ -277,7 +279,7 @@ declare const Button: default_2.ForwardRefExoticComponent<{
|
|
|
277
279
|
type?: ButtonType;
|
|
278
280
|
variant?: ButtonVariant;
|
|
279
281
|
themeColor?: ButtonThemeColor;
|
|
280
|
-
size?:
|
|
282
|
+
size?: SizeType;
|
|
281
283
|
disabled?: boolean;
|
|
282
284
|
children?: default_2.ReactNode | default_2.ReactNode[];
|
|
283
285
|
icon?: default_2.ReactNode;
|
|
@@ -287,7 +289,6 @@ declare const Button: default_2.ForwardRefExoticComponent<{
|
|
|
287
289
|
formId?: string;
|
|
288
290
|
style?: CSSProperties;
|
|
289
291
|
gap?: string | number;
|
|
290
|
-
accessibilityProps?: any;
|
|
291
292
|
autoFocus?: boolean;
|
|
292
293
|
contextualLabel?: string;
|
|
293
294
|
} & Pick<default_2.HTMLAttributes<HTMLButtonElement>, "className" | "aria-disabled" | "aria-label" | "aria-controls" | "aria-expanded" | "role" | "onFocus" | "onBlur" | "onClick" | "tabIndex" | "onMouseEnter" | "onMouseLeave"> & default_2.RefAttributes<HTMLButtonElement>>;
|
|
@@ -495,8 +496,6 @@ declare type ComponentRendererDef<T extends ComponentDef = any> = {
|
|
|
495
496
|
|
|
496
497
|
declare type ComponentRendererFn<T extends ComponentDef> = (context: RendererContext<T>) => ReactNode;
|
|
497
498
|
|
|
498
|
-
declare type ComponentSize = (typeof sizeValues)[number];
|
|
499
|
-
|
|
500
499
|
declare interface CompoundComponentDef extends Scriptable {
|
|
501
500
|
name: string;
|
|
502
501
|
component: ComponentDef;
|
|
@@ -853,7 +852,7 @@ declare interface IfStatement extends ScripNodeBase {
|
|
|
853
852
|
}
|
|
854
853
|
|
|
855
854
|
declare type InterceptorOperationDef = {
|
|
856
|
-
method: "get" | "post" | "put" | "delete";
|
|
855
|
+
method: "get" | "post" | "put" | "delete" | "patch" | "head" | "options";
|
|
857
856
|
url: string | Array<string>;
|
|
858
857
|
handler: string;
|
|
859
858
|
requestShape?: any;
|
|
@@ -1039,8 +1038,6 @@ declare type ParserResult = {
|
|
|
1039
1038
|
*/
|
|
1040
1039
|
declare function parseScssVar(scssStr: any): any;
|
|
1041
1040
|
|
|
1042
|
-
declare function partClassName(name: string): string;
|
|
1043
|
-
|
|
1044
1041
|
declare type POSTFIX_OP_EXPRESSION = typeof T_POSTFIX_OP_EXPRESSION;
|
|
1045
1042
|
|
|
1046
1043
|
declare interface PostfixOpExpression extends ExpressionBase {
|
|
@@ -1069,8 +1066,8 @@ declare type ProjectCompilation = {
|
|
|
1069
1066
|
themes: Record<string, ThemeDefinition>;
|
|
1070
1067
|
};
|
|
1071
1068
|
|
|
1072
|
-
declare type PropertyValueDescription = string | number | {
|
|
1073
|
-
value:
|
|
1069
|
+
declare type PropertyValueDescription<T = string | number> = T | {
|
|
1070
|
+
value: T;
|
|
1074
1071
|
description: string;
|
|
1075
1072
|
};
|
|
1076
1073
|
|
|
@@ -1178,6 +1175,11 @@ declare type Props_5 = {
|
|
|
1178
1175
|
passwordHiddenIcon?: string;
|
|
1179
1176
|
};
|
|
1180
1177
|
|
|
1178
|
+
declare type Props_6 = {
|
|
1179
|
+
children?: ReactNode;
|
|
1180
|
+
style?: React.CSSProperties;
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1181
1183
|
declare type REACTIVE_VAR_DECLARATION = typeof T_REACTIVE_VAR_DECLARATION;
|
|
1182
1184
|
|
|
1183
1185
|
declare interface ReactiveVarDeclaration extends ExpressionBase {
|
|
@@ -1263,7 +1265,9 @@ declare interface SequenceExpression extends ExpressionBase {
|
|
|
1263
1265
|
loose?: boolean;
|
|
1264
1266
|
}
|
|
1265
1267
|
|
|
1266
|
-
declare
|
|
1268
|
+
declare type SizeType = (typeof sizeValues)[number];
|
|
1269
|
+
|
|
1270
|
+
declare const sizeValues: readonly ["xs", "sm", "md", "lg"];
|
|
1267
1271
|
|
|
1268
1272
|
declare const Spinner: ForwardRefExoticComponent<SpinnerProps & RefAttributes<HTMLDivElement>>;
|
|
1269
1273
|
|
|
@@ -1371,7 +1375,7 @@ declare const standaloneExports: {
|
|
|
1371
1375
|
type?: ButtonType;
|
|
1372
1376
|
variant?: ButtonVariant;
|
|
1373
1377
|
themeColor?: ButtonThemeColor;
|
|
1374
|
-
size?:
|
|
1378
|
+
size?: SizeType;
|
|
1375
1379
|
disabled?: boolean;
|
|
1376
1380
|
children?: default_2.ReactNode | default_2.ReactNode[];
|
|
1377
1381
|
icon?: default_2.ReactNode;
|
|
@@ -1381,7 +1385,6 @@ declare const standaloneExports: {
|
|
|
1381
1385
|
formId?: string;
|
|
1382
1386
|
style?: default_2.CSSProperties;
|
|
1383
1387
|
gap?: string | number;
|
|
1384
|
-
accessibilityProps?: any;
|
|
1385
1388
|
autoFocus?: boolean;
|
|
1386
1389
|
contextualLabel?: string;
|
|
1387
1390
|
} & Pick<default_2.HTMLAttributes<HTMLButtonElement>, "className" | "aria-disabled" | "aria-label" | "aria-controls" | "aria-expanded" | "role" | "onFocus" | "onBlur" | "onClick" | "tabIndex" | "onMouseEnter" | "onMouseLeave"> & default_2.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1510,6 +1513,10 @@ declare const standaloneExports: {
|
|
|
1510
1513
|
className?: string;
|
|
1511
1514
|
inline?: boolean;
|
|
1512
1515
|
} & default_2.RefAttributes<HTMLImageElement>>;
|
|
1516
|
+
Breakout: ({ children, style, ...rest }: {
|
|
1517
|
+
children?: default_2.ReactNode;
|
|
1518
|
+
style?: default_2.CSSProperties;
|
|
1519
|
+
}) => default_3.JSX.Element;
|
|
1513
1520
|
useSearchContextContent: () => Record<string, {
|
|
1514
1521
|
path: string;
|
|
1515
1522
|
title: string;
|
|
@@ -1519,7 +1526,6 @@ declare const standaloneExports: {
|
|
|
1519
1526
|
StyleProvider: typeof xmluiExports.StyleProvider;
|
|
1520
1527
|
StyleRegistry: typeof xmluiExports.StyleRegistry;
|
|
1521
1528
|
useEvent: UseEventOverload;
|
|
1522
|
-
partClassName: typeof xmluiExports.partClassName;
|
|
1523
1529
|
StandaloneComponent: typeof xmluiExports.StandaloneComponent;
|
|
1524
1530
|
};
|
|
1525
1531
|
export default standaloneExports;
|
|
@@ -2142,12 +2148,12 @@ declare namespace xmluiExports {
|
|
|
2142
2148
|
LinkNative,
|
|
2143
2149
|
ToneChangerButton,
|
|
2144
2150
|
Logo,
|
|
2151
|
+
Breakout,
|
|
2145
2152
|
useSearchContextContent,
|
|
2146
2153
|
useAppLayoutContext,
|
|
2147
2154
|
StyleProvider,
|
|
2148
2155
|
StyleRegistry,
|
|
2149
2156
|
useEvent,
|
|
2150
|
-
partClassName,
|
|
2151
2157
|
StandaloneComponent
|
|
2152
2158
|
}
|
|
2153
2159
|
}
|