45 lines
1.6 KiB
JavaScript
45 lines
1.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "useFieldContextValues_unstable", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return useFieldContextValues_unstable;
|
|
}
|
|
});
|
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
const useFieldContextValues_unstable = (state)=>{
|
|
var _state_label, _state_label1, _state_validationMessage, _state_hint;
|
|
const { generatedControlId, orientation, required, size, validationState } = state;
|
|
const labelFor = (_state_label = state.label) === null || _state_label === void 0 ? void 0 : _state_label.htmlFor;
|
|
const labelId = (_state_label1 = state.label) === null || _state_label1 === void 0 ? void 0 : _state_label1.id;
|
|
const validationMessageId = (_state_validationMessage = state.validationMessage) === null || _state_validationMessage === void 0 ? void 0 : _state_validationMessage.id;
|
|
const hintId = (_state_hint = state.hint) === null || _state_hint === void 0 ? void 0 : _state_hint.id;
|
|
const field = _react.useMemo(()=>({
|
|
generatedControlId,
|
|
hintId,
|
|
labelFor,
|
|
labelId,
|
|
orientation,
|
|
required,
|
|
size,
|
|
validationMessageId,
|
|
validationState
|
|
}), [
|
|
generatedControlId,
|
|
hintId,
|
|
labelFor,
|
|
labelId,
|
|
orientation,
|
|
required,
|
|
size,
|
|
validationMessageId,
|
|
validationState
|
|
]);
|
|
return {
|
|
field
|
|
};
|
|
};
|