xmlui 0.10.14 → 0.10.16
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-779mp2Bm.mjs → index-D4RYJasT.mjs} +2952 -937
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-CAXdczCj.mjs → initMock-qzTZlH-6.mjs} +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-D90qqMGc.mjs → metadata-utils-CtY0QcvH.mjs} +2 -1
- package/dist/lib/{server-common-lmBDLpUh.mjs → server-common-Cine5nRR.mjs} +1 -1
- package/dist/lib/xmlui-parser.d.ts +1 -1
- package/dist/lib/xmlui.d.ts +87 -11
- package/dist/lib/xmlui.mjs +72 -37
- package/dist/metadata/{collectedComponentMetadata-7DFXlw-J.mjs → collectedComponentMetadata-BQaefK3f.mjs} +3189 -1242
- package/dist/metadata/{initMock-AFWEftc6.mjs → initMock-Cz6QssI3.mjs} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/package.json +2 -3
- package/dist/scripts/src/components/Animation/AnimationNative.js +5 -1
- package/dist/scripts/src/components/AppState/AppState.js +32 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +27 -3
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +1 -5
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +263 -82
- package/dist/scripts/src/components/Button/Button.js +5 -1
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +41 -2
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +7 -9
- package/dist/scripts/src/components/Form/FormNative.js +33 -25
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
- package/dist/scripts/src/components/Icon/IconNative.js +18 -15
- package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +182 -123
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +14 -6
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
- package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -4
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +112 -423
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +18 -4
- package/dist/scripts/src/components/Option/Option.js +3 -1
- package/dist/scripts/src/components/Select/HiddenOption.js +1 -1
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +3 -1
- package/dist/scripts/src/components/Slider/Slider.spec.js +46 -13
- package/dist/scripts/src/components/Slider/SliderNative.js +19 -9
- package/dist/scripts/src/components/Table/Table.js +7 -1
- package/dist/scripts/src/components/Table/TableNative.js +4 -1
- package/dist/scripts/src/components/Table/useRowSelection.js +215 -1
- package/dist/scripts/src/components/TextBox/TextBox.js +1 -5
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +368 -324
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +10 -15
- package/dist/scripts/src/components/Theme/ThemeNative.js +2 -6
- package/dist/scripts/src/components/TimeInput/TimeInput.js +1 -5
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +2 -9
- package/dist/scripts/src/components/Tree/Tree-dynamic.spec.js +2894 -0
- package/dist/scripts/src/components/Tree/Tree.spec.js +2932 -0
- package/dist/scripts/src/components/Tree/TreeComponent.js +266 -10
- package/dist/scripts/src/components/Tree/TreeNative.js +1048 -23
- package/dist/scripts/src/components/Tree/testData.js +272 -0
- package/dist/scripts/src/components-core/ApiBoundComponent.js +38 -24
- package/dist/scripts/src/components-core/RestApiProxy.js +0 -1
- package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +54 -0
- package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +81 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
- package/dist/scripts/src/components-core/parts.js +4 -1
- package/dist/scripts/src/components-core/rendering/AppRoot.js +2 -1
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +32 -48
- package/dist/scripts/src/components-core/rendering/nodeUtils.js +6 -0
- package/dist/scripts/src/components-core/theming/layout-resolver.js +2 -0
- package/dist/scripts/src/components-core/utils/treeUtils.js +187 -12
- package/dist/scripts/src/index.js +38 -1
- package/dist/scripts/src/testing/ComponentDrivers.js +77 -31
- package/dist/scripts/src/testing/drivers/NumberBoxDriver.js +44 -0
- package/dist/scripts/src/testing/drivers/TextBoxDriver.js +20 -0
- package/dist/scripts/src/testing/drivers/TreeDriver.js +13 -0
- package/dist/scripts/src/testing/fixtures.js +40 -9
- package/dist/standalone/xmlui-standalone.es.d.ts +158 -15
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +2 -3
- package/dist/scripts/src/components/Animation/Animation.js +0 -50
|
@@ -56,7 +56,6 @@ const TextBox_module_scss_1 = __importDefault(require("./TextBox.module.scss"));
|
|
|
56
56
|
const constants_1 = require("../../components-core/constants");
|
|
57
57
|
const misc_1 = require("../../components-core/utils/misc");
|
|
58
58
|
const InputAdornment_1 = require("../Input/InputAdornment");
|
|
59
|
-
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
60
59
|
const parts_1 = require("../../components-core/parts");
|
|
61
60
|
exports.defaultProps = {
|
|
62
61
|
type: "text",
|
|
@@ -73,9 +72,7 @@ exports.defaultProps = {
|
|
|
73
72
|
passwordHiddenIcon: "eye-off",
|
|
74
73
|
};
|
|
75
74
|
exports.TextBox = (0, react_1.forwardRef)(function TextBox(_a, ref) {
|
|
76
|
-
var { id, type = exports.defaultProps.type, value = exports.defaultProps.value, updateState = exports.defaultProps.updateState, initialValue = exports.defaultProps.initialValue, style, className, maxLength, enabled = exports.defaultProps.enabled, placeholder, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onKeyDown = exports.defaultProps.onKeyDown, registerComponentApi, startText, startIcon, endText, endIcon, gap, autoFocus, readOnly, tabIndex,
|
|
77
|
-
const _id = (0, react_1.useId)();
|
|
78
|
-
id = id || _id;
|
|
75
|
+
var { id, type = exports.defaultProps.type, value = exports.defaultProps.value, updateState = exports.defaultProps.updateState, initialValue = exports.defaultProps.initialValue, style, className, maxLength, enabled = exports.defaultProps.enabled, placeholder, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onKeyDown = exports.defaultProps.onKeyDown, registerComponentApi, startText, startIcon, endText, endIcon, gap, autoFocus, readOnly, tabIndex, required, showPasswordToggle, passwordVisibleIcon = exports.defaultProps.passwordVisibleIcon, passwordHiddenIcon = exports.defaultProps.passwordHiddenIcon } = _a, rest = __rest(_a, ["id", "type", "value", "updateState", "initialValue", "style", "className", "maxLength", "enabled", "placeholder", "validationStatus", "onDidChange", "onFocus", "onBlur", "onKeyDown", "registerComponentApi", "startText", "startIcon", "endText", "endIcon", "gap", "autoFocus", "readOnly", "tabIndex", "required", "showPasswordToggle", "passwordVisibleIcon", "passwordHiddenIcon"]);
|
|
79
76
|
const inputRef = (0, react_2.useRef)(null);
|
|
80
77
|
// State to control password visibility
|
|
81
78
|
const [showPassword, setShowPassword] = (0, react_1.useState)(false);
|
|
@@ -133,15 +130,13 @@ exports.TextBox = (0, react_1.forwardRef)(function TextBox(_a, ref) {
|
|
|
133
130
|
setValue,
|
|
134
131
|
});
|
|
135
132
|
}, [focus, registerComponentApi, setValue]);
|
|
136
|
-
return ((0, jsx_runtime_1.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
[TextBox_module_scss_1.default.readOnly]: readOnly,
|
|
146
|
-
}), disabled: !enabled, value: localValue, maxLength: maxLength, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: onKeyDown, ref: inputRef, readOnly: readOnly, autoFocus: autoFocus, tabIndex: enabled ? tabIndex : -1, required: required }), type === "password" && showPasswordToggle ? ((0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { "data-part-id": parts_1.PART_END_ADORNMENT, iconName: showPassword ? passwordVisibleIcon : passwordHiddenIcon, className: (0, classnames_1.default)(TextBox_module_scss_1.default.adornment, TextBox_module_scss_1.default.passwordToggle), onClick: togglePasswordVisibility })) : ((0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { "data-part-id": parts_1.PART_END_ADORNMENT, text: endText, iconName: endIcon, className: TextBox_module_scss_1.default.adornment }))] }) })));
|
|
133
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { ref: ref, className: (0, classnames_1.default)(TextBox_module_scss_1.default.inputRoot, {
|
|
134
|
+
[TextBox_module_scss_1.default.disabled]: !enabled,
|
|
135
|
+
[TextBox_module_scss_1.default.readOnly]: readOnly,
|
|
136
|
+
[TextBox_module_scss_1.default.error]: validationStatus === "error",
|
|
137
|
+
[TextBox_module_scss_1.default.warning]: validationStatus === "warning",
|
|
138
|
+
[TextBox_module_scss_1.default.valid]: validationStatus === "valid",
|
|
139
|
+
}), tabIndex: -1, onFocus: focus, style: { gap }, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { "data-part-id": parts_1.PART_START_ADORNMENT, text: startText, iconName: startIcon, className: (0, classnames_1.default)(TextBox_module_scss_1.default.adornment) }), (0, jsx_runtime_1.jsx)("input", { id: id, ref: inputRef, "data-part-id": parts_1.PART_INPUT, type: actualType, className: (0, classnames_1.default)(TextBox_module_scss_1.default.input, {
|
|
140
|
+
[TextBox_module_scss_1.default.readOnly]: readOnly,
|
|
141
|
+
}), disabled: !enabled, value: localValue, maxLength: maxLength, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: onKeyDown, readOnly: readOnly, autoFocus: autoFocus, tabIndex: enabled ? tabIndex : -1, required: required }), type === "password" && showPasswordToggle ? ((0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { "data-part-id": parts_1.PART_END_ADORNMENT, iconName: showPassword ? passwordVisibleIcon : passwordHiddenIcon, className: (0, classnames_1.default)(TextBox_module_scss_1.default.adornment, TextBox_module_scss_1.default.passwordToggle), onClick: togglePasswordVisibility })) : ((0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { "data-part-id": parts_1.PART_END_ADORNMENT, text: endText, iconName: endIcon, className: TextBox_module_scss_1.default.adornment }))] })));
|
|
147
142
|
});
|
|
@@ -117,13 +117,9 @@ function Theme({ id, isRoot = exports.defaultProps.isRoot, renderChild, node, to
|
|
|
117
117
|
}
|
|
118
118
|
if (isRoot) {
|
|
119
119
|
const faviconUrl = getResourceUrl("resource:favicon") || "/resources/favicon.ico";
|
|
120
|
-
return (
|
|
121
|
-
// <ThemeContext.Provider value={currentThemeContextValue}>
|
|
122
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => (0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink))] }), (0, jsx_runtime_1.jsx)(RootClasses, { classNames: rootClasses }), (0, jsx_runtime_1.jsxs)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "theme-root", children: [renderChild(node.children), children] }), (0, jsx_runtime_1.jsx)(NotificationToast_1.NotificationToast, { toastDuration: toastDuration })] })
|
|
123
|
-
// </ThemeContext.Provider>
|
|
124
|
-
);
|
|
120
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => (0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink))] }), (0, jsx_runtime_1.jsx)(RootClasses, { classNames: rootClasses }), (0, jsx_runtime_1.jsxs)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "theme-root", children: [renderChild && renderChild(node.children), children] }), (0, jsx_runtime_1.jsx)(NotificationToast_1.NotificationToast, { toastDuration: toastDuration })] }));
|
|
125
121
|
}
|
|
126
|
-
return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: [(0, jsx_runtime_1.
|
|
122
|
+
return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(Theme_module_scss_1.default.wrapper, className), children: [renderChild && renderChild(node.children, Object.assign(Object.assign({}, layoutContext), { themeClassName: className })), children] }), root &&
|
|
127
123
|
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className), ref: (el) => {
|
|
128
124
|
if (el) {
|
|
129
125
|
setCurrentThemeRoot(el);
|
|
@@ -38,10 +38,6 @@ exports.TimeInputMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
38
38
|
readOnly: (0, metadata_helpers_1.dReadonly)(),
|
|
39
39
|
enabled: (0, metadata_helpers_1.dEnabled)(TimeInputNative_1.defaultProps.enabled),
|
|
40
40
|
validationStatus: (0, metadata_helpers_1.dValidationStatus)(TimeInputNative_1.defaultProps.validationStatus),
|
|
41
|
-
label: (0, metadata_helpers_1.dLabel)(),
|
|
42
|
-
labelPosition: (0, metadata_helpers_1.dLabelPosition)("top"),
|
|
43
|
-
labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
|
|
44
|
-
labelBreak: (0, metadata_helpers_1.dLabelBreak)(COMP),
|
|
45
41
|
hour24: {
|
|
46
42
|
description: "Whether to use 24-hour format (true) or 12-hour format with AM/PM (false)",
|
|
47
43
|
valueType: "boolean",
|
|
@@ -149,5 +145,5 @@ exports.TimeInputMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
149
145
|
exports.timeInputComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TimeInputMd, ({ node, state, updateState, extractValue, className, lookupEventHandler, registerComponentApi, }) => {
|
|
150
146
|
const extractedInitialValue = extractValue(node.props.initialValue);
|
|
151
147
|
const stateValue = state === null || state === void 0 ? void 0 : state.value;
|
|
152
|
-
return ((0, jsx_runtime_1.jsx)(TimeInputNative_1.TimeInputNative, { className: className, initialValue: extractedInitialValue, value: stateValue, updateState: updateState, registerComponentApi: registerComponentApi, enabled: extractValue.asOptionalBoolean(node.props.enabled, TimeInputNative_1.defaultProps.enabled), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus, TimeInputNative_1.defaultProps.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly, TimeInputNative_1.defaultProps.readOnly), validationStatus: extractValue(node.props.validationStatus), hour24: extractValue.asOptionalBoolean(node.props.hour24, TimeInputNative_1.defaultProps.hour24), seconds: extractValue.asOptionalBoolean(node.props.seconds, TimeInputNative_1.defaultProps.seconds), minTime: extractValue(node.props.minTime), maxTime: extractValue(node.props.maxTime), clearable: extractValue.asOptionalBoolean(node.props.clearable, TimeInputNative_1.defaultProps.clearable), clearIcon: extractValue(node.props.clearIcon), clearToInitialValue: extractValue.asOptionalBoolean(node.props.clearToInitialValue, TimeInputNative_1.defaultProps.clearToInitialValue), required: extractValue.asOptionalBoolean(node.props.required, TimeInputNative_1.defaultProps.required),
|
|
148
|
+
return ((0, jsx_runtime_1.jsx)(TimeInputNative_1.TimeInputNative, { className: className, initialValue: extractedInitialValue, value: stateValue, updateState: updateState, registerComponentApi: registerComponentApi, enabled: extractValue.asOptionalBoolean(node.props.enabled, TimeInputNative_1.defaultProps.enabled), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus, TimeInputNative_1.defaultProps.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly, TimeInputNative_1.defaultProps.readOnly), validationStatus: extractValue(node.props.validationStatus), hour24: extractValue.asOptionalBoolean(node.props.hour24, TimeInputNative_1.defaultProps.hour24), seconds: extractValue.asOptionalBoolean(node.props.seconds, TimeInputNative_1.defaultProps.seconds), minTime: extractValue(node.props.minTime), maxTime: extractValue(node.props.maxTime), clearable: extractValue.asOptionalBoolean(node.props.clearable, TimeInputNative_1.defaultProps.clearable), clearIcon: extractValue(node.props.clearIcon), clearToInitialValue: extractValue.asOptionalBoolean(node.props.clearToInitialValue, TimeInputNative_1.defaultProps.clearToInitialValue), required: extractValue.asOptionalBoolean(node.props.required, TimeInputNative_1.defaultProps.required), startText: extractValue(node.props.startText), startIcon: extractValue(node.props.startIcon), endText: extractValue(node.props.endText), endIcon: extractValue(node.props.endIcon), gap: extractValue.asOptionalString(node.props.gap), emptyCharacter: extractValue.asOptionalString(node.props.emptyCharacter, TimeInputNative_1.defaultProps.emptyCharacter), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), onInvalidChange: lookupEventHandler("invalidTime") }));
|
|
153
149
|
});
|
|
@@ -23,7 +23,6 @@ const PartialInput_1 = require("../Input/PartialInput");
|
|
|
23
23
|
const InputDivider_1 = require("../Input/InputDivider");
|
|
24
24
|
const misc_1 = require("../../components-core/utils/misc");
|
|
25
25
|
const InputAdornment_1 = require("../Input/InputAdornment");
|
|
26
|
-
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
27
26
|
const IconNative_1 = __importDefault(require("../Icon/IconNative"));
|
|
28
27
|
// Import utilities and types from merged utils file
|
|
29
28
|
const utils_1 = require("./utils");
|
|
@@ -41,14 +40,12 @@ exports.defaultProps = {
|
|
|
41
40
|
clearable: false,
|
|
42
41
|
clearToInitialValue: true,
|
|
43
42
|
required: false,
|
|
44
|
-
labelPosition: "top",
|
|
45
43
|
readOnly: false,
|
|
46
44
|
autoFocus: false,
|
|
47
|
-
labelBreak: false,
|
|
48
45
|
emptyCharacter: "-",
|
|
49
46
|
};
|
|
50
47
|
exports.TimeInputNative = (0, react_1.forwardRef)(function TimeInputNative(_a, ref) {
|
|
51
|
-
var { id, initialValue, value: controlledValue, enabled = exports.defaultProps.enabled, updateState, style, className, onDidChange, onFocus, onBlur, onInvalidChange, validationStatus = exports.defaultProps.validationStatus, registerComponentApi, hour24 = exports.defaultProps.hour24, seconds = exports.defaultProps.seconds, minTime, maxTime, clearable = exports.defaultProps.clearable, clearIcon, clearToInitialValue = exports.defaultProps.clearToInitialValue, required = exports.defaultProps.required, startText, startIcon, endText, endIcon, gap,
|
|
48
|
+
var { id, initialValue, value: controlledValue, enabled = exports.defaultProps.enabled, updateState, style, className, onDidChange, onFocus, onBlur, onInvalidChange, validationStatus = exports.defaultProps.validationStatus, registerComponentApi, hour24 = exports.defaultProps.hour24, seconds = exports.defaultProps.seconds, minTime, maxTime, clearable = exports.defaultProps.clearable, clearIcon, clearToInitialValue = exports.defaultProps.clearToInitialValue, required = exports.defaultProps.required, startText, startIcon, endText, endIcon, gap, readOnly = exports.defaultProps.readOnly, autoFocus = exports.defaultProps.autoFocus, emptyCharacter = exports.defaultProps.emptyCharacter } = _a, rest = __rest(_a, ["id", "initialValue", "value", "enabled", "updateState", "style", "className", "onDidChange", "onFocus", "onBlur", "onInvalidChange", "validationStatus", "registerComponentApi", "hour24", "seconds", "minTime", "maxTime", "clearable", "clearIcon", "clearToInitialValue", "required", "startText", "startIcon", "endText", "endIcon", "gap", "readOnly", "autoFocus", "emptyCharacter"]);
|
|
52
49
|
const timeInputRef = (0, react_1.useRef)(null);
|
|
53
50
|
// Refs for auto-tabbing between inputs
|
|
54
51
|
const hourInputRef = (0, react_1.useRef)(null);
|
|
@@ -412,11 +409,7 @@ exports.TimeInputNative = (0, react_1.forwardRef)(function TimeInputNative(_a, r
|
|
|
412
409
|
[TimeInput_module_scss_1.default.valid]: validationStatus === "valid",
|
|
413
410
|
[TimeInput_module_scss_1.default.disabled]: !enabled,
|
|
414
411
|
[TimeInput_module_scss_1.default.readOnly]: readOnly,
|
|
415
|
-
}, className), style: Object.assign(Object.assign({}, style), { gap }), onFocusCapture: handleComponentFocus, onBlur: handleComponentBlur, "data-validation-status": validationStatus }, rest, { children: [startAdornment, (0, jsx_runtime_1.jsxs)("div", { className: TimeInput_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsxs)("div", { className: TimeInput_module_scss_1.default.inputGroup, children: [(0, jsx_runtime_1.jsx)(HourInput, { amPm: amPm, autoFocus: autoFocus, disabled: !enabled, inputRef: hourInputRef, nextInputRef: minuteInputRef, maxTime: maxTime, minTime: minTime, onChange: handleHourChange, onBlur: handleHourBlur, onKeyDown: handleArrowKeys, readOnly: readOnly, required: required, value: hour, isInvalid: isHourCurrentlyInvalid, is24Hour: !is12HourFormat, emptyCharacter: processedEmptyCharacter }), (0, jsx_runtime_1.jsx)(InputDivider_1.InputDivider, { separator: ":" }), (0, jsx_runtime_1.jsx)(MinuteInput, { disabled: !enabled, hour: hour, inputRef: minuteInputRef, nextInputRef: showSeconds ? secondInputRef : undefined, nextButtonRef: showSeconds ? undefined : is12HourFormat ? amPmButtonRef : undefined, maxTime: maxTime, minTime: minTime, onChange: handleMinuteChange, onBlur: handleMinuteBlur, onKeyDown: handleArrowKeys, readOnly: readOnly, required: required, showLeadingZeros: showLeadingZeros, value: minute, isInvalid: isMinuteCurrentlyInvalid, emptyCharacter: processedEmptyCharacter }), showSeconds && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InputDivider_1.InputDivider, { separator: ":", className: TimeInput_module_scss_1.default.divider }), (0, jsx_runtime_1.jsx)(SecondInput, { disabled: !enabled, hour: hour, inputRef: secondInputRef, nextButtonRef: is12HourFormat ? amPmButtonRef : undefined, maxTime: maxTime, minTime: minTime, minute: minute, onChange: handleSecondChange, onBlur: handleSecondBlur, onKeyDown: handleArrowKeys, readOnly: readOnly, required: required, showLeadingZeros: showLeadingZeros, value: second, isInvalid: isSecondCurrentlyInvalid, emptyCharacter: processedEmptyCharacter })] })), is12HourFormat && ((0, jsx_runtime_1.jsx)(AmPmButton, { className: "timeinput", disabled: !enabled, buttonRef: amPmButtonRef, maxTime: maxTime, minTime: minTime, onClick: handleAmPmToggle, onAmPmSet: handleAmPmSet, onKeyDown: handleArrowKeys, value: amPm }))] }), clearable && ((0, jsx_runtime_1.jsx)("button", { "data-part-id": PART_CLEAR_BUTTON, className: (0, classnames_1.default)(TimeInput_module_scss_1.default.clearButton, TimeInput_module_scss_1.default.button), disabled: !enabled, onClick: clear, onFocus: stopPropagation, type: "button", children: clearIconElement }))] }), endAdornment] })));
|
|
416
|
-
// Wrap with label if needed
|
|
417
|
-
if (label) {
|
|
418
|
-
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { label: label, labelPosition: labelPosition, labelWidth: labelWidth, labelBreak: labelBreak, required: required, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startAdornment, timeInputComponent, endAdornment] }) }));
|
|
419
|
-
}
|
|
412
|
+
}, className), style: Object.assign(Object.assign({}, style), { gap }), onFocusCapture: handleComponentFocus, onBlur: handleComponentBlur, "data-validation-status": validationStatus }, rest, { children: [startAdornment, (0, jsx_runtime_1.jsxs)("div", { className: TimeInput_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsxs)("div", { className: TimeInput_module_scss_1.default.inputGroup, children: [(0, jsx_runtime_1.jsx)(HourInput, { id: id, amPm: amPm, autoFocus: autoFocus, disabled: !enabled, inputRef: hourInputRef, nextInputRef: minuteInputRef, maxTime: maxTime, minTime: minTime, onChange: handleHourChange, onBlur: handleHourBlur, onKeyDown: handleArrowKeys, readOnly: readOnly, required: required, value: hour, isInvalid: isHourCurrentlyInvalid, is24Hour: !is12HourFormat, emptyCharacter: processedEmptyCharacter }), (0, jsx_runtime_1.jsx)(InputDivider_1.InputDivider, { separator: ":" }), (0, jsx_runtime_1.jsx)(MinuteInput, { disabled: !enabled, hour: hour, inputRef: minuteInputRef, nextInputRef: showSeconds ? secondInputRef : undefined, nextButtonRef: showSeconds ? undefined : is12HourFormat ? amPmButtonRef : undefined, maxTime: maxTime, minTime: minTime, onChange: handleMinuteChange, onBlur: handleMinuteBlur, onKeyDown: handleArrowKeys, readOnly: readOnly, required: required, showLeadingZeros: showLeadingZeros, value: minute, isInvalid: isMinuteCurrentlyInvalid, emptyCharacter: processedEmptyCharacter }), showSeconds && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InputDivider_1.InputDivider, { separator: ":", className: TimeInput_module_scss_1.default.divider }), (0, jsx_runtime_1.jsx)(SecondInput, { disabled: !enabled, hour: hour, inputRef: secondInputRef, nextButtonRef: is12HourFormat ? amPmButtonRef : undefined, maxTime: maxTime, minTime: minTime, minute: minute, onChange: handleSecondChange, onBlur: handleSecondBlur, onKeyDown: handleArrowKeys, readOnly: readOnly, required: required, showLeadingZeros: showLeadingZeros, value: second, isInvalid: isSecondCurrentlyInvalid, emptyCharacter: processedEmptyCharacter })] })), is12HourFormat && ((0, jsx_runtime_1.jsx)(AmPmButton, { className: "timeinput", disabled: !enabled, buttonRef: amPmButtonRef, maxTime: maxTime, minTime: minTime, onClick: handleAmPmToggle, onAmPmSet: handleAmPmSet, onKeyDown: handleArrowKeys, value: amPm }))] }), clearable && ((0, jsx_runtime_1.jsx)("button", { "data-part-id": PART_CLEAR_BUTTON, className: (0, classnames_1.default)(TimeInput_module_scss_1.default.clearButton, TimeInput_module_scss_1.default.button), disabled: !enabled, onClick: clear, onFocus: stopPropagation, type: "button", children: clearIconElement }))] }), endAdornment] })));
|
|
420
413
|
return timeInputComponent;
|
|
421
414
|
});
|
|
422
415
|
function AmPmButton({ ariaLabel, autoFocus, className, disabled, locale, maxTime, minTime, onClick, onAmPmSet, onKeyDown, buttonRef, value, }) {
|