@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.
@@ -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
  *
@@ -6941,17 +6941,19 @@ const datetimeValidator = (locale) => new Validator({
6941
6941
  parameters: { format: dateFormat$2(locale) }
6942
6942
  });
6943
6943
  function dateField({
6944
+ format,
6944
6945
  key = "date",
6945
6946
  label = "date",
6946
- yearDebounce,
6947
6947
  locale,
6948
+ validator,
6949
+ yearDebounce,
6948
6950
  ...props
6949
6951
  }, config) {
6950
6952
  return createField({
6951
6953
  key,
6952
6954
  label,
6953
6955
  ...props,
6954
- format: {
6956
+ format: format ?? {
6955
6957
  bind: (value) => {
6956
6958
  const dt = value ? dateFns.parseISO(value) : void 0;
6957
6959
  return dt && dateFns.isValid(dt) ? { raw: dt } : void 0;
@@ -6960,7 +6962,7 @@ function dateField({
6960
6962
  return isRichFormValue(value, "raw") ? dateFns.formatISO(value.raw) : value ? dateFns.formatISO(value) : null;
6961
6963
  }
6962
6964
  },
6963
- validator: props.validator ? datetimeValidator(config.language).and(props.validator) : datetimeValidator(config.language),
6965
+ validator: validator ? datetimeValidator(config.language).and(validator) : datetimeValidator(config.language),
6964
6966
  component: DateField,
6965
6967
  extendedParams: {
6966
6968
  locale: locale ?? config.language,
@@ -6981,6 +6983,15 @@ function birthdateField({ min, max, label = "birthdate", ...props }, config) {
6981
6983
  return dateField({
6982
6984
  ...props,
6983
6985
  label,
6986
+ format: {
6987
+ bind: (value) => {
6988
+ const dt = value ? dateFns.parseISO(value) : void 0;
6989
+ return dt && dateFns.isValid(dt) ? { raw: dt } : void 0;
6990
+ },
6991
+ unbind: (value) => {
6992
+ return isRichFormValue(value, "raw") ? dateFns.formatISO(value.raw, { representation: "date" }) : value ? dateFns.formatISO(value, { representation: "date" }) : null;
6993
+ }
6994
+ },
6984
6995
  validator: ageLimitValidator(min, max)
6985
6996
  }, config);
6986
6997
  }