@astroapps/forms-core 2.0.0 → 2.0.2

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/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ensureMetaValue, newControl, updateComputedValue, addDependent, createAsyncEffect, createSyncEffect, trackedValue, collectChanges, getCurrentFields, createCleanupScope, createEffect, trackControlChange, ControlChange, createScopedEffect, updateElements } from '@astroapps/controls';
2
+ import { parseDateTime } from '@internationalized/date';
2
3
  import jsonata from 'jsonata';
3
4
  import { v4 } from 'uuid';
4
5
 
@@ -1021,11 +1022,17 @@ function getHasMoreControl(data) {
1021
1022
  }
1022
1023
 
1023
1024
  class DefaultSchemaInterface {
1024
- constructor(boolStrings = ["No", "Yes"], parseDateTime = s => Date.parse(s)) {
1025
+ constructor(boolStrings = ["No", "Yes"], parseDateTime$1 = s => {
1026
+ try {
1027
+ return parseDateTime(s).toDate("UTC").getTime();
1028
+ } catch (e) {
1029
+ return Number.NaN;
1030
+ }
1031
+ }) {
1025
1032
  this.boolStrings = void 0;
1026
1033
  this.parseDateTime = void 0;
1027
1034
  this.boolStrings = boolStrings;
1028
- this.parseDateTime = parseDateTime;
1035
+ this.parseDateTime = parseDateTime$1;
1029
1036
  }
1030
1037
  parseToMillis(field, v) {
1031
1038
  return this.parseDateTime(v);
@@ -2120,7 +2127,7 @@ function resolveArrayChildren(data, node, adjustChild) {
2120
2127
  const childCount = childNodes.length;
2121
2128
  const singleChild = childCount === 1 ? childNodes[0] : null;
2122
2129
  return data.control.as().elements.map((x, i) => ({
2123
- childKey: x.uniqueId,
2130
+ childKey: x.uniqueId + "/" + i,
2124
2131
  create: () => {
2125
2132
  var _adjustChild;
2126
2133
  return _extends({