@wix/form-public 0.522.0 → 0.524.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -258,7 +258,7 @@ function deriveError(validation, error, options) {
|
|
|
258
258
|
if (!error) {
|
|
259
259
|
return error;
|
|
260
260
|
}
|
|
261
|
-
return derivePatternError(error) ?? deriveCharacterLengthError(validation, error) ?? deriveItemsCountError(validation, error) ?? deriveNumericValueError(validation, error) ??
|
|
261
|
+
return derivePatternError(error) ?? deriveCharacterLengthError(validation, error) ?? deriveItemsCountError(validation, error) ?? deriveNumericValueError(validation, error) ?? deriveDateTimeFieldError(validation, error, options?.value) ?? deriveDateFieldError(validation, error, options?.value) ?? error;
|
|
262
262
|
}
|
|
263
263
|
function derivePatternError(error) {
|
|
264
264
|
if (!error || error.errorType !== types.ErrorType.PATTERN_ERROR) {
|
|
@@ -54093,6 +54093,7 @@ var NonModalPopover = /* @__PURE__ */ React173.forwardRef((props2, forwardedRef)
|
|
|
54093
54093
|
shouldCloseOnInteractOutside: isOutsideTrigger
|
|
54094
54094
|
}));
|
|
54095
54095
|
});
|
|
54096
|
+
var EMPTY_SELECT_PLACEHOLDER = "\u200B";
|
|
54096
54097
|
var SelectTriggerButton = /* @__PURE__ */ React173.forwardRef((props2, ref) => {
|
|
54097
54098
|
const overlayState = React173.useContext(reactAriaComponents.OverlayTriggerStateContext);
|
|
54098
54099
|
const handlePressStart = (event) => {
|
|
@@ -54331,7 +54332,7 @@ var Month = ({ children, className }) => {
|
|
|
54331
54332
|
const [isOpen, setIsOpen] = React173.useState(false);
|
|
54332
54333
|
const isForcedOpen = useIsForcedOpenDropdown(id6);
|
|
54333
54334
|
const [container, setContainer] = React173.useState(null);
|
|
54334
|
-
const placeholder = hidePlaceholder ?
|
|
54335
|
+
const placeholder = hidePlaceholder ? EMPTY_SELECT_PLACEHOLDER : t("field.date.placeholder.month");
|
|
54335
54336
|
const handleMonthChange = React173.useCallback((selectedValue) => {
|
|
54336
54337
|
if (readOnly) {
|
|
54337
54338
|
return;
|
|
@@ -54697,7 +54698,8 @@ var Input2 = ({ className }) => {
|
|
|
54697
54698
|
regionalFormat
|
|
54698
54699
|
]);
|
|
54699
54700
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateInput, {
|
|
54700
|
-
className
|
|
54701
|
+
className,
|
|
54702
|
+
"data-placeholder-hidden": !placeholder || void 0
|
|
54701
54703
|
}, (segment) => {
|
|
54702
54704
|
const showCustomPlaceholder = segment.type === firstSegmentType && segment.isPlaceholder && Boolean(placeholder);
|
|
54703
54705
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateSegment, {
|
|
@@ -54931,7 +54933,7 @@ var Month2 = ({ children, className }) => {
|
|
|
54931
54933
|
const [isOpen, setIsOpen] = React173.useState(false);
|
|
54932
54934
|
const isForcedOpen = useIsForcedOpenDropdown(id6);
|
|
54933
54935
|
const [container, setContainer] = React173.useState(null);
|
|
54934
|
-
const placeholder = hidePlaceholder ?
|
|
54936
|
+
const placeholder = hidePlaceholder ? EMPTY_SELECT_PLACEHOLDER : t("field.date.placeholder.month");
|
|
54935
54937
|
const handleMonthChange = React173.useCallback((selectedValue) => {
|
|
54936
54938
|
if (readOnly) {
|
|
54937
54939
|
return;
|
|
@@ -55155,12 +55157,14 @@ var TimeLabel = ({ className }) => {
|
|
|
55155
55157
|
}, label);
|
|
55156
55158
|
};
|
|
55157
55159
|
var TimeInput = ({ children, className }) => {
|
|
55160
|
+
const { hidePlaceholder } = useFieldPropsV2();
|
|
55158
55161
|
const hourElement = findChildOfType(children, Time.Hour);
|
|
55159
55162
|
const minuteElement = findChildOfType(children, Time.Minute);
|
|
55160
55163
|
const periodElement = findChildOfType(children, Time.Period);
|
|
55161
55164
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateInput, {
|
|
55162
55165
|
className,
|
|
55163
|
-
"data-hook": "time"
|
|
55166
|
+
"data-hook": "time",
|
|
55167
|
+
"data-placeholder-hidden": hidePlaceholder || void 0
|
|
55164
55168
|
}, (segment) => {
|
|
55165
55169
|
switch (segment.type) {
|
|
55166
55170
|
case "hour":
|
|
@@ -55790,7 +55794,7 @@ var Dropdown = ({ children }) => {
|
|
|
55790
55794
|
isDisabled: disabled,
|
|
55791
55795
|
isInvalid: hasError,
|
|
55792
55796
|
isRequired: required,
|
|
55793
|
-
placeholder,
|
|
55797
|
+
placeholder: placeholder || EMPTY_SELECT_PLACEHOLDER,
|
|
55794
55798
|
onBlur,
|
|
55795
55799
|
onFocus
|
|
55796
55800
|
}, triggerElement, applyInternalProps(optionsElement, {
|
|
@@ -62860,13 +62864,14 @@ var TimeInput2 = ({ children }) => {
|
|
|
62860
62864
|
});
|
|
62861
62865
|
};
|
|
62862
62866
|
var Time2 = ({ children, className }) => {
|
|
62863
|
-
const { hasError } = useFieldPropsV2();
|
|
62867
|
+
const { hasError, hidePlaceholder } = useFieldPropsV2();
|
|
62864
62868
|
const hourElement = findChildOfType(children, Time2.Hour);
|
|
62865
62869
|
const minuteElement = findChildOfType(children, Time2.Minute);
|
|
62866
62870
|
const periodElement = findChildOfType(children, Time2.Period);
|
|
62867
62871
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateInput, {
|
|
62868
62872
|
className,
|
|
62869
|
-
"data-invalid": hasError || void 0
|
|
62873
|
+
"data-invalid": hasError || void 0,
|
|
62874
|
+
"data-placeholder-hidden": hidePlaceholder || void 0
|
|
62870
62875
|
}, (segment) => {
|
|
62871
62876
|
switch (segment.type) {
|
|
62872
62877
|
case "hour":
|