@wix/form-public 0.523.0 → 0.525.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 +17 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -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) => {
|
|
@@ -54155,17 +54156,16 @@ var hasDropdown = (field, isMobile2) => {
|
|
|
54155
54156
|
}
|
|
54156
54157
|
return DROPDOWN_FIELD_TYPES.includes(field.fieldType);
|
|
54157
54158
|
};
|
|
54158
|
-
var isOpenableDropdown = (field, isMobile2) => hasDropdown(field, isMobile2) && !field.properties.
|
|
54159
|
-
var byLayoutPosition = (first2, second) => first2.layout.row - second.layout.row || first2.layout.column - second.layout.column;
|
|
54159
|
+
var isOpenableDropdown = (field, isMobile2) => hasDropdown(field, isMobile2) && !field.properties.disabled && !field.properties.readOnly;
|
|
54160
54160
|
var useIsForcedOpenDropdown = (fieldId) => {
|
|
54161
54161
|
const isOpenState = useElementProps().dropdown?.open === true;
|
|
54162
54162
|
const formView = React173.useContext(FormViewContext);
|
|
54163
54163
|
const { isMobile: isMobile2 = false } = useConfig();
|
|
54164
|
-
const
|
|
54164
|
+
const openableDropdownIds = React173.useMemo(() => formView && !formView.parentId ? formView.fields.filter((field) => isOpenableDropdown(field, isMobile2)).map((field) => field.id) : [], [
|
|
54165
54165
|
formView,
|
|
54166
54166
|
isMobile2
|
|
54167
54167
|
]);
|
|
54168
|
-
return isOpenState &&
|
|
54168
|
+
return isOpenState && openableDropdownIds.includes(fieldId);
|
|
54169
54169
|
};
|
|
54170
54170
|
var UNLIMITED_ROWS = Infinity;
|
|
54171
54171
|
var MAX_HEIGHT_PROBE_STYLE = {
|
|
@@ -54331,7 +54331,7 @@ var Month = ({ children, className }) => {
|
|
|
54331
54331
|
const [isOpen, setIsOpen] = React173.useState(false);
|
|
54332
54332
|
const isForcedOpen = useIsForcedOpenDropdown(id6);
|
|
54333
54333
|
const [container, setContainer] = React173.useState(null);
|
|
54334
|
-
const placeholder = hidePlaceholder ?
|
|
54334
|
+
const placeholder = hidePlaceholder ? EMPTY_SELECT_PLACEHOLDER : t("field.date.placeholder.month");
|
|
54335
54335
|
const handleMonthChange = React173.useCallback((selectedValue) => {
|
|
54336
54336
|
if (readOnly) {
|
|
54337
54337
|
return;
|
|
@@ -54697,7 +54697,8 @@ var Input2 = ({ className }) => {
|
|
|
54697
54697
|
regionalFormat
|
|
54698
54698
|
]);
|
|
54699
54699
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateInput, {
|
|
54700
|
-
className
|
|
54700
|
+
className,
|
|
54701
|
+
"data-placeholder-hidden": !placeholder || void 0
|
|
54701
54702
|
}, (segment) => {
|
|
54702
54703
|
const showCustomPlaceholder = segment.type === firstSegmentType && segment.isPlaceholder && Boolean(placeholder);
|
|
54703
54704
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateSegment, {
|
|
@@ -54931,7 +54932,7 @@ var Month2 = ({ children, className }) => {
|
|
|
54931
54932
|
const [isOpen, setIsOpen] = React173.useState(false);
|
|
54932
54933
|
const isForcedOpen = useIsForcedOpenDropdown(id6);
|
|
54933
54934
|
const [container, setContainer] = React173.useState(null);
|
|
54934
|
-
const placeholder = hidePlaceholder ?
|
|
54935
|
+
const placeholder = hidePlaceholder ? EMPTY_SELECT_PLACEHOLDER : t("field.date.placeholder.month");
|
|
54935
54936
|
const handleMonthChange = React173.useCallback((selectedValue) => {
|
|
54936
54937
|
if (readOnly) {
|
|
54937
54938
|
return;
|
|
@@ -55155,12 +55156,14 @@ var TimeLabel = ({ className }) => {
|
|
|
55155
55156
|
}, label);
|
|
55156
55157
|
};
|
|
55157
55158
|
var TimeInput = ({ children, className }) => {
|
|
55159
|
+
const { hidePlaceholder } = useFieldPropsV2();
|
|
55158
55160
|
const hourElement = findChildOfType(children, Time.Hour);
|
|
55159
55161
|
const minuteElement = findChildOfType(children, Time.Minute);
|
|
55160
55162
|
const periodElement = findChildOfType(children, Time.Period);
|
|
55161
55163
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateInput, {
|
|
55162
55164
|
className,
|
|
55163
|
-
"data-hook": "time"
|
|
55165
|
+
"data-hook": "time",
|
|
55166
|
+
"data-placeholder-hidden": hidePlaceholder || void 0
|
|
55164
55167
|
}, (segment) => {
|
|
55165
55168
|
switch (segment.type) {
|
|
55166
55169
|
case "hour":
|
|
@@ -55790,7 +55793,7 @@ var Dropdown = ({ children }) => {
|
|
|
55790
55793
|
isDisabled: disabled,
|
|
55791
55794
|
isInvalid: hasError,
|
|
55792
55795
|
isRequired: required,
|
|
55793
|
-
placeholder,
|
|
55796
|
+
placeholder: placeholder || EMPTY_SELECT_PLACEHOLDER,
|
|
55794
55797
|
onBlur,
|
|
55795
55798
|
onFocus
|
|
55796
55799
|
}, triggerElement, applyInternalProps(optionsElement, {
|
|
@@ -61277,11 +61280,11 @@ var SignaturePad = class _SignaturePad extends SignatureEventTarget {
|
|
|
61277
61280
|
var useId2 = typeof React173__default.default.useId === "function" ? React173__default.default.useId : () => React173.useRef(generateUUID()).current;
|
|
61278
61281
|
var hasUploadTab = ({ properties }) => properties.uploadEnabled === true;
|
|
61279
61282
|
var isForceableSignature = (field, mode) => field.fieldType === FIELD_TYPES.SIGNATURE && !field.properties.hidden && !field.properties.disabled && !field.properties.readOnly && (mode !== "upload" || hasUploadTab(field));
|
|
61280
|
-
var
|
|
61283
|
+
var byLayoutPosition = (first2, second) => first2.layout.row - second.layout.row || first2.layout.column - second.layout.column;
|
|
61281
61284
|
var useForcedSignatureMode = (fieldId) => {
|
|
61282
61285
|
const forcedMode = useElementProps().signatureContainer?.signatureMode;
|
|
61283
61286
|
const formView = React173.useContext(FormViewContext);
|
|
61284
|
-
const firstSignatureId = React173.useMemo(() => formView && !formView.parentId && forcedMode ? formView.fields.filter((field) => isForceableSignature(field, forcedMode)).sort(
|
|
61287
|
+
const firstSignatureId = React173.useMemo(() => formView && !formView.parentId && forcedMode ? formView.fields.filter((field) => isForceableSignature(field, forcedMode)).sort(byLayoutPosition)[0]?.id : void 0, [
|
|
61285
61288
|
formView,
|
|
61286
61289
|
forcedMode
|
|
61287
61290
|
]);
|
|
@@ -62860,13 +62863,14 @@ var TimeInput2 = ({ children }) => {
|
|
|
62860
62863
|
});
|
|
62861
62864
|
};
|
|
62862
62865
|
var Time2 = ({ children, className }) => {
|
|
62863
|
-
const { hasError } = useFieldPropsV2();
|
|
62866
|
+
const { hasError, hidePlaceholder } = useFieldPropsV2();
|
|
62864
62867
|
const hourElement = findChildOfType(children, Time2.Hour);
|
|
62865
62868
|
const minuteElement = findChildOfType(children, Time2.Minute);
|
|
62866
62869
|
const periodElement = findChildOfType(children, Time2.Period);
|
|
62867
62870
|
return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.DateInput, {
|
|
62868
62871
|
className,
|
|
62869
|
-
"data-invalid": hasError || void 0
|
|
62872
|
+
"data-invalid": hasError || void 0,
|
|
62873
|
+
"data-placeholder-hidden": hidePlaceholder || void 0
|
|
62870
62874
|
}, (segment) => {
|
|
62871
62875
|
switch (segment.type) {
|
|
62872
62876
|
case "hour":
|