@genesislcap/foundation-forms 14.293.1 → 14.293.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.
@@ -1 +1 @@
1
- {"version":3,"file":"DateControlRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/DateControlRenderer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkB5C,eAAO,MAAM,2BAA2B,YAAY,MAAM,6DAyCzD,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,aAMtC,CAAC"}
1
+ {"version":3,"file":"DateControlRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/DateControlRenderer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkB5C,eAAO,MAAM,2BAA2B,YAAY,MAAM,6DA+CzD,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,aAMtC,CAAC"}
@@ -32,12 +32,12 @@ export const DateControlRendererTemplate = (prefix = 'zero') => html `
32
32
  const type = typeSwitch(x.control);
33
33
  const date = new Date(x.control.data);
34
34
  const padded = (dateComponent) => dateComponent.toString().padStart(2, '0');
35
- const year = date.getUTCFullYear();
36
- const month = padded(date.getUTCMonth() + 1);
37
- const day = padded(date.getUTCDate());
38
- const hour = padded(date.getUTCHours());
39
- const minute = padded(date.getUTCMinutes());
40
- return (`${year}-${month}-${day}` + (type === 'datetime-local' ? ` ${hour}:${minute}` : ''));
35
+ const year = date.getFullYear();
36
+ const month = padded(date.getMonth() + 1);
37
+ const day = padded(date.getDate());
38
+ const hour = padded(date.getHours());
39
+ const minute = padded(date.getMinutes());
40
+ return (`${year}-${month}-${day}` + (type === 'datetime-local' ? `T${hour}:${minute}` : ''));
41
41
  }}
42
42
  id=${(x) => x.control.path}
43
43
  type="${(x) => typeSwitch(x.control)}"
@@ -45,9 +45,16 @@ export const DateControlRendererTemplate = (prefix = 'zero') => html `
45
45
  ?required=${(x) => x.control.required}
46
46
  ?disabled=${(x) => !x.control.enabled}
47
47
  @blur=${(x, c) => {
48
- const dateValue = c.event.target.control.valueAsNumber;
48
+ const target = c.event.target;
49
+ const inputValue = target.value;
49
50
  x.onBlur();
50
- x.control.handleChange(x.control.path, !isNaN(dateValue) ? dateValue : undefined);
51
+ if (inputValue) {
52
+ const timestamp = new Date(inputValue).getTime();
53
+ x.control.handleChange(x.control.path, timestamp);
54
+ }
55
+ else {
56
+ x.control.handleChange(x.control.path, undefined);
57
+ }
51
58
  }}"
52
59
  style="width: 100%"
53
60
  ></${prefix}-text-field>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-forms",
3
3
  "description": "Genesis Foundation Forms",
4
- "version": "14.293.1",
4
+ "version": "14.293.2",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -48,23 +48,23 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@genesislcap/foundation-testing": "14.293.1",
52
- "@genesislcap/genx": "14.293.1",
53
- "@genesislcap/rollup-builder": "14.293.1",
54
- "@genesislcap/ts-builder": "14.293.1",
55
- "@genesislcap/uvu-playwright-builder": "14.293.1",
56
- "@genesislcap/vite-builder": "14.293.1",
57
- "@genesislcap/webpack-builder": "14.293.1",
51
+ "@genesislcap/foundation-testing": "14.293.2",
52
+ "@genesislcap/genx": "14.293.2",
53
+ "@genesislcap/rollup-builder": "14.293.2",
54
+ "@genesislcap/ts-builder": "14.293.2",
55
+ "@genesislcap/uvu-playwright-builder": "14.293.2",
56
+ "@genesislcap/vite-builder": "14.293.2",
57
+ "@genesislcap/webpack-builder": "14.293.2",
58
58
  "@types/json-schema": "^7.0.11",
59
59
  "rimraf": "^5.0.0"
60
60
  },
61
61
  "dependencies": {
62
- "@genesislcap/foundation-comms": "14.293.1",
63
- "@genesislcap/foundation-criteria": "14.293.1",
64
- "@genesislcap/foundation-logger": "14.293.1",
65
- "@genesislcap/foundation-notifications": "14.293.1",
66
- "@genesislcap/foundation-ui": "14.293.1",
67
- "@genesislcap/foundation-utils": "14.293.1",
62
+ "@genesislcap/foundation-comms": "14.293.2",
63
+ "@genesislcap/foundation-criteria": "14.293.2",
64
+ "@genesislcap/foundation-logger": "14.293.2",
65
+ "@genesislcap/foundation-notifications": "14.293.2",
66
+ "@genesislcap/foundation-ui": "14.293.2",
67
+ "@genesislcap/foundation-utils": "14.293.2",
68
68
  "@json-schema-tools/dereferencer": "^1.6.1",
69
69
  "@jsonforms/core": "^3.2.1",
70
70
  "@microsoft/fast-components": "2.30.6",
@@ -86,5 +86,5 @@
86
86
  "access": "public"
87
87
  },
88
88
  "customElements": "dist/custom-elements.json",
89
- "gitHead": "79f870205c14e857233724904d5eb8e034d2a72e"
89
+ "gitHead": "a5107ae0a1670f5ed14eef84504d7e16385a0601"
90
90
  }