@defra/forms-model 3.0.168 → 3.0.169

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.
Files changed (56) hide show
  1. package/dist/module/components/component-types.js +47 -46
  2. package/dist/module/components/component-types.js.map +1 -1
  3. package/dist/module/components/enums.js +31 -24
  4. package/dist/module/components/enums.js.map +1 -1
  5. package/dist/module/components/index.js +1 -2
  6. package/dist/module/components/index.js.map +1 -1
  7. package/dist/module/components/types.js.map +1 -1
  8. package/dist/module/conditions/condition-field.js.map +1 -1
  9. package/dist/module/conditions/condition-operators.js +12 -11
  10. package/dist/module/conditions/condition-operators.js.map +1 -1
  11. package/dist/module/conditions/enums.js +5 -0
  12. package/dist/module/conditions/enums.js.map +1 -1
  13. package/dist/module/conditions/index.js +1 -1
  14. package/dist/module/conditions/index.js.map +1 -1
  15. package/dist/module/form/form-definition/index.js +4 -3
  16. package/dist/module/form/form-definition/index.js.map +1 -1
  17. package/dist/module/index.js +0 -1
  18. package/dist/module/index.js.map +1 -1
  19. package/dist/types/components/component-types.d.ts.map +1 -1
  20. package/dist/types/components/enums.d.ts +8 -2
  21. package/dist/types/components/enums.d.ts.map +1 -1
  22. package/dist/types/components/index.d.ts +1 -2
  23. package/dist/types/components/index.d.ts.map +1 -1
  24. package/dist/types/components/types.d.ts +46 -47
  25. package/dist/types/components/types.d.ts.map +1 -1
  26. package/dist/types/conditions/condition-field.d.ts +1 -1
  27. package/dist/types/conditions/condition-operators.d.ts +2 -1
  28. package/dist/types/conditions/condition-operators.d.ts.map +1 -1
  29. package/dist/types/conditions/enums.d.ts +4 -0
  30. package/dist/types/conditions/enums.d.ts.map +1 -1
  31. package/dist/types/conditions/index.d.ts +1 -1
  32. package/dist/types/conditions/index.d.ts.map +1 -1
  33. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  34. package/dist/types/index.d.ts +0 -1
  35. package/dist/types/index.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/src/components/component-types.ts +47 -46
  38. package/src/components/enums.ts +9 -2
  39. package/src/components/index.ts +1 -2
  40. package/src/components/types.ts +68 -71
  41. package/src/conditions/condition-field.ts +1 -1
  42. package/src/conditions/condition-operators.ts +19 -15
  43. package/src/conditions/enums.ts +5 -0
  44. package/src/conditions/index.ts +1 -1
  45. package/src/form/form-definition/index.ts +20 -11
  46. package/src/index.ts +0 -1
  47. package/dist/module/components/conditional-component-types.js +0 -10
  48. package/dist/module/components/conditional-component-types.js.map +0 -1
  49. package/dist/module/form/form-configuration/index.js +0 -16
  50. package/dist/module/form/form-configuration/index.js.map +0 -1
  51. package/dist/types/components/conditional-component-types.d.ts +0 -3
  52. package/dist/types/components/conditional-component-types.d.ts.map +0 -1
  53. package/dist/types/form/form-configuration/index.d.ts +0 -8
  54. package/dist/types/form/form-configuration/index.d.ts.map +0 -1
  55. package/src/components/conditional-component-types.ts +0 -14
  56. package/src/form/form-configuration/index.ts +0 -21
@@ -1,184 +1,185 @@
1
+ import { ComponentSubType, ComponentType } from "./enums.js";
1
2
  export const ComponentTypes = [{
2
3
  name: 'TextField',
3
- type: 'TextField',
4
+ type: ComponentType.TextField,
4
5
  title: 'Text field',
5
- subType: 'field',
6
+ subType: ComponentSubType.Field,
6
7
  hint: '',
7
8
  options: {},
8
9
  schema: {}
9
10
  }, {
10
11
  name: 'MultilineTextField',
11
- type: 'MultilineTextField',
12
+ type: ComponentType.MultilineTextField,
12
13
  title: 'Multiline text field',
13
- subType: 'field',
14
+ subType: ComponentSubType.Field,
14
15
  hint: '',
15
16
  options: {},
16
17
  schema: {}
17
18
  }, {
18
19
  name: 'YesNoField',
19
- type: 'YesNoField',
20
+ type: ComponentType.YesNoField,
20
21
  title: 'Yes/No field',
21
- subType: 'field',
22
+ subType: ComponentSubType.Field,
22
23
  hint: '',
23
24
  options: {},
24
25
  schema: {}
25
26
  }, {
26
27
  name: 'DateField',
27
- type: 'DateField',
28
+ type: ComponentType.DateField,
28
29
  title: 'Date field',
29
- subType: 'field',
30
+ subType: ComponentSubType.Field,
30
31
  hint: '',
31
32
  options: {},
32
33
  schema: {}
33
34
  }, {
34
35
  name: 'TimeField',
35
- type: 'TimeField',
36
+ type: ComponentType.TimeField,
36
37
  title: 'Time field',
37
- subType: 'field',
38
+ subType: ComponentSubType.Field,
38
39
  hint: '',
39
40
  options: {},
40
41
  schema: {}
41
42
  }, {
42
43
  name: 'DateTimeField',
43
- type: 'DateTimeField',
44
+ type: ComponentType.DateTimeField,
44
45
  title: 'Date time field',
45
- subType: 'field',
46
+ subType: ComponentSubType.Field,
46
47
  hint: '',
47
48
  options: {},
48
49
  schema: {}
49
50
  }, {
50
51
  name: 'DatePartsField',
51
- type: 'DatePartsField',
52
+ type: ComponentType.DatePartsField,
52
53
  title: 'Date parts field',
53
- subType: 'field',
54
+ subType: ComponentSubType.Field,
54
55
  hint: '',
55
56
  options: {},
56
57
  schema: {}
57
58
  }, {
58
59
  name: 'DateTimePartsField',
59
- type: 'DateTimePartsField',
60
+ type: ComponentType.DateTimePartsField,
60
61
  title: 'Date time parts field',
61
- subType: 'field',
62
+ subType: ComponentSubType.Field,
62
63
  hint: '',
63
64
  options: {},
64
65
  schema: {}
65
66
  }, {
66
67
  name: 'MonthYearField',
67
- type: 'MonthYearField',
68
+ type: ComponentType.MonthYearField,
68
69
  title: 'Month year field',
69
- subType: 'field',
70
+ subType: ComponentSubType.Field,
70
71
  hint: '',
71
72
  options: {},
72
73
  schema: {}
73
74
  }, {
74
75
  name: 'SelectField',
75
- type: 'SelectField',
76
+ type: ComponentType.SelectField,
76
77
  title: 'Select field',
77
- subType: 'listField',
78
+ subType: ComponentSubType.ListField,
78
79
  options: {},
79
80
  schema: {},
80
81
  list: ''
81
82
  }, {
82
83
  name: 'AutocompleteField',
83
- type: 'AutocompleteField',
84
+ type: ComponentType.AutocompleteField,
84
85
  title: 'Autocomplete field',
85
- subType: 'listField',
86
+ subType: ComponentSubType.ListField,
86
87
  options: {},
87
88
  schema: {},
88
89
  list: ''
89
90
  }, {
90
91
  name: 'RadiosField',
91
- type: 'RadiosField',
92
+ type: ComponentType.RadiosField,
92
93
  title: 'Radios field',
93
- subType: 'listField',
94
+ subType: ComponentSubType.ListField,
94
95
  options: {},
95
96
  schema: {},
96
97
  list: ''
97
98
  }, {
98
99
  name: 'CheckboxesField',
99
- type: 'CheckboxesField',
100
+ type: ComponentType.CheckboxesField,
100
101
  title: 'Checkboxes field',
101
- subType: 'listField',
102
+ subType: ComponentSubType.ListField,
102
103
  options: {},
103
104
  schema: {},
104
105
  list: ''
105
106
  }, {
106
107
  name: 'NumberField',
107
- type: 'NumberField',
108
+ type: ComponentType.NumberField,
108
109
  title: 'Number field',
109
- subType: 'field',
110
+ subType: ComponentSubType.Field,
110
111
  hint: '',
111
112
  options: {},
112
113
  schema: {}
113
114
  }, {
114
115
  name: 'UkAddressField',
115
- type: 'UkAddressField',
116
+ type: ComponentType.UkAddressField,
116
117
  title: 'UK address field',
117
- subType: 'field',
118
+ subType: ComponentSubType.Field,
118
119
  hint: '',
119
120
  options: {},
120
121
  schema: {}
121
122
  }, {
122
123
  name: 'TelephoneNumberField',
123
- type: 'TelephoneNumberField',
124
+ type: ComponentType.TelephoneNumberField,
124
125
  title: 'Telephone number field',
125
- subType: 'field',
126
+ subType: ComponentSubType.Field,
126
127
  hint: '',
127
128
  options: {},
128
129
  schema: {}
129
130
  }, {
130
131
  name: 'EmailAddressField',
131
- type: 'EmailAddressField',
132
+ type: ComponentType.EmailAddressField,
132
133
  title: 'Email address field',
133
- subType: 'field',
134
+ subType: ComponentSubType.Field,
134
135
  hint: '',
135
136
  options: {},
136
137
  schema: {}
137
138
  }, {
138
139
  name: 'FileUploadField',
139
- type: 'FileUploadField',
140
+ type: ComponentType.FileUploadField,
140
141
  title: 'File upload field',
141
- subType: 'field',
142
+ subType: ComponentSubType.Field,
142
143
  hint: '',
143
144
  options: {},
144
145
  schema: {}
145
146
  }, {
146
147
  name: 'Html',
147
- type: 'Html',
148
+ type: ComponentType.Html,
148
149
  title: 'Html',
149
- subType: 'content',
150
+ subType: ComponentSubType.Content,
150
151
  content: '',
151
152
  options: {},
152
153
  schema: {}
153
154
  }, {
154
155
  name: 'InsetText',
155
- type: 'InsetText',
156
+ type: ComponentType.InsetText,
156
157
  title: 'Inset text',
157
- subType: 'content',
158
+ subType: ComponentSubType.Content,
158
159
  content: '',
159
160
  options: {},
160
161
  schema: {}
161
162
  }, {
162
163
  name: 'Details',
163
- type: 'Details',
164
+ type: ComponentType.Details,
164
165
  title: 'Details',
165
- subType: 'content',
166
+ subType: ComponentSubType.Content,
166
167
  content: '',
167
168
  options: {},
168
169
  schema: {}
169
170
  }, {
170
171
  name: 'List',
171
- type: 'List',
172
+ type: ComponentType.List,
172
173
  title: 'List',
173
- subType: 'content',
174
+ subType: ComponentSubType.Content,
174
175
  options: {},
175
176
  schema: {},
176
177
  list: ''
177
178
  }, {
178
179
  name: 'WebsiteField',
179
- type: 'WebsiteField',
180
+ type: ComponentType.WebsiteField,
180
181
  title: 'Website field',
181
- subType: 'field',
182
+ subType: ComponentSubType.Field,
182
183
  hint: '',
183
184
  options: {},
184
185
  schema: {}
@@ -1 +1 @@
1
- {"version":3,"file":"component-types.js","names":["ComponentTypes","name","type","title","subType","hint","options","schema","list","content"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\n\nexport const ComponentTypes: ComponentDef[] = [\n {\n name: 'TextField',\n type: 'TextField',\n title: 'Text field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n type: 'MultilineTextField',\n title: 'Multiline text field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n type: 'YesNoField',\n title: 'Yes/No field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateField',\n type: 'DateField',\n title: 'Date field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TimeField',\n type: 'TimeField',\n title: 'Time field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimeField',\n type: 'DateTimeField',\n title: 'Date time field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DatePartsField',\n type: 'DatePartsField',\n title: 'Date parts field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimePartsField',\n type: 'DateTimePartsField',\n title: 'Date time parts field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MonthYearField',\n type: 'MonthYearField',\n title: 'Month year field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'SelectField',\n type: 'SelectField',\n title: 'Select field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'AutocompleteField',\n type: 'AutocompleteField',\n title: 'Autocomplete field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'RadiosField',\n type: 'RadiosField',\n title: 'Radios field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'CheckboxesField',\n type: 'CheckboxesField',\n title: 'Checkboxes field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'NumberField',\n type: 'NumberField',\n title: 'Number field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n type: 'UkAddressField',\n title: 'UK address field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TelephoneNumberField',\n type: 'TelephoneNumberField',\n title: 'Telephone number field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'EmailAddressField',\n type: 'EmailAddressField',\n title: 'Email address field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'FileUploadField',\n type: 'FileUploadField',\n title: 'File upload field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n type: 'Html',\n title: 'Html',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'InsetText',\n type: 'InsetText',\n title: 'Inset text',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Details',\n type: 'Details',\n title: 'Details',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'List',\n type: 'List',\n title: 'List',\n subType: 'content',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'WebsiteField',\n type: 'WebsiteField',\n title: 'Website field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n }\n]\n"],"mappings":"AAEA,OAAO,MAAMA,cAA8B,GAAG,CAC5C;EACEC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,WAAW;EACjBC,IAAI,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ACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF","ignoreList":[]}
1
+ {"version":3,"file":"component-types.js","names":["ComponentSubType","ComponentType","ComponentTypes","name","type","TextField","title","subType","Field","hint","options","schema","MultilineTextField","YesNoField","DateField","TimeField","DateTimeField","DatePartsField","DateTimePartsField","MonthYearField","SelectField","ListField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","FileUploadField","Html","Content","content","InsetText","Details","List","WebsiteField"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentSubType, ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\nexport const ComponentTypes: ComponentDef[] = [\n {\n name: 'TextField',\n type: ComponentType.TextField,\n title: 'Text field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n type: ComponentType.MultilineTextField,\n title: 'Multiline text field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n type: ComponentType.YesNoField,\n title: 'Yes/No field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateField',\n type: ComponentType.DateField,\n title: 'Date field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TimeField',\n type: ComponentType.TimeField,\n title: 'Time field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimeField',\n type: ComponentType.DateTimeField,\n title: 'Date time field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DatePartsField',\n type: ComponentType.DatePartsField,\n title: 'Date parts field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimePartsField',\n type: ComponentType.DateTimePartsField,\n title: 'Date time parts field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MonthYearField',\n type: ComponentType.MonthYearField,\n title: 'Month year field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'SelectField',\n type: ComponentType.SelectField,\n title: 'Select field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'AutocompleteField',\n type: ComponentType.AutocompleteField,\n title: 'Autocomplete field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'RadiosField',\n type: ComponentType.RadiosField,\n title: 'Radios field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'CheckboxesField',\n type: ComponentType.CheckboxesField,\n title: 'Checkboxes field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'NumberField',\n type: ComponentType.NumberField,\n title: 'Number field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n type: ComponentType.UkAddressField,\n title: 'UK address field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TelephoneNumberField',\n type: ComponentType.TelephoneNumberField,\n title: 'Telephone number field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'EmailAddressField',\n type: ComponentType.EmailAddressField,\n title: 'Email address field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'FileUploadField',\n type: ComponentType.FileUploadField,\n title: 'File upload field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n type: ComponentType.Html,\n title: 'Html',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'InsetText',\n type: ComponentType.InsetText,\n title: 'Inset text',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Details',\n type: ComponentType.Details,\n title: 'Details',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'List',\n type: ComponentType.List,\n title: 'List',\n subType: ComponentSubType.Content,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'WebsiteField',\n type: ComponentType.WebsiteField,\n title: 'Website field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n }\n]\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,aAAa;AAGxC,OAAO,MAAMC,cAA8B,GAAG,CAC5C;EACEC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAEH,aAAa,CAACI,SAAS;EAC7BC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAEP,gBAAgB,CAACQ,KAAK;EAC/BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACER,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAEH,aAAa,CAACW,kBAAkB;EACtCN,KAAK,EAAE,sBAAsB;EAC7BC,OAAO,EAAEP,gBAAgB,CAACQ,KAAK;EAC/BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACER,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAEH,aAAa,CAACY,UAAU;EAC9BP,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAEP,gBAAgB,CAACQ,KAAK;EAC/BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACER,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAEH,aAAa,CAACa,SAAS;EAC7BR,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAEP,gBAAgB,CAACQ,KAAK;EAC/BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EAC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CAAC,EACD;EACER,IAAI,EAAE,SAAS;EACfC,IAAI,EAAEH,aAAa,CAACkC,OAAO;EAC3B7B,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAEP,gBAAgB,CAACgC,OAAO;EACjCC,OAAO,EAAE,EAAE;EACXvB,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACER,IAAI,EAAE,MAAM;EACZC,IAAI,EAAEH,aAAa,CAACmC,IAAI;EACxB9B,KAAK,EAAE,MAAM;EACbC,OAAO,EAAEP,gBAAgB,CAACgC,OAAO;EACjCtB,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC,CAAC;EACVW,IAAI,EAAE;AACR,CAAC,EACD;EACEnB,IAAI,EAAE,cAAc;EACpBC,IAAI,EAAEH,aAAa,CAACoC,YAAY;EAChC/B,KAAK,EAAE,eAAe;EACtBC,OAAO,EAAEP,gBAAgB,CAACQ,KAAK;EAC/BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF","ignoreList":[]}
@@ -1,26 +1,33 @@
1
- export let ComponentTypeEnum = /*#__PURE__*/function (ComponentTypeEnum) {
2
- ComponentTypeEnum["TextField"] = "TextField";
3
- ComponentTypeEnum["MultilineTextField"] = "MultilineTextField";
4
- ComponentTypeEnum["YesNoField"] = "YesNoField";
5
- ComponentTypeEnum["DateField"] = "DateField";
6
- ComponentTypeEnum["TimeField"] = "TimeField";
7
- ComponentTypeEnum["DateTimeField"] = "DateTimeField";
8
- ComponentTypeEnum["DatePartsField"] = "DatePartsField";
9
- ComponentTypeEnum["MonthYearField"] = "MonthYearField";
10
- ComponentTypeEnum["DateTimePartsField"] = "DateTimePartsField";
11
- ComponentTypeEnum["SelectField"] = "SelectField";
12
- ComponentTypeEnum["AutocompleteField"] = "AutocompleteField";
13
- ComponentTypeEnum["RadiosField"] = "RadiosField";
14
- ComponentTypeEnum["CheckboxesField"] = "CheckboxesField";
15
- ComponentTypeEnum["NumberField"] = "NumberField";
16
- ComponentTypeEnum["UkAddressField"] = "UkAddressField";
17
- ComponentTypeEnum["TelephoneNumberField"] = "TelephoneNumberField";
18
- ComponentTypeEnum["EmailAddressField"] = "EmailAddressField";
19
- ComponentTypeEnum["FileUploadField"] = "FileUploadField";
20
- ComponentTypeEnum["Html"] = "Html";
21
- ComponentTypeEnum["InsetText"] = "InsetText";
22
- ComponentTypeEnum["Details"] = "Details";
23
- ComponentTypeEnum["List"] = "List";
24
- return ComponentTypeEnum;
1
+ export let ComponentType = /*#__PURE__*/function (ComponentType) {
2
+ ComponentType["TextField"] = "TextField";
3
+ ComponentType["MultilineTextField"] = "MultilineTextField";
4
+ ComponentType["YesNoField"] = "YesNoField";
5
+ ComponentType["DateField"] = "DateField";
6
+ ComponentType["TimeField"] = "TimeField";
7
+ ComponentType["DateTimeField"] = "DateTimeField";
8
+ ComponentType["DatePartsField"] = "DatePartsField";
9
+ ComponentType["MonthYearField"] = "MonthYearField";
10
+ ComponentType["DateTimePartsField"] = "DateTimePartsField";
11
+ ComponentType["SelectField"] = "SelectField";
12
+ ComponentType["AutocompleteField"] = "AutocompleteField";
13
+ ComponentType["RadiosField"] = "RadiosField";
14
+ ComponentType["CheckboxesField"] = "CheckboxesField";
15
+ ComponentType["NumberField"] = "NumberField";
16
+ ComponentType["UkAddressField"] = "UkAddressField";
17
+ ComponentType["TelephoneNumberField"] = "TelephoneNumberField";
18
+ ComponentType["EmailAddressField"] = "EmailAddressField";
19
+ ComponentType["FileUploadField"] = "FileUploadField";
20
+ ComponentType["Html"] = "Html";
21
+ ComponentType["InsetText"] = "InsetText";
22
+ ComponentType["Details"] = "Details";
23
+ ComponentType["List"] = "List";
24
+ ComponentType["WebsiteField"] = "WebsiteField";
25
+ return ComponentType;
26
+ }({});
27
+ export let ComponentSubType = /*#__PURE__*/function (ComponentSubType) {
28
+ ComponentSubType["Content"] = "content";
29
+ ComponentSubType["Field"] = "field";
30
+ ComponentSubType["ListField"] = "listField";
31
+ return ComponentSubType;
25
32
  }({});
26
33
  //# sourceMappingURL=enums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["ComponentTypeEnum"],"sources":["../../../src/components/enums.ts"],"sourcesContent":["export enum ComponentTypeEnum {\n TextField = 'TextField',\n MultilineTextField = 'MultilineTextField',\n YesNoField = 'YesNoField',\n DateField = 'DateField',\n TimeField = 'TimeField',\n DateTimeField = 'DateTimeField',\n DatePartsField = 'DatePartsField',\n MonthYearField = 'MonthYearField',\n DateTimePartsField = 'DateTimePartsField',\n SelectField = 'SelectField',\n AutocompleteField = 'AutocompleteField',\n RadiosField = 'RadiosField',\n CheckboxesField = 'CheckboxesField',\n NumberField = 'NumberField',\n UkAddressField = 'UkAddressField',\n TelephoneNumberField = 'TelephoneNumberField',\n EmailAddressField = 'EmailAddressField',\n FileUploadField = 'FileUploadField',\n Html = 'Html',\n InsetText = 'InsetText',\n Details = 'Details',\n List = 'List'\n}\n"],"mappings":"AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["ComponentType","ComponentSubType"],"sources":["../../../src/components/enums.ts"],"sourcesContent":["export enum ComponentType {\n TextField = 'TextField',\n MultilineTextField = 'MultilineTextField',\n YesNoField = 'YesNoField',\n DateField = 'DateField',\n TimeField = 'TimeField',\n DateTimeField = 'DateTimeField',\n DatePartsField = 'DatePartsField',\n MonthYearField = 'MonthYearField',\n DateTimePartsField = 'DateTimePartsField',\n SelectField = 'SelectField',\n AutocompleteField = 'AutocompleteField',\n RadiosField = 'RadiosField',\n CheckboxesField = 'CheckboxesField',\n NumberField = 'NumberField',\n UkAddressField = 'UkAddressField',\n TelephoneNumberField = 'TelephoneNumberField',\n EmailAddressField = 'EmailAddressField',\n FileUploadField = 'FileUploadField',\n Html = 'Html',\n InsetText = 'InsetText',\n Details = 'Details',\n List = 'List',\n WebsiteField = 'WebsiteField'\n}\n\nexport enum ComponentSubType {\n Content = 'content',\n Field = 'field',\n ListField = 'listField'\n}\n"],"mappings":"AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AA0BzB,WAAYC,gBAAgB,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA","ignoreList":[]}
@@ -1,4 +1,3 @@
1
1
  export { ComponentTypes } from "./component-types.js";
2
- export { ConditionalComponentTypes } from "./conditional-component-types.js";
3
- export { ComponentTypeEnum } from "./enums.js";
2
+ export { ComponentType, ComponentSubType } from "./enums.js";
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentTypes","ConditionalComponentTypes","ComponentTypeEnum"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types.js'\nexport { ConditionalComponentTypes } from '~/src/components/conditional-component-types.js'\nexport { ComponentTypeEnum } from '~/src/components/enums.js'\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAASC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ComponentTypes","ComponentType","ComponentSubType"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types.js'\nexport { ComponentType, ComponentSubType } from '~/src/components/enums.js'\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SAASC,aAAa,EAAEC,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/types.ts"],"sourcesContent":["export type ComponentType =\n | 'TextField'\n | 'MultilineTextField'\n | 'YesNoField'\n | 'DateField'\n | 'TimeField'\n | 'DateTimeField'\n | 'MonthYearField'\n | 'DatePartsField'\n | 'DateTimePartsField'\n | 'SelectField'\n | 'AutocompleteField'\n | 'RadiosField'\n | 'CheckboxesField'\n | 'NumberField'\n | 'UkAddressField'\n | 'TelephoneNumberField'\n | 'EmailAddressField'\n | 'FileUploadField'\n | 'Html'\n | 'InsetText'\n | 'Details'\n | 'List'\n | 'WebsiteField'\n\nexport type ComponentSubType = 'field' | 'content'\n\nexport interface ConditionalComponent {\n name: 'TextField' | 'NumberField'\n title: string\n subType: 'field'\n}\n\nexport interface ContentOptions {\n condition?: string\n}\n\n/**\n * Types for Components JSON structure which are expected by engine and turned into actual form input/content/lists\n */\ninterface TextFieldBase {\n subType?: 'field'\n type: string\n name: string\n title: string\n hint?: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n allow?: string\n autocomplete?: string\n exposeToContext?: boolean\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n error?: any // TODO: in same cases this is a function e.g. addressLine1 in ukaddress\n }\n}\n\ninterface NumberFieldBase {\n subType?: 'field'\n type: string\n name: string\n title: string\n hint: string\n options: {\n prefix?: string\n suffix?: string\n exposeToContext?: boolean\n }\n schema: {\n min?: number\n max?: number\n precision?: number\n }\n}\n\ninterface ListFieldBase {\n subType?: 'listField' | 'content'\n type: string\n name: string\n title: string\n options: {\n type?: string\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n bold?: boolean\n exposeToContext?: boolean\n allowPrePopulation?: boolean\n }\n list: string\n schema: {}\n}\n\ninterface ContentFieldBase {\n subType?: 'content'\n type: string\n name: string\n title: string\n content: string\n options: ContentOptions\n schema: {}\n}\n\ninterface DateFieldBase {\n subType?: 'field'\n type: string\n name: string\n title: string\n hint: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n maxDaysInFuture?: number\n maxDaysInPast?: number\n exposeToContext?: boolean\n }\n schema: {}\n}\n\n// Text Fields\nexport interface TextFieldComponent extends TextFieldBase {\n type: 'TextField'\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface EmailAddressFieldComponent extends TextFieldBase {\n type: 'EmailAddressField'\n}\n\nexport interface NumberFieldComponent extends NumberFieldBase {\n type: 'NumberField'\n}\n\nexport interface WebsiteFieldComponent extends TextFieldBase {\n type: 'WebsiteField'\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface TelephoneNumberFieldComponent extends TextFieldBase {\n type: 'TelephoneNumberField'\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface YesNoFieldComponent extends TextFieldBase {\n type: 'YesNoField'\n}\n\nexport interface MultilineTextFieldComponent extends TextFieldBase {\n type: 'MultilineTextField'\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n rows?: number\n maxWords?: number\n }\n schema: {\n max?: number\n min?: number\n }\n}\n\nexport interface FileUploadFieldComponent {\n subType?: 'field'\n type: 'FileUploadField'\n name: string\n title: string\n hint: string\n options: {\n required?: boolean\n hideTitle?: boolean\n multiple?: boolean\n classes?: string\n exposeToContext?: boolean\n imageQualityPlayback?: boolean\n }\n schema: {}\n}\n\nexport interface UkAddressFieldComponent extends TextFieldBase {\n type: 'UkAddressField'\n}\n\n// Date Fields\nexport interface DateFieldComponent extends DateFieldBase {\n type: 'DateField'\n}\n\nexport interface DateTimeFieldComponent extends DateFieldBase {\n type: 'DateTimeField'\n}\n\nexport interface DatePartsFieldFieldComponent extends DateFieldBase {\n type: 'DatePartsField'\n}\n\nexport interface MonthYearFieldComponent extends DateFieldBase {\n type: 'MonthYearField'\n}\n\nexport interface DateTimePartsFieldComponent extends DateFieldBase {\n type: 'DateTimePartsField'\n}\n\nexport interface TimeFieldComponent extends DateFieldBase {\n type: 'TimeField'\n}\n\n// Content Fields\nexport interface DetailsComponent extends ContentFieldBase {\n type: 'Details'\n}\n\nexport interface HtmlComponent extends ContentFieldBase {\n type: 'Html'\n}\n\nexport interface InsetTextComponent extends ContentFieldBase {\n type: 'InsetText'\n}\n\n// List Fields\nexport interface ListComponent extends ListFieldBase {\n type: 'List'\n}\n\nexport interface AutocompleteFieldComponent extends ListFieldBase {\n type: 'AutocompleteField'\n subType?: 'listField'\n}\n\nexport interface CheckboxesFieldComponent extends ListFieldBase {\n type: 'CheckboxesField'\n subType?: 'listField'\n}\n\nexport interface RadiosFieldComponent extends ListFieldBase {\n type: 'RadiosField'\n subType?: 'listField'\n}\n\nexport interface SelectFieldComponent extends ListFieldBase {\n type: 'SelectField'\n options: ListFieldBase['options'] & { autocomplete?: string }\n subType?: 'listField'\n}\n\nexport type ComponentDef =\n | InsetTextComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | DateFieldComponent\n | DatePartsFieldFieldComponent\n | MonthYearFieldComponent\n | DateTimeFieldComponent\n | DateTimePartsFieldComponent\n | DetailsComponent\n | EmailAddressFieldComponent\n | FileUploadFieldComponent\n | HtmlComponent\n | ListComponent\n | MultilineTextFieldComponent\n | NumberFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | TelephoneNumberFieldComponent\n | TextFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n | YesNoFieldComponent\n | WebsiteFieldComponent\n\n// Components that render inputs.\nexport type InputFieldsComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | NumberFieldComponent\n | MultilineTextFieldComponent\n | TelephoneNumberFieldComponent\n | YesNoFieldComponent\n | FileUploadFieldComponent\n | DateFieldComponent\n | DateTimeFieldComponent\n | DateTimePartsFieldComponent\n | MonthYearFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n | WebsiteFieldComponent\n\n// Components that render content.\nexport type ContentComponentsDef =\n | DetailsComponent\n | HtmlComponent\n | InsetTextComponent\n | ListComponent\n\n// Components that render Lists\nexport type ListComponentsDef =\n | ListComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/types.ts"],"sourcesContent":["import {\n type ComponentSubType,\n type ComponentType\n} from '~/src/components/enums.js'\n\nexport interface ConditionalComponent {\n name: string\n title: string\n subType: ComponentSubType.Field\n}\n\nexport interface ContentOptions {\n condition?: string\n}\n\n/**\n * Types for Components JSON structure which are expected by engine and turned into actual form input/content/lists\n */\ninterface TextFieldBase {\n type:\n | ComponentType.EmailAddressField\n | ComponentType.MultilineTextField\n | ComponentType.NumberField\n | ComponentType.TelephoneNumberField\n | ComponentType.TextField\n | ComponentType.UkAddressField\n | ComponentType.WebsiteField\n | ComponentType.YesNoField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint?: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n allow?: string\n autocomplete?: string\n exposeToContext?: boolean\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n error?: unknown\n }\n}\n\ninterface NumberFieldBase {\n type: ComponentType\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n prefix?: string\n suffix?: string\n exposeToContext?: boolean\n }\n schema: {\n min?: number\n max?: number\n precision?: number\n }\n}\n\ninterface ListFieldBase {\n type:\n | ComponentType.AutocompleteField\n | ComponentType.CheckboxesField\n | ComponentType.List\n | ComponentType.RadiosField\n | ComponentType.SelectField\n subType?: ComponentSubType.Content | ComponentSubType.ListField\n name: string\n title: string\n options: {\n type?: string\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n bold?: boolean\n exposeToContext?: boolean\n allowPrePopulation?: boolean\n }\n list: string\n schema: object\n}\n\ninterface ContentFieldBase {\n type: ComponentType.Details | ComponentType.Html | ComponentType.InsetText\n subType?: ComponentSubType.Content\n name: string\n title: string\n content: string\n options: ContentOptions\n schema?: object\n}\n\ninterface DateFieldBase {\n type:\n | ComponentType.DateField\n | ComponentType.DatePartsField\n | ComponentType.DateTimeField\n | ComponentType.DateTimePartsField\n | ComponentType.MonthYearField\n | ComponentType.TimeField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n maxDaysInFuture?: number\n maxDaysInPast?: number\n exposeToContext?: boolean\n }\n schema: object\n}\n\n// Text Fields\nexport interface TextFieldComponent extends TextFieldBase {\n type: ComponentType.TextField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface EmailAddressFieldComponent extends TextFieldBase {\n type: ComponentType.EmailAddressField\n}\n\nexport interface NumberFieldComponent extends NumberFieldBase {\n type: ComponentType.NumberField\n}\n\nexport interface WebsiteFieldComponent extends TextFieldBase {\n type: ComponentType.WebsiteField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface TelephoneNumberFieldComponent extends TextFieldBase {\n type: ComponentType.TelephoneNumberField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface YesNoFieldComponent extends TextFieldBase {\n type: ComponentType.YesNoField\n}\n\nexport interface MultilineTextFieldComponent extends TextFieldBase {\n type: ComponentType.MultilineTextField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n rows?: number\n maxWords?: number\n }\n schema: {\n max?: number\n min?: number\n }\n}\n\nexport interface FileUploadFieldComponent {\n type: ComponentType.FileUploadField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n required?: boolean\n hideTitle?: boolean\n multiple?: boolean\n classes?: string\n exposeToContext?: boolean\n imageQualityPlayback?: boolean\n }\n schema: object\n}\n\nexport interface UkAddressFieldComponent extends TextFieldBase {\n type: ComponentType.UkAddressField\n}\n\n// Date Fields\nexport interface DateFieldComponent extends DateFieldBase {\n type: ComponentType.DateField\n}\n\nexport interface DateTimeFieldComponent extends DateFieldBase {\n type: ComponentType.DateTimeField\n}\n\nexport interface DatePartsFieldFieldComponent extends DateFieldBase {\n type: ComponentType.DatePartsField\n}\n\nexport interface MonthYearFieldComponent extends DateFieldBase {\n type: ComponentType.MonthYearField\n}\n\nexport interface DateTimePartsFieldComponent extends DateFieldBase {\n type: ComponentType.DateTimePartsField\n}\n\nexport interface TimeFieldComponent extends DateFieldBase {\n type: ComponentType.TimeField\n}\n\n// Content Fields\nexport interface DetailsComponent extends ContentFieldBase {\n type: ComponentType.Details\n}\n\nexport interface HtmlComponent extends ContentFieldBase {\n type: ComponentType.Html\n}\n\nexport interface InsetTextComponent extends ContentFieldBase {\n type: ComponentType.InsetText\n}\n\n// List Fields\nexport interface ListComponent extends ListFieldBase {\n type: ComponentType.List\n}\n\nexport interface AutocompleteFieldComponent extends ListFieldBase {\n type: ComponentType.AutocompleteField\n subType?: ComponentSubType.ListField\n}\n\nexport interface CheckboxesFieldComponent extends ListFieldBase {\n type: ComponentType.CheckboxesField\n subType?: ComponentSubType.ListField\n}\n\nexport interface RadiosFieldComponent extends ListFieldBase {\n type: ComponentType.RadiosField\n subType?: ComponentSubType.ListField\n}\n\nexport interface SelectFieldComponent extends ListFieldBase {\n type: ComponentType.SelectField\n subType?: ComponentSubType.ListField\n options: ListFieldBase['options'] & { autocomplete?: string }\n}\n\nexport type ComponentDef =\n | InsetTextComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | DateFieldComponent\n | DatePartsFieldFieldComponent\n | MonthYearFieldComponent\n | DateTimeFieldComponent\n | DateTimePartsFieldComponent\n | DetailsComponent\n | EmailAddressFieldComponent\n | FileUploadFieldComponent\n | HtmlComponent\n | ListComponent\n | MultilineTextFieldComponent\n | NumberFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | TelephoneNumberFieldComponent\n | TextFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n | YesNoFieldComponent\n | WebsiteFieldComponent\n\n// Components that render inputs.\nexport type InputFieldsComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | NumberFieldComponent\n | MultilineTextFieldComponent\n | TelephoneNumberFieldComponent\n | YesNoFieldComponent\n | FileUploadFieldComponent\n | DateFieldComponent\n | DateTimeFieldComponent\n | DateTimePartsFieldComponent\n | MonthYearFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n | WebsiteFieldComponent\n\n// Components that render content.\nexport type ContentComponentsDef =\n | DetailsComponent\n | HtmlComponent\n | InsetTextComponent\n | ListComponent\n\n// Components that render Lists\nexport type ListComponentsDef =\n | ListComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"condition-field.js","names":["ComponentTypes","ConditionField","name","type","display","constructor","Error","find","componentType","from","obj"],"sources":["../../../src/conditions/condition-field.ts"],"sourcesContent":["import { ComponentTypes } from '~/src/components/component-types.js'\nimport { type ComponentType } from '~/src/components/types.js'\n\nexport class ConditionField {\n name: string\n type: ComponentType\n display: string\n\n constructor(name: string, type: ComponentType, display: string) {\n if (!name || typeof name !== 'string') {\n throw Error(`name ${name} is not valid`)\n }\n\n if (!ComponentTypes.find((componentType) => componentType.type === type)) {\n throw Error(`type ${type} is not valid`)\n }\n\n if (!display || typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n\n this.name = name\n this.type = type\n this.display = display\n }\n\n static from(obj: { name: string; type: ComponentType; display: string }) {\n return new ConditionField(obj.name, obj.type, obj.display)\n }\n}\n"],"mappings":"AAAA,SAASA,cAAc;AAGvB,OAAO,MAAMC,cAAc,CAAC;EAC1BC,IAAI;EACJC,IAAI;EACJC,OAAO;EAEPC,WAAWA,CAACH,IAAY,EAAEC,IAAmB,EAAEC,OAAe,EAAE;IAC9D,IAAI,CAACF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACrC,MAAMI,KAAK,CAAC,QAAQJ,IAAI,eAAe,CAAC;IAC1C;IAEA,IAAI,CAACF,cAAc,CAACO,IAAI,CAAEC,aAAa,IAAKA,aAAa,CAACL,IAAI,KAAKA,IAAI,CAAC,EAAE;MACxE,MAAMG,KAAK,CAAC,QAAQH,IAAI,eAAe,CAAC;IAC1C;IAEA,IAAI,CAACC,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC3C,MAAME,KAAK,CAAC,WAAWF,OAAO,eAAe,CAAC;IAChD;IAEA,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;EACxB;EAEA,OAAOK,IAAIA,CAACC,GAA2D,EAAE;IACvE,OAAO,IAAIT,cAAc,CAACS,GAAG,CAACR,IAAI,EAAEQ,GAAG,CAACP,IAAI,EAAEO,GAAG,CAACN,OAAO,CAAC;EAC5D;AACF","ignoreList":[]}
1
+ {"version":3,"file":"condition-field.js","names":["ComponentTypes","ConditionField","name","type","display","constructor","Error","find","componentType","from","obj"],"sources":["../../../src/conditions/condition-field.ts"],"sourcesContent":["import { ComponentTypes } from '~/src/components/component-types.js'\nimport { type ComponentType } from '~/src/components/enums.js'\n\nexport class ConditionField {\n name: string\n type: ComponentType\n display: string\n\n constructor(name: string, type: ComponentType, display: string) {\n if (!name || typeof name !== 'string') {\n throw Error(`name ${name} is not valid`)\n }\n\n if (!ComponentTypes.find((componentType) => componentType.type === type)) {\n throw Error(`type ${type} is not valid`)\n }\n\n if (!display || typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n\n this.name = name\n this.type = type\n this.display = display\n }\n\n static from(obj: { name: string; type: ComponentType; display: string }) {\n return new ConditionField(obj.name, obj.type, obj.display)\n }\n}\n"],"mappings":"AAAA,SAASA,cAAc;AAGvB,OAAO,MAAMC,cAAc,CAAC;EAC1BC,IAAI;EACJC,IAAI;EACJC,OAAO;EAEPC,WAAWA,CAACH,IAAY,EAAEC,IAAmB,EAAEC,OAAe,EAAE;IAC9D,IAAI,CAACF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACrC,MAAMI,KAAK,CAAC,QAAQJ,IAAI,eAAe,CAAC;IAC1C;IAEA,IAAI,CAACF,cAAc,CAACO,IAAI,CAAEC,aAAa,IAAKA,aAAa,CAACL,IAAI,KAAKA,IAAI,CAAC,EAAE;MACxE,MAAMG,KAAK,CAAC,QAAQH,IAAI,eAAe,CAAC;IAC1C;IAEA,IAAI,CAACC,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC3C,MAAME,KAAK,CAAC,WAAWF,OAAO,eAAe,CAAC;IAChD;IAEA,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;EACxB;EAEA,OAAOK,IAAIA,CAACC,GAA2D,EAAE;IACvE,OAAO,IAAIT,cAAc,CAACS,GAAG,CAACR,IAAI,EAAEQ,GAAG,CAACP,IAAI,EAAEO,GAAG,CAACN,OAAO,CAAC;EAC5D;AACF","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ import { ComponentType } from "../components/enums.js";
1
2
  import { timeUnits, dateUnits, dateTimeUnits, ConditionValue, DateDirections, RelativeTimeValue } from "./condition-values.js";
2
3
  const defaultOperators = {
3
4
  is: inline('=='),
@@ -24,24 +25,24 @@ const relativeTimeOperators = units => ({
24
25
  'is more than': relativeTime('<', '>', units)
25
26
  });
26
27
  export const customOperators = {
27
- CheckboxesField: {
28
+ [ComponentType.CheckboxesField]: {
28
29
  contains: reverseInline('in'),
29
30
  'does not contain': not(reverseInline('in'))
30
31
  },
31
- NumberField: withDefaults({
32
+ [ComponentType.NumberField]: withDefaults({
32
33
  'is at least': inline('>='),
33
34
  'is at most': inline('<='),
34
35
  'is less than': inline('<'),
35
36
  'is more than': inline('>')
36
37
  }),
37
- DateField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateUnits)),
38
- TimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(timeUnits)),
39
- DatePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateUnits)),
40
- DateTimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateTimeUnits)),
41
- DateTimePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateTimeUnits)),
42
- TextField: withDefaults(textBasedFieldCustomisations),
43
- MultilineTextField: withDefaults(textBasedFieldCustomisations),
44
- EmailAddressField: withDefaults(textBasedFieldCustomisations)
38
+ [ComponentType.DateField]: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateUnits)),
39
+ [ComponentType.TimeField]: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(timeUnits)),
40
+ [ComponentType.DatePartsField]: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateUnits)),
41
+ [ComponentType.DateTimeField]: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateTimeUnits)),
42
+ [ComponentType.DateTimePartsField]: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateTimeUnits)),
43
+ [ComponentType.TextField]: withDefaults(textBasedFieldCustomisations),
44
+ [ComponentType.MultilineTextField]: withDefaults(textBasedFieldCustomisations),
45
+ [ComponentType.EmailAddressField]: withDefaults(textBasedFieldCustomisations)
45
46
  };
46
47
  export function getOperatorNames(fieldType) {
47
48
  return Object.keys(getConditionals(fieldType)).sort();
@@ -79,7 +80,7 @@ function not(operatorDefinition) {
79
80
  };
80
81
  }
81
82
  function formatValue(fieldType, value) {
82
- if (fieldType === 'NumberField' || fieldType === 'YesNoField') {
83
+ if (fieldType === ComponentType.YesNoField || fieldType === ComponentType.NumberField) {
83
84
  return value;
84
85
  }
85
86
  return `'${value}'`;
@@ -1 +1 @@
1
- {"version":3,"file":"condition-operators.js","names":["timeUnits","dateUnits","dateTimeUnits","ConditionValue","DateDirections","RelativeTimeValue","defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","CheckboxesField","contains","reverseInline","not","NumberField","DateField","TimeField","DatePartsField","DateTimeField","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","toExpression","Error","pastOperator","futureOperator","direction","PAST"],"sources":["../../../src/conditions/condition-operators.ts"],"sourcesContent":["import {\n type ComponentType,\n type ComponentDef\n} from '~/src/components/types.js'\nimport { type ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'\nimport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n DateDirections,\n RelativeTimeValue\n} from '~/src/conditions/condition-values.js'\n\ntype Operator = '==' | '!=' | '>=' | '<=' | '<' | '>'\n\nconst defaultOperators = {\n is: inline('=='),\n 'is not': inline('!=')\n}\n\nfunction withDefaults<T>(param: T) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textBasedFieldCustomisations = {\n 'is longer than': lengthIs('>'),\n 'is shorter than': lengthIs('<'),\n 'has length': lengthIs('==')\n}\n\nconst absoluteDateTimeOperators = {\n is: absoluteDateTime('=='),\n 'is not': absoluteDateTime('!='),\n 'is before': absoluteDateTime('<'),\n 'is after': absoluteDateTime('>')\n}\n\nconst relativeTimeOperators = (units) => ({\n 'is at least': relativeTime('<=', '>=', units),\n 'is at most': relativeTime('>=', '<=', units),\n 'is less than': relativeTime('>', '<', units),\n 'is more than': relativeTime('<', '>', units)\n})\n\nexport const customOperators = {\n CheckboxesField: {\n contains: reverseInline('in'),\n 'does not contain': not(reverseInline('in'))\n },\n NumberField: withDefaults({\n 'is at least': inline('>='),\n 'is at most': inline('<='),\n 'is less than': inline('<'),\n 'is more than': inline('>')\n }),\n DateField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n TimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(timeUnits)\n ),\n DatePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n DateTimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n DateTimePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n TextField: withDefaults(textBasedFieldCustomisations),\n MultilineTextField: withDefaults(textBasedFieldCustomisations),\n EmailAddressField: withDefaults(textBasedFieldCustomisations)\n}\n\nexport function getOperatorNames(fieldType) {\n return Object.keys(getConditionals(fieldType)).sort()\n}\n\nexport function getExpression(\n fieldType: ComponentType,\n fieldName: string,\n operator: string,\n value: ConditionValueAbstract\n) {\n return getConditionals(fieldType)[operator].expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(fieldType: ComponentType, operator) {\n return getConditionals(fieldType)[operator]\n}\n\nfunction getConditionals(fieldType: ComponentType) {\n return customOperators[fieldType] || defaultOperators\n}\n\nfunction inline(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) =>\n `${field.name} ${operator} ${formatValue(field.type, value.value)}`\n }\n}\n\nfunction lengthIs(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) =>\n `length(${field.name}) ${operator} ${value.value}`\n }\n}\n\nfunction reverseInline(operator: 'in') {\n return {\n expression: (field: ComponentDef, value) =>\n `${formatValue(field.type, value.value)} ${operator} ${field.name}`\n }\n}\n\nfunction not(operatorDefinition) {\n return {\n expression: (field: ComponentDef, value) =>\n `not (${operatorDefinition.expression(field, value)})`\n }\n}\n\nfunction formatValue(fieldType: ComponentType, value) {\n if (fieldType === 'NumberField' || fieldType === 'YesNoField') {\n return value\n }\n return `'${value}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) => {\n if (value instanceof ConditionValue) {\n return `${field.name} ${operator} '${value.toExpression()}'`\n }\n throw Error('only Value types are supported')\n }\n }\n}\n\nfunction relativeTime(pastOperator, futureOperator, units) {\n return {\n units,\n expression: (field: ComponentDef, value) => {\n if (value instanceof RelativeTimeValue) {\n const operator =\n value.direction === DateDirections.PAST\n ? pastOperator\n : futureOperator\n return `${field.name} ${operator} ${value.toExpression()}`\n }\n throw Error('time shift requires a TimeShiftValue')\n }\n }\n}\n"],"mappings":"AAKA,SACEA,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,iBAAiB;AAKnB,MAAMC,gBAAgB,GAAG;EACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;EAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;AACvB,CAAC;AAED,SAASC,YAAYA,CAAIC,KAAQ,EAAE;EACjC,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,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AkB,EAAE;EAC5C,OAAO;IACLE,UAAU,EAAEA,CAACI,KAAmB,EAAEL,KAAK,KAAK;MAC1C,IAAIA,KAAK,YAAYvC,cAAc,EAAE;QACnC,OAAO,GAAG4C,KAAK,CAACF,IAAI,IAAIJ,QAAQ,KAAKC,KAAK,CAACU,YAAY,CAAC,CAAC,GAAG;MAC9D;MACA,MAAMC,KAAK,CAAC,gCAAgC,CAAC;IAC/C;EACF,CAAC;AACH;AAEA,SAASlC,YAAYA,CAACmC,YAAY,EAAEC,cAAc,EAAErC,KAAK,EAAE;EACzD,OAAO;IACLA,KAAK;IACLyB,UAAU,EAAEA,CAACI,KAAmB,EAAEL,KAAK,KAAK;MAC1C,IAAIA,KAAK,YAAYrC,iBAAiB,EAAE;QACtC,MAAMoC,QAAQ,GACZC,KAAK,CAACc,SAAS,KAAKpD,cAAc,CAACqD,IAAI,GACnCH,YAAY,GACZC,cAAc;QACpB,OAAO,GAAGR,KAAK,CAACF,IAAI,IAAIJ,QAAQ,IAAIC,KAAK,CAACU,YAAY,CAAC,CAAC,EAAE;MAC5D;MACA,MAAMC,KAAK,CAAC,sCAAsC,CAAC;IACrD;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"condition-operators.js","names":["ComponentType","timeUnits","dateUnits","dateTimeUnits","ConditionValue","DateDirections","RelativeTimeValue","defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","CheckboxesField","contains","reverseInline","not","NumberField","DateField","TimeField","DatePartsField","DateTimeField","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","YesNoField","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","toExpression","Error","pastOperator","futureOperator","direction","PAST"],"sources":["../../../src/conditions/condition-operators.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'\nimport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n DateDirections,\n RelativeTimeValue\n} from '~/src/conditions/condition-values.js'\n\ntype Operator = '==' | '!=' | '>=' | '<=' | '<' | '>'\n\nconst defaultOperators = {\n is: inline('=='),\n 'is not': inline('!=')\n}\n\nfunction withDefaults<T>(param: T) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textBasedFieldCustomisations = {\n 'is longer than': lengthIs('>'),\n 'is shorter than': lengthIs('<'),\n 'has length': lengthIs('==')\n}\n\nconst absoluteDateTimeOperators = {\n is: absoluteDateTime('=='),\n 'is not': absoluteDateTime('!='),\n 'is before': absoluteDateTime('<'),\n 'is after': absoluteDateTime('>')\n}\n\nconst relativeTimeOperators = (units) => ({\n 'is at least': relativeTime('<=', '>=', units),\n 'is at most': relativeTime('>=', '<=', units),\n 'is less than': relativeTime('>', '<', units),\n 'is more than': relativeTime('<', '>', units)\n})\n\nexport const customOperators = {\n [ComponentType.CheckboxesField]: {\n contains: reverseInline('in'),\n 'does not contain': not(reverseInline('in'))\n },\n [ComponentType.NumberField]: withDefaults({\n 'is at least': inline('>='),\n 'is at most': inline('<='),\n 'is less than': inline('<'),\n 'is more than': inline('>')\n }),\n [ComponentType.DateField]: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n [ComponentType.TimeField]: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(timeUnits)\n ),\n [ComponentType.DatePartsField]: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n [ComponentType.DateTimeField]: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n [ComponentType.DateTimePartsField]: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n [ComponentType.TextField]: withDefaults(textBasedFieldCustomisations),\n [ComponentType.MultilineTextField]: withDefaults(\n textBasedFieldCustomisations\n ),\n [ComponentType.EmailAddressField]: withDefaults(textBasedFieldCustomisations)\n}\n\nexport function getOperatorNames(fieldType) {\n return Object.keys(getConditionals(fieldType)).sort()\n}\n\nexport function getExpression(\n fieldType: ComponentType,\n fieldName: string,\n operator: string,\n value: ConditionValueAbstract\n) {\n return getConditionals(fieldType)[operator].expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(fieldType: ComponentType, operator) {\n return getConditionals(fieldType)[operator]\n}\n\nfunction getConditionals(fieldType: ComponentType) {\n return customOperators[fieldType] || defaultOperators\n}\n\nfunction inline(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) =>\n `${field.name} ${operator} ${formatValue(field.type, value.value)}`\n }\n}\n\nfunction lengthIs(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) =>\n `length(${field.name}) ${operator} ${value.value}`\n }\n}\n\nfunction reverseInline(operator: 'in') {\n return {\n expression: (field: ComponentDef, value) =>\n `${formatValue(field.type, value.value)} ${operator} ${field.name}`\n }\n}\n\nfunction not(operatorDefinition) {\n return {\n expression: (field: ComponentDef, value) =>\n `not (${operatorDefinition.expression(field, value)})`\n }\n}\n\nfunction formatValue(fieldType: ComponentType, value) {\n if (\n fieldType === ComponentType.YesNoField ||\n fieldType === ComponentType.NumberField\n ) {\n return value\n }\n\n return `'${value}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) => {\n if (value instanceof ConditionValue) {\n return `${field.name} ${operator} '${value.toExpression()}'`\n }\n throw Error('only Value types are supported')\n }\n }\n}\n\nfunction relativeTime(pastOperator, futureOperator, units) {\n return {\n units,\n expression: (field: ComponentDef, value) => {\n if (value instanceof RelativeTimeValue) {\n const operator =\n value.direction === DateDirections.PAST\n ? pastOperator\n : futureOperator\n return `${field.name} ${operator} ${value.toExpression()}`\n }\n throw Error('time shift requires a TimeShiftValue')\n }\n }\n}\n"],"mappings":"AAAA,SAASA,aAAa;AAGtB,SACEC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,iBAAiB;AAKnB,MAAMC,gBAAgB,GAAG;EACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;EAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;AACvB,CAAC;AAED,SAASC,YAAYA,CAAIC,KAAQ,EAAE;EACjC,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAEJ,gBAAgB,CAAC;AACnD;AAEA,MAAMO,4BAA4B,GAAG;EACnC,gBAAgB,EAAEC,QAAQ,CAAC,GAAG,CAAC;EAC/B,iBAAiB,EAAEA,QAAQ,CAAC,GAAG,CAAC;EAChC,YAAY,EAAEA,QAAQ,CAAC,IAAI;AAC7B,CAAC;AAED,MAAMC,yBAAyB,GAAG;EAChCR,EAAE,EAAES,gBAAgB,CAAC,IAAI,CAAC;EAC1B,QAAQ,EAAEA,gBAAgB,CAAC,IAAI,CAAC;EAChC,WAAW,EAAEA,gBAAgB,CAAC,GAAG,CAAC;EAClC,UAAU,EAAEA,gBAAgB,CAAC,GAAG;AAClC,CAAC;AAED,MAAMC,qBAAqB,GAAIC,KAAK,KAAM;EACxC,aAAa,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CAAC;EAC9C,YAAY,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CAAC;EAC7C,cAAc,EAAEC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAED,KAAK,CAAC;EAC7C,cAAc,EAAEC,YAAY,CAAC,GAAG,EAAE,GA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AACe,SAAS,KAAKrD,cAAc,CAACsD,IAAI,GACnCH,YAAY,GACZC,cAAc;QACpB,OAAO,GAAGT,KAAK,CAACF,IAAI,IAAIJ,QAAQ,IAAIC,KAAK,CAACW,YAAY,CAAC,CAAC,EAAE;MAC5D;MACA,MAAMC,KAAK,CAAC,sCAAsC,CAAC;IACrD;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,3 +1,8 @@
1
+ export let ConditionType = /*#__PURE__*/function (ConditionType) {
2
+ ConditionType["Value"] = "Value";
3
+ ConditionType["RelativeTime"] = "RelativeTime";
4
+ return ConditionType;
5
+ }({});
1
6
  export let Coordinator = /*#__PURE__*/function (Coordinator) {
2
7
  Coordinator["AND"] = "and";
3
8
  Coordinator["OR"] = "or";
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["Coordinator"],"sources":["../../../src/conditions/enums.ts"],"sourcesContent":["export enum Coordinator {\n AND = 'and',\n OR = 'or'\n}\n"],"mappings":"AAAA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["ConditionType","Coordinator"],"sources":["../../../src/conditions/enums.ts"],"sourcesContent":["export enum ConditionType {\n Value = 'Value',\n RelativeTime = 'RelativeTime'\n}\n\nexport enum Coordinator {\n AND = 'and',\n OR = 'or'\n}\n"],"mappings":"AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAKzB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
@@ -7,5 +7,5 @@ export { ConditionGroup } from "./condition-group.js";
7
7
  export { ConditionsModel } from "./condition-model.js";
8
8
  export { ConditionGroupDef } from "./condition-group-def.js";
9
9
  export { toExpression, toPresentationString } from "./helpers.js";
10
- export { Coordinator } from "./enums.js";
10
+ export { ConditionType, Coordinator } from "./enums.js";
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getExpression","getOperatorConfig","getOperatorNames","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","timeUnits","dateUnits","dateTimeUnits","ConditionValue","DateDirections","RelativeTimeValue","conditionValueFrom","ConditionField","Condition","ConditionRef","ConditionGroup","ConditionsModel","ConditionGroupDef","toExpression","toPresentationString","Coordinator"],"sources":["../../../src/conditions/index.ts"],"sourcesContent":["export {\n getExpression,\n getOperatorConfig,\n getOperatorNames,\n absoluteDateOrTimeOperatorNames,\n relativeDateOrTimeOperatorNames\n} from '~/src/conditions/condition-operators.js'\n\nexport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n DateDirections,\n RelativeTimeValue,\n conditionValueFrom\n} from '~/src/conditions/condition-values.js'\n\nexport { ConditionField } from '~/src/conditions/condition-field.js'\nexport { Condition } from '~/src/conditions/condition.js'\nexport { ConditionRef } from '~/src/conditions/condition-ref.js'\nexport { ConditionGroup } from '~/src/conditions/condition-group.js'\nexport { ConditionsModel } from '~/src/conditions/condition-model.js'\nexport { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'\nexport { toExpression, toPresentationString } from '~/src/conditions/helpers.js'\n\nexport { Coordinator } from '~/src/conditions/enums.js'\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,iBAAiB,EACjBC,gBAAgB,EAChBC,+BAA+B,EAC/BC,+BAA+B;AAGjC,SACEC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB;AAGpB,SAASC,cAAc;AACvB,SAASC,SAAS;AAClB,SAASC,YAAY;AACrB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SAASC,YAAY,EAAEC,oBAAoB;AAE3C,SAASC,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["getExpression","getOperatorConfig","getOperatorNames","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","timeUnits","dateUnits","dateTimeUnits","ConditionValue","DateDirections","RelativeTimeValue","conditionValueFrom","ConditionField","Condition","ConditionRef","ConditionGroup","ConditionsModel","ConditionGroupDef","toExpression","toPresentationString","ConditionType","Coordinator"],"sources":["../../../src/conditions/index.ts"],"sourcesContent":["export {\n getExpression,\n getOperatorConfig,\n getOperatorNames,\n absoluteDateOrTimeOperatorNames,\n relativeDateOrTimeOperatorNames\n} from '~/src/conditions/condition-operators.js'\n\nexport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n DateDirections,\n RelativeTimeValue,\n conditionValueFrom\n} from '~/src/conditions/condition-values.js'\n\nexport { ConditionField } from '~/src/conditions/condition-field.js'\nexport { Condition } from '~/src/conditions/condition.js'\nexport { ConditionRef } from '~/src/conditions/condition-ref.js'\nexport { ConditionGroup } from '~/src/conditions/condition-group.js'\nexport { ConditionsModel } from '~/src/conditions/condition-model.js'\nexport { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'\nexport { toExpression, toPresentationString } from '~/src/conditions/helpers.js'\n\nexport { ConditionType, Coordinator } from '~/src/conditions/enums.js'\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,iBAAiB,EACjBC,gBAAgB,EAChBC,+BAA+B,EAC/BC,+BAA+B;AAGjC,SACEC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB;AAGpB,SAASC,cAAc;AACvB,SAASC,SAAS;AAClB,SAASC,YAAY;AACrB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SAASC,YAAY,EAAEC,oBAAoB;AAE3C,SAASC,aAAa,EAAEC,WAAW","ignoreList":[]}
@@ -40,19 +40,20 @@ const conditionSchema = Joi.object().keys({
40
40
  const conditionGroupSchema = Joi.object().keys({
41
41
  conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, Joi.any() /** Should be a joi.link('#conditionGroupSchema') */))
42
42
  });
43
- const conditionsModelSchema = Joi.object().keys({
43
+ const conditionsModelSchema = Joi.alternatives().try(Joi.string(), Joi.object().keys({
44
44
  name: Joi.string().required(),
45
45
  conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, conditionGroupSchema))
46
- });
46
+ }));
47
47
  const conditionsSchema = Joi.object().keys({
48
48
  name: Joi.string().required(),
49
49
  displayName: Joi.string(),
50
- value: Joi.alternatives().try(Joi.string(), conditionsModelSchema).required()
50
+ value: conditionsModelSchema.required()
51
51
  });
52
52
  const localisedString = Joi.alternatives().try(Joi.object({
53
53
  a: Joi.any()
54
54
  }).unknown(), Joi.string().allow(''));
55
55
  export const componentSchema = Joi.object().keys({
56
+ subType: Joi.string().optional(),
56
57
  type: Joi.string().required(),
57
58
  name: Joi.string(),
58
59
  title: localisedString,