@bcweed/dynamic-form-lib 0.0.3 → 0.0.4
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/.editorconfig +17 -0
- package/.postcssrc.json +5 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/AngularDynamicFormLibrary.esproj +14 -0
- package/CHANGELOG.md +16 -0
- package/README.md +15 -19
- package/angular.json +169 -0
- package/aspnetcore-https.js +37 -0
- package/karma.conf.js +44 -0
- package/obj/Debug/AngularDynamicFormLibrary.esproj.CoreCompileInputs.cache +0 -0
- package/obj/Debug/AngularDynamicFormLibrary.esproj.FileListAbsolute.txt +1 -0
- package/obj/Debug/package.g.props +56 -0
- package/package.json +65 -37
- package/postcss.config.js +6 -0
- package/projects/dynamic-form-lib/.postcssrc.json +5 -0
- package/projects/dynamic-form-lib/README.md +63 -0
- package/projects/dynamic-form-lib/ng-package.json +10 -0
- package/projects/dynamic-form-lib/package.json +27 -0
- package/projects/dynamic-form-lib/src/lib/README.md +424 -0
- package/projects/dynamic-form-lib/src/lib/SUMMARY.md +159 -0
- package/projects/dynamic-form-lib/src/lib/directives/dynamic-ref-directive.ts +13 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form-demo/dynamic-form-demo.component.html +75 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form-demo/dynamic-form-demo.component.scss +127 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form-demo/dynamic-form-demo.component.ts +50 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form-field/dynamic-form-field.component.html +234 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form-field/dynamic-form-field.component.scss +315 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form-field/dynamic-form-field.component.ts +233 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form.component.html +137 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form.component.scss +141 -0
- package/projects/dynamic-form-lib/src/lib/dynamic-form.component.ts +366 -0
- package/projects/dynamic-form-lib/src/lib/helpers/component-helper.ts +54 -0
- package/projects/dynamic-form-lib/src/lib/index.ts +10 -0
- package/projects/dynamic-form-lib/src/lib/models/dynamic-form-interfaces.ts +117 -0
- package/projects/dynamic-form-lib/src/lib/services/dynamic-form.service.spec.ts +302 -0
- package/projects/dynamic-form-lib/src/lib/services/dynamic-form.service.ts +325 -0
- package/projects/dynamic-form-lib/src/lib/style.scss +3 -0
- package/projects/dynamic-form-lib/src/lib/tailwind-output.css +0 -0
- package/projects/dynamic-form-lib/src/lib/validators/compare-validator.ts +26 -0
- package/projects/dynamic-form-lib/src/public-api.css +1 -0
- package/projects/dynamic-form-lib/src/public-api.ts +10 -0
- package/projects/dynamic-form-lib/tailwind.config.js +10 -0
- package/projects/dynamic-form-lib/tsconfig.lib.json +15 -0
- package/projects/dynamic-form-lib/tsconfig.lib.prod.json +11 -0
- package/projects/dynamic-form-lib/tsconfig.spec.json +15 -0
- package/public/favicon.ico +0 -0
- package/src/app/app-routing.module.ts +10 -0
- package/src/app/app.component.css +0 -0
- package/src/app/app.component.html +18 -0
- package/src/app/app.component.spec.ts +35 -0
- package/src/app/app.component.ts +1038 -0
- package/src/app/app.config.ts +45 -0
- package/src/app/app.module.ts +46 -0
- package/src/app/app.routes.ts +8 -0
- package/src/index.html +13 -0
- package/src/main.ts +16 -0
- package/src/styles.css +2 -0
- package/tailwind.config.js +10 -0
- package/tsconfig.app.json +15 -0
- package/tsconfig.json +32 -0
- package/tsconfig.spec.json +15 -0
- package/fesm2022/bcweed-dynamic-form-lib.mjs +0 -938
- package/fesm2022/bcweed-dynamic-form-lib.mjs.map +0 -1
- package/index.d.ts +0 -254
- /package/{src → projects/dynamic-form-lib/src}/lib/style.css +0 -0
|
@@ -0,0 +1,1038 @@
|
|
|
1
|
+
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { DynamicFormConfig, DynamicFormValue, DynamicFormState, DynamicFormService, DynamicFormComponent } from 'dynamic-form-lib';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-root',
|
|
7
|
+
templateUrl: './app.component.html',
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [DynamicFormComponent],
|
|
10
|
+
styleUrl: './app.component.css'
|
|
11
|
+
})
|
|
12
|
+
export class AppComponent implements OnInit, AfterViewInit {
|
|
13
|
+
formConfig!: DynamicFormConfig;
|
|
14
|
+
formValues: DynamicFormValue = {};
|
|
15
|
+
formState: DynamicFormState | null = null;
|
|
16
|
+
submittedData: any = null;
|
|
17
|
+
constructor(
|
|
18
|
+
private dynamicFormService: DynamicFormService,
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
let d = new Date('2026-03-25T07:00:00');
|
|
28
|
+
debugger;
|
|
29
|
+
this.formValues = {
|
|
30
|
+
secondVesselName: new Date('2026-03-25T07:00:00'),
|
|
31
|
+
thirdVesselName: '5555555555'
|
|
32
|
+
};
|
|
33
|
+
this.formConfig = this.createAdvancedFormConfig();
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
onFormSubmit(values: DynamicFormValue): void {
|
|
38
|
+
console.log('Form submitted:', values);
|
|
39
|
+
this.submittedData = values;
|
|
40
|
+
alert('Form submitted successfully! Check console for values.');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onFormCancel(): void {
|
|
44
|
+
console.log('Form cancelled');
|
|
45
|
+
this.submittedData = null;
|
|
46
|
+
alert('Form cancelled');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
onFormStateChange(state: DynamicFormState): void {
|
|
50
|
+
this.formState = state;
|
|
51
|
+
console.log('Form state changed:', state);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ngAfterViewInit(): void {
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private createAdvancedFormConfig(): DynamicFormConfig {
|
|
59
|
+
return {
|
|
60
|
+
id: 'new-vessel-registration-information-form',
|
|
61
|
+
frames: [
|
|
62
|
+
{
|
|
63
|
+
id: 'someId',
|
|
64
|
+
order: 1,
|
|
65
|
+
sections: [
|
|
66
|
+
{
|
|
67
|
+
id: 'vessel-name',
|
|
68
|
+
title: 'Vessel Name And Port of Registry',
|
|
69
|
+
description: 'I/We wish to apply for the name:',
|
|
70
|
+
fields: [
|
|
71
|
+
{
|
|
72
|
+
id: 'firstVesselName',
|
|
73
|
+
label: '1st Choice',
|
|
74
|
+
type: 'radio',
|
|
75
|
+
popInfo: `<p>A canadian registered vessel needs to have a port of registry.</p>
|
|
76
|
+
<p>The port of registry normally appears next to the vessel name: <span>e.g. FV Windcatcher, Victoria, BC</span></p>`,
|
|
77
|
+
placeholder: 'e.g. Sea Breeze',
|
|
78
|
+
inputWidth: '25%',
|
|
79
|
+
toolTip: 'Enter your 1st vessel name choice',
|
|
80
|
+
required: true,
|
|
81
|
+
order: 1,
|
|
82
|
+
cssClass: 'field-container-1col',
|
|
83
|
+
validations: [
|
|
84
|
+
{
|
|
85
|
+
type: 'required',
|
|
86
|
+
message: '1st Choice is required'
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
conditionalDisabled: () => { return true; }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'secondVesselName',
|
|
93
|
+
label: '2nd Choice',
|
|
94
|
+
type: 'date',
|
|
95
|
+
inputWidth: '50%',
|
|
96
|
+
placeholder: 'e.g. Wind Dancer',
|
|
97
|
+
toolTip: 'Enter your 2nd vessel name choice',
|
|
98
|
+
required: true,
|
|
99
|
+
order: 2,
|
|
100
|
+
cssClass: 'field-container-1col',
|
|
101
|
+
validations: [
|
|
102
|
+
{
|
|
103
|
+
type: 'required',
|
|
104
|
+
message: '2nd Choice is required'
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
conditionalDisabled: () => { return false; }
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'thirdVesselName',
|
|
111
|
+
label: '3rd Choice',
|
|
112
|
+
type: 'text',
|
|
113
|
+
placeholder: 'e.g. Cleopatra III',
|
|
114
|
+
toolTip: 'Enter your 3rd vessel name choice',
|
|
115
|
+
required: true,
|
|
116
|
+
order: 3,
|
|
117
|
+
leftPreInput: 'I certify that I have',
|
|
118
|
+
cssClass: 'field-container-1col',
|
|
119
|
+
validations: [
|
|
120
|
+
{
|
|
121
|
+
type: 'required',
|
|
122
|
+
message: '3rd Choice is required'
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'portOfRegistry',
|
|
128
|
+
label: 'Port of registry/intended port of registry',
|
|
129
|
+
type: 'select',
|
|
130
|
+
popInfo: `<p>A canadian registered vessel needs to have a port of registry.</p>
|
|
131
|
+
<p>The port of registry normally appears next to the vessel name: <span>e.g. FV Windcatcher, Victoria, BC</span></p>`,
|
|
132
|
+
placeholder: 'Select a Port of Registry',
|
|
133
|
+
toolTip: 'Select your Port of Registry',
|
|
134
|
+
required: true,
|
|
135
|
+
order: 4,
|
|
136
|
+
cssClass: 'field-container-1col',
|
|
137
|
+
postInfo: 'this is post info',
|
|
138
|
+
postWarning: 'this is a warning. Beware',
|
|
139
|
+
validations: [
|
|
140
|
+
{
|
|
141
|
+
type: 'required',
|
|
142
|
+
message: 'Port of registry/intended port of registry is required'
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'vessel-particulars',
|
|
150
|
+
title: 'Particulars of Vessel',
|
|
151
|
+
fields: [
|
|
152
|
+
|
|
153
|
+
{
|
|
154
|
+
id: 'typeOfPropulsion',
|
|
155
|
+
label: 'Type of propulsion (select one)',
|
|
156
|
+
type: 'radio',
|
|
157
|
+
popInfo: `<p>Indicate the type of propulsion of your vessel.</p>`,
|
|
158
|
+
required: true,
|
|
159
|
+
order: 5,
|
|
160
|
+
cssClass: 'field-container-1col',
|
|
161
|
+
options: [
|
|
162
|
+
{ label: 'Self-propelled', value: 1, toolTip: 'Select this option to indicate that your vessel is self propelled' },
|
|
163
|
+
{ label: 'Sail', value: 2, toolTip: 'Select this option to indicate that your vessel is propelled by sail' },
|
|
164
|
+
{ label: 'Auxiliary', value: 3, toolTip: 'Select this option to indicate that your vessel has auxiliary propulsion' },
|
|
165
|
+
{ label: 'None', value: 4, toolTip: 'Select this option to indicate that your vessel has no propulsion' }
|
|
166
|
+
],
|
|
167
|
+
validations: [
|
|
168
|
+
{
|
|
169
|
+
type: 'required',
|
|
170
|
+
message: 'Type of propulsion is required'
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: 'methodOfPropulsion',
|
|
176
|
+
label: 'Method of propulsion (select one)',
|
|
177
|
+
type: 'radio',
|
|
178
|
+
popInfo: `<p>Indicate the method of propulsion of your vessel. Select 'other' if not in the list of options.</p>`,
|
|
179
|
+
required: true,
|
|
180
|
+
order: 6,
|
|
181
|
+
cssClass: 'field-container-1col',
|
|
182
|
+
options: [
|
|
183
|
+
{ label: 'Single screw', value: 1, toolTip: 'Select this option to indicate that your vessel has only one (1) propeller' },
|
|
184
|
+
{ label: 'Twin screw', value: 2, toolTip: 'Select this option to indicate that your vessel has two (2) propellers' },
|
|
185
|
+
{ label: 'Triple screw', value: 3, toolTip: 'Select this option to indicate that your vessel has three (3) propellers' },
|
|
186
|
+
{ label: 'Jet', value: 4, toolTip: 'Select this option to indicate that your vessel is propelled by Jets instead of propellers' },
|
|
187
|
+
{ label: 'Other', value: 5, toolTip: 'Select this option to indicate that your vessel is propelled by another mean of propulsion not available in the list' }
|
|
188
|
+
],
|
|
189
|
+
onClick: (value: any, form: FormGroup) => {
|
|
190
|
+
if (value && value == 5) {
|
|
191
|
+
form.controls["methodOfPropulsionOther"].setValidators(this.dynamicFormService.getValidators([
|
|
192
|
+
{
|
|
193
|
+
type: 'required',
|
|
194
|
+
message: 'Method of propulsion (Other) is required'
|
|
195
|
+
}
|
|
196
|
+
]));
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
form.controls["methodOfPropulsionOther"].clearValidators();
|
|
201
|
+
form.controls["methodOfPropulsionOther"].setValue(null);
|
|
202
|
+
}
|
|
203
|
+
form.controls["methodOfPropulsionOther"].updateValueAndValidity();
|
|
204
|
+
|
|
205
|
+
},
|
|
206
|
+
validations: [
|
|
207
|
+
{
|
|
208
|
+
type: 'required',
|
|
209
|
+
message: 'Method of propulsion is required'
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'methodOfPropulsionOther',
|
|
215
|
+
label: 'Method of propulsion (Other)',
|
|
216
|
+
type: 'text',
|
|
217
|
+
popInfo: `<p>Enter the method of propulsion of your vessel if it is not in the above list.</p>`,
|
|
218
|
+
placeholder: 'e.g. Paddlewheel',
|
|
219
|
+
toolTip: 'Enter the method of propulsion of your vessel if it is not found in the above list',
|
|
220
|
+
required: true,
|
|
221
|
+
order: 7,
|
|
222
|
+
cssClass: 'field-container-1col',
|
|
223
|
+
validations: [
|
|
224
|
+
{
|
|
225
|
+
type: 'required',
|
|
226
|
+
message: 'Method of propulsion (Other) is required'
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
conditionalDisplay: (formValues: any) => {
|
|
230
|
+
return formValues.methodOfPropulsion === 5;
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: 'numberOfEngines',
|
|
235
|
+
label: 'Number of engines',
|
|
236
|
+
type: 'number',
|
|
237
|
+
popInfo: `<p>Enter the number of engines your vessel has and 0 for none.</p>`,
|
|
238
|
+
placeholder: 'e.g. 2',
|
|
239
|
+
toolTip: 'Enter the number of engines your vessel has and 0 for none',
|
|
240
|
+
required: true,
|
|
241
|
+
order: 8,
|
|
242
|
+
cssClass: 'field-container-1col',
|
|
243
|
+
validations: [
|
|
244
|
+
{
|
|
245
|
+
type: 'required',
|
|
246
|
+
message: 'Number of engines is required'
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 'engineDescription',
|
|
252
|
+
label: 'Engine description (select one)',
|
|
253
|
+
type: 'radio',
|
|
254
|
+
popInfo: `<p>Indicate the engine description of your vessel. Select 'other' if not in the list of options.</p>`,
|
|
255
|
+
required: true,
|
|
256
|
+
order: 9,
|
|
257
|
+
cssClass: 'field-container-1col',
|
|
258
|
+
options: [
|
|
259
|
+
{ label: 'Gas', value: 1, toolTip: 'Select this option to indicate that your engine is a Gas engine and runs mainly on Gasoline' },
|
|
260
|
+
{ label: 'Diesel', value: 2, toolTip: 'Select this option to indicate that your engine is a Diesel engine and runs mainly on some form of Diesel' },
|
|
261
|
+
{ label: 'Other', value: 3, toolTip: 'Select this option to indicate that your engine is powered by another energy source not available in the list... Such as Electric..' },
|
|
262
|
+
],
|
|
263
|
+
onClick: (value: any, form: FormGroup) => {
|
|
264
|
+
if (value && value == 3) {
|
|
265
|
+
form.controls["engineDescriptionOther"].setValidators(this.dynamicFormService.getValidators([
|
|
266
|
+
{
|
|
267
|
+
type: 'required',
|
|
268
|
+
message: 'Engine description (Other) is required'
|
|
269
|
+
}
|
|
270
|
+
]));
|
|
271
|
+
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
form.controls["engineDescriptionOther"].clearValidators();
|
|
275
|
+
form.controls["engineDescriptionOther"].setValue(null);
|
|
276
|
+
}
|
|
277
|
+
form.controls["engineDescriptionOther"].updateValueAndValidity();
|
|
278
|
+
|
|
279
|
+
},
|
|
280
|
+
validations: [
|
|
281
|
+
{
|
|
282
|
+
type: 'required',
|
|
283
|
+
message: 'Engine description is required'
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 'engineDescriptionOther',
|
|
289
|
+
label: 'Engine description (Other)',
|
|
290
|
+
type: 'text',
|
|
291
|
+
popInfo: `<p>Indicate the engine description of your vessel. Select 'other' if not in the list of options.</p>`,
|
|
292
|
+
placeholder: 'e.g. Electric',
|
|
293
|
+
toolTip: 'Enter the engine description of your vessel if it is not in the above list',
|
|
294
|
+
required: true,
|
|
295
|
+
order: 10,
|
|
296
|
+
cssClass: 'field-container-1col',
|
|
297
|
+
validations: [
|
|
298
|
+
{
|
|
299
|
+
type: 'required',
|
|
300
|
+
message: 'Engine description (Other) is required'
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
conditionalDisplay: (formValues: any) => {
|
|
304
|
+
return formValues.engineDescription === 3;
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: 'propulsionPower',
|
|
309
|
+
label: 'Propulsion power (select one)',
|
|
310
|
+
type: 'radio',
|
|
311
|
+
popInfo: `<p>Indicate the propulsion power unit of your vessel.</p>`,
|
|
312
|
+
required: true,
|
|
313
|
+
order: 11,
|
|
314
|
+
cssClass: 'field-container-1col',
|
|
315
|
+
options: [
|
|
316
|
+
{ label: 'BHP', value: 1, toolTip: 'Select this option to indicate that the power of your engine is rated in Breaking Horse Power (BHP)' },
|
|
317
|
+
{ label: 'kW', value: 2, toolTip: 'Select this option to indicate that the power of your engine is rated in KiloWatts (kW)' },
|
|
318
|
+
],
|
|
319
|
+
validations: [
|
|
320
|
+
{
|
|
321
|
+
type: 'required',
|
|
322
|
+
message: 'Propulsion power is required'
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: 'enginePower',
|
|
328
|
+
label: 'Engine power',
|
|
329
|
+
type: 'number',
|
|
330
|
+
popInfo: `<p>Enter the engine power of your vessel in the unit selected above (BHP or kW) and 0 for none.</p>`,
|
|
331
|
+
placeholder: 'e.g. 150',
|
|
332
|
+
toolTip: 'Enter the engine power of your vessel in the unit selected above (BHP or kW) and 0 for none',
|
|
333
|
+
required: true,
|
|
334
|
+
order: 12,
|
|
335
|
+
cssClass: 'field-container-1col',
|
|
336
|
+
validations: [
|
|
337
|
+
{
|
|
338
|
+
type: 'required',
|
|
339
|
+
message: 'Engine power is required'
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: 'speedInKnots',
|
|
345
|
+
label: 'Speed in knots',
|
|
346
|
+
type: 'number',
|
|
347
|
+
popInfo: `<p>Enter the speed of your vessel in knots and 0 for none.</p>`,
|
|
348
|
+
placeholder: 'e.g. 12',
|
|
349
|
+
toolTip: 'Enter the speed of your vessel in knots and 0 for none',
|
|
350
|
+
required: true,
|
|
351
|
+
order: 13,
|
|
352
|
+
cssClass: 'field-container-1col',
|
|
353
|
+
validations: [
|
|
354
|
+
{
|
|
355
|
+
type: 'required',
|
|
356
|
+
message: 'Speed in knots is required'
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
id: 'length',
|
|
362
|
+
label: 'Length (m.cm)',
|
|
363
|
+
type: 'number',
|
|
364
|
+
helperInfo: 'The field Length (m.cm) must be a numeric measurement in meters and centimeter.',
|
|
365
|
+
popInfo: `<p>Enter the length of your vessel in meters and centimeters. Ex: 8.2</p>`,
|
|
366
|
+
placeholder: 'e.g. 8.25',
|
|
367
|
+
toolTip: 'Enter the length of your vessel in meters and centimeters. Ex: 8.2',
|
|
368
|
+
required: true,
|
|
369
|
+
order: 14,
|
|
370
|
+
cssClass: 'field-container-1col',
|
|
371
|
+
validations: [
|
|
372
|
+
{
|
|
373
|
+
type: 'required',
|
|
374
|
+
message: 'Length is required'
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: 'breadth',
|
|
380
|
+
label: 'Breadth (m.cm)',
|
|
381
|
+
type: 'number',
|
|
382
|
+
helperInfo: 'The field Breadth (m.cm) must be a numeric measurement in meters and centimeter.',
|
|
383
|
+
popInfo: `<p>Enter the breadth (how wide) of your vessel in meters and centimeters. Ex: 8.2</p>`,
|
|
384
|
+
placeholder: 'e.g. 8.25',
|
|
385
|
+
toolTip: 'Enter the breadth (how wide) of your vessel in meters and centimeters. Ex: 8.2',
|
|
386
|
+
required: true,
|
|
387
|
+
order: 15,
|
|
388
|
+
cssClass: 'field-container-1col',
|
|
389
|
+
validations: [
|
|
390
|
+
{
|
|
391
|
+
type: 'required',
|
|
392
|
+
message: 'Breadth is required'
|
|
393
|
+
}
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
id: 'depth',
|
|
398
|
+
label: 'Depth (m.cm)',
|
|
399
|
+
type: 'number',
|
|
400
|
+
helperInfo: 'The field Depth (m.cm) must be a numeric measurement in meters and centimeter.',
|
|
401
|
+
popInfo: `<p>Enter the depth (how deep) of your vessel in meters and centimeters. Ex: 8.2</p>`,
|
|
402
|
+
placeholder: 'e.g. 8.25',
|
|
403
|
+
toolTip: 'Enter the depth (how deep) of your vessel in meters and centimeters. Ex: 8.2',
|
|
404
|
+
required: true,
|
|
405
|
+
order: 16,
|
|
406
|
+
cssClass: 'field-container-1col',
|
|
407
|
+
validations: [
|
|
408
|
+
{
|
|
409
|
+
type: 'required',
|
|
410
|
+
message: 'Depth is required'
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: 'grossTonnage',
|
|
416
|
+
label: 'Gross tonnage',
|
|
417
|
+
type: 'number',
|
|
418
|
+
popInfo: `<p>Enter the gross tonnage of your vessel.</p>`,
|
|
419
|
+
placeholder: 'e.g. 16000',
|
|
420
|
+
toolTip: 'Enter the gross tonnage of your vessel',
|
|
421
|
+
required: true,
|
|
422
|
+
order: 17,
|
|
423
|
+
cssClass: 'field-container-1col',
|
|
424
|
+
validations: [
|
|
425
|
+
{
|
|
426
|
+
type: 'required',
|
|
427
|
+
message: 'Gross tonnage is required'
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
id: 'netTonnage',
|
|
433
|
+
label: 'Net tonnage',
|
|
434
|
+
type: 'number',
|
|
435
|
+
popInfo: `<p>Enter the net tonnage of your vessel.</p>`,
|
|
436
|
+
placeholder: 'e.g. 16000',
|
|
437
|
+
toolTip: 'Enter the net tonnage of your vessel',
|
|
438
|
+
required: true,
|
|
439
|
+
order: 18,
|
|
440
|
+
cssClass: 'field-container-1col',
|
|
441
|
+
validations: [
|
|
442
|
+
{
|
|
443
|
+
type: 'required',
|
|
444
|
+
message: 'Net tonnage is required'
|
|
445
|
+
}
|
|
446
|
+
]
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
id: 'typeOfTonnage',
|
|
450
|
+
label: 'Type of tonnage (select one)',
|
|
451
|
+
type: 'radio',
|
|
452
|
+
popInfo: `<p>Indicate the type of tonnage entered above.</p>`,
|
|
453
|
+
required: true,
|
|
454
|
+
order: 19,
|
|
455
|
+
cssClass: 'field-container-1col',
|
|
456
|
+
options: [
|
|
457
|
+
{ label: 'Assigned formal tonnage (non-calculated tonnage)', value: 1, toolTip: 'Select this option to indicate that the tonnage of your vessel was an Assigned Formal Tonnage' },
|
|
458
|
+
{ label: 'Calculated tonnage (if calculated, specify below)', value: 2, toolTip: 'Select this option to indicate that the tonnage of your vessel was Calculated using an approved method below' },
|
|
459
|
+
],
|
|
460
|
+
onClick: (value: any, form: FormGroup) => {
|
|
461
|
+
if (value && value == 2) {
|
|
462
|
+
form.controls["measurementSource"].setValidators(this.dynamicFormService.getValidators([
|
|
463
|
+
{
|
|
464
|
+
type: 'required',
|
|
465
|
+
message: 'Measurement source is required'
|
|
466
|
+
}
|
|
467
|
+
]));
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
form.controls["measurementSource"].clearValidators();
|
|
472
|
+
form.controls["measurementSource"].setValue(null);
|
|
473
|
+
}
|
|
474
|
+
form.controls["measurementSource"].updateValueAndValidity();
|
|
475
|
+
|
|
476
|
+
},
|
|
477
|
+
validations: [
|
|
478
|
+
{
|
|
479
|
+
type: 'required',
|
|
480
|
+
message: 'Engine description is required'
|
|
481
|
+
}
|
|
482
|
+
]
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: 'measurementSource',
|
|
486
|
+
label: 'Tonnage measurement and calculations carried out by (select one)',
|
|
487
|
+
type: 'radio',
|
|
488
|
+
popInfo: `<p>Indicate measurement source of the tonnage entered above.</p>`,
|
|
489
|
+
required: true,
|
|
490
|
+
order: 20,
|
|
491
|
+
cssClass: 'field-container-1col',
|
|
492
|
+
options: [
|
|
493
|
+
{ label: 'Vessel owner (Simplified)', value: 1, toolTip: 'Select this option to indicate that the tonnage calculation was done by the owner using the simplified method' },
|
|
494
|
+
{ label: 'Appointed tonnage measurer (Certificate of Survey)', value: 2, toolTip: 'Select this option to indicate that the tonnage calculation was done by an Appointed Tonnage Measurer' },
|
|
495
|
+
],
|
|
496
|
+
validations: [
|
|
497
|
+
{
|
|
498
|
+
type: 'required',
|
|
499
|
+
message: 'Measurement source is required'
|
|
500
|
+
}
|
|
501
|
+
],
|
|
502
|
+
conditionalDisplay: (formValues: any) => {
|
|
503
|
+
return formValues.typeOfTonnage === 2;
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
id: 'contructionType',
|
|
508
|
+
label: 'Type of construction',
|
|
509
|
+
type: 'select',
|
|
510
|
+
popInfo: `<p>Select a Construction Type.</p>`,
|
|
511
|
+
placeholder: 'Select a Construction Type',
|
|
512
|
+
toolTip: 'Select from the list the type of construction of your vessel',
|
|
513
|
+
required: true,
|
|
514
|
+
order: 21,
|
|
515
|
+
cssClass: 'field-container-1col',
|
|
516
|
+
validations: [
|
|
517
|
+
{
|
|
518
|
+
type: 'required',
|
|
519
|
+
message: 'Type of construction is required'
|
|
520
|
+
}
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
id: 'hullConstructionMaterial',
|
|
525
|
+
label: 'Hull construction materials',
|
|
526
|
+
type: 'select',
|
|
527
|
+
popInfo: `<p>Select a Hull Construction Material.</p>`,
|
|
528
|
+
placeholder: 'Select a Hull Construction Material',
|
|
529
|
+
toolTip: 'Select from the list the hull construction materials used in the construction of your vessel',
|
|
530
|
+
required: true,
|
|
531
|
+
order: 22,
|
|
532
|
+
cssClass: 'field-container-1col',
|
|
533
|
+
validations: [
|
|
534
|
+
{
|
|
535
|
+
type: 'required',
|
|
536
|
+
message: 'Hull construction materials is required'
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
id: 'hullSerialNumber',
|
|
542
|
+
label: 'Hull serial number',
|
|
543
|
+
type: 'text',
|
|
544
|
+
popInfo: `<p>Enter the hull serial number of your vessel. This should be stamped on the inside of your hull.</p>`,
|
|
545
|
+
placeholder: 'e.g. 32045006',
|
|
546
|
+
toolTip: 'Enter the hull serial number of your vessel. This should be stamped on the inside of your hull',
|
|
547
|
+
required: true,
|
|
548
|
+
order: 23,
|
|
549
|
+
cssClass: 'field-container-1col',
|
|
550
|
+
validations: [
|
|
551
|
+
{
|
|
552
|
+
type: 'required',
|
|
553
|
+
message: 'Hull serial number is required'
|
|
554
|
+
}
|
|
555
|
+
]
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
id: 'builderName',
|
|
559
|
+
label: 'Name of builder',
|
|
560
|
+
type: 'text',
|
|
561
|
+
popInfo: `<p>Enter the name of builder of your vessel. (The company or person which built your vessel).</p>`,
|
|
562
|
+
placeholder: 'e.g. Boat Builders United or Bayliner',
|
|
563
|
+
toolTip: 'Enter the name of builder of your vessel. (The company or person which built your vessel)',
|
|
564
|
+
required: true,
|
|
565
|
+
order: 24,
|
|
566
|
+
cssClass: 'field-container-1col',
|
|
567
|
+
validations: [
|
|
568
|
+
{
|
|
569
|
+
type: 'required',
|
|
570
|
+
message: 'Name of builder is required'
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
id: 'cityBuilt',
|
|
576
|
+
label: 'Place (City) and year of build',
|
|
577
|
+
type: 'text',
|
|
578
|
+
popInfo: `<p>Enter the location (City) where your vessel was built and the year it was built.</p>`,
|
|
579
|
+
placeholder: 'e.g. Long Beach 2018',
|
|
580
|
+
toolTip: 'Enter the location (City) where your vessel was built and the year it was built',
|
|
581
|
+
required: true,
|
|
582
|
+
order: 25,
|
|
583
|
+
cssClass: 'field-container-1col',
|
|
584
|
+
validations: [
|
|
585
|
+
{
|
|
586
|
+
type: 'required',
|
|
587
|
+
message: 'Place (City) and year of build is required'
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
id: 'regionBuilt',
|
|
593
|
+
label: 'Province/State',
|
|
594
|
+
type: 'text',
|
|
595
|
+
popInfo: `<p>Enter the province/state where your vessel was built.</p>`,
|
|
596
|
+
placeholder: 'e.g. British Columbia',
|
|
597
|
+
toolTip: 'Enter the province/state where your vessel was built',
|
|
598
|
+
required: true,
|
|
599
|
+
order: 26,
|
|
600
|
+
cssClass: 'field-container-1col',
|
|
601
|
+
validations: [
|
|
602
|
+
{
|
|
603
|
+
type: 'required',
|
|
604
|
+
message: 'Province/State is required'
|
|
605
|
+
}
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
id: 'countryBuilt',
|
|
610
|
+
label: 'Country',
|
|
611
|
+
type: 'text',
|
|
612
|
+
popInfo: `<p>Enter the country where your vessel was built.</p>`,
|
|
613
|
+
placeholder: 'e.g. Canada',
|
|
614
|
+
toolTip: 'Enter the country where your vessel was built',
|
|
615
|
+
required: true,
|
|
616
|
+
order: 27,
|
|
617
|
+
cssClass: 'field-container-1col',
|
|
618
|
+
validations: [
|
|
619
|
+
{
|
|
620
|
+
type: 'required',
|
|
621
|
+
message: 'Country is required'
|
|
622
|
+
}
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
id: 'intendedVesselUse',
|
|
627
|
+
label: 'Intended use of vessel (if non-pleasure, the Descriptor of Vessel must be completed). (select one)',
|
|
628
|
+
type: 'radio',
|
|
629
|
+
popInfo: `<p>Indicate the intended use of your vessel whether it will be for pleasure use or commercial use.</p>`,
|
|
630
|
+
required: true,
|
|
631
|
+
order: 28,
|
|
632
|
+
cssClass: 'field-container-1col',
|
|
633
|
+
options: [
|
|
634
|
+
{ label: 'Pleasure', value: 1, toolTip: 'Select this option to indicate that your vessel will mainly be used for Pleasure purposes' },
|
|
635
|
+
{ label: 'Non-Pleasure', value: 2, toolTip: 'Select this option to indicate that your vessel will mainly be used for Commercial purposes' },
|
|
636
|
+
],
|
|
637
|
+
validations: [
|
|
638
|
+
{
|
|
639
|
+
type: 'required',
|
|
640
|
+
message: 'Intended use of vessel is required'
|
|
641
|
+
}
|
|
642
|
+
]
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
id: 'vesselDescriptorEnum',
|
|
646
|
+
label: 'Descriptor of vessel (select one)',
|
|
647
|
+
type: 'radio',
|
|
648
|
+
popInfo: `<p>Indicate the descriptor of your vessel. Select 'other' if not in the list of options.</p>`,
|
|
649
|
+
required: true,
|
|
650
|
+
order: 29,
|
|
651
|
+
cssClass: 'field-container-1col',
|
|
652
|
+
options: [
|
|
653
|
+
{ label: 'Fishing (excludes sport fishing)', value: 1, toolTip: 'Select this option to indicate that the vessel is a Commercial Fishing Vessel' },
|
|
654
|
+
{ label: 'Passenger', value: 2, toolTip: 'Select this option to indicate that the vessel is a Commercial Passenger Vessel' },
|
|
655
|
+
{ label: 'Tug', value: 3, toolTip: 'Select this option to indicate that the vessel is a Tug Boat' },
|
|
656
|
+
{ label: 'Cargo', value: 4, toolTip: 'Select this option to indicate that the vessel is a Commercial Cargo Vessel' },
|
|
657
|
+
{ label: 'Yacht (pleasure craft)', value: 5, toolTip: 'Select this option to indicate that the vessel is a Yacht' },
|
|
658
|
+
{ label: 'Other', value: 6, toolTip: 'Select this option to indicate that the vessel is a another type of vessel not available in the list' },
|
|
659
|
+
],
|
|
660
|
+
onClick: (value: any, form: FormGroup) => {
|
|
661
|
+
if (value && value == 6) {
|
|
662
|
+
form.controls["vesselDescriptor"].setValidators(this.dynamicFormService.getValidators([
|
|
663
|
+
{
|
|
664
|
+
type: 'required',
|
|
665
|
+
message: 'Descriptor of vessel specification is required'
|
|
666
|
+
}
|
|
667
|
+
]));
|
|
668
|
+
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
form.controls["vesselDescriptor"].clearValidators();
|
|
672
|
+
form.controls["vesselDescriptor"].setValue(null);
|
|
673
|
+
}
|
|
674
|
+
form.controls["vesselDescriptor"].updateValueAndValidity();
|
|
675
|
+
|
|
676
|
+
},
|
|
677
|
+
validations: [
|
|
678
|
+
{
|
|
679
|
+
type: 'required',
|
|
680
|
+
message: 'Descriptor of vessel is required'
|
|
681
|
+
}
|
|
682
|
+
]
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
id: 'vesselDescriptor',
|
|
686
|
+
label: '(Specify)',
|
|
687
|
+
type: 'select',
|
|
688
|
+
popInfo: `<p>Select a Vessel Descriptor from the list.</p>`,
|
|
689
|
+
placeholder: 'Select a Vessel Descriptor',
|
|
690
|
+
toolTip: 'Select from the list the descriptor specification of your vessel if not found in the options above',
|
|
691
|
+
required: true,
|
|
692
|
+
order: 30,
|
|
693
|
+
cssClass: 'field-container-1col',
|
|
694
|
+
validations: [
|
|
695
|
+
{
|
|
696
|
+
type: 'required',
|
|
697
|
+
message: 'Descriptor of vessel specification is required'
|
|
698
|
+
}
|
|
699
|
+
],
|
|
700
|
+
conditionalDisplay: (formValues: any) => {
|
|
701
|
+
return formValues.vesselDescriptorEnum === 6;
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
id: 'vesselIsAirCushion',
|
|
706
|
+
label: 'If your vessel is an air cushion vehicle (ACV), give details',
|
|
707
|
+
type: 'radio',
|
|
708
|
+
popInfo: `<p>Indicate wheter your vessel is an air cushion vehicle (ACV) or not.</p>`,
|
|
709
|
+
required: true,
|
|
710
|
+
order: 31,
|
|
711
|
+
cssClass: 'field-container-1col',
|
|
712
|
+
options: [
|
|
713
|
+
{ label: 'No', value: false, toolTip: 'Select this option to indicate that the vessel is NOT an Air Cusshion Vehicle' },
|
|
714
|
+
{ label: 'Yes', value: true, toolTip: 'Select this option to indicate that the vessel is an Air Cusshion Vehicle' },
|
|
715
|
+
],
|
|
716
|
+
onClick: (value: any, form: FormGroup) => {
|
|
717
|
+
if (value && Boolean(value) == true) {
|
|
718
|
+
form.controls["allUpWeight"].setValidators(this.dynamicFormService.getValidators([
|
|
719
|
+
{
|
|
720
|
+
type: 'required',
|
|
721
|
+
message: 'All up weight is required'
|
|
722
|
+
}
|
|
723
|
+
]));
|
|
724
|
+
form.controls["modelDesignation"].setValidators(this.dynamicFormService.getValidators([
|
|
725
|
+
{
|
|
726
|
+
type: 'required',
|
|
727
|
+
message: 'Model designation is required'
|
|
728
|
+
}
|
|
729
|
+
]));
|
|
730
|
+
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
form.controls["allUpWeight"].clearValidators();
|
|
734
|
+
form.controls["allUpWeight"].setValue(null);
|
|
735
|
+
form.controls["modelDesignation"].clearValidators();
|
|
736
|
+
form.controls["modelDesignation"].setValue(null);
|
|
737
|
+
}
|
|
738
|
+
form.controls["allUpWeight"].updateValueAndValidity();
|
|
739
|
+
form.controls["modelDesignation"].updateValueAndValidity();
|
|
740
|
+
|
|
741
|
+
},
|
|
742
|
+
validations: [
|
|
743
|
+
{
|
|
744
|
+
type: 'required',
|
|
745
|
+
message: 'Vessel is an air cushion vehicle (ACV) is required'
|
|
746
|
+
}
|
|
747
|
+
]
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
id: 'allUpWeight',
|
|
751
|
+
label: 'All up weight (KG)',
|
|
752
|
+
type: 'number',
|
|
753
|
+
popInfo: `<p>Enter the maximum weight of your vessel in kilograms.</p>`,
|
|
754
|
+
placeholder: 'e.g. 3000',
|
|
755
|
+
toolTip: 'Enter the maximum weight of your vessel in kilograms',
|
|
756
|
+
required: true,
|
|
757
|
+
order: 32,
|
|
758
|
+
cssClass: 'field-container-1col',
|
|
759
|
+
validations: [
|
|
760
|
+
{
|
|
761
|
+
type: 'required',
|
|
762
|
+
message: 'All up weight is required'
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
conditionalDisplay: (formValues: any) => {
|
|
766
|
+
return formValues.vesselIsAirCushion === true;
|
|
767
|
+
}
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
id: 'modelDesignation',
|
|
771
|
+
label: 'Model designation',
|
|
772
|
+
type: 'text',
|
|
773
|
+
popInfo: `<p>Enter the model designation.</p>`,
|
|
774
|
+
placeholder: 'e.g. PACV',
|
|
775
|
+
toolTip: 'Enter the model designation',
|
|
776
|
+
required: true,
|
|
777
|
+
order: 33,
|
|
778
|
+
cssClass: 'field-container-1col',
|
|
779
|
+
validations: [
|
|
780
|
+
{
|
|
781
|
+
type: 'required',
|
|
782
|
+
message: 'Model designation is required'
|
|
783
|
+
}
|
|
784
|
+
],
|
|
785
|
+
conditionalDisplay: (formValues: any) => {
|
|
786
|
+
return formValues.vesselIsAirCushion === true;
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
id: 'vesselPrviouslyRegisteredInCanada',
|
|
791
|
+
label: 'The vessel is, or has previously been registered in Canada or a foreign country (select one)',
|
|
792
|
+
type: 'radio',
|
|
793
|
+
popInfo: `<p>Indicate wheter your vessel is, or has previously been registered in Canada or a foreign country or not at all.</p>`,
|
|
794
|
+
required: true,
|
|
795
|
+
order: 34,
|
|
796
|
+
cssClass: 'field-container-1col',
|
|
797
|
+
options: [
|
|
798
|
+
{ label: 'No', value: false, toolTip: 'Select this option to indicate that the vessel is NOT currently registered or was NOT registered in the past here in Canada or in a foreign country' },
|
|
799
|
+
{ label: 'Yes', value: true, toolTip: 'Select this option to indicate that the vessel is currently registered or was registered in the past here in Canada or in a foreign country' },
|
|
800
|
+
],
|
|
801
|
+
onClick: (value: any, form: FormGroup) => {
|
|
802
|
+
if (value && Boolean(value) == true) {
|
|
803
|
+
form.controls["officialRegistrationNumber"].setValidators(this.dynamicFormService.getValidators([
|
|
804
|
+
{
|
|
805
|
+
type: 'required',
|
|
806
|
+
message: 'Official number is required'
|
|
807
|
+
}
|
|
808
|
+
]));
|
|
809
|
+
form.controls["registeredName"].setValidators(this.dynamicFormService.getValidators([
|
|
810
|
+
{
|
|
811
|
+
type: 'required',
|
|
812
|
+
message: 'Registered name is required'
|
|
813
|
+
}
|
|
814
|
+
]));
|
|
815
|
+
form.controls["previousPortOfRegistry"].setValidators(this.dynamicFormService.getValidators([
|
|
816
|
+
{
|
|
817
|
+
type: 'required',
|
|
818
|
+
message: 'Port of registry is required'
|
|
819
|
+
}
|
|
820
|
+
]));
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
form.controls["officialRegistrationNumber"].clearValidators();
|
|
824
|
+
form.controls["officialRegistrationNumber"].setValue(null);
|
|
825
|
+
form.controls["registeredName"].clearValidators();
|
|
826
|
+
form.controls["registeredName"].setValue(null);
|
|
827
|
+
form.controls["previousPortOfRegistry"].clearValidators();
|
|
828
|
+
form.controls["previousPortOfRegistry"].setValue(null);
|
|
829
|
+
}
|
|
830
|
+
form.controls["officialRegistrationNumber"].updateValueAndValidity();
|
|
831
|
+
form.controls["registeredName"].updateValueAndValidity();
|
|
832
|
+
form.controls["previousPortOfRegistry"].updateValueAndValidity();
|
|
833
|
+
|
|
834
|
+
},
|
|
835
|
+
validations: [
|
|
836
|
+
{
|
|
837
|
+
type: 'required',
|
|
838
|
+
message: 'The vessel is, or has previously been registered in Canada or a foreign country is required'
|
|
839
|
+
}
|
|
840
|
+
]
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
id: 'officialRegistrationNumber',
|
|
844
|
+
label: 'Official number',
|
|
845
|
+
type: 'text',
|
|
846
|
+
popInfo: `<p>Enter the official number previously assigned to your vessel.</p>`,
|
|
847
|
+
placeholder: 'e.g. 32056009',
|
|
848
|
+
toolTip: 'Enter the official number previously assigned to your vessel',
|
|
849
|
+
required: true,
|
|
850
|
+
order: 35,
|
|
851
|
+
cssClass: 'field-container-1col',
|
|
852
|
+
validations: [
|
|
853
|
+
{
|
|
854
|
+
type: 'required',
|
|
855
|
+
message: 'Official number is required'
|
|
856
|
+
}
|
|
857
|
+
],
|
|
858
|
+
conditionalDisplay: (formValues: any) => {
|
|
859
|
+
return formValues.vesselPrviouslyRegisteredInCanada === true;
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
id: 'registeredName',
|
|
864
|
+
label: 'Registered name',
|
|
865
|
+
type: 'text',
|
|
866
|
+
popInfo: `<p>Enter the registered name of your vessel.</p>`,
|
|
867
|
+
placeholder: 'e.g. Sea Angel II',
|
|
868
|
+
toolTip: 'Enter the registered name of your vessel',
|
|
869
|
+
required: true,
|
|
870
|
+
order: 36,
|
|
871
|
+
cssClass: 'field-container-1col',
|
|
872
|
+
validations: [
|
|
873
|
+
{
|
|
874
|
+
type: 'required',
|
|
875
|
+
message: 'Registered name is required'
|
|
876
|
+
}
|
|
877
|
+
],
|
|
878
|
+
conditionalDisplay: (formValues: any) => {
|
|
879
|
+
return formValues.vesselPrviouslyRegisteredInCanada === true;
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
id: 'previousPortOfRegistry',
|
|
884
|
+
label: 'Port of registry',
|
|
885
|
+
type: 'select',
|
|
886
|
+
popInfo: `<p>Select a Port of Registry.</p>`,
|
|
887
|
+
placeholder: 'Select a Port of Registry',
|
|
888
|
+
toolTip: 'Select from the list the port of registry of your vessel',
|
|
889
|
+
required: true,
|
|
890
|
+
order: 37,
|
|
891
|
+
cssClass: 'field-container-1col',
|
|
892
|
+
validations: [
|
|
893
|
+
{
|
|
894
|
+
type: 'required',
|
|
895
|
+
message: 'Port of registry is required'
|
|
896
|
+
}
|
|
897
|
+
],
|
|
898
|
+
conditionalDisplay: (formValues: any) => {
|
|
899
|
+
return formValues.vesselPrviouslyRegisteredInCanada === true;
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
id: 'vesselIsAsUnderConstruction',
|
|
904
|
+
label: 'The vessel is recorded as a vessel under construction (select one)',
|
|
905
|
+
type: 'radio',
|
|
906
|
+
popInfo: `<p>Indicate wheter your vessel is recorded as a vessel under construction or not.</p>`,
|
|
907
|
+
required: true,
|
|
908
|
+
order: 38,
|
|
909
|
+
cssClass: 'field-container-1col',
|
|
910
|
+
options: [
|
|
911
|
+
{ label: 'No', value: false, toolTip: 'Select this option to indicate that the vessel is NOT currently listed as being in construction' },
|
|
912
|
+
{ label: 'Yes', value: true, toolTip: 'Select this option to indicate that the vessel is currently listed as being in construction' },
|
|
913
|
+
],
|
|
914
|
+
onClick: (value: any, form: FormGroup) => {
|
|
915
|
+
if (value && Boolean(value) == true) {
|
|
916
|
+
form.controls["constructionRecordNumber"].setValidators(this.dynamicFormService.getValidators([
|
|
917
|
+
{
|
|
918
|
+
type: 'required',
|
|
919
|
+
message: 'Record Number is required'
|
|
920
|
+
}
|
|
921
|
+
]));
|
|
922
|
+
form.controls["temporaryName"].setValidators(this.dynamicFormService.getValidators([
|
|
923
|
+
{
|
|
924
|
+
type: 'required',
|
|
925
|
+
message: 'Temporary name is required'
|
|
926
|
+
}
|
|
927
|
+
]));
|
|
928
|
+
form.controls["constructionPortOfRegistry"].setValidators(this.dynamicFormService.getValidators([
|
|
929
|
+
{
|
|
930
|
+
type: 'required',
|
|
931
|
+
message: 'Port of registry is required'
|
|
932
|
+
}
|
|
933
|
+
]));
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
form.controls["constructionRecordNumber"].clearValidators();
|
|
937
|
+
form.controls["constructionRecordNumber"].setValue(null);
|
|
938
|
+
form.controls["temporaryName"].clearValidators();
|
|
939
|
+
form.controls["temporaryName"].setValue(null);
|
|
940
|
+
form.controls["constructionPortOfRegistry"].clearValidators();
|
|
941
|
+
form.controls["constructionPortOfRegistry"].setValue(null);
|
|
942
|
+
}
|
|
943
|
+
form.controls["constructionRecordNumber"].updateValueAndValidity();
|
|
944
|
+
form.controls["temporaryName"].updateValueAndValidity();
|
|
945
|
+
form.controls["constructionPortOfRegistry"].updateValueAndValidity();
|
|
946
|
+
|
|
947
|
+
},
|
|
948
|
+
validations: [
|
|
949
|
+
{
|
|
950
|
+
type: 'required',
|
|
951
|
+
message: 'Vessel is recorded as a vessel under construction is required'
|
|
952
|
+
}
|
|
953
|
+
]
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
id: 'constructionRecordNumber',
|
|
957
|
+
label: 'Record Number',
|
|
958
|
+
type: 'text',
|
|
959
|
+
placeholder: 'e.g. 550045',
|
|
960
|
+
toolTip: 'Enter the record number of your vessel',
|
|
961
|
+
popInfo: `<p>Enter the record number of your vessel.</p>`,
|
|
962
|
+
required: true,
|
|
963
|
+
order: 39,
|
|
964
|
+
cssClass: 'field-container-1col',
|
|
965
|
+
validations: [
|
|
966
|
+
{
|
|
967
|
+
type: 'required',
|
|
968
|
+
message: 'Record Number is required'
|
|
969
|
+
}
|
|
970
|
+
],
|
|
971
|
+
conditionalDisplay: (formValues: any) => {
|
|
972
|
+
return formValues.vesselIsAsUnderConstruction === true;
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
id: 'temporaryName',
|
|
977
|
+
label: 'Temporary name',
|
|
978
|
+
type: 'text',
|
|
979
|
+
placeholder: 'e.g. Sea Lady',
|
|
980
|
+
toolTip: 'Enter the temporary name of your vessel',
|
|
981
|
+
popInfo: `<p>Enter the temporary name of your vessel.</p>`,
|
|
982
|
+
required: true,
|
|
983
|
+
order: 40,
|
|
984
|
+
cssClass: 'field-container-1col',
|
|
985
|
+
validations: [
|
|
986
|
+
{
|
|
987
|
+
type: 'required',
|
|
988
|
+
message: 'Temporary name is required'
|
|
989
|
+
}
|
|
990
|
+
],
|
|
991
|
+
conditionalDisplay: (formValues: any) => {
|
|
992
|
+
return formValues.vesselIsAsUnderConstruction === true;
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
id: 'constructionPortOfRegistry',
|
|
997
|
+
label: 'Port of registry',
|
|
998
|
+
type: 'select',
|
|
999
|
+
placeholder: 'Select a Port of Registry',
|
|
1000
|
+
toolTip: 'Select from the list the port of registry of your vessel',
|
|
1001
|
+
popInfo: `<p>Select a Port of Registry.</p>`,
|
|
1002
|
+
required: true,
|
|
1003
|
+
order: 41,
|
|
1004
|
+
cssClass: 'field-container-1col',
|
|
1005
|
+
validations: [
|
|
1006
|
+
{
|
|
1007
|
+
type: 'required',
|
|
1008
|
+
message: 'Port of registry is required'
|
|
1009
|
+
}
|
|
1010
|
+
],
|
|
1011
|
+
conditionalDisplay: (formValues: any) => {
|
|
1012
|
+
return formValues.vesselIsAsUnderConstruction === true;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
]
|
|
1018
|
+
|
|
1019
|
+
}],
|
|
1020
|
+
submitLabel: 'Submit',
|
|
1021
|
+
cancelLabel: 'Cancel'
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
get formIsValid(): boolean {
|
|
1026
|
+
return this.formState?.isValid ?? false;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
get formErrorCount(): number {
|
|
1030
|
+
return this.formState?.errors.length ?? 0;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
public backClick() {
|
|
1035
|
+
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
}
|