@genesislcap/foundation-forms 14.180.1 → 14.180.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/dist/custom-elements.json +14 -0
- package/dist/dts/jsonforms/renderers/DateControlRenderer.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/types.d.ts +19 -0
- package/dist/dts/utils/types.d.ts.map +1 -0
- package/dist/esm/jsonforms/renderers/DateControlRenderer.js +18 -5
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/types.js +19 -0
- package/dist/foundation-forms.d.ts +19 -0
- package/docs/api-report.md +28 -0
- package/package.json +14 -14
|
@@ -1058,6 +1058,14 @@
|
|
|
1058
1058
|
"name": "*",
|
|
1059
1059
|
"package": "./validation"
|
|
1060
1060
|
}
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
"kind": "js",
|
|
1064
|
+
"name": "*",
|
|
1065
|
+
"declaration": {
|
|
1066
|
+
"name": "*",
|
|
1067
|
+
"package": "./types"
|
|
1068
|
+
}
|
|
1061
1069
|
}
|
|
1062
1070
|
]
|
|
1063
1071
|
},
|
|
@@ -1104,6 +1112,12 @@
|
|
|
1104
1112
|
}
|
|
1105
1113
|
]
|
|
1106
1114
|
},
|
|
1115
|
+
{
|
|
1116
|
+
"kind": "javascript-module",
|
|
1117
|
+
"path": "src/utils/types.ts",
|
|
1118
|
+
"declarations": [],
|
|
1119
|
+
"exports": []
|
|
1120
|
+
},
|
|
1107
1121
|
{
|
|
1108
1122
|
"kind": "javascript-module",
|
|
1109
1123
|
"path": "src/utils/validation.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateControlRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/DateControlRenderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateControlRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/DateControlRenderer.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,2BAA2B,YAAY,MAAM,6DAuCzD,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,GAMtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Needed to explicitly set as string as we don't want to let typescript set them as ascending numbers
|
|
4
|
+
* at runtime as we want to compare with the literal string values from the server
|
|
5
|
+
*/
|
|
6
|
+
export declare enum GenesisType {
|
|
7
|
+
STRING = "STRING",
|
|
8
|
+
ENUM = "ENUM",
|
|
9
|
+
INT = "INT",
|
|
10
|
+
SHORT = "SHORT",
|
|
11
|
+
DOUBLE = "DOUBLE",
|
|
12
|
+
LONG = "LONG",
|
|
13
|
+
BOOLEAN = "BOOLEAN",
|
|
14
|
+
BIGDECIMAL = "BIGDECIMAL",
|
|
15
|
+
DATE = "DATE",
|
|
16
|
+
DATETIME = "DATETIME",
|
|
17
|
+
RAW = "RAW"
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,GAAG,QAAQ;CACZ"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { mapStateToControlProps, rankWith } from '@jsonforms/core';
|
|
2
2
|
import { html } from '@microsoft/fast-element';
|
|
3
|
+
import { GenesisType } from '../../utils';
|
|
3
4
|
import { isOneOfDate } from '../testers/isDate';
|
|
4
5
|
import { DATE_CONTROL_RANK } from './RenderersRanks';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
const typeSwitch = (control) => { var _a; return ((_a = control.schema) === null || _a === void 0 ? void 0 : _a.genesisType) === GenesisType.DATETIME ? 'datetime-local' : 'date'; };
|
|
5
10
|
export const DateControlRendererTemplate = (prefix = 'zero') => html `
|
|
6
11
|
<template>
|
|
7
12
|
<control-wrapper
|
|
@@ -10,16 +15,24 @@ export const DateControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
10
15
|
?submitted=${(x) => x.submitted}
|
|
11
16
|
>
|
|
12
17
|
<${prefix}-text-field
|
|
13
|
-
:value=${(x) =>
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
:value=${(x) => {
|
|
19
|
+
const type = typeSwitch(x.control);
|
|
20
|
+
const formats = {
|
|
16
21
|
year: 'numeric',
|
|
17
22
|
month: '2-digit',
|
|
18
23
|
day: '2-digit',
|
|
19
24
|
timeZone: 'UTC',
|
|
20
|
-
}
|
|
25
|
+
};
|
|
26
|
+
if (type === 'datetime-local') {
|
|
27
|
+
formats.hour = '2-digit:'; // need the : otherwise the format is invalid
|
|
28
|
+
formats.minute = '2-digit';
|
|
29
|
+
}
|
|
30
|
+
return x.control.data === undefined || x.control.data === null
|
|
31
|
+
? ''
|
|
32
|
+
: new Intl.DateTimeFormat('fr-CA', formats).format(x.control.data);
|
|
33
|
+
}}
|
|
21
34
|
id=${(x) => x.control.path}
|
|
22
|
-
type="
|
|
35
|
+
type="${(x) => typeSwitch(x.control)}"
|
|
23
36
|
data-test-id=${(x) => x.control.path}
|
|
24
37
|
?required=${(x) => x.control.required}
|
|
25
38
|
?disabled=${(x) => !x.control.enabled}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Needed to explicitly set as string as we don't want to let typescript set them as ascending numbers
|
|
4
|
+
* at runtime as we want to compare with the literal string values from the server
|
|
5
|
+
*/
|
|
6
|
+
export var GenesisType;
|
|
7
|
+
(function (GenesisType) {
|
|
8
|
+
GenesisType["STRING"] = "STRING";
|
|
9
|
+
GenesisType["ENUM"] = "ENUM";
|
|
10
|
+
GenesisType["INT"] = "INT";
|
|
11
|
+
GenesisType["SHORT"] = "SHORT";
|
|
12
|
+
GenesisType["DOUBLE"] = "DOUBLE";
|
|
13
|
+
GenesisType["LONG"] = "LONG";
|
|
14
|
+
GenesisType["BOOLEAN"] = "BOOLEAN";
|
|
15
|
+
GenesisType["BIGDECIMAL"] = "BIGDECIMAL";
|
|
16
|
+
GenesisType["DATE"] = "DATE";
|
|
17
|
+
GenesisType["DATETIME"] = "DATETIME";
|
|
18
|
+
GenesisType["RAW"] = "RAW";
|
|
19
|
+
})(GenesisType || (GenesisType = {}));
|
|
@@ -695,6 +695,25 @@ export declare const foundationFormTemplate: ViewTemplate<Form, any>;
|
|
|
695
695
|
/** @public */
|
|
696
696
|
export declare const genesisErrorTranslator: ErrorTranslator;
|
|
697
697
|
|
|
698
|
+
/**
|
|
699
|
+
* @internal
|
|
700
|
+
* Needed to explicitly set as string as we don't want to let typescript set them as ascending numbers
|
|
701
|
+
* at runtime as we want to compare with the literal string values from the server
|
|
702
|
+
*/
|
|
703
|
+
export declare enum GenesisType {
|
|
704
|
+
STRING = "STRING",
|
|
705
|
+
ENUM = "ENUM",
|
|
706
|
+
INT = "INT",
|
|
707
|
+
SHORT = "SHORT",
|
|
708
|
+
DOUBLE = "DOUBLE",
|
|
709
|
+
LONG = "LONG",
|
|
710
|
+
BOOLEAN = "BOOLEAN",
|
|
711
|
+
BIGDECIMAL = "BIGDECIMAL",
|
|
712
|
+
DATE = "DATE",
|
|
713
|
+
DATETIME = "DATETIME",
|
|
714
|
+
RAW = "RAW"
|
|
715
|
+
}
|
|
716
|
+
|
|
698
717
|
/** @internal */
|
|
699
718
|
export declare const getPrefixedForm: (prefix: any) => ViewTemplate<Form, any>;
|
|
700
719
|
|
package/docs/api-report.md
CHANGED
|
@@ -138,6 +138,34 @@ export const foundationFormTemplate: ViewTemplate<Form, any>;
|
|
|
138
138
|
// @public (undocumented)
|
|
139
139
|
export const genesisErrorTranslator: ErrorTranslator;
|
|
140
140
|
|
|
141
|
+
// Warning: (ae-internal-missing-underscore) The name "GenesisType" should be prefixed with an underscore because the declaration is marked as @internal
|
|
142
|
+
//
|
|
143
|
+
// @internal
|
|
144
|
+
export enum GenesisType {
|
|
145
|
+
// (undocumented)
|
|
146
|
+
BIGDECIMAL = "BIGDECIMAL",
|
|
147
|
+
// (undocumented)
|
|
148
|
+
BOOLEAN = "BOOLEAN",
|
|
149
|
+
// (undocumented)
|
|
150
|
+
DATE = "DATE",
|
|
151
|
+
// (undocumented)
|
|
152
|
+
DATETIME = "DATETIME",
|
|
153
|
+
// (undocumented)
|
|
154
|
+
DOUBLE = "DOUBLE",
|
|
155
|
+
// (undocumented)
|
|
156
|
+
ENUM = "ENUM",
|
|
157
|
+
// (undocumented)
|
|
158
|
+
INT = "INT",
|
|
159
|
+
// (undocumented)
|
|
160
|
+
LONG = "LONG",
|
|
161
|
+
// (undocumented)
|
|
162
|
+
RAW = "RAW",
|
|
163
|
+
// (undocumented)
|
|
164
|
+
SHORT = "SHORT",
|
|
165
|
+
// (undocumented)
|
|
166
|
+
STRING = "STRING"
|
|
167
|
+
}
|
|
168
|
+
|
|
141
169
|
// Warning: (ae-internal-missing-underscore) The name "getPrefixedForm" should be prefixed with an underscore because the declaration is marked as @internal
|
|
142
170
|
//
|
|
143
171
|
// @internal (undocumented)
|
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.180.
|
|
4
|
+
"version": "14.180.2",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"test:debug": "genx test --debug"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@genesislcap/foundation-testing": "14.180.
|
|
44
|
-
"@genesislcap/genx": "14.180.
|
|
45
|
-
"@genesislcap/rollup-builder": "14.180.
|
|
46
|
-
"@genesislcap/ts-builder": "14.180.
|
|
47
|
-
"@genesislcap/uvu-playwright-builder": "14.180.
|
|
48
|
-
"@genesislcap/vite-builder": "14.180.
|
|
49
|
-
"@genesislcap/webpack-builder": "14.180.
|
|
43
|
+
"@genesislcap/foundation-testing": "14.180.2",
|
|
44
|
+
"@genesislcap/genx": "14.180.2",
|
|
45
|
+
"@genesislcap/rollup-builder": "14.180.2",
|
|
46
|
+
"@genesislcap/ts-builder": "14.180.2",
|
|
47
|
+
"@genesislcap/uvu-playwright-builder": "14.180.2",
|
|
48
|
+
"@genesislcap/vite-builder": "14.180.2",
|
|
49
|
+
"@genesislcap/webpack-builder": "14.180.2",
|
|
50
50
|
"@types/json-schema": "^7.0.11",
|
|
51
51
|
"rimraf": "^3.0.2"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@genesislcap/foundation-comms": "14.180.
|
|
55
|
-
"@genesislcap/foundation-criteria": "14.180.
|
|
56
|
-
"@genesislcap/foundation-logger": "14.180.
|
|
57
|
-
"@genesislcap/foundation-ui": "14.180.
|
|
58
|
-
"@genesislcap/foundation-utils": "14.180.
|
|
54
|
+
"@genesislcap/foundation-comms": "14.180.2",
|
|
55
|
+
"@genesislcap/foundation-criteria": "14.180.2",
|
|
56
|
+
"@genesislcap/foundation-logger": "14.180.2",
|
|
57
|
+
"@genesislcap/foundation-ui": "14.180.2",
|
|
58
|
+
"@genesislcap/foundation-utils": "14.180.2",
|
|
59
59
|
"@json-schema-tools/dereferencer": "^1.6.1",
|
|
60
60
|
"@jsonforms/core": "^3.2.1",
|
|
61
61
|
"@microsoft/fast-components": "^2.30.6",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
78
|
"customElements": "dist/custom-elements.json",
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "5fdd1837209acabc17881ad7062a2ec304df0b18"
|
|
80
80
|
}
|