@reachfive/identity-ui 1.32.0 → 1.32.1

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/es/identity-ui.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @reachfive/identity-ui - v1.32.0
3
- * Compiled Wed, 05 Feb 2025 16:08:31 UTC
2
+ * @reachfive/identity-ui - v1.32.1
3
+ * Compiled Thu, 06 Feb 2025 17:46:27 UTC
4
4
  *
5
5
  * Copyright (c) ReachFive.
6
6
  *
@@ -6920,17 +6920,19 @@ const datetimeValidator = (locale) => new Validator({
6920
6920
  parameters: { format: dateFormat$2(locale) }
6921
6921
  });
6922
6922
  function dateField({
6923
+ format,
6923
6924
  key = "date",
6924
6925
  label = "date",
6925
- yearDebounce,
6926
6926
  locale,
6927
+ validator,
6928
+ yearDebounce,
6927
6929
  ...props
6928
6930
  }, config) {
6929
6931
  return createField({
6930
6932
  key,
6931
6933
  label,
6932
6934
  ...props,
6933
- format: {
6935
+ format: format ?? {
6934
6936
  bind: (value) => {
6935
6937
  const dt = value ? parseISO(value) : void 0;
6936
6938
  return dt && isValid(dt) ? { raw: dt } : void 0;
@@ -6939,7 +6941,7 @@ function dateField({
6939
6941
  return isRichFormValue(value, "raw") ? formatISO(value.raw) : value ? formatISO(value) : null;
6940
6942
  }
6941
6943
  },
6942
- validator: props.validator ? datetimeValidator(config.language).and(props.validator) : datetimeValidator(config.language),
6944
+ validator: validator ? datetimeValidator(config.language).and(validator) : datetimeValidator(config.language),
6943
6945
  component: DateField,
6944
6946
  extendedParams: {
6945
6947
  locale: locale ?? config.language,
@@ -6960,6 +6962,15 @@ function birthdateField({ min, max, label = "birthdate", ...props }, config) {
6960
6962
  return dateField({
6961
6963
  ...props,
6962
6964
  label,
6965
+ format: {
6966
+ bind: (value) => {
6967
+ const dt = value ? parseISO(value) : void 0;
6968
+ return dt && isValid(dt) ? { raw: dt } : void 0;
6969
+ },
6970
+ unbind: (value) => {
6971
+ return isRichFormValue(value, "raw") ? formatISO(value.raw, { representation: "date" }) : value ? formatISO(value, { representation: "date" }) : null;
6972
+ }
6973
+ },
6963
6974
  validator: ageLimitValidator(min, max)
6964
6975
  }, config);
6965
6976
  }