@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.js CHANGED
@@ -14763,12 +14763,25 @@ var init_form_validator = __esm({
14763
14763
  }))));
14764
14764
  const addressForms = this.getAddressForms(currentlyValidatableForm, submission);
14765
14765
  const objectArrayForms = this.getObjectArrayForms(currentlyValidatableForm);
14766
- return createAjvSchemaValidator([
14766
+ const ajv = createAjvSchemaValidator([
14767
14767
  ...this.formSchemas,
14768
14768
  ...nestedForms,
14769
14769
  ...addressForms,
14770
14770
  ...objectArrayForms
14771
14771
  ]);
14772
+ this.addPlaceholdersForMissingDeletedAddressForms(ajv, currentlyValidatableForm);
14773
+ return ajv;
14774
+ }
14775
+ // A deleted address field still references its address form. Without that
14776
+ // form the schema cannot compile, so accept any value for the field instead.
14777
+ addPlaceholdersForMissingDeletedAddressForms(ajv, form) {
14778
+ (form.deletedFields ?? []).filter((field) => field.target && field.validation?.predefined?.format === ValidationFormat.MULTILINE_ADDRESS).forEach((field) => {
14779
+ if (!ajv.getSchema(field.target)) {
14780
+ ajv.addSchema({
14781
+ $id: field.target
14782
+ });
14783
+ }
14784
+ });
14772
14785
  }
14773
14786
  // eslint-disable-next-line max-params
14774
14787
  constructor(formSchemas, validationMode, platformisedFieldBasedValidation = false, addressFormProvider = () => void 0, submissionValueProvider, lenientPhoneValidation = false) {
@@ -61029,7 +61042,7 @@ ProductList.Description = Description;
61029
61042
  ProductList.Error = Error2;
61030
61043
  var RatingInput = ({ children }) => {
61031
61044
  const { id: id6, value, onChange, disabled, readOnly, required, hasError, onBlur, onFocus, FieldLayout } = useFieldPropsV2();
61032
- const { labelId } = useFieldAttributes();
61045
+ const { labelId, ariaDescribedBy } = useFieldAttributes();
61033
61046
  const handleChange = useCallback((selectedValue) => onChange(Number(selectedValue)), [
61034
61047
  onChange
61035
61048
  ]);
@@ -61042,6 +61055,7 @@ var RatingInput = ({ children }) => {
61042
61055
  renderLabel: () => labelElement,
61043
61056
  renderInput: () => /* @__PURE__ */ React172.createElement(RadioGroup$1, {
61044
61057
  "aria-labelledby": labelId,
61058
+ "aria-describedby": ariaDescribedBy,
61045
61059
  value: value ? String(value) : void 0,
61046
61060
  onChange: handleChange,
61047
61061
  isDisabled: disabled,
@@ -61057,7 +61071,7 @@ var RatingInput = ({ children }) => {
61057
61071
  };
61058
61072
  var Ratings = ({ children, className, getReactionLabel }) => {
61059
61073
  const { value, readOnly, hasError } = useFieldPropsV2();
61060
- const { inputId, ariaDescribedBy } = useFieldAttributes();
61074
+ const { inputId } = useFieldAttributes();
61061
61075
  const [hovered, setHovered] = useState();
61062
61076
  const containerRef = useRef(null);
61063
61077
  const ratingElement = findChildOfType(children, Ratings.Rating);
@@ -61072,7 +61086,6 @@ var Ratings = ({ children, className, getReactionLabel }) => {
61072
61086
  return /* @__PURE__ */ React172.createElement("div", {
61073
61087
  ref: containerRef,
61074
61088
  id: inputId,
61075
- "aria-describedby": ariaDescribedBy,
61076
61089
  className,
61077
61090
  "data-invalid": hasError,
61078
61091
  "data-readonly": readOnly