@wix/form-public 0.550.0 → 0.552.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 CHANGED
@@ -14773,12 +14773,25 @@ var init_form_validator = __esm({
14773
14773
  }))));
14774
14774
  const addressForms = this.getAddressForms(currentlyValidatableForm, submission);
14775
14775
  const objectArrayForms = this.getObjectArrayForms(currentlyValidatableForm);
14776
- return createAjvSchemaValidator([
14776
+ const ajv = createAjvSchemaValidator([
14777
14777
  ...this.formSchemas,
14778
14778
  ...nestedForms,
14779
14779
  ...addressForms,
14780
14780
  ...objectArrayForms
14781
14781
  ]);
14782
+ this.addPlaceholdersForMissingDeletedAddressForms(ajv, currentlyValidatableForm);
14783
+ return ajv;
14784
+ }
14785
+ // A deleted address field still references its address form. Without that
14786
+ // form the schema cannot compile, so accept any value for the field instead.
14787
+ addPlaceholdersForMissingDeletedAddressForms(ajv, form) {
14788
+ (form.deletedFields ?? []).filter((field) => field.target && field.validation?.predefined?.format === types$1.ValidationFormat.MULTILINE_ADDRESS).forEach((field) => {
14789
+ if (!ajv.getSchema(field.target)) {
14790
+ ajv.addSchema({
14791
+ $id: field.target
14792
+ });
14793
+ }
14794
+ });
14782
14795
  }
14783
14796
  // eslint-disable-next-line max-params
14784
14797
  constructor(formSchemas, validationMode, platformisedFieldBasedValidation = false, addressFormProvider = () => void 0, submissionValueProvider, lenientPhoneValidation = false) {
@@ -61039,7 +61052,7 @@ ProductList.Description = Description;
61039
61052
  ProductList.Error = Error2;
61040
61053
  var RatingInput = ({ children }) => {
61041
61054
  const { id: id6, value, onChange, disabled, readOnly, required, hasError, onBlur, onFocus, FieldLayout } = useFieldPropsV2();
61042
- const { labelId } = useFieldAttributes();
61055
+ const { labelId, ariaDescribedBy } = useFieldAttributes();
61043
61056
  const handleChange = React172.useCallback((selectedValue) => onChange(Number(selectedValue)), [
61044
61057
  onChange
61045
61058
  ]);
@@ -61052,6 +61065,7 @@ var RatingInput = ({ children }) => {
61052
61065
  renderLabel: () => labelElement,
61053
61066
  renderInput: () => /* @__PURE__ */ React172__default.default.createElement(reactAriaComponents.RadioGroup, {
61054
61067
  "aria-labelledby": labelId,
61068
+ "aria-describedby": ariaDescribedBy,
61055
61069
  value: value ? String(value) : void 0,
61056
61070
  onChange: handleChange,
61057
61071
  isDisabled: disabled,
@@ -61067,7 +61081,7 @@ var RatingInput = ({ children }) => {
61067
61081
  };
61068
61082
  var Ratings = ({ children, className, getReactionLabel }) => {
61069
61083
  const { value, readOnly, hasError } = useFieldPropsV2();
61070
- const { inputId, ariaDescribedBy } = useFieldAttributes();
61084
+ const { inputId } = useFieldAttributes();
61071
61085
  const [hovered, setHovered] = React172.useState();
61072
61086
  const containerRef = React172.useRef(null);
61073
61087
  const ratingElement = findChildOfType(children, Ratings.Rating);
@@ -61082,7 +61096,6 @@ var Ratings = ({ children, className, getReactionLabel }) => {
61082
61096
  return /* @__PURE__ */ React172__default.default.createElement("div", {
61083
61097
  ref: containerRef,
61084
61098
  id: inputId,
61085
- "aria-describedby": ariaDescribedBy,
61086
61099
  className,
61087
61100
  "data-invalid": hasError,
61088
61101
  "data-readonly": readOnly