@epistola.app/valtimo-plugin 0.0.1

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 (54) hide show
  1. package/dist/fesm2022/epistola.app-valtimo-plugin.mjs +1393 -0
  2. package/dist/fesm2022/epistola.app-valtimo-plugin.mjs.map +1 -0
  3. package/dist/index.d.ts +5 -0
  4. package/dist/lib/assets/epistola-logo.d.ts +1 -0
  5. package/dist/lib/assets/index.d.ts +1 -0
  6. package/dist/lib/components/check-job-status-configuration/check-job-status-configuration.component.d.ts +25 -0
  7. package/dist/lib/components/data-mapping-tree/data-mapping-tree.component.d.ts +33 -0
  8. package/dist/lib/components/download-document-configuration/download-document-configuration.component.d.ts +25 -0
  9. package/dist/lib/components/epistola-configuration/epistola-configuration.component.d.ts +29 -0
  10. package/dist/lib/components/epistola-download/epistola-download.component.d.ts +24 -0
  11. package/dist/lib/components/epistola-download/epistola-download.formio.d.ts +4 -0
  12. package/dist/lib/components/field-tree/field-tree.component.d.ts +75 -0
  13. package/dist/lib/components/generate-document-configuration/generate-document-configuration.component.d.ts +78 -0
  14. package/dist/lib/epistola.module.d.ts +17 -0
  15. package/dist/lib/epistola.specification.d.ts +3 -0
  16. package/dist/lib/models/config.d.ts +49 -0
  17. package/dist/lib/models/index.d.ts +2 -0
  18. package/dist/lib/models/template.d.ts +63 -0
  19. package/dist/lib/services/epistola-plugin.service.d.ts +42 -0
  20. package/dist/lib/services/index.d.ts +1 -0
  21. package/dist/public_api.d.ts +12 -0
  22. package/ng-package.json +17 -0
  23. package/package.json +38 -0
  24. package/src/lib/assets/epistola-logo.ts +4 -0
  25. package/src/lib/assets/index.ts +1 -0
  26. package/src/lib/components/check-job-status-configuration/check-job-status-configuration.component.html +51 -0
  27. package/src/lib/components/check-job-status-configuration/check-job-status-configuration.component.scss +1 -0
  28. package/src/lib/components/check-job-status-configuration/check-job-status-configuration.component.ts +71 -0
  29. package/src/lib/components/data-mapping-tree/data-mapping-tree.component.html +23 -0
  30. package/src/lib/components/data-mapping-tree/data-mapping-tree.component.scss +38 -0
  31. package/src/lib/components/data-mapping-tree/data-mapping-tree.component.ts +124 -0
  32. package/src/lib/components/download-document-configuration/download-document-configuration.component.html +29 -0
  33. package/src/lib/components/download-document-configuration/download-document-configuration.component.scss +1 -0
  34. package/src/lib/components/download-document-configuration/download-document-configuration.component.ts +71 -0
  35. package/src/lib/components/epistola-configuration/epistola-configuration.component.html +74 -0
  36. package/src/lib/components/epistola-configuration/epistola-configuration.component.scss +1 -0
  37. package/src/lib/components/epistola-configuration/epistola-configuration.component.ts +96 -0
  38. package/src/lib/components/epistola-download/epistola-download.component.ts +79 -0
  39. package/src/lib/components/epistola-download/epistola-download.formio.ts +19 -0
  40. package/src/lib/components/field-tree/field-tree.component.html +192 -0
  41. package/src/lib/components/field-tree/field-tree.component.scss +255 -0
  42. package/src/lib/components/field-tree/field-tree.component.ts +321 -0
  43. package/src/lib/components/generate-document-configuration/generate-document-configuration.component.html +182 -0
  44. package/src/lib/components/generate-document-configuration/generate-document-configuration.component.scss +150 -0
  45. package/src/lib/components/generate-document-configuration/generate-document-configuration.component.ts +422 -0
  46. package/src/lib/epistola.module.ts +50 -0
  47. package/src/lib/epistola.specification.ts +208 -0
  48. package/src/lib/models/config.ts +53 -0
  49. package/src/lib/models/index.ts +2 -0
  50. package/src/lib/models/template.ts +70 -0
  51. package/src/lib/services/epistola-plugin.service.ts +82 -0
  52. package/src/lib/services/index.ts +1 -0
  53. package/src/public_api.ts +16 -0
  54. package/tsconfig.lib.json +21 -0
@@ -0,0 +1,182 @@
1
+ <v-form
2
+ (valueChange)="formValueChange($event)"
3
+ *ngIf="{
4
+ disabled: disabled$ | async,
5
+ prefill: prefillConfiguration$ ? (prefillConfiguration$ | async) : null,
6
+ templateOptions: templateOptions$ | async,
7
+ templatesLoading: templatesLoading$ | async,
8
+ variantOptions: variantOptions$ | async,
9
+ variantsLoading: variantsLoading$ | async,
10
+ environmentOptions: environmentOptions$ | async,
11
+ environmentsLoading: environmentsLoading$ | async,
12
+ templateFieldsLoading: templateFieldsLoading$ | async,
13
+ selectedTemplateId: selectedTemplateId$ | async
14
+ } as obs"
15
+ >
16
+ <v-select
17
+ name="templateId"
18
+ [title]="'templateId' | pluginTranslate: pluginId | async"
19
+ [tooltip]="'templateIdTooltip' | pluginTranslate: pluginId | async"
20
+ [margin]="true"
21
+ [items]="obs.templateOptions"
22
+ [defaultSelectionId]="obs.prefill?.templateId"
23
+ [disabled]="obs.disabled || obs.templatesLoading"
24
+ [required]="true"
25
+ [loading]="obs.templatesLoading"
26
+ >
27
+ </v-select>
28
+
29
+ <!-- Variant selection mode toggle -->
30
+ <div class="variant-mode-toggle" *ngIf="obs.selectedTemplateId">
31
+ <label class="variant-mode-label">{{ 'variantSelectionMode' | pluginTranslate: pluginId | async }}</label>
32
+ <div class="variant-mode-buttons">
33
+ <button
34
+ type="button"
35
+ class="variant-mode-btn"
36
+ [class.active]="variantSelectionMode === 'explicit'"
37
+ (click)="onVariantSelectionModeChange('explicit')"
38
+ [disabled]="obs.disabled"
39
+ >{{ 'selectByVariant' | pluginTranslate: pluginId | async }}</button>
40
+ <button
41
+ type="button"
42
+ class="variant-mode-btn"
43
+ [class.active]="variantSelectionMode === 'attributes'"
44
+ (click)="onVariantSelectionModeChange('attributes')"
45
+ [disabled]="obs.disabled"
46
+ >{{ 'selectByAttributes' | pluginTranslate: pluginId | async }}</button>
47
+ </div>
48
+ </div>
49
+
50
+ <!-- Explicit variant selection (dropdown) -->
51
+ <v-select
52
+ *ngIf="variantSelectionMode === 'explicit'"
53
+ name="variantId"
54
+ [title]="'variantId' | pluginTranslate: pluginId | async"
55
+ [tooltip]="'variantIdTooltip' | pluginTranslate: pluginId | async"
56
+ [margin]="true"
57
+ [items]="obs.variantOptions"
58
+ [defaultSelectionId]="obs.prefill?.variantId"
59
+ [disabled]="obs.disabled || obs.variantsLoading || !obs.selectedTemplateId"
60
+ [required]="false"
61
+ [loading]="obs.variantsLoading"
62
+ >
63
+ </v-select>
64
+
65
+ <!-- Attribute-based variant selection -->
66
+ <div *ngIf="variantSelectionMode === 'attributes' && obs.selectedTemplateId" class="variant-attributes-section">
67
+ <label class="variant-attributes-label">{{ 'variantAttributes' | pluginTranslate: pluginId | async }}</label>
68
+ <div class="variant-attributes-list">
69
+ <div *ngFor="let entry of variantAttributeEntries; let i = index" class="variant-attribute-row">
70
+ <input
71
+ type="text"
72
+ class="variant-attribute-input"
73
+ [placeholder]="'attributeKey' | pluginTranslate: pluginId | async"
74
+ [(ngModel)]="entry.key"
75
+ (ngModelChange)="onAttributeEntryChange()"
76
+ [disabled]="obs.disabled"
77
+ />
78
+ <input
79
+ type="text"
80
+ class="variant-attribute-input"
81
+ [placeholder]="'attributeValue' | pluginTranslate: pluginId | async"
82
+ [(ngModel)]="entry.value"
83
+ (ngModelChange)="onAttributeEntryChange()"
84
+ [disabled]="obs.disabled"
85
+ />
86
+ <button
87
+ type="button"
88
+ class="variant-attribute-remove-btn"
89
+ (click)="removeAttributeEntry(i)"
90
+ [disabled]="obs.disabled"
91
+ title="{{ 'removeAttribute' | pluginTranslate: pluginId | async }}"
92
+ >&times;</button>
93
+ </div>
94
+ </div>
95
+ <button
96
+ type="button"
97
+ class="variant-attribute-add-btn"
98
+ (click)="addAttributeEntry()"
99
+ [disabled]="obs.disabled"
100
+ >+ {{ 'addAttribute' | pluginTranslate: pluginId | async }}</button>
101
+ </div>
102
+
103
+ <v-select
104
+ name="environmentId"
105
+ [title]="'environmentId' | pluginTranslate: pluginId | async"
106
+ [tooltip]="'environmentIdTooltip' | pluginTranslate: pluginId | async"
107
+ [margin]="true"
108
+ [items]="obs.environmentOptions"
109
+ [defaultSelectionId]="obs.prefill?.environmentId"
110
+ [disabled]="obs.disabled || obs.environmentsLoading"
111
+ [required]="false"
112
+ [loading]="obs.environmentsLoading"
113
+ >
114
+ </v-select>
115
+
116
+ <v-select
117
+ name="outputFormat"
118
+ [title]="'outputFormat' | pluginTranslate: pluginId | async"
119
+ [tooltip]="'outputFormatTooltip' | pluginTranslate: pluginId | async"
120
+ [margin]="true"
121
+ [items]="outputFormatOptions"
122
+ [defaultSelectionId]="obs.prefill?.outputFormat || 'PDF'"
123
+ [disabled]="obs.disabled"
124
+ [required]="true"
125
+ >
126
+ </v-select>
127
+
128
+ <v-input
129
+ name="filename"
130
+ [title]="'filename' | pluginTranslate: pluginId | async"
131
+ [tooltip]="'filenameTooltip' | pluginTranslate: pluginId | async"
132
+ [margin]="true"
133
+ [defaultValue]="obs.prefill?.filename"
134
+ [disabled]="obs.disabled"
135
+ [required]="true"
136
+ >
137
+ </v-input>
138
+
139
+ <v-input
140
+ name="correlationId"
141
+ [title]="'correlationId' | pluginTranslate: pluginId | async"
142
+ [tooltip]="'correlationIdTooltip' | pluginTranslate: pluginId | async"
143
+ [margin]="true"
144
+ [defaultValue]="obs.prefill?.correlationId"
145
+ [disabled]="obs.disabled"
146
+ [required]="false"
147
+ >
148
+ </v-input>
149
+
150
+ <v-input
151
+ name="resultProcessVariable"
152
+ [title]="'resultProcessVariable' | pluginTranslate: pluginId | async"
153
+ [tooltip]="'resultProcessVariableTooltip' | pluginTranslate: pluginId | async"
154
+ [margin]="true"
155
+ [defaultValue]="obs.prefill?.resultProcessVariable"
156
+ [disabled]="obs.disabled"
157
+ [required]="true"
158
+ >
159
+ </v-input>
160
+ </v-form>
161
+
162
+ <epistola-data-mapping-tree
163
+ *ngIf="(selectedTemplateId$ | async)"
164
+ [pluginId]="pluginId"
165
+ [templateFields$]="templateFields$"
166
+ [disabled$]="disabled$"
167
+ [prefillMapping$]="prefillDataMapping$"
168
+ [caseDefinitionKey]="caseDefinitionKey"
169
+ [processVariables]="processVariables"
170
+ (mappingChange)="onDataMappingChange($event)"
171
+ (requiredFieldsStatus)="onRequiredFieldsStatusChange($event)"
172
+ ></epistola-data-mapping-tree>
173
+
174
+ <div class="validation-summary" *ngIf="(selectedTemplateId$ | async) && requiredFieldsStatus.total > 0">
175
+ <span *ngIf="requiredFieldsStatus.mapped === requiredFieldsStatus.total" class="validation-complete">
176
+ {{ 'requiredFieldsComplete' | pluginTranslate: pluginId | async }}
177
+ </span>
178
+ <span *ngIf="requiredFieldsStatus.mapped < requiredFieldsStatus.total" class="validation-incomplete">
179
+ {{ requiredFieldsStatus.mapped }} / {{ requiredFieldsStatus.total }}
180
+ {{ 'validationSummary' | pluginTranslate: pluginId | async }}
181
+ </span>
182
+ </div>
@@ -0,0 +1,150 @@
1
+ .validation-summary {
2
+ margin-top: 0.5rem;
3
+ padding: 0.5rem 0.75rem;
4
+ border-radius: 4px;
5
+ font-size: 0.875rem;
6
+
7
+ .validation-complete {
8
+ color: #198754;
9
+ }
10
+
11
+ .validation-incomplete {
12
+ color: #dc3545;
13
+ font-weight: 500;
14
+ }
15
+ }
16
+
17
+ .variant-mode-toggle {
18
+ margin-bottom: 1rem;
19
+ padding: 0 0.75rem;
20
+ }
21
+
22
+ .variant-mode-label {
23
+ display: block;
24
+ font-size: 0.875rem;
25
+ font-weight: 500;
26
+ margin-bottom: 0.375rem;
27
+ }
28
+
29
+ .variant-mode-buttons {
30
+ display: flex;
31
+ gap: 0;
32
+ border: 1px solid #d1d5db;
33
+ border-radius: 4px;
34
+ overflow: hidden;
35
+ width: fit-content;
36
+ }
37
+
38
+ .variant-mode-btn {
39
+ padding: 0.375rem 0.75rem;
40
+ font-size: 0.8125rem;
41
+ background: #fff;
42
+ border: none;
43
+ border-right: 1px solid #d1d5db;
44
+ cursor: pointer;
45
+ color: #374151;
46
+ transition: background-color 0.15s, color 0.15s;
47
+
48
+ &:last-child {
49
+ border-right: none;
50
+ }
51
+
52
+ &:hover:not([disabled]) {
53
+ background: #f3f4f6;
54
+ }
55
+
56
+ &.active {
57
+ background: #2563eb;
58
+ color: #fff;
59
+ }
60
+
61
+ &[disabled] {
62
+ opacity: 0.5;
63
+ cursor: not-allowed;
64
+ }
65
+ }
66
+
67
+ .variant-attributes-section {
68
+ margin-bottom: 1rem;
69
+ padding: 0 0.75rem;
70
+ }
71
+
72
+ .variant-attributes-label {
73
+ display: block;
74
+ font-size: 0.875rem;
75
+ font-weight: 500;
76
+ margin-bottom: 0.375rem;
77
+ }
78
+
79
+ .variant-attributes-list {
80
+ display: flex;
81
+ flex-direction: column;
82
+ gap: 0.375rem;
83
+ }
84
+
85
+ .variant-attribute-row {
86
+ display: flex;
87
+ gap: 0.375rem;
88
+ align-items: center;
89
+ }
90
+
91
+ .variant-attribute-input {
92
+ flex: 1;
93
+ padding: 0.375rem 0.5rem;
94
+ font-size: 0.8125rem;
95
+ border: 1px solid #d1d5db;
96
+ border-radius: 4px;
97
+ outline: none;
98
+
99
+ &:focus {
100
+ border-color: #2563eb;
101
+ box-shadow: 0 0 0 1px #2563eb;
102
+ }
103
+
104
+ &[disabled] {
105
+ opacity: 0.5;
106
+ background: #f9fafb;
107
+ }
108
+ }
109
+
110
+ .variant-attribute-remove-btn {
111
+ padding: 0.25rem 0.5rem;
112
+ font-size: 1rem;
113
+ line-height: 1;
114
+ background: none;
115
+ border: 1px solid #d1d5db;
116
+ border-radius: 4px;
117
+ cursor: pointer;
118
+ color: #6b7280;
119
+
120
+ &:hover:not([disabled]) {
121
+ color: #dc3545;
122
+ border-color: #dc3545;
123
+ }
124
+
125
+ &[disabled] {
126
+ opacity: 0.5;
127
+ cursor: not-allowed;
128
+ }
129
+ }
130
+
131
+ .variant-attribute-add-btn {
132
+ margin-top: 0.375rem;
133
+ padding: 0.25rem 0.5rem;
134
+ font-size: 0.8125rem;
135
+ background: none;
136
+ border: 1px dashed #d1d5db;
137
+ border-radius: 4px;
138
+ cursor: pointer;
139
+ color: #6b7280;
140
+
141
+ &:hover:not([disabled]) {
142
+ color: #2563eb;
143
+ border-color: #2563eb;
144
+ }
145
+
146
+ &[disabled] {
147
+ opacity: 0.5;
148
+ cursor: not-allowed;
149
+ }
150
+ }