@gcforms/types 0.0.7 → 0.0.8
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/package.json +2 -17
- package/dist/types/cjs/index.d.ts +0 -2
- package/dist/types/esm/form-response-types.d.ts +0 -9
- package/dist/types/esm/form-types.d.ts +0 -165
- package/dist/types/esm/index.d.ts +0 -2
- /package/dist/types/{cjs/form-response-types.d.ts → form-response-types.d.ts} +0 -0
- /package/dist/types/{cjs/form-types.d.ts → form-types.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gcforms/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"author": "Canadian Digital Service",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,21 +10,6 @@
|
|
|
10
10
|
"main": "./dist/cjs/index.js",
|
|
11
11
|
"module": "./dist/esm/index.js",
|
|
12
12
|
"types": "./dist/types/index.d.ts",
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"import": "./dist/esm/index.js",
|
|
16
|
-
"require": "./dist/cjs/index.js",
|
|
17
|
-
"types": "./dist/types/index.d.ts"
|
|
18
|
-
},
|
|
19
|
-
"./cjs": {
|
|
20
|
-
"require": "./dist/cjs/index.js",
|
|
21
|
-
"types": "./dist/types/cjs/index.d.ts"
|
|
22
|
-
},
|
|
23
|
-
"./esm": {
|
|
24
|
-
"import": "./dist/esm/index.js",
|
|
25
|
-
"types": "./dist/types/esm/index.d.ts"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
13
|
"files": [
|
|
29
14
|
"dist",
|
|
30
15
|
"package.json"
|
|
@@ -32,7 +17,7 @@
|
|
|
32
17
|
"scripts": {
|
|
33
18
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
34
19
|
"build:esm": "tsc -p tsconfig.esm.json",
|
|
35
|
-
"build": "rm -rf dist && yarn build:cjs && yarn build:esm
|
|
20
|
+
"build": "rm -rf dist && yarn build:cjs && yarn build:esm",
|
|
36
21
|
"prepare": "yarn build"
|
|
37
22
|
},
|
|
38
23
|
"dependencies": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { FormElementTypes, type dynamicRowType, type FormElement, type Group, type ElementProperties, type PropertyChoices, type BrandProperties, type DeliveryOption, type ConditionalRule, type FormRecord, type SecurityAttribute, type FormPurpose, type PublicFormRecord, type ValidationProperties, type FormProperties, type AddressComponents, type ClosedDetails, } from "./form-types.js";
|
|
2
|
-
export type { Response, Responses, FileInputResponse } from "./form-response-types.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type Responses = {
|
|
2
|
-
[key: string]: Response;
|
|
3
|
-
};
|
|
4
|
-
export type Response = string | string[] | number | Record<string, unknown>[] | FileInputResponse | FileInputResponse[] | Record<string, unknown>;
|
|
5
|
-
export type FileInputResponse = {
|
|
6
|
-
name: string | null;
|
|
7
|
-
size: number | null;
|
|
8
|
-
based64EncodedFile: string | null;
|
|
9
|
-
};
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
export type TypeOmit<Type, Key extends PropertyKey> = {
|
|
2
|
-
[Property in keyof Type as Exclude<Property, Key>]: Type[Property];
|
|
3
|
-
};
|
|
4
|
-
export type FormChangeEvent = {
|
|
5
|
-
target: {
|
|
6
|
-
value: string | number | boolean | string[];
|
|
7
|
-
name?: string;
|
|
8
|
-
type?: string;
|
|
9
|
-
checked?: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type Group = {
|
|
13
|
-
name: string;
|
|
14
|
-
titleEn: string;
|
|
15
|
-
titleFr: string;
|
|
16
|
-
nextAction?: string | NextActionRule[];
|
|
17
|
-
elements: string[];
|
|
18
|
-
autoFlow?: boolean;
|
|
19
|
-
exitUrlEn?: string;
|
|
20
|
-
exitUrlFr?: string;
|
|
21
|
-
};
|
|
22
|
-
export type GroupsType = Record<string, Group>;
|
|
23
|
-
export type FormValues = Record<string, string | string[]>;
|
|
24
|
-
export type ChoiceRule = {
|
|
25
|
-
elementId: string;
|
|
26
|
-
choiceId: string;
|
|
27
|
-
};
|
|
28
|
-
export type NextActionRule = {
|
|
29
|
-
groupId: string;
|
|
30
|
-
choiceId: string;
|
|
31
|
-
};
|
|
32
|
-
export type HTMLTextInputTypeAttribute = "text" | "email" | "name" | "number" | "password" | "search" | "tel" | "url";
|
|
33
|
-
export declare enum FormElementTypes {
|
|
34
|
-
textField = "textField",
|
|
35
|
-
textArea = "textArea",
|
|
36
|
-
dropdown = "dropdown",
|
|
37
|
-
radio = "radio",
|
|
38
|
-
checkbox = "checkbox",
|
|
39
|
-
fileInput = "fileInput",
|
|
40
|
-
richText = "richText",
|
|
41
|
-
dynamicRow = "dynamicRow",
|
|
42
|
-
attestation = "attestation",
|
|
43
|
-
address = "address",
|
|
44
|
-
addressComplete = "addressComplete",
|
|
45
|
-
name = "name",
|
|
46
|
-
firstMiddleLastName = "firstMiddleLastName",
|
|
47
|
-
departments = "departments",
|
|
48
|
-
contact = "contact",
|
|
49
|
-
combobox = "combobox",
|
|
50
|
-
formattedDate = "formattedDate"
|
|
51
|
-
}
|
|
52
|
-
export type ConditionalRule = {
|
|
53
|
-
choiceId: string;
|
|
54
|
-
};
|
|
55
|
-
export interface ValidationProperties {
|
|
56
|
-
required: boolean;
|
|
57
|
-
type?: HTMLTextInputTypeAttribute;
|
|
58
|
-
regex?: string;
|
|
59
|
-
maxLength?: number;
|
|
60
|
-
descriptionEN?: string;
|
|
61
|
-
descriptionFR?: string;
|
|
62
|
-
[key: string]: unknown;
|
|
63
|
-
}
|
|
64
|
-
export interface PropertyChoices {
|
|
65
|
-
en: string;
|
|
66
|
-
fr: string;
|
|
67
|
-
[key: string]: string;
|
|
68
|
-
}
|
|
69
|
-
export type AddressComponents = {
|
|
70
|
-
canadianOnly?: boolean;
|
|
71
|
-
splitAddress?: boolean;
|
|
72
|
-
};
|
|
73
|
-
export interface DeliveryOption {
|
|
74
|
-
emailAddress: string;
|
|
75
|
-
emailSubjectEn?: string;
|
|
76
|
-
emailSubjectFr?: string;
|
|
77
|
-
[key: string]: string | undefined;
|
|
78
|
-
}
|
|
79
|
-
export interface ElementProperties {
|
|
80
|
-
titleEn: string;
|
|
81
|
-
titleFr: string;
|
|
82
|
-
placeholderEn?: string;
|
|
83
|
-
placeholderFr?: string;
|
|
84
|
-
descriptionEn?: string;
|
|
85
|
-
descriptionFr?: string;
|
|
86
|
-
validation?: ValidationProperties | undefined;
|
|
87
|
-
choices?: PropertyChoices[];
|
|
88
|
-
managedChoices?: string;
|
|
89
|
-
subElements?: FormElement[];
|
|
90
|
-
fileType?: string | undefined;
|
|
91
|
-
headingLevel?: string | undefined;
|
|
92
|
-
isSectional?: boolean;
|
|
93
|
-
maxNumberOfRows?: number;
|
|
94
|
-
autoComplete?: string;
|
|
95
|
-
dateFormat?: string;
|
|
96
|
-
conditionalRules?: ConditionalRule[];
|
|
97
|
-
full?: boolean;
|
|
98
|
-
addressComponents?: AddressComponents | undefined;
|
|
99
|
-
dynamicRow?: dynamicRowType;
|
|
100
|
-
[key: string]: string | number | boolean | Array<PropertyChoices> | Array<FormElement> | ValidationProperties | Array<ConditionalRule> | AddressComponents | dynamicRowType | undefined;
|
|
101
|
-
}
|
|
102
|
-
export interface BrandProperties {
|
|
103
|
-
name?: string;
|
|
104
|
-
logoEn: string;
|
|
105
|
-
logoFr: string;
|
|
106
|
-
logoTitleEn: string;
|
|
107
|
-
logoTitleFr: string;
|
|
108
|
-
urlEn?: string;
|
|
109
|
-
urlFr?: string;
|
|
110
|
-
disableGcBranding?: boolean;
|
|
111
|
-
[key: string]: string | boolean | undefined;
|
|
112
|
-
}
|
|
113
|
-
export interface FormElement {
|
|
114
|
-
id: number;
|
|
115
|
-
subId?: string;
|
|
116
|
-
type: FormElementTypes;
|
|
117
|
-
properties: ElementProperties;
|
|
118
|
-
onchange?: (event: FormChangeEvent) => void;
|
|
119
|
-
brand?: BrandProperties;
|
|
120
|
-
}
|
|
121
|
-
export interface FormProperties {
|
|
122
|
-
titleEn: string;
|
|
123
|
-
titleFr: string;
|
|
124
|
-
introduction?: Record<string, string>;
|
|
125
|
-
privacyPolicy?: Record<string, string>;
|
|
126
|
-
confirmation?: Record<string, string>;
|
|
127
|
-
closedMessage?: Record<string, string>;
|
|
128
|
-
layout: number[];
|
|
129
|
-
groups?: GroupsType;
|
|
130
|
-
groupsLayout?: string[];
|
|
131
|
-
elements: FormElement[];
|
|
132
|
-
lastGeneratedElementId?: number;
|
|
133
|
-
brand?: BrandProperties;
|
|
134
|
-
formPurpose?: string;
|
|
135
|
-
[key: string]: string | number | boolean | Array<string | number | FormElement> | Record<string, string> | BrandProperties | GroupsType | undefined;
|
|
136
|
-
}
|
|
137
|
-
export type dynamicRowType = {
|
|
138
|
-
rowTitleEn: string;
|
|
139
|
-
rowTitleFr: string;
|
|
140
|
-
addButtonTextEn: string;
|
|
141
|
-
removeButtonTextEn: string;
|
|
142
|
-
addButtonTextFr: string;
|
|
143
|
-
removeButtonTextFr: string;
|
|
144
|
-
};
|
|
145
|
-
export type FormRecord = {
|
|
146
|
-
id: string;
|
|
147
|
-
createdAt?: string;
|
|
148
|
-
updatedAt?: string;
|
|
149
|
-
name: string;
|
|
150
|
-
form: FormProperties;
|
|
151
|
-
isPublished: boolean;
|
|
152
|
-
deliveryOption?: DeliveryOption;
|
|
153
|
-
securityAttribute: SecurityAttribute;
|
|
154
|
-
closingDate?: string;
|
|
155
|
-
closedDetails?: ClosedDetails;
|
|
156
|
-
saveAndResume?: boolean;
|
|
157
|
-
[key: string]: string | boolean | FormProperties | DeliveryOption | ClosedDetails | undefined;
|
|
158
|
-
};
|
|
159
|
-
export type SecurityAttribute = "Unclassified" | "Protected A" | "Protected B";
|
|
160
|
-
export type FormPurpose = "" | "admin" | "nonAdmin";
|
|
161
|
-
export type ClosedDetails = {
|
|
162
|
-
messageEn?: string;
|
|
163
|
-
messageFr?: string;
|
|
164
|
-
};
|
|
165
|
-
export type PublicFormRecord = TypeOmit<FormRecord, "name" | "deliveryOption">;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { FormElementTypes, type dynamicRowType, type FormElement, type Group, type ElementProperties, type PropertyChoices, type BrandProperties, type DeliveryOption, type ConditionalRule, type FormRecord, type SecurityAttribute, type FormPurpose, type PublicFormRecord, type ValidationProperties, type FormProperties, type AddressComponents, type ClosedDetails, } from "./form-types.js";
|
|
2
|
-
export type { Response, Responses, FileInputResponse } from "./form-response-types.js";
|
|
File without changes
|
|
File without changes
|