@wix/form-public 0.524.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 +5 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -54156,17 +54156,16 @@ var hasDropdown = (field, isMobile2) => {
|
|
|
54156
54156
|
}
|
|
54157
54157
|
return DROPDOWN_FIELD_TYPES.includes(field.fieldType);
|
|
54158
54158
|
};
|
|
54159
|
-
var isOpenableDropdown = (field, isMobile2) => hasDropdown(field, isMobile2) && !field.properties.
|
|
54160
|
-
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;
|
|
54161
54160
|
var useIsForcedOpenDropdown = (fieldId) => {
|
|
54162
54161
|
const isOpenState = useElementProps().dropdown?.open === true;
|
|
54163
54162
|
const formView = React173.useContext(FormViewContext);
|
|
54164
54163
|
const { isMobile: isMobile2 = false } = useConfig();
|
|
54165
|
-
const
|
|
54164
|
+
const openableDropdownIds = React173.useMemo(() => formView && !formView.parentId ? formView.fields.filter((field) => isOpenableDropdown(field, isMobile2)).map((field) => field.id) : [], [
|
|
54166
54165
|
formView,
|
|
54167
54166
|
isMobile2
|
|
54168
54167
|
]);
|
|
54169
|
-
return isOpenState &&
|
|
54168
|
+
return isOpenState && openableDropdownIds.includes(fieldId);
|
|
54170
54169
|
};
|
|
54171
54170
|
var UNLIMITED_ROWS = Infinity;
|
|
54172
54171
|
var MAX_HEIGHT_PROBE_STYLE = {
|
|
@@ -61281,11 +61280,11 @@ var SignaturePad = class _SignaturePad extends SignatureEventTarget {
|
|
|
61281
61280
|
var useId2 = typeof React173__default.default.useId === "function" ? React173__default.default.useId : () => React173.useRef(generateUUID()).current;
|
|
61282
61281
|
var hasUploadTab = ({ properties }) => properties.uploadEnabled === true;
|
|
61283
61282
|
var isForceableSignature = (field, mode) => field.fieldType === FIELD_TYPES.SIGNATURE && !field.properties.hidden && !field.properties.disabled && !field.properties.readOnly && (mode !== "upload" || hasUploadTab(field));
|
|
61284
|
-
var
|
|
61283
|
+
var byLayoutPosition = (first2, second) => first2.layout.row - second.layout.row || first2.layout.column - second.layout.column;
|
|
61285
61284
|
var useForcedSignatureMode = (fieldId) => {
|
|
61286
61285
|
const forcedMode = useElementProps().signatureContainer?.signatureMode;
|
|
61287
61286
|
const formView = React173.useContext(FormViewContext);
|
|
61288
|
-
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, [
|
|
61289
61288
|
formView,
|
|
61290
61289
|
forcedMode
|
|
61291
61290
|
]);
|